istereo2
view src/sanegl.h @ 4:d4fed8aac9a6
fixed all sideways crap in the effect code
fixed fov on all orientations
fixed inverted tangent vector in bump mapped version
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 21 Sep 2015 21:12:36 +0300 |
parents | |
children | 3bccfc7d10fe |
line source
1 /*
2 SaneGL - a small library to bring back sanity to OpenGL ES 2.x
3 Copyright (C) 2011 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 */
19 #ifndef SANEGL_H_
20 #define SANEGL_H_
22 #include "opengl.h"
24 #ifndef GL_MODELVIEW
25 #define GL_MODELVIEW 0x1700
26 #endif
27 #ifndef GL_PROJECTION
28 #define GL_PROJECTION 0x1701
29 #endif
30 #ifndef GL_TEXTURE
31 #define GL_TEXTURE 0x1702
32 #endif
34 #ifndef GL_POINTS
35 #define GL_POINTS 0
36 #endif
37 #ifndef GL_LINES
38 #define GL_LINES 1
39 #endif
40 #ifndef GL_TRIANGLES
41 #define GL_TRIANGLES 4
42 #endif
43 #ifndef GL_QUADS
44 #define GL_QUADS 7
45 #endif
47 #ifdef GLDEF
49 #define glMatrixMode gl_matrix_mode
50 #define glPushMatrix gl_push_matrix
51 #define glPopMatrix gl_pop_matrix
52 #define glLoadIdentity gl_load_identity
53 #define glLoadMatrixf gl_load_matrixf
54 #define glMultMatrixf gl_mult_matrixf
55 #define glTranslatef gl_translatef
56 #define glRotatef gl_rotatef
57 #define glScalef gl_scalef
58 #define glOrtho gl_ortho
59 #define glFrustum gl_frustum
60 #define gluPerspective glu_perspective
62 #define glBegin gl_begin
63 #define glEnd gl_end
64 #define glVertex2f gl_vertex2f
65 #define glVertex3f gl_vertex3f
66 #define glVertex4f gl_vertex4f
67 #define glNormal3f gl_normal3f
68 #define glColor3f gl_color3f
69 #define glColor4f gl_color4f
70 #define glTexCoord1f gl_texcoord1f
71 #define glTexCoord2f gl_texcoord2f
72 #define glVertexAttrib2f gl_vertex_attrib2f
73 #define glVertexAttrib3f gl_vertex_attrib3f
74 #define glVertexAttrib4f gl_vertex_attrib4f
75 #endif
77 /* matrix stuff */
78 void gl_matrix_mode(int mmode);
79 void gl_push_matrix(void);
80 void gl_pop_matrix(void);
81 void gl_load_identity(void);
82 void gl_load_matrixf(const float *mat);
83 void gl_mult_matrixf(const float *mat);
84 void gl_translatef(float x, float y, float z);
85 void gl_rotatef(float angle, float x, float y, float z);
86 void gl_scalef(float x, float y, float z);
87 void gl_ortho(float left, float right, float bottom, float top, float near, float far);
88 void gl_frustum(float left, float right, float bottom, float top, float near, float far);
89 void glu_perspective(float vfov, float aspect, float near, float far);
91 void gl_apply_xform(unsigned int prog);
94 /* immediate mode rendering */
95 void gl_begin(int prim);
96 void gl_end(void);
98 void gl_vertex2f(float x, float y);
99 void gl_vertex3f(float x, float y, float z);
100 void gl_vertex4f(float x, float y, float z, float w);
102 void gl_normal3f(float x, float y, float z);
104 void gl_color3f(float r, float g, float b);
105 void gl_color4f(float r, float g, float b, float a);
107 void gl_texcoord1f(float s);
108 void gl_texcoord2f(float s, float t);
110 void gl_vertex_attrib2f(int loc, float x, float y);
111 void gl_vertex_attrib3f(int loc, float x, float y, float z);
112 void gl_vertex_attrib4f(int loc, float x, float y, float z, float w);
114 #endif /* SANEGL_H_ */