istereo

annotate src/sanegl.h @ 21:75a63f9ab7cc

ha!
author John Tsiombikas <nuclear@mutantstargoat.com>
date Wed, 07 Sep 2011 10:49:11 +0300
parents
children
rev   line source
nuclear@1 1 /*
nuclear@1 2 SaneGL - a small library to bring back sanity to OpenGL ES 2.x
nuclear@1 3 Copyright (C) 2011 John Tsiombikas <nuclear@member.fsf.org>
nuclear@1 4
nuclear@1 5 This program is free software: you can redistribute it and/or modify
nuclear@1 6 it under the terms of the GNU General Public License as published by
nuclear@1 7 the Free Software Foundation, either version 3 of the License, or
nuclear@1 8 (at your option) any later version.
nuclear@1 9
nuclear@1 10 This program is distributed in the hope that it will be useful,
nuclear@1 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
nuclear@1 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
nuclear@1 13 GNU General Public License for more details.
nuclear@1 14
nuclear@1 15 You should have received a copy of the GNU General Public License
nuclear@1 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
nuclear@1 17 */
nuclear@1 18
nuclear@1 19 #ifndef SANEGL_H_
nuclear@1 20 #define SANEGL_H_
nuclear@1 21
nuclear@1 22 #include "opengl.h"
nuclear@1 23
nuclear@1 24 #ifndef GL_MODELVIEW
nuclear@1 25 #define GL_MODELVIEW 0x1700
nuclear@1 26 #endif
nuclear@1 27 #ifndef GL_PROJECTION
nuclear@1 28 #define GL_PROJECTION 0x1701
nuclear@1 29 #endif
nuclear@1 30 #ifndef GL_TEXTURE
nuclear@1 31 #define GL_TEXTURE 0x1702
nuclear@1 32 #endif
nuclear@1 33
nuclear@1 34 #ifndef GL_POINTS
nuclear@1 35 #define GL_POINTS 0
nuclear@1 36 #endif
nuclear@1 37 #ifndef GL_LINES
nuclear@1 38 #define GL_LINES 1
nuclear@1 39 #endif
nuclear@1 40 #ifndef GL_TRIANGLES
nuclear@1 41 #define GL_TRIANGLES 4
nuclear@1 42 #endif
nuclear@1 43 #ifndef GL_QUADS
nuclear@1 44 #define GL_QUADS 7
nuclear@1 45 #endif
nuclear@1 46
nuclear@1 47 #ifdef GLDEF
nuclear@1 48
nuclear@1 49 #define glMatrixMode gl_matrix_mode
nuclear@1 50 #define glPushMatrix gl_push_matrix
nuclear@1 51 #define glPopMatrix gl_pop_matrix
nuclear@1 52 #define glLoadIdentity gl_load_identity
nuclear@1 53 #define glLoadMatrixf gl_load_matrixf
nuclear@1 54 #define glMultMatrixf gl_mult_matrixf
nuclear@1 55 #define glTranslatef gl_translatef
nuclear@1 56 #define glRotatef gl_rotatef
nuclear@1 57 #define glScalef gl_scalef
nuclear@1 58 #define glOrtho gl_ortho
nuclear@1 59 #define glFrustum gl_frustum
nuclear@1 60 #define gluPerspective glu_perspective
nuclear@1 61
nuclear@1 62 #define glBegin gl_begin
nuclear@1 63 #define glEnd gl_end
nuclear@1 64 #define glVertex2f gl_vertex2f
nuclear@1 65 #define glVertex3f gl_vertex3f
nuclear@1 66 #define glVertex4f gl_vertex4f
nuclear@1 67 #define glNormal3f gl_normal3f
nuclear@1 68 #define glColor3f gl_color3f
nuclear@1 69 #define glColor4f gl_color4f
nuclear@1 70 #define glTexCoord1f gl_texcoord1f
nuclear@1 71 #define glTexCoord2f gl_texcoord2f
nuclear@1 72 #define glVertexAttrib2f gl_vertex_attrib2f
nuclear@1 73 #define glVertexAttrib3f gl_vertex_attrib3f
nuclear@1 74 #define glVertexAttrib4f gl_vertex_attrib4f
nuclear@1 75 #endif
nuclear@1 76
nuclear@1 77 /* matrix stuff */
nuclear@1 78 void gl_matrix_mode(int mmode);
nuclear@1 79 void gl_push_matrix(void);
nuclear@1 80 void gl_pop_matrix(void);
nuclear@1 81 void gl_load_identity(void);
nuclear@1 82 void gl_load_matrixf(const float *mat);
nuclear@1 83 void gl_mult_matrixf(const float *mat);
nuclear@1 84 void gl_translatef(float x, float y, float z);
nuclear@1 85 void gl_rotatef(float angle, float x, float y, float z);
nuclear@1 86 void gl_scalef(float x, float y, float z);
nuclear@1 87 void gl_ortho(float left, float right, float bottom, float top, float near, float far);
nuclear@1 88 void gl_frustum(float left, float right, float bottom, float top, float near, float far);
nuclear@1 89 void glu_perspective(float vfov, float aspect, float near, float far);
nuclear@1 90
nuclear@1 91 void gl_apply_xform(unsigned int prog);
nuclear@1 92
nuclear@1 93
nuclear@1 94 /* immediate mode rendering */
nuclear@1 95 void gl_begin(int prim);
nuclear@1 96 void gl_end(void);
nuclear@1 97
nuclear@1 98 void gl_vertex2f(float x, float y);
nuclear@1 99 void gl_vertex3f(float x, float y, float z);
nuclear@1 100 void gl_vertex4f(float x, float y, float z, float w);
nuclear@1 101
nuclear@1 102 void gl_normal3f(float x, float y, float z);
nuclear@1 103
nuclear@1 104 void gl_color3f(float r, float g, float b);
nuclear@1 105 void gl_color4f(float r, float g, float b, float a);
nuclear@1 106
nuclear@1 107 void gl_texcoord1f(float s);
nuclear@1 108 void gl_texcoord2f(float s, float t);
nuclear@1 109
nuclear@1 110 void gl_vertex_attrib2f(int loc, float x, float y);
nuclear@1 111 void gl_vertex_attrib3f(int loc, float x, float y, float z);
nuclear@1 112 void gl_vertex_attrib4f(int loc, float x, float y, float z, float w);
nuclear@1 113
nuclear@1 114 #endif /* SANEGL_H_ */