5 void glVertex4f(float x
,float y
,float z
,float w
)
18 void glVertex2f(float x
,float y
)
23 void glVertex3f(float x
,float y
,float z
)
28 void glVertex3fv(float *v
)
30 glVertex4f(v
[0],v
[1],v
[2],1);
35 void glNormal3f(float x
,float y
,float z
)
47 void glNormal3fv(float *v
)
49 glNormal3f(v
[0],v
[1],v
[2]);
54 void glColor4f(float r
,float g
,float b
,float a
)
63 /* direct convertion to integer to go faster if no shading */
64 p
[5].ui
= (unsigned int) (r
* (ZB_POINT_RED_MAX
- ZB_POINT_RED_MIN
) +
66 p
[6].ui
= (unsigned int) (g
* (ZB_POINT_GREEN_MAX
- ZB_POINT_GREEN_MIN
) +
68 p
[7].ui
= (unsigned int) (b
* (ZB_POINT_BLUE_MAX
- ZB_POINT_BLUE_MIN
) +
73 void glColor4fv(float *v
)
82 /* direct convertion to integer to go faster if no shading */
83 p
[5].ui
= (unsigned int) (v
[0] * (ZB_POINT_RED_MAX
- ZB_POINT_RED_MIN
) +
85 p
[6].ui
= (unsigned int) (v
[1] * (ZB_POINT_GREEN_MAX
- ZB_POINT_GREEN_MIN
) +
87 p
[7].ui
= (unsigned int) (v
[2] * (ZB_POINT_BLUE_MAX
- ZB_POINT_BLUE_MIN
) +
92 void glColor3f(float x
,float y
,float z
)
97 void glColor3fv(float *v
)
99 glColor4f(v
[0],v
[1],v
[2],1);
105 void glTexCoord4f(float s
,float t
,float r
,float q
)
118 void glTexCoord2f(float s
,float t
)
120 glTexCoord4f(s
,t
,0,1);
123 void glTexCoord2fv(float *v
)
125 glTexCoord4f(v
[0],v
[1],0,1);
128 void glEdgeFlag(int flag
)
140 void glShadeModel(int mode
)
144 assert(mode
== GL_FLAT
|| mode
== GL_SMOOTH
);
146 p
[0].op
=OP_ShadeModel
;
152 void glCullFace(int mode
)
156 assert(mode
== GL_BACK
||
158 mode
== GL_FRONT_AND_BACK
);
166 void glFrontFace(int mode
)
170 assert(mode
== GL_CCW
|| mode
== GL_CW
);
172 mode
= (mode
!= GL_CCW
);
174 p
[0].op
=OP_FrontFace
;
180 void glPolygonMode(int face
,int mode
)
184 assert(face
== GL_BACK
||
186 face
== GL_FRONT_AND_BACK
);
187 assert(mode
== GL_POINT
|| mode
== GL_LINE
|| mode
==GL_FILL
);
189 p
[0].op
=OP_PolygonMode
;
197 /* glEnable / glDisable */
199 void glEnable(int cap
)
203 p
[0].op
=OP_EnableDisable
;
210 void glDisable(int cap
)
214 p
[0].op
=OP_EnableDisable
;
221 /* glBegin / glEnd */
223 void glBegin(int mode
)
244 void glMatrixMode(int mode
)
248 p
[0].op
=OP_MatrixMode
;
254 void glLoadMatrixf(const float *m
)
259 p
[0].op
=OP_LoadMatrix
;
260 for(i
=0;i
<16;i
++) p
[i
+1].f
=m
[i
];
265 void glLoadIdentity(void)
269 p
[0].op
=OP_LoadIdentity
;
274 void glMultMatrixf(const float *m
)
279 p
[0].op
=OP_MultMatrix
;
280 for(i
=0;i
<16;i
++) p
[i
+1].f
=m
[i
];
285 void glPushMatrix(void)
289 p
[0].op
=OP_PushMatrix
;
294 void glPopMatrix(void)
298 p
[0].op
=OP_PopMatrix
;
303 void glRotatef(float angle
,float x
,float y
,float z
)
316 void glTranslatef(float x
,float y
,float z
)
320 p
[0].op
=OP_Translate
;
328 void glScalef(float x
,float y
,float z
)
341 void glViewport(int x
,int y
,int width
,int height
)
354 void glFrustum(double left
,double right
,double bottom
,double top
,
355 double near
,double farv
)
372 void glMaterialfv(int mode
,int type
,float *v
)
377 assert(mode
== GL_FRONT
|| mode
== GL_BACK
|| mode
==GL_FRONT_AND_BACK
);
383 if (type
== GL_SHININESS
) n
=1;
384 for(i
=0;i
<4;i
++) p
[3+i
].f
=v
[i
];
385 for(i
=n
;i
<4;i
++) p
[3+i
].f
=0;
390 void glMaterialf(int mode
,int type
,float v
)
399 for(i
=0;i
<3;i
++) p
[4+i
].f
=0;
404 void glColorMaterial(int mode
,int type
)
408 p
[0].op
=OP_ColorMaterial
;
415 void glLightfv(int light
,int type
,float *v
)
423 /* TODO: 3 composants ? */
424 for(i
=0;i
<4;i
++) p
[3+i
].f
=v
[i
];
430 void glLightf(int light
,int type
,float v
)
439 for(i
=0;i
<3;i
++) p
[4+i
].f
=0;
444 void glLightModeli(int pname
,int param
)
449 p
[0].op
=OP_LightModel
;
452 for(i
=0;i
<4;i
++) p
[3+i
].f
=0;
457 void glLightModelfv(int pname
,float *param
)
462 p
[0].op
=OP_LightModel
;
464 for(i
=0;i
<4;i
++) p
[2+i
].f
=param
[i
];
471 void glClear(int mask
)
481 void glClearColor(float r
,float g
,float b
,float a
)
485 p
[0].op
=OP_ClearColor
;
494 void glClearDepth(double depth
)
498 p
[0].op
=OP_ClearDepth
;
507 void glTexImage2D( int target
, int level
, int components
,
508 int width
, int height
, int border
,
509 int format
, int type
, void *pixels
)
513 p
[0].op
=OP_TexImage2D
;
528 void glBindTexture(int target
,int texture
)
532 p
[0].op
=OP_BindTexture
;
539 void glTexEnvi(int target
,int pname
,int param
)
555 void glTexParameteri(int target
,int pname
,int param
)
559 p
[0].op
=OP_TexParameter
;
571 void glPixelStorei(int pname
,int param
)
575 p
[0].op
=OP_PixelStore
;
584 void glInitNames(void)
588 p
[0].op
=OP_InitNames
;
593 void glPushName(unsigned int name
)
612 void glLoadName(unsigned int name
)
623 glPolygonOffset(GLfloat factor
, GLfloat units
)
626 p
[0].op
= OP_PolygonOffset
;
631 /* Special Functions */
633 void glCallList(unsigned int list
)
648 void glHint(int target
,int mode
)
659 /* Non standard functions */
661 void glDebug(int mode
)
663 GLContext
*c
=gl_get_context();