updated readme
[andemo] / src / sanegl.h
1 #ifndef SANEGL_H_
2 #define SANEGL_H_
3
4 #include "opengl.h"
5
6 #ifndef GL_MODELVIEW
7 #define GL_MODELVIEW            0x1700
8 #endif
9 #ifndef GL_PROJECTION
10 #define GL_PROJECTION           0x1701
11 #endif
12 #ifndef GL_TEXTURE
13 #define GL_TEXTURE                      0x1702
14 #endif
15
16 #ifndef GL_POINTS
17 #define GL_POINTS                       0
18 #endif
19 #ifndef GL_LINES
20 #define GL_LINES                        1
21 #endif
22 #ifndef GL_TRIANGLES
23 #define GL_TRIANGLES            4
24 #endif
25 #ifndef GL_QUADS
26 #define GL_QUADS                        7
27 #endif
28
29 #ifdef GLDEF
30
31 #define glMatrixMode            gl_matrix_mode
32 #define glPushMatrix            gl_push_matrix
33 #define glPopMatrix                     gl_pop_matrix
34 #define glLoadIdentity          gl_load_identity
35 #define glLoadMatrixf           gl_load_matrixf
36 #define glMultMatrixf           gl_mult_matrixf
37 #define glTranslatef            gl_translatef
38 #define glRotatef                       gl_rotatef
39 #define glScalef                        gl_scalef
40 #define glOrtho                         gl_ortho
41 #define glFrustum                       gl_frustum
42 #define gluPerspective          glu_perspective
43
44 #define glBegin                         gl_begin
45 #define glEnd                           gl_end
46 #define glVertex2f                      gl_vertex2f
47 #define glVertex3f                      gl_vertex3f
48 #define glVertex4f                      gl_vertex4f
49 #define glNormal3f                      gl_normal3f
50 #define glColor3f                       gl_color3f
51 #define glColor4f                       gl_color4f
52 #define glTexCoord1f            gl_texcoord1f
53 #define glTexCoord2f            gl_texcoord2f
54 #define glVertexAttrib2f        gl_vertex_attrib2f
55 #define glVertexAttrib3f        gl_vertex_attrib3f
56 #define glVertexAttrib4f        gl_vertex_attrib4f
57 #endif
58
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62
63 /* matrix stuff */
64 void gl_matrix_mode(int mmode);
65 void gl_push_matrix(void);
66 void gl_pop_matrix(void);
67 void gl_load_identity(void);
68 void gl_load_matrixf(const float *mat);
69 void gl_mult_matrixf(const float *mat);
70 void gl_translatef(float x, float y, float z);
71 void gl_rotatef(float angle, float x, float y, float z);
72 void gl_scalef(float x, float y, float z);
73 void gl_ortho(float left, float right, float bottom, float top, float znear, float zfar);
74 void gl_frustum(float left, float right, float bottom, float top, float znear, float zfar);
75 void glu_perspective(float vfov, float aspect, float znear, float zfar);
76
77 void gl_apply_xform(unsigned int prog);
78
79
80 /* immediate mode rendering */
81 void gl_begin(int prim);
82 void gl_end(void);
83
84 void gl_vertex2f(float x, float y);
85 void gl_vertex3f(float x, float y, float z);
86 void gl_vertex4f(float x, float y, float z, float w);
87
88 void gl_normal3f(float x, float y, float z);
89
90 void gl_color3f(float r, float g, float b);
91 void gl_color4f(float r, float g, float b, float a);
92
93 void gl_texcoord1f(float s);
94 void gl_texcoord2f(float s, float t);
95
96 void gl_vertex_attrib2f(int loc, float x, float y);
97 void gl_vertex_attrib3f(int loc, float x, float y, float z);
98 void gl_vertex_attrib4f(int loc, float x, float y, float z, float w);
99
100 #ifdef __cplusplus
101 }
102 #endif
103
104 #endif  /* SANEGL_H_ */