dbf-udg

diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/post.cc	Wed Feb 20 04:55:03 2013 +0200
     1.3 @@ -0,0 +1,30 @@
     1.4 +#include "opengl.h"
     1.5 +#include "post.h"
     1.6 +
     1.7 +void overlay(float r, float g, float b, float a)
     1.8 +{
     1.9 +	glPushAttrib(GL_ENABLE_BIT);
    1.10 +	glDisable(GL_DEPTH_TEST);
    1.11 +	glDisable(GL_LIGHTING);
    1.12 +
    1.13 +	glMatrixMode(GL_MODELVIEW);
    1.14 +	glPushMatrix();
    1.15 +	glLoadIdentity();
    1.16 +	glMatrixMode(GL_PROJECTION);
    1.17 +	glPushMatrix();
    1.18 +	glLoadIdentity();
    1.19 +
    1.20 +	glBegin(GL_QUADS);
    1.21 +	glColor4f(r, g, b, a);
    1.22 +	glTexCoord2f(0, 0); glVertex2f(-1, -1);
    1.23 +	glTexCoord2f(1, 0); glVertex2f(1, -1);
    1.24 +	glTexCoord2f(1, 1); glVertex2f(1, 1);
    1.25 +	glTexCoord2f(0, 1); glVertex2f(-1, 1);
    1.26 +	glEnd();
    1.27 +
    1.28 +	glPopMatrix();
    1.29 +	glMatrixMode(GL_MODELVIEW);
    1.30 +	glPopMatrix();
    1.31 +
    1.32 +	glPopAttrib();
    1.33 +}