labyrinth
diff src/gles/sanegl.h @ 3:45b91185b298
android port
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 01 May 2015 04:36:50 +0300 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/gles/sanegl.h Fri May 01 04:36:50 2015 +0300 1.3 @@ -0,0 +1,96 @@ 1.4 +/* 1.5 +SaneGL - a small library to bring back sanity to OpenGL ES 2.x 1.6 +Copyright (C) 2011-2013 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_POINTS 1.28 +#define GL_POINTS 0 1.29 +#endif 1.30 +#ifndef GL_LINES 1.31 +#define GL_LINES 1 1.32 +#endif 1.33 +#ifndef GL_TRIANGLES 1.34 +#define GL_TRIANGLES 4 1.35 +#endif 1.36 +#ifndef GL_QUADS 1.37 +#define GL_QUADS 7 1.38 +#endif 1.39 + 1.40 +/* glGet stuff */ 1.41 +#ifndef GL_VIEWPORT 1.42 +#define GL_VIEWPORT 0x0BA2 1.43 +#endif 1.44 +#ifndef GL_MODELVIEW_MATRIX 1.45 +#define GL_MODELVIEW_MATRIX 0x0BA6 1.46 +#endif 1.47 +#ifndef GL_PROJECTION_MATRIX 1.48 +#define GL_PROJECTION_MATRIX 0x0BA7 1.49 +#endif 1.50 + 1.51 +#ifdef GLDEF 1.52 + 1.53 +#define glBegin gl_begin 1.54 +#define glEnd gl_end 1.55 +#define glVertex2f gl_vertex2f 1.56 +#define glVertex3f gl_vertex3f 1.57 +#define glVertex4f gl_vertex4f 1.58 +#define glNormal3f gl_normal3f 1.59 +#define glColor3f gl_color3f 1.60 +#define glColor4f gl_color4f 1.61 +#define glTexCoord1f gl_texcoord1f 1.62 +#define glTexCoord2f gl_texcoord2f 1.63 +#define glVertexAttrib2f gl_vertex_attrib2f 1.64 +#define glVertexAttrib3f gl_vertex_attrib3f 1.65 +#define glVertexAttrib4f gl_vertex_attrib4f 1.66 + 1.67 +#define gluPerspective glu_perspective 1.68 + 1.69 +#endif /* GLDEF */ 1.70 + 1.71 +#ifdef __cplusplus 1.72 +extern "C" { 1.73 +#endif 1.74 + 1.75 +/* immediate mode rendering */ 1.76 +void gl_begin(int prim); 1.77 +void gl_end(void); 1.78 + 1.79 +void gl_vertex2f(float x, float y); 1.80 +void gl_vertex3f(float x, float y, float z); 1.81 +void gl_vertex4f(float x, float y, float z, float w); 1.82 + 1.83 +void gl_normal3f(float x, float y, float z); 1.84 + 1.85 +void gl_color3f(float r, float g, float b); 1.86 +void gl_color4f(float r, float g, float b, float a); 1.87 + 1.88 +void gl_texcoord1f(float s); 1.89 +void gl_texcoord2f(float s, float t); 1.90 + 1.91 +/* GLU */ 1.92 + 1.93 +void glu_perspective(float fov, float aspect, float nearz, float farz); 1.94 + 1.95 +#ifdef __cplusplus 1.96 +} 1.97 +#endif 1.98 + 1.99 +#endif /* SANEGL_H_ */