3dphotoshoot
diff src/sanegl.h @ 11:ad49e1f9b627
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 31 May 2015 06:02:08 +0300 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/sanegl.h Sun May 31 06:02:08 2015 +0300 1.3 @@ -0,0 +1,154 @@ 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_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 +/* glGet stuff */ 1.51 +#ifndef GL_VIEWPORT 1.52 +#define GL_VIEWPORT 0x0BA2 1.53 +#endif 1.54 +#ifndef GL_MODELVIEW_MATRIX 1.55 +#define GL_MODELVIEW_MATRIX 0x0BA6 1.56 +#endif 1.57 +#ifndef GL_PROJECTION_MATRIX 1.58 +#define GL_PROJECTION_MATRIX 0x0BA7 1.59 +#endif 1.60 + 1.61 +#ifdef GLDEF 1.62 + 1.63 +#define glEnable gl_enable 1.64 +#define glDisable gl_disable 1.65 + 1.66 +#define glMatrixMode gl_matrix_mode 1.67 +#define glPushMatrix gl_push_matrix 1.68 +#define glPopMatrix gl_pop_matrix 1.69 +#define glLoadIdentity gl_load_identity 1.70 +#define glLoadMatrixf gl_load_matrixf 1.71 +#define glLoadMatrixd gl_load_matrixd 1.72 +#define glMultMatrixf gl_mult_matrixf 1.73 +#define glMultMatrixd gl_mult_matrixd 1.74 +#define glTranslatef gl_translatef 1.75 +#define glRotatef gl_rotatef 1.76 +#define glScalef gl_scalef 1.77 +#define glOrtho gl_ortho 1.78 +#define glFrustum gl_frustum 1.79 +#define gluPerspective glu_perspective 1.80 +#define gluUnProject glu_un_project 1.81 + 1.82 +#define glBegin gl_begin 1.83 +#define glEnd gl_end 1.84 +#define glVertex2f gl_vertex2f 1.85 +#define glVertex3f gl_vertex3f 1.86 +#define glVertex4f gl_vertex4f 1.87 +#define glNormal3f gl_normal3f 1.88 +#define glColor3f gl_color3f 1.89 +#define glColor4f gl_color4f 1.90 +#define glTexCoord1f gl_texcoord1f 1.91 +#define glTexCoord2f gl_texcoord2f 1.92 +#define glVertexAttrib2f gl_vertex_attrib2f 1.93 +#define glVertexAttrib3f gl_vertex_attrib3f 1.94 +#define glVertexAttrib4f gl_vertex_attrib4f 1.95 + 1.96 +#define glGetFloatv gl_get_floatv 1.97 +#define glGetDoublev gl_get_doublev 1.98 +#endif 1.99 + 1.100 +#ifdef __cplusplus 1.101 +extern "C" { 1.102 +#endif 1.103 + 1.104 +void gl_enable(int state); 1.105 +void gl_disable(int state); 1.106 + 1.107 +/* matrix stuff */ 1.108 +void gl_matrix_mode(int mmode); 1.109 +void gl_push_matrix(void); 1.110 +void gl_pop_matrix(void); 1.111 +void gl_load_identity(void); 1.112 +void gl_load_matrixf(const float *mat); 1.113 +void gl_load_matrixd(const double *mat); 1.114 +void gl_mult_matrixf(const float *mat); 1.115 +void gl_mult_matrixd(const double *mat); 1.116 +void gl_translatef(float x, float y, float z); 1.117 +void gl_rotatef(float angle, float x, float y, float z); 1.118 +void gl_scalef(float x, float y, float z); 1.119 +void gl_ortho(float left, float right, float bottom, float top, float near, float far); 1.120 +void gl_frustum(float left, float right, float bottom, float top, float near, float far); 1.121 +void glu_perspective(float vfov, float aspect, float near, float far); 1.122 +int glu_un_project(double winx, double winy, double winz, 1.123 + const double *model, const double *proj, const int *viewp, 1.124 + double *objx, double *objy, double *objz); 1.125 + 1.126 +void gl_apply_xform(unsigned int prog); 1.127 + 1.128 + 1.129 +/* immediate mode rendering */ 1.130 +void gl_begin(int prim); 1.131 +void gl_end(void); 1.132 + 1.133 +void gl_vertex2f(float x, float y); 1.134 +void gl_vertex3f(float x, float y, float z); 1.135 +void gl_vertex4f(float x, float y, float z, float w); 1.136 + 1.137 +void gl_normal3f(float x, float y, float z); 1.138 + 1.139 +void gl_color3f(float r, float g, float b); 1.140 +void gl_color4f(float r, float g, float b, float a); 1.141 + 1.142 +void gl_texcoord1f(float s); 1.143 +void gl_texcoord2f(float s, float t); 1.144 + 1.145 +void gl_vertex_attrib2f(int loc, float x, float y); 1.146 +void gl_vertex_attrib3f(int loc, float x, float y, float z); 1.147 +void gl_vertex_attrib4f(int loc, float x, float y, float z, float w); 1.148 + 1.149 +/* state retrieval */ 1.150 +void gl_get_floatv(int what, float *res); 1.151 +void gl_get_doublev(int what, double *res); 1.152 + 1.153 +#ifdef __cplusplus 1.154 +} 1.155 +#endif 1.156 + 1.157 +#endif /* SANEGL_H_ */