istereo

diff src/sanegl.h @ 1:4d25539806d2

bollocks
author John Tsiombikas <nuclear@mutantstargoat.com>
date Tue, 06 Sep 2011 12:48:39 +0300
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/sanegl.h	Tue Sep 06 12:48:39 2011 +0300
     1.3 @@ -0,0 +1,114 @@
     1.4 +/*
     1.5 +SaneGL - a small library to bring back sanity to OpenGL ES 2.x
     1.6 +Copyright (C) 2011  John Tsiombikas <nuclear@member.fsf.org>
     1.7 +
     1.8 +This program is free software: you can redistribute it and/or modify
     1.9 +it under the terms of the GNU General Public License as published by
    1.10 +the Free Software Foundation, either version 3 of the License, or
    1.11 +(at your option) any later version.
    1.12 +
    1.13 +This program is distributed in the hope that it will be useful,
    1.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.16 +GNU General Public License for more details.
    1.17 +
    1.18 +You should have received a copy of the GNU General Public License
    1.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1.20 +*/
    1.21 +
    1.22 +#ifndef SANEGL_H_
    1.23 +#define SANEGL_H_
    1.24 +
    1.25 +#include "opengl.h"
    1.26 +
    1.27 +#ifndef GL_MODELVIEW
    1.28 +#define GL_MODELVIEW		0x1700
    1.29 +#endif
    1.30 +#ifndef GL_PROJECTION
    1.31 +#define GL_PROJECTION		0x1701
    1.32 +#endif
    1.33 +#ifndef GL_TEXTURE
    1.34 +#define GL_TEXTURE			0x1702
    1.35 +#endif
    1.36 +
    1.37 +#ifndef GL_POINTS
    1.38 +#define GL_POINTS			0
    1.39 +#endif
    1.40 +#ifndef GL_LINES
    1.41 +#define GL_LINES			1
    1.42 +#endif
    1.43 +#ifndef GL_TRIANGLES
    1.44 +#define GL_TRIANGLES		4
    1.45 +#endif
    1.46 +#ifndef GL_QUADS
    1.47 +#define GL_QUADS			7
    1.48 +#endif
    1.49 +
    1.50 +#ifdef GLDEF
    1.51 +
    1.52 +#define glMatrixMode		gl_matrix_mode
    1.53 +#define glPushMatrix		gl_push_matrix
    1.54 +#define glPopMatrix			gl_pop_matrix
    1.55 +#define glLoadIdentity		gl_load_identity
    1.56 +#define glLoadMatrixf		gl_load_matrixf
    1.57 +#define glMultMatrixf		gl_mult_matrixf
    1.58 +#define glTranslatef		gl_translatef
    1.59 +#define glRotatef			gl_rotatef
    1.60 +#define glScalef			gl_scalef
    1.61 +#define glOrtho				gl_ortho
    1.62 +#define glFrustum			gl_frustum
    1.63 +#define gluPerspective		glu_perspective
    1.64 +
    1.65 +#define glBegin				gl_begin
    1.66 +#define glEnd				gl_end
    1.67 +#define glVertex2f			gl_vertex2f
    1.68 +#define glVertex3f			gl_vertex3f
    1.69 +#define glVertex4f			gl_vertex4f
    1.70 +#define glNormal3f			gl_normal3f
    1.71 +#define glColor3f			gl_color3f
    1.72 +#define glColor4f			gl_color4f
    1.73 +#define glTexCoord1f		gl_texcoord1f
    1.74 +#define glTexCoord2f		gl_texcoord2f
    1.75 +#define glVertexAttrib2f	gl_vertex_attrib2f
    1.76 +#define glVertexAttrib3f	gl_vertex_attrib3f
    1.77 +#define glVertexAttrib4f	gl_vertex_attrib4f
    1.78 +#endif
    1.79 +
    1.80 +/* matrix stuff */
    1.81 +void gl_matrix_mode(int mmode);
    1.82 +void gl_push_matrix(void);
    1.83 +void gl_pop_matrix(void);
    1.84 +void gl_load_identity(void);
    1.85 +void gl_load_matrixf(const float *mat);
    1.86 +void gl_mult_matrixf(const float *mat);
    1.87 +void gl_translatef(float x, float y, float z);
    1.88 +void gl_rotatef(float angle, float x, float y, float z);
    1.89 +void gl_scalef(float x, float y, float z);
    1.90 +void gl_ortho(float left, float right, float bottom, float top, float near, float far);
    1.91 +void gl_frustum(float left, float right, float bottom, float top, float near, float far);
    1.92 +void glu_perspective(float vfov, float aspect, float near, float far);
    1.93 +
    1.94 +void gl_apply_xform(unsigned int prog);
    1.95 +
    1.96 +
    1.97 +/* immediate mode rendering */
    1.98 +void gl_begin(int prim);
    1.99 +void gl_end(void);
   1.100 +
   1.101 +void gl_vertex2f(float x, float y);
   1.102 +void gl_vertex3f(float x, float y, float z);
   1.103 +void gl_vertex4f(float x, float y, float z, float w);
   1.104 +
   1.105 +void gl_normal3f(float x, float y, float z);
   1.106 +
   1.107 +void gl_color3f(float r, float g, float b);
   1.108 +void gl_color4f(float r, float g, float b, float a);
   1.109 +
   1.110 +void gl_texcoord1f(float s);
   1.111 +void gl_texcoord2f(float s, float t);
   1.112 +
   1.113 +void gl_vertex_attrib2f(int loc, float x, float y);
   1.114 +void gl_vertex_attrib3f(int loc, float x, float y, float z);
   1.115 +void gl_vertex_attrib4f(int loc, float x, float y, float z, float w);
   1.116 +
   1.117 +#endif	/* SANEGL_H_ */