dbf-udg

view src/post.cc @ 11:5f99c4c7a9fe

now it looks pretty much ok
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 20 Feb 2013 04:55:03 +0200
parents
children 1abbed71e9c9
line source
1 #include "opengl.h"
2 #include "post.h"
4 void overlay(float r, float g, float b, float a)
5 {
6 glPushAttrib(GL_ENABLE_BIT);
7 glDisable(GL_DEPTH_TEST);
8 glDisable(GL_LIGHTING);
10 glMatrixMode(GL_MODELVIEW);
11 glPushMatrix();
12 glLoadIdentity();
13 glMatrixMode(GL_PROJECTION);
14 glPushMatrix();
15 glLoadIdentity();
17 glBegin(GL_QUADS);
18 glColor4f(r, g, b, a);
19 glTexCoord2f(0, 0); glVertex2f(-1, -1);
20 glTexCoord2f(1, 0); glVertex2f(1, -1);
21 glTexCoord2f(1, 1); glVertex2f(1, 1);
22 glTexCoord2f(0, 1); glVertex2f(-1, 1);
23 glEnd();
25 glPopMatrix();
26 glMatrixMode(GL_MODELVIEW);
27 glPopMatrix();
29 glPopAttrib();
30 }