llglheaders.h
上传用户:king477883
上传日期:2021-03-01
资源大小:9553k
文件大小:41k
源码类别:

游戏引擎

开发平台:

C++ Builder

  1. /** 
  2.  * @file llglheaders.h
  3.  * @brief LLGL definitions
  4.  *
  5.  * $LicenseInfo:firstyear=2001&license=viewergpl$
  6.  * 
  7.  * Copyright (c) 2001-2010, Linden Research, Inc.
  8.  * 
  9.  * Second Life Viewer Source Code
  10.  * The source code in this file ("Source Code") is provided by Linden Lab
  11.  * to you under the terms of the GNU General Public License, version 2.0
  12.  * ("GPL"), unless you have obtained a separate licensing agreement
  13.  * ("Other License"), formally executed by you and Linden Lab.  Terms of
  14.  * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15.  * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16.  * 
  17.  * There are special exceptions to the terms and conditions of the GPL as
  18.  * it is applied to this Source Code. View the full text of the exception
  19.  * in the file doc/FLOSS-exception.txt in this software distribution, or
  20.  * online at
  21.  * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22.  * 
  23.  * By copying, modifying or distributing this software, you acknowledge
  24.  * that you have read and understood your obligations described above,
  25.  * and agree to abide by those obligations.
  26.  * 
  27.  * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28.  * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29.  * COMPLETENESS OR PERFORMANCE.
  30.  * $/LicenseInfo$
  31.  */
  32. #ifndef LL_LLGLHEADERS_H
  33. #define LL_LLGLHEADERS_H
  34. #if LL_SOLARIS
  35. #   if defined(__sparc)
  36. #      define I_NEED_OS2_H  //  avoiding BOOL conflicts
  37. #   endif
  38. #   include "GL/gl.h"
  39. #   if defined(__sparc)
  40. #      undef I_NEED_OS2_H
  41. #      ifdef BOOL
  42. #         undef BOOL // now get rid of Xmd.h crap
  43. #      endif
  44. #   endif
  45. #   include "GL/glx.h"
  46. #   define  GL_GLEXT_PROTOTYPES 1
  47. #   include "GL/glext.h"
  48. #   include "GL/glu.h"
  49. #   include "GL/glx.h"
  50. #   define  GLX_GLXEXT_PROTOTYPES 1
  51. #   include "GL/glxext.h"
  52. //#   define  GLH_EXT_GET_PROC_ADDRESS(p) glXGetProcAddressARB((const GLubyte*)(p))
  53. #   define  GLH_EXT_GET_PROC_ADDRESS(p) glXGetProcAddress((const GLubyte*)(p))
  54. // The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly
  55. // This header is distributed with SL.  You'll find it in linden/libraries/include/GL/
  56. # define __APPLE__
  57. # include "GL/glh_extensions.h"
  58. # undef __APPLE__
  59. // GL_ARB_vertex_buffer_object
  60. extern PFNGLBINDBUFFERARBPROC glBindBufferARB;
  61. extern PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB;
  62. extern PFNGLGENBUFFERSARBPROC glGenBuffersARB;
  63. extern PFNGLISBUFFERARBPROC glIsBufferARB;
  64. extern PFNGLBUFFERDATAARBPROC glBufferDataARB;
  65. extern PFNGLBUFFERSUBDATAARBPROC glBufferSubDataARB;
  66. extern PFNGLGETBUFFERSUBDATAARBPROC glGetBufferSubDataARB;
  67. extern PFNGLMAPBUFFERARBPROC glMapBufferARB;
  68. extern PFNGLUNMAPBUFFERARBPROC glUnmapBufferARB;
  69. extern PFNGLGETBUFFERPARAMETERIVARBPROC glGetBufferParameterivARB;
  70. extern PFNGLGETBUFFERPOINTERVARBPROC glGetBufferPointervARB;
  71. // GL_ATI_vertex_array_object
  72. extern PFNGLNEWOBJECTBUFFERATIPROC glNewObjectBufferATI;
  73. extern PFNGLISOBJECTBUFFERATIPROC glIsObjectBufferATI;
  74. extern PFNGLUPDATEOBJECTBUFFERATIPROC glUpdateObjectBufferATI;
  75. extern PFNGLGETOBJECTBUFFERFVATIPROC glGetObjectBufferfvATI;
  76. extern PFNGLGETOBJECTBUFFERIVATIPROC glGetObjectBufferivATI;
  77. extern PFNGLFREEOBJECTBUFFERATIPROC     glFreeObjectBufferATI;
  78. extern PFNGLARRAYOBJECTATIPROC glArrayObjectATI;
  79. extern PFNGLVERTEXATTRIBARRAYOBJECTATIPROC glVertexAttribArrayObjectATI;
  80. extern PFNGLGETARRAYOBJECTFVATIPROC glGetArrayObjectfvATI;
  81. extern PFNGLGETARRAYOBJECTIVATIPROC glGetArrayObjectivATI;
  82. extern PFNGLVARIANTARRAYOBJECTATIPROC glVariantObjectArrayATI;
  83. extern PFNGLGETVARIANTARRAYOBJECTFVATIPROC glGetVariantArrayObjectfvATI;
  84. extern PFNGLGETVARIANTARRAYOBJECTIVATIPROC glGetVariantArrayObjectivATI;
  85. // GL_ARB_occlusion_query
  86. extern PFNGLGENQUERIESARBPROC glGenQueriesARB;
  87. extern PFNGLDELETEQUERIESARBPROC glDeleteQueriesARB;
  88. extern PFNGLISQUERYARBPROC glIsQueryARB;
  89. extern PFNGLBEGINQUERYARBPROC glBeginQueryARB;
  90. extern PFNGLENDQUERYARBPROC glEndQueryARB;
  91. extern PFNGLGETQUERYIVARBPROC glGetQueryivARB;
  92. extern PFNGLGETQUERYOBJECTIVARBPROC glGetQueryObjectivARB;
  93. extern PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB;
  94. // GL_ARB_point_parameters
  95. extern PFNGLPOINTPARAMETERFARBPROC glPointParameterfARB;
  96. extern PFNGLPOINTPARAMETERFVARBPROC glPointParameterfvARB;
  97. // GL_ARB_shader_objects
  98. extern PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
  99. extern PFNGLGETHANDLEARBPROC glGetHandleARB;
  100. extern PFNGLDETACHOBJECTARBPROC glDetachObjectARB;
  101. extern PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
  102. extern PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
  103. extern PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
  104. extern PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB;
  105. extern PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
  106. extern PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
  107. extern PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB;
  108. extern PFNGLVALIDATEPROGRAMARBPROC glValidateProgramARB;
  109. extern PFNGLUNIFORM1FARBPROC glUniform1fARB;
  110. extern PFNGLUNIFORM2FARBPROC glUniform2fARB;
  111. extern PFNGLUNIFORM3FARBPROC glUniform3fARB;
  112. extern PFNGLUNIFORM4FARBPROC glUniform4fARB;
  113. extern PFNGLUNIFORM1IARBPROC glUniform1iARB;
  114. extern PFNGLUNIFORM2IARBPROC glUniform2iARB;
  115. extern PFNGLUNIFORM3IARBPROC glUniform3iARB;
  116. extern PFNGLUNIFORM4IARBPROC glUniform4iARB;
  117. extern PFNGLUNIFORM1FVARBPROC glUniform1fvARB;
  118. extern PFNGLUNIFORM2FVARBPROC glUniform2fvARB;
  119. extern PFNGLUNIFORM3FVARBPROC glUniform3fvARB;
  120. extern PFNGLUNIFORM4FVARBPROC glUniform4fvARB;
  121. extern PFNGLUNIFORM1IVARBPROC glUniform1ivARB;
  122. extern PFNGLUNIFORM2IVARBPROC glUniform2ivARB;
  123. extern PFNGLUNIFORM3IVARBPROC glUniform3ivARB;
  124. extern PFNGLUNIFORM4IVARBPROC glUniform4ivARB;
  125. extern PFNGLUNIFORMMATRIX2FVARBPROC glUniformMatrix2fvARB;
  126. extern PFNGLUNIFORMMATRIX3FVARBPROC glUniformMatrix3fvARB;
  127. extern PFNGLUNIFORMMATRIX4FVARBPROC glUniformMatrix4fvARB;
  128. extern PFNGLGETOBJECTPARAMETERFVARBPROC glGetObjectParameterfvARB;
  129. extern PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
  130. extern PFNGLGETINFOLOGARBPROC glGetInfoLogARB;
  131. extern PFNGLGETATTACHEDOBJECTSARBPROC glGetAttachedObjectsARB;
  132. extern PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
  133. extern PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB;
  134. extern PFNGLGETUNIFORMFVARBPROC glGetUniformfvARB;
  135. extern PFNGLGETUNIFORMIVARBPROC glGetUniformivARB;
  136. extern PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB;
  137. // GL_ARB_vertex_shader
  138. extern PFNGLVERTEXATTRIB1DARBPROC glVertexAttrib1dARB;
  139. extern PFNGLVERTEXATTRIB1DVARBPROC glVertexAttrib1dvARB;
  140. extern PFNGLVERTEXATTRIB1FARBPROC glVertexAttrib1fARB;
  141. extern PFNGLVERTEXATTRIB1FVARBPROC glVertexAttrib1fvARB;
  142. extern PFNGLVERTEXATTRIB1SARBPROC glVertexAttrib1sARB;
  143. extern PFNGLVERTEXATTRIB1SVARBPROC glVertexAttrib1svARB;
  144. extern PFNGLVERTEXATTRIB2DARBPROC glVertexAttrib2dARB;
  145. extern PFNGLVERTEXATTRIB2DVARBPROC glVertexAttrib2dvARB;
  146. extern PFNGLVERTEXATTRIB2FARBPROC glVertexAttrib2fARB;
  147. extern PFNGLVERTEXATTRIB2FVARBPROC glVertexAttrib2fvARB;
  148. extern PFNGLVERTEXATTRIB2SARBPROC glVertexAttrib2sARB;
  149. extern PFNGLVERTEXATTRIB2SVARBPROC glVertexAttrib2svARB;
  150. extern PFNGLVERTEXATTRIB3DARBPROC glVertexAttrib3dARB;
  151. extern PFNGLVERTEXATTRIB3DVARBPROC glVertexAttrib3dvARB;
  152. extern PFNGLVERTEXATTRIB3FARBPROC glVertexAttrib3fARB;
  153. extern PFNGLVERTEXATTRIB3FVARBPROC glVertexAttrib3fvARB;
  154. extern PFNGLVERTEXATTRIB3SARBPROC glVertexAttrib3sARB;
  155. extern PFNGLVERTEXATTRIB3SVARBPROC glVertexAttrib3svARB;
  156. extern PFNGLVERTEXATTRIB4NBVARBPROC glVertexAttrib4nbvARB;
  157. extern PFNGLVERTEXATTRIB4NIVARBPROC glVertexAttrib4nivARB;
  158. extern PFNGLVERTEXATTRIB4NSVARBPROC glVertexAttrib4nsvARB;
  159. extern PFNGLVERTEXATTRIB4NUBARBPROC glVertexAttrib4nubARB;
  160. extern PFNGLVERTEXATTRIB4NUBVARBPROC glVertexAttrib4nubvARB;
  161. extern PFNGLVERTEXATTRIB4NUIVARBPROC glVertexAttrib4nuivARB;
  162. extern PFNGLVERTEXATTRIB4NUSVARBPROC glVertexAttrib4nusvARB;
  163. extern PFNGLVERTEXATTRIB4BVARBPROC glVertexAttrib4bvARB;
  164. extern PFNGLVERTEXATTRIB4DARBPROC glVertexAttrib4dARB;
  165. extern PFNGLVERTEXATTRIB4DVARBPROC glVertexAttrib4dvARB;
  166. extern PFNGLVERTEXATTRIB4FARBPROC glVertexAttrib4fARB;
  167. extern PFNGLVERTEXATTRIB4FVARBPROC glVertexAttrib4fvARB;
  168. extern PFNGLVERTEXATTRIB4IVARBPROC glVertexAttrib4ivARB;
  169. extern PFNGLVERTEXATTRIB4SARBPROC glVertexAttrib4sARB;
  170. extern PFNGLVERTEXATTRIB4SVARBPROC glVertexAttrib4svARB;
  171. extern PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB;
  172. extern PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB;
  173. extern PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB;
  174. extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB;
  175. extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB;
  176. extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB;
  177. extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB;
  178. extern PFNGLBINDPROGRAMARBPROC glBindProgramARB;
  179. extern PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB;
  180. extern PFNGLGENPROGRAMSARBPROC glGenProgramsARB;
  181. extern PFNGLPROGRAMENVPARAMETER4DARBPROC glProgramEnvParameter4dARB;
  182. extern PFNGLPROGRAMENVPARAMETER4DVARBPROC glProgramEnvParameter4dvARB;
  183. extern PFNGLPROGRAMENVPARAMETER4FARBPROC glProgramEnvParameter4fARB;
  184. extern PFNGLPROGRAMENVPARAMETER4FVARBPROC glProgramEnvParameter4fvARB;
  185. extern PFNGLPROGRAMLOCALPARAMETER4DARBPROC glProgramLocalParameter4dARB;
  186. extern PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glProgramLocalParameter4dvARB;
  187. extern PFNGLPROGRAMLOCALPARAMETER4FARBPROC glProgramLocalParameter4fARB;
  188. extern PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glProgramLocalParameter4fvARB;
  189. extern PFNGLGETPROGRAMENVPARAMETERDVARBPROC glGetProgramEnvParameterdvARB;
  190. extern PFNGLGETPROGRAMENVPARAMETERFVARBPROC glGetProgramEnvParameterfvARB;
  191. extern PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glGetProgramLocalParameterdvARB;
  192. extern PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glGetProgramLocalParameterfvARB;
  193. extern PFNGLGETPROGRAMIVARBPROC glGetProgramivARB;
  194. extern PFNGLGETPROGRAMSTRINGARBPROC glGetProgramStringARB;
  195. extern PFNGLGETVERTEXATTRIBDVARBPROC glGetVertexAttribdvARB;
  196. extern PFNGLGETVERTEXATTRIBFVARBPROC glGetVertexAttribfvARB;
  197. extern PFNGLGETVERTEXATTRIBIVARBPROC glGetVertexAttribivARB;
  198. extern PFNGLGETVERTEXATTRIBPOINTERVARBPROC glGetVertexAttribPointervARB;
  199. extern PFNGLISPROGRAMARBPROC glIsProgramARB;
  200. extern PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB;
  201. extern PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB;
  202. extern PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB;
  203. extern PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glCompressedTexImage2DARB;
  204. extern PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glGetCompressedTexImageARB;
  205. extern PFNGLCOLORTABLEEXTPROC glColorTableEXT;
  206. //GL_EXT_framebuffer_object
  207. extern PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT;
  208. extern PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT;
  209. extern PFNGLDELETERENDERBUFFERSEXTPROC glDeleteRenderbuffersEXT;
  210. extern PFNGLGENRENDERBUFFERSEXTPROC glGenRenderbuffersEXT;
  211. extern PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT;
  212. extern PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glGetRenderbufferParameterivEXT;
  213. extern PFNGLISFRAMEBUFFEREXTPROC glIsFramebufferEXT;
  214. extern PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT;
  215. extern PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT;
  216. extern PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT;
  217. extern PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT;
  218. extern PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glFramebufferTexture1DEXT;
  219. extern PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT;
  220. extern PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glFramebufferTexture3DEXT;
  221. extern PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT;
  222. extern PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glGetFramebufferAttachmentParameterivEXT;
  223. extern PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT;
  224. #elif LL_MESA
  225. //----------------------------------------------------------------------------
  226. // MESA headers
  227. // quotes so we get libraries/.../GL/ version
  228. #define GL_GLEXT_PROTOTYPES 1
  229. #include "GL/gl.h"
  230. #include "GL/glext.h"
  231. #include "GL/glu.h"
  232. // The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly
  233. # define __APPLE__
  234. # include "GL/glh_extensions.h"
  235. # undef __APPLE__
  236. #elif LL_LINUX 
  237. //----------------------------------------------------------------------------
  238. // Linux, MESA headers, but not necessarily assuming MESA runtime.
  239. // quotes so we get libraries/.../GL/ version
  240. #include "GL/gl.h"
  241. #include "GL/glext.h"
  242. #include "GL/glu.h"
  243. #if LL_LINUX && !LL_MESA_HEADLESS
  244. // The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly
  245. # define __APPLE__
  246. # include "GL/glh_extensions.h"
  247. # undef __APPLE__
  248. /* Although SDL very likely ends up calling glXGetProcAddress() itself,
  249.    if we use SDL_GL_GetProcAddress() then we get bogus addresses back on
  250.    some systems.  Weird. */
  251. /*# include "SDL/SDL.h"
  252.   # define GLH_EXT_GET_PROC_ADDRESS(p) SDL_GL_GetProcAddress(p) */
  253. #define GLX_GLXEXT_PROTOTYPES 1
  254. # include "GL/glx.h"
  255. # include "GL/glxext.h"
  256. // Use glXGetProcAddressARB instead of glXGetProcAddress - the ARB symbol
  257. // is considered 'legacy' but works on more machines.
  258. # define GLH_EXT_GET_PROC_ADDRESS(p) glXGetProcAddressARB((const GLubyte*)(p))
  259. #endif // LL_LINUX && !LL_MESA_HEADLESS
  260. #if LL_LINUX && defined(WINGDIAPI)
  261. // WINGDIAPI gets set if we are using the linux nvidia gl.h header which needs
  262. // the functions below setting up.
  263. # define LL_LINUX_NV_GL_HEADERS 1
  264. #else
  265. # define LL_LINUX_NV_GL_HEADERS 0
  266. #endif // LL_LINUX && defined(WINGDIAPI)
  267. #if LL_LINUX_NV_GL_HEADERS
  268. // Missing functions when using nvidia headers:
  269. extern PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
  270. extern PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB;
  271. extern PFNGLDRAWRANGEELEMENTSPROC  glDrawRangeElements;
  272. #endif // LL_LINUX_NV_GL_HEADERS
  273. // GL_ARB_vertex_buffer_object
  274. extern PFNGLBINDBUFFERARBPROC glBindBufferARB;
  275. extern PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB;
  276. extern PFNGLGENBUFFERSARBPROC glGenBuffersARB;
  277. extern PFNGLISBUFFERARBPROC glIsBufferARB;
  278. extern PFNGLBUFFERDATAARBPROC glBufferDataARB;
  279. extern PFNGLBUFFERSUBDATAARBPROC glBufferSubDataARB;
  280. extern PFNGLGETBUFFERSUBDATAARBPROC glGetBufferSubDataARB;
  281. extern PFNGLMAPBUFFERARBPROC glMapBufferARB;
  282. extern PFNGLUNMAPBUFFERARBPROC glUnmapBufferARB;
  283. extern PFNGLGETBUFFERPARAMETERIVARBPROC glGetBufferParameterivARB;
  284. extern PFNGLGETBUFFERPOINTERVARBPROC glGetBufferPointervARB;
  285. // GL_ATI_vertex_array_object
  286. extern PFNGLNEWOBJECTBUFFERATIPROC glNewObjectBufferATI;
  287. extern PFNGLISOBJECTBUFFERATIPROC glIsObjectBufferATI;
  288. extern PFNGLUPDATEOBJECTBUFFERATIPROC glUpdateObjectBufferATI;
  289. extern PFNGLGETOBJECTBUFFERFVATIPROC glGetObjectBufferfvATI;
  290. extern PFNGLGETOBJECTBUFFERIVATIPROC glGetObjectBufferivATI;
  291. extern PFNGLFREEOBJECTBUFFERATIPROC     glFreeObjectBufferATI;
  292. extern PFNGLARRAYOBJECTATIPROC glArrayObjectATI;
  293. extern PFNGLVERTEXATTRIBARRAYOBJECTATIPROC glVertexAttribArrayObjectATI;
  294. extern PFNGLGETARRAYOBJECTFVATIPROC glGetArrayObjectfvATI;
  295. extern PFNGLGETARRAYOBJECTIVATIPROC glGetArrayObjectivATI;
  296. extern PFNGLVARIANTARRAYOBJECTATIPROC glVariantObjectArrayATI;
  297. extern PFNGLGETVARIANTARRAYOBJECTFVATIPROC glGetVariantArrayObjectfvATI;
  298. extern PFNGLGETVARIANTARRAYOBJECTIVATIPROC glGetVariantArrayObjectivATI;
  299. // GL_ARB_occlusion_query
  300. extern PFNGLGENQUERIESARBPROC glGenQueriesARB;
  301. extern PFNGLDELETEQUERIESARBPROC glDeleteQueriesARB;
  302. extern PFNGLISQUERYARBPROC glIsQueryARB;
  303. extern PFNGLBEGINQUERYARBPROC glBeginQueryARB;
  304. extern PFNGLENDQUERYARBPROC glEndQueryARB;
  305. extern PFNGLGETQUERYIVARBPROC glGetQueryivARB;
  306. extern PFNGLGETQUERYOBJECTIVARBPROC glGetQueryObjectivARB;
  307. extern PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB;
  308. // GL_ARB_point_parameters
  309. extern PFNGLPOINTPARAMETERFARBPROC glPointParameterfARB;
  310. extern PFNGLPOINTPARAMETERFVARBPROC glPointParameterfvARB;
  311. // GL_ARB_shader_objects
  312. extern PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
  313. extern PFNGLGETHANDLEARBPROC glGetHandleARB;
  314. extern PFNGLDETACHOBJECTARBPROC glDetachObjectARB;
  315. extern PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
  316. extern PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
  317. extern PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
  318. extern PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB;
  319. extern PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
  320. extern PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
  321. extern PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB;
  322. extern PFNGLVALIDATEPROGRAMARBPROC glValidateProgramARB;
  323. extern PFNGLUNIFORM1FARBPROC glUniform1fARB;
  324. extern PFNGLUNIFORM2FARBPROC glUniform2fARB;
  325. extern PFNGLUNIFORM3FARBPROC glUniform3fARB;
  326. extern PFNGLUNIFORM4FARBPROC glUniform4fARB;
  327. extern PFNGLUNIFORM1IARBPROC glUniform1iARB;
  328. extern PFNGLUNIFORM2IARBPROC glUniform2iARB;
  329. extern PFNGLUNIFORM3IARBPROC glUniform3iARB;
  330. extern PFNGLUNIFORM4IARBPROC glUniform4iARB;
  331. extern PFNGLUNIFORM1FVARBPROC glUniform1fvARB;
  332. extern PFNGLUNIFORM2FVARBPROC glUniform2fvARB;
  333. extern PFNGLUNIFORM3FVARBPROC glUniform3fvARB;
  334. extern PFNGLUNIFORM4FVARBPROC glUniform4fvARB;
  335. extern PFNGLUNIFORM1IVARBPROC glUniform1ivARB;
  336. extern PFNGLUNIFORM2IVARBPROC glUniform2ivARB;
  337. extern PFNGLUNIFORM3IVARBPROC glUniform3ivARB;
  338. extern PFNGLUNIFORM4IVARBPROC glUniform4ivARB;
  339. extern PFNGLUNIFORMMATRIX2FVARBPROC glUniformMatrix2fvARB;
  340. extern PFNGLUNIFORMMATRIX3FVARBPROC glUniformMatrix3fvARB;
  341. extern PFNGLUNIFORMMATRIX4FVARBPROC glUniformMatrix4fvARB;
  342. extern PFNGLGETOBJECTPARAMETERFVARBPROC glGetObjectParameterfvARB;
  343. extern PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
  344. extern PFNGLGETINFOLOGARBPROC glGetInfoLogARB;
  345. extern PFNGLGETATTACHEDOBJECTSARBPROC glGetAttachedObjectsARB;
  346. extern PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
  347. extern PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB;
  348. extern PFNGLGETUNIFORMFVARBPROC glGetUniformfvARB;
  349. extern PFNGLGETUNIFORMIVARBPROC glGetUniformivARB;
  350. extern PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB;
  351. // GL_ARB_vertex_shader
  352. extern PFNGLVERTEXATTRIB1DARBPROC glVertexAttrib1dARB;
  353. extern PFNGLVERTEXATTRIB1DVARBPROC glVertexAttrib1dvARB;
  354. extern PFNGLVERTEXATTRIB1FARBPROC glVertexAttrib1fARB;
  355. extern PFNGLVERTEXATTRIB1FVARBPROC glVertexAttrib1fvARB;
  356. extern PFNGLVERTEXATTRIB1SARBPROC glVertexAttrib1sARB;
  357. extern PFNGLVERTEXATTRIB1SVARBPROC glVertexAttrib1svARB;
  358. extern PFNGLVERTEXATTRIB2DARBPROC glVertexAttrib2dARB;
  359. extern PFNGLVERTEXATTRIB2DVARBPROC glVertexAttrib2dvARB;
  360. extern PFNGLVERTEXATTRIB2FARBPROC glVertexAttrib2fARB;
  361. extern PFNGLVERTEXATTRIB2FVARBPROC glVertexAttrib2fvARB;
  362. extern PFNGLVERTEXATTRIB2SARBPROC glVertexAttrib2sARB;
  363. extern PFNGLVERTEXATTRIB2SVARBPROC glVertexAttrib2svARB;
  364. extern PFNGLVERTEXATTRIB3DARBPROC glVertexAttrib3dARB;
  365. extern PFNGLVERTEXATTRIB3DVARBPROC glVertexAttrib3dvARB;
  366. extern PFNGLVERTEXATTRIB3FARBPROC glVertexAttrib3fARB;
  367. extern PFNGLVERTEXATTRIB3FVARBPROC glVertexAttrib3fvARB;
  368. extern PFNGLVERTEXATTRIB3SARBPROC glVertexAttrib3sARB;
  369. extern PFNGLVERTEXATTRIB3SVARBPROC glVertexAttrib3svARB;
  370. extern PFNGLVERTEXATTRIB4NBVARBPROC glVertexAttrib4nbvARB;
  371. extern PFNGLVERTEXATTRIB4NIVARBPROC glVertexAttrib4nivARB;
  372. extern PFNGLVERTEXATTRIB4NSVARBPROC glVertexAttrib4nsvARB;
  373. extern PFNGLVERTEXATTRIB4NUBARBPROC glVertexAttrib4nubARB;
  374. extern PFNGLVERTEXATTRIB4NUBVARBPROC glVertexAttrib4nubvARB;
  375. extern PFNGLVERTEXATTRIB4NUIVARBPROC glVertexAttrib4nuivARB;
  376. extern PFNGLVERTEXATTRIB4NUSVARBPROC glVertexAttrib4nusvARB;
  377. extern PFNGLVERTEXATTRIB4BVARBPROC glVertexAttrib4bvARB;
  378. extern PFNGLVERTEXATTRIB4DARBPROC glVertexAttrib4dARB;
  379. extern PFNGLVERTEXATTRIB4DVARBPROC glVertexAttrib4dvARB;
  380. extern PFNGLVERTEXATTRIB4FARBPROC glVertexAttrib4fARB;
  381. extern PFNGLVERTEXATTRIB4FVARBPROC glVertexAttrib4fvARB;
  382. extern PFNGLVERTEXATTRIB4IVARBPROC glVertexAttrib4ivARB;
  383. extern PFNGLVERTEXATTRIB4SARBPROC glVertexAttrib4sARB;
  384. extern PFNGLVERTEXATTRIB4SVARBPROC glVertexAttrib4svARB;
  385. extern PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB;
  386. extern PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB;
  387. extern PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB;
  388. extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB;
  389. extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB;
  390. extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB;
  391. extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB;
  392. extern PFNGLBINDPROGRAMARBPROC glBindProgramARB;
  393. extern PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB;
  394. extern PFNGLGENPROGRAMSARBPROC glGenProgramsARB;
  395. extern PFNGLPROGRAMENVPARAMETER4DARBPROC glProgramEnvParameter4dARB;
  396. extern PFNGLPROGRAMENVPARAMETER4DVARBPROC glProgramEnvParameter4dvARB;
  397. extern PFNGLPROGRAMENVPARAMETER4FARBPROC glProgramEnvParameter4fARB;
  398. extern PFNGLPROGRAMENVPARAMETER4FVARBPROC glProgramEnvParameter4fvARB;
  399. extern PFNGLPROGRAMLOCALPARAMETER4DARBPROC glProgramLocalParameter4dARB;
  400. extern PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glProgramLocalParameter4dvARB;
  401. extern PFNGLPROGRAMLOCALPARAMETER4FARBPROC glProgramLocalParameter4fARB;
  402. extern PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glProgramLocalParameter4fvARB;
  403. extern PFNGLGETPROGRAMENVPARAMETERDVARBPROC glGetProgramEnvParameterdvARB;
  404. extern PFNGLGETPROGRAMENVPARAMETERFVARBPROC glGetProgramEnvParameterfvARB;
  405. extern PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glGetProgramLocalParameterdvARB;
  406. extern PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glGetProgramLocalParameterfvARB;
  407. extern PFNGLGETPROGRAMIVARBPROC glGetProgramivARB;
  408. extern PFNGLGETPROGRAMSTRINGARBPROC glGetProgramStringARB;
  409. extern PFNGLGETVERTEXATTRIBDVARBPROC glGetVertexAttribdvARB;
  410. extern PFNGLGETVERTEXATTRIBFVARBPROC glGetVertexAttribfvARB;
  411. extern PFNGLGETVERTEXATTRIBIVARBPROC glGetVertexAttribivARB;
  412. extern PFNGLGETVERTEXATTRIBPOINTERVARBPROC glGetVertexAttribPointervARB;
  413. extern PFNGLISPROGRAMARBPROC glIsProgramARB;
  414. extern PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB;
  415. extern PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB;
  416. extern PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB;
  417. extern PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glCompressedTexImage2DARB;
  418. extern PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glGetCompressedTexImageARB;
  419. //GL_EXT_framebuffer_object
  420. extern PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT;
  421. extern PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT;
  422. extern PFNGLDELETERENDERBUFFERSEXTPROC glDeleteRenderbuffersEXT;
  423. extern PFNGLGENRENDERBUFFERSEXTPROC glGenRenderbuffersEXT;
  424. extern PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT;
  425. extern PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glGetRenderbufferParameterivEXT;
  426. extern PFNGLISFRAMEBUFFEREXTPROC glIsFramebufferEXT;
  427. extern PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT;
  428. extern PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT;
  429. extern PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT;
  430. extern PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT;
  431. extern PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glFramebufferTexture1DEXT;
  432. extern PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT;
  433. extern PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glFramebufferTexture3DEXT;
  434. extern PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT;
  435. extern PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glGetFramebufferAttachmentParameterivEXT;
  436. extern PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT;
  437. // GL_EXT_framebuffer_multisample
  438. extern PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glRenderbufferStorageMultisampleEXT;
  439. // GL_EXT_framebuffer_blit
  440. extern PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT;
  441. //GL_ARB_draw_buffers
  442. extern PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB;
  443. #elif LL_WINDOWS
  444. // windows gl headers depend on things like APIENTRY, so include windows.
  445. #define WIN32_LEAN_AND_MEAN
  446. #include <winsock2.h>
  447. #include <windows.h>
  448. //----------------------------------------------------------------------------
  449. #include <GL/gl.h>
  450. #include <GL/glu.h>
  451. // quotes so we get libraries/.../GL/ version
  452. #include "GL/glext.h"
  453. #include "GL/glh_extensions.h"
  454. // GL_ARB_vertex_buffer_object
  455. extern PFNGLBINDBUFFERARBPROC glBindBufferARB;
  456. extern PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB;
  457. extern PFNGLGENBUFFERSARBPROC glGenBuffersARB;
  458. extern PFNGLISBUFFERARBPROC glIsBufferARB;
  459. extern PFNGLBUFFERDATAARBPROC glBufferDataARB;
  460. extern PFNGLBUFFERSUBDATAARBPROC glBufferSubDataARB;
  461. extern PFNGLGETBUFFERSUBDATAARBPROC glGetBufferSubDataARB;
  462. extern PFNGLMAPBUFFERARBPROC glMapBufferARB;
  463. extern PFNGLUNMAPBUFFERARBPROC glUnmapBufferARB;
  464. extern PFNGLGETBUFFERPARAMETERIVARBPROC glGetBufferParameterivARB;
  465. extern PFNGLGETBUFFERPOINTERVARBPROC glGetBufferPointervARB;
  466. // GL_ATI_vertex_array_object
  467. extern PFNGLNEWOBJECTBUFFERATIPROC glNewObjectBufferATI;
  468. extern PFNGLISOBJECTBUFFERATIPROC glIsObjectBufferATI;
  469. extern PFNGLUPDATEOBJECTBUFFERATIPROC glUpdateObjectBufferATI;
  470. extern PFNGLGETOBJECTBUFFERFVATIPROC glGetObjectBufferfvATI;
  471. extern PFNGLGETOBJECTBUFFERIVATIPROC glGetObjectBufferivATI;
  472. extern PFNGLFREEOBJECTBUFFERATIPROC     glFreeObjectBufferATI;
  473. extern PFNGLARRAYOBJECTATIPROC glArrayObjectATI;
  474. extern PFNGLVERTEXATTRIBARRAYOBJECTATIPROC glVertexAttribArrayObjectATI;
  475. extern PFNGLGETARRAYOBJECTFVATIPROC glGetArrayObjectfvATI;
  476. extern PFNGLGETARRAYOBJECTIVATIPROC glGetArrayObjectivATI;
  477. extern PFNGLVARIANTARRAYOBJECTATIPROC glVariantObjectArrayATI;
  478. extern PFNGLGETVARIANTARRAYOBJECTFVATIPROC glGetVariantArrayObjectfvATI;
  479. extern PFNGLGETVARIANTARRAYOBJECTIVATIPROC glGetVariantArrayObjectivATI;
  480. extern PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT;
  481. // GL_ARB_occlusion_query
  482. extern PFNGLGENQUERIESARBPROC glGenQueriesARB;
  483. extern PFNGLDELETEQUERIESARBPROC glDeleteQueriesARB;
  484. extern PFNGLISQUERYARBPROC glIsQueryARB;
  485. extern PFNGLBEGINQUERYARBPROC glBeginQueryARB;
  486. extern PFNGLENDQUERYARBPROC glEndQueryARB;
  487. extern PFNGLGETQUERYIVARBPROC glGetQueryivARB;
  488. extern PFNGLGETQUERYOBJECTIVARBPROC glGetQueryObjectivARB;
  489. extern PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB;
  490. // GL_ARB_point_parameters
  491. extern PFNGLPOINTPARAMETERFARBPROC glPointParameterfARB;
  492. extern PFNGLPOINTPARAMETERFVARBPROC glPointParameterfvARB;
  493. // GL_ARB_shader_objects
  494. extern PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
  495. extern PFNGLGETHANDLEARBPROC glGetHandleARB;
  496. extern PFNGLDETACHOBJECTARBPROC glDetachObjectARB;
  497. extern PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
  498. extern PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
  499. extern PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
  500. extern PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB;
  501. extern PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
  502. extern PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
  503. extern PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB;
  504. extern PFNGLVALIDATEPROGRAMARBPROC glValidateProgramARB;
  505. extern PFNGLUNIFORM1FARBPROC glUniform1fARB;
  506. extern PFNGLUNIFORM2FARBPROC glUniform2fARB;
  507. extern PFNGLUNIFORM3FARBPROC glUniform3fARB;
  508. extern PFNGLUNIFORM4FARBPROC glUniform4fARB;
  509. extern PFNGLUNIFORM1IARBPROC glUniform1iARB;
  510. extern PFNGLUNIFORM2IARBPROC glUniform2iARB;
  511. extern PFNGLUNIFORM3IARBPROC glUniform3iARB;
  512. extern PFNGLUNIFORM4IARBPROC glUniform4iARB;
  513. extern PFNGLUNIFORM1FVARBPROC glUniform1fvARB;
  514. extern PFNGLUNIFORM2FVARBPROC glUniform2fvARB;
  515. extern PFNGLUNIFORM3FVARBPROC glUniform3fvARB;
  516. extern PFNGLUNIFORM4FVARBPROC glUniform4fvARB;
  517. extern PFNGLUNIFORM1IVARBPROC glUniform1ivARB;
  518. extern PFNGLUNIFORM2IVARBPROC glUniform2ivARB;
  519. extern PFNGLUNIFORM3IVARBPROC glUniform3ivARB;
  520. extern PFNGLUNIFORM4IVARBPROC glUniform4ivARB;
  521. extern PFNGLUNIFORMMATRIX2FVARBPROC glUniformMatrix2fvARB;
  522. extern PFNGLUNIFORMMATRIX3FVARBPROC glUniformMatrix3fvARB;
  523. extern PFNGLUNIFORMMATRIX4FVARBPROC glUniformMatrix4fvARB;
  524. extern PFNGLGETOBJECTPARAMETERFVARBPROC glGetObjectParameterfvARB;
  525. extern PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
  526. extern PFNGLGETINFOLOGARBPROC glGetInfoLogARB;
  527. extern PFNGLGETATTACHEDOBJECTSARBPROC glGetAttachedObjectsARB;
  528. extern PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
  529. extern PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB;
  530. extern PFNGLGETUNIFORMFVARBPROC glGetUniformfvARB;
  531. extern PFNGLGETUNIFORMIVARBPROC glGetUniformivARB;
  532. extern PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB;
  533. // GL_ARB_vertex_shader
  534. extern PFNGLVERTEXATTRIB1DARBPROC glVertexAttrib1dARB;
  535. extern PFNGLVERTEXATTRIB1DVARBPROC glVertexAttrib1dvARB;
  536. extern PFNGLVERTEXATTRIB1FARBPROC glVertexAttrib1fARB;
  537. extern PFNGLVERTEXATTRIB1FVARBPROC glVertexAttrib1fvARB;
  538. extern PFNGLVERTEXATTRIB1SARBPROC glVertexAttrib1sARB;
  539. extern PFNGLVERTEXATTRIB1SVARBPROC glVertexAttrib1svARB;
  540. extern PFNGLVERTEXATTRIB2DARBPROC glVertexAttrib2dARB;
  541. extern PFNGLVERTEXATTRIB2DVARBPROC glVertexAttrib2dvARB;
  542. extern PFNGLVERTEXATTRIB2FARBPROC glVertexAttrib2fARB;
  543. extern PFNGLVERTEXATTRIB2FVARBPROC glVertexAttrib2fvARB;
  544. extern PFNGLVERTEXATTRIB2SARBPROC glVertexAttrib2sARB;
  545. extern PFNGLVERTEXATTRIB2SVARBPROC glVertexAttrib2svARB;
  546. extern PFNGLVERTEXATTRIB3DARBPROC glVertexAttrib3dARB;
  547. extern PFNGLVERTEXATTRIB3DVARBPROC glVertexAttrib3dvARB;
  548. extern PFNGLVERTEXATTRIB3FARBPROC glVertexAttrib3fARB;
  549. extern PFNGLVERTEXATTRIB3FVARBPROC glVertexAttrib3fvARB;
  550. extern PFNGLVERTEXATTRIB3SARBPROC glVertexAttrib3sARB;
  551. extern PFNGLVERTEXATTRIB3SVARBPROC glVertexAttrib3svARB;
  552. extern PFNGLVERTEXATTRIB4NBVARBPROC glVertexAttrib4nbvARB;
  553. extern PFNGLVERTEXATTRIB4NIVARBPROC glVertexAttrib4nivARB;
  554. extern PFNGLVERTEXATTRIB4NSVARBPROC glVertexAttrib4nsvARB;
  555. extern PFNGLVERTEXATTRIB4NUBARBPROC glVertexAttrib4nubARB;
  556. extern PFNGLVERTEXATTRIB4NUBVARBPROC glVertexAttrib4nubvARB;
  557. extern PFNGLVERTEXATTRIB4NUIVARBPROC glVertexAttrib4nuivARB;
  558. extern PFNGLVERTEXATTRIB4NUSVARBPROC glVertexAttrib4nusvARB;
  559. extern PFNGLVERTEXATTRIB4BVARBPROC glVertexAttrib4bvARB;
  560. extern PFNGLVERTEXATTRIB4DARBPROC glVertexAttrib4dARB;
  561. extern PFNGLVERTEXATTRIB4DVARBPROC glVertexAttrib4dvARB;
  562. extern PFNGLVERTEXATTRIB4FARBPROC glVertexAttrib4fARB;
  563. extern PFNGLVERTEXATTRIB4FVARBPROC glVertexAttrib4fvARB;
  564. extern PFNGLVERTEXATTRIB4IVARBPROC glVertexAttrib4ivARB;
  565. extern PFNGLVERTEXATTRIB4SARBPROC glVertexAttrib4sARB;
  566. extern PFNGLVERTEXATTRIB4SVARBPROC glVertexAttrib4svARB;
  567. extern PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB;
  568. extern PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB;
  569. extern PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB;
  570. extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB;
  571. extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB;
  572. extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB;
  573. extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB;
  574. extern PFNGLBINDPROGRAMARBPROC glBindProgramARB;
  575. extern PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB;
  576. extern PFNGLGENPROGRAMSARBPROC glGenProgramsARB;
  577. extern PFNGLPROGRAMENVPARAMETER4DARBPROC glProgramEnvParameter4dARB;
  578. extern PFNGLPROGRAMENVPARAMETER4DVARBPROC glProgramEnvParameter4dvARB;
  579. extern PFNGLPROGRAMENVPARAMETER4FARBPROC glProgramEnvParameter4fARB;
  580. extern PFNGLPROGRAMENVPARAMETER4FVARBPROC glProgramEnvParameter4fvARB;
  581. extern PFNGLPROGRAMLOCALPARAMETER4DARBPROC glProgramLocalParameter4dARB;
  582. extern PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glProgramLocalParameter4dvARB;
  583. extern PFNGLPROGRAMLOCALPARAMETER4FARBPROC glProgramLocalParameter4fARB;
  584. extern PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glProgramLocalParameter4fvARB;
  585. extern PFNGLGETPROGRAMENVPARAMETERDVARBPROC glGetProgramEnvParameterdvARB;
  586. extern PFNGLGETPROGRAMENVPARAMETERFVARBPROC glGetProgramEnvParameterfvARB;
  587. extern PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glGetProgramLocalParameterdvARB;
  588. extern PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glGetProgramLocalParameterfvARB;
  589. extern PFNGLGETPROGRAMIVARBPROC glGetProgramivARB;
  590. extern PFNGLGETPROGRAMSTRINGARBPROC glGetProgramStringARB;
  591. extern PFNGLGETVERTEXATTRIBDVARBPROC glGetVertexAttribdvARB;
  592. extern PFNGLGETVERTEXATTRIBFVARBPROC glGetVertexAttribfvARB;
  593. extern PFNGLGETVERTEXATTRIBIVARBPROC glGetVertexAttribivARB;
  594. extern PFNGLGETVERTEXATTRIBPOINTERVARBPROC glGetVertexAttribPointervARB;
  595. extern PFNGLISPROGRAMARBPROC glIsProgramARB;
  596. extern PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB;
  597. extern PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB;
  598. extern PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB;
  599. //GL_EXT_framebuffer_object
  600. extern PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT;
  601. extern PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT;
  602. extern PFNGLDELETERENDERBUFFERSEXTPROC glDeleteRenderbuffersEXT;
  603. extern PFNGLGENRENDERBUFFERSEXTPROC glGenRenderbuffersEXT;
  604. extern PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT;
  605. extern PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glGetRenderbufferParameterivEXT;
  606. extern PFNGLISFRAMEBUFFEREXTPROC glIsFramebufferEXT;
  607. extern PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT;
  608. extern PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT;
  609. extern PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT;
  610. extern PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT;
  611. extern PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glFramebufferTexture1DEXT;
  612. extern PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT;
  613. extern PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glFramebufferTexture3DEXT;
  614. extern PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT;
  615. extern PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glGetFramebufferAttachmentParameterivEXT;
  616. extern PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT;
  617. // GL_EXT_framebuffer_multisample
  618. extern PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glRenderbufferStorageMultisampleEXT;
  619. // GL_EXT_framebuffer_blit
  620. extern PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT;
  621. //GL_ARB_draw_buffers
  622. extern PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB;
  623. #elif LL_DARWIN
  624. //----------------------------------------------------------------------------
  625. // LL_DARWIN
  626. #include <OpenGL/gl.h>
  627. #include <OpenGL/glu.h>
  628. #define GL_EXT_separate_specular_color 1
  629. #include <OpenGL/glext.h>
  630. #include "GL/glh_extensions.h"
  631. // These symbols don't exist on 10.3.9, so they have to be declared weak.  Redeclaring them here fixes the problem.
  632. // Note that they also must not be called on 10.3.9.  This should be taken care of by a runtime check for the existence of the GL extension.
  633. #include <AvailabilityMacros.h>
  634. // GL_EXT_framebuffer_object
  635. extern GLboolean glIsRenderbufferEXT(GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  636. extern void glBindRenderbufferEXT(GLenum target, GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  637. extern void glDeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  638. extern void glGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  639. extern void glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  640. extern void glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  641. extern GLboolean glIsFramebufferEXT(GLuint framebuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  642. extern void glBindFramebufferEXT(GLenum target, GLuint framebuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  643. extern void glDeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  644. extern void glGenFramebuffersEXT(GLsizei n, GLuint *framebuffers) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  645. extern GLenum glCheckFramebufferStatusEXT(GLenum target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  646. extern void glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  647. extern void glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  648. extern void glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  649. extern void glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  650. extern void glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint *params) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  651. extern void glGenerateMipmapEXT(GLenum target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  652. // GL_ARB_draw_buffers
  653. extern void glDrawBuffersARB(GLsizei n, const GLenum* bufs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  654. #ifdef __cplusplus
  655. extern "C" {
  656. #endif
  657. //
  658. // Define vertex buffer object headers on Mac
  659. //
  660. #ifndef GL_ARB_vertex_buffer_object
  661. #define GL_BUFFER_SIZE_ARB                0x8764
  662. #define GL_BUFFER_USAGE_ARB               0x8765
  663. #define GL_ARRAY_BUFFER_ARB               0x8892
  664. #define GL_ELEMENT_ARRAY_BUFFER_ARB       0x8893
  665. #define GL_ARRAY_BUFFER_BINDING_ARB       0x8894
  666. #define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
  667. #define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
  668. #define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
  669. #define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
  670. #define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
  671. #define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
  672. #define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
  673. #define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
  674. #define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
  675. #define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
  676. #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
  677. #define GL_READ_ONLY_ARB                  0x88B8
  678. #define GL_WRITE_ONLY_ARB                 0x88B9
  679. #define GL_READ_WRITE_ARB                 0x88BA
  680. #define GL_BUFFER_ACCESS_ARB              0x88BB
  681. #define GL_BUFFER_MAPPED_ARB              0x88BC
  682. #define GL_BUFFER_MAP_POINTER_ARB         0x88BD
  683. #define GL_STREAM_DRAW_ARB                0x88E0
  684. #define GL_STREAM_READ_ARB                0x88E1
  685. #define GL_STREAM_COPY_ARB                0x88E2
  686. #define GL_STATIC_DRAW_ARB                0x88E4
  687. #define GL_STATIC_READ_ARB                0x88E5
  688. #define GL_STATIC_COPY_ARB                0x88E6
  689. #define GL_DYNAMIC_DRAW_ARB               0x88E8
  690. #define GL_DYNAMIC_READ_ARB               0x88E9
  691. #define GL_DYNAMIC_COPY_ARB               0x88EA
  692. #endif
  693. #ifndef GL_ARB_vertex_buffer_object
  694. /* GL types for handling large vertex buffer objects */
  695. typedef intptr_t GLintptrARB;
  696. typedef intptr_t GLsizeiptrARB;
  697. #endif
  698. #ifndef GL_ARB_vertex_buffer_object
  699. #define GL_ARB_vertex_buffer_object 1
  700. #ifdef GL_GLEXT_FUNCTION_POINTERS
  701. typedef void (* glBindBufferARBProcPtr) (GLenum target, GLuint buffer);
  702. typedef void (* glDeleteBufferARBProcPtr) (GLsizei n, const GLuint *buffers);
  703. typedef void (* glGenBuffersARBProcPtr) (GLsizei n, GLuint *buffers);
  704. typedef GLboolean (* glIsBufferARBProcPtr) (GLuint buffer);
  705. typedef void (* glBufferDataARBProcPtr) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
  706. typedef void (* glBufferSubDataARBProcPtr) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
  707. typedef void (* glGetBufferSubDataARBProcPtr) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
  708. typedef GLvoid* (* glMapBufferARBProcPtr) (GLenum target, GLenum access); /* Flawfinder: ignore */
  709. typedef GLboolean (* glUnmapBufferARBProcPtr) (GLenum target);
  710. typedef void (* glGetBufferParameterivARBProcPtr) (GLenum target, GLenum pname, GLint *params);
  711. typedef void (* glGetBufferPointervARBProcPtr) (GLenum target, GLenum pname, GLvoid* *params);
  712. #else
  713. extern void glBindBufferARB (GLenum, GLuint);
  714. extern void glDeleteBuffersARB (GLsizei, const GLuint *);
  715. extern void glGenBuffersARB (GLsizei, GLuint *);
  716. extern GLboolean glIsBufferARB (GLuint);
  717. extern void glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
  718. extern void glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *);
  719. extern void glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *);
  720. extern GLvoid* glMapBufferARB (GLenum, GLenum);
  721. extern GLboolean glUnmapBufferARB (GLenum);
  722. extern void glGetBufferParameterivARB (GLenum, GLenum, GLint *);
  723. extern void glGetBufferPointervARB (GLenum, GLenum, GLvoid* *);
  724. #endif /* GL_GLEXT_FUNCTION_POINTERS */
  725. #endif
  726. // May be needed for DARWIN...
  727. // #ifndef GL_ARB_compressed_tex_image
  728. // #define GL_ARB_compressed_tex_image 1
  729. // #ifdef GL_GLEXT_FUNCTION_POINTERS
  730. // typedef void (* glCompressedTexImage1D) (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid*);
  731. // typedef void (* glCompressedTexImage2D) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
  732. // typedef void (* glCompressedTexImage3D) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
  733. // typedef void (* glCompressedTexSubImage1D) (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid*);
  734. // typedef void (* glCompressedTexSubImage2D) (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
  735. // typedef void (* glCompressedTexSubImage3D) (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
  736. // typedef void (* glGetCompressedTexImage) (GLenum, GLint, GLvoid*);
  737. // #else
  738. // extern void glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid*);
  739. // extern void glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
  740. // extern void glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
  741. // extern void glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid*);
  742. // extern void glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
  743. // extern void glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
  744. // extern void glGetCompressedTexImage (GLenum, GLint, GLvoid*);
  745. // #endif /* GL_GLEXT_FUNCTION_POINTERS */
  746. // #endif
  747. #ifdef __cplusplus
  748. }
  749. #endif
  750. #include <AGL/gl.h>
  751. #endif // LL_MESA / LL_WINDOWS / LL_DARWIN
  752. #endif // LL_LLGLHEADERS_H