28 #ifndef __FREEWRL_OPENGL_UTILS_H__
29 #define __FREEWRL_OPENGL_UTILS_H__
32 #define MAX_USER_DEFINED_SHADERS 40 //Sept 2016, changed from 4 to 40. In theory could do 2^32 - we have an int32 now just for user shaders
34 int getNextFreeUserDefinedShaderSlot();
35 void kill_userDefinedShaders();
36 void sendShaderTextToEngine(
int ste,
int partsN,
char ** vertSource,
char ** fragSource);
38 typedef enum vertexShaderResources {
41 vertexPrecisionDeclare,
48 vertexPositionDeclare,
49 vertexSimpleColourDeclare,
50 vertexTextureMatrixDeclare,
51 vertexOneMaterialDeclare,
52 vertexBackMaterialDeclare,
53 vertFrontColourDeclare,
54 vertexTexCoordInputDeclare,
55 vertexTexCoordOutputDeclare,
56 vertexHatchPositionDeclare,
57 vertexPointSizeDeclare,
61 vertexLightingEquation,
65 vertexPointSizeAssign,
66 vertexPositionCalculation,
68 vertexOneMaterialCalculation,
69 vertexNormPosCalculation,
70 vertexSingleTextureCalculation,
71 vertexADSLCalculation,
72 vertexSimpleColourCalculation,
73 vertexHatchPositionCalculation,
75 vertexUserDefinedInput,
79 } vertexShaderResources_t;
81 typedef enum fragmenShaderResources {
83 fragmentPrecisionDeclare,
86 fragmentMultiTexDefines,
88 fragmentFillPropDefines,
90 fragmentNormalColorDefs,
92 fragmentTexCoordDeclare,
94 fragmentMultiTexDeclare,
95 fragmentSimpleColourDeclare,
96 fragmentOneColourDeclare,
97 fragmentBackColourDeclare,
98 fragmentNormPosDeclare,
99 fragmentHatchPositionDeclare,
100 fragmentADSLLightModel,
101 fragmentMultiTexModel,
102 fragmentFillPropModel,
106 fragmentUserDefinedInput,
108 fragmentSimpleColourAssign,
109 fragmentOneColourAssign,
111 fragmentTextureAssign,
112 fragmentFillPropAssign,
116 } fragmentShaderResources_t;
123 OLDCODE
int multitex_mode[2];
124 OLDCODE
int multitex_source[2];
125 OLDCODE
int multitex_function;
130 void do_textureTransform (
struct X3D_Node *textureNode,
int ttnum);
131 void markForDispose(
struct X3D_Node *node,
int recursive);
140 BackEndClearBuffer(
int);
143 BackEndLightsOff(
void);
145 #ifdef DEBUGGING_CODE
146 void drawBBOX(
struct X3D_Node *node);
147 #endif //DEBUGGING_CODE
150 void fw_glMatrixMode(GLint mode);
151 void fw_glLoadIdentity(
void);
152 void fw_glPushMatrix(
void);
153 void fw_glPopMatrix(
void);
154 void fw_glTranslated(GLDOUBLE a, GLDOUBLE b, GLDOUBLE c);
155 void fw_glTranslatef(
float a,
float b,
float c);
156 void fw_glRotateRad (GLDOUBLE a, GLDOUBLE b, GLDOUBLE c, GLDOUBLE d);
157 void fw_glRotated (GLDOUBLE a, GLDOUBLE b, GLDOUBLE c, GLDOUBLE d);
158 void fw_glRotatef (
float a,
float b,
float c,
float d);
159 void fw_glScaled (GLDOUBLE a, GLDOUBLE b, GLDOUBLE c);
160 void fw_glScalef (
float a,
float b,
float c);
161 void fw_glGetDoublev (
int ty, GLDOUBLE *mat);
162 void fw_glSetDoublev (
int ty, GLDOUBLE *mat);
165 void fw_iphone_enableClientState(GLenum aaa);
166 void fw_iphone_disableClientState(GLenum aaa);
167 void fw_iphone_vertexPointer(GLint aaa,GLenum bbb,GLsizei ccc,
const GLvoid *ddd);
168 void fw_iphone_normalPointer(GLenum aaa,GLsizei bbb,
const GLvoid *ccc);
169 void fw_iphone_texcoordPointer(GLint aaa, GLenum bbb ,GLsizei ccc,
const GLvoid *ddd);
170 void fw_iphone_colorPointer(GLint aaa, GLenum bbb,GLsizei ccc,
const GLvoid *ddd);
171 void fw_gluPerspective(GLDOUBLE fovy, GLDOUBLE aspect, GLDOUBLE zNear, GLDOUBLE zFar);
172 void fw_gluPickMatrix(GLDOUBLE xx, GLDOUBLE yy, GLDOUBLE width, GLDOUBLE height, GLint *vp);
173 void fw_Frustum(GLDOUBLE left, GLDOUBLE right, GLDOUBLE bottom, GLDOUBLE top, GLDOUBLE nearZ, GLDOUBLE farZ);
174 void fw_Ortho(GLDOUBLE left, GLDOUBLE right, GLDOUBLE bottom, GLDOUBLE top, GLDOUBLE nearZ, GLDOUBLE farZ);
175 void fw_gluProject( GLDOUBLE objX,
178 const GLDOUBLE *model,
179 const GLDOUBLE *proj,
184 void fw_gluUnProject( GLDOUBLE winX,
187 const GLDOUBLE *model,
188 const GLDOUBLE *proj,
194 void fw_gluPickMatrix(GLDOUBLE x, GLDOUBLE y, GLDOUBLE deltax, GLDOUBLE deltay,
197 void printMaxStackUsed();
198 GLDOUBLE *getPickrayMatrix(
int index);
199 void setPickrayMatrix(
int index, GLDOUBLE *mat);
200 void freeMallocedNodeFields(
struct X3D_Node* node);
201 void unRegisterX3DNode(
struct X3D_Node * tmp);