void postfilter glMatrixMode GL_PROJECTION glLoadIdentity gluOrtho2D 6

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
void postfilter(){
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0, 600, 0, 600);
glClearColor(1.0, 1.0, 1.0, 0.0);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_ACCUM_BUFFER_BIT);
//center
glRasterPos2i(100,100);
glDrawPixels(200,200,GL_RGB,GL_FLOAT,buffer);
glAccum(GL_ACCUM, 0.25);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
//left
glRasterPos2i(99,100);
glDrawPixels(200,200,GL_RGB,GL_FLOAT,buffer);
glAccum(GL_ACCUM, 0.125);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
//rigth
glRasterPos2i(101,100);
glDrawPixels(200,200,GL_RGB,GL_FLOAT,buffer);
glAccum(GL_ACCUM, 0.125);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
//top
glRasterPos2i(100,101);
glDrawPixels(200,200,GL_RGB,GL_FLOAT,buffer);
glAccum(GL_ACCUM, 0.125);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
//bottom
glRasterPos2i(100,99);
glDrawPixels(200,200,GL_RGB,GL_FLOAT,buffer);
glAccum(GL_ACCUM, 0.125);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
//rigth + top
glRasterPos2i(101,101);
glDrawPixels(200,200,GL_RGB,GL_FLOAT,buffer);
glAccum(GL_ACCUM, 0.0625);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
//rigth + bottom
glRasterPos2i(101,99);
glDrawPixels(200,200,GL_RGB,GL_FLOAT,buffer);
glAccum(GL_ACCUM, 0.0625);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
//left + bottom
glRasterPos2i(99,99);
glDrawPixels(200,200,GL_RGB,GL_FLOAT,buffer);
glAccum(GL_ACCUM, 0.0625);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
//left + top
glRasterPos2i(99,101);
glDrawPixels(200,200,GL_RGB,GL_FLOAT,buffer);
glAccum(GL_ACCUM, 0.0625);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glAccum(GL_RETURN, 1.0);
}