3dphotoshoot

annotate src/sanegl.h @ 27:3d082c566b53

fixed all the bugs, pc version works
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 18 Jun 2015 04:32:25 +0300
parents
children
rev   line source
nuclear@11 1 /*
nuclear@11 2 SaneGL - a small library to bring back sanity to OpenGL ES 2.x
nuclear@11 3 Copyright (C) 2011-2013 John Tsiombikas <nuclear@member.fsf.org>
nuclear@11 4
nuclear@11 5 This program is free software: you can redistribute it and/or modify
nuclear@11 6 it under the terms of the GNU General Public License as published by
nuclear@11 7 the Free Software Foundation, either version 3 of the License, or
nuclear@11 8 (at your option) any later version.
nuclear@11 9
nuclear@11 10 This program is distributed in the hope that it will be useful,
nuclear@11 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
nuclear@11 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
nuclear@11 13 GNU General Public License for more details.
nuclear@11 14
nuclear@11 15 You should have received a copy of the GNU General Public License
nuclear@11 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
nuclear@11 17 */
nuclear@11 18
nuclear@11 19 #ifndef SANEGL_H_
nuclear@11 20 #define SANEGL_H_
nuclear@11 21
nuclear@11 22 #include "opengl.h"
nuclear@11 23
nuclear@11 24 #ifndef GL_MODELVIEW
nuclear@11 25 #define GL_MODELVIEW 0x1700
nuclear@11 26 #endif
nuclear@11 27 #ifndef GL_PROJECTION
nuclear@11 28 #define GL_PROJECTION 0x1701
nuclear@11 29 #endif
nuclear@11 30 #ifndef GL_TEXTURE
nuclear@11 31 #define GL_TEXTURE 0x1702
nuclear@11 32 #endif
nuclear@11 33
nuclear@11 34 #ifndef GL_POINTS
nuclear@11 35 #define GL_POINTS 0
nuclear@11 36 #endif
nuclear@11 37 #ifndef GL_LINES
nuclear@11 38 #define GL_LINES 1
nuclear@11 39 #endif
nuclear@11 40 #ifndef GL_TRIANGLES
nuclear@11 41 #define GL_TRIANGLES 4
nuclear@11 42 #endif
nuclear@11 43 #ifndef GL_QUADS
nuclear@11 44 #define GL_QUADS 7
nuclear@11 45 #endif
nuclear@11 46
nuclear@11 47 /* glGet stuff */
nuclear@11 48 #ifndef GL_VIEWPORT
nuclear@11 49 #define GL_VIEWPORT 0x0BA2
nuclear@11 50 #endif
nuclear@11 51 #ifndef GL_MODELVIEW_MATRIX
nuclear@11 52 #define GL_MODELVIEW_MATRIX 0x0BA6
nuclear@11 53 #endif
nuclear@11 54 #ifndef GL_PROJECTION_MATRIX
nuclear@11 55 #define GL_PROJECTION_MATRIX 0x0BA7
nuclear@11 56 #endif
nuclear@11 57
nuclear@11 58 #ifdef GLDEF
nuclear@11 59
nuclear@11 60 #define glEnable gl_enable
nuclear@11 61 #define glDisable gl_disable
nuclear@11 62
nuclear@11 63 #define glMatrixMode gl_matrix_mode
nuclear@11 64 #define glPushMatrix gl_push_matrix
nuclear@11 65 #define glPopMatrix gl_pop_matrix
nuclear@11 66 #define glLoadIdentity gl_load_identity
nuclear@11 67 #define glLoadMatrixf gl_load_matrixf
nuclear@11 68 #define glLoadMatrixd gl_load_matrixd
nuclear@11 69 #define glMultMatrixf gl_mult_matrixf
nuclear@11 70 #define glMultMatrixd gl_mult_matrixd
nuclear@11 71 #define glTranslatef gl_translatef
nuclear@11 72 #define glRotatef gl_rotatef
nuclear@11 73 #define glScalef gl_scalef
nuclear@11 74 #define glOrtho gl_ortho
nuclear@11 75 #define glFrustum gl_frustum
nuclear@11 76 #define gluPerspective glu_perspective
nuclear@11 77 #define gluUnProject glu_un_project
nuclear@11 78
nuclear@11 79 #define glBegin gl_begin
nuclear@11 80 #define glEnd gl_end
nuclear@11 81 #define glVertex2f gl_vertex2f
nuclear@11 82 #define glVertex3f gl_vertex3f
nuclear@11 83 #define glVertex4f gl_vertex4f
nuclear@11 84 #define glNormal3f gl_normal3f
nuclear@11 85 #define glColor3f gl_color3f
nuclear@11 86 #define glColor4f gl_color4f
nuclear@11 87 #define glTexCoord1f gl_texcoord1f
nuclear@11 88 #define glTexCoord2f gl_texcoord2f
nuclear@11 89 #define glVertexAttrib2f gl_vertex_attrib2f
nuclear@11 90 #define glVertexAttrib3f gl_vertex_attrib3f
nuclear@11 91 #define glVertexAttrib4f gl_vertex_attrib4f
nuclear@11 92
nuclear@11 93 #define glGetFloatv gl_get_floatv
nuclear@11 94 #define glGetDoublev gl_get_doublev
nuclear@11 95 #endif
nuclear@11 96
nuclear@11 97 #ifdef __cplusplus
nuclear@11 98 extern "C" {
nuclear@11 99 #endif
nuclear@11 100
nuclear@11 101 void gl_enable(int state);
nuclear@11 102 void gl_disable(int state);
nuclear@11 103
nuclear@11 104 /* matrix stuff */
nuclear@11 105 void gl_matrix_mode(int mmode);
nuclear@11 106 void gl_push_matrix(void);
nuclear@11 107 void gl_pop_matrix(void);
nuclear@11 108 void gl_load_identity(void);
nuclear@11 109 void gl_load_matrixf(const float *mat);
nuclear@11 110 void gl_load_matrixd(const double *mat);
nuclear@11 111 void gl_mult_matrixf(const float *mat);
nuclear@11 112 void gl_mult_matrixd(const double *mat);
nuclear@11 113 void gl_translatef(float x, float y, float z);
nuclear@11 114 void gl_rotatef(float angle, float x, float y, float z);
nuclear@11 115 void gl_scalef(float x, float y, float z);
nuclear@11 116 void gl_ortho(float left, float right, float bottom, float top, float near, float far);
nuclear@11 117 void gl_frustum(float left, float right, float bottom, float top, float near, float far);
nuclear@11 118 void glu_perspective(float vfov, float aspect, float near, float far);
nuclear@11 119 int glu_un_project(double winx, double winy, double winz,
nuclear@11 120 const double *model, const double *proj, const int *viewp,
nuclear@11 121 double *objx, double *objy, double *objz);
nuclear@11 122
nuclear@11 123 void gl_apply_xform(unsigned int prog);
nuclear@11 124
nuclear@11 125
nuclear@11 126 /* immediate mode rendering */
nuclear@11 127 void gl_begin(int prim);
nuclear@11 128 void gl_end(void);
nuclear@11 129
nuclear@11 130 void gl_vertex2f(float x, float y);
nuclear@11 131 void gl_vertex3f(float x, float y, float z);
nuclear@11 132 void gl_vertex4f(float x, float y, float z, float w);
nuclear@11 133
nuclear@11 134 void gl_normal3f(float x, float y, float z);
nuclear@11 135
nuclear@11 136 void gl_color3f(float r, float g, float b);
nuclear@11 137 void gl_color4f(float r, float g, float b, float a);
nuclear@11 138
nuclear@11 139 void gl_texcoord1f(float s);
nuclear@11 140 void gl_texcoord2f(float s, float t);
nuclear@11 141
nuclear@11 142 void gl_vertex_attrib2f(int loc, float x, float y);
nuclear@11 143 void gl_vertex_attrib3f(int loc, float x, float y, float z);
nuclear@11 144 void gl_vertex_attrib4f(int loc, float x, float y, float z, float w);
nuclear@11 145
nuclear@11 146 /* state retrieval */
nuclear@11 147 void gl_get_floatv(int what, float *res);
nuclear@11 148 void gl_get_doublev(int what, double *res);
nuclear@11 149
nuclear@11 150 #ifdef __cplusplus
nuclear@11 151 }
nuclear@11 152 #endif
nuclear@11 153
nuclear@11 154 #endif /* SANEGL_H_ */