winGLSpecial.cc 76 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2013 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. // These are a bunch of auxilary functions for logging and computing performance.
  23. // They don't really have anything to do with GL loading, so let's put them
  24. // in a serperate file.
  25. #include "platformWin32/platformWin32.h"
  26. #include "platform/platformGL.h"
  27. #include "console/consoleTypes.h"
  28. #include "console/console.h"
  29. #include <time.h>
  30. static bool loggingEnabled = false;
  31. static bool outlineEnabled = false;
  32. static bool perfEnabled = false;
  33. #define GL_FUNCTION(fn_type, fn_name, fn_args, fn_body) extern fn_type (APIENTRY * dll##fn_name)fn_args;
  34. #define WGL_FUNCTION(fn_type, fn_name, fn_args, fn_body) extern fn_type (APIENTRY * dlld##fn_name)fn_args;
  35. #define WGLD3D_FUNCTION(fn_type, fn_name, fn_args, fn_body) extern fn_type (APIENTRY * dlldwgl##fn_name)fn_args;
  36. //includes...
  37. #include "platform/GLCoreFunc.h"
  38. #include "platform/GLExtFunc.h"
  39. #include "platform/GLUFunc.h"
  40. #include "platformWin32/GLWinFunc.h"
  41. //undefs...
  42. #undef GL_FUNCTION
  43. #undef WGL_FUNCTION
  44. #undef WGLD3D_FUNCTION
  45. static const char * BooleanToString( GLboolean b )
  46. {
  47. if ( b == GL_FALSE )
  48. return "GL_FALSE";
  49. else if ( b == GL_TRUE )
  50. return "GL_TRUE";
  51. else
  52. return "OUT OF RANGE FOR BOOLEAN";
  53. }
  54. static const char * FuncToString( GLenum f )
  55. {
  56. switch ( f )
  57. {
  58. case GL_ALWAYS:
  59. return "GL_ALWAYS";
  60. case GL_NEVER:
  61. return "GL_NEVER";
  62. case GL_LEQUAL:
  63. return "GL_LEQUAL";
  64. case GL_LESS:
  65. return "GL_LESS";
  66. case GL_EQUAL:
  67. return "GL_EQUAL";
  68. case GL_GREATER:
  69. return "GL_GREATER";
  70. case GL_GEQUAL:
  71. return "GL_GEQUAL";
  72. case GL_NOTEQUAL:
  73. return "GL_NOTEQUAL";
  74. default:
  75. return "!!! UNKNOWN !!!";
  76. }
  77. }
  78. static const char* CoordToString( GLenum coord)
  79. {
  80. if (coord == GL_S)
  81. return "GL_S";
  82. else if (coord == GL_T)
  83. return "GL_T";
  84. else
  85. return "INVALID_COORD";
  86. }
  87. static const char * PrimToString( GLenum mode )
  88. {
  89. static char prim[1024];
  90. if ( mode == GL_TRIANGLES )
  91. strcpy( prim, "GL_TRIANGLES" );
  92. else if ( mode == GL_TRIANGLE_STRIP )
  93. strcpy( prim, "GL_TRIANGLE_STRIP" );
  94. else if ( mode == GL_TRIANGLE_FAN )
  95. strcpy( prim, "GL_TRIANGLE_FAN" );
  96. else if ( mode == GL_QUADS )
  97. strcpy( prim, "GL_QUADS" );
  98. else if ( mode == GL_QUAD_STRIP )
  99. strcpy( prim, "GL_QUAD_STRIP" );
  100. else if ( mode == GL_POLYGON )
  101. strcpy( prim, "GL_POLYGON" );
  102. else if ( mode == GL_POINTS )
  103. strcpy( prim, "GL_POINTS" );
  104. else if ( mode == GL_LINES )
  105. strcpy( prim, "GL_LINES" );
  106. else if ( mode == GL_LINE_STRIP )
  107. strcpy( prim, "GL_LINE_STRIP" );
  108. else if ( mode == GL_LINE_LOOP )
  109. strcpy( prim, "GL_LINE_LOOP" );
  110. else
  111. sprintf( prim, "0x%x", mode );
  112. return prim;
  113. }
  114. static const char * CapToString( GLenum cap )
  115. {
  116. static char buffer[1024];
  117. switch ( cap )
  118. {
  119. case GL_TEXTURE_2D:
  120. return "GL_TEXTURE_2D";
  121. case GL_BLEND:
  122. return "GL_BLEND";
  123. case GL_DEPTH_TEST:
  124. return "GL_DEPTH_TEST";
  125. case GL_CULL_FACE:
  126. return "GL_CULL_FACE";
  127. case GL_CLIP_PLANE0:
  128. return "GL_CLIP_PLANE0";
  129. case GL_COLOR_ARRAY:
  130. return "GL_COLOR_ARRAY";
  131. case GL_TEXTURE_COORD_ARRAY:
  132. return "GL_TEXTURE_COORD_ARRAY";
  133. case GL_VERTEX_ARRAY:
  134. return "GL_VERTEX_ARRAY";
  135. case GL_ALPHA_TEST:
  136. return "GL_ALPHA_TEST";
  137. case GL_STENCIL_TEST:
  138. return "GL_STENCIL_TEST";
  139. case GL_TEXTURE_GEN_S:
  140. return "GL_TEXTURE_GEN_S";
  141. case GL_TEXTURE_GEN_T:
  142. return "GL_TEXTURE_GEN_T";
  143. default:
  144. sprintf( buffer, "0x%x", cap );
  145. }
  146. return buffer;
  147. }
  148. static const char * TypeToString( GLenum t )
  149. {
  150. switch ( t )
  151. {
  152. case GL_BYTE:
  153. return "GL_BYTE";
  154. case GL_UNSIGNED_BYTE:
  155. return "GL_UNSIGNED_BYTE";
  156. case GL_SHORT:
  157. return "GL_SHORT";
  158. case GL_UNSIGNED_SHORT:
  159. return "GL_UNSIGNED_SHORT";
  160. case GL_INT:
  161. return "GL_INT";
  162. case GL_UNSIGNED_INT:
  163. return "GL_UNSIGNED_INT";
  164. case GL_FLOAT:
  165. return "GL_FLOAT";
  166. case GL_DOUBLE:
  167. return "GL_DOUBLE";
  168. default:
  169. return "!!! UNKNOWN !!!";
  170. }
  171. }
  172. //------------------------------------------------------------------------------
  173. // GLU Log Functions
  174. static void APIENTRY loggluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top)
  175. {
  176. fprintf(winState.log_fp, "gluOrtho2D( %f, %f, %f, %f )\n", left, right, bottom, top);
  177. fflush(winState.log_fp);
  178. dllgluOrtho2D(left, right, bottom, top);
  179. }
  180. static void APIENTRY loggluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar)
  181. {
  182. fprintf(winState.log_fp, "gluPerspective( %f, %f, %f, %f )\n", fovy, aspect, zNear, zFar);
  183. fflush(winState.log_fp);
  184. dllgluPerspective(fovy, aspect, zNear, zFar);
  185. }
  186. static void APIENTRY loggluPickMatrix(GLdouble x, GLdouble y, GLdouble width, GLdouble height, GLint viewport[4])
  187. {
  188. fprintf(winState.log_fp, "gluPickMatrix(%f, %f, %f, %f, VIEW)\n", x, y, width, height);
  189. fflush(winState.log_fp);
  190. dllgluPickMatrix(x, y, width, height, viewport);
  191. }
  192. static void APIENTRY loggluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, GLdouble upz)
  193. {
  194. fprintf(winState.log_fp, "gluLookAt(%f, %f, %f, %f, %f, %f, %f, %f, %f)\n",eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz);
  195. fflush(winState.log_fp);
  196. dllgluLookAt(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz);
  197. }
  198. static int APIENTRY loggluProject(GLdouble objx, GLdouble objy, GLdouble objz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *winx, GLdouble *winy, GLdouble *winz)
  199. {
  200. fprintf(winState.log_fp, "gluProject\n");
  201. fflush(winState.log_fp);
  202. return dllgluProject(objx, objy, objz, modelMatrix, projMatrix, viewport, winx, winy, winz);
  203. }
  204. static int APIENTRY loggluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *objx, GLdouble *objy, GLdouble *objz)
  205. {
  206. fprintf(winState.log_fp, "gluUnProject\n");
  207. fflush(winState.log_fp);
  208. return dllgluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz);
  209. }
  210. static int APIENTRY loggluScaleImage(GLenum format, GLint widthin, GLint heightin, GLenum typein, const void *datain, GLint widthout, GLint heightout, GLenum typeout, void *dataout)
  211. {
  212. fprintf(winState.log_fp, "gluScaleImage\n");
  213. fflush(winState.log_fp);
  214. return dllgluScaleImage(format, widthin, heightin, typein, datain, widthout, heightout, typeout, dataout);
  215. }
  216. static int APIENTRY loggluBuild1DMipmaps(GLenum target, GLint components, GLint width, GLenum format, GLenum type, const void *data)
  217. {
  218. fprintf(winState.log_fp, "gluBuild1DMipmaps\n");
  219. fflush(winState.log_fp);
  220. return dllgluBuild1DMipmaps(target, components, width, format, type, data);
  221. }
  222. static int APIENTRY loggluBuild2DMipmaps(GLenum target, GLint components, GLint width, GLint height, GLenum format, GLenum type, const void *data)
  223. {
  224. fprintf(winState.log_fp, "gluBuild2DMipmaps\n");
  225. fflush(winState.log_fp);
  226. return dllgluBuild2DMipmaps(target, components, width, height, format, type, data);
  227. }
  228. //------------------------------------------------------------------------------
  229. // GL LOG Functions
  230. static void APIENTRY logglAccum(GLenum op, GLfloat value)
  231. {
  232. fprintf( winState.log_fp, "glAccum\n" );
  233. fflush(winState.log_fp);
  234. dllglAccum( op, value );
  235. }
  236. static void APIENTRY logglAlphaFunc(GLenum func, GLclampf ref)
  237. {
  238. fprintf( winState.log_fp, "glAlphaFunc( 0x%x, %g )\n", func, ref );
  239. fflush(winState.log_fp);
  240. dllglAlphaFunc( func, ref );
  241. }
  242. static GLboolean APIENTRY logglAreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences)
  243. {
  244. fprintf( winState.log_fp, "glAreTexturesResident\n" );
  245. fflush(winState.log_fp);
  246. return dllglAreTexturesResident( n, textures, residences );
  247. }
  248. static void APIENTRY logglArrayElement(GLint i)
  249. {
  250. fprintf( winState.log_fp, "glArrayElement\n" );
  251. fflush(winState.log_fp);
  252. dllglArrayElement( i );
  253. }
  254. static void APIENTRY logglBegin(GLenum mode)
  255. {
  256. fprintf( winState.log_fp, "glBegin( %s )\n", PrimToString( mode ));
  257. fflush(winState.log_fp);
  258. dllglBegin( mode );
  259. }
  260. static void APIENTRY logglBindTexture(GLenum target, GLuint texture)
  261. {
  262. fprintf( winState.log_fp, "glBindTexture( 0x%x, %u )\n", target, texture );
  263. fflush(winState.log_fp);
  264. dllglBindTexture( target, texture );
  265. }
  266. static void APIENTRY logglBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap)
  267. {
  268. fprintf( winState.log_fp, "glBitmap\n" );
  269. fflush(winState.log_fp);
  270. dllglBitmap( width, height, xorig, yorig, xmove, ymove, bitmap );
  271. }
  272. static void BlendToName( char *n, GLenum f )
  273. {
  274. switch ( f )
  275. {
  276. case GL_ONE:
  277. strcpy( n, "GL_ONE" );
  278. break;
  279. case GL_ZERO:
  280. strcpy( n, "GL_ZERO" );
  281. break;
  282. case GL_SRC_ALPHA:
  283. strcpy( n, "GL_SRC_ALPHA" );
  284. break;
  285. case GL_ONE_MINUS_SRC_ALPHA:
  286. strcpy( n, "GL_ONE_MINUS_SRC_ALPHA" );
  287. break;
  288. case GL_SRC_COLOR:
  289. strcpy( n, "GL_SRC_COLOR" );
  290. break;
  291. case GL_ONE_MINUS_SRC_COLOR:
  292. strcpy( n, "GL_ONE_MINUS_SRC_COLOR" );
  293. break;
  294. case GL_DST_COLOR:
  295. strcpy( n, "GL_DST_COLOR" );
  296. break;
  297. case GL_ONE_MINUS_DST_COLOR:
  298. strcpy( n, "GL_ONE_MINUS_DST_COLOR" );
  299. break;
  300. case GL_DST_ALPHA:
  301. strcpy( n, "GL_DST_ALPHA" );
  302. break;
  303. default:
  304. sprintf( n, "0x%x", f );
  305. }
  306. }
  307. static void APIENTRY logglBlendFunc(GLenum sfactor, GLenum dfactor)
  308. {
  309. char sf[128], df[128];
  310. BlendToName( sf, sfactor );
  311. BlendToName( df, dfactor );
  312. fprintf( winState.log_fp, "glBlendFunc( %s, %s )\n", sf, df );
  313. fflush(winState.log_fp);
  314. dllglBlendFunc( sfactor, dfactor );
  315. }
  316. static void APIENTRY logglCallList(GLuint list)
  317. {
  318. fprintf( winState.log_fp, "glCallList( %u )\n", list );
  319. fflush(winState.log_fp);
  320. dllglCallList( list );
  321. }
  322. static void APIENTRY logglCallLists(GLsizei n, GLenum type, const void *lists)
  323. {
  324. fprintf( winState.log_fp, "glCallLists\n" );
  325. fflush(winState.log_fp);
  326. dllglCallLists( n, type, lists );
  327. }
  328. static void APIENTRY logglClear(GLbitfield mask)
  329. {
  330. fprintf( winState.log_fp, "glClear( 0x%x = ", mask );
  331. if ( mask & GL_COLOR_BUFFER_BIT )
  332. fprintf( winState.log_fp, "GL_COLOR_BUFFER_BIT " );
  333. if ( mask & GL_DEPTH_BUFFER_BIT )
  334. fprintf( winState.log_fp, "GL_DEPTH_BUFFER_BIT " );
  335. if ( mask & GL_STENCIL_BUFFER_BIT )
  336. fprintf( winState.log_fp, "GL_STENCIL_BUFFER_BIT " );
  337. if ( mask & GL_ACCUM_BUFFER_BIT )
  338. fprintf( winState.log_fp, "GL_ACCUM_BUFFER_BIT " );
  339. fprintf( winState.log_fp, ")\n" );
  340. fflush(winState.log_fp);
  341. dllglClear( mask );
  342. }
  343. static void APIENTRY logglClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
  344. {
  345. fprintf( winState.log_fp, "glClearAccum\n" );
  346. fflush(winState.log_fp);
  347. dllglClearAccum( red, green, blue, alpha );
  348. }
  349. static void APIENTRY logglClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
  350. {
  351. fprintf( winState.log_fp, "glClearColor\n" );
  352. fflush(winState.log_fp);
  353. dllglClearColor( red, green, blue, alpha );
  354. }
  355. static void APIENTRY logglClearDepth(GLclampd depth)
  356. {
  357. fprintf( winState.log_fp, "glClearDepth( %g )\n", ( F32 ) depth );
  358. fflush(winState.log_fp);
  359. dllglClearDepth( depth );
  360. }
  361. static void APIENTRY logglClearIndex(GLfloat c)
  362. {
  363. fprintf( winState.log_fp, "glClearIndex\n" );
  364. fflush(winState.log_fp);
  365. dllglClearIndex( c );
  366. }
  367. static void APIENTRY logglClearStencil(GLint s)
  368. {
  369. fprintf( winState.log_fp, "glClearStencil( %d )\n", s );
  370. fflush(winState.log_fp);
  371. dllglClearStencil( s );
  372. }
  373. static void APIENTRY logglClipPlane(GLenum plane, const GLdouble *equation)
  374. {
  375. fprintf( winState.log_fp, "glClipPlane\n" );
  376. fflush(winState.log_fp);
  377. dllglClipPlane( plane, equation );
  378. }
  379. static void APIENTRY logglColor3b(GLbyte red, GLbyte green, GLbyte blue)
  380. {
  381. fprintf( winState.log_fp, "glColor3b\n" );
  382. fflush(winState.log_fp);
  383. dllglColor3b( red, green, blue );
  384. }
  385. static void APIENTRY logglColor3bv(const GLbyte *v)
  386. {
  387. fprintf( winState.log_fp, "glColor3bv\n" );
  388. fflush(winState.log_fp);
  389. dllglColor3bv( v );
  390. }
  391. static void APIENTRY logglColor3d(GLdouble red, GLdouble green, GLdouble blue)
  392. {
  393. fprintf( winState.log_fp, "glColor3d\n" );
  394. fflush(winState.log_fp);
  395. dllglColor3d( red, green, blue );
  396. }
  397. static void APIENTRY logglColor3dv(const GLdouble *v)
  398. {
  399. fprintf( winState.log_fp, "glColor3dv\n" );
  400. fflush(winState.log_fp);
  401. dllglColor3dv( v );
  402. }
  403. static void APIENTRY logglColor3f(GLfloat red, GLfloat green, GLfloat blue)
  404. {
  405. fprintf( winState.log_fp, "glColor3f\n" );
  406. fflush(winState.log_fp);
  407. dllglColor3f( red, green, blue );
  408. }
  409. static void APIENTRY logglColor3fv(const GLfloat *v)
  410. {
  411. fprintf( winState.log_fp, "glColor3fv\n" );
  412. fflush(winState.log_fp);
  413. dllglColor3fv( v );
  414. }
  415. static void APIENTRY logglColor3i(GLint red, GLint green, GLint blue)
  416. {
  417. fprintf( winState.log_fp, "glColor3i\n" );
  418. fflush(winState.log_fp);
  419. dllglColor3i( red, green, blue );
  420. }
  421. static void APIENTRY logglColor3iv(const GLint *v)
  422. {
  423. fprintf( winState.log_fp, "glColor3iv\n" );
  424. fflush(winState.log_fp);
  425. dllglColor3iv( v );
  426. }
  427. static void APIENTRY logglColor3s(GLshort red, GLshort green, GLshort blue)
  428. {
  429. fprintf( winState.log_fp, "glColor3s\n" );
  430. fflush(winState.log_fp);
  431. dllglColor3s( red, green, blue );
  432. }
  433. static void APIENTRY logglColor3sv(const GLshort *v)
  434. {
  435. fprintf( winState.log_fp, "glColor3sv\n" );
  436. fflush(winState.log_fp);
  437. dllglColor3sv( v );
  438. }
  439. static void APIENTRY logglColor3ub(GLubyte red, GLubyte green, GLubyte blue)
  440. {
  441. fprintf( winState.log_fp, "glColor3ub\n" );
  442. fflush(winState.log_fp);
  443. dllglColor3ub( red, green, blue );
  444. }
  445. static void APIENTRY logglColor3ubv(const GLubyte *v)
  446. {
  447. fprintf( winState.log_fp, "glColor3ubv\n" );
  448. fflush(winState.log_fp);
  449. dllglColor3ubv( v );
  450. }
  451. #define SIG( x ) fprintf( winState.log_fp, x "\n" ); fflush(winState.log_fp)
  452. static void APIENTRY logglColor3ui(GLuint red, GLuint green, GLuint blue)
  453. {
  454. SIG( "glColor3ui" );
  455. dllglColor3ui( red, green, blue );
  456. }
  457. static void APIENTRY logglColor3uiv(const GLuint *v)
  458. {
  459. SIG( "glColor3uiv" );
  460. dllglColor3uiv( v );
  461. }
  462. static void APIENTRY logglColor3us(GLushort red, GLushort green, GLushort blue)
  463. {
  464. SIG( "glColor3us" );
  465. dllglColor3us( red, green, blue );
  466. }
  467. static void APIENTRY logglColor3usv(const GLushort *v)
  468. {
  469. SIG( "glColor3usv" );
  470. dllglColor3usv( v );
  471. }
  472. static void APIENTRY logglColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)
  473. {
  474. SIG( "glColor4b" );
  475. dllglColor4b( red, green, blue, alpha );
  476. }
  477. static void APIENTRY logglColor4bv(const GLbyte *v)
  478. {
  479. SIG( "glColor4bv" );
  480. dllglColor4bv( v );
  481. }
  482. static void APIENTRY logglColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
  483. {
  484. SIG( "glColor4d" );
  485. dllglColor4d( red, green, blue, alpha );
  486. }
  487. static void APIENTRY logglColor4dv(const GLdouble *v)
  488. {
  489. SIG( "glColor4dv" );
  490. dllglColor4dv( v );
  491. }
  492. static void APIENTRY logglColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
  493. {
  494. fprintf( winState.log_fp, "glColor4f( %g,%g,%g,%g )\n", red, green, blue, alpha );
  495. fflush(winState.log_fp);
  496. dllglColor4f( red, green, blue, alpha );
  497. }
  498. static void APIENTRY logglColor4fv(const GLfloat *v)
  499. {
  500. fprintf( winState.log_fp, "glColor4fv( %g,%g,%g,%g )\n", v[0], v[1], v[2], v[3] );
  501. fflush(winState.log_fp);
  502. dllglColor4fv( v );
  503. }
  504. static void APIENTRY logglColor4i(GLint red, GLint green, GLint blue, GLint alpha)
  505. {
  506. SIG( "glColor4i" );
  507. dllglColor4i( red, green, blue, alpha );
  508. }
  509. static void APIENTRY logglColor4iv(const GLint *v)
  510. {
  511. SIG( "glColor4iv" );
  512. dllglColor4iv( v );
  513. }
  514. static void APIENTRY logglColor4s(GLshort red, GLshort green, GLshort blue, GLshort alpha)
  515. {
  516. SIG( "glColor4s" );
  517. dllglColor4s( red, green, blue, alpha );
  518. }
  519. static void APIENTRY logglColor4sv(const GLshort *v)
  520. {
  521. SIG( "glColor4sv" );
  522. dllglColor4sv( v );
  523. }
  524. static void APIENTRY logglColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
  525. {
  526. SIG( "glColor4ub" );
  527. dllglColor4b( red, green, blue, alpha );
  528. }
  529. static void APIENTRY logglColor4ubv(const GLubyte *v)
  530. {
  531. SIG( "glColor4ubv" );
  532. dllglColor4ubv( v );
  533. }
  534. static void APIENTRY logglColor4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha)
  535. {
  536. SIG( "glColor4ui" );
  537. dllglColor4ui( red, green, blue, alpha );
  538. }
  539. static void APIENTRY logglColor4uiv(const GLuint *v)
  540. {
  541. SIG( "glColor4uiv" );
  542. dllglColor4uiv( v );
  543. }
  544. static void APIENTRY logglColor4us(GLushort red, GLushort green, GLushort blue, GLushort alpha)
  545. {
  546. SIG( "glColor4us" );
  547. dllglColor4us( red, green, blue, alpha );
  548. }
  549. static void APIENTRY logglColor4usv(const GLushort *v)
  550. {
  551. SIG( "glColor4usv" );
  552. dllglColor4usv( v );
  553. }
  554. static void APIENTRY logglColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
  555. {
  556. SIG( "glColorMask" );
  557. dllglColorMask( red, green, blue, alpha );
  558. }
  559. static void APIENTRY logglColorMaterial(GLenum face, GLenum mode)
  560. {
  561. SIG( "glColorMaterial" );
  562. dllglColorMaterial( face, mode );
  563. }
  564. static void APIENTRY logglColorPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
  565. {
  566. fprintf( winState.log_fp, "glColorPointer( %d, %s, %d, MEM )\n", size, TypeToString( type ), stride );
  567. fflush(winState.log_fp);
  568. dllglColorPointer( size, type, stride, pointer );
  569. }
  570. static void APIENTRY logglCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
  571. {
  572. SIG( "glCopyPixels" );
  573. dllglCopyPixels( x, y, width, height, type );
  574. }
  575. static void APIENTRY logglCopyTexImage1D(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border)
  576. {
  577. SIG( "glCopyTexImage1D" );
  578. dllglCopyTexImage1D( target, level, internalFormat, x, y, width, border );
  579. }
  580. static void APIENTRY logglCopyTexImage2D(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
  581. {
  582. SIG( "glCopyTexImage2D" );
  583. dllglCopyTexImage2D( target, level, internalFormat, x, y, width, height, border );
  584. }
  585. static void APIENTRY logglCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
  586. {
  587. SIG( "glCopyTexSubImage1D" );
  588. dllglCopyTexSubImage1D( target, level, xoffset, x, y, width );
  589. }
  590. static void APIENTRY logglCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
  591. {
  592. SIG( "glCopyTexSubImage2D" );
  593. dllglCopyTexSubImage2D( target, level, xoffset, yoffset, x, y, width, height );
  594. }
  595. static void APIENTRY logglCullFace(GLenum mode)
  596. {
  597. fprintf( winState.log_fp, "glCullFace( %s )\n", ( mode == GL_FRONT ) ? "GL_FRONT" : "GL_BACK" );
  598. fflush(winState.log_fp);
  599. dllglCullFace( mode );
  600. }
  601. static void APIENTRY logglDeleteLists(GLuint list, GLsizei range)
  602. {
  603. SIG( "glDeleteLists" );
  604. dllglDeleteLists( list, range );
  605. }
  606. static void APIENTRY logglDeleteTextures(GLsizei n, const GLuint *textures)
  607. {
  608. SIG( "glDeleteTextures" );
  609. dllglDeleteTextures( n, textures );
  610. }
  611. static void APIENTRY logglDepthFunc(GLenum func)
  612. {
  613. fprintf( winState.log_fp, "glDepthFunc( %s )\n", FuncToString( func ) );
  614. fflush(winState.log_fp);
  615. dllglDepthFunc( func );
  616. }
  617. static void APIENTRY logglDepthMask(GLboolean flag)
  618. {
  619. fprintf( winState.log_fp, "glDepthMask( %s )\n", BooleanToString( flag ) );
  620. fflush(winState.log_fp);
  621. dllglDepthMask( flag );
  622. }
  623. static void APIENTRY logglDepthRange(GLclampd zNear, GLclampd zFar)
  624. {
  625. fprintf( winState.log_fp, "glDepthRange( %g, %g )\n", ( F32 ) zNear, ( F32 ) zFar );
  626. fflush(winState.log_fp);
  627. dllglDepthRange( zNear, zFar );
  628. }
  629. static void APIENTRY logglDisable(GLenum cap)
  630. {
  631. fprintf( winState.log_fp, "glDisable( %s )\n", CapToString( cap ) );
  632. fflush(winState.log_fp);
  633. dllglDisable( cap );
  634. }
  635. static void APIENTRY logglDisableClientState(GLenum array)
  636. {
  637. fprintf( winState.log_fp, "glDisableClientState( %s )\n", CapToString( array ) );
  638. fflush(winState.log_fp);
  639. dllglDisableClientState( array );
  640. }
  641. static void APIENTRY logglDrawArrays(GLenum mode, GLint first, GLsizei count)
  642. {
  643. SIG( "glDrawArrays" );
  644. dllglDrawArrays( mode, first, count );
  645. }
  646. static void APIENTRY logglDrawBuffer(GLenum mode)
  647. {
  648. SIG( "glDrawBuffer" );
  649. dllglDrawBuffer( mode );
  650. }
  651. static void APIENTRY logglDrawElements(GLenum mode, GLsizei count, GLenum type, const void *indices)
  652. {
  653. fprintf( winState.log_fp, "glDrawElements( %s, %d, %s, MEM )\n", PrimToString( mode ), count, TypeToString( type ) );
  654. fflush(winState.log_fp);
  655. dllglDrawElements( mode, count, type, indices );
  656. }
  657. static void APIENTRY logglDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels)
  658. {
  659. SIG( "glDrawPixels" );
  660. dllglDrawPixels( width, height, format, type, pixels );
  661. }
  662. static void APIENTRY logglEdgeFlag(GLboolean flag)
  663. {
  664. SIG( "glEdgeFlag" );
  665. dllglEdgeFlag( flag );
  666. }
  667. static void APIENTRY logglEdgeFlagPointer(GLsizei stride, const GLvoid *pointer)
  668. {
  669. SIG( "glEdgeFlagPointer" );
  670. dllglEdgeFlagPointer( stride, pointer );
  671. }
  672. static void APIENTRY logglEdgeFlagv(const GLboolean *flag)
  673. {
  674. SIG( "glEdgeFlagv" );
  675. dllglEdgeFlagv( flag );
  676. }
  677. static void APIENTRY logglEnable(GLenum cap)
  678. {
  679. fprintf( winState.log_fp, "glEnable( %s )\n", CapToString( cap ) );
  680. fflush(winState.log_fp);
  681. dllglEnable( cap );
  682. }
  683. static void APIENTRY logglEnableClientState(GLenum array)
  684. {
  685. fprintf( winState.log_fp, "glEnableClientState( %s )\n", CapToString( array ) );
  686. fflush(winState.log_fp);
  687. dllglEnableClientState( array );
  688. }
  689. static void APIENTRY logglEnd(void)
  690. {
  691. SIG( "glEnd" );
  692. dllglEnd();
  693. }
  694. static void APIENTRY logglEndList(void)
  695. {
  696. SIG( "glEndList" );
  697. dllglEndList();
  698. }
  699. static void APIENTRY logglEvalCoord1d(GLdouble u)
  700. {
  701. SIG( "glEvalCoord1d" );
  702. dllglEvalCoord1d( u );
  703. }
  704. static void APIENTRY logglEvalCoord1dv(const GLdouble *u)
  705. {
  706. SIG( "glEvalCoord1dv" );
  707. dllglEvalCoord1dv( u );
  708. }
  709. static void APIENTRY logglEvalCoord1f(GLfloat u)
  710. {
  711. SIG( "glEvalCoord1f" );
  712. dllglEvalCoord1f( u );
  713. }
  714. static void APIENTRY logglEvalCoord1fv(const GLfloat *u)
  715. {
  716. SIG( "glEvalCoord1fv" );
  717. dllglEvalCoord1fv( u );
  718. }
  719. static void APIENTRY logglEvalCoord2d(GLdouble u, GLdouble v)
  720. {
  721. SIG( "glEvalCoord2d" );
  722. dllglEvalCoord2d( u, v );
  723. }
  724. static void APIENTRY logglEvalCoord2dv(const GLdouble *u)
  725. {
  726. SIG( "glEvalCoord2dv" );
  727. dllglEvalCoord2dv( u );
  728. }
  729. static void APIENTRY logglEvalCoord2f(GLfloat u, GLfloat v)
  730. {
  731. SIG( "glEvalCoord2f" );
  732. dllglEvalCoord2f( u, v );
  733. }
  734. static void APIENTRY logglEvalCoord2fv(const GLfloat *u)
  735. {
  736. SIG( "glEvalCoord2fv" );
  737. dllglEvalCoord2fv( u );
  738. }
  739. static void APIENTRY logglEvalMesh1(GLenum mode, GLint i1, GLint i2)
  740. {
  741. SIG( "glEvalMesh1" );
  742. dllglEvalMesh1( mode, i1, i2 );
  743. }
  744. static void APIENTRY logglEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
  745. {
  746. SIG( "glEvalMesh2" );
  747. dllglEvalMesh2( mode, i1, i2, j1, j2 );
  748. }
  749. static void APIENTRY logglEvalPoint1(GLint i)
  750. {
  751. SIG( "glEvalPoint1" );
  752. dllglEvalPoint1( i );
  753. }
  754. static void APIENTRY logglEvalPoint2(GLint i, GLint j)
  755. {
  756. SIG( "glEvalPoint2" );
  757. dllglEvalPoint2( i, j );
  758. }
  759. static void APIENTRY logglFeedbackBuffer(GLsizei size, GLenum type, GLfloat *buffer)
  760. {
  761. SIG( "glFeedbackBuffer" );
  762. dllglFeedbackBuffer( size, type, buffer );
  763. }
  764. static void APIENTRY logglFinish(void)
  765. {
  766. SIG( "glFinish" );
  767. dllglFinish();
  768. }
  769. static void APIENTRY logglFlush(void)
  770. {
  771. SIG( "glFlush" );
  772. dllglFlush();
  773. }
  774. static void APIENTRY logglFogf(GLenum pname, GLfloat param)
  775. {
  776. SIG( "glFogf" );
  777. dllglFogf( pname, param );
  778. }
  779. static void APIENTRY logglFogfv(GLenum pname, const GLfloat *params)
  780. {
  781. SIG( "glFogfv" );
  782. dllglFogfv( pname, params );
  783. }
  784. static void APIENTRY logglFogi(GLenum pname, GLint param)
  785. {
  786. SIG( "glFogi" );
  787. dllglFogi( pname, param );
  788. }
  789. static void APIENTRY logglFogiv(GLenum pname, const GLint *params)
  790. {
  791. SIG( "glFogiv" );
  792. dllglFogiv( pname, params );
  793. }
  794. static void APIENTRY logglFrontFace(GLenum mode)
  795. {
  796. SIG( "glFrontFace" );
  797. dllglFrontFace( mode );
  798. }
  799. static void APIENTRY logglFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
  800. {
  801. SIG( "glFrustum" );
  802. dllglFrustum( left, right, bottom, top, zNear, zFar );
  803. }
  804. static GLuint APIENTRY logglGenLists(GLsizei range)
  805. {
  806. SIG( "glGenLists" );
  807. return dllglGenLists( range );
  808. }
  809. static void APIENTRY logglGenTextures(GLsizei n, GLuint *textures)
  810. {
  811. SIG( "glGenTextures" );
  812. dllglGenTextures( n, textures );
  813. }
  814. static void APIENTRY logglGetBooleanv(GLenum pname, GLboolean *params)
  815. {
  816. SIG( "glGetBooleanv" );
  817. dllglGetBooleanv( pname, params );
  818. }
  819. static void APIENTRY logglGetClipPlane(GLenum plane, GLdouble *equation)
  820. {
  821. SIG( "glGetClipPlane" );
  822. dllglGetClipPlane( plane, equation );
  823. }
  824. static void APIENTRY logglGetDoublev(GLenum pname, GLdouble *params)
  825. {
  826. SIG( "glGetDoublev" );
  827. dllglGetDoublev( pname, params );
  828. }
  829. static GLenum APIENTRY logglGetError(void)
  830. {
  831. SIG( "glGetError" );
  832. return dllglGetError();
  833. }
  834. static void APIENTRY logglGetFloatv(GLenum pname, GLfloat *params)
  835. {
  836. SIG( "glGetFloatv" );
  837. dllglGetFloatv( pname, params );
  838. }
  839. static void APIENTRY logglGetIntegerv(GLenum pname, GLint *params)
  840. {
  841. SIG( "glGetIntegerv" );
  842. dllglGetIntegerv( pname, params );
  843. }
  844. static void APIENTRY logglGetLightfv(GLenum light, GLenum pname, GLfloat *params)
  845. {
  846. SIG( "glGetLightfv" );
  847. dllglGetLightfv( light, pname, params );
  848. }
  849. static void APIENTRY logglGetLightiv(GLenum light, GLenum pname, GLint *params)
  850. {
  851. SIG( "glGetLightiv" );
  852. dllglGetLightiv( light, pname, params );
  853. }
  854. static void APIENTRY logglGetMapdv(GLenum target, GLenum query, GLdouble *v)
  855. {
  856. SIG( "glGetMapdv" );
  857. dllglGetMapdv( target, query, v );
  858. }
  859. static void APIENTRY logglGetMapfv(GLenum target, GLenum query, GLfloat *v)
  860. {
  861. SIG( "glGetMapfv" );
  862. dllglGetMapfv( target, query, v );
  863. }
  864. static void APIENTRY logglGetMapiv(GLenum target, GLenum query, GLint *v)
  865. {
  866. SIG( "glGetMapiv" );
  867. dllglGetMapiv( target, query, v );
  868. }
  869. static void APIENTRY logglGetMaterialfv(GLenum face, GLenum pname, GLfloat *params)
  870. {
  871. SIG( "glGetMaterialfv" );
  872. dllglGetMaterialfv( face, pname, params );
  873. }
  874. static void APIENTRY logglGetMaterialiv(GLenum face, GLenum pname, GLint *params)
  875. {
  876. SIG( "glGetMaterialiv" );
  877. dllglGetMaterialiv( face, pname, params );
  878. }
  879. static void APIENTRY logglGetPixelMapfv(GLenum map, GLfloat *values)
  880. {
  881. SIG( "glGetPixelMapfv" );
  882. dllglGetPixelMapfv( map, values );
  883. }
  884. static void APIENTRY logglGetPixelMapuiv(GLenum map, GLuint *values)
  885. {
  886. SIG( "glGetPixelMapuiv" );
  887. dllglGetPixelMapuiv( map, values );
  888. }
  889. static void APIENTRY logglGetPixelMapusv(GLenum map, GLushort *values)
  890. {
  891. SIG( "glGetPixelMapusv" );
  892. dllglGetPixelMapusv( map, values );
  893. }
  894. static void APIENTRY logglGetPointerv(GLenum pname, GLvoid* *params)
  895. {
  896. SIG( "glGetPointerv" );
  897. dllglGetPointerv( pname, params );
  898. }
  899. static void APIENTRY logglGetPolygonStipple(GLubyte *mask)
  900. {
  901. SIG( "glGetPolygonStipple" );
  902. dllglGetPolygonStipple( mask );
  903. }
  904. static const GLubyte * APIENTRY logglGetString(GLenum name)
  905. {
  906. SIG( "glGetString" );
  907. return dllglGetString( name );
  908. }
  909. static void APIENTRY logglGetTexEnvfv(GLenum target, GLenum pname, GLfloat *params)
  910. {
  911. SIG( "glGetTexEnvfv" );
  912. dllglGetTexEnvfv( target, pname, params );
  913. }
  914. static void APIENTRY logglGetTexEnviv(GLenum target, GLenum pname, GLint *params)
  915. {
  916. SIG( "glGetTexEnviv" );
  917. dllglGetTexEnviv( target, pname, params );
  918. }
  919. static void APIENTRY logglGetTexGendv(GLenum coord, GLenum pname, GLdouble *params)
  920. {
  921. SIG( "glGetTexGendv" );
  922. dllglGetTexGendv( coord, pname, params );
  923. }
  924. static void APIENTRY logglGetTexGenfv(GLenum coord, GLenum pname, GLfloat *params)
  925. {
  926. SIG( "glGetTexGenfv" );
  927. dllglGetTexGenfv( coord, pname, params );
  928. }
  929. static void APIENTRY logglGetTexGeniv(GLenum coord, GLenum pname, GLint *params)
  930. {
  931. SIG( "glGetTexGeniv" );
  932. dllglGetTexGeniv( coord, pname, params );
  933. }
  934. static void APIENTRY logglGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, void *pixels)
  935. {
  936. SIG( "glGetTexImage" );
  937. dllglGetTexImage( target, level, format, type, pixels );
  938. }
  939. static void APIENTRY logglGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params )
  940. {
  941. SIG( "glGetTexLevelParameterfv" );
  942. dllglGetTexLevelParameterfv( target, level, pname, params );
  943. }
  944. static void APIENTRY logglGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params)
  945. {
  946. SIG( "glGetTexLevelParameteriv" );
  947. dllglGetTexLevelParameteriv( target, level, pname, params );
  948. }
  949. static void APIENTRY logglGetTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
  950. {
  951. SIG( "glGetTexParameterfv" );
  952. dllglGetTexParameterfv( target, pname, params );
  953. }
  954. static void APIENTRY logglGetTexParameteriv(GLenum target, GLenum pname, GLint *params)
  955. {
  956. SIG( "glGetTexParameteriv" );
  957. dllglGetTexParameteriv( target, pname, params );
  958. }
  959. static void APIENTRY logglHint(GLenum target, GLenum mode)
  960. {
  961. fprintf( winState.log_fp, "glHint( 0x%x, 0x%x )\n", target, mode );
  962. fflush(winState.log_fp);
  963. dllglHint( target, mode );
  964. }
  965. static void APIENTRY logglIndexMask(GLuint mask)
  966. {
  967. SIG( "glIndexMask" );
  968. dllglIndexMask( mask );
  969. }
  970. static void APIENTRY logglIndexPointer(GLenum type, GLsizei stride, const void *pointer)
  971. {
  972. SIG( "glIndexPointer" );
  973. dllglIndexPointer( type, stride, pointer );
  974. }
  975. static void APIENTRY logglIndexd(GLdouble c)
  976. {
  977. SIG( "glIndexd" );
  978. dllglIndexd( c );
  979. }
  980. static void APIENTRY logglIndexdv(const GLdouble *c)
  981. {
  982. SIG( "glIndexdv" );
  983. dllglIndexdv( c );
  984. }
  985. static void APIENTRY logglIndexf(GLfloat c)
  986. {
  987. SIG( "glIndexf" );
  988. dllglIndexf( c );
  989. }
  990. static void APIENTRY logglIndexfv(const GLfloat *c)
  991. {
  992. SIG( "glIndexfv" );
  993. dllglIndexfv( c );
  994. }
  995. static void APIENTRY logglIndexi(GLint c)
  996. {
  997. SIG( "glIndexi" );
  998. dllglIndexi( c );
  999. }
  1000. static void APIENTRY logglIndexiv(const GLint *c)
  1001. {
  1002. SIG( "glIndexiv" );
  1003. dllglIndexiv( c );
  1004. }
  1005. static void APIENTRY logglIndexs(GLshort c)
  1006. {
  1007. SIG( "glIndexs" );
  1008. dllglIndexs( c );
  1009. }
  1010. static void APIENTRY logglIndexsv(const GLshort *c)
  1011. {
  1012. SIG( "glIndexsv" );
  1013. dllglIndexsv( c );
  1014. }
  1015. static void APIENTRY logglIndexub(GLubyte c)
  1016. {
  1017. SIG( "glIndexub" );
  1018. dllglIndexub( c );
  1019. }
  1020. static void APIENTRY logglIndexubv(const GLubyte *c)
  1021. {
  1022. SIG( "glIndexubv" );
  1023. dllglIndexubv( c );
  1024. }
  1025. static void APIENTRY logglInitNames(void)
  1026. {
  1027. SIG( "glInitNames" );
  1028. dllglInitNames();
  1029. }
  1030. static void APIENTRY logglInterleavedArrays(GLenum format, GLsizei stride, const void *pointer)
  1031. {
  1032. SIG( "glInterleavedArrays" );
  1033. dllglInterleavedArrays( format, stride, pointer );
  1034. }
  1035. static GLboolean APIENTRY logglIsEnabled(GLenum cap)
  1036. {
  1037. SIG( "glIsEnabled" );
  1038. return dllglIsEnabled( cap );
  1039. }
  1040. static GLboolean APIENTRY logglIsList(GLuint list)
  1041. {
  1042. SIG( "glIsList" );
  1043. return dllglIsList( list );
  1044. }
  1045. static GLboolean APIENTRY logglIsTexture(GLuint texture)
  1046. {
  1047. SIG( "glIsTexture" );
  1048. return dllglIsTexture( texture );
  1049. }
  1050. static void APIENTRY logglLightModelf(GLenum pname, GLfloat param)
  1051. {
  1052. SIG( "glLightModelf" );
  1053. dllglLightModelf( pname, param );
  1054. }
  1055. static void APIENTRY logglLightModelfv(GLenum pname, const GLfloat *params)
  1056. {
  1057. SIG( "glLightModelfv" );
  1058. dllglLightModelfv( pname, params );
  1059. }
  1060. static void APIENTRY logglLightModeli(GLenum pname, GLint param)
  1061. {
  1062. SIG( "glLightModeli" );
  1063. dllglLightModeli( pname, param );
  1064. }
  1065. static void APIENTRY logglLightModeliv(GLenum pname, const GLint *params)
  1066. {
  1067. SIG( "glLightModeliv" );
  1068. dllglLightModeliv( pname, params );
  1069. }
  1070. static void APIENTRY logglLightf(GLenum light, GLenum pname, GLfloat param)
  1071. {
  1072. SIG( "glLightf" );
  1073. dllglLightf( light, pname, param );
  1074. }
  1075. static void APIENTRY logglLightfv(GLenum light, GLenum pname, const GLfloat *params)
  1076. {
  1077. SIG( "glLightfv" );
  1078. dllglLightfv( light, pname, params );
  1079. }
  1080. static void APIENTRY logglLighti(GLenum light, GLenum pname, GLint param)
  1081. {
  1082. SIG( "glLighti" );
  1083. dllglLighti( light, pname, param );
  1084. }
  1085. static void APIENTRY logglLightiv(GLenum light, GLenum pname, const GLint *params)
  1086. {
  1087. SIG( "glLightiv" );
  1088. dllglLightiv( light, pname, params );
  1089. }
  1090. static void APIENTRY logglLineStipple(GLint factor, GLushort pattern)
  1091. {
  1092. SIG( "glLineStipple" );
  1093. dllglLineStipple( factor, pattern );
  1094. }
  1095. static void APIENTRY logglLineWidth(GLfloat width)
  1096. {
  1097. SIG( "glLineWidth" );
  1098. dllglLineWidth( width );
  1099. }
  1100. static void APIENTRY logglListBase(GLuint base)
  1101. {
  1102. SIG( "glListBase" );
  1103. dllglListBase( base );
  1104. }
  1105. static void APIENTRY logglLoadIdentity(void)
  1106. {
  1107. SIG( "glLoadIdentity" );
  1108. dllglLoadIdentity();
  1109. }
  1110. static void APIENTRY logglLoadMatrixd(const GLdouble *m)
  1111. {
  1112. SIG( "glLoadMatrixd" );
  1113. dllglLoadMatrixd( m );
  1114. }
  1115. static void APIENTRY logglLoadMatrixf(const GLfloat *m)
  1116. {
  1117. SIG( "glLoadMatrixf" );
  1118. dllglLoadMatrixf( m );
  1119. }
  1120. static void APIENTRY logglLoadName(GLuint name)
  1121. {
  1122. SIG( "glLoadName" );
  1123. dllglLoadName( name );
  1124. }
  1125. static void APIENTRY logglLogicOp(GLenum opcode)
  1126. {
  1127. SIG( "glLogicOp" );
  1128. dllglLogicOp( opcode );
  1129. }
  1130. static void APIENTRY logglMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points)
  1131. {
  1132. SIG( "glMap1d" );
  1133. dllglMap1d( target, u1, u2, stride, order, points );
  1134. }
  1135. static void APIENTRY logglMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points)
  1136. {
  1137. SIG( "glMap1f" );
  1138. dllglMap1f( target, u1, u2, stride, order, points );
  1139. }
  1140. static void APIENTRY logglMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points)
  1141. {
  1142. SIG( "glMap2d" );
  1143. dllglMap2d( target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points );
  1144. }
  1145. static void APIENTRY logglMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points)
  1146. {
  1147. SIG( "glMap2f" );
  1148. dllglMap2f( target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points );
  1149. }
  1150. static void APIENTRY logglMapGrid1d(GLint un, GLdouble u1, GLdouble u2)
  1151. {
  1152. SIG( "glMapGrid1d" );
  1153. dllglMapGrid1d( un, u1, u2 );
  1154. }
  1155. static void APIENTRY logglMapGrid1f(GLint un, GLfloat u1, GLfloat u2)
  1156. {
  1157. SIG( "glMapGrid1f" );
  1158. dllglMapGrid1f( un, u1, u2 );
  1159. }
  1160. static void APIENTRY logglMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
  1161. {
  1162. SIG( "glMapGrid2d" );
  1163. dllglMapGrid2d( un, u1, u2, vn, v1, v2 );
  1164. }
  1165. static void APIENTRY logglMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
  1166. {
  1167. SIG( "glMapGrid2f" );
  1168. dllglMapGrid2f( un, u1, u2, vn, v1, v2 );
  1169. }
  1170. static void APIENTRY logglMaterialf(GLenum face, GLenum pname, GLfloat param)
  1171. {
  1172. SIG( "glMaterialf" );
  1173. dllglMaterialf( face, pname, param );
  1174. }
  1175. static void APIENTRY logglMaterialfv(GLenum face, GLenum pname, const GLfloat *params)
  1176. {
  1177. SIG( "glMaterialfv" );
  1178. dllglMaterialfv( face, pname, params );
  1179. }
  1180. static void APIENTRY logglMateriali(GLenum face, GLenum pname, GLint param)
  1181. {
  1182. SIG( "glMateriali" );
  1183. dllglMateriali( face, pname, param );
  1184. }
  1185. static void APIENTRY logglMaterialiv(GLenum face, GLenum pname, const GLint *params)
  1186. {
  1187. SIG( "glMaterialiv" );
  1188. dllglMaterialiv( face, pname, params );
  1189. }
  1190. static void APIENTRY logglMatrixMode(GLenum mode)
  1191. {
  1192. SIG( "glMatrixMode" );
  1193. dllglMatrixMode( mode );
  1194. }
  1195. static void APIENTRY logglMultMatrixd(const GLdouble *m)
  1196. {
  1197. SIG( "glMultMatrixd" );
  1198. dllglMultMatrixd( m );
  1199. }
  1200. static void APIENTRY logglMultMatrixf(const GLfloat *m)
  1201. {
  1202. SIG( "glMultMatrixf" );
  1203. dllglMultMatrixf( m );
  1204. }
  1205. static void APIENTRY logglNewList(GLuint list, GLenum mode)
  1206. {
  1207. SIG( "glNewList" );
  1208. dllglNewList( list, mode );
  1209. }
  1210. static void APIENTRY logglNormal3b(GLbyte nx, GLbyte ny, GLbyte nz)
  1211. {
  1212. SIG ("glNormal3b" );
  1213. dllglNormal3b( nx, ny, nz );
  1214. }
  1215. static void APIENTRY logglNormal3bv(const GLbyte *v)
  1216. {
  1217. SIG( "glNormal3bv" );
  1218. dllglNormal3bv( v );
  1219. }
  1220. static void APIENTRY logglNormal3d(GLdouble nx, GLdouble ny, GLdouble nz)
  1221. {
  1222. SIG( "glNormal3d" );
  1223. dllglNormal3d( nx, ny, nz );
  1224. }
  1225. static void APIENTRY logglNormal3dv(const GLdouble *v)
  1226. {
  1227. SIG( "glNormal3dv" );
  1228. dllglNormal3dv( v );
  1229. }
  1230. static void APIENTRY logglNormal3f(GLfloat nx, GLfloat ny, GLfloat nz)
  1231. {
  1232. SIG( "glNormal3f" );
  1233. dllglNormal3f( nx, ny, nz );
  1234. }
  1235. static void APIENTRY logglNormal3fv(const GLfloat *v)
  1236. {
  1237. SIG( "glNormal3fv" );
  1238. dllglNormal3fv( v );
  1239. }
  1240. static void APIENTRY logglNormal3i(GLint nx, GLint ny, GLint nz)
  1241. {
  1242. SIG( "glNormal3i" );
  1243. dllglNormal3i( nx, ny, nz );
  1244. }
  1245. static void APIENTRY logglNormal3iv(const GLint *v)
  1246. {
  1247. SIG( "glNormal3iv" );
  1248. dllglNormal3iv( v );
  1249. }
  1250. static void APIENTRY logglNormal3s(GLshort nx, GLshort ny, GLshort nz)
  1251. {
  1252. SIG( "glNormal3s" );
  1253. dllglNormal3s( nx, ny, nz );
  1254. }
  1255. static void APIENTRY logglNormal3sv(const GLshort *v)
  1256. {
  1257. SIG( "glNormal3sv" );
  1258. dllglNormal3sv( v );
  1259. }
  1260. static void APIENTRY logglNormalPointer(GLenum type, GLsizei stride, const void *pointer)
  1261. {
  1262. SIG( "glNormalPointer" );
  1263. dllglNormalPointer( type, stride, pointer );
  1264. }
  1265. static void APIENTRY logglOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
  1266. {
  1267. SIG( "glOrtho" );
  1268. dllglOrtho( left, right, bottom, top, zNear, zFar );
  1269. }
  1270. static void APIENTRY logglPassThrough(GLfloat token)
  1271. {
  1272. SIG( "glPassThrough" );
  1273. dllglPassThrough( token );
  1274. }
  1275. static void APIENTRY logglPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat *values)
  1276. {
  1277. SIG( "glPixelMapfv" );
  1278. dllglPixelMapfv( map, mapsize, values );
  1279. }
  1280. static void APIENTRY logglPixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values)
  1281. {
  1282. SIG( "glPixelMapuiv" );
  1283. dllglPixelMapuiv( map, mapsize, values );
  1284. }
  1285. static void APIENTRY logglPixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values)
  1286. {
  1287. SIG( "glPixelMapusv" );
  1288. dllglPixelMapusv( map, mapsize, values );
  1289. }
  1290. static void APIENTRY logglPixelStoref(GLenum pname, GLfloat param)
  1291. {
  1292. SIG( "glPixelStoref" );
  1293. dllglPixelStoref( pname, param );
  1294. }
  1295. static void APIENTRY logglPixelStorei(GLenum pname, GLint param)
  1296. {
  1297. SIG( "glPixelStorei" );
  1298. dllglPixelStorei( pname, param );
  1299. }
  1300. static void APIENTRY logglPixelTransferf(GLenum pname, GLfloat param)
  1301. {
  1302. SIG( "glPixelTransferf" );
  1303. dllglPixelTransferf( pname, param );
  1304. }
  1305. static void APIENTRY logglPixelTransferi(GLenum pname, GLint param)
  1306. {
  1307. SIG( "glPixelTransferi" );
  1308. dllglPixelTransferi( pname, param );
  1309. }
  1310. static void APIENTRY logglPixelZoom(GLfloat xfactor, GLfloat yfactor)
  1311. {
  1312. SIG( "glPixelZoom" );
  1313. dllglPixelZoom( xfactor, yfactor );
  1314. }
  1315. static void APIENTRY logglPointSize(GLfloat size)
  1316. {
  1317. SIG( "glPointSize" );
  1318. dllglPointSize( size );
  1319. }
  1320. static void APIENTRY logglPolygonMode(GLenum face, GLenum mode)
  1321. {
  1322. fprintf( winState.log_fp, "glPolygonMode( 0x%x, 0x%x )\n", face, mode );
  1323. fflush(winState.log_fp);
  1324. dllglPolygonMode( face, mode );
  1325. }
  1326. static void APIENTRY logglPolygonOffset(GLfloat factor, GLfloat units)
  1327. {
  1328. SIG( "glPolygonOffset" );
  1329. dllglPolygonOffset( factor, units );
  1330. }
  1331. static void APIENTRY logglPolygonStipple(const GLubyte *mask )
  1332. {
  1333. SIG( "glPolygonStipple" );
  1334. dllglPolygonStipple( mask );
  1335. }
  1336. static void APIENTRY logglPopAttrib(void)
  1337. {
  1338. SIG( "glPopAttrib" );
  1339. dllglPopAttrib();
  1340. }
  1341. static void APIENTRY logglPopClientAttrib(void)
  1342. {
  1343. SIG( "glPopClientAttrib" );
  1344. dllglPopClientAttrib();
  1345. }
  1346. static void APIENTRY logglPopMatrix(void)
  1347. {
  1348. SIG( "glPopMatrix" );
  1349. dllglPopMatrix();
  1350. }
  1351. static void APIENTRY logglPopName(void)
  1352. {
  1353. SIG( "glPopName" );
  1354. dllglPopName();
  1355. }
  1356. static void APIENTRY logglPrioritizeTextures(GLsizei n, const GLuint *textures, const GLclampf *priorities)
  1357. {
  1358. SIG( "glPrioritizeTextures" );
  1359. dllglPrioritizeTextures( n, textures, priorities );
  1360. }
  1361. static void APIENTRY logglPushAttrib(GLbitfield mask)
  1362. {
  1363. SIG( "glPushAttrib" );
  1364. dllglPushAttrib( mask );
  1365. }
  1366. static void APIENTRY logglPushClientAttrib(GLbitfield mask)
  1367. {
  1368. SIG( "glPushClientAttrib" );
  1369. dllglPushClientAttrib( mask );
  1370. }
  1371. static void APIENTRY logglPushMatrix(void)
  1372. {
  1373. SIG( "glPushMatrix" );
  1374. dllglPushMatrix();
  1375. }
  1376. static void APIENTRY logglPushName(GLuint name)
  1377. {
  1378. SIG( "glPushName" );
  1379. dllglPushName( name );
  1380. }
  1381. static void APIENTRY logglRasterPos2d(GLdouble x, GLdouble y)
  1382. {
  1383. SIG ("glRasterPot2d" );
  1384. dllglRasterPos2d( x, y );
  1385. }
  1386. static void APIENTRY logglRasterPos2dv(const GLdouble *v)
  1387. {
  1388. SIG( "glRasterPos2dv" );
  1389. dllglRasterPos2dv( v );
  1390. }
  1391. static void APIENTRY logglRasterPos2f(GLfloat x, GLfloat y)
  1392. {
  1393. SIG( "glRasterPos2f" );
  1394. dllglRasterPos2f( x, y );
  1395. }
  1396. static void APIENTRY logglRasterPos2fv(const GLfloat *v)
  1397. {
  1398. SIG( "glRasterPos2dv" );
  1399. dllglRasterPos2fv( v );
  1400. }
  1401. static void APIENTRY logglRasterPos2i(GLint x, GLint y)
  1402. {
  1403. SIG( "glRasterPos2if" );
  1404. dllglRasterPos2i( x, y );
  1405. }
  1406. static void APIENTRY logglRasterPos2iv(const GLint *v)
  1407. {
  1408. SIG( "glRasterPos2iv" );
  1409. dllglRasterPos2iv( v );
  1410. }
  1411. static void APIENTRY logglRasterPos2s(GLshort x, GLshort y)
  1412. {
  1413. SIG( "glRasterPos2s" );
  1414. dllglRasterPos2s( x, y );
  1415. }
  1416. static void APIENTRY logglRasterPos2sv(const GLshort *v)
  1417. {
  1418. SIG( "glRasterPos2sv" );
  1419. dllglRasterPos2sv( v );
  1420. }
  1421. static void APIENTRY logglRasterPos3d(GLdouble x, GLdouble y, GLdouble z)
  1422. {
  1423. SIG( "glRasterPos3d" );
  1424. dllglRasterPos3d( x, y, z );
  1425. }
  1426. static void APIENTRY logglRasterPos3dv(const GLdouble *v)
  1427. {
  1428. SIG( "glRasterPos3dv" );
  1429. dllglRasterPos3dv( v );
  1430. }
  1431. static void APIENTRY logglRasterPos3f(GLfloat x, GLfloat y, GLfloat z)
  1432. {
  1433. SIG( "glRasterPos3f" );
  1434. dllglRasterPos3f( x, y, z );
  1435. }
  1436. static void APIENTRY logglRasterPos3fv(const GLfloat *v)
  1437. {
  1438. SIG( "glRasterPos3fv" );
  1439. dllglRasterPos3fv( v );
  1440. }
  1441. static void APIENTRY logglRasterPos3i(GLint x, GLint y, GLint z)
  1442. {
  1443. SIG( "glRasterPos3i" );
  1444. dllglRasterPos3i( x, y, z );
  1445. }
  1446. static void APIENTRY logglRasterPos3iv(const GLint *v)
  1447. {
  1448. SIG( "glRasterPos3iv" );
  1449. dllglRasterPos3iv( v );
  1450. }
  1451. static void APIENTRY logglRasterPos3s(GLshort x, GLshort y, GLshort z)
  1452. {
  1453. SIG( "glRasterPos3s" );
  1454. dllglRasterPos3s( x, y, z );
  1455. }
  1456. static void APIENTRY logglRasterPos3sv(const GLshort *v)
  1457. {
  1458. SIG( "glRasterPos3sv" );
  1459. dllglRasterPos3sv( v );
  1460. }
  1461. static void APIENTRY logglRasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
  1462. {
  1463. SIG( "glRasterPos4d" );
  1464. dllglRasterPos4d( x, y, z, w );
  1465. }
  1466. static void APIENTRY logglRasterPos4dv(const GLdouble *v)
  1467. {
  1468. SIG( "glRasterPos4dv" );
  1469. dllglRasterPos4dv( v );
  1470. }
  1471. static void APIENTRY logglRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
  1472. {
  1473. SIG( "glRasterPos4f" );
  1474. dllglRasterPos4f( x, y, z, w );
  1475. }
  1476. static void APIENTRY logglRasterPos4fv(const GLfloat *v)
  1477. {
  1478. SIG( "glRasterPos4fv" );
  1479. dllglRasterPos4fv( v );
  1480. }
  1481. static void APIENTRY logglRasterPos4i(GLint x, GLint y, GLint z, GLint w)
  1482. {
  1483. SIG( "glRasterPos4i" );
  1484. dllglRasterPos4i( x, y, z, w );
  1485. }
  1486. static void APIENTRY logglRasterPos4iv(const GLint *v)
  1487. {
  1488. SIG( "glRasterPos4iv" );
  1489. dllglRasterPos4iv( v );
  1490. }
  1491. static void APIENTRY logglRasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
  1492. {
  1493. SIG( "glRasterPos4s" );
  1494. dllglRasterPos4s( x, y, z, w );
  1495. }
  1496. static void APIENTRY logglRasterPos4sv(const GLshort *v)
  1497. {
  1498. SIG( "glRasterPos4sv" );
  1499. dllglRasterPos4sv( v );
  1500. }
  1501. static void APIENTRY logglReadBuffer(GLenum mode)
  1502. {
  1503. SIG( "glReadBuffer" );
  1504. dllglReadBuffer( mode );
  1505. }
  1506. static void APIENTRY logglReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels)
  1507. {
  1508. SIG( "glReadPixels" );
  1509. dllglReadPixels( x, y, width, height, format, type, pixels );
  1510. }
  1511. static void APIENTRY logglRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
  1512. {
  1513. SIG( "glRectd" );
  1514. dllglRectd( x1, y1, x2, y2 );
  1515. }
  1516. static void APIENTRY logglRectdv(const GLdouble *v1, const GLdouble *v2)
  1517. {
  1518. SIG( "glRectdv" );
  1519. dllglRectdv( v1, v2 );
  1520. }
  1521. static void APIENTRY logglRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
  1522. {
  1523. SIG( "glRectf" );
  1524. dllglRectf( x1, y1, x2, y2 );
  1525. }
  1526. static void APIENTRY logglRectfv(const GLfloat *v1, const GLfloat *v2)
  1527. {
  1528. SIG( "glRectfv" );
  1529. dllglRectfv( v1, v2 );
  1530. }
  1531. static void APIENTRY logglRecti(GLint x1, GLint y1, GLint x2, GLint y2)
  1532. {
  1533. SIG( "glRecti" );
  1534. dllglRecti( x1, y1, x2, y2 );
  1535. }
  1536. static void APIENTRY logglRectiv(const GLint *v1, const GLint *v2)
  1537. {
  1538. SIG( "glRectiv" );
  1539. dllglRectiv( v1, v2 );
  1540. }
  1541. static void APIENTRY logglRects(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
  1542. {
  1543. SIG( "glRects" );
  1544. dllglRects( x1, y1, x2, y2 );
  1545. }
  1546. static void APIENTRY logglRectsv(const GLshort *v1, const GLshort *v2)
  1547. {
  1548. SIG( "glRectsv" );
  1549. dllglRectsv( v1, v2 );
  1550. }
  1551. static GLint APIENTRY logglRenderMode(GLenum mode)
  1552. {
  1553. SIG( "glRenderMode" );
  1554. return dllglRenderMode( mode );
  1555. }
  1556. static void APIENTRY logglRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
  1557. {
  1558. SIG( "glRotated" );
  1559. dllglRotated( angle, x, y, z );
  1560. }
  1561. static void APIENTRY logglRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
  1562. {
  1563. SIG( "glRotatef" );
  1564. dllglRotatef( angle, x, y, z );
  1565. }
  1566. static void APIENTRY logglScaled(GLdouble x, GLdouble y, GLdouble z)
  1567. {
  1568. SIG( "glScaled" );
  1569. dllglScaled( x, y, z );
  1570. }
  1571. static void APIENTRY logglScalef(GLfloat x, GLfloat y, GLfloat z)
  1572. {
  1573. SIG( "glScalef" );
  1574. dllglScalef( x, y, z );
  1575. }
  1576. static void APIENTRY logglScissor(GLint x, GLint y, GLsizei width, GLsizei height)
  1577. {
  1578. fprintf( winState.log_fp, "glScissor( %d, %d, %d, %d )\n", x, y, width, height );
  1579. fflush(winState.log_fp);
  1580. dllglScissor( x, y, width, height );
  1581. }
  1582. static void APIENTRY logglSelectBuffer(GLsizei size, GLuint *buffer)
  1583. {
  1584. SIG( "glSelectBuffer" );
  1585. dllglSelectBuffer( size, buffer );
  1586. }
  1587. static void APIENTRY logglShadeModel(GLenum mode)
  1588. {
  1589. SIG( "glShadeModel" );
  1590. dllglShadeModel( mode );
  1591. }
  1592. static void APIENTRY logglStencilFunc(GLenum func, GLint ref, GLuint mask)
  1593. {
  1594. SIG( "glStencilFunc" );
  1595. dllglStencilFunc( func, ref, mask );
  1596. }
  1597. static void APIENTRY logglStencilMask(GLuint mask)
  1598. {
  1599. SIG( "glStencilMask" );
  1600. dllglStencilMask( mask );
  1601. }
  1602. static void APIENTRY logglStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
  1603. {
  1604. SIG( "glStencilOp" );
  1605. dllglStencilOp( fail, zfail, zpass );
  1606. }
  1607. static void APIENTRY logglTexCoord1d(GLdouble s)
  1608. {
  1609. SIG( "glTexCoord1d" );
  1610. dllglTexCoord1d( s );
  1611. }
  1612. static void APIENTRY logglTexCoord1dv(const GLdouble *v)
  1613. {
  1614. SIG( "glTexCoord1dv" );
  1615. dllglTexCoord1dv( v );
  1616. }
  1617. static void APIENTRY logglTexCoord1f(GLfloat s)
  1618. {
  1619. SIG( "glTexCoord1f" );
  1620. dllglTexCoord1f( s );
  1621. }
  1622. static void APIENTRY logglTexCoord1fv(const GLfloat *v)
  1623. {
  1624. SIG( "glTexCoord1fv" );
  1625. dllglTexCoord1fv( v );
  1626. }
  1627. static void APIENTRY logglTexCoord1i(GLint s)
  1628. {
  1629. SIG( "glTexCoord1i" );
  1630. dllglTexCoord1i( s );
  1631. }
  1632. static void APIENTRY logglTexCoord1iv(const GLint *v)
  1633. {
  1634. SIG( "glTexCoord1iv" );
  1635. dllglTexCoord1iv( v );
  1636. }
  1637. static void APIENTRY logglTexCoord1s(GLshort s)
  1638. {
  1639. SIG( "glTexCoord1s" );
  1640. dllglTexCoord1s( s );
  1641. }
  1642. static void APIENTRY logglTexCoord1sv(const GLshort *v)
  1643. {
  1644. SIG( "glTexCoord1sv" );
  1645. dllglTexCoord1sv( v );
  1646. }
  1647. static void APIENTRY logglTexCoord2d(GLdouble s, GLdouble t)
  1648. {
  1649. SIG( "glTexCoord2d" );
  1650. dllglTexCoord2d( s, t );
  1651. }
  1652. static void APIENTRY logglTexCoord2dv(const GLdouble *v)
  1653. {
  1654. SIG( "glTexCoord2dv" );
  1655. dllglTexCoord2dv( v );
  1656. }
  1657. static void APIENTRY logglTexCoord2f(GLfloat s, GLfloat t)
  1658. {
  1659. SIG( "glTexCoord2f" );
  1660. dllglTexCoord2f( s, t );
  1661. }
  1662. static void APIENTRY logglTexCoord2fv(const GLfloat *v)
  1663. {
  1664. SIG( "glTexCoord2fv" );
  1665. dllglTexCoord2fv( v );
  1666. }
  1667. static void APIENTRY logglTexCoord2i(GLint s, GLint t)
  1668. {
  1669. SIG( "glTexCoord2i" );
  1670. dllglTexCoord2i( s, t );
  1671. }
  1672. static void APIENTRY logglTexCoord2iv(const GLint *v)
  1673. {
  1674. SIG( "glTexCoord2iv" );
  1675. dllglTexCoord2iv( v );
  1676. }
  1677. static void APIENTRY logglTexCoord2s(GLshort s, GLshort t)
  1678. {
  1679. SIG( "glTexCoord2s" );
  1680. dllglTexCoord2s( s, t );
  1681. }
  1682. static void APIENTRY logglTexCoord2sv(const GLshort *v)
  1683. {
  1684. SIG( "glTexCoord2sv" );
  1685. dllglTexCoord2sv( v );
  1686. }
  1687. static void APIENTRY logglTexCoord3d(GLdouble s, GLdouble t, GLdouble r)
  1688. {
  1689. SIG( "glTexCoord3d" );
  1690. dllglTexCoord3d( s, t, r );
  1691. }
  1692. static void APIENTRY logglTexCoord3dv(const GLdouble *v)
  1693. {
  1694. SIG( "glTexCoord3dv" );
  1695. dllglTexCoord3dv( v );
  1696. }
  1697. static void APIENTRY logglTexCoord3f(GLfloat s, GLfloat t, GLfloat r)
  1698. {
  1699. SIG( "glTexCoord3f" );
  1700. dllglTexCoord3f( s, t, r );
  1701. }
  1702. static void APIENTRY logglTexCoord3fv(const GLfloat *v)
  1703. {
  1704. SIG( "glTexCoord3fv" );
  1705. dllglTexCoord3fv( v );
  1706. }
  1707. static void APIENTRY logglTexCoord3i(GLint s, GLint t, GLint r)
  1708. {
  1709. SIG( "glTexCoord3i" );
  1710. dllglTexCoord3i( s, t, r );
  1711. }
  1712. static void APIENTRY logglTexCoord3iv(const GLint *v)
  1713. {
  1714. SIG( "glTexCoord3iv" );
  1715. dllglTexCoord3iv( v );
  1716. }
  1717. static void APIENTRY logglTexCoord3s(GLshort s, GLshort t, GLshort r)
  1718. {
  1719. SIG( "glTexCoord3s" );
  1720. dllglTexCoord3s( s, t, r );
  1721. }
  1722. static void APIENTRY logglTexCoord3sv(const GLshort *v)
  1723. {
  1724. SIG( "glTexCoord3sv" );
  1725. dllglTexCoord3sv( v );
  1726. }
  1727. static void APIENTRY logglTexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
  1728. {
  1729. SIG( "glTexCoord4d" );
  1730. dllglTexCoord4d( s, t, r, q );
  1731. }
  1732. static void APIENTRY logglTexCoord4dv(const GLdouble *v)
  1733. {
  1734. SIG( "glTexCoord4dv" );
  1735. dllglTexCoord4dv( v );
  1736. }
  1737. static void APIENTRY logglTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
  1738. {
  1739. SIG( "glTexCoord4f" );
  1740. dllglTexCoord4f( s, t, r, q );
  1741. }
  1742. static void APIENTRY logglTexCoord4fv(const GLfloat *v)
  1743. {
  1744. SIG( "glTexCoord4fv" );
  1745. dllglTexCoord4fv( v );
  1746. }
  1747. static void APIENTRY logglTexCoord4i(GLint s, GLint t, GLint r, GLint q)
  1748. {
  1749. SIG( "glTexCoord4i" );
  1750. dllglTexCoord4i( s, t, r, q );
  1751. }
  1752. static void APIENTRY logglTexCoord4iv(const GLint *v)
  1753. {
  1754. SIG( "glTexCoord4iv" );
  1755. dllglTexCoord4iv( v );
  1756. }
  1757. static void APIENTRY logglTexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q)
  1758. {
  1759. SIG( "glTexCoord4s" );
  1760. dllglTexCoord4s( s, t, r, q );
  1761. }
  1762. static void APIENTRY logglTexCoord4sv(const GLshort *v)
  1763. {
  1764. SIG( "glTexCoord4sv" );
  1765. dllglTexCoord4sv( v );
  1766. }
  1767. static void APIENTRY logglTexCoordPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
  1768. {
  1769. fprintf( winState.log_fp, "glTexCoordPointer( %d, %s, %d, MEM )\n", size, TypeToString( type ), stride );
  1770. fflush(winState.log_fp);
  1771. dllglTexCoordPointer( size, type, stride, pointer );
  1772. }
  1773. static void APIENTRY logglTexEnvf(GLenum target, GLenum pname, GLfloat param)
  1774. {
  1775. fprintf( winState.log_fp, "glTexEnvf( 0x%x, 0x%x, %g )\n", target, pname, param );
  1776. fflush(winState.log_fp);
  1777. dllglTexEnvf( target, pname, param );
  1778. }
  1779. static void APIENTRY logglTexEnvfv(GLenum target, GLenum pname, const GLfloat *params)
  1780. {
  1781. SIG( "glTexEnvfv" );
  1782. dllglTexEnvfv( target, pname, params );
  1783. }
  1784. static void APIENTRY logglTexEnvi(GLenum target, GLenum pname, GLint param)
  1785. {
  1786. fprintf( winState.log_fp, "glTexEnvi( 0x%x, 0x%x, 0x%x )\n", target, pname, param );
  1787. fflush(winState.log_fp);
  1788. dllglTexEnvi( target, pname, param );
  1789. }
  1790. static void APIENTRY logglTexEnviv(GLenum target, GLenum pname, const GLint *params)
  1791. {
  1792. SIG( "glTexEnviv" );
  1793. dllglTexEnviv( target, pname, params );
  1794. }
  1795. static void APIENTRY logglTexGend(GLenum coord, GLenum pname, GLdouble param)
  1796. {
  1797. SIG( "glTexGend" );
  1798. dllglTexGend( coord, pname, param );
  1799. }
  1800. static void APIENTRY logglTexGendv(GLenum coord, GLenum pname, const GLdouble *params)
  1801. {
  1802. SIG( "glTexGendv" );
  1803. dllglTexGendv( coord, pname, params );
  1804. }
  1805. static void APIENTRY logglTexGenf(GLenum coord, GLenum pname, GLfloat param)
  1806. {
  1807. SIG( "glTexGenf" );
  1808. dllglTexGenf( coord, pname, param );
  1809. }
  1810. static void APIENTRY logglTexGenfv(GLenum coord, GLenum pname, const GLfloat *params)
  1811. {
  1812. // fprintf( winState.log_fp, "glTexGenfv( %s, (%g, %g, %g, %g) )\n", CoordToString( coord ), params[0], params[1], params[2], params[3]);
  1813. fflush(winState.log_fp);
  1814. fprintf( winState.log_fp, "glTexGenfv( %s, MEM )\n", CoordToString( coord ));
  1815. fflush(winState.log_fp);
  1816. dllglTexGenfv( coord, pname, params );
  1817. }
  1818. static void APIENTRY logglTexGeni(GLenum coord, GLenum pname, GLint param)
  1819. {
  1820. SIG( "glTexGeni" );
  1821. dllglTexGeni( coord, pname, param );
  1822. }
  1823. static void APIENTRY logglTexGeniv(GLenum coord, GLenum pname, const GLint *params)
  1824. {
  1825. SIG( "glTexGeniv" );
  1826. dllglTexGeniv( coord, pname, params );
  1827. }
  1828. static void APIENTRY logglTexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels)
  1829. {
  1830. SIG( "glTexImage1D" );
  1831. dllglTexImage1D( target, level, internalformat, width, border, format, type, pixels );
  1832. }
  1833. static void APIENTRY logglTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels)
  1834. {
  1835. SIG( "glTexImage2D" );
  1836. dllglTexImage2D( target, level, internalformat, width, height, border, format, type, pixels );
  1837. }
  1838. static void APIENTRY logglTexParameterf(GLenum target, GLenum pname, GLfloat param)
  1839. {
  1840. fprintf( winState.log_fp, "glTexParameterf( 0x%x, 0x%x, %g )\n", target, pname, param );
  1841. fflush(winState.log_fp);
  1842. dllglTexParameterf( target, pname, param );
  1843. }
  1844. static void APIENTRY logglTexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
  1845. {
  1846. SIG( "glTexParameterfv" );
  1847. dllglTexParameterfv( target, pname, params );
  1848. }
  1849. static void APIENTRY logglTexParameteri(GLenum target, GLenum pname, GLint param)
  1850. {
  1851. fprintf( winState.log_fp, "glTexParameteri( 0x%x, 0x%x, 0x%x )\n", target, pname, param );
  1852. fflush(winState.log_fp);
  1853. dllglTexParameteri( target, pname, param );
  1854. }
  1855. static void APIENTRY logglTexParameteriv(GLenum target, GLenum pname, const GLint *params)
  1856. {
  1857. SIG( "glTexParameteriv" );
  1858. dllglTexParameteriv( target, pname, params );
  1859. }
  1860. static void APIENTRY logglTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels)
  1861. {
  1862. SIG( "glTexSubImage1D" );
  1863. dllglTexSubImage1D( target, level, xoffset, width, format, type, pixels );
  1864. }
  1865. static void APIENTRY logglTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels)
  1866. {
  1867. SIG( "glTexSubImage2D" );
  1868. dllglTexSubImage2D( target, level, xoffset, yoffset, width, height, format, type, pixels );
  1869. }
  1870. static void APIENTRY logglTranslated(GLdouble x, GLdouble y, GLdouble z)
  1871. {
  1872. SIG( "glTranslated" );
  1873. dllglTranslated( x, y, z );
  1874. }
  1875. static void APIENTRY logglTranslatef(GLfloat x, GLfloat y, GLfloat z)
  1876. {
  1877. SIG( "glTranslatef" );
  1878. dllglTranslatef( x, y, z );
  1879. }
  1880. static void APIENTRY logglVertex2d(GLdouble x, GLdouble y)
  1881. {
  1882. SIG( "glVertex2d" );
  1883. dllglVertex2d( x, y );
  1884. }
  1885. static void APIENTRY logglVertex2dv(const GLdouble *v)
  1886. {
  1887. SIG( "glVertex2dv" );
  1888. dllglVertex2dv( v );
  1889. }
  1890. static void APIENTRY logglVertex2f(GLfloat x, GLfloat y)
  1891. {
  1892. SIG( "glVertex2f" );
  1893. dllglVertex2f( x, y );
  1894. }
  1895. static void APIENTRY logglVertex2fv(const GLfloat *v)
  1896. {
  1897. SIG( "glVertex2fv" );
  1898. dllglVertex2fv( v );
  1899. }
  1900. static void APIENTRY logglVertex2i(GLint x, GLint y)
  1901. {
  1902. SIG( "glVertex2i" );
  1903. dllglVertex2i( x, y );
  1904. }
  1905. static void APIENTRY logglVertex2iv(const GLint *v)
  1906. {
  1907. SIG( "glVertex2iv" );
  1908. dllglVertex2iv( v );
  1909. }
  1910. static void APIENTRY logglVertex2s(GLshort x, GLshort y)
  1911. {
  1912. SIG( "glVertex2s" );
  1913. dllglVertex2s( x, y );
  1914. }
  1915. static void APIENTRY logglVertex2sv(const GLshort *v)
  1916. {
  1917. SIG( "glVertex2sv" );
  1918. dllglVertex2sv( v );
  1919. }
  1920. static void APIENTRY logglVertex3d(GLdouble x, GLdouble y, GLdouble z)
  1921. {
  1922. SIG( "glVertex3d" );
  1923. dllglVertex3d( x, y, z );
  1924. }
  1925. static void APIENTRY logglVertex3dv(const GLdouble *v)
  1926. {
  1927. SIG( "glVertex3dv" );
  1928. dllglVertex3dv( v );
  1929. }
  1930. static void APIENTRY logglVertex3f(GLfloat x, GLfloat y, GLfloat z)
  1931. {
  1932. SIG( "glVertex3f" );
  1933. dllglVertex3f( x, y, z );
  1934. }
  1935. static void APIENTRY logglVertex3fv(const GLfloat *v)
  1936. {
  1937. SIG( "glVertex3fv" );
  1938. dllglVertex3fv( v );
  1939. }
  1940. static void APIENTRY logglVertex3i(GLint x, GLint y, GLint z)
  1941. {
  1942. SIG( "glVertex3i" );
  1943. dllglVertex3i( x, y, z );
  1944. }
  1945. static void APIENTRY logglVertex3iv(const GLint *v)
  1946. {
  1947. SIG( "glVertex3iv" );
  1948. dllglVertex3iv( v );
  1949. }
  1950. static void APIENTRY logglVertex3s(GLshort x, GLshort y, GLshort z)
  1951. {
  1952. SIG( "glVertex3s" );
  1953. dllglVertex3s( x, y, z );
  1954. }
  1955. static void APIENTRY logglVertex3sv(const GLshort *v)
  1956. {
  1957. SIG( "glVertex3sv" );
  1958. dllglVertex3sv( v );
  1959. }
  1960. static void APIENTRY logglVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
  1961. {
  1962. SIG( "glVertex4d" );
  1963. dllglVertex4d( x, y, z, w );
  1964. }
  1965. static void APIENTRY logglVertex4dv(const GLdouble *v)
  1966. {
  1967. SIG( "glVertex4dv" );
  1968. dllglVertex4dv( v );
  1969. }
  1970. static void APIENTRY logglVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
  1971. {
  1972. SIG( "glVertex4f" );
  1973. dllglVertex4f( x, y, z, w );
  1974. }
  1975. static void APIENTRY logglVertex4fv(const GLfloat *v)
  1976. {
  1977. SIG( "glVertex4fv" );
  1978. dllglVertex4fv( v );
  1979. }
  1980. static void APIENTRY logglVertex4i(GLint x, GLint y, GLint z, GLint w)
  1981. {
  1982. SIG( "glVertex4i" );
  1983. dllglVertex4i( x, y, z, w );
  1984. }
  1985. static void APIENTRY logglVertex4iv(const GLint *v)
  1986. {
  1987. SIG( "glVertex4iv" );
  1988. dllglVertex4iv( v );
  1989. }
  1990. static void APIENTRY logglVertex4s(GLshort x, GLshort y, GLshort z, GLshort w)
  1991. {
  1992. SIG( "glVertex4s" );
  1993. dllglVertex4s( x, y, z, w );
  1994. }
  1995. static void APIENTRY logglVertex4sv(const GLshort *v)
  1996. {
  1997. SIG( "glVertex4sv" );
  1998. dllglVertex4sv( v );
  1999. }
  2000. static void APIENTRY logglVertexPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
  2001. {
  2002. fprintf( winState.log_fp, "glVertexPointer( %d, %s, %d, MEM )\n", size, TypeToString( type ), stride );
  2003. fflush(winState.log_fp);
  2004. dllglVertexPointer( size, type, stride, pointer );
  2005. }
  2006. static void APIENTRY logglViewport(GLint x, GLint y, GLsizei width, GLsizei height)
  2007. {
  2008. fprintf( winState.log_fp, "glViewport( %d, %d, %d, %d )\n", x, y, width, height );
  2009. fflush(winState.log_fp);
  2010. dllglViewport( x, y, width, height );
  2011. }
  2012. static void APIENTRY logglColorTableEXT(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void* data)
  2013. {
  2014. AssertFatal(dllglColorTableEXT != NULL, "Error, shouldn't have called unsupported paletted_texture extension");
  2015. fprintf(winState.log_fp, "glColorTableEXT(%d, %d, %d, %d, %d, <data>)\n",
  2016. target,
  2017. internalFormat,
  2018. width,
  2019. format,
  2020. type);
  2021. fflush(winState.log_fp);
  2022. dllglColorTableEXT(target, internalFormat, width, format, type, data);
  2023. }
  2024. static void APIENTRY logglLockArraysEXT(GLint first, GLsizei count)
  2025. {
  2026. AssertFatal(dllglLockArraysEXT != NULL, "Error, shouldn't have called unsupported compiled_vertex_array extension");
  2027. fprintf( winState.log_fp, "glLockArraysEXT( %d, %d )\n", first, count);
  2028. fflush(winState.log_fp);
  2029. dllglLockArraysEXT(first, count);
  2030. }
  2031. static void APIENTRY logglUnlockArraysEXT()
  2032. {
  2033. AssertFatal(dllglLockArraysEXT != NULL, "Error, shouldn't have called unsupported compiled_vertex_array extension");
  2034. SIG("glUnlockArraysEXT");
  2035. dllglUnlockArraysEXT();
  2036. }
  2037. /* ARB_multitexture */
  2038. static const char* gARBMTenums[] = {
  2039. "GL_TEXTURE0_ARB", "GL_TEXTURE1_ARB", "GL_TEXTURE2_ARB",
  2040. "GL_TEXTURE3_ARB", "GL_TEXTURE4_ARB", "GL_TEXTURE5_ARB",
  2041. "GL_TEXTURE6_ARB", "GL_TEXTURE7_ARB", "GL_TEXTURE8_ARB",
  2042. "GL_TEXTURE9_ARB", "GL_TEXTURE10_ARB", "GL_TEXTURE11_ARB",
  2043. "GL_TEXTURE12_ARB", "GL_TEXTURE13_ARB", "GL_TEXTURE14_ARB",
  2044. "GL_TEXTURE15_ARB", "GL_TEXTURE16_ARB", "GL_TEXTURE17_ARB",
  2045. "GL_TEXTURE18_ARB", "GL_TEXTURE19_ARB", "GL_TEXTURE20_ARB",
  2046. "GL_TEXTURE21_ARB", "GL_TEXTURE22_ARB", "GL_TEXTURE23_ARB",
  2047. "GL_TEXTURE24_ARB", "GL_TEXTURE25_ARB", "GL_TEXTURE26_ARB",
  2048. "GL_TEXTURE27_ARB", "GL_TEXTURE28_ARB", "GL_TEXTURE29_ARB",
  2049. "GL_TEXTURE30_ARB", "GL_TEXTURE31_ARB"
  2050. };
  2051. static void APIENTRY logglActiveTextureARB(GLenum target)
  2052. {
  2053. U32 index = target - GL_TEXTURE0_ARB;
  2054. fprintf( winState.log_fp, "glActiveTexturesARB( %s )\n", gARBMTenums[index]);
  2055. fflush(winState.log_fp);
  2056. dllglActiveTextureARB(target);
  2057. }
  2058. static void APIENTRY logglClientActiveTextureARB(GLenum target)
  2059. {
  2060. U32 index = target - GL_TEXTURE0_ARB;
  2061. fprintf( winState.log_fp, "glClientActiveTexturesARB( %s )\n", gARBMTenums[index]);
  2062. fflush(winState.log_fp);
  2063. dllglClientActiveTextureARB(target);
  2064. }
  2065. static void APIENTRY logglMultiTexCoord2fARB(GLenum texture, GLfloat x, GLfloat y)
  2066. {
  2067. U32 index = texture - GL_TEXTURE0_ARB;
  2068. fprintf( winState.log_fp, "glMultiTexCoord2fARB( %s, %g, %g )\n", gARBMTenums[index], x, y);
  2069. fflush(winState.log_fp);
  2070. dllglMultiTexCoord2fARB(texture, x, y);
  2071. }
  2072. static void APIENTRY logglMultiTexCoord2fvARB(GLenum texture, const GLfloat* p)
  2073. {
  2074. U32 index = texture - GL_TEXTURE0_ARB;
  2075. fprintf( winState.log_fp, "glMultiTexCoord2fARB( %s, [%g, %g] )\n", gARBMTenums[index], p[0], p[1]);
  2076. fflush(winState.log_fp);
  2077. dllglMultiTexCoord2fvARB(texture, p);
  2078. }
  2079. /* NV_vertex_array_range */
  2080. static void APIENTRY logglVertexArrayRangeNV(GLsizei length, void* pointer)
  2081. {
  2082. fprintf(winState.log_fp, "glVertexArrayRangeNV( %d, MEMORY )", length);
  2083. fflush(winState.log_fp);
  2084. dllglVertexArrayRangeNV(length, pointer);
  2085. }
  2086. static void APIENTRY logglFlushVertexArrayRangeNV()
  2087. {
  2088. SIG("glFlushVertexArrayRangeNV");
  2089. dllglFlushVertexArrayRangeNV();
  2090. }
  2091. static void* APIENTRY logwglAllocateMemoryNV(GLsizei length, GLfloat read, GLfloat write, GLfloat priority)
  2092. {
  2093. fprintf(winState.log_fp, "wglAllocateMemoryNV( %d, %g, %g, %g)", length, read, write, priority);
  2094. fflush(winState.log_fp);
  2095. return dllwglAllocateMemoryNV(length, read, write, priority);
  2096. }
  2097. static void APIENTRY logwglFreeMemoryNV(void* pointer)
  2098. {
  2099. SIG("glFreeMemoryNV(MEM)");
  2100. dllwglFreeMemoryNV(pointer);
  2101. }
  2102. /* EXT_fog_coord */
  2103. static void APIENTRY logglFogCoordfEXT(GLfloat coord)
  2104. {
  2105. fprintf( winState.log_fp, "glFogCoordEXT(%g)\n", coord);
  2106. fflush(winState.log_fp);
  2107. dllglFogCoordfEXT(coord);
  2108. }
  2109. static void APIENTRY logglFogCoordPointerEXT(GLenum type, GLsizei stride, void *pointer)
  2110. {
  2111. fprintf( winState.log_fp, "glFogCoordPointerEXT(%s, %d, MEMORY)\n", TypeToString(type), stride);
  2112. fflush(winState.log_fp);
  2113. dllglFogCoordPointerEXT(type, stride, pointer);
  2114. }
  2115. /* ARB_texture_compression */
  2116. static void APIENTRY logglCompressedTexImage3DARB(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data)
  2117. {
  2118. fprintf( winState.log_fp, "glCompressedTexImage3DARB(...)\n");
  2119. fflush(winState.log_fp);
  2120. dllglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, data);
  2121. }
  2122. static void APIENTRY logglCompressedTexImage2DARB(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
  2123. {
  2124. fprintf( winState.log_fp, "glCompressedTexImage3DARB(...)\n");
  2125. fflush(winState.log_fp);
  2126. dllglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, data);
  2127. }
  2128. static void APIENTRY logglCompressedTexImage1DARB(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data)
  2129. {
  2130. fprintf( winState.log_fp, "glCompressedTexImage3DARB(...)\n");
  2131. fflush(winState.log_fp);
  2132. dllglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, data);
  2133. }
  2134. static void APIENTRY logglCompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data)
  2135. {
  2136. fprintf( winState.log_fp, "glCompressedTexSubImage3DARB(...)\n");
  2137. fflush(winState.log_fp);
  2138. dllglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
  2139. }
  2140. static void APIENTRY logglCompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
  2141. {
  2142. fprintf( winState.log_fp, "glCompressedTexSubImage2DARB(...)\n");
  2143. fflush(winState.log_fp);
  2144. dllglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, data);
  2145. }
  2146. static void APIENTRY logglCompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data)
  2147. {
  2148. fprintf( winState.log_fp, "glCompressedTexSubImage1DARB(...)\n");
  2149. fflush(winState.log_fp);
  2150. dllglCompressedTexSubImage1DARB(target, level, xoffset, width, format, imageSize, data);
  2151. }
  2152. static void APIENTRY logglGetCompressedTexImageARB(GLenum target, GLint lod, void* img)
  2153. {
  2154. fprintf( winState.log_fp, "glGetCompressedTexImage3DARB(...)\n");
  2155. fflush(winState.log_fp);
  2156. dllglGetCompressedTexImageARB(target, lod, img);
  2157. }
  2158. /* EXT_vertex_buffer */
  2159. static GLboolean APIENTRY logglAvailableVertexBufferEXT()
  2160. {
  2161. fprintf( winState.log_fp, "glAvailableVertexBufferEXT(...)\n");
  2162. fflush(winState.log_fp);
  2163. return dllglAvailableVertexBufferEXT();
  2164. }
  2165. static GLint APIENTRY logglAllocateVertexBufferEXT(GLsizei size, GLint format, GLboolean preserve)
  2166. {
  2167. fprintf( winState.log_fp, "glAllocateVertexBufferEXT(...)\n");
  2168. fflush(winState.log_fp);
  2169. return dllglAllocateVertexBufferEXT(size, format, preserve);
  2170. }
  2171. static void * APIENTRY logglLockVertexBufferEXT(GLint handle, GLsizei size)
  2172. {
  2173. fprintf( winState.log_fp, "glLockVertexBufferEXT(...)\n");
  2174. fflush(winState.log_fp);
  2175. return dllglLockVertexBufferEXT(handle, size);
  2176. }
  2177. static void APIENTRY logglUnlockVertexBufferEXT(GLint handle)
  2178. {
  2179. fprintf( winState.log_fp, "glUnlockVertexBufferEXT(...)\n");
  2180. fflush(winState.log_fp);
  2181. dllglUnlockVertexBufferEXT(handle);
  2182. }
  2183. static void APIENTRY logglSetVertexBufferEXT(GLint handle)
  2184. {
  2185. fprintf( winState.log_fp, "glSetVertexBufferEXT(...)\n");
  2186. fflush(winState.log_fp);
  2187. dllglSetVertexBufferEXT(handle);
  2188. }
  2189. static void APIENTRY logglOffsetVertexBufferEXT(GLint handle, GLuint offset)
  2190. {
  2191. fprintf( winState.log_fp, "glOffsetVertexBufferEXT(...)\n");
  2192. fflush(winState.log_fp);
  2193. dllglOffsetVertexBufferEXT(handle, offset);
  2194. }
  2195. static void APIENTRY logglFillVertexBufferEXT(GLint handle, GLint first, GLsizei count)
  2196. {
  2197. fprintf( winState.log_fp, "glFillVertexBufferEXT(...)\n");
  2198. fflush(winState.log_fp);
  2199. dllglFillVertexBufferEXT(handle, first, count);
  2200. }
  2201. static void APIENTRY logglFreeVertexBufferEXT(GLint handle)
  2202. {
  2203. fprintf( winState.log_fp, "glFreeVertexBufferEXT(...)\n");
  2204. fflush(winState.log_fp);
  2205. dllglFreeVertexBufferEXT(handle);
  2206. }
  2207. static void APIENTRY logglBlendColorEXT(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
  2208. {
  2209. fprintf( winState.log_fp, "glBlendColorEXT( %g, %g, %g, %g )\n", red, green, blue, alpha );
  2210. fflush(winState.log_fp);
  2211. dllglBlendColorEXT(red, green, blue, alpha);
  2212. }
  2213. static void APIENTRY logglBlendEquationEXT(GLenum mode)
  2214. {
  2215. fprintf( winState.log_fp, "glBlendEquationEXT( %d )\n", mode );
  2216. fflush(winState.log_fp);
  2217. dllglBlendEquationEXT(mode);
  2218. }
  2219. //-------------------------------------------------------
  2220. static U32 getIndex(GLenum type, const void *indices, U32 i)
  2221. {
  2222. if(type == GL_UNSIGNED_BYTE)
  2223. return ((U8 *) indices)[i];
  2224. else if(type == GL_UNSIGNED_SHORT)
  2225. return ((U16 *) indices)[i];
  2226. else
  2227. return ((U32 *) indices)[i];
  2228. }
  2229. static BOOL WINAPI outlineSwapBuffers(HDC dc)
  2230. {
  2231. bool ret = dlldwglSwapBuffers(dc);
  2232. glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  2233. return ret;
  2234. }
  2235. static void APIENTRY outlineDrawElements(GLenum mode, GLsizei count, GLenum type, const void *indices)
  2236. {
  2237. if(mode == GL_POLYGON)
  2238. mode = GL_LINE_LOOP;
  2239. if(mode == GL_POINTS || mode == GL_LINE_STRIP || mode == GL_LINE_LOOP || mode == GL_LINES)
  2240. dllglDrawElements( mode, count, type, indices );
  2241. else
  2242. {
  2243. glBegin(GL_LINES);
  2244. if(mode == GL_TRIANGLE_STRIP)
  2245. {
  2246. U32 i;
  2247. for(i = 0; i < (U32)(count - 1); i++)
  2248. {
  2249. dllglArrayElement(getIndex(type, indices, i));
  2250. dllglArrayElement(getIndex(type, indices, i + 1));
  2251. if(i + 2 != count)
  2252. {
  2253. dllglArrayElement(getIndex(type, indices, i));
  2254. dllglArrayElement(getIndex(type, indices, i + 2));
  2255. }
  2256. }
  2257. }
  2258. else if(mode == GL_TRIANGLE_FAN)
  2259. {
  2260. for(U32 i = 1; i < (U32)count; i ++)
  2261. {
  2262. dllglArrayElement(getIndex(type, indices, 0));
  2263. dllglArrayElement(getIndex(type, indices, i));
  2264. if(i != count - 1)
  2265. {
  2266. dllglArrayElement(getIndex(type, indices, i));
  2267. dllglArrayElement(getIndex(type, indices, i + 1));
  2268. }
  2269. }
  2270. }
  2271. else if(mode == GL_TRIANGLES)
  2272. {
  2273. for(U32 i = 3; i <= (U32)count; i += 3)
  2274. {
  2275. dllglArrayElement(getIndex(type, indices, i - 3));
  2276. dllglArrayElement(getIndex(type, indices, i - 2));
  2277. dllglArrayElement(getIndex(type, indices, i - 2));
  2278. dllglArrayElement(getIndex(type, indices, i - 1));
  2279. dllglArrayElement(getIndex(type, indices, i - 3));
  2280. dllglArrayElement(getIndex(type, indices, i - 1));
  2281. }
  2282. }
  2283. else if(mode == GL_QUADS)
  2284. {
  2285. for(U32 i = 4; i <= (U32)count; i += 4)
  2286. {
  2287. dllglArrayElement(getIndex(type, indices, i - 4));
  2288. dllglArrayElement(getIndex(type, indices, i - 3));
  2289. dllglArrayElement(getIndex(type, indices, i - 3));
  2290. dllglArrayElement(getIndex(type, indices, i - 2));
  2291. dllglArrayElement(getIndex(type, indices, i - 2));
  2292. dllglArrayElement(getIndex(type, indices, i - 1));
  2293. dllglArrayElement(getIndex(type, indices, i - 4));
  2294. dllglArrayElement(getIndex(type, indices, i - 1));
  2295. }
  2296. }
  2297. else if(mode == GL_QUAD_STRIP)
  2298. {
  2299. if(count < 4)
  2300. return;
  2301. dllglArrayElement(getIndex(type, indices, 0));
  2302. dllglArrayElement(getIndex(type, indices, 1));
  2303. for(U32 i = 4; i <= (U32)count; i += 2)
  2304. {
  2305. dllglArrayElement(getIndex(type, indices, i - 4));
  2306. dllglArrayElement(getIndex(type, indices, i - 2));
  2307. dllglArrayElement(getIndex(type, indices, i - 3));
  2308. dllglArrayElement(getIndex(type, indices, i - 1));
  2309. dllglArrayElement(getIndex(type, indices, i - 2));
  2310. dllglArrayElement(getIndex(type, indices, i - 1));
  2311. }
  2312. }
  2313. glEnd();
  2314. }
  2315. }
  2316. static void APIENTRY outlineDrawArrays(GLenum mode, GLint first, GLsizei count)
  2317. {
  2318. if(mode == GL_POLYGON)
  2319. mode = GL_LINE_LOOP;
  2320. if(mode == GL_POINTS || mode == GL_LINE_STRIP || mode == GL_LINE_LOOP || mode == GL_LINES)
  2321. dllglDrawArrays( mode, first, count );
  2322. else
  2323. {
  2324. glBegin(GL_LINES);
  2325. if(mode == GL_TRIANGLE_STRIP)
  2326. {
  2327. U32 i;
  2328. for(i = 0; i < (U32)count - 1; i++)
  2329. {
  2330. dllglArrayElement(first + i);
  2331. dllglArrayElement(first + i + 1);
  2332. if(i + 2 != count)
  2333. {
  2334. dllglArrayElement(first + i);
  2335. dllglArrayElement(first + i + 2);
  2336. }
  2337. }
  2338. }
  2339. else if(mode == GL_TRIANGLE_FAN)
  2340. {
  2341. for(U32 i = 1; i < (U32)count; i ++)
  2342. {
  2343. dllglArrayElement(first);
  2344. dllglArrayElement(first + i);
  2345. if(i != count - 1)
  2346. {
  2347. dllglArrayElement(first + i);
  2348. dllglArrayElement(first + i + 1);
  2349. }
  2350. }
  2351. }
  2352. else if(mode == GL_TRIANGLES)
  2353. {
  2354. for(U32 i = 3; i <= (U32)count; i += 3)
  2355. {
  2356. dllglArrayElement(first + i - 3);
  2357. dllglArrayElement(first + i - 2);
  2358. dllglArrayElement(first + i - 2);
  2359. dllglArrayElement(first + i - 1);
  2360. dllglArrayElement(first + i - 3);
  2361. dllglArrayElement(first + i - 1);
  2362. }
  2363. }
  2364. else if(mode == GL_QUADS)
  2365. {
  2366. for(U32 i = 4; i <= (U32)count; i += 4)
  2367. {
  2368. dllglArrayElement(first + i - 4);
  2369. dllglArrayElement(first + i - 3);
  2370. dllglArrayElement(first + i - 3);
  2371. dllglArrayElement(first + i - 2);
  2372. dllglArrayElement(first + i - 2);
  2373. dllglArrayElement(first + i - 1);
  2374. dllglArrayElement(first + i - 4);
  2375. dllglArrayElement(first + i - 1);
  2376. }
  2377. }
  2378. else if(mode == GL_QUAD_STRIP)
  2379. {
  2380. if(count < 4)
  2381. return;
  2382. dllglArrayElement(first + 0);
  2383. dllglArrayElement(first + 1);
  2384. for(U32 i = 4; i <= (U32)count; i += 2)
  2385. {
  2386. dllglArrayElement(first + i - 4);
  2387. dllglArrayElement(first + i - 2);
  2388. dllglArrayElement(first + i - 3);
  2389. dllglArrayElement(first + i - 1);
  2390. dllglArrayElement(first + i - 2);
  2391. dllglArrayElement(first + i - 1);
  2392. }
  2393. }
  2394. glEnd();
  2395. }
  2396. }
  2397. static void APIENTRY perfDrawArrays(GLenum mode, GLint first, GLsizei count)
  2398. {
  2399. gGLState.primCount[gGLState.primMode]++;
  2400. U32 tc = 0;
  2401. if(mode == GL_TRIANGLES)
  2402. tc = count / 3;
  2403. else if(mode == GL_TRIANGLE_FAN || mode == GL_TRIANGLE_STRIP)
  2404. tc = count - 2;
  2405. gGLState.triCount[gGLState.primMode] += tc;
  2406. dllglDrawArrays( mode, first, count );
  2407. }
  2408. static void APIENTRY perfDrawElements(GLenum mode, GLsizei count, GLenum type, const void *indices)
  2409. {
  2410. gGLState.primCount[gGLState.primMode]++;
  2411. U32 tc = 0;
  2412. if(mode == GL_TRIANGLES)
  2413. tc = count / 3;
  2414. else if(mode == GL_TRIANGLE_FAN || mode == GL_TRIANGLE_STRIP)
  2415. tc = count - 2;
  2416. gGLState.triCount[gGLState.primMode] += tc;
  2417. dllglDrawElements( mode, count, type, indices );
  2418. }
  2419. #include "winGLSpecial_ScriptBinding.h"