PageRenderTime 138ms CodeModel.GetById 62ms app.highlight 69ms RepoModel.GetById 1ms app.codeStats 1ms

/indra/llrender/llglheaders.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 1013 lines | 780 code | 91 blank | 142 comment | 4 complexity | e9a5015921226b7e080b298772a616a7 MD5 | raw file
   1/**
   2 * @file llglheaders.h
   3 * @brief LLGL definitions
   4 *
   5 * $LicenseInfo:firstyear=2001&license=viewerlgpl$
   6 * Second Life Viewer Source Code
   7 * Copyright (C) 2010, Linden Research, Inc.
   8 *
   9 * This library is free software; you can redistribute it and/or
  10 * modify it under the terms of the GNU Lesser General Public
  11 * License as published by the Free Software Foundation;
  12 * version 2.1 of the License only.
  13 *
  14 * This library is distributed in the hope that it will be useful,
  15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  17 * Lesser General Public License for more details.
  18 *
  19 * You should have received a copy of the GNU Lesser General Public
  20 * License along with this library; if not, write to the Free Software
  21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  22 *
  23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  24 * $/LicenseInfo$
  25 */
  26
  27#ifndef LL_LLGLHEADERS_H
  28#define LL_LLGLHEADERS_H
  29
  30#if LL_SOLARIS
  31#   if defined(__sparc)
  32#      define I_NEED_OS2_H 	//  avoiding BOOL conflicts
  33#   endif
  34#   include "GL/gl.h"
  35#   if defined(__sparc)
  36#      undef I_NEED_OS2_H
  37#      ifdef BOOL
  38#         undef BOOL		// now get rid of Xmd.h crap
  39#      endif
  40#   endif
  41#   include "GL/glx.h"
  42#   define  GL_GLEXT_PROTOTYPES 1
  43#   include "GL/glext.h"
  44#   include "GL/glu.h"
  45#   include "GL/glx.h"
  46#   define  GLX_GLXEXT_PROTOTYPES 1
  47#   include "GL/glxext.h"
  48//#   define  GLH_EXT_GET_PROC_ADDRESS(p) glXGetProcAddressARB((const GLubyte*)(p))
  49#   define  GLH_EXT_GET_PROC_ADDRESS(p) glXGetProcAddress((const GLubyte*)(p))
  50
  51// The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly
  52// This header is distributed with SL.  You'll find it in linden/libraries/include/GL/
  53# define __APPLE__
  54# include "GL/glh_extensions.h"
  55# undef __APPLE__
  56
  57
  58// GL_ARB_vertex_buffer_object
  59extern PFNGLBINDBUFFERARBPROC		glBindBufferARB;
  60extern PFNGLDELETEBUFFERSARBPROC	glDeleteBuffersARB;
  61extern PFNGLGENBUFFERSARBPROC		glGenBuffersARB;
  62extern PFNGLISBUFFERARBPROC			glIsBufferARB;
  63extern PFNGLBUFFERDATAARBPROC		glBufferDataARB;
  64extern PFNGLBUFFERSUBDATAARBPROC	glBufferSubDataARB;
  65extern PFNGLGETBUFFERSUBDATAARBPROC glGetBufferSubDataARB;
  66extern PFNGLMAPBUFFERARBPROC		glMapBufferARB;
  67extern PFNGLUNMAPBUFFERARBPROC		glUnmapBufferARB;
  68extern PFNGLGETBUFFERPARAMETERIVARBPROC	glGetBufferParameterivARB;
  69extern PFNGLGETBUFFERPOINTERVARBPROC	glGetBufferPointervARB;
  70
  71// GL_ARB_vertex_array_object
  72extern PFNGLBINDVERTEXARRAYPROC glBindVertexArray;
  73extern PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays;
  74extern PFNGLGENVERTEXARRAYSPROC glGenVertexArrays;
  75extern PFNGLISVERTEXARRAYPROC glIsVertexArray;
  76
  77// GL_ARB_sync
  78extern PFNGLFENCESYNCPROC				glFenceSync;
  79extern PFNGLISSYNCPROC					glIsSync;
  80extern PFNGLDELETESYNCPROC				glDeleteSync;
  81extern PFNGLCLIENTWAITSYNCPROC			glClientWaitSync;
  82extern PFNGLWAITSYNCPROC				glWaitSync;
  83extern PFNGLGETINTEGER64VPROC			glGetInteger64v;
  84extern PFNGLGETSYNCIVPROC				glGetSynciv;
  85
  86// GL_APPLE_flush_buffer_range
  87extern PFNGLBUFFERPARAMETERIAPPLEPROC	glBufferParameteriAPPLE;
  88extern PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC glFlushMappedBufferRangeAPPLE;
  89
  90// GL_ARB_map_buffer_range
  91extern PFNGLMAPBUFFERRANGEPROC			glMapBufferRange;
  92extern PFNGLFLUSHMAPPEDBUFFERRANGEPROC	glFlushMappedBufferRange;
  93
  94// GL_ATI_vertex_array_object
  95extern PFNGLNEWOBJECTBUFFERATIPROC			glNewObjectBufferATI;
  96extern PFNGLISOBJECTBUFFERATIPROC			glIsObjectBufferATI;
  97extern PFNGLUPDATEOBJECTBUFFERATIPROC		glUpdateObjectBufferATI;
  98extern PFNGLGETOBJECTBUFFERFVATIPROC		glGetObjectBufferfvATI;
  99extern PFNGLGETOBJECTBUFFERIVATIPROC		glGetObjectBufferivATI;
 100extern PFNGLFREEOBJECTBUFFERATIPROC		    glFreeObjectBufferATI;
 101extern PFNGLARRAYOBJECTATIPROC				glArrayObjectATI;
 102extern PFNGLVERTEXATTRIBARRAYOBJECTATIPROC	glVertexAttribArrayObjectATI;
 103extern PFNGLGETARRAYOBJECTFVATIPROC			glGetArrayObjectfvATI;
 104extern PFNGLGETARRAYOBJECTIVATIPROC			glGetArrayObjectivATI;
 105extern PFNGLVARIANTARRAYOBJECTATIPROC		glVariantObjectArrayATI;
 106extern PFNGLGETVARIANTARRAYOBJECTFVATIPROC	glGetVariantArrayObjectfvATI;
 107extern PFNGLGETVARIANTARRAYOBJECTIVATIPROC	glGetVariantArrayObjectivATI;
 108
 109// GL_ARB_occlusion_query
 110extern PFNGLGENQUERIESARBPROC glGenQueriesARB;
 111extern PFNGLDELETEQUERIESARBPROC glDeleteQueriesARB;
 112extern PFNGLISQUERYARBPROC glIsQueryARB;
 113extern PFNGLBEGINQUERYARBPROC glBeginQueryARB;
 114extern PFNGLENDQUERYARBPROC glEndQueryARB;
 115extern PFNGLGETQUERYIVARBPROC glGetQueryivARB;
 116extern PFNGLGETQUERYOBJECTIVARBPROC glGetQueryObjectivARB;
 117extern PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB;
 118
 119// GL_ARB_point_parameters
 120extern PFNGLPOINTPARAMETERFARBPROC glPointParameterfARB;
 121extern PFNGLPOINTPARAMETERFVARBPROC glPointParameterfvARB;
 122
 123// GL_ARB_shader_objects
 124extern PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
 125extern PFNGLGETHANDLEARBPROC glGetHandleARB;
 126extern PFNGLDETACHOBJECTARBPROC glDetachObjectARB;
 127extern PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
 128extern PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
 129extern PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
 130extern PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB;
 131extern PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
 132extern PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
 133extern PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB;
 134extern PFNGLVALIDATEPROGRAMARBPROC glValidateProgramARB;
 135extern PFNGLUNIFORM1FARBPROC glUniform1fARB;
 136extern PFNGLUNIFORM2FARBPROC glUniform2fARB;
 137extern PFNGLUNIFORM3FARBPROC glUniform3fARB;
 138extern PFNGLUNIFORM4FARBPROC glUniform4fARB;
 139extern PFNGLUNIFORM1IARBPROC glUniform1iARB;
 140extern PFNGLUNIFORM2IARBPROC glUniform2iARB;
 141extern PFNGLUNIFORM3IARBPROC glUniform3iARB;
 142extern PFNGLUNIFORM4IARBPROC glUniform4iARB;
 143extern PFNGLUNIFORM1FVARBPROC glUniform1fvARB;
 144extern PFNGLUNIFORM2FVARBPROC glUniform2fvARB;
 145extern PFNGLUNIFORM3FVARBPROC glUniform3fvARB;
 146extern PFNGLUNIFORM4FVARBPROC glUniform4fvARB;
 147extern PFNGLUNIFORM1IVARBPROC glUniform1ivARB;
 148extern PFNGLUNIFORM2IVARBPROC glUniform2ivARB;
 149extern PFNGLUNIFORM3IVARBPROC glUniform3ivARB;
 150extern PFNGLUNIFORM4IVARBPROC glUniform4ivARB;
 151extern PFNGLUNIFORMMATRIX2FVARBPROC glUniformMatrix2fvARB;
 152extern PFNGLUNIFORMMATRIX3FVARBPROC glUniformMatrix3fvARB;
 153extern PFNGLUNIFORMMATRIX4FVARBPROC glUniformMatrix4fvARB;
 154extern PFNGLGETOBJECTPARAMETERFVARBPROC glGetObjectParameterfvARB;
 155extern PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
 156extern PFNGLGETINFOLOGARBPROC glGetInfoLogARB;
 157extern PFNGLGETATTACHEDOBJECTSARBPROC glGetAttachedObjectsARB;
 158extern PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
 159extern PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB;
 160extern PFNGLGETUNIFORMFVARBPROC glGetUniformfvARB;
 161extern PFNGLGETUNIFORMIVARBPROC glGetUniformivARB;
 162extern PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB;
 163
 164// GL_ARB_vertex_shader
 165extern PFNGLVERTEXATTRIB1DARBPROC glVertexAttrib1dARB;
 166extern PFNGLVERTEXATTRIB1DVARBPROC glVertexAttrib1dvARB;
 167extern PFNGLVERTEXATTRIB1FARBPROC glVertexAttrib1fARB;
 168extern PFNGLVERTEXATTRIB1FVARBPROC glVertexAttrib1fvARB;
 169extern PFNGLVERTEXATTRIB1SARBPROC glVertexAttrib1sARB;
 170extern PFNGLVERTEXATTRIB1SVARBPROC glVertexAttrib1svARB;
 171extern PFNGLVERTEXATTRIB2DARBPROC glVertexAttrib2dARB;
 172extern PFNGLVERTEXATTRIB2DVARBPROC glVertexAttrib2dvARB;
 173extern PFNGLVERTEXATTRIB2FARBPROC glVertexAttrib2fARB;
 174extern PFNGLVERTEXATTRIB2FVARBPROC glVertexAttrib2fvARB;
 175extern PFNGLVERTEXATTRIB2SARBPROC glVertexAttrib2sARB;
 176extern PFNGLVERTEXATTRIB2SVARBPROC glVertexAttrib2svARB;
 177extern PFNGLVERTEXATTRIB3DARBPROC glVertexAttrib3dARB;
 178extern PFNGLVERTEXATTRIB3DVARBPROC glVertexAttrib3dvARB;
 179extern PFNGLVERTEXATTRIB3FARBPROC glVertexAttrib3fARB;
 180extern PFNGLVERTEXATTRIB3FVARBPROC glVertexAttrib3fvARB;
 181extern PFNGLVERTEXATTRIB3SARBPROC glVertexAttrib3sARB;
 182extern PFNGLVERTEXATTRIB3SVARBPROC glVertexAttrib3svARB;
 183extern PFNGLVERTEXATTRIB4NBVARBPROC glVertexAttrib4nbvARB;
 184extern PFNGLVERTEXATTRIB4NIVARBPROC glVertexAttrib4nivARB;
 185extern PFNGLVERTEXATTRIB4NSVARBPROC glVertexAttrib4nsvARB;
 186extern PFNGLVERTEXATTRIB4NUBARBPROC glVertexAttrib4nubARB;
 187extern PFNGLVERTEXATTRIB4NUBVARBPROC glVertexAttrib4nubvARB;
 188extern PFNGLVERTEXATTRIB4NUIVARBPROC glVertexAttrib4nuivARB;
 189extern PFNGLVERTEXATTRIB4NUSVARBPROC glVertexAttrib4nusvARB;
 190extern PFNGLVERTEXATTRIB4BVARBPROC glVertexAttrib4bvARB;
 191extern PFNGLVERTEXATTRIB4DARBPROC glVertexAttrib4dARB;
 192extern PFNGLVERTEXATTRIB4DVARBPROC glVertexAttrib4dvARB;
 193extern PFNGLVERTEXATTRIB4FARBPROC glVertexAttrib4fARB;
 194extern PFNGLVERTEXATTRIB4FVARBPROC glVertexAttrib4fvARB;
 195extern PFNGLVERTEXATTRIB4IVARBPROC glVertexAttrib4ivARB;
 196extern PFNGLVERTEXATTRIB4SARBPROC glVertexAttrib4sARB;
 197extern PFNGLVERTEXATTRIB4SVARBPROC glVertexAttrib4svARB;
 198extern PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB;
 199extern PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB;
 200extern PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB;
 201extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB;
 202extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB;
 203extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB;
 204extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB;
 205extern PFNGLBINDPROGRAMARBPROC glBindProgramARB;
 206extern PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB;
 207extern PFNGLGENPROGRAMSARBPROC glGenProgramsARB;
 208extern PFNGLPROGRAMENVPARAMETER4DARBPROC glProgramEnvParameter4dARB;
 209extern PFNGLPROGRAMENVPARAMETER4DVARBPROC glProgramEnvParameter4dvARB;
 210extern PFNGLPROGRAMENVPARAMETER4FARBPROC glProgramEnvParameter4fARB;
 211extern PFNGLPROGRAMENVPARAMETER4FVARBPROC glProgramEnvParameter4fvARB;
 212extern PFNGLPROGRAMLOCALPARAMETER4DARBPROC glProgramLocalParameter4dARB;
 213extern PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glProgramLocalParameter4dvARB;
 214extern PFNGLPROGRAMLOCALPARAMETER4FARBPROC glProgramLocalParameter4fARB;
 215extern PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glProgramLocalParameter4fvARB;
 216extern PFNGLGETPROGRAMENVPARAMETERDVARBPROC glGetProgramEnvParameterdvARB;
 217extern PFNGLGETPROGRAMENVPARAMETERFVARBPROC glGetProgramEnvParameterfvARB;
 218extern PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glGetProgramLocalParameterdvARB;
 219extern PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glGetProgramLocalParameterfvARB;
 220extern PFNGLGETPROGRAMIVARBPROC glGetProgramivARB;
 221extern PFNGLGETPROGRAMSTRINGARBPROC glGetProgramStringARB;
 222extern PFNGLGETVERTEXATTRIBDVARBPROC glGetVertexAttribdvARB;
 223extern PFNGLGETVERTEXATTRIBFVARBPROC glGetVertexAttribfvARB;
 224extern PFNGLGETVERTEXATTRIBIVARBPROC glGetVertexAttribivARB;
 225extern PFNGLGETVERTEXATTRIBPOINTERVARBPROC glGetVertexAttribPointervARB;
 226extern PFNGLISPROGRAMARBPROC glIsProgramARB;
 227extern PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB;
 228extern PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB;
 229extern PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB;
 230
 231extern PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glCompressedTexImage2DARB;
 232extern PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glGetCompressedTexImageARB;
 233
 234extern PFNGLCOLORTABLEEXTPROC glColorTableEXT;
 235
 236//GL_EXT_blend_func_separate
 237extern PFNGLBLENDFUNCSEPARATEEXTPROC glBlendFuncSeparateEXT;
 238
 239//GL_EXT_framebuffer_object
 240extern PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT;
 241extern PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT;
 242extern PFNGLDELETERENDERBUFFERSEXTPROC glDeleteRenderbuffersEXT;
 243extern PFNGLGENRENDERBUFFERSEXTPROC glGenRenderbuffersEXT;
 244extern PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT;
 245extern PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glGetRenderbufferParameterivEXT;
 246extern PFNGLISFRAMEBUFFEREXTPROC glIsFramebufferEXT;
 247extern PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT;
 248extern PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT;
 249extern PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT;
 250extern PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT;
 251extern PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glFramebufferTexture1DEXT;
 252extern PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT;
 253extern PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glFramebufferTexture3DEXT;
 254extern PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT;
 255extern PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glGetFramebufferAttachmentParameterivEXT;
 256extern PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT;
 257
 258#elif LL_MESA
 259//----------------------------------------------------------------------------
 260// MESA headers
 261// quotes so we get libraries/.../GL/ version
 262#define GL_GLEXT_PROTOTYPES 1
 263#include "GL/gl.h"
 264#include "GL/glext.h"
 265#include "GL/glu.h"
 266
 267// The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly
 268# define __APPLE__
 269# include "GL/glh_extensions.h"
 270# undef __APPLE__
 271
 272#elif LL_LINUX
 273//----------------------------------------------------------------------------
 274// LL_LINUX
 275
 276//----------------------------------------------------------------------------
 277// Linux, MESA headers, but not necessarily assuming MESA runtime.
 278// quotes so we get libraries/.../GL/ version
 279#include "GL/gl.h"
 280#include "GL/glext.h"
 281#include "GL/glu.h"
 282
 283
 284#if LL_LINUX && !LL_MESA_HEADLESS
 285// The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly
 286# define __APPLE__
 287# include "GL/glh_extensions.h"
 288# undef __APPLE__
 289
 290/* Although SDL very likely ends up calling glXGetProcAddress() itself,
 291   if we use SDL_GL_GetProcAddress() then we get bogus addresses back on
 292   some systems.  Weird. */
 293/*# include "SDL/SDL.h"
 294  # define GLH_EXT_GET_PROC_ADDRESS(p) SDL_GL_GetProcAddress(p) */
 295#define GLX_GLXEXT_PROTOTYPES 1
 296# include "GL/glx.h"
 297# include "GL/glxext.h"
 298// Use glXGetProcAddressARB instead of glXGetProcAddress - the ARB symbol
 299// is considered 'legacy' but works on more machines.
 300# define GLH_EXT_GET_PROC_ADDRESS(p) glXGetProcAddressARB((const GLubyte*)(p))
 301#endif // LL_LINUX && !LL_MESA_HEADLESS
 302
 303#if LL_LINUX && defined(WINGDIAPI)
 304// WINGDIAPI gets set if we are using the linux nvidia gl.h header which needs
 305// the functions below setting up.
 306# define LL_LINUX_NV_GL_HEADERS 1
 307#else
 308# define LL_LINUX_NV_GL_HEADERS 0
 309#endif // LL_LINUX && defined(WINGDIAPI)
 310
 311
 312#if LL_LINUX_NV_GL_HEADERS
 313// Missing functions when using nvidia headers:
 314extern PFNGLACTIVETEXTUREARBPROC	glActiveTextureARB;
 315extern PFNGLCLIENTACTIVETEXTUREARBPROC	glClientActiveTextureARB;
 316extern PFNGLDRAWRANGEELEMENTSPROC 	glDrawRangeElements;
 317#endif // LL_LINUX_NV_GL_HEADERS
 318
 319// GL_ARB_vertex_array_object
 320extern PFNGLBINDVERTEXARRAYPROC glBindVertexArray;
 321extern PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays;
 322extern PFNGLGENVERTEXARRAYSPROC glGenVertexArrays;
 323extern PFNGLISVERTEXARRAYPROC glIsVertexArray;
 324
 325// GL_ARB_vertex_buffer_object
 326extern PFNGLBINDBUFFERARBPROC		glBindBufferARB;
 327extern PFNGLDELETEBUFFERSARBPROC	glDeleteBuffersARB;
 328extern PFNGLGENBUFFERSARBPROC		glGenBuffersARB;
 329extern PFNGLISBUFFERARBPROC			glIsBufferARB;
 330extern PFNGLBUFFERDATAARBPROC		glBufferDataARB;
 331extern PFNGLBUFFERSUBDATAARBPROC	glBufferSubDataARB;
 332extern PFNGLGETBUFFERSUBDATAARBPROC glGetBufferSubDataARB;
 333extern PFNGLMAPBUFFERARBPROC		glMapBufferARB;
 334extern PFNGLUNMAPBUFFERARBPROC		glUnmapBufferARB;
 335extern PFNGLGETBUFFERPARAMETERIVARBPROC	glGetBufferParameterivARB;
 336extern PFNGLGETBUFFERPOINTERVARBPROC	glGetBufferPointervARB;
 337
 338// GL_ARB_sync
 339extern PFNGLFENCESYNCPROC				glFenceSync;
 340extern PFNGLISSYNCPROC					glIsSync;
 341extern PFNGLDELETESYNCPROC				glDeleteSync;
 342extern PFNGLCLIENTWAITSYNCPROC			glClientWaitSync;
 343extern PFNGLWAITSYNCPROC				glWaitSync;
 344extern PFNGLGETINTEGER64VPROC			glGetInteger64v;
 345extern PFNGLGETSYNCIVPROC				glGetSynciv;
 346
 347// GL_APPLE_flush_buffer_range
 348extern PFNGLBUFFERPARAMETERIAPPLEPROC	glBufferParameteriAPPLE;
 349extern PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC glFlushMappedBufferRangeAPPLE;
 350
 351// GL_ARB_map_buffer_range
 352extern PFNGLMAPBUFFERRANGEPROC			glMapBufferRange;
 353extern PFNGLFLUSHMAPPEDBUFFERRANGEPROC	glFlushMappedBufferRange;
 354
 355// GL_ATI_vertex_array_object
 356extern PFNGLNEWOBJECTBUFFERATIPROC			glNewObjectBufferATI;
 357extern PFNGLISOBJECTBUFFERATIPROC			glIsObjectBufferATI;
 358extern PFNGLUPDATEOBJECTBUFFERATIPROC		glUpdateObjectBufferATI;
 359extern PFNGLGETOBJECTBUFFERFVATIPROC		glGetObjectBufferfvATI;
 360extern PFNGLGETOBJECTBUFFERIVATIPROC		glGetObjectBufferivATI;
 361extern PFNGLFREEOBJECTBUFFERATIPROC		    glFreeObjectBufferATI;
 362extern PFNGLARRAYOBJECTATIPROC				glArrayObjectATI;
 363extern PFNGLVERTEXATTRIBARRAYOBJECTATIPROC	glVertexAttribArrayObjectATI;
 364extern PFNGLGETARRAYOBJECTFVATIPROC			glGetArrayObjectfvATI;
 365extern PFNGLGETARRAYOBJECTIVATIPROC			glGetArrayObjectivATI;
 366extern PFNGLVARIANTARRAYOBJECTATIPROC		glVariantObjectArrayATI;
 367extern PFNGLGETVARIANTARRAYOBJECTFVATIPROC	glGetVariantArrayObjectfvATI;
 368extern PFNGLGETVARIANTARRAYOBJECTIVATIPROC	glGetVariantArrayObjectivATI;
 369
 370// GL_ARB_occlusion_query
 371extern PFNGLGENQUERIESARBPROC glGenQueriesARB;
 372extern PFNGLDELETEQUERIESARBPROC glDeleteQueriesARB;
 373extern PFNGLISQUERYARBPROC glIsQueryARB;
 374extern PFNGLBEGINQUERYARBPROC glBeginQueryARB;
 375extern PFNGLENDQUERYARBPROC glEndQueryARB;
 376extern PFNGLGETQUERYIVARBPROC glGetQueryivARB;
 377extern PFNGLGETQUERYOBJECTIVARBPROC glGetQueryObjectivARB;
 378extern PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB;
 379
 380// GL_ARB_point_parameters
 381extern PFNGLPOINTPARAMETERFARBPROC glPointParameterfARB;
 382extern PFNGLPOINTPARAMETERFVARBPROC glPointParameterfvARB;
 383
 384// GL_ARB_shader_objects
 385extern PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
 386extern PFNGLGETHANDLEARBPROC glGetHandleARB;
 387extern PFNGLDETACHOBJECTARBPROC glDetachObjectARB;
 388extern PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
 389extern PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
 390extern PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
 391extern PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB;
 392extern PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
 393extern PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
 394extern PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB;
 395extern PFNGLVALIDATEPROGRAMARBPROC glValidateProgramARB;
 396extern PFNGLUNIFORM1FARBPROC glUniform1fARB;
 397extern PFNGLUNIFORM2FARBPROC glUniform2fARB;
 398extern PFNGLUNIFORM3FARBPROC glUniform3fARB;
 399extern PFNGLUNIFORM4FARBPROC glUniform4fARB;
 400extern PFNGLUNIFORM1IARBPROC glUniform1iARB;
 401extern PFNGLUNIFORM2IARBPROC glUniform2iARB;
 402extern PFNGLUNIFORM3IARBPROC glUniform3iARB;
 403extern PFNGLUNIFORM4IARBPROC glUniform4iARB;
 404extern PFNGLUNIFORM1FVARBPROC glUniform1fvARB;
 405extern PFNGLUNIFORM2FVARBPROC glUniform2fvARB;
 406extern PFNGLUNIFORM3FVARBPROC glUniform3fvARB;
 407extern PFNGLUNIFORM4FVARBPROC glUniform4fvARB;
 408extern PFNGLUNIFORM1IVARBPROC glUniform1ivARB;
 409extern PFNGLUNIFORM2IVARBPROC glUniform2ivARB;
 410extern PFNGLUNIFORM3IVARBPROC glUniform3ivARB;
 411extern PFNGLUNIFORM4IVARBPROC glUniform4ivARB;
 412extern PFNGLUNIFORMMATRIX2FVARBPROC glUniformMatrix2fvARB;
 413extern PFNGLUNIFORMMATRIX3FVARBPROC glUniformMatrix3fvARB;
 414extern PFNGLUNIFORMMATRIX4FVARBPROC glUniformMatrix4fvARB;
 415extern PFNGLGETOBJECTPARAMETERFVARBPROC glGetObjectParameterfvARB;
 416extern PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
 417extern PFNGLGETINFOLOGARBPROC glGetInfoLogARB;
 418extern PFNGLGETATTACHEDOBJECTSARBPROC glGetAttachedObjectsARB;
 419extern PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
 420extern PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB;
 421extern PFNGLGETUNIFORMFVARBPROC glGetUniformfvARB;
 422extern PFNGLGETUNIFORMIVARBPROC glGetUniformivARB;
 423extern PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB;
 424
 425// GL_ARB_vertex_shader
 426extern PFNGLVERTEXATTRIB1DARBPROC glVertexAttrib1dARB;
 427extern PFNGLVERTEXATTRIB1DVARBPROC glVertexAttrib1dvARB;
 428extern PFNGLVERTEXATTRIB1FARBPROC glVertexAttrib1fARB;
 429extern PFNGLVERTEXATTRIB1FVARBPROC glVertexAttrib1fvARB;
 430extern PFNGLVERTEXATTRIB1SARBPROC glVertexAttrib1sARB;
 431extern PFNGLVERTEXATTRIB1SVARBPROC glVertexAttrib1svARB;
 432extern PFNGLVERTEXATTRIB2DARBPROC glVertexAttrib2dARB;
 433extern PFNGLVERTEXATTRIB2DVARBPROC glVertexAttrib2dvARB;
 434extern PFNGLVERTEXATTRIB2FARBPROC glVertexAttrib2fARB;
 435extern PFNGLVERTEXATTRIB2FVARBPROC glVertexAttrib2fvARB;
 436extern PFNGLVERTEXATTRIB2SARBPROC glVertexAttrib2sARB;
 437extern PFNGLVERTEXATTRIB2SVARBPROC glVertexAttrib2svARB;
 438extern PFNGLVERTEXATTRIB3DARBPROC glVertexAttrib3dARB;
 439extern PFNGLVERTEXATTRIB3DVARBPROC glVertexAttrib3dvARB;
 440extern PFNGLVERTEXATTRIB3FARBPROC glVertexAttrib3fARB;
 441extern PFNGLVERTEXATTRIB3FVARBPROC glVertexAttrib3fvARB;
 442extern PFNGLVERTEXATTRIB3SARBPROC glVertexAttrib3sARB;
 443extern PFNGLVERTEXATTRIB3SVARBPROC glVertexAttrib3svARB;
 444extern PFNGLVERTEXATTRIB4NBVARBPROC glVertexAttrib4nbvARB;
 445extern PFNGLVERTEXATTRIB4NIVARBPROC glVertexAttrib4nivARB;
 446extern PFNGLVERTEXATTRIB4NSVARBPROC glVertexAttrib4nsvARB;
 447extern PFNGLVERTEXATTRIB4NUBARBPROC glVertexAttrib4nubARB;
 448extern PFNGLVERTEXATTRIB4NUBVARBPROC glVertexAttrib4nubvARB;
 449extern PFNGLVERTEXATTRIB4NUIVARBPROC glVertexAttrib4nuivARB;
 450extern PFNGLVERTEXATTRIB4NUSVARBPROC glVertexAttrib4nusvARB;
 451extern PFNGLVERTEXATTRIB4BVARBPROC glVertexAttrib4bvARB;
 452extern PFNGLVERTEXATTRIB4DARBPROC glVertexAttrib4dARB;
 453extern PFNGLVERTEXATTRIB4DVARBPROC glVertexAttrib4dvARB;
 454extern PFNGLVERTEXATTRIB4FARBPROC glVertexAttrib4fARB;
 455extern PFNGLVERTEXATTRIB4FVARBPROC glVertexAttrib4fvARB;
 456extern PFNGLVERTEXATTRIB4IVARBPROC glVertexAttrib4ivARB;
 457extern PFNGLVERTEXATTRIB4SARBPROC glVertexAttrib4sARB;
 458extern PFNGLVERTEXATTRIB4SVARBPROC glVertexAttrib4svARB;
 459extern PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB;
 460extern PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB;
 461extern PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB;
 462extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB;
 463extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB;
 464extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB;
 465extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB;
 466extern PFNGLBINDPROGRAMARBPROC glBindProgramARB;
 467extern PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB;
 468extern PFNGLGENPROGRAMSARBPROC glGenProgramsARB;
 469extern PFNGLPROGRAMENVPARAMETER4DARBPROC glProgramEnvParameter4dARB;
 470extern PFNGLPROGRAMENVPARAMETER4DVARBPROC glProgramEnvParameter4dvARB;
 471extern PFNGLPROGRAMENVPARAMETER4FARBPROC glProgramEnvParameter4fARB;
 472extern PFNGLPROGRAMENVPARAMETER4FVARBPROC glProgramEnvParameter4fvARB;
 473extern PFNGLPROGRAMLOCALPARAMETER4DARBPROC glProgramLocalParameter4dARB;
 474extern PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glProgramLocalParameter4dvARB;
 475extern PFNGLPROGRAMLOCALPARAMETER4FARBPROC glProgramLocalParameter4fARB;
 476extern PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glProgramLocalParameter4fvARB;
 477extern PFNGLGETPROGRAMENVPARAMETERDVARBPROC glGetProgramEnvParameterdvARB;
 478extern PFNGLGETPROGRAMENVPARAMETERFVARBPROC glGetProgramEnvParameterfvARB;
 479extern PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glGetProgramLocalParameterdvARB;
 480extern PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glGetProgramLocalParameterfvARB;
 481extern PFNGLGETPROGRAMIVARBPROC glGetProgramivARB;
 482extern PFNGLGETPROGRAMSTRINGARBPROC glGetProgramStringARB;
 483extern PFNGLGETVERTEXATTRIBDVARBPROC glGetVertexAttribdvARB;
 484extern PFNGLGETVERTEXATTRIBFVARBPROC glGetVertexAttribfvARB;
 485extern PFNGLGETVERTEXATTRIBIVARBPROC glGetVertexAttribivARB;
 486extern PFNGLGETVERTEXATTRIBPOINTERVARBPROC glGetVertexAttribPointervARB;
 487extern PFNGLISPROGRAMARBPROC glIsProgramARB;
 488extern PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB;
 489extern PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB;
 490extern PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB;
 491
 492extern PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glCompressedTexImage2DARB;
 493extern PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glGetCompressedTexImageARB;
 494
 495//GL_EXT_blend_func_separate
 496extern PFNGLBLENDFUNCSEPARATEEXTPROC glBlendFuncSeparateEXT;
 497
 498//GL_ARB_framebuffer_object
 499extern PFNGLISRENDERBUFFERPROC glIsRenderbuffer;
 500extern PFNGLBINDRENDERBUFFERPROC glBindRenderbuffer;
 501extern PFNGLDELETERENDERBUFFERSPROC glDeleteRenderbuffers;
 502extern PFNGLGENRENDERBUFFERSPROC glGenRenderbuffers;
 503extern PFNGLRENDERBUFFERSTORAGEPROC glRenderbufferStorage;
 504extern PFNGLGETRENDERBUFFERPARAMETERIVPROC glGetRenderbufferParameteriv;
 505extern PFNGLISFRAMEBUFFERPROC glIsFramebuffer;
 506extern PFNGLBINDFRAMEBUFFERPROC glBindFramebuffer;
 507extern PFNGLDELETEFRAMEBUFFERSPROC glDeleteFramebuffers;
 508extern PFNGLGENFRAMEBUFFERSPROC glGenFramebuffers;
 509extern PFNGLCHECKFRAMEBUFFERSTATUSPROC glCheckFramebufferStatus;
 510extern PFNGLFRAMEBUFFERTEXTURE1DPROC glFramebufferTexture1D;
 511extern PFNGLFRAMEBUFFERTEXTURE2DPROC glFramebufferTexture2D;
 512extern PFNGLFRAMEBUFFERTEXTURE3DPROC glFramebufferTexture3D;
 513extern PFNGLFRAMEBUFFERRENDERBUFFERPROC glFramebufferRenderbuffer;
 514extern PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glGetFramebufferAttachmentParameteriv;
 515extern PFNGLGENERATEMIPMAPPROC glGenerateMipmap;
 516extern PFNGLBLITFRAMEBUFFERPROC glBlitFramebuffer;
 517extern PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glRenderbufferStorageMultisample;
 518extern PFNGLFRAMEBUFFERTEXTURELAYERPROC glFramebufferTextureLayer;
 519
 520//GL_ARB_draw_buffers
 521extern PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB;
 522
 523//GL_ARB_texture_multisample
 524extern PFNGLTEXIMAGE2DMULTISAMPLEPROC glTexImage2DMultisample;
 525extern PFNGLTEXIMAGE3DMULTISAMPLEPROC glTexImage3DMultisample;
 526extern PFNGLGETMULTISAMPLEFVPROC glGetMultisamplefv;
 527extern PFNGLSAMPLEMASKIPROC glSampleMaski;
 528
 529#elif LL_WINDOWS
 530//----------------------------------------------------------------------------
 531// LL_WINDOWS
 532
 533// windows gl headers depend on things like APIENTRY, so include windows.
 534#define WIN32_LEAN_AND_MEAN
 535#include <winsock2.h>
 536#include <windows.h>
 537
 538//----------------------------------------------------------------------------
 539#include <GL/gl.h>
 540#include <GL/glu.h>
 541
 542// quotes so we get libraries/.../GL/ version
 543#include "GL/glext.h"
 544#include "GL/glh_extensions.h"
 545
 546// WGL_ARB_create_context
 547extern PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB;
 548extern PFNGLGETSTRINGIPROC glGetStringi;
 549
 550// GL_ARB_vertex_buffer_object
 551extern PFNGLBINDBUFFERARBPROC		glBindBufferARB;
 552extern PFNGLDELETEBUFFERSARBPROC	glDeleteBuffersARB;
 553extern PFNGLGENBUFFERSARBPROC		glGenBuffersARB;
 554extern PFNGLISBUFFERARBPROC			glIsBufferARB;
 555extern PFNGLBUFFERDATAARBPROC		glBufferDataARB;
 556extern PFNGLBUFFERSUBDATAARBPROC	glBufferSubDataARB;
 557extern PFNGLGETBUFFERSUBDATAARBPROC glGetBufferSubDataARB;
 558extern PFNGLMAPBUFFERARBPROC		glMapBufferARB;
 559extern PFNGLUNMAPBUFFERARBPROC		glUnmapBufferARB;
 560extern PFNGLGETBUFFERPARAMETERIVARBPROC	glGetBufferParameterivARB;
 561extern PFNGLGETBUFFERPOINTERVARBPROC	glGetBufferPointervARB;
 562
 563// GL_ARB_vertex_array_object
 564extern PFNGLBINDVERTEXARRAYPROC glBindVertexArray;
 565extern PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays;
 566extern PFNGLGENVERTEXARRAYSPROC glGenVertexArrays;
 567extern PFNGLISVERTEXARRAYPROC glIsVertexArray;
 568
 569// GL_ARB_sync
 570extern PFNGLFENCESYNCPROC				glFenceSync;
 571extern PFNGLISSYNCPROC					glIsSync;
 572extern PFNGLDELETESYNCPROC				glDeleteSync;
 573extern PFNGLCLIENTWAITSYNCPROC			glClientWaitSync;
 574extern PFNGLWAITSYNCPROC				glWaitSync;
 575extern PFNGLGETINTEGER64VPROC			glGetInteger64v;
 576extern PFNGLGETSYNCIVPROC				glGetSynciv;
 577
 578// GL_APPLE_flush_buffer_range
 579extern PFNGLBUFFERPARAMETERIAPPLEPROC	glBufferParameteriAPPLE;
 580extern PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC glFlushMappedBufferRangeAPPLE;
 581
 582// GL_ARB_map_buffer_range
 583extern PFNGLMAPBUFFERRANGEPROC			glMapBufferRange;
 584extern PFNGLFLUSHMAPPEDBUFFERRANGEPROC	glFlushMappedBufferRange;
 585
 586// GL_ATI_vertex_array_object
 587extern PFNGLNEWOBJECTBUFFERATIPROC			glNewObjectBufferATI;
 588extern PFNGLISOBJECTBUFFERATIPROC			glIsObjectBufferATI;
 589extern PFNGLUPDATEOBJECTBUFFERATIPROC		glUpdateObjectBufferATI;
 590extern PFNGLGETOBJECTBUFFERFVATIPROC		glGetObjectBufferfvATI;
 591extern PFNGLGETOBJECTBUFFERIVATIPROC		glGetObjectBufferivATI;
 592extern PFNGLFREEOBJECTBUFFERATIPROC		    glFreeObjectBufferATI;
 593extern PFNGLARRAYOBJECTATIPROC				glArrayObjectATI;
 594extern PFNGLVERTEXATTRIBARRAYOBJECTATIPROC	glVertexAttribArrayObjectATI;
 595extern PFNGLGETARRAYOBJECTFVATIPROC			glGetArrayObjectfvATI;
 596extern PFNGLGETARRAYOBJECTIVATIPROC			glGetArrayObjectivATI;
 597extern PFNGLVARIANTARRAYOBJECTATIPROC		glVariantObjectArrayATI;
 598extern PFNGLGETVARIANTARRAYOBJECTFVATIPROC	glGetVariantArrayObjectfvATI;
 599extern PFNGLGETVARIANTARRAYOBJECTIVATIPROC	glGetVariantArrayObjectivATI;
 600
 601extern PFNWGLSWAPINTERVALEXTPROC			wglSwapIntervalEXT;
 602
 603// GL_ARB_occlusion_query
 604extern PFNGLGENQUERIESARBPROC glGenQueriesARB;
 605extern PFNGLDELETEQUERIESARBPROC glDeleteQueriesARB;
 606extern PFNGLISQUERYARBPROC glIsQueryARB;
 607extern PFNGLBEGINQUERYARBPROC glBeginQueryARB;
 608extern PFNGLENDQUERYARBPROC glEndQueryARB;
 609extern PFNGLGETQUERYIVARBPROC glGetQueryivARB;
 610extern PFNGLGETQUERYOBJECTIVARBPROC glGetQueryObjectivARB;
 611extern PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB;
 612
 613// GL_ARB_point_parameters
 614extern PFNGLPOINTPARAMETERFARBPROC glPointParameterfARB;
 615extern PFNGLPOINTPARAMETERFVARBPROC glPointParameterfvARB;
 616
 617// GL_ARB_shader_objects
 618extern PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
 619extern PFNGLGETHANDLEARBPROC glGetHandleARB;
 620extern PFNGLDETACHOBJECTARBPROC glDetachObjectARB;
 621extern PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
 622extern PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
 623extern PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
 624extern PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB;
 625extern PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
 626extern PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
 627extern PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB;
 628extern PFNGLVALIDATEPROGRAMARBPROC glValidateProgramARB;
 629extern PFNGLUNIFORM1FARBPROC glUniform1fARB;
 630extern PFNGLUNIFORM2FARBPROC glUniform2fARB;
 631extern PFNGLUNIFORM3FARBPROC glUniform3fARB;
 632extern PFNGLUNIFORM4FARBPROC glUniform4fARB;
 633extern PFNGLUNIFORM1IARBPROC glUniform1iARB;
 634extern PFNGLUNIFORM2IARBPROC glUniform2iARB;
 635extern PFNGLUNIFORM3IARBPROC glUniform3iARB;
 636extern PFNGLUNIFORM4IARBPROC glUniform4iARB;
 637extern PFNGLUNIFORM1FVARBPROC glUniform1fvARB;
 638extern PFNGLUNIFORM2FVARBPROC glUniform2fvARB;
 639extern PFNGLUNIFORM3FVARBPROC glUniform3fvARB;
 640extern PFNGLUNIFORM4FVARBPROC glUniform4fvARB;
 641extern PFNGLUNIFORM1IVARBPROC glUniform1ivARB;
 642extern PFNGLUNIFORM2IVARBPROC glUniform2ivARB;
 643extern PFNGLUNIFORM3IVARBPROC glUniform3ivARB;
 644extern PFNGLUNIFORM4IVARBPROC glUniform4ivARB;
 645extern PFNGLUNIFORMMATRIX2FVARBPROC glUniformMatrix2fvARB;
 646extern PFNGLUNIFORMMATRIX3FVARBPROC glUniformMatrix3fvARB;
 647extern PFNGLUNIFORMMATRIX4FVARBPROC glUniformMatrix4fvARB;
 648extern PFNGLGETOBJECTPARAMETERFVARBPROC glGetObjectParameterfvARB;
 649extern PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
 650extern PFNGLGETINFOLOGARBPROC glGetInfoLogARB;
 651extern PFNGLGETATTACHEDOBJECTSARBPROC glGetAttachedObjectsARB;
 652extern PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
 653extern PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB;
 654extern PFNGLGETUNIFORMFVARBPROC glGetUniformfvARB;
 655extern PFNGLGETUNIFORMIVARBPROC glGetUniformivARB;
 656extern PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB;
 657
 658// GL_ARB_vertex_shader
 659extern PFNGLVERTEXATTRIB1DARBPROC glVertexAttrib1dARB;
 660extern PFNGLVERTEXATTRIB1DVARBPROC glVertexAttrib1dvARB;
 661extern PFNGLVERTEXATTRIB1FARBPROC glVertexAttrib1fARB;
 662extern PFNGLVERTEXATTRIB1FVARBPROC glVertexAttrib1fvARB;
 663extern PFNGLVERTEXATTRIB1SARBPROC glVertexAttrib1sARB;
 664extern PFNGLVERTEXATTRIB1SVARBPROC glVertexAttrib1svARB;
 665extern PFNGLVERTEXATTRIB2DARBPROC glVertexAttrib2dARB;
 666extern PFNGLVERTEXATTRIB2DVARBPROC glVertexAttrib2dvARB;
 667extern PFNGLVERTEXATTRIB2FARBPROC glVertexAttrib2fARB;
 668extern PFNGLVERTEXATTRIB2FVARBPROC glVertexAttrib2fvARB;
 669extern PFNGLVERTEXATTRIB2SARBPROC glVertexAttrib2sARB;
 670extern PFNGLVERTEXATTRIB2SVARBPROC glVertexAttrib2svARB;
 671extern PFNGLVERTEXATTRIB3DARBPROC glVertexAttrib3dARB;
 672extern PFNGLVERTEXATTRIB3DVARBPROC glVertexAttrib3dvARB;
 673extern PFNGLVERTEXATTRIB3FARBPROC glVertexAttrib3fARB;
 674extern PFNGLVERTEXATTRIB3FVARBPROC glVertexAttrib3fvARB;
 675extern PFNGLVERTEXATTRIB3SARBPROC glVertexAttrib3sARB;
 676extern PFNGLVERTEXATTRIB3SVARBPROC glVertexAttrib3svARB;
 677extern PFNGLVERTEXATTRIB4NBVARBPROC glVertexAttrib4nbvARB;
 678extern PFNGLVERTEXATTRIB4NIVARBPROC glVertexAttrib4nivARB;
 679extern PFNGLVERTEXATTRIB4NSVARBPROC glVertexAttrib4nsvARB;
 680extern PFNGLVERTEXATTRIB4NUBARBPROC glVertexAttrib4nubARB;
 681extern PFNGLVERTEXATTRIB4NUBVARBPROC glVertexAttrib4nubvARB;
 682extern PFNGLVERTEXATTRIB4NUIVARBPROC glVertexAttrib4nuivARB;
 683extern PFNGLVERTEXATTRIB4NUSVARBPROC glVertexAttrib4nusvARB;
 684extern PFNGLVERTEXATTRIB4BVARBPROC glVertexAttrib4bvARB;
 685extern PFNGLVERTEXATTRIB4DARBPROC glVertexAttrib4dARB;
 686extern PFNGLVERTEXATTRIB4DVARBPROC glVertexAttrib4dvARB;
 687extern PFNGLVERTEXATTRIB4FARBPROC glVertexAttrib4fARB;
 688extern PFNGLVERTEXATTRIB4FVARBPROC glVertexAttrib4fvARB;
 689extern PFNGLVERTEXATTRIB4IVARBPROC glVertexAttrib4ivARB;
 690extern PFNGLVERTEXATTRIB4SARBPROC glVertexAttrib4sARB;
 691extern PFNGLVERTEXATTRIB4SVARBPROC glVertexAttrib4svARB;
 692extern PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB;
 693extern PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB;
 694extern PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB;
 695extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB;
 696extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB;
 697extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB;
 698extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB;
 699extern PFNGLBINDPROGRAMARBPROC glBindProgramARB;
 700extern PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB;
 701extern PFNGLGENPROGRAMSARBPROC glGenProgramsARB;
 702extern PFNGLPROGRAMENVPARAMETER4DARBPROC glProgramEnvParameter4dARB;
 703extern PFNGLPROGRAMENVPARAMETER4DVARBPROC glProgramEnvParameter4dvARB;
 704extern PFNGLPROGRAMENVPARAMETER4FARBPROC glProgramEnvParameter4fARB;
 705extern PFNGLPROGRAMENVPARAMETER4FVARBPROC glProgramEnvParameter4fvARB;
 706extern PFNGLPROGRAMLOCALPARAMETER4DARBPROC glProgramLocalParameter4dARB;
 707extern PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glProgramLocalParameter4dvARB;
 708extern PFNGLPROGRAMLOCALPARAMETER4FARBPROC glProgramLocalParameter4fARB;
 709extern PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glProgramLocalParameter4fvARB;
 710extern PFNGLGETPROGRAMENVPARAMETERDVARBPROC glGetProgramEnvParameterdvARB;
 711extern PFNGLGETPROGRAMENVPARAMETERFVARBPROC glGetProgramEnvParameterfvARB;
 712extern PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glGetProgramLocalParameterdvARB;
 713extern PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glGetProgramLocalParameterfvARB;
 714extern PFNGLGETPROGRAMIVARBPROC glGetProgramivARB;
 715extern PFNGLGETPROGRAMSTRINGARBPROC glGetProgramStringARB;
 716extern PFNGLGETVERTEXATTRIBDVARBPROC glGetVertexAttribdvARB;
 717extern PFNGLGETVERTEXATTRIBFVARBPROC glGetVertexAttribfvARB;
 718extern PFNGLGETVERTEXATTRIBIVARBPROC glGetVertexAttribivARB;
 719extern PFNGLGETVERTEXATTRIBPOINTERVARBPROC glGetVertexAttribPointervARB;
 720extern PFNGLISPROGRAMARBPROC glIsProgramARB;
 721extern PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB;
 722extern PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB;
 723extern PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB;
 724
 725//GL_EXT_blend_func_separate
 726extern PFNGLBLENDFUNCSEPARATEEXTPROC glBlendFuncSeparateEXT;
 727
 728//GL_ARB_framebuffer_object
 729extern PFNGLISRENDERBUFFERPROC glIsRenderbuffer;
 730extern PFNGLBINDRENDERBUFFERPROC glBindRenderbuffer;
 731extern PFNGLDELETERENDERBUFFERSPROC glDeleteRenderbuffers;
 732extern PFNGLGENRENDERBUFFERSPROC glGenRenderbuffers;
 733extern PFNGLRENDERBUFFERSTORAGEPROC glRenderbufferStorage;
 734extern PFNGLGETRENDERBUFFERPARAMETERIVPROC glGetRenderbufferParameteriv;
 735extern PFNGLISFRAMEBUFFERPROC glIsFramebuffer;
 736extern PFNGLBINDFRAMEBUFFERPROC glBindFramebuffer;
 737extern PFNGLDELETEFRAMEBUFFERSPROC glDeleteFramebuffers;
 738extern PFNGLGENFRAMEBUFFERSPROC glGenFramebuffers;
 739extern PFNGLCHECKFRAMEBUFFERSTATUSPROC glCheckFramebufferStatus;
 740extern PFNGLFRAMEBUFFERTEXTURE1DPROC glFramebufferTexture1D;
 741extern PFNGLFRAMEBUFFERTEXTURE2DPROC glFramebufferTexture2D;
 742extern PFNGLFRAMEBUFFERTEXTURE3DPROC glFramebufferTexture3D;
 743extern PFNGLFRAMEBUFFERRENDERBUFFERPROC glFramebufferRenderbuffer;
 744extern PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glGetFramebufferAttachmentParameteriv;
 745extern PFNGLGENERATEMIPMAPPROC glGenerateMipmap;
 746extern PFNGLBLITFRAMEBUFFERPROC glBlitFramebuffer;
 747extern PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glRenderbufferStorageMultisample;
 748extern PFNGLFRAMEBUFFERTEXTURELAYERPROC glFramebufferTextureLayer;
 749
 750//GL_ARB_draw_buffers
 751extern PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB;
 752
 753//GL_ARB_texture_multisample
 754extern PFNGLTEXIMAGE2DMULTISAMPLEPROC glTexImage2DMultisample;
 755extern PFNGLTEXIMAGE3DMULTISAMPLEPROC glTexImage3DMultisample;
 756extern PFNGLGETMULTISAMPLEFVPROC glGetMultisamplefv;
 757extern PFNGLSAMPLEMASKIPROC glSampleMaski;
 758
 759//GL_ARB_debug_output
 760extern PFNGLDEBUGMESSAGECONTROLARBPROC glDebugMessageControlARB;
 761extern PFNGLDEBUGMESSAGEINSERTARBPROC glDebugMessageInsertARB;
 762extern PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARB;
 763extern PFNGLGETDEBUGMESSAGELOGARBPROC glGetDebugMessageLogARB;
 764
 765#elif LL_DARWIN
 766//----------------------------------------------------------------------------
 767// LL_DARWIN
 768
 769#include <OpenGL/gl.h>
 770#include <OpenGL/glu.h>
 771
 772#define GL_EXT_separate_specular_color 1
 773#include <OpenGL/glext.h>
 774
 775#include "GL/glh_extensions.h"
 776
 777// These symbols don't exist on 10.3.9, so they have to be declared weak.  Redeclaring them here fixes the problem.
 778// 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.
 779#include <AvailabilityMacros.h>
 780
 781//GL_EXT_blend_func_separate
 782extern void glBlendFuncSeparateEXT(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) ;
 783
 784// GL_EXT_framebuffer_object
 785extern GLboolean glIsRenderbufferEXT(GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 786extern void glBindRenderbufferEXT(GLenum target, GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 787extern void glDeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 788extern void glGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 789extern void glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 790extern void glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 791extern GLboolean glIsFramebufferEXT(GLuint framebuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 792extern void glBindFramebufferEXT(GLenum target, GLuint framebuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 793extern void glDeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 794extern void glGenFramebuffersEXT(GLsizei n, GLuint *framebuffers) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 795extern GLenum glCheckFramebufferStatusEXT(GLenum target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 796extern void glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 797extern void glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 798extern void glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 799extern void glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 800extern void glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint *params) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 801extern void glGenerateMipmapEXT(GLenum target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 802
 803#ifndef GL_ARB_framebuffer_object
 804#define glGenerateMipmap glGenerateMipmapEXT
 805#define GL_MAX_SAMPLES	0x8D57
 806#endif
 807
 808// GL_ARB_draw_buffers
 809extern void glDrawBuffersARB(GLsizei n, const GLenum* bufs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
 810
 811#ifdef __cplusplus
 812extern "C" {
 813#endif
 814
 815//
 816// Define map buffer range headers on Mac
 817//
 818#ifndef GL_ARB_map_buffer_range
 819#define GL_MAP_READ_BIT                   0x0001
 820#define GL_MAP_WRITE_BIT                  0x0002
 821#define GL_MAP_INVALIDATE_RANGE_BIT       0x0004
 822#define GL_MAP_INVALIDATE_BUFFER_BIT      0x0008
 823#define GL_MAP_FLUSH_EXPLICIT_BIT         0x0010
 824#define GL_MAP_UNSYNCHRONIZED_BIT         0x0020
 825#endif
 826
 827//
 828// Define multisample headers on Mac
 829//
 830#ifndef GL_ARB_texture_multisample
 831#define GL_SAMPLE_POSITION                0x8E50
 832#define GL_SAMPLE_MASK                    0x8E51
 833#define GL_SAMPLE_MASK_VALUE              0x8E52
 834#define GL_MAX_SAMPLE_MASK_WORDS          0x8E59
 835#define GL_TEXTURE_2D_MULTISAMPLE         0x9100
 836#define GL_PROXY_TEXTURE_2D_MULTISAMPLE   0x9101
 837#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY   0x9102
 838#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103
 839#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
 840#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105
 841#define GL_TEXTURE_SAMPLES                0x9106
 842#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
 843#define GL_SAMPLER_2D_MULTISAMPLE         0x9108
 844#define GL_INT_SAMPLER_2D_MULTISAMPLE     0x9109
 845#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
 846#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY   0x910B
 847#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
 848#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
 849#define GL_MAX_COLOR_TEXTURE_SAMPLES      0x910E
 850#define GL_MAX_DEPTH_TEXTURE_SAMPLES      0x910F
 851#define GL_MAX_INTEGER_SAMPLES            0x9110
 852#endif
 853
 854//
 855// Define vertex buffer object headers on Mac
 856//
 857#ifndef GL_ARB_vertex_buffer_object
 858#define GL_BUFFER_SIZE_ARB                0x8764
 859#define GL_BUFFER_USAGE_ARB               0x8765
 860#define GL_ARRAY_BUFFER_ARB               0x8892
 861#define GL_ELEMENT_ARRAY_BUFFER_ARB       0x8893
 862#define GL_ARRAY_BUFFER_BINDING_ARB       0x8894
 863#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
 864#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
 865#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
 866#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
 867#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
 868#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
 869#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
 870#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
 871#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
 872#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
 873#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
 874#define GL_READ_ONLY_ARB                  0x88B8
 875#define GL_WRITE_ONLY_ARB                 0x88B9
 876#define GL_READ_WRITE_ARB                 0x88BA
 877#define GL_BUFFER_ACCESS_ARB              0x88BB
 878#define GL_BUFFER_MAPPED_ARB              0x88BC
 879#define GL_BUFFER_MAP_POINTER_ARB         0x88BD
 880#define GL_STREAM_DRAW_ARB                0x88E0
 881#define GL_STREAM_READ_ARB                0x88E1
 882#define GL_STREAM_COPY_ARB                0x88E2
 883#define GL_STATIC_DRAW_ARB                0x88E4
 884#define GL_STATIC_READ_ARB                0x88E5
 885#define GL_STATIC_COPY_ARB                0x88E6
 886#define GL_DYNAMIC_DRAW_ARB               0x88E8
 887#define GL_DYNAMIC_READ_ARB               0x88E9
 888#define GL_DYNAMIC_COPY_ARB               0x88EA
 889#endif
 890	
 891
 892
 893#ifndef GL_ARB_vertex_buffer_object
 894/* GL types for handling large vertex buffer objects */
 895typedef intptr_t GLintptrARB;
 896typedef intptr_t GLsizeiptrARB;
 897#endif
 898
 899
 900#ifndef GL_ARB_vertex_buffer_object
 901#define GL_ARB_vertex_buffer_object 1
 902#ifdef GL_GLEXT_FUNCTION_POINTERS
 903typedef void (* glBindBufferARBProcPtr) (GLenum target, GLuint buffer);
 904typedef void (* glDeleteBufferARBProcPtr) (GLsizei n, const GLuint *buffers);
 905typedef void (* glGenBuffersARBProcPtr) (GLsizei n, GLuint *buffers);
 906typedef GLboolean (* glIsBufferARBProcPtr) (GLuint buffer);
 907typedef void (* glBufferDataARBProcPtr) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
 908typedef void (* glBufferSubDataARBProcPtr) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
 909typedef void (* glGetBufferSubDataARBProcPtr) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
 910typedef GLvoid* (* glMapBufferARBProcPtr) (GLenum target, GLenum access);	/* Flawfinder: ignore */
 911typedef GLboolean (* glUnmapBufferARBProcPtr) (GLenum target);
 912typedef void (* glGetBufferParameterivARBProcPtr) (GLenum target, GLenum pname, GLint *params);
 913typedef void (* glGetBufferPointervARBProcPtr) (GLenum target, GLenum pname, GLvoid* *params);
 914#else
 915extern void glBindBufferARB (GLenum, GLuint);
 916extern void glDeleteBuffersARB (GLsizei, const GLuint *);
 917extern void glGenBuffersARB (GLsizei, GLuint *);
 918extern GLboolean glIsBufferARB (GLuint);
 919extern void glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
 920extern void glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *);
 921extern void glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *);
 922extern GLvoid* glMapBufferARB (GLenum, GLenum);
 923extern GLboolean glUnmapBufferARB (GLenum);
 924extern void glGetBufferParameterivARB (GLenum, GLenum, GLint *);
 925extern void glGetBufferPointervARB (GLenum, GLenum, GLvoid* *);
 926#endif /* GL_GLEXT_FUNCTION_POINTERS */
 927#endif
 928
 929#ifndef GL_ARB_texture_rg
 930#define GL_RG                             0x8227
 931#define GL_RG_INTEGER                     0x8228
 932#define GL_R8                             0x8229
 933#define GL_R16                            0x822A
 934#define GL_RG8                            0x822B
 935#define GL_RG16                           0x822C
 936#define GL_R16F                           0x822D
 937#define GL_R32F                           0x822E
 938#define GL_RG16F                          0x822F
 939#define GL_RG32F                          0x8230
 940#define GL_R8I                            0x8231
 941#define GL_R8UI                           0x8232
 942#define GL_R16I                           0x8233
 943#define GL_R16UI                          0x8234
 944#define GL_R32I                           0x8235
 945#define GL_R32UI                          0x8236
 946#define GL_RG8I                           0x8237
 947#define GL_RG8UI                          0x8238
 948#define GL_RG16I                          0x8239
 949#define GL_RG16UI                         0x823A
 950#define GL_RG32I                          0x823B
 951#define GL_RG32UI                         0x823C
 952#endif
 953
 954// May be needed for DARWIN...
 955// #ifndef GL_ARB_compressed_tex_image
 956// #define GL_ARB_compressed_tex_image 1
 957// #ifdef GL_GLEXT_FUNCTION_POINTERS
 958// typedef void (* glCompressedTexImage1D) (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid*);
 959// typedef void (* glCompressedTexImage2D) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
 960// typedef void (* glCompressedTexImage3D) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
 961// typedef void (* glCompressedTexSubImage1D) (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid*);
 962// typedef void (* glCompressedTexSubImage2D) (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
 963// typedef void (* glCompressedTexSubImage3D) (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
 964// typedef void (* glGetCompressedTexImage) (GLenum, GLint, GLvoid*);
 965// #else
 966// extern void glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid*);
 967// extern void glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
 968// extern void glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
 969// extern void glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid*);
 970// extern void glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
 971// extern void glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
 972// extern void glGetCompressedTexImage (GLenum, GLint, GLvoid*);
 973// #endif /* GL_GLEXT_FUNCTION_POINTERS */
 974// #endif
 975
 976#ifdef __cplusplus
 977}
 978#endif
 979
 980#include <AGL/gl.h>
 981
 982#endif // LL_MESA / LL_WINDOWS / LL_DARWIN
 983
 984// Even when GL_ARB_depth_clamp is available in the driver, the (correct)
 985// headers, and therefore GL_DEPTH_CLAMP might not be defined.
 986// In that case GL_DEPTH_CLAMP_NV should be defined, but why not just
 987// use the known numeric.
 988//
 989// To avoid #ifdef's in the code. Just define this here.
 990#ifndef GL_DEPTH_CLAMP
 991// Probably (still) called GL_DEPTH_CLAMP_NV.
 992#define GL_DEPTH_CLAMP 0x864F
 993#endif
 994
 995//GL_NVX_gpu_memory_info constants
 996#ifndef GL_NVX_gpu_memory_info
 997#define GL_NVX_gpu_memory_info
 998#define	GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX          0x9047
 999#define	GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX    0x9048
1000#define	GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX  0x9049
1001#define	GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX            0x904A
1002#define	GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX            0x904B
1003#endif
1004
1005//GL_ATI_meminfo constants
1006#ifndef GL_ATI_meminfo
1007#define GL_ATI_meminfo
1008#define GL_VBO_FREE_MEMORY_ATI                     0x87FB
1009#define GL_TEXTURE_FREE_MEMORY_ATI                 0x87FC
1010#define GL_RENDERBUFFER_FREE_MEMORY_ATI            0x87FD
1011#endif
1012
1013#endif // LL_LLGLHEADERS_H