fix build
[gltest.git] / glutil_gl1.cpp
1 /* gltest - small OpenGL tearing test program
2  * Copyright (C) 2012-2013 Ralf Jung <post@ralfj.de>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18
19 #include "glutil.h"
20
21 #if !defined(CON_GL1)
22 #error "Only GL1 contexts support GL1 functionality"
23 #endif
24
25 void resolveFunctionPointers(T_glGetProcAddress)
26 {
27         // nothing to do
28 }
29
30 // initialisation
31 void initialise2dProjection()
32 {
33         glMatrixMode(GL_PROJECTION);
34         glLoadIdentity();
35         glOrtho (0, 1, 1, 0, 0, 1);
36         glMatrixMode(GL_MODELVIEW);
37 }
38
39 // draw a quad
40 void drawQuad(GLfloat red, GLfloat green, GLfloat blue, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
41 {
42         glBegin(GL_QUADS);
43         glColor3f(red, green, blue);
44         glVertex2f(x1, y1);
45         glVertex2f(x2, y1);
46         glVertex2f(x2, y2);
47         glVertex2f(x1, y2);
48         glEnd();
49 }