dbf-udg
view src/post.cc @ 15:2d1a9b5111f9
added visual studio project
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 20 Feb 2013 06:03:31 +0200 |
parents | 1abbed71e9c9 |
children |
line source
1 /*
2 Printblobs - halftoning display hack
3 Copyright (C) 2013 John Tsiombikas <nuclear@member.fsf.org>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #include "opengl.h"
19 #include "post.h"
21 void overlay(float r, float g, float b, float a)
22 {
23 glPushAttrib(GL_ENABLE_BIT);
24 glDisable(GL_DEPTH_TEST);
25 glDisable(GL_LIGHTING);
27 glMatrixMode(GL_MODELVIEW);
28 glPushMatrix();
29 glLoadIdentity();
30 glMatrixMode(GL_PROJECTION);
31 glPushMatrix();
32 glLoadIdentity();
34 glBegin(GL_QUADS);
35 glColor4f(r, g, b, a);
36 glTexCoord2f(0, 0); glVertex2f(-1, -1);
37 glTexCoord2f(1, 0); glVertex2f(1, -1);
38 glTexCoord2f(1, 1); glVertex2f(1, 1);
39 glTexCoord2f(0, 1); glVertex2f(-1, 1);
40 glEnd();
42 glPopMatrix();
43 glMatrixMode(GL_MODELVIEW);
44 glPopMatrix();
46 glPopAttrib();
47 }