dbf-udg
annotate 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 |
rev | line source |
---|---|
nuclear@11 | 1 #include "opengl.h" |
nuclear@11 | 2 #include "post.h" |
nuclear@11 | 3 |
nuclear@11 | 4 void overlay(float r, float g, float b, float a) |
nuclear@11 | 5 { |
nuclear@11 | 6 glPushAttrib(GL_ENABLE_BIT); |
nuclear@11 | 7 glDisable(GL_DEPTH_TEST); |
nuclear@11 | 8 glDisable(GL_LIGHTING); |
nuclear@11 | 9 |
nuclear@11 | 10 glMatrixMode(GL_MODELVIEW); |
nuclear@11 | 11 glPushMatrix(); |
nuclear@11 | 12 glLoadIdentity(); |
nuclear@11 | 13 glMatrixMode(GL_PROJECTION); |
nuclear@11 | 14 glPushMatrix(); |
nuclear@11 | 15 glLoadIdentity(); |
nuclear@11 | 16 |
nuclear@11 | 17 glBegin(GL_QUADS); |
nuclear@11 | 18 glColor4f(r, g, b, a); |
nuclear@11 | 19 glTexCoord2f(0, 0); glVertex2f(-1, -1); |
nuclear@11 | 20 glTexCoord2f(1, 0); glVertex2f(1, -1); |
nuclear@11 | 21 glTexCoord2f(1, 1); glVertex2f(1, 1); |
nuclear@11 | 22 glTexCoord2f(0, 1); glVertex2f(-1, 1); |
nuclear@11 | 23 glEnd(); |
nuclear@11 | 24 |
nuclear@11 | 25 glPopMatrix(); |
nuclear@11 | 26 glMatrixMode(GL_MODELVIEW); |
nuclear@11 | 27 glPopMatrix(); |
nuclear@11 | 28 |
nuclear@11 | 29 glPopAttrib(); |
nuclear@11 | 30 } |