34 #if 1 || defined(HAVE_FV_INLIB)
35 #define KEEP_FV_INLIB 1
36 #define KEEP_X11_INLIB 1
38 #define KEEP_FV_INLIB 0
39 #define KEEP_X11_INLIB 0
42 #ifndef __LIBFREEWRL_DISPLAY_H__
43 #define __LIBFREEWRL_DISPLAY_H__
46 #ifndef MAX_MULTITEXTURE
47 #define MAX_MULTITEXTURE 4
50 #ifdef GL_ES_VERSION_2_0
52 #define STR_MAX_LIGHTS "\n#define MAX_LIGHTS 6\n "
53 #define MAX_LIGHT_STACK 8 //making this larger than MAX_LIGHTS means we can visit all the local lights and use the last one on the stack/most local (or 2 if headlight off)
54 #define HEADLIGHT_LIGHT (MAX_LIGHT_STACK-1)
56 #define MAX_LIGHTS 8 //8 lights is 1152bytes transfered to GPU shader per shape draw - 11% of mainloop load on pentium class PC with card in old-style 32bit PCI expansion slot
57 #define STR_MAX_LIGHTS "\n#define MAX_LIGHTS 8\n "
58 #define MAX_LIGHT_STACK 8 //going down the transform stack, up to 7 local lights, with most-local as last
59 #define HEADLIGHT_LIGHT (MAX_LIGHT_STACK-1)
62 #ifdef AQUA // OLD_IPHONE_AQUA
67 OLD_IPHONE_AQUA #ifdef IPHONE
68 OLD_IPHONE_AQUA #include <OpenGLES/ES2/gl.h>
69 OLD_IPHONE_AQUA #include <OpenGLES/ES2/glext.h>
70 OLD_IPHONE_AQUA #include <OpenGLES/ES3/gl.h>
71 OLD_IPHONE_AQUA #include <OpenGLES/ES3/glext.h>
74 OLD_IPHONE_AQUA #include <OpenGL/OpenGL.h>
75 OLD_IPHONE_AQUA #include <OpenGL/CGLTypes.h>
77 OLD_IPHONE_AQUA #include <AGL/AGL.h>
78 OLD_IPHONE_AQUA #endif
81 #include <libFreeWRL.h>
84 #if defined(_MSC_VER) && defined(HAVE_GLEW_H) && !defined(ANGLEPROJECT)
88 GLEWContext * glewGetContext();
93 #if defined(__linux__) && !defined(_ANDROID) && !defined(ANDROIDNDK)
94 # define GL_GLEXT_PROTOTYPES 1
98 #include <../libtess/libtess2.h>
108 #if defined (_ANDROID) || defined(ANDROIDNDK) || defined (QNX) || defined(ANGLEPROJECT)
109 #include <GLES2/gl2.h>
110 #include <GLES2/gl2ext.h>
119 #ifdef GL_ES_VERSION_2_0
120 #define GLDOUBLE double
121 #define DOUBLE_MAX fmax
122 #define DOUBLE_MIN fmin
124 #define GLDOUBLE GLdouble
125 #define DOUBLE_MAX max
126 #define DOUBLE_MIN min
131 #define CULL_FACE(v) \
132 if (v != getAppearanceProperties()->cullFace) { \
133 getAppearanceProperties()->cullFace = v; \
134 if (getAppearanceProperties()->cullFace == TRUE) {glEnable(GL_CULL_FACE);}\
135 else { glDisable(GL_CULL_FACE);} \
137 #define CULL_FACE_INITIALIZE getAppearanceProperties()->cullFace=FALSE; glDisable(GL_CULL_FACE);
139 #define DISABLE_CULL_FACE CULL_FACE(FALSE)
140 #define ENABLE_CULL_FACE CULL_FACE(TRUE)
142 #define GL_LIGHT_RADIUS 0xBEEF
143 #define GL_SPOT_BEAMWIDTH 0xF00D
144 #ifdef GL_ES_VERSION_2_0
145 #if !defined(PATH_MAX)
146 #define PATH_MAX 5000
151 #define GL_MODELVIEW 0x1700
152 #define GL_MODELVIEW_MATRIX 0x0BA6
153 #define GL_PROJECTION 0x1701
154 #define GL_PROJECTION_MATRIX 0x0BA7
155 #define GL_TEXTURE_MATRIX 0x0BA8
158 #define GL_SHININESS 0x1601
159 #define GL_DIFFUSE 0x1201
160 #define GL_AMBIENT 0x1200
161 #define GL_SPECULAR 0x1202
162 #define GL_EMISSION 0x1600
163 #define GL_ENABLE_BIT 0x00002000
165 #define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
166 #define GL_SEPARATE_SPECULAR_COLOR 0x81FA
167 #define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
168 #define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
169 #define GL_LIGHT_MODEL_AMBIENT 0x0B53
170 #define GL_LIGHT0 0x4000
173 #define GL_BACK_LEFT GL_BACK
174 #define GL_BACK_RIGHT GL_BACK
175 #define GL_STEREO 0x0C33
178 #define GL_QUERY_RESULT 0x8866
179 #define GL_QUERY_RESULT_AVAILABLE 0x8867
180 #define GL_SAMPLES_PASSED 0x8914
183 #define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
184 #define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
185 #define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
186 #define GL_RGBA8 0x8058
187 #define GL_RGB8 0x8051
188 #define GL_BGR 0x80E0
189 #define GL_RGB5 0x8050
191 #define GL_EDGE_FLAG_ARRAY 0x8079
192 #define GL_INDEX_ARRAY 0x8077
193 #define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY
194 #define GL_SECONDARY_COLOR_ARRAY 0x845E
195 #define GL_LINE_STIPPLE 0x0B24
196 #define GL_VERTEX_ARRAY 0x8074
197 #define GL_NORMAL_ARRAY 0x8075
198 #define GL_TEXTURE_COORD_ARRAY 0x8078
199 #define GL_COLOR_ARRAY 0x8076
200 #define GL_OBJECT_LINEAR 0x2401
201 #define GL_EYE_LINEAR 0x2400
202 #define GL_REFLECTION_MAP 0x8512
203 #define GL_SPHERE_MAP 0x2402
204 #define GL_NORMAL_MAP 0x8511
206 #define GL_TEXTURE_GEN_MODE 0x2500
208 #define GL_TEXTURE_GEN_S 0x0C60
209 #define GL_TEXTURE_GEN_T 0x0C61
210 #define GL_TEXTURE_ENV 0x2300
211 #define GL_TEXTURE_ENV_MODE 0x2200
212 #define GL_MODULATE 0x2100
213 #define GL_COMBINE 0x8570
214 #define GL_COMBINE_RGB 0x8571
215 #define GL_SOURCE0_RGB 0x8580
216 #define GL_OPERAND0_RGB 0x8590
217 #define GL_SOURCE1_RGB 0x8581
218 #define GL_OPERAND1_RGB 0x8591
219 #define GL_COMBINE_ALPHA 0x8572
220 #define GL_SOURCE0_ALPHA 0x8588
221 #define GL_OPERAND0_ALPHA 0x8598
222 #define GL_RGB_SCALE 0x8573
223 #define GL_ALPHA_SCALE 0x0D1C
224 #define GL_SOURCE1_ALPHA 0x8589
225 #define GL_OPERAND1_ALPHA 0x8599
226 #define GL_TEXTURE_GEN_S 0x0C60
227 #define GL_TEXTURE_GEN_T 0x0C61
228 #define GL_PREVIOUS 0x8578
229 #define GL_ADD 0x0104
230 #define GL_SUBTRACT 0x84E7
231 #define GL_DOT3_RGB 0x86AE
232 #define GL_ADD_SIGNED 0x8574
233 #define GL_CLAMP 0x2900
234 #define GL_CLAMP_TO_BORDER 0x812D
235 #define GL_TEXTURE_WRAP_R 0x8072
237 #define GL_TEXTURE_GEN_R 0x0C62
238 #define GL_GENERATE_MIPMAP 0x8191
239 #define GL_TEXTURE_PRIORITY 0x8066
240 #define GL_TEXTURE_BORDER_COLOR 0x1004
241 #define GL_TEXTURE_INTERNAL_FORMAT 0x1003
242 #define GL_COMPRESSED_RGBA 0x84EE
243 #define GL_TEXTURE_COMPRESSION_HINT 0x84EF
244 #define GL_PROXY_TEXTURE_2D 0x8064
245 #define GL_TEXTURE_WIDTH 0x1000
246 #define GL_TEXTURE_HEIGHT 0x1001
247 #define GL_POSITION 0x1203
248 #define GL_SPOT_DIRECTION 0x1204
250 #define GL_CONSTANT_ATTENUATION 0x1207
251 #define GL_LINEAR_ATTENUATION 0x1208
252 #define GL_QUADRATIC_ATTENUATION 0x1209
253 #define GL_SPOT_CUTOFF 0x1206
254 #define GL_COMPILE 0x1300
255 #define GL_FLAT 0x1D00
256 #define GL_SMOOTH 0x1D01
257 #define GL_LIST_BIT 0x00020000
259 #define VERTEX_SHADER GL_VERTEX_SHADER
260 #define FRAGMENT_SHADER GL_FRAGMENT_SHADER
261 #define SHADER_SOURCE glShaderSource
262 #define COMPILE_SHADER glCompileShader
263 #define CREATE_PROGRAM glCreateProgram();
264 #define CREATE_SHADER glCreateShader
265 #define ATTACH_SHADER glAttachShader
266 #define LINK_SHADER glLinkProgram
267 #define DELETE_SHADER glDeleteShader
268 #define DELETE_PROGRAM glDeleteProgram
269 #define USE_SHADER(aaa) glUseProgram(aaa)
270 #define GET_SHADER_INFO glGetShaderiv
271 #define LINK_STATUS GL_LINK_STATUS
272 #define COMPILE_STATUS GL_COMPILE_STATUS
273 #define GET_UNIFORM(aaa,bbb) glGetUniformLocation(aaa,bbb)
274 #define GET_ATTRIB(aaa,bbb) glGetAttribLocation(aaa,bbb)
275 #define GLUNIFORM1I glUniform1i
276 #define GLUNIFORM1F glUniform1f
277 #define GLUNIFORM2F glUniform2f
278 #define GLUNIFORM3F glUniform3f
279 #define GLUNIFORM4F glUniform4f
280 #define GLUNIFORM1IV glUniform1iv
281 #define GLUNIFORM1FV glUniform1fv
282 #define GLUNIFORM2FV glUniform2fv
283 #define GLUNIFORM3FV glUniform3fv
284 #define GLUNIFORM4FV glUniform4fv
285 #define GLUNIFORMMATRIX4FV glUniformMatrix4fv
286 #define GLUNIFORMMATRIX3FV glUniformMatrix3fv
291 #if defined (_MSC_VER) || defined(_ANDROID) || defined(ANDROIDNDK) || defined(QNX)
292 #include <libtess2.h>
293 #endif // linux spefcific for now
297 #define IS_DISPLAY_INITIALIZED (gglobal()->display.display_initialized==TRUE)
320 #define TEXTURE_VBO0 5
321 #define TEXTURE_VBO1 6
322 #define TEXTURE_VBO2 7
323 #define TEXTURE_VBO3 8
327 void fv_setScreenDim(
int wi,
int he);
329 int fv_open_display();
330 int fv_display_initialize(
void);
331 int fv_display_initialize_desktop(
void);
334 bool fv_create_GLcontext();
335 bool fv_bind_GLcontext();
346 GLuint myShaderProgram;
348 GLint myMaterialAmbient;
349 GLint myMaterialDiffuse;
350 GLint myMaterialSpecular;
351 GLint myMaterialShininess;
352 GLint myMaterialEmission;
354 GLint myMaterialBackAmbient;
355 GLint myMaterialBackDiffuse;
356 GLint myMaterialBackSpecular;
357 GLint myMaterialBackShininess;
358 GLint myMaterialBackEmission;
363 bool haveLightInShader;
367 GLint lightType[MAX_LIGHTS];
368 GLint lightAmbient[MAX_LIGHTS];
369 GLint lightDiffuse[MAX_LIGHTS];
370 GLint lightSpecular[MAX_LIGHTS];
371 GLint lightPosition[MAX_LIGHTS];
372 GLint lightSpotDir[MAX_LIGHTS];
373 GLint lightAtten[MAX_LIGHTS];
377 GLint lightSpotCutoffAngle[MAX_LIGHTS];
378 GLint lightSpotBeamWidth[MAX_LIGHTS];
380 GLint lightRadius[MAX_LIGHTS];
382 GLint ModelViewMatrix;
383 GLint ProjectionMatrix;
385 GLint ModelViewInverseMatrix;
386 GLint TextureMatrix[MAX_MULTITEXTURE];
390 GLint TexCoords[MAX_MULTITEXTURE];
393 GLint TextureUnit[MAX_MULTITEXTURE];
394 GLint TextureMode[MAX_MULTITEXTURE];
395 GLint TextureSource[MAX_MULTITEXTURE];
396 GLint TextureFunction[MAX_MULTITEXTURE];
398 GLint multitextureColor;
402 GLint tex3dUseVertex;
415 GLint texCoordGenType;
418 GLint fogvisibilityRange;
443 const char *renderer;
446 const char *extensions;
448 bool have_GL_VERSION_1_1;
449 bool have_GL_VERSION_1_2;
450 bool have_GL_VERSION_1_3;
451 bool have_GL_VERSION_1_4;
452 bool have_GL_VERSION_1_5;
453 bool have_GL_VERSION_2_0;
454 bool have_GL_VERSION_2_1;
455 bool have_GL_VERSION_3_0;
457 bool av_multitexture;
458 bool av_npot_texture;
459 bool av_texture_rect;
463 int runtime_max_texture_size;
464 int system_max_texture_size;
465 float anisotropicDegree;
467 GLboolean quadBuffer;
473 bool initialize_rdr_caps();
474 void initialize_rdr_functions();
479 OLD_IPHONE_AQUA #ifndef IPHONE
481 OLD_IPHONE_AQUA
extern int ccurse;
482 OLD_IPHONE_AQUA
extern int ocurse;
488 OLD_IPHONE_AQUA
extern int PaneClipnpx;
489 OLD_IPHONE_AQUA
extern int PaneClipnpy;
491 OLD_IPHONE_AQUA
extern int PaneClipct;
492 OLD_IPHONE_AQUA
extern int PaneClipcb;
493 OLD_IPHONE_AQUA
extern int PaneClipcr;
494 OLD_IPHONE_AQUA
extern int PaneClipcl;
495 OLD_IPHONE_AQUA
extern int PaneClipwidth;
496 OLD_IPHONE_AQUA
extern int PaneClipheight;
497 OLD_IPHONE_AQUA
extern int PaneClipChanged;
499 OLD_IPHONE_AQUA #include
"OpenGL/glu.h"
500 OLD_IPHONE_AQUA #endif
506 #if defined(TARGET_X11) || defined(TARGET_MOTIF)
512 # include <X11/Xlib.h>
513 # include <X11/Xutil.h>
514 # include <X11/keysym.h>
517 extern GLXContext GLcx;
520 extern long event_mask;
521 extern Display *Xdpy;
523 extern Window Xroot_window;
524 extern XVisualInfo *Xvi;
525 extern Colormap colormap;
528 extern XSetWindowAttributes attr;
529 extern unsigned long mask;
530 extern Atom WM_DELETE_WINDOW;
532 void handle_Xevents(XEvent event);
534 # ifdef HAVE_XF86_VMODE
535 # include <X11/extensions/xf86vmode.h>
536 extern int vmode_nb_modes;
537 extern XF86VidModeModeInfo **vmode_modes;
538 extern int vmode_mode_selected;
541 # if defined(TARGET_MOTIF)
546 # include <X11/Intrinsic.h>
549 extern XtAppContext Xtcx;
551 void getMotifWindowedGLwin(Window *win);
552 # define GET_GLWIN getMotifWindowedGLwin(&GLwin)
559 # define GET_GLWIN getBareWindowedGLwin(&GLwin)
569 #if defined (FW_DEBUG)
571 #if defined(_ANDROID)
572 #define PRINT_GL_ERROR_IF_ANY(_where) { \
573 GLenum _global_gl_err = glGetError(); \
574 while (_global_gl_err != GL_NO_ERROR) { \
575 if (_global_gl_err == GL_INVALID_ENUM) {DROIDDEBUG ("GL_INVALID_ENUM"); } \
576 else if (_global_gl_err == GL_INVALID_VALUE) {DROIDDEBUG("GL_INVALID_VALUE"); } \
577 else if (_global_gl_err == GL_INVALID_OPERATION) {DROIDDEBUG("GL_INVALID_OPERATION"); } \
578 else if (_global_gl_err == GL_OUT_OF_MEMORY) {DROIDDEBUG("GL_OUT_OF_MEMORY"); } \
579 else DROIDDEBUG("unknown error"); \
580 DROIDDEBUG(" here: %s (%s:%d)\n", _where,__FILE__,__LINE__); \
581 _global_gl_err = glGetError(); \
586 #define PRINT_GL_ERROR_IF_ANY(_where) { \
587 GLenum _global_gl_err = glGetError(); \
588 while (_global_gl_err != GL_NO_ERROR) { \
589 if (_global_gl_err == GL_INVALID_ENUM) {printf ("GL_INVALID_ENUM"); } \
590 else if (_global_gl_err == GL_INVALID_VALUE) {printf ("GL_INVALID_VALUE"); } \
591 else if (_global_gl_err == GL_INVALID_OPERATION) {printf ("GL_INVALID_OPERATION"); } \
592 else if (_global_gl_err == GL_OUT_OF_MEMORY) {printf ("GL_OUT_OF_MEMORY"); } \
593 else printf ("unknown error"); \
594 printf(" here: %s (%s:%d)\n", _where,__FILE__,__LINE__); \
595 _global_gl_err = glGetError(); \
601 #define PRINT_GL_ERROR_IF_ANY(_where)
604 #define GL_ERROR_MSG (\
605 (glGetError() == GL_NO_ERROR)?"":\
606 (glGetError() == GL_INVALID_ENUM)?"GL_INVALID_ENUM":\
607 (glGetError() == GL_INVALID_VALUE)?"GL_INVALID_VALUE":\
608 (glGetError() == GL_INVALID_OPERATION)?"GL_INVALID_OPERATION":\
609 (glGetError() == GL_OUT_OF_MEMORY)?"GL_OUT_OF_MEMORY":\
612 void resetGeometry();
617 #ifdef GL_VERSION_2_0
618 #define VERTEX_SHADER GL_VERTEX_SHADER
619 #define FRAGMENT_SHADER GL_FRAGMENT_SHADER
620 #define SHADER_SOURCE glShaderSource
621 #define COMPILE_SHADER glCompileShader
622 #define CREATE_PROGRAM glCreateProgram();
623 #define CREATE_SHADER glCreateShader
624 #define ATTACH_SHADER glAttachShader
625 #define LINK_SHADER glLinkProgram
626 #define DELETE_SHADER glDeleteShader
627 #define DELETE_PROGRAM glDeleteProgram
628 #define USE_SHADER(aaa) glUseProgram(aaa)
629 #define GET_SHADER_INFO glGetShaderiv
630 #define LINK_STATUS GL_LINK_STATUS
631 #define COMPILE_STATUS GL_COMPILE_STATUS
632 #define GET_UNIFORM(aaa,bbb) glGetUniformLocation(aaa,bbb)
633 #define GET_ATTRIB(aaa,bbb) glGetAttribLocation(aaa,bbb)
634 #define GLUNIFORM1I glUniform1i
635 #define GLUNIFORM1F glUniform1f
636 #define GLUNIFORM2F glUniform2f
637 #define GLUNIFORM3F glUniform3f
638 #define GLUNIFORM4F glUniform4f
639 #define GLUNIFORM1IV glUniform1iv
640 #define GLUNIFORM1FV glUniform1fv
641 #define GLUNIFORM2FV glUniform2fv
642 #define GLUNIFORM3FV glUniform3fv
643 #define GLUNIFORM4FV glUniform4fv
644 #define GLUNIFORMMATRIX4FV glUniformMatrix4fv
645 #define GLUNIFORMMATRIX3FV glUniformMatrix3fv
648 #ifdef GL_VERSION_1_5
649 #define VERTEX_SHADER GL_VERTEX_SHADER_ARB
650 #define FRAGMENT_SHADER GL_FRAGMENT_SHADER_ARB
651 #define SHADER_SOURCE glShaderSourceARB
652 #define COMPILE_SHADER glCompileShaderARB
653 #define CREATE_PROGRAM glCreateProgramObjectARB();
654 #define CREATE_SHADER glCreateShaderARB
655 #define ATTACH_SHADER glAttachObjectARB
656 #define LINK_SHADER glLinkProgramARB
657 #define DELETE_SHADER glDeleteShaderARB
658 #define DELETE_PROGRAM glDeleteProgramARB
659 #define USE_SHADER(aaa) glUseProgramObjectARB(aaa)
660 #define CREATE_SHADER glCreateShaderObjectARB
661 #define GET_SHADER_INFO glGetObjectParameterivARB
662 #define LINK_STATUS GL_OBJECT_LINK_STATUS_ARB
663 #define COMPILE_STATUS GL_OBJECT_COMPILE_STATUS_ARB
664 #define GET_UNIFORM(aaa,bbb) glGetUniformLocationARB(aaa,bbb)
665 #define GET_ATTRIB(aaa,bbb) glGetAttribLocationARB(aaa,bbb)
666 #define GLUNIFORM1F glUniform1fARB
667 #define GLUNIFORM1I glUniform1iARB
668 #define GLUNIFORM2F glUniform2fARB
669 #define GLUNIFORM3F glUniform3fARB
670 #define GLUNIFORM4F glUniform4fARB
671 #define GLUNIFORM1IV glUniform1ivARB
672 #define GLUNIFORM1FV glUniform1fvARB
673 #define GLUNIFORM2FV glUniform2fvARB
674 #define GLUNIFORM3FV glUniform3fvARB
675 #define GLUNIFORM4FV glUniform4fvARB
676 #define GLUNIFORMMATRIX4FV glUniformMatrix4fvARB
677 #define GLUNIFORMMATRIX3FV glUniformMatrix3fvARB
686 #if defined(_MSC_VER)
687 void fwMessageLoop();
688 #define FW_GL_SWAPBUFFERS fv_swapbuffers(gglobal()->display.params); //SwapBuffers(wglGetCurrentDC());
692 #if defined (TARGET_X11) || defined (TARGET_MOTIF)
693 #define FW_GL_SWAPBUFFERS fv_swapbuffers(gglobal()->display.params);
697 #ifndef FW_GL_SWAPBUFFERS
698 #define FW_GL_SWAPBUFFERS
714 #define FW_GLU_PERSPECTIVE(aaa,bbb,ccc,ddd) fw_gluPerspective(aaa,bbb,ccc,ddd)
715 #define FW_GLU_UNPROJECT(aaa, bbb, ccc, ddd, eee, fff, ggg, hhh, iii) fw_gluUnProject(aaa, bbb, ccc, ddd, eee, fff, ggg, hhh, iii)
716 #define FW_GLU_PROJECT(aaa, bbb, ccc, ddd, eee, fff, ggg, hhh, iii) fw_gluProject(aaa, bbb, ccc, ddd, eee, fff, ggg, hhh, iii)
717 #define FW_GLU_PICK_MATRIX(aaa, bbb, ccc, ddd, eee) fw_gluPickMatrix(aaa, bbb, ccc, ddd, eee)
720 #define FW_GLU_DELETETESS(aaa) gluDeleteTess(aaa)
721 #define FW_GLU_NEW_TESS gluNewTess
722 #define FW_GLU_END_POLYGON(aaa) gluEndPolygon(aaa)
723 #define FW_GLU_BEGIN_POLYGON(aaa) gluBeginPolygon(aaa)
724 #define FW_GLU_TESS_VERTEX(aaa, bbb, ccc) gluTessVertex(aaa, bbb, ccc)
725 #define FW_GLU_TESS_CALLBACK(aaa, bbb, ccc) gluTessCallback(aaa,bbb,ccc);
726 #define FW_GLU_NEXT_CONTOUR(aaa, bbb) gluNextContour(aaa,bbb)
729 #define FW_GL_GETDOUBLEV(aaa,bbb) fw_glGetDoublev(aaa,bbb);
730 #define FW_GL_SETDOUBLEV(aaa,bbb) fw_glSetDoublev(aaa,bbb);
731 #define FW_GL_LOAD_IDENTITY fw_glLoadIdentity
732 #define FW_GL_POP_MATRIX() fw_glPopMatrix()
733 #define FW_GL_PUSH_MATRIX() fw_glPushMatrix()
735 #define FW_GL_TRANSLATE_F(xxx,yyy,zzz) fw_glTranslatef(xxx,yyy,zzz)
736 #define FW_GL_TRANSLATE_D(xxx,yyy,zzz) fw_glTranslated(xxx,yyy,zzz)
737 #define FW_GL_ROTATE_F(aaa,xxx,yyy,zzz) fw_glRotatef(aaa,xxx,yyy,zzz)
738 #define FW_GL_ROTATE_D(aaa,xxx,yyy,zzz) fw_glRotated(aaa,xxx,yyy,zzz)
739 #define FW_GL_ROTATE_RADIANS(aaa,xxx,yyy,zzz) fw_glRotateRad(aaa,xxx,yyy,zzz)
740 #define FW_GL_SCALE_F(xxx,yyy,zzz) fw_glScalef(xxx,yyy,zzz)
741 #define FW_GL_SCALE_D(xxx,yyy,zzz) fw_glScaled(xxx,yyy,zzz)
742 #define FW_GL_PUSH_ATTRIB(aaa) glPushAttrib(aaa);
743 #define FW_GL_POP_ATTRIB() glPopAttrib();
744 #define FW_GL_MATRIX_MODE(aaa) fw_glMatrixMode(aaa)
745 #define FW_GL_ORTHO(aaa,bbb,ccc,ddd,eee,fff) fw_Ortho(aaa,bbb,ccc,ddd,eee,fff);
749 #define FW_VERTEX_POINTER_TYPE 44354
750 #define FW_NORMAL_POINTER_TYPE 5434
751 #define FW_FOG_POINTER_TYPE 33888 //?? how geenerate these numbers
752 #define FW_COLOR_POINTER_TYPE 12453
753 #define FW_TEXCOORD_POINTER_TYPE 67655
756 #define FW_GL_VERTEX_POINTER(aaa, bbb, ccc, ddd) {sendAttribToGPU(FW_VERTEX_POINTER_TYPE, aaa, bbb, GL_FALSE, ccc, ddd,0,__FILE__,__LINE__); }
757 #define FW_GL_COLOR_POINTER(aaa, bbb, ccc, ddd) {sendAttribToGPU(FW_COLOR_POINTER_TYPE, aaa, bbb, GL_FALSE, ccc, ddd,0,__FILE__,__LINE__); }
758 #define FW_GL_NORMAL_POINTER(aaa, bbb, ccc) {sendAttribToGPU(FW_NORMAL_POINTER_TYPE, 0, aaa, GL_FALSE, bbb, ccc,0,__FILE__,__LINE__); }
759 #define FW_GL_FOG_POINTER(aaa, bbb, ccc) {sendAttribToGPU(FW_FOG_POINTER_TYPE, 0, aaa, GL_FALSE, bbb, ccc,0,__FILE__,__LINE__); }
760 #define FW_GL_TEXCOORD_POINTER(aaa, bbb, ccc, ddd, eee) {sendAttribToGPU(FW_TEXCOORD_POINTER_TYPE, aaa, bbb, GL_FALSE, ccc, ddd,eee,__FILE__,__LINE__); }
761 #define FW_GL_BINDBUFFER(xxx,yyy) {sendBindBufferToGPU(xxx,yyy,__FILE__,__LINE__); }
765 #define FW_GL_VIEWPORT(aaa,bbb,ccc,ddd) glViewport(aaa,bbb,ccc,ddd);
766 #define FW_GL_CLEAR_COLOR(aaa,bbb,ccc,ddd) glClearColor(aaa,bbb,ccc,ddd);
767 #define FW_GL_DEPTHMASK(aaa) glDepthMask(aaa);
768 #define FW_GL_SCISSOR(aaa,bbb,ccc,ddd) glScissor(aaa,bbb,ccc,ddd);
769 #define FW_GL_WINDOWPOS2I(aaa,bbb) glWindowPos2i(aaa,bbb);
770 #define FW_GL_FLUSH glFlush
771 #define FW_GL_RASTERPOS2I(aaa,bbb) glRasterPos2i(aaa,bbb);
772 #define FW_GL_LIGHTMODELI(aaa,bbb) glLightModeli(aaa,bbb);
773 #define FW_GL_LIGHTMODELFV(aaa,bbb) glLightModelfv(aaa,bbb);
774 #define FW_GL_BLENDFUNC(aaa,bbb) glBlendFunc(aaa,bbb);
775 #define FW_GL_LIGHTFV(aaa,bbb,ccc) fwglLightfv(aaa,bbb,ccc);
776 #define FW_GL_LIGHTF(aaa,bbb,ccc) fwglLightf(aaa,bbb,ccc);
777 #define FW_GL_CLEAR(zzz) glClear(zzz);
778 #define FW_GL_DEPTHFUNC(zzz) glDepthFunc(zzz);
779 #define FW_GL_SHADEMODEL(aaa) glShadeModel(aaa);
780 #define FW_GL_PIXELSTOREI(aaa,bbb) glPixelStorei(aaa,bbb);
783 #define GL_FOG 0x0B60
785 #define FW_GL_FOGFV(aaa, bbb) glFogfv(aaa, bbb)
786 #define FW_GL_FOGF(aaa, bbb) glFogf(aaa, bbb)
787 #define FW_GL_FOGI(aaa, bbb) glFogi(aaa, bbb)
788 #define FW_GL_BEGIN_QUERY(aaa, bbb) glBeginQuery(aaa, bbb)
789 #define FW_GL_END_QUERY(aaa) glEndQuery(aaa)
790 #define FW_GL_LINE_STIPPLE(aaa, bbb) glLineStipple(aaa, bbb)
791 #define FW_GL_VERTEX3D(aaa, bbb, ccc) glVertex3d(aaa, bbb, ccc)
796 #define FW_GL_GETSTRING(aaa) glGetString(aaa)
797 #define FW_GL_DELETETEXTURES(aaa,bbb) glDeleteTextures(aaa,bbb);
798 #define FW_GL_GETINTEGERV(aaa,bbb) glGetIntegerv(aaa,bbb);
799 #define FW_GL_GETFLOATV(aaa,bbb) glGetFloatv(aaa,bbb);
802 #define FW_GL_FRONTFACE(aaa) glFrontFace(aaa);
803 #define FW_GL_GENLISTS(aaa) glGenLists(aaa)
804 #define FW_GL_GENTEXTURES(aaa,bbb) glGenTextures(aaa,bbb)
805 #define FW_GL_GETBOOLEANV(aaa,bbb) glGetBooleanv(aaa,bbb)
806 #define FW_GL_NEWLIST(aaa,bbb) glNewList(aaa,bbb)
807 #define FW_GL_NORMAL3F(aaa,bbb,ccc) glNormal3f(aaa,bbb,ccc)
809 #define FW_GL_READPIXELS(aaa,bbb,ccc,ddd,eee,fff,ggg) glReadPixels(aaa,bbb,ccc,ddd,eee,fff,ggg)
810 #define FW_GL_TEXIMAGE2D(aaa,bbb,ccc,ddd,eee,fff,ggg,hhh,iii) glTexImage2D(aaa,bbb,ccc,ddd,eee,fff,ggg,hhh,iii)
811 #define FW_GL_TEXPARAMETERF(aaa,bbb,ccc) glTexParameterf(aaa,bbb,ccc)
812 #define FW_GL_TEXPARAMETERI(aaa,bbb,ccc) glTexParameteri(aaa,bbb,ccc)
813 #define FW_GL_TEXPARAMETERFV(aaa,bbb,ccc) glTexParameterfv(aaa,bbb,ccc)
814 #define FW_GL_GETQUERYOBJECTIV(aaa,bbb,ccc) glGetQueryObjectiv(aaa,bbb,ccc)
817 #define FW_GL_DRAWBUFFER(aaa) glDrawBuffer(aaa)
818 #define FW_GL_ENDLIST() glEndList()
819 #define FW_GL_BITMAP(aaa,bbb,ccc,ddd,eee,fff,ggg) glBitmap(aaa,bbb,ccc,ddd,eee,fff,ggg)
820 #define FW_GL_CALLLISTS(aaa,bbb,ccc) glCallLists(aaa,bbb,ccc)
821 #define FW_GL_LISTBASE(aaa) glListBase(aaa)
822 #define FW_GL_DRAWPIXELS(aaa,bbb,ccc,ddd,eee) glDrawPixels(aaa,bbb,ccc,ddd,eee)