diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 4308d0b44..588503797 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -171,6 +171,14 @@ MACRO(NL_ADD_STATIC_VID_DRIVERS name) TARGET_LINK_LIBRARIES(${name} nel_drv_opengl) ENDIF(WIN32) ENDIF(WITH_DRIVER_OPENGL) + + IF(WITH_DRIVER_OPENGL3) + IF(WIN32) + TARGET_LINK_LIBRARIES(${name} nel_drv_opengl3_win) + ELSE(WIN32) + TARGET_LINK_LIBRARIES(${name} nel_drv_opengl3) + ENDIF(WIN32) + ENDIF(WITH_DRIVER_OPENGL3) IF(WITH_DRIVER_OPENGLES) IF(WIN32) @@ -309,6 +317,7 @@ MACRO(NL_SETUP_NEL_DEFAULT_OPTIONS) # Drivers Support ### OPTION(WITH_DRIVER_OPENGL "Build OpenGL Driver (3D)" ON ) + OPTION(WITH_DRIVER_OPENGL3 "Build OpenGL3 Driver (3D)" OFF) OPTION(WITH_DRIVER_OPENGLES "Build OpenGL ES Driver (3D)" OFF) OPTION(WITH_DRIVER_DIRECT3D "Build Direct3D Driver (3D)" OFF) OPTION(WITH_DRIVER_OPENAL "Build OpenAL Driver (Sound)" ON ) diff --git a/code/nel/src/3d/driver/CMakeLists.txt b/code/nel/src/3d/driver/CMakeLists.txt index 1004e5824..9ccfd8729 100644 --- a/code/nel/src/3d/driver/CMakeLists.txt +++ b/code/nel/src/3d/driver/CMakeLists.txt @@ -2,6 +2,10 @@ IF(WITH_DRIVER_OPENGL) ADD_SUBDIRECTORY(opengl) ENDIF(WITH_DRIVER_OPENGL) +IF(WITH_DRIVER_OPENGL3) + ADD_SUBDIRECTORY(OpenGL3) +ENDIF(WITH_DRIVER_OPENGL3) + IF(WITH_DRIVER_OPENGLES) ADD_SUBDIRECTORY(opengles) ENDIF(WITH_DRIVER_OPENGLES) diff --git a/code/nel/src/3d/driver/OpenGL3/CMakeLists.txt b/code/nel/src/3d/driver/OpenGL3/CMakeLists.txt new file mode 100644 index 000000000..abc34339b --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/CMakeLists.txt @@ -0,0 +1,81 @@ +FIND_PACKAGE(OpenGL REQUIRED) + +IF(NOT WIN32) + IF(APPLE) + FIND_LIBRARY(CARBON NAMES Carbon) + FIND_LIBRARY(COCOA NAMES Cocoa) + ELSE(APPLE) + FIND_PACKAGE(X11) + FIND_PACKAGE(XF86VidMode) + ENDIF(APPLE) +ENDIF(NOT WIN32) + +FILE(GLOB SRC *.cpp *.h *.def) + +IF(APPLE) + FILE(GLOB MAC_SRC mac/*.h mac/*.m mac/*.mm mac/*.cpp) + SET(SRC ${SRC} ${MAC_SRC}) + SET_SOURCE_FILES_PROPERTIES(${SRC} + PROPERTIES COMPILE_FLAGS "-x objective-c++") +ENDIF(APPLE) + +IF(WIN32) + SET(NLDRV_OGL_LIB "nel_drv_opengl3_win") +ELSE(WIN32) + SET(NLDRV_OGL_LIB "nel_drv_opengl3") +ENDIF(WIN32) + +NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC}) + +INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + +TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_gl_LIBRARY}) +NL_DEFAULT_PROPS(${NLDRV_OGL_LIB} "NeL, Driver, Video: OpenGL3") +NL_ADD_LIB_SUFFIX(${NLDRV_OGL_LIB}) +NL_ADD_RUNTIME_FLAGS(${NLDRV_OGL_LIB}) + +IF(WIN32) + INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) + ADD_DEFINITIONS(/DDRIVER_OPENGL_EXPORTS) +ENDIF(WIN32) + +IF(APPLE) + TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${CARBON}) + TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${COCOA}) +ENDIF(APPLE) + +IF(UNIX AND NOT APPLE) + TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_X11_LIB}) + IF(XF86VidMode_FOUND) + INCLUDE_DIRECTORIES(${XF86VidMode_INCLUDE_DIR}) + ADD_DEFINITIONS(${XF86VidMode_DEFINITIONS}) + TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${XF86VidMode_LIBRARY}) + ENDIF(XF86VidMode_FOUND) + IF(X11_Xrandr_FOUND) + INCLUDE_DIRECTORIES(${X11_Xrandr_INCLUDE_PATH}) + ADD_DEFINITIONS(-DHAVE_XRANDR) + TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_Xrandr_LIB}) + ENDIF(X11_Xrandr_FOUND) + IF(X11_Xrender_FOUND) + INCLUDE_DIRECTORIES(${X11_Xrender_INCLUDE_PATH}) + ADD_DEFINITIONS(-DHAVE_XRENDER) + TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_Xrender_LIB}) + ENDIF(X11_Xrender_FOUND) + IF(X11_Xcursor_FOUND) + INCLUDE_DIRECTORIES(${X11_Xcursor_INCLUDE_PATH}) + ADD_DEFINITIONS(-DHAVE_XCURSOR) + TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_Xcursor_LIB}) + ENDIF(X11_Xcursor_FOUND) +ENDIF(UNIX AND NOT APPLE) + +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(${NLDRV_OGL_LIB} ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.h ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.cpp) +ENDIF(WITH_PCH) + +IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS) + INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_DRIVER_PREFIX} COMPONENT drivers3d) + IF(WITH_MAXPLUGIN) + INSTALL(TARGETS ${NLDRV_OGL_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d) + ENDIF(WITH_MAXPLUGIN) +ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS) diff --git a/code/nel/src/3d/driver/OpenGL3/EGL/egl.h b/code/nel/src/3d/driver/OpenGL3/EGL/egl.h new file mode 100644 index 000000000..99ea342a4 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/EGL/egl.h @@ -0,0 +1,329 @@ +/* -*- mode: c; tab-width: 8; -*- */ +/* vi: set sw=4 ts=8: */ +/* Reference version of egl.h for EGL 1.4. + * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $ + */ + +/* +** Copyright (c) 2007-2009 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __egl_h_ +#define __egl_h_ + +/* All platform-dependent types and macro boilerplate (such as EGLAPI + * and EGLAPIENTRY) should go in eglplatform.h. + */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* EGL Types */ +/* EGLint is defined in eglplatform.h */ +typedef unsigned int EGLBoolean; +typedef unsigned int EGLenum; +typedef void *EGLConfig; +typedef void *EGLContext; +typedef void *EGLDisplay; +typedef void *EGLSurface; +typedef void *EGLClientBuffer; + +/* EGL Versioning */ +#define EGL_VERSION_1_0 1 +#define EGL_VERSION_1_1 1 +#define EGL_VERSION_1_2 1 +#define EGL_VERSION_1_3 1 +#define EGL_VERSION_1_4 1 + +/* EGL Enumerants. Bitmasks and other exceptional cases aside, most + * enums are assigned unique values starting at 0x3000. + */ + +/* EGL aliases */ +#define EGL_FALSE 0 +#define EGL_TRUE 1 + +/* Out-of-band handle values */ +#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) +#define EGL_NO_CONTEXT ((EGLContext)0) +#define EGL_NO_DISPLAY ((EGLDisplay)0) +#define EGL_NO_SURFACE ((EGLSurface)0) + +/* Out-of-band attribute value */ +#define EGL_DONT_CARE ((EGLint)-1) + +/* Errors / GetError return values */ +#define EGL_SUCCESS 0x3000 +#define EGL_NOT_INITIALIZED 0x3001 +#define EGL_BAD_ACCESS 0x3002 +#define EGL_BAD_ALLOC 0x3003 +#define EGL_BAD_ATTRIBUTE 0x3004 +#define EGL_BAD_CONFIG 0x3005 +#define EGL_BAD_CONTEXT 0x3006 +#define EGL_BAD_CURRENT_SURFACE 0x3007 +#define EGL_BAD_DISPLAY 0x3008 +#define EGL_BAD_MATCH 0x3009 +#define EGL_BAD_NATIVE_PIXMAP 0x300A +#define EGL_BAD_NATIVE_WINDOW 0x300B +#define EGL_BAD_PARAMETER 0x300C +#define EGL_BAD_SURFACE 0x300D +#define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */ + +/* Reserved 0x300F-0x301F for additional errors */ + +/* Config attributes */ +#define EGL_BUFFER_SIZE 0x3020 +#define EGL_ALPHA_SIZE 0x3021 +#define EGL_BLUE_SIZE 0x3022 +#define EGL_GREEN_SIZE 0x3023 +#define EGL_RED_SIZE 0x3024 +#define EGL_DEPTH_SIZE 0x3025 +#define EGL_STENCIL_SIZE 0x3026 +#define EGL_CONFIG_CAVEAT 0x3027 +#define EGL_CONFIG_ID 0x3028 +#define EGL_LEVEL 0x3029 +#define EGL_MAX_PBUFFER_HEIGHT 0x302A +#define EGL_MAX_PBUFFER_PIXELS 0x302B +#define EGL_MAX_PBUFFER_WIDTH 0x302C +#define EGL_NATIVE_RENDERABLE 0x302D +#define EGL_NATIVE_VISUAL_ID 0x302E +#define EGL_NATIVE_VISUAL_TYPE 0x302F +#define EGL_SAMPLES 0x3031 +#define EGL_SAMPLE_BUFFERS 0x3032 +#define EGL_SURFACE_TYPE 0x3033 +#define EGL_TRANSPARENT_TYPE 0x3034 +#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 +#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 +#define EGL_TRANSPARENT_RED_VALUE 0x3037 +#define EGL_NONE 0x3038 /* Attrib list terminator */ +#define EGL_BIND_TO_TEXTURE_RGB 0x3039 +#define EGL_BIND_TO_TEXTURE_RGBA 0x303A +#define EGL_MIN_SWAP_INTERVAL 0x303B +#define EGL_MAX_SWAP_INTERVAL 0x303C +#define EGL_LUMINANCE_SIZE 0x303D +#define EGL_ALPHA_MASK_SIZE 0x303E +#define EGL_COLOR_BUFFER_TYPE 0x303F +#define EGL_RENDERABLE_TYPE 0x3040 +#define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */ +#define EGL_CONFORMANT 0x3042 + +/* Reserved 0x3041-0x304F for additional config attributes */ + +/* Config attribute values */ +#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */ +#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */ +#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */ +#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */ +#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */ + +/* More config attribute values, for EGL_TEXTURE_FORMAT */ +#define EGL_NO_TEXTURE 0x305C +#define EGL_TEXTURE_RGB 0x305D +#define EGL_TEXTURE_RGBA 0x305E +#define EGL_TEXTURE_2D 0x305F + +/* Config attribute mask bits */ +#define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */ +#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */ + +#define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */ +#define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */ +#define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */ +#define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */ + +/* QueryString targets */ +#define EGL_VENDOR 0x3053 +#define EGL_VERSION 0x3054 +#define EGL_EXTENSIONS 0x3055 +#define EGL_CLIENT_APIS 0x308D + +/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */ +#define EGL_HEIGHT 0x3056 +#define EGL_WIDTH 0x3057 +#define EGL_LARGEST_PBUFFER 0x3058 +#define EGL_TEXTURE_FORMAT 0x3080 +#define EGL_TEXTURE_TARGET 0x3081 +#define EGL_MIPMAP_TEXTURE 0x3082 +#define EGL_MIPMAP_LEVEL 0x3083 +#define EGL_RENDER_BUFFER 0x3086 +#define EGL_VG_COLORSPACE 0x3087 +#define EGL_VG_ALPHA_FORMAT 0x3088 +#define EGL_HORIZONTAL_RESOLUTION 0x3090 +#define EGL_VERTICAL_RESOLUTION 0x3091 +#define EGL_PIXEL_ASPECT_RATIO 0x3092 +#define EGL_SWAP_BEHAVIOR 0x3093 +#define EGL_MULTISAMPLE_RESOLVE 0x3099 + +/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */ +#define EGL_BACK_BUFFER 0x3084 +#define EGL_SINGLE_BUFFER 0x3085 + +/* OpenVG color spaces */ +#define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */ +#define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */ + +/* OpenVG alpha formats */ +#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */ +#define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */ + +/* Constant scale factor by which fractional display resolutions & + * aspect ratio are scaled when queried as integer values. + */ +#define EGL_DISPLAY_SCALING 10000 + +/* Unknown display resolution/aspect ratio */ +#define EGL_UNKNOWN ((EGLint)-1) + +/* Back buffer swap behaviors */ +#define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */ +#define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */ + +/* CreatePbufferFromClientBuffer buffer types */ +#define EGL_OPENVG_IMAGE 0x3096 + +/* QueryContext targets */ +#define EGL_CONTEXT_CLIENT_TYPE 0x3097 + +/* CreateContext attributes */ +#define EGL_CONTEXT_CLIENT_VERSION 0x3098 + +/* Multisample resolution behaviors */ +#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */ +#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */ + +/* BindAPI/QueryAPI targets */ +#define EGL_OPENGL_ES_API 0x30A0 +#define EGL_OPENVG_API 0x30A1 +#define EGL_OPENGL_API 0x30A2 + +/* GetCurrentSurface targets */ +#define EGL_DRAW 0x3059 +#define EGL_READ 0x305A + +/* WaitNative engines */ +#define EGL_CORE_NATIVE_ENGINE 0x305B + +/* EGL 1.2 tokens renamed for consistency in EGL 1.3 */ +#define EGL_COLORSPACE EGL_VG_COLORSPACE +#define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT +#define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB +#define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR +#define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE +#define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE + +/* EGL extensions must request enum blocks from the Khronos + * API Registrar, who maintains the enumerant registry. Submit + * a bug in Khronos Bugzilla against task "Registry". + */ + + + +/* EGL Functions */ + +EGLAPI EGLint EGLAPIENTRY eglGetError(void); + +EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id); +EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor); +EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy); + +EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name); + +EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, + EGLint config_size, EGLint *num_config); +EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, + EGLConfig *configs, EGLint config_size, + EGLint *num_config); +EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, + EGLint attribute, EGLint *value); + +EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, + EGLNativeWindowType win, + const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, + const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, + EGLNativePixmapType pixmap, + const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface); +EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, + EGLint attribute, EGLint *value); + +EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api); +EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void); + +EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void); + +EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void); + +EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer( + EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, + EGLConfig config, const EGLint *attrib_list); + +EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, + EGLint attribute, EGLint value); +EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); +EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); + + +EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval); + + +EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, + EGLContext share_context, + const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx); +EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, + EGLSurface read, EGLContext ctx); + +EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void); +EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw); +EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx, + EGLint attribute, EGLint *value); + +EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine); +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface); +EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, + EGLNativePixmapType target); + +/* This is a generic function pointer type, whose name indicates it must + * be cast to the proper type *and calling convention* before use. + */ +typedef void (*__eglMustCastToProperFunctionPointerType)(void); + +/* Now, define eglGetProcAddress using the generic function ptr. type */ +EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY + eglGetProcAddress(const char *procname); + +#ifdef __cplusplus +} +#endif + +#endif /* __egl_h_ */ diff --git a/code/nel/src/3d/driver/OpenGL3/EGL/eglext.h b/code/nel/src/3d/driver/OpenGL3/EGL/eglext.h new file mode 100644 index 000000000..a28f5b88e --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/EGL/eglext.h @@ -0,0 +1,488 @@ +#ifndef __eglext_h_ +#define __eglext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2007-2012 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#include + +/*************************************************************/ + +/* Header file version number */ +/* Current version at http://www.khronos.org/registry/egl/ */ +/* $Revision: 19332 $ on $Date: 2012-09-28 17:56:20 -0700 (Fri, 28 Sep 2012) $ */ +#define EGL_EGLEXT_VERSION 14 + +#ifndef EGL_KHR_config_attribs +#define EGL_KHR_config_attribs 1 +#define EGL_CONFORMANT_KHR 0x3042 /* EGLConfig attribute */ +#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 /* EGL_SURFACE_TYPE bitfield */ +#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 /* EGL_SURFACE_TYPE bitfield */ +#endif + +#ifndef EGL_KHR_lock_surface +#define EGL_KHR_lock_surface 1 +#define EGL_READ_SURFACE_BIT_KHR 0x0001 /* EGL_LOCK_USAGE_HINT_KHR bitfield */ +#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 /* EGL_LOCK_USAGE_HINT_KHR bitfield */ +#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 /* EGL_SURFACE_TYPE bitfield */ +#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 /* EGL_SURFACE_TYPE bitfield */ +#define EGL_MATCH_FORMAT_KHR 0x3043 /* EGLConfig attribute */ +#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 /* EGL_MATCH_FORMAT_KHR value */ +#define EGL_FORMAT_RGB_565_KHR 0x30C1 /* EGL_MATCH_FORMAT_KHR value */ +#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 /* EGL_MATCH_FORMAT_KHR value */ +#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 /* EGL_MATCH_FORMAT_KHR value */ +#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 /* eglLockSurfaceKHR attribute */ +#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 /* eglLockSurfaceKHR attribute */ +#define EGL_BITMAP_POINTER_KHR 0x30C6 /* eglQuerySurface attribute */ +#define EGL_BITMAP_PITCH_KHR 0x30C7 /* eglQuerySurface attribute */ +#define EGL_BITMAP_ORIGIN_KHR 0x30C8 /* eglQuerySurface attribute */ +#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 /* eglQuerySurface attribute */ +#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA /* eglQuerySurface attribute */ +#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB /* eglQuerySurface attribute */ +#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC /* eglQuerySurface attribute */ +#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD /* eglQuerySurface attribute */ +#define EGL_LOWER_LEFT_KHR 0x30CE /* EGL_BITMAP_ORIGIN_KHR value */ +#define EGL_UPPER_LEFT_KHR 0x30CF /* EGL_BITMAP_ORIGIN_KHR value */ +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface); +#endif + +#ifndef EGL_KHR_image +#define EGL_KHR_image 1 +#define EGL_NATIVE_PIXMAP_KHR 0x30B0 /* eglCreateImageKHR target */ +typedef void *EGLImageKHR; +#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0) +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); +#endif + +#ifndef EGL_KHR_vg_parent_image +#define EGL_KHR_vg_parent_image 1 +#define EGL_VG_PARENT_IMAGE_KHR 0x30BA /* eglCreateImageKHR target */ +#endif + +#ifndef EGL_KHR_gl_texture_2D_image +#define EGL_KHR_gl_texture_2D_image 1 +#define EGL_GL_TEXTURE_2D_KHR 0x30B1 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC /* eglCreateImageKHR attribute */ +#endif + +#ifndef EGL_KHR_gl_texture_cubemap_image +#define EGL_KHR_gl_texture_cubemap_image 1 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 /* eglCreateImageKHR target */ +#endif + +#ifndef EGL_KHR_gl_texture_3D_image +#define EGL_KHR_gl_texture_3D_image 1 +#define EGL_GL_TEXTURE_3D_KHR 0x30B2 /* eglCreateImageKHR target */ +#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD /* eglCreateImageKHR attribute */ +#endif + +#ifndef EGL_KHR_gl_renderbuffer_image +#define EGL_KHR_gl_renderbuffer_image 1 +#define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */ +#endif + +#if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */ +#ifndef EGL_KHR_reusable_sync +#define EGL_KHR_reusable_sync 1 + +typedef void* EGLSyncKHR; +typedef khronos_utime_nanoseconds_t EGLTimeKHR; + +#define EGL_SYNC_STATUS_KHR 0x30F1 +#define EGL_SIGNALED_KHR 0x30F2 +#define EGL_UNSIGNALED_KHR 0x30F3 +#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 +#define EGL_CONDITION_SATISFIED_KHR 0x30F6 +#define EGL_SYNC_TYPE_KHR 0x30F7 +#define EGL_SYNC_REUSABLE_KHR 0x30FA +#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 /* eglClientWaitSyncKHR bitfield */ +#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull +#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0) +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync); +EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); +EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); +EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); +typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); +#endif +#endif + +#ifndef EGL_KHR_image_base +#define EGL_KHR_image_base 1 +/* Most interfaces defined by EGL_KHR_image_pixmap above */ +#define EGL_IMAGE_PRESERVED_KHR 0x30D2 /* eglCreateImageKHR attribute */ +#endif + +#ifndef EGL_KHR_image_pixmap +#define EGL_KHR_image_pixmap 1 +/* Interfaces defined by EGL_KHR_image above */ +#endif + +#ifndef EGL_IMG_context_priority +#define EGL_IMG_context_priority 1 +#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 +#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 +#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 +#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 +#endif + +#ifndef EGL_KHR_lock_surface2 +#define EGL_KHR_lock_surface2 1 +#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 +#endif + +#ifndef EGL_NV_coverage_sample +#define EGL_NV_coverage_sample 1 +#define EGL_COVERAGE_BUFFERS_NV 0x30E0 +#define EGL_COVERAGE_SAMPLES_NV 0x30E1 +#endif + +#ifndef EGL_NV_depth_nonlinear +#define EGL_NV_depth_nonlinear 1 +#define EGL_DEPTH_ENCODING_NV 0x30E2 +#define EGL_DEPTH_ENCODING_NONE_NV 0 +#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 +#endif + +#if KHRONOS_SUPPORT_INT64 /* EGLTimeNV requires 64-bit uint support */ +#ifndef EGL_NV_sync +#define EGL_NV_sync 1 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 +#define EGL_SYNC_STATUS_NV 0x30E7 +#define EGL_SIGNALED_NV 0x30E8 +#define EGL_UNSIGNALED_NV 0x30E9 +#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 +#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull +#define EGL_ALREADY_SIGNALED_NV 0x30EA +#define EGL_TIMEOUT_EXPIRED_NV 0x30EB +#define EGL_CONDITION_SATISFIED_NV 0x30EC +#define EGL_SYNC_TYPE_NV 0x30ED +#define EGL_SYNC_CONDITION_NV 0x30EE +#define EGL_SYNC_FENCE_NV 0x30EF +#define EGL_NO_SYNC_NV ((EGLSyncNV)0) +typedef void* EGLSyncNV; +typedef khronos_utime_nanoseconds_t EGLTimeNV; +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync); +EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync); +EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); +EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode); +EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync); +typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value); +#endif +#endif + +#if KHRONOS_SUPPORT_INT64 /* Dependent on EGL_KHR_reusable_sync which requires 64-bit uint support */ +#ifndef EGL_KHR_fence_sync +#define EGL_KHR_fence_sync 1 +/* Reuses most tokens and entry points from EGL_KHR_reusable_sync */ +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 +#define EGL_SYNC_CONDITION_KHR 0x30F8 +#define EGL_SYNC_FENCE_KHR 0x30F9 +#endif +#endif + +#ifndef EGL_HI_clientpixmap +#define EGL_HI_clientpixmap 1 + +/* Surface Attribute */ +#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74 +/* + * Structure representing a client pixmap + * (pixmap's data is in client-space memory). + */ +struct EGLClientPixmapHI +{ + void* pData; + EGLint iWidth; + EGLint iHeight; + EGLint iStride; +}; + +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI(EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap); +#endif /* EGL_HI_clientpixmap */ + +#ifndef EGL_HI_colorformats +#define EGL_HI_colorformats 1 +/* Config Attribute */ +#define EGL_COLOR_FORMAT_HI 0x8F70 +/* Color Formats */ +#define EGL_COLOR_RGB_HI 0x8F71 +#define EGL_COLOR_RGBA_HI 0x8F72 +#define EGL_COLOR_ARGB_HI 0x8F73 +#endif /* EGL_HI_colorformats */ + +#ifndef EGL_MESA_drm_image +#define EGL_MESA_drm_image 1 +#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 /* CreateDRMImageMESA attribute */ +#define EGL_DRM_BUFFER_USE_MESA 0x31D1 /* CreateDRMImageMESA attribute */ +#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 /* EGL_IMAGE_FORMAT_MESA attribute value */ +#define EGL_DRM_BUFFER_MESA 0x31D3 /* eglCreateImageKHR target */ +#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 +#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 /* EGL_DRM_BUFFER_USE_MESA bits */ +#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 /* EGL_DRM_BUFFER_USE_MESA bits */ +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); +#endif + +#ifndef EGL_NV_post_sub_buffer +#define EGL_NV_post_sub_buffer 1 +#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); +#endif + +#ifndef EGL_ANDROID_image_native_buffer +#define EGL_ANDROID_image_native_buffer 1 +struct ANativeWindowBuffer; +#define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */ +#endif + +#ifndef EGL_ANDROID_swap_rectangle +#define EGL_ANDROID_swap_rectangle 1 +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSetSwapRectangleANDROID (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSWAPRECTANGLEANDROIDPROC) (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height); +#endif + +#ifndef EGL_ANDROID_recordable +#define EGL_ANDROID_recordable 1 +#define EGL_RECORDABLE_ANDROID 0x3142 /* EGLConfig attribute */ +#endif + +#ifndef EGL_ANGLE_query_surface_pointer +#define EGL_ANGLE_query_surface_pointer 1 +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean eglQuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); +#endif +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); +#endif + +#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle +#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 +#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 +#endif + +#ifndef EGL_NV_coverage_sample_resolve +#define EGL_NV_coverage_sample_resolve 1 +#define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131 +#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132 +#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133 +#endif + +#if KHRONOS_SUPPORT_INT64 /* EGLuint64NV requires 64-bit uint support */ +#ifndef EGL_NV_system_time +#define EGL_NV_system_time 1 + +typedef khronos_utime_nanoseconds_t EGLuint64NV; + +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV(void); +EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV(void); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void); +typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void); +#endif +#endif + +#if KHRONOS_SUPPORT_INT64 /* EGLuint64KHR requires 64-bit uint support */ +#ifndef EGL_KHR_stream +#define EGL_KHR_stream 1 +typedef void* EGLStreamKHR; +typedef khronos_uint64_t EGLuint64KHR; +#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0) +#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 +#define EGL_PRODUCER_FRAME_KHR 0x3212 +#define EGL_CONSUMER_FRAME_KHR 0x3213 +#define EGL_STREAM_STATE_KHR 0x3214 +#define EGL_STREAM_STATE_CREATED_KHR 0x3215 +#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 +#define EGL_STREAM_STATE_EMPTY_KHR 0x3217 +#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218 +#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219 +#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A +#define EGL_BAD_STREAM_KHR 0x321B +#define EGL_BAD_STATE_KHR 0x321C +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream); +EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC)(EGLDisplay dpy, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); +#endif +#endif + +#ifdef EGL_KHR_stream /* Requires KHR_stream extension */ +#ifndef EGL_KHR_stream_consumer_gltexture +#define EGL_KHR_stream_consumer_gltexture 1 +#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream); +EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream); +EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream); +#endif +#endif + +#ifdef EGL_KHR_stream /* Requires KHR_stream extension */ +#ifndef EGL_KHR_stream_producer_eglsurface +#define EGL_KHR_stream_producer_eglsurface 1 +#define EGL_STREAM_BIT_KHR 0x0800 +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); +#endif +#endif + +#ifdef EGL_KHR_stream /* Requires KHR_stream extension */ +#ifndef EGL_KHR_stream_producer_aldatalocator +#define EGL_KHR_stream_producer_aldatalocator 1 +#endif +#endif + +#ifdef EGL_KHR_stream /* Requires KHR_stream extension */ +#ifndef EGL_KHR_stream_fifo +#define EGL_KHR_stream_fifo 1 +/* reuse EGLTimeKHR */ +#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC +#define EGL_STREAM_TIME_NOW_KHR 0x31FD +#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE +#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); +#endif +#endif + +#ifndef EGL_EXT_create_context_robustness +#define EGL_EXT_create_context_robustness 1 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138 +#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF +#endif + +#ifndef EGL_ANGLE_d3d_share_handle_client_buffer +#define EGL_ANGLE_d3d_share_handle_client_buffer 1 +/* reuse EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE */ +#endif + +#ifndef EGL_KHR_create_context +#define EGL_KHR_create_context 1 +#define EGL_CONTEXT_MAJOR_VERSION_KHR EGL_CONTEXT_CLIENT_VERSION +#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB +#define EGL_CONTEXT_FLAGS_KHR 0x30FC +#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD +#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF +#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 +#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 +#endif + +#ifndef EGL_KHR_surfaceless_context +#define EGL_KHR_surfaceless_context 1 +/* No tokens/entry points, just relaxes an error condition */ +#endif + +#ifdef EGL_KHR_stream /* Requires KHR_stream extension */ +#ifndef EGL_KHR_stream_cross_process_fd +#define EGL_KHR_stream_cross_process_fd 1 +typedef int EGLNativeFileDescriptorKHR; +#define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1)) +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR(EGLDisplay dpy, EGLStreamKHR stream); +EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); +#endif +#endif + +#ifndef EGL_EXT_multiview_window +#define EGL_EXT_multiview_window 1 +#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134 +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/nel/src/3d/driver/OpenGL3/EGL/eglplatform.h b/code/nel/src/3d/driver/OpenGL3/EGL/eglplatform.h new file mode 100644 index 000000000..6d34ab55d --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/EGL/eglplatform.h @@ -0,0 +1,115 @@ +#ifndef __eglplatform_h_ +#define __eglplatform_h_ + +/* +** Copyright (c) 2007-2009 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Platform-specific types and definitions for egl.h + * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $ + * + * Adopters may modify khrplatform.h and this file to suit their platform. + * You are encouraged to submit all modifications to the Khronos group so that + * they can be included in future versions of this file. Please submit changes + * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) + * by filing a bug against product "EGL" component "Registry". + */ + +#include + +/* Macros used in EGL function prototype declarations. + * + * EGL functions should be prototyped as: + * + * EGLAPI return-type EGLAPIENTRY eglFunction(arguments); + * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); + * + * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h + */ + +#ifndef EGLAPI +#define EGLAPI KHRONOS_APICALL +#endif + +#ifndef EGLAPIENTRY +#define EGLAPIENTRY KHRONOS_APIENTRY +#endif +#define EGLAPIENTRYP EGLAPIENTRY* + +/* The types NativeDisplayType, NativeWindowType, and NativePixmapType + * are aliases of window-system-dependent types, such as X Display * or + * Windows Device Context. They must be defined in platform-specific + * code below. The EGL-prefixed versions of Native*Type are the same + * types, renamed in EGL 1.3 so all types in the API start with "EGL". + * + * Khronos STRONGLY RECOMMENDS that you use the default definitions + * provided below, since these changes affect both binary and source + * portability of applications using EGL running on different EGL + * implementations. + */ + +#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +#include + +typedef HDC EGLNativeDisplayType; +typedef HBITMAP EGLNativePixmapType; +typedef HWND EGLNativeWindowType; + +#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ + +typedef int EGLNativeDisplayType; +typedef void *EGLNativeWindowType; +typedef void *EGLNativePixmapType; + +#elif defined(__unix__) + +/* X11 (tentative) */ +#include +#include + +typedef Display *EGLNativeDisplayType; +typedef Pixmap EGLNativePixmapType; +typedef Window EGLNativeWindowType; + +#else +#error "Platform not recognized" +#endif + +/* EGL 1.2 types, renamed for consistency in EGL 1.3 */ +typedef EGLNativeDisplayType NativeDisplayType; +typedef EGLNativePixmapType NativePixmapType; +typedef EGLNativeWindowType NativeWindowType; + + +/* Define EGLint. This must be a signed integral type large enough to contain + * all legal attribute names and values passed into and out of EGL, whether + * their type is boolean, bitmask, enumerant (symbolic constant), integer, + * handle, or other. While in general a 32-bit integer will suffice, if + * handles are 64 bit types, then EGLint should be defined as a signed 64-bit + * integer type. + */ +typedef khronos_int32_t EGLint; + +#endif /* __eglplatform_h */ diff --git a/code/nel/src/3d/driver/OpenGL3/GL/glext.h b/code/nel/src/3d/driver/OpenGL3/GL/glext.h new file mode 100644 index 000000000..44ab7c62e --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/GL/glext.h @@ -0,0 +1,12740 @@ +#ifndef __glext_h_ +#define __glext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2007-2012 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Header file version number, required by OpenGL ABI for Linux */ +/* glext.h last updated $Date: 2012-09-19 19:02:24 -0700 (Wed, 19 Sep 2012) $ */ +/* Current version at http://www.opengl.org/registry/ */ +#define GL_GLEXT_VERSION 85 +/* Function declaration macros - to move into glplatform.h */ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +/*************************************************************/ + +#ifndef GL_VERSION_1_2 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_RESCALE_NORMAL 0x803A +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#endif + +#ifndef GL_ARB_imaging +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#endif + +#ifndef GL_VERSION_1_3 +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#endif + +#ifndef GL_VERSION_1_4 +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_COMPARE_R_TO_TEXTURE 0x884E +#endif + +#ifndef GL_VERSION_1_5 +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 +#define GL_SRC1_ALPHA 0x8589 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_FOG_COORD_SRC 0x8450 +#define GL_FOG_COORD 0x8451 +#define GL_CURRENT_FOG_COORD 0x8453 +#define GL_FOG_COORD_ARRAY_TYPE 0x8454 +#define GL_FOG_COORD_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORD_ARRAY_POINTER 0x8456 +#define GL_FOG_COORD_ARRAY 0x8457 +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D +#define GL_SRC0_RGB 0x8580 +#define GL_SRC1_RGB 0x8581 +#define GL_SRC2_RGB 0x8582 +#define GL_SRC0_ALPHA 0x8588 +#define GL_SRC2_ALPHA 0x858A +#endif + +#ifndef GL_VERSION_2_0 +#define GL_BLEND_EQUATION_RGB 0x8009 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_TEXTURE_COORDS 0x8871 +#endif + +#ifndef GL_VERSION_2_1 +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B +#endif + +#ifndef GL_VERSION_3_0 +#define GL_COMPARE_REF_TO_TEXTURE 0x884E +#define GL_CLIP_DISTANCE0 0x3000 +#define GL_CLIP_DISTANCE1 0x3001 +#define GL_CLIP_DISTANCE2 0x3002 +#define GL_CLIP_DISTANCE3 0x3003 +#define GL_CLIP_DISTANCE4 0x3004 +#define GL_CLIP_DISTANCE5 0x3005 +#define GL_CLIP_DISTANCE6 0x3006 +#define GL_CLIP_DISTANCE7 0x3007 +#define GL_MAX_CLIP_DISTANCES 0x0D32 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_MAX_VARYING_COMPONENTS 0x8B4B +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 +/* Reuse tokens from ARB_depth_buffer_float */ +/* reuse GL_DEPTH_COMPONENT32F */ +/* reuse GL_DEPTH32F_STENCIL8 */ +/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */ +/* Reuse tokens from ARB_framebuffer_object */ +/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ +/* reuse GL_FRAMEBUFFER_DEFAULT */ +/* reuse GL_FRAMEBUFFER_UNDEFINED */ +/* reuse GL_DEPTH_STENCIL_ATTACHMENT */ +/* reuse GL_INDEX */ +/* reuse GL_MAX_RENDERBUFFER_SIZE */ +/* reuse GL_DEPTH_STENCIL */ +/* reuse GL_UNSIGNED_INT_24_8 */ +/* reuse GL_DEPTH24_STENCIL8 */ +/* reuse GL_TEXTURE_STENCIL_SIZE */ +/* reuse GL_TEXTURE_RED_TYPE */ +/* reuse GL_TEXTURE_GREEN_TYPE */ +/* reuse GL_TEXTURE_BLUE_TYPE */ +/* reuse GL_TEXTURE_ALPHA_TYPE */ +/* reuse GL_TEXTURE_DEPTH_TYPE */ +/* reuse GL_UNSIGNED_NORMALIZED */ +/* reuse GL_FRAMEBUFFER_BINDING */ +/* reuse GL_DRAW_FRAMEBUFFER_BINDING */ +/* reuse GL_RENDERBUFFER_BINDING */ +/* reuse GL_READ_FRAMEBUFFER */ +/* reuse GL_DRAW_FRAMEBUFFER */ +/* reuse GL_READ_FRAMEBUFFER_BINDING */ +/* reuse GL_RENDERBUFFER_SAMPLES */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ +/* reuse GL_FRAMEBUFFER_COMPLETE */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */ +/* reuse GL_FRAMEBUFFER_UNSUPPORTED */ +/* reuse GL_MAX_COLOR_ATTACHMENTS */ +/* reuse GL_COLOR_ATTACHMENT0 */ +/* reuse GL_COLOR_ATTACHMENT1 */ +/* reuse GL_COLOR_ATTACHMENT2 */ +/* reuse GL_COLOR_ATTACHMENT3 */ +/* reuse GL_COLOR_ATTACHMENT4 */ +/* reuse GL_COLOR_ATTACHMENT5 */ +/* reuse GL_COLOR_ATTACHMENT6 */ +/* reuse GL_COLOR_ATTACHMENT7 */ +/* reuse GL_COLOR_ATTACHMENT8 */ +/* reuse GL_COLOR_ATTACHMENT9 */ +/* reuse GL_COLOR_ATTACHMENT10 */ +/* reuse GL_COLOR_ATTACHMENT11 */ +/* reuse GL_COLOR_ATTACHMENT12 */ +/* reuse GL_COLOR_ATTACHMENT13 */ +/* reuse GL_COLOR_ATTACHMENT14 */ +/* reuse GL_COLOR_ATTACHMENT15 */ +/* reuse GL_DEPTH_ATTACHMENT */ +/* reuse GL_STENCIL_ATTACHMENT */ +/* reuse GL_FRAMEBUFFER */ +/* reuse GL_RENDERBUFFER */ +/* reuse GL_RENDERBUFFER_WIDTH */ +/* reuse GL_RENDERBUFFER_HEIGHT */ +/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */ +/* reuse GL_STENCIL_INDEX1 */ +/* reuse GL_STENCIL_INDEX4 */ +/* reuse GL_STENCIL_INDEX8 */ +/* reuse GL_STENCIL_INDEX16 */ +/* reuse GL_RENDERBUFFER_RED_SIZE */ +/* reuse GL_RENDERBUFFER_GREEN_SIZE */ +/* reuse GL_RENDERBUFFER_BLUE_SIZE */ +/* reuse GL_RENDERBUFFER_ALPHA_SIZE */ +/* reuse GL_RENDERBUFFER_DEPTH_SIZE */ +/* reuse GL_RENDERBUFFER_STENCIL_SIZE */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ +/* reuse GL_MAX_SAMPLES */ +/* Reuse tokens from ARB_framebuffer_sRGB */ +/* reuse GL_FRAMEBUFFER_SRGB */ +/* Reuse tokens from ARB_half_float_vertex */ +/* reuse GL_HALF_FLOAT */ +/* Reuse tokens from ARB_map_buffer_range */ +/* reuse GL_MAP_READ_BIT */ +/* reuse GL_MAP_WRITE_BIT */ +/* reuse GL_MAP_INVALIDATE_RANGE_BIT */ +/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */ +/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */ +/* reuse GL_MAP_UNSYNCHRONIZED_BIT */ +/* Reuse tokens from ARB_texture_compression_rgtc */ +/* reuse GL_COMPRESSED_RED_RGTC1 */ +/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */ +/* reuse GL_COMPRESSED_RG_RGTC2 */ +/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */ +/* Reuse tokens from ARB_texture_rg */ +/* reuse GL_RG */ +/* reuse GL_RG_INTEGER */ +/* reuse GL_R8 */ +/* reuse GL_R16 */ +/* reuse GL_RG8 */ +/* reuse GL_RG16 */ +/* reuse GL_R16F */ +/* reuse GL_R32F */ +/* reuse GL_RG16F */ +/* reuse GL_RG32F */ +/* reuse GL_R8I */ +/* reuse GL_R8UI */ +/* reuse GL_R16I */ +/* reuse GL_R16UI */ +/* reuse GL_R32I */ +/* reuse GL_R32UI */ +/* reuse GL_RG8I */ +/* reuse GL_RG8UI */ +/* reuse GL_RG16I */ +/* reuse GL_RG16UI */ +/* reuse GL_RG32I */ +/* reuse GL_RG32UI */ +/* Reuse tokens from ARB_vertex_array_object */ +/* reuse GL_VERTEX_ARRAY_BINDING */ +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_ALPHA_INTEGER 0x8D97 +/* Reuse tokens from ARB_framebuffer_object */ +/* reuse GL_TEXTURE_LUMINANCE_TYPE */ +/* reuse GL_TEXTURE_INTENSITY_TYPE */ +#endif + +#ifndef GL_VERSION_3_1 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +/* Reuse tokens from ARB_copy_buffer */ +/* reuse GL_COPY_READ_BUFFER */ +/* reuse GL_COPY_WRITE_BUFFER */ +/* Reuse tokens from ARB_draw_instanced (none) */ +/* Reuse tokens from ARB_uniform_buffer_object */ +/* reuse GL_UNIFORM_BUFFER */ +/* reuse GL_UNIFORM_BUFFER_BINDING */ +/* reuse GL_UNIFORM_BUFFER_START */ +/* reuse GL_UNIFORM_BUFFER_SIZE */ +/* reuse GL_MAX_VERTEX_UNIFORM_BLOCKS */ +/* reuse GL_MAX_FRAGMENT_UNIFORM_BLOCKS */ +/* reuse GL_MAX_COMBINED_UNIFORM_BLOCKS */ +/* reuse GL_MAX_UNIFORM_BUFFER_BINDINGS */ +/* reuse GL_MAX_UNIFORM_BLOCK_SIZE */ +/* reuse GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS */ +/* reuse GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT */ +/* reuse GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */ +/* reuse GL_ACTIVE_UNIFORM_BLOCKS */ +/* reuse GL_UNIFORM_TYPE */ +/* reuse GL_UNIFORM_SIZE */ +/* reuse GL_UNIFORM_NAME_LENGTH */ +/* reuse GL_UNIFORM_BLOCK_INDEX */ +/* reuse GL_UNIFORM_OFFSET */ +/* reuse GL_UNIFORM_ARRAY_STRIDE */ +/* reuse GL_UNIFORM_MATRIX_STRIDE */ +/* reuse GL_UNIFORM_IS_ROW_MAJOR */ +/* reuse GL_UNIFORM_BLOCK_BINDING */ +/* reuse GL_UNIFORM_BLOCK_DATA_SIZE */ +/* reuse GL_UNIFORM_BLOCK_NAME_LENGTH */ +/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS */ +/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER */ +/* reuse GL_INVALID_INDEX */ +#endif + +#ifndef GL_VERSION_3_2 +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 +/* reuse GL_MAX_VARYING_COMPONENTS */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ +/* Reuse tokens from ARB_depth_clamp */ +/* reuse GL_DEPTH_CLAMP */ +/* Reuse tokens from ARB_draw_elements_base_vertex (none) */ +/* Reuse tokens from ARB_fragment_coord_conventions (none) */ +/* Reuse tokens from ARB_provoking_vertex */ +/* reuse GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ +/* reuse GL_FIRST_VERTEX_CONVENTION */ +/* reuse GL_LAST_VERTEX_CONVENTION */ +/* reuse GL_PROVOKING_VERTEX */ +/* Reuse tokens from ARB_seamless_cube_map */ +/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */ +/* Reuse tokens from ARB_sync */ +/* reuse GL_MAX_SERVER_WAIT_TIMEOUT */ +/* reuse GL_OBJECT_TYPE */ +/* reuse GL_SYNC_CONDITION */ +/* reuse GL_SYNC_STATUS */ +/* reuse GL_SYNC_FLAGS */ +/* reuse GL_SYNC_FENCE */ +/* reuse GL_SYNC_GPU_COMMANDS_COMPLETE */ +/* reuse GL_UNSIGNALED */ +/* reuse GL_SIGNALED */ +/* reuse GL_ALREADY_SIGNALED */ +/* reuse GL_TIMEOUT_EXPIRED */ +/* reuse GL_CONDITION_SATISFIED */ +/* reuse GL_WAIT_FAILED */ +/* reuse GL_TIMEOUT_IGNORED */ +/* reuse GL_SYNC_FLUSH_COMMANDS_BIT */ +/* reuse GL_TIMEOUT_IGNORED */ +/* Reuse tokens from ARB_texture_multisample */ +/* reuse GL_SAMPLE_POSITION */ +/* reuse GL_SAMPLE_MASK */ +/* reuse GL_SAMPLE_MASK_VALUE */ +/* reuse GL_MAX_SAMPLE_MASK_WORDS */ +/* reuse GL_TEXTURE_2D_MULTISAMPLE */ +/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE */ +/* reuse GL_TEXTURE_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE */ +/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_TEXTURE_SAMPLES */ +/* reuse GL_TEXTURE_FIXED_SAMPLE_LOCATIONS */ +/* reuse GL_SAMPLER_2D_MULTISAMPLE */ +/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE */ +/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE */ +/* reuse GL_SAMPLER_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_MAX_COLOR_TEXTURE_SAMPLES */ +/* reuse GL_MAX_DEPTH_TEXTURE_SAMPLES */ +/* reuse GL_MAX_INTEGER_SAMPLES */ +/* Don't need to reuse tokens from ARB_vertex_array_bgra since they're already in 1.2 core */ +#endif + +#ifndef GL_VERSION_3_3 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +/* Reuse tokens from ARB_blend_func_extended */ +/* reuse GL_SRC1_COLOR */ +/* reuse GL_ONE_MINUS_SRC1_COLOR */ +/* reuse GL_ONE_MINUS_SRC1_ALPHA */ +/* reuse GL_MAX_DUAL_SOURCE_DRAW_BUFFERS */ +/* Reuse tokens from ARB_explicit_attrib_location (none) */ +/* Reuse tokens from ARB_occlusion_query2 */ +/* reuse GL_ANY_SAMPLES_PASSED */ +/* Reuse tokens from ARB_sampler_objects */ +/* reuse GL_SAMPLER_BINDING */ +/* Reuse tokens from ARB_shader_bit_encoding (none) */ +/* Reuse tokens from ARB_texture_rgb10_a2ui */ +/* reuse GL_RGB10_A2UI */ +/* Reuse tokens from ARB_texture_swizzle */ +/* reuse GL_TEXTURE_SWIZZLE_R */ +/* reuse GL_TEXTURE_SWIZZLE_G */ +/* reuse GL_TEXTURE_SWIZZLE_B */ +/* reuse GL_TEXTURE_SWIZZLE_A */ +/* reuse GL_TEXTURE_SWIZZLE_RGBA */ +/* Reuse tokens from ARB_timer_query */ +/* reuse GL_TIME_ELAPSED */ +/* reuse GL_TIMESTAMP */ +/* Reuse tokens from ARB_vertex_type_2_10_10_10_rev */ +/* reuse GL_INT_2_10_10_10_REV */ +#endif + +#ifndef GL_VERSION_4_0 +#define GL_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F +/* Reuse tokens from ARB_texture_query_lod (none) */ +/* Reuse tokens from ARB_draw_buffers_blend (none) */ +/* Reuse tokens from ARB_draw_indirect */ +/* reuse GL_DRAW_INDIRECT_BUFFER */ +/* reuse GL_DRAW_INDIRECT_BUFFER_BINDING */ +/* Reuse tokens from ARB_gpu_shader5 */ +/* reuse GL_GEOMETRY_SHADER_INVOCATIONS */ +/* reuse GL_MAX_GEOMETRY_SHADER_INVOCATIONS */ +/* reuse GL_MIN_FRAGMENT_INTERPOLATION_OFFSET */ +/* reuse GL_MAX_FRAGMENT_INTERPOLATION_OFFSET */ +/* reuse GL_FRAGMENT_INTERPOLATION_OFFSET_BITS */ +/* reuse GL_MAX_VERTEX_STREAMS */ +/* Reuse tokens from ARB_gpu_shader_fp64 */ +/* reuse GL_DOUBLE_VEC2 */ +/* reuse GL_DOUBLE_VEC3 */ +/* reuse GL_DOUBLE_VEC4 */ +/* reuse GL_DOUBLE_MAT2 */ +/* reuse GL_DOUBLE_MAT3 */ +/* reuse GL_DOUBLE_MAT4 */ +/* reuse GL_DOUBLE_MAT2x3 */ +/* reuse GL_DOUBLE_MAT2x4 */ +/* reuse GL_DOUBLE_MAT3x2 */ +/* reuse GL_DOUBLE_MAT3x4 */ +/* reuse GL_DOUBLE_MAT4x2 */ +/* reuse GL_DOUBLE_MAT4x3 */ +/* Reuse tokens from ARB_shader_subroutine */ +/* reuse GL_ACTIVE_SUBROUTINES */ +/* reuse GL_ACTIVE_SUBROUTINE_UNIFORMS */ +/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS */ +/* reuse GL_ACTIVE_SUBROUTINE_MAX_LENGTH */ +/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH */ +/* reuse GL_MAX_SUBROUTINES */ +/* reuse GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS */ +/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */ +/* reuse GL_COMPATIBLE_SUBROUTINES */ +/* Reuse tokens from ARB_tessellation_shader */ +/* reuse GL_PATCHES */ +/* reuse GL_PATCH_VERTICES */ +/* reuse GL_PATCH_DEFAULT_INNER_LEVEL */ +/* reuse GL_PATCH_DEFAULT_OUTER_LEVEL */ +/* reuse GL_TESS_CONTROL_OUTPUT_VERTICES */ +/* reuse GL_TESS_GEN_MODE */ +/* reuse GL_TESS_GEN_SPACING */ +/* reuse GL_TESS_GEN_VERTEX_ORDER */ +/* reuse GL_TESS_GEN_POINT_MODE */ +/* reuse GL_ISOLINES */ +/* reuse GL_FRACTIONAL_ODD */ +/* reuse GL_FRACTIONAL_EVEN */ +/* reuse GL_MAX_PATCH_VERTICES */ +/* reuse GL_MAX_TESS_GEN_LEVEL */ +/* reuse GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS */ +/* reuse GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS */ +/* reuse GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS */ +/* reuse GL_MAX_TESS_PATCH_COMPONENTS */ +/* reuse GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS */ +/* reuse GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS */ +/* reuse GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS */ +/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS */ +/* reuse GL_MAX_TESS_CONTROL_INPUT_COMPONENTS */ +/* reuse GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS */ +/* reuse GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER */ +/* reuse GL_TESS_EVALUATION_SHADER */ +/* reuse GL_TESS_CONTROL_SHADER */ +/* Reuse tokens from ARB_texture_buffer_object_rgb32 (none) */ +/* Reuse tokens from ARB_transform_feedback2 */ +/* reuse GL_TRANSFORM_FEEDBACK */ +/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */ +/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */ +/* reuse GL_TRANSFORM_FEEDBACK_BINDING */ +/* Reuse tokens from ARB_transform_feedback3 */ +/* reuse GL_MAX_TRANSFORM_FEEDBACK_BUFFERS */ +/* reuse GL_MAX_VERTEX_STREAMS */ +#endif + +#ifndef GL_VERSION_4_1 +/* Reuse tokens from ARB_ES2_compatibility */ +/* reuse GL_FIXED */ +/* reuse GL_IMPLEMENTATION_COLOR_READ_TYPE */ +/* reuse GL_IMPLEMENTATION_COLOR_READ_FORMAT */ +/* reuse GL_LOW_FLOAT */ +/* reuse GL_MEDIUM_FLOAT */ +/* reuse GL_HIGH_FLOAT */ +/* reuse GL_LOW_INT */ +/* reuse GL_MEDIUM_INT */ +/* reuse GL_HIGH_INT */ +/* reuse GL_SHADER_COMPILER */ +/* reuse GL_SHADER_BINARY_FORMATS */ +/* reuse GL_NUM_SHADER_BINARY_FORMATS */ +/* reuse GL_MAX_VERTEX_UNIFORM_VECTORS */ +/* reuse GL_MAX_VARYING_VECTORS */ +/* reuse GL_MAX_FRAGMENT_UNIFORM_VECTORS */ +/* reuse GL_RGB565 */ +/* Reuse tokens from ARB_get_program_binary */ +/* reuse GL_PROGRAM_BINARY_RETRIEVABLE_HINT */ +/* reuse GL_PROGRAM_BINARY_LENGTH */ +/* reuse GL_NUM_PROGRAM_BINARY_FORMATS */ +/* reuse GL_PROGRAM_BINARY_FORMATS */ +/* Reuse tokens from ARB_separate_shader_objects */ +/* reuse GL_VERTEX_SHADER_BIT */ +/* reuse GL_FRAGMENT_SHADER_BIT */ +/* reuse GL_GEOMETRY_SHADER_BIT */ +/* reuse GL_TESS_CONTROL_SHADER_BIT */ +/* reuse GL_TESS_EVALUATION_SHADER_BIT */ +/* reuse GL_ALL_SHADER_BITS */ +/* reuse GL_PROGRAM_SEPARABLE */ +/* reuse GL_ACTIVE_PROGRAM */ +/* reuse GL_PROGRAM_PIPELINE_BINDING */ +/* Reuse tokens from ARB_shader_precision (none) */ +/* Reuse tokens from ARB_vertex_attrib_64bit - all are in GL 3.0 and 4.0 already */ +/* Reuse tokens from ARB_viewport_array - some are in GL 1.1 and ARB_provoking_vertex already */ +/* reuse GL_MAX_VIEWPORTS */ +/* reuse GL_VIEWPORT_SUBPIXEL_BITS */ +/* reuse GL_VIEWPORT_BOUNDS_RANGE */ +/* reuse GL_LAYER_PROVOKING_VERTEX */ +/* reuse GL_VIEWPORT_INDEX_PROVOKING_VERTEX */ +/* reuse GL_UNDEFINED_VERTEX */ +#endif + +#ifndef GL_VERSION_4_2 +/* Reuse tokens from ARB_base_instance (none) */ +/* Reuse tokens from ARB_shading_language_420pack (none) */ +/* Reuse tokens from ARB_transform_feedback_instanced (none) */ +/* Reuse tokens from ARB_compressed_texture_pixel_storage */ +/* reuse GL_UNPACK_COMPRESSED_BLOCK_WIDTH */ +/* reuse GL_UNPACK_COMPRESSED_BLOCK_HEIGHT */ +/* reuse GL_UNPACK_COMPRESSED_BLOCK_DEPTH */ +/* reuse GL_UNPACK_COMPRESSED_BLOCK_SIZE */ +/* reuse GL_PACK_COMPRESSED_BLOCK_WIDTH */ +/* reuse GL_PACK_COMPRESSED_BLOCK_HEIGHT */ +/* reuse GL_PACK_COMPRESSED_BLOCK_DEPTH */ +/* reuse GL_PACK_COMPRESSED_BLOCK_SIZE */ +/* Reuse tokens from ARB_conservative_depth (none) */ +/* Reuse tokens from ARB_internalformat_query */ +/* reuse GL_NUM_SAMPLE_COUNTS */ +/* Reuse tokens from ARB_map_buffer_alignment */ +/* reuse GL_MIN_MAP_BUFFER_ALIGNMENT */ +/* Reuse tokens from ARB_shader_atomic_counters */ +/* reuse GL_ATOMIC_COUNTER_BUFFER */ +/* reuse GL_ATOMIC_COUNTER_BUFFER_BINDING */ +/* reuse GL_ATOMIC_COUNTER_BUFFER_START */ +/* reuse GL_ATOMIC_COUNTER_BUFFER_SIZE */ +/* reuse GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE */ +/* reuse GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS */ +/* reuse GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES */ +/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER */ +/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER */ +/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER */ +/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER */ +/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER */ +/* reuse GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS */ +/* reuse GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS */ +/* reuse GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS */ +/* reuse GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS */ +/* reuse GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS */ +/* reuse GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS */ +/* reuse GL_MAX_VERTEX_ATOMIC_COUNTERS */ +/* reuse GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS */ +/* reuse GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS */ +/* reuse GL_MAX_GEOMETRY_ATOMIC_COUNTERS */ +/* reuse GL_MAX_FRAGMENT_ATOMIC_COUNTERS */ +/* reuse GL_MAX_COMBINED_ATOMIC_COUNTERS */ +/* reuse GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE */ +/* reuse GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS */ +/* reuse GL_ACTIVE_ATOMIC_COUNTER_BUFFERS */ +/* reuse GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX */ +/* reuse GL_UNSIGNED_INT_ATOMIC_COUNTER */ +/* Reuse tokens from ARB_shader_image_load_store */ +/* reuse GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT */ +/* reuse GL_ELEMENT_ARRAY_BARRIER_BIT */ +/* reuse GL_UNIFORM_BARRIER_BIT */ +/* reuse GL_TEXTURE_FETCH_BARRIER_BIT */ +/* reuse GL_SHADER_IMAGE_ACCESS_BARRIER_BIT */ +/* reuse GL_COMMAND_BARRIER_BIT */ +/* reuse GL_PIXEL_BUFFER_BARRIER_BIT */ +/* reuse GL_TEXTURE_UPDATE_BARRIER_BIT */ +/* reuse GL_BUFFER_UPDATE_BARRIER_BIT */ +/* reuse GL_FRAMEBUFFER_BARRIER_BIT */ +/* reuse GL_TRANSFORM_FEEDBACK_BARRIER_BIT */ +/* reuse GL_ATOMIC_COUNTER_BARRIER_BIT */ +/* reuse GL_ALL_BARRIER_BITS */ +/* reuse GL_MAX_IMAGE_UNITS */ +/* reuse GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS */ +/* reuse GL_IMAGE_BINDING_NAME */ +/* reuse GL_IMAGE_BINDING_LEVEL */ +/* reuse GL_IMAGE_BINDING_LAYERED */ +/* reuse GL_IMAGE_BINDING_LAYER */ +/* reuse GL_IMAGE_BINDING_ACCESS */ +/* reuse GL_IMAGE_1D */ +/* reuse GL_IMAGE_2D */ +/* reuse GL_IMAGE_3D */ +/* reuse GL_IMAGE_2D_RECT */ +/* reuse GL_IMAGE_CUBE */ +/* reuse GL_IMAGE_BUFFER */ +/* reuse GL_IMAGE_1D_ARRAY */ +/* reuse GL_IMAGE_2D_ARRAY */ +/* reuse GL_IMAGE_CUBE_MAP_ARRAY */ +/* reuse GL_IMAGE_2D_MULTISAMPLE */ +/* reuse GL_IMAGE_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_INT_IMAGE_1D */ +/* reuse GL_INT_IMAGE_2D */ +/* reuse GL_INT_IMAGE_3D */ +/* reuse GL_INT_IMAGE_2D_RECT */ +/* reuse GL_INT_IMAGE_CUBE */ +/* reuse GL_INT_IMAGE_BUFFER */ +/* reuse GL_INT_IMAGE_1D_ARRAY */ +/* reuse GL_INT_IMAGE_2D_ARRAY */ +/* reuse GL_INT_IMAGE_CUBE_MAP_ARRAY */ +/* reuse GL_INT_IMAGE_2D_MULTISAMPLE */ +/* reuse GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_UNSIGNED_INT_IMAGE_1D */ +/* reuse GL_UNSIGNED_INT_IMAGE_2D */ +/* reuse GL_UNSIGNED_INT_IMAGE_3D */ +/* reuse GL_UNSIGNED_INT_IMAGE_2D_RECT */ +/* reuse GL_UNSIGNED_INT_IMAGE_CUBE */ +/* reuse GL_UNSIGNED_INT_IMAGE_BUFFER */ +/* reuse GL_UNSIGNED_INT_IMAGE_1D_ARRAY */ +/* reuse GL_UNSIGNED_INT_IMAGE_2D_ARRAY */ +/* reuse GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY */ +/* reuse GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE */ +/* reuse GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_MAX_IMAGE_SAMPLES */ +/* reuse GL_IMAGE_BINDING_FORMAT */ +/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_TYPE */ +/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE */ +/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS */ +/* reuse GL_MAX_VERTEX_IMAGE_UNIFORMS */ +/* reuse GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS */ +/* reuse GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS */ +/* reuse GL_MAX_GEOMETRY_IMAGE_UNIFORMS */ +/* reuse GL_MAX_FRAGMENT_IMAGE_UNIFORMS */ +/* reuse GL_MAX_COMBINED_IMAGE_UNIFORMS */ +/* Reuse tokens from ARB_shading_language_packing (none) */ +/* Reuse tokens from ARB_texture_storage */ +/* reuse GL_TEXTURE_IMMUTABLE_FORMAT */ +#endif + +#ifndef GL_VERSION_4_3 +#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 +#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E +/* Reuse tokens from ARB_arrays_of_arrays (none, GLSL only) */ +/* Reuse tokens from ARB_fragment_layer_viewport (none, GLSL only) */ +/* Reuse tokens from ARB_shader_image_size (none, GLSL only) */ +/* Reuse tokens from ARB_ES3_compatibility */ +/* reuse GL_COMPRESSED_RGB8_ETC2 */ +/* reuse GL_COMPRESSED_SRGB8_ETC2 */ +/* reuse GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 */ +/* reuse GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 */ +/* reuse GL_COMPRESSED_RGBA8_ETC2_EAC */ +/* reuse GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC */ +/* reuse GL_COMPRESSED_R11_EAC */ +/* reuse GL_COMPRESSED_SIGNED_R11_EAC */ +/* reuse GL_COMPRESSED_RG11_EAC */ +/* reuse GL_COMPRESSED_SIGNED_RG11_EAC */ +/* reuse GL_PRIMITIVE_RESTART_FIXED_INDEX */ +/* reuse GL_ANY_SAMPLES_PASSED_CONSERVATIVE */ +/* reuse GL_MAX_ELEMENT_INDEX */ +/* Reuse tokens from ARB_clear_buffer_object (none) */ +/* Reuse tokens from ARB_compute_shader */ +/* reuse GL_COMPUTE_SHADER */ +/* reuse GL_MAX_COMPUTE_UNIFORM_BLOCKS */ +/* reuse GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS */ +/* reuse GL_MAX_COMPUTE_IMAGE_UNIFORMS */ +/* reuse GL_MAX_COMPUTE_SHARED_MEMORY_SIZE */ +/* reuse GL_MAX_COMPUTE_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS */ +/* reuse GL_MAX_COMPUTE_ATOMIC_COUNTERS */ +/* reuse GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_COMPUTE_LOCAL_INVOCATIONS */ +/* reuse GL_MAX_COMPUTE_WORK_GROUP_COUNT */ +/* reuse GL_MAX_COMPUTE_WORK_GROUP_SIZE */ +/* reuse GL_COMPUTE_LOCAL_WORK_SIZE */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER */ +/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER */ +/* reuse GL_DISPATCH_INDIRECT_BUFFER */ +/* reuse GL_DISPATCH_INDIRECT_BUFFER_BINDING */ +/* Reuse tokens from ARB_copy_image (none) */ +/* Reuse tokens from KHR_debug */ +/* reuse GL_DEBUG_OUTPUT_SYNCHRONOUS */ +/* reuse GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH */ +/* reuse GL_DEBUG_CALLBACK_FUNCTION */ +/* reuse GL_DEBUG_CALLBACK_USER_PARAM */ +/* reuse GL_DEBUG_SOURCE_API */ +/* reuse GL_DEBUG_SOURCE_WINDOW_SYSTEM */ +/* reuse GL_DEBUG_SOURCE_SHADER_COMPILER */ +/* reuse GL_DEBUG_SOURCE_THIRD_PARTY */ +/* reuse GL_DEBUG_SOURCE_APPLICATION */ +/* reuse GL_DEBUG_SOURCE_OTHER */ +/* reuse GL_DEBUG_TYPE_ERROR */ +/* reuse GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR */ +/* reuse GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR */ +/* reuse GL_DEBUG_TYPE_PORTABILITY */ +/* reuse GL_DEBUG_TYPE_PERFORMANCE */ +/* reuse GL_DEBUG_TYPE_OTHER */ +/* reuse GL_MAX_DEBUG_MESSAGE_LENGTH */ +/* reuse GL_MAX_DEBUG_LOGGED_MESSAGES */ +/* reuse GL_DEBUG_LOGGED_MESSAGES */ +/* reuse GL_DEBUG_SEVERITY_HIGH */ +/* reuse GL_DEBUG_SEVERITY_MEDIUM */ +/* reuse GL_DEBUG_SEVERITY_LOW */ +/* reuse GL_DEBUG_TYPE_MARKER */ +/* reuse GL_DEBUG_TYPE_PUSH_GROUP */ +/* reuse GL_DEBUG_TYPE_POP_GROUP */ +/* reuse GL_DEBUG_SEVERITY_NOTIFICATION */ +/* reuse GL_MAX_DEBUG_GROUP_STACK_DEPTH */ +/* reuse GL_DEBUG_GROUP_STACK_DEPTH */ +/* reuse GL_BUFFER */ +/* reuse GL_SHADER */ +/* reuse GL_PROGRAM */ +/* reuse GL_QUERY */ +/* reuse GL_PROGRAM_PIPELINE */ +/* reuse GL_SAMPLER */ +/* reuse GL_DISPLAY_LIST */ +/* reuse GL_MAX_LABEL_LENGTH */ +/* reuse GL_DEBUG_OUTPUT */ +/* reuse GL_CONTEXT_FLAG_DEBUG_BIT */ +/* reuse GL_STACK_UNDERFLOW */ +/* reuse GL_STACK_OVERFLOW */ +/* Reuse tokens from ARB_explicit_uniform_location */ +/* reuse GL_MAX_UNIFORM_LOCATIONS */ +/* Reuse tokens from ARB_framebuffer_no_attachments */ +/* reuse GL_FRAMEBUFFER_DEFAULT_WIDTH */ +/* reuse GL_FRAMEBUFFER_DEFAULT_HEIGHT */ +/* reuse GL_FRAMEBUFFER_DEFAULT_LAYERS */ +/* reuse GL_FRAMEBUFFER_DEFAULT_SAMPLES */ +/* reuse GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS */ +/* reuse GL_MAX_FRAMEBUFFER_WIDTH */ +/* reuse GL_MAX_FRAMEBUFFER_HEIGHT */ +/* reuse GL_MAX_FRAMEBUFFER_LAYERS */ +/* reuse GL_MAX_FRAMEBUFFER_SAMPLES */ +/* Reuse tokens from ARB_internalformat_query2 */ +/* reuse GL_INTERNALFORMAT_SUPPORTED */ +/* reuse GL_INTERNALFORMAT_PREFERRED */ +/* reuse GL_INTERNALFORMAT_RED_SIZE */ +/* reuse GL_INTERNALFORMAT_GREEN_SIZE */ +/* reuse GL_INTERNALFORMAT_BLUE_SIZE */ +/* reuse GL_INTERNALFORMAT_ALPHA_SIZE */ +/* reuse GL_INTERNALFORMAT_DEPTH_SIZE */ +/* reuse GL_INTERNALFORMAT_STENCIL_SIZE */ +/* reuse GL_INTERNALFORMAT_SHARED_SIZE */ +/* reuse GL_INTERNALFORMAT_RED_TYPE */ +/* reuse GL_INTERNALFORMAT_GREEN_TYPE */ +/* reuse GL_INTERNALFORMAT_BLUE_TYPE */ +/* reuse GL_INTERNALFORMAT_ALPHA_TYPE */ +/* reuse GL_INTERNALFORMAT_DEPTH_TYPE */ +/* reuse GL_INTERNALFORMAT_STENCIL_TYPE */ +/* reuse GL_MAX_WIDTH */ +/* reuse GL_MAX_HEIGHT */ +/* reuse GL_MAX_DEPTH */ +/* reuse GL_MAX_LAYERS */ +/* reuse GL_MAX_COMBINED_DIMENSIONS */ +/* reuse GL_COLOR_COMPONENTS */ +/* reuse GL_DEPTH_COMPONENTS */ +/* reuse GL_STENCIL_COMPONENTS */ +/* reuse GL_COLOR_RENDERABLE */ +/* reuse GL_DEPTH_RENDERABLE */ +/* reuse GL_STENCIL_RENDERABLE */ +/* reuse GL_FRAMEBUFFER_RENDERABLE */ +/* reuse GL_FRAMEBUFFER_RENDERABLE_LAYERED */ +/* reuse GL_FRAMEBUFFER_BLEND */ +/* reuse GL_READ_PIXELS */ +/* reuse GL_READ_PIXELS_FORMAT */ +/* reuse GL_READ_PIXELS_TYPE */ +/* reuse GL_TEXTURE_IMAGE_FORMAT */ +/* reuse GL_TEXTURE_IMAGE_TYPE */ +/* reuse GL_GET_TEXTURE_IMAGE_FORMAT */ +/* reuse GL_GET_TEXTURE_IMAGE_TYPE */ +/* reuse GL_MIPMAP */ +/* reuse GL_MANUAL_GENERATE_MIPMAP */ +/* reuse GL_AUTO_GENERATE_MIPMAP */ +/* reuse GL_COLOR_ENCODING */ +/* reuse GL_SRGB_READ */ +/* reuse GL_SRGB_WRITE */ +/* reuse GL_FILTER */ +/* reuse GL_VERTEX_TEXTURE */ +/* reuse GL_TESS_CONTROL_TEXTURE */ +/* reuse GL_TESS_EVALUATION_TEXTURE */ +/* reuse GL_GEOMETRY_TEXTURE */ +/* reuse GL_FRAGMENT_TEXTURE */ +/* reuse GL_COMPUTE_TEXTURE */ +/* reuse GL_TEXTURE_SHADOW */ +/* reuse GL_TEXTURE_GATHER */ +/* reuse GL_TEXTURE_GATHER_SHADOW */ +/* reuse GL_SHADER_IMAGE_LOAD */ +/* reuse GL_SHADER_IMAGE_STORE */ +/* reuse GL_SHADER_IMAGE_ATOMIC */ +/* reuse GL_IMAGE_TEXEL_SIZE */ +/* reuse GL_IMAGE_COMPATIBILITY_CLASS */ +/* reuse GL_IMAGE_PIXEL_FORMAT */ +/* reuse GL_IMAGE_PIXEL_TYPE */ +/* reuse GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST */ +/* reuse GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST */ +/* reuse GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE */ +/* reuse GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE */ +/* reuse GL_TEXTURE_COMPRESSED_BLOCK_WIDTH */ +/* reuse GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT */ +/* reuse GL_TEXTURE_COMPRESSED_BLOCK_SIZE */ +/* reuse GL_CLEAR_BUFFER */ +/* reuse GL_TEXTURE_VIEW */ +/* reuse GL_VIEW_COMPATIBILITY_CLASS */ +/* reuse GL_FULL_SUPPORT */ +/* reuse GL_CAVEAT_SUPPORT */ +/* reuse GL_IMAGE_CLASS_4_X_32 */ +/* reuse GL_IMAGE_CLASS_2_X_32 */ +/* reuse GL_IMAGE_CLASS_1_X_32 */ +/* reuse GL_IMAGE_CLASS_4_X_16 */ +/* reuse GL_IMAGE_CLASS_2_X_16 */ +/* reuse GL_IMAGE_CLASS_1_X_16 */ +/* reuse GL_IMAGE_CLASS_4_X_8 */ +/* reuse GL_IMAGE_CLASS_2_X_8 */ +/* reuse GL_IMAGE_CLASS_1_X_8 */ +/* reuse GL_IMAGE_CLASS_11_11_10 */ +/* reuse GL_IMAGE_CLASS_10_10_10_2 */ +/* reuse GL_VIEW_CLASS_128_BITS */ +/* reuse GL_VIEW_CLASS_96_BITS */ +/* reuse GL_VIEW_CLASS_64_BITS */ +/* reuse GL_VIEW_CLASS_48_BITS */ +/* reuse GL_VIEW_CLASS_32_BITS */ +/* reuse GL_VIEW_CLASS_24_BITS */ +/* reuse GL_VIEW_CLASS_16_BITS */ +/* reuse GL_VIEW_CLASS_8_BITS */ +/* reuse GL_VIEW_CLASS_S3TC_DXT1_RGB */ +/* reuse GL_VIEW_CLASS_S3TC_DXT1_RGBA */ +/* reuse GL_VIEW_CLASS_S3TC_DXT3_RGBA */ +/* reuse GL_VIEW_CLASS_S3TC_DXT5_RGBA */ +/* reuse GL_VIEW_CLASS_RGTC1_RED */ +/* reuse GL_VIEW_CLASS_RGTC2_RG */ +/* reuse GL_VIEW_CLASS_BPTC_UNORM */ +/* reuse GL_VIEW_CLASS_BPTC_FLOAT */ +/* Reuse tokens from ARB_invalidate_subdata (none) */ +/* Reuse tokens from ARB_multi_draw_indirect (none) */ +/* Reuse tokens from ARB_program_interface_query */ +/* reuse GL_UNIFORM */ +/* reuse GL_UNIFORM_BLOCK */ +/* reuse GL_PROGRAM_INPUT */ +/* reuse GL_PROGRAM_OUTPUT */ +/* reuse GL_BUFFER_VARIABLE */ +/* reuse GL_SHADER_STORAGE_BLOCK */ +/* reuse GL_VERTEX_SUBROUTINE */ +/* reuse GL_TESS_CONTROL_SUBROUTINE */ +/* reuse GL_TESS_EVALUATION_SUBROUTINE */ +/* reuse GL_GEOMETRY_SUBROUTINE */ +/* reuse GL_FRAGMENT_SUBROUTINE */ +/* reuse GL_COMPUTE_SUBROUTINE */ +/* reuse GL_VERTEX_SUBROUTINE_UNIFORM */ +/* reuse GL_TESS_CONTROL_SUBROUTINE_UNIFORM */ +/* reuse GL_TESS_EVALUATION_SUBROUTINE_UNIFORM */ +/* reuse GL_GEOMETRY_SUBROUTINE_UNIFORM */ +/* reuse GL_FRAGMENT_SUBROUTINE_UNIFORM */ +/* reuse GL_COMPUTE_SUBROUTINE_UNIFORM */ +/* reuse GL_TRANSFORM_FEEDBACK_VARYING */ +/* reuse GL_ACTIVE_RESOURCES */ +/* reuse GL_MAX_NAME_LENGTH */ +/* reuse GL_MAX_NUM_ACTIVE_VARIABLES */ +/* reuse GL_MAX_NUM_COMPATIBLE_SUBROUTINES */ +/* reuse GL_NAME_LENGTH */ +/* reuse GL_TYPE */ +/* reuse GL_ARRAY_SIZE */ +/* reuse GL_OFFSET */ +/* reuse GL_BLOCK_INDEX */ +/* reuse GL_ARRAY_STRIDE */ +/* reuse GL_MATRIX_STRIDE */ +/* reuse GL_IS_ROW_MAJOR */ +/* reuse GL_ATOMIC_COUNTER_BUFFER_INDEX */ +/* reuse GL_BUFFER_BINDING */ +/* reuse GL_BUFFER_DATA_SIZE */ +/* reuse GL_NUM_ACTIVE_VARIABLES */ +/* reuse GL_ACTIVE_VARIABLES */ +/* reuse GL_REFERENCED_BY_VERTEX_SHADER */ +/* reuse GL_REFERENCED_BY_TESS_CONTROL_SHADER */ +/* reuse GL_REFERENCED_BY_TESS_EVALUATION_SHADER */ +/* reuse GL_REFERENCED_BY_GEOMETRY_SHADER */ +/* reuse GL_REFERENCED_BY_FRAGMENT_SHADER */ +/* reuse GL_REFERENCED_BY_COMPUTE_SHADER */ +/* reuse GL_TOP_LEVEL_ARRAY_SIZE */ +/* reuse GL_TOP_LEVEL_ARRAY_STRIDE */ +/* reuse GL_LOCATION */ +/* reuse GL_LOCATION_INDEX */ +/* reuse GL_IS_PER_PATCH */ +/* Reuse tokens from ARB_robust_buffer_access_behavior (none) */ +/* Reuse tokens from ARB_shader_storage_buffer_object */ +/* reuse GL_SHADER_STORAGE_BUFFER */ +/* reuse GL_SHADER_STORAGE_BUFFER_BINDING */ +/* reuse GL_SHADER_STORAGE_BUFFER_START */ +/* reuse GL_SHADER_STORAGE_BUFFER_SIZE */ +/* reuse GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS */ +/* reuse GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS */ +/* reuse GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS */ +/* reuse GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS */ +/* reuse GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS */ +/* reuse GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS */ +/* reuse GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS */ +/* reuse GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS */ +/* reuse GL_MAX_SHADER_STORAGE_BLOCK_SIZE */ +/* reuse GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT */ +/* reuse GL_SHADER_STORAGE_BARRIER_BIT */ +/* reuse GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES */ +/* Reuse tokens from ARB_stencil_texturing */ +/* reuse GL_DEPTH_STENCIL_TEXTURE_MODE */ +/* Reuse tokens from ARB_texture_buffer_range */ +/* reuse GL_TEXTURE_BUFFER_OFFSET */ +/* reuse GL_TEXTURE_BUFFER_SIZE */ +/* reuse GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT */ +/* Reuse tokens from ARB_texture_query_levels (none) */ +/* Reuse tokens from ARB_texture_storage_multisample (none) */ +/* Reuse tokens from ARB_texture_view */ +/* reuse GL_TEXTURE_VIEW_MIN_LEVEL */ +/* reuse GL_TEXTURE_VIEW_NUM_LEVELS */ +/* reuse GL_TEXTURE_VIEW_MIN_LAYER */ +/* reuse GL_TEXTURE_VIEW_NUM_LAYERS */ +/* reuse GL_TEXTURE_IMMUTABLE_LEVELS */ +/* Reuse tokens from ARB_vertex_attrib_binding */ +/* reuse GL_VERTEX_ATTRIB_BINDING */ +/* reuse GL_VERTEX_ATTRIB_RELATIVE_OFFSET */ +/* reuse GL_VERTEX_BINDING_DIVISOR */ +/* reuse GL_VERTEX_BINDING_OFFSET */ +/* reuse GL_VERTEX_BINDING_STRIDE */ +/* reuse GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET */ +/* reuse GL_MAX_VERTEX_ATTRIB_BINDINGS */ +#endif + +#ifndef GL_ARB_multitexture +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +#endif + +#ifndef GL_ARB_multisample +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +#endif + +#ifndef GL_ARB_texture_env_add +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#endif + +#ifndef GL_ARB_texture_compression +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif + +#ifndef GL_ARB_point_parameters +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_ARB 0x8370 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#endif + +#ifndef GL_ARB_shadow +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF +#endif + +#ifndef GL_ARB_window_pos +#endif + +#ifndef GL_ARB_vertex_program +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF +#endif + +#ifndef GL_ARB_fragment_program +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +#endif + +#ifndef GL_ARB_occlusion_query +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 +#endif + +#ifndef GL_ARB_shader_objects +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#endif + +#ifndef GL_ARB_point_sprite +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 +#endif + +#ifndef GL_ARB_fragment_program_shadow +#endif + +#ifndef GL_ARB_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#endif + +#ifndef GL_ARB_color_buffer_float +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_HALF_FLOAT_ARB 0x140B +#endif + +#ifndef GL_ARB_texture_float +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF +#endif + +#ifndef GL_ARB_depth_buffer_float +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD +#endif + +#ifndef GL_ARB_draw_instanced +#endif + +#ifndef GL_ARB_framebuffer_object +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 +#define GL_INDEX 0x8222 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#endif + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_FRAMEBUFFER_SRGB 0x8DB9 +#endif + +#ifndef GL_ARB_geometry_shader4 +#define GL_LINES_ADJACENCY_ARB 0x000A +#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B +#define GL_TRIANGLES_ADJACENCY_ARB 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 +/* reuse GL_MAX_VARYING_COMPONENTS */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ +#endif + +#ifndef GL_ARB_half_float_vertex +#define GL_HALF_FLOAT 0x140B +#endif + +#ifndef GL_ARB_instanced_arrays +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE +#endif + +#ifndef GL_ARB_map_buffer_range +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 +#endif + +#ifndef GL_ARB_texture_buffer_object +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E +#endif + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE +#endif + +#ifndef GL_ARB_texture_rg +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C +#endif + +#ifndef GL_ARB_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING 0x85B5 +#endif + +#ifndef GL_ARB_uniform_buffer_object +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +#define GL_INVALID_INDEX 0xFFFFFFFFu +#endif + +#ifndef GL_ARB_compatibility +/* ARB_compatibility just defines tokens from core 3.0 */ +#endif + +#ifndef GL_ARB_copy_buffer +#define GL_COPY_READ_BUFFER_BINDING 0x8F36 +#define GL_COPY_READ_BUFFER GL_COPY_READ_BUFFER_BINDING +#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37 +#define GL_COPY_WRITE_BUFFER GL_COPY_WRITE_BUFFER_BINDING +#endif + +#ifndef GL_ARB_shader_texture_lod +#endif + +#ifndef GL_ARB_depth_clamp +#define GL_DEPTH_CLAMP 0x864F +#endif + +#ifndef GL_ARB_draw_elements_base_vertex +#endif + +#ifndef GL_ARB_fragment_coord_conventions +#endif + +#ifndef GL_ARB_provoking_vertex +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F +#endif + +#ifndef GL_ARB_seamless_cube_map +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F +#endif + +#ifndef GL_ARB_sync +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull +#endif + +#ifndef GL_ARB_texture_multisample +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 +#endif + +#ifndef GL_ARB_vertex_array_bgra +/* reuse GL_BGRA */ +#endif + +#ifndef GL_ARB_draw_buffers_blend +#endif + +#ifndef GL_ARB_sample_shading +#define GL_SAMPLE_SHADING_ARB 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 +#endif + +#ifndef GL_ARB_texture_cube_map_array +#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F +#endif + +#ifndef GL_ARB_texture_gather +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F +#endif + +#ifndef GL_ARB_texture_query_lod +#endif + +#ifndef GL_ARB_shading_language_include +#define GL_SHADER_INCLUDE_ARB 0x8DAE +#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 +#define GL_NAMED_STRING_TYPE_ARB 0x8DEA +#endif + +#ifndef GL_ARB_texture_compression_bptc +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F +#endif + +#ifndef GL_ARB_blend_func_extended +#define GL_SRC1_COLOR 0x88F9 +/* reuse GL_SRC1_ALPHA */ +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC +#endif + +#ifndef GL_ARB_explicit_attrib_location +#endif + +#ifndef GL_ARB_occlusion_query2 +#define GL_ANY_SAMPLES_PASSED 0x8C2F +#endif + +#ifndef GL_ARB_sampler_objects +#define GL_SAMPLER_BINDING 0x8919 +#endif + +#ifndef GL_ARB_shader_bit_encoding +#endif + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_RGB10_A2UI 0x906F +#endif + +#ifndef GL_ARB_texture_swizzle +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 +#endif + +#ifndef GL_ARB_timer_query +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 +#endif + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +/* reuse GL_UNSIGNED_INT_2_10_10_10_REV */ +#define GL_INT_2_10_10_10_REV 0x8D9F +#endif + +#ifndef GL_ARB_draw_indirect +#define GL_DRAW_INDIRECT_BUFFER 0x8F3F +#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 +#endif + +#ifndef GL_ARB_gpu_shader5 +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +/* reuse GL_MAX_VERTEX_STREAMS */ +#endif + +#ifndef GL_ARB_gpu_shader_fp64 +/* reuse GL_DOUBLE */ +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E +#endif + +#ifndef GL_ARB_shader_subroutine +#define GL_ACTIVE_SUBROUTINES 0x8DE5 +#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 +#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 +#define GL_MAX_SUBROUTINES 0x8DE7 +#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 +#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A +#define GL_COMPATIBLE_SUBROUTINES 0x8E4B +/* reuse GL_UNIFORM_SIZE */ +/* reuse GL_UNIFORM_NAME_LENGTH */ +#endif + +#ifndef GL_ARB_tessellation_shader +#define GL_PATCHES 0x000E +#define GL_PATCH_VERTICES 0x8E72 +#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 +#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 +#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 +#define GL_TESS_GEN_MODE 0x8E76 +#define GL_TESS_GEN_SPACING 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 +#define GL_TESS_GEN_POINT_MODE 0x8E79 +/* reuse GL_TRIANGLES */ +/* reuse GL_QUADS */ +#define GL_ISOLINES 0x8E7A +/* reuse GL_EQUAL */ +#define GL_FRACTIONAL_ODD 0x8E7B +#define GL_FRACTIONAL_EVEN 0x8E7C +/* reuse GL_CCW */ +/* reuse GL_CW */ +#define GL_MAX_PATCH_VERTICES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 +#define GL_TESS_EVALUATION_SHADER 0x8E87 +#define GL_TESS_CONTROL_SHADER 0x8E88 +#endif + +#ifndef GL_ARB_texture_buffer_object_rgb32 +/* reuse GL_RGB32F */ +/* reuse GL_RGB32UI */ +/* reuse GL_RGB32I */ +#endif + +#ifndef GL_ARB_transform_feedback2 +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED GL_TRANSFORM_FEEDBACK_PAUSED +#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE GL_TRANSFORM_FEEDBACK_ACTIVE +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 +#endif + +#ifndef GL_ARB_transform_feedback3 +#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 +#define GL_MAX_VERTEX_STREAMS 0x8E71 +#endif + +#ifndef GL_ARB_ES2_compatibility +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD +#define GL_RGB565 0x8D62 +#endif + +#ifndef GL_ARB_get_program_binary +#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 +#define GL_PROGRAM_BINARY_LENGTH 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE +#define GL_PROGRAM_BINARY_FORMATS 0x87FF +#endif + +#ifndef GL_ARB_separate_shader_objects +#define GL_VERTEX_SHADER_BIT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT 0x00000002 +#define GL_GEOMETRY_SHADER_BIT 0x00000004 +#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 +#define GL_ALL_SHADER_BITS 0xFFFFFFFF +#define GL_PROGRAM_SEPARABLE 0x8258 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#endif + +#ifndef GL_ARB_shader_precision +#endif + +#ifndef GL_ARB_vertex_attrib_64bit +/* reuse GL_RGB32I */ +/* reuse GL_DOUBLE_VEC2 */ +/* reuse GL_DOUBLE_VEC3 */ +/* reuse GL_DOUBLE_VEC4 */ +/* reuse GL_DOUBLE_MAT2 */ +/* reuse GL_DOUBLE_MAT3 */ +/* reuse GL_DOUBLE_MAT4 */ +/* reuse GL_DOUBLE_MAT2x3 */ +/* reuse GL_DOUBLE_MAT2x4 */ +/* reuse GL_DOUBLE_MAT3x2 */ +/* reuse GL_DOUBLE_MAT3x4 */ +/* reuse GL_DOUBLE_MAT4x2 */ +/* reuse GL_DOUBLE_MAT4x3 */ +#endif + +#ifndef GL_ARB_viewport_array +/* reuse GL_SCISSOR_BOX */ +/* reuse GL_VIEWPORT */ +/* reuse GL_DEPTH_RANGE */ +/* reuse GL_SCISSOR_TEST */ +#define GL_MAX_VIEWPORTS 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE 0x825D +#define GL_LAYER_PROVOKING_VERTEX 0x825E +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F +#define GL_UNDEFINED_VERTEX 0x8260 +/* reuse GL_FIRST_VERTEX_CONVENTION */ +/* reuse GL_LAST_VERTEX_CONVENTION */ +/* reuse GL_PROVOKING_VERTEX */ +#endif + +#ifndef GL_ARB_cl_event +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 +#endif + +#ifndef GL_ARB_debug_output +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 +#endif + +#ifndef GL_ARB_robustness +/* reuse GL_NO_ERROR */ +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 +#endif + +#ifndef GL_ARB_shader_stencil_export +#endif + +#ifndef GL_ARB_base_instance +#endif + +#ifndef GL_ARB_shading_language_420pack +#endif + +#ifndef GL_ARB_transform_feedback_instanced +#endif + +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 +#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 +#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 +#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A +#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B +#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C +#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D +#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E +#endif + +#ifndef GL_ARB_conservative_depth +#endif + +#ifndef GL_ARB_internalformat_query +#define GL_NUM_SAMPLE_COUNTS 0x9380 +#endif + +#ifndef GL_ARB_map_buffer_alignment +#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC +#endif + +#ifndef GL_ARB_shader_atomic_counters +#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 +#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 +#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 +#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 +#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB +#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF +#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 +#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 +#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 +#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 +#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC +#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 +#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB +#endif + +#ifndef GL_ARB_shader_image_load_store +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 +#define GL_COMMAND_BARRIER_BIT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 +#define GL_ALL_BARRIER_BITS 0xFFFFFFFF +#define GL_MAX_IMAGE_UNITS 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 +#define GL_IMAGE_BINDING_NAME 0x8F3A +#define GL_IMAGE_BINDING_LEVEL 0x8F3B +#define GL_IMAGE_BINDING_LAYERED 0x8F3C +#define GL_IMAGE_BINDING_LAYER 0x8F3D +#define GL_IMAGE_BINDING_ACCESS 0x8F3E +#define GL_IMAGE_1D 0x904C +#define GL_IMAGE_2D 0x904D +#define GL_IMAGE_3D 0x904E +#define GL_IMAGE_2D_RECT 0x904F +#define GL_IMAGE_CUBE 0x9050 +#define GL_IMAGE_BUFFER 0x9051 +#define GL_IMAGE_1D_ARRAY 0x9052 +#define GL_IMAGE_2D_ARRAY 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 +#define GL_INT_IMAGE_1D 0x9057 +#define GL_INT_IMAGE_2D 0x9058 +#define GL_INT_IMAGE_3D 0x9059 +#define GL_INT_IMAGE_2D_RECT 0x905A +#define GL_INT_IMAGE_CUBE 0x905B +#define GL_INT_IMAGE_BUFFER 0x905C +#define GL_INT_IMAGE_1D_ARRAY 0x905D +#define GL_INT_IMAGE_2D_ARRAY 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C +#define GL_MAX_IMAGE_SAMPLES 0x906D +#define GL_IMAGE_BINDING_FORMAT 0x906E +#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 +#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD +#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE +#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#endif + +#ifndef GL_ARB_shading_language_packing +#endif + +#ifndef GL_ARB_texture_storage +#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F +#endif + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD +#endif + +#ifndef GL_KHR_debug +#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 +#define GL_DEBUG_SOURCE_API 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION 0x824A +#define GL_DEBUG_SOURCE_OTHER 0x824B +#define GL_DEBUG_TYPE_ERROR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 +#define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_DEBUG_TYPE_MARKER 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D +#define GL_BUFFER 0x82E0 +#define GL_SHADER 0x82E1 +#define GL_PROGRAM 0x82E2 +#define GL_QUERY 0x82E3 +#define GL_PROGRAM_PIPELINE 0x82E4 +#define GL_SAMPLER 0x82E6 +#define GL_DISPLAY_LIST 0x82E7 +/* DISPLAY_LIST used in compatibility profile only */ +#define GL_MAX_LABEL_LENGTH 0x82E8 +#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES 0x9145 +#define GL_DEBUG_SEVERITY_HIGH 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 +#define GL_DEBUG_SEVERITY_LOW 0x9148 +#define GL_DEBUG_OUTPUT 0x92E0 +#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 +/* reuse GL_STACK_UNDERFLOW */ +/* reuse GL_STACK_OVERFLOW */ +#endif + +#ifndef GL_ARB_arrays_of_arrays +#endif + +#ifndef GL_ARB_clear_buffer_object +#endif + +#ifndef GL_ARB_compute_shader +#define GL_COMPUTE_SHADER 0x91B9 +#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB +#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC +#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD +#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 +#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 +#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 +#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 +#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 +#define GL_MAX_COMPUTE_LOCAL_INVOCATIONS 0x90EB +#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE +#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF +#define GL_COMPUTE_LOCAL_WORK_SIZE 0x8267 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED +#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE +#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF +#define GL_COMPUTE_SHADER_BIT 0x00000020 +#endif + +#ifndef GL_ARB_copy_image +#endif + +#ifndef GL_ARB_texture_view +#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF +#endif + +#ifndef GL_ARB_vertex_attrib_binding +#define GL_VERTEX_ATTRIB_BINDING 0x82D4 +#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 +#define GL_VERTEX_BINDING_DIVISOR 0x82D6 +#define GL_VERTEX_BINDING_OFFSET 0x82D7 +#define GL_VERTEX_BINDING_STRIDE 0x82D8 +#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 +#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA +#endif + +#ifndef GL_ARB_robustness_isolation +#endif + +#ifndef GL_ARB_ES3_compatibility +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#define GL_MAX_ELEMENT_INDEX 0x8D6B +#endif + +#ifndef GL_ARB_explicit_uniform_location +#define GL_MAX_UNIFORM_LOCATIONS 0x826E +#endif + +#ifndef GL_ARB_fragment_layer_viewport +#endif + +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 +#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 +#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 +#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 +#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 +#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 +#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 +#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 +#endif + +#ifndef GL_ARB_internalformat_query2 +/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_TYPE */ +/* reuse GL_NUM_SAMPLE_COUNTS */ +/* reuse GL_RENDERBUFFER */ +/* reuse GL_SAMPLES */ +/* reuse GL_TEXTURE_1D */ +/* reuse GL_TEXTURE_1D_ARRAY */ +/* reuse GL_TEXTURE_2D */ +/* reuse GL_TEXTURE_2D_ARRAY */ +/* reuse GL_TEXTURE_3D */ +/* reuse GL_TEXTURE_CUBE_MAP */ +/* reuse GL_TEXTURE_CUBE_MAP_ARRAY */ +/* reuse GL_TEXTURE_RECTANGLE */ +/* reuse GL_TEXTURE_BUFFER */ +/* reuse GL_TEXTURE_2D_MULTISAMPLE */ +/* reuse GL_TEXTURE_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_TEXTURE_COMPRESSED */ +#define GL_INTERNALFORMAT_SUPPORTED 0x826F +#define GL_INTERNALFORMAT_PREFERRED 0x8270 +#define GL_INTERNALFORMAT_RED_SIZE 0x8271 +#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 +#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 +#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 +#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 +#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 +#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 +#define GL_INTERNALFORMAT_RED_TYPE 0x8278 +#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 +#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A +#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B +#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C +#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D +#define GL_MAX_WIDTH 0x827E +#define GL_MAX_HEIGHT 0x827F +#define GL_MAX_DEPTH 0x8280 +#define GL_MAX_LAYERS 0x8281 +#define GL_MAX_COMBINED_DIMENSIONS 0x8282 +#define GL_COLOR_COMPONENTS 0x8283 +#define GL_DEPTH_COMPONENTS 0x8284 +#define GL_STENCIL_COMPONENTS 0x8285 +#define GL_COLOR_RENDERABLE 0x8286 +#define GL_DEPTH_RENDERABLE 0x8287 +#define GL_STENCIL_RENDERABLE 0x8288 +#define GL_FRAMEBUFFER_RENDERABLE 0x8289 +#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A +#define GL_FRAMEBUFFER_BLEND 0x828B +#define GL_READ_PIXELS 0x828C +#define GL_READ_PIXELS_FORMAT 0x828D +#define GL_READ_PIXELS_TYPE 0x828E +#define GL_TEXTURE_IMAGE_FORMAT 0x828F +#define GL_TEXTURE_IMAGE_TYPE 0x8290 +#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 +#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 +#define GL_MIPMAP 0x8293 +#define GL_MANUAL_GENERATE_MIPMAP 0x8294 +#define GL_AUTO_GENERATE_MIPMAP 0x8295 +#define GL_COLOR_ENCODING 0x8296 +#define GL_SRGB_READ 0x8297 +#define GL_SRGB_WRITE 0x8298 +#define GL_SRGB_DECODE_ARB 0x8299 +#define GL_FILTER 0x829A +#define GL_VERTEX_TEXTURE 0x829B +#define GL_TESS_CONTROL_TEXTURE 0x829C +#define GL_TESS_EVALUATION_TEXTURE 0x829D +#define GL_GEOMETRY_TEXTURE 0x829E +#define GL_FRAGMENT_TEXTURE 0x829F +#define GL_COMPUTE_TEXTURE 0x82A0 +#define GL_TEXTURE_SHADOW 0x82A1 +#define GL_TEXTURE_GATHER 0x82A2 +#define GL_TEXTURE_GATHER_SHADOW 0x82A3 +#define GL_SHADER_IMAGE_LOAD 0x82A4 +#define GL_SHADER_IMAGE_STORE 0x82A5 +#define GL_SHADER_IMAGE_ATOMIC 0x82A6 +#define GL_IMAGE_TEXEL_SIZE 0x82A7 +#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 +#define GL_IMAGE_PIXEL_FORMAT 0x82A9 +#define GL_IMAGE_PIXEL_TYPE 0x82AA +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF +#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 +#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 +#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 +#define GL_CLEAR_BUFFER 0x82B4 +#define GL_TEXTURE_VIEW 0x82B5 +#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 +#define GL_FULL_SUPPORT 0x82B7 +#define GL_CAVEAT_SUPPORT 0x82B8 +#define GL_IMAGE_CLASS_4_X_32 0x82B9 +#define GL_IMAGE_CLASS_2_X_32 0x82BA +#define GL_IMAGE_CLASS_1_X_32 0x82BB +#define GL_IMAGE_CLASS_4_X_16 0x82BC +#define GL_IMAGE_CLASS_2_X_16 0x82BD +#define GL_IMAGE_CLASS_1_X_16 0x82BE +#define GL_IMAGE_CLASS_4_X_8 0x82BF +#define GL_IMAGE_CLASS_2_X_8 0x82C0 +#define GL_IMAGE_CLASS_1_X_8 0x82C1 +#define GL_IMAGE_CLASS_11_11_10 0x82C2 +#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 +#define GL_VIEW_CLASS_128_BITS 0x82C4 +#define GL_VIEW_CLASS_96_BITS 0x82C5 +#define GL_VIEW_CLASS_64_BITS 0x82C6 +#define GL_VIEW_CLASS_48_BITS 0x82C7 +#define GL_VIEW_CLASS_32_BITS 0x82C8 +#define GL_VIEW_CLASS_24_BITS 0x82C9 +#define GL_VIEW_CLASS_16_BITS 0x82CA +#define GL_VIEW_CLASS_8_BITS 0x82CB +#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC +#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD +#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE +#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF +#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 +#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 +#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 +#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 +#endif + +#ifndef GL_ARB_invalidate_subdata +#endif + +#ifndef GL_ARB_multi_draw_indirect +#endif + +#ifndef GL_ARB_program_interface_query +#define GL_UNIFORM 0x92E1 +#define GL_UNIFORM_BLOCK 0x92E2 +#define GL_PROGRAM_INPUT 0x92E3 +#define GL_PROGRAM_OUTPUT 0x92E4 +#define GL_BUFFER_VARIABLE 0x92E5 +#define GL_SHADER_STORAGE_BLOCK 0x92E6 +/* reuse GL_ATOMIC_COUNTER_BUFFER */ +#define GL_VERTEX_SUBROUTINE 0x92E8 +#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 +#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA +#define GL_GEOMETRY_SUBROUTINE 0x92EB +#define GL_FRAGMENT_SUBROUTINE 0x92EC +#define GL_COMPUTE_SUBROUTINE 0x92ED +#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE +#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF +#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 +#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 +#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 +#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 +#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 +#define GL_ACTIVE_RESOURCES 0x92F5 +#define GL_MAX_NAME_LENGTH 0x92F6 +#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 +#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 +#define GL_NAME_LENGTH 0x92F9 +#define GL_TYPE 0x92FA +#define GL_ARRAY_SIZE 0x92FB +#define GL_OFFSET 0x92FC +#define GL_BLOCK_INDEX 0x92FD +#define GL_ARRAY_STRIDE 0x92FE +#define GL_MATRIX_STRIDE 0x92FF +#define GL_IS_ROW_MAJOR 0x9300 +#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 +#define GL_BUFFER_BINDING 0x9302 +#define GL_BUFFER_DATA_SIZE 0x9303 +#define GL_NUM_ACTIVE_VARIABLES 0x9304 +#define GL_ACTIVE_VARIABLES 0x9305 +#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 +#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 +#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 +#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 +#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A +#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B +#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C +#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D +#define GL_LOCATION 0x930E +#define GL_LOCATION_INDEX 0x930F +#define GL_IS_PER_PATCH 0x92E7 +/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */ +/* reuse GL_COMPATIBLE_SUBROUTINES */ +#endif + +#ifndef GL_ARB_robust_buffer_access_behavior +#endif + +#ifndef GL_ARB_shader_image_size +#endif + +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_SHADER_STORAGE_BUFFER 0x90D2 +#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 +#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 +#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 +#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 +#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 +#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 +#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA +#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB +#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC +#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD +#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE +#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF +#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000 +#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS +/* reuse GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS */ +#endif + +#ifndef GL_ARB_stencil_texturing +#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA +#endif + +#ifndef GL_ARB_texture_buffer_range +#define GL_TEXTURE_BUFFER_OFFSET 0x919D +#define GL_TEXTURE_BUFFER_SIZE 0x919E +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F +#endif + +#ifndef GL_ARB_texture_query_levels +#endif + +#ifndef GL_ARB_texture_storage_multisample +#endif + +#ifndef GL_EXT_abgr +#define GL_ABGR_EXT 0x8000 +#endif + +#ifndef GL_EXT_blend_color +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +#endif + +#ifndef GL_EXT_texture +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#endif + +#ifndef GL_EXT_texture3D +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +#endif + +#ifndef GL_EXT_subtexture +#endif + +#ifndef GL_EXT_copy_texture +#endif + +#ifndef GL_EXT_histogram +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#endif + +#ifndef GL_EXT_convolution +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 +#endif + +#ifndef GL_SGI_color_matrix +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#endif + +#ifndef GL_SGI_color_table +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +#endif + +#ifndef GL_SGIS_texture4D +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#endif + +#ifndef GL_EXT_cmyka +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#endif + +#ifndef GL_EXT_texture_object +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#endif + +#ifndef GL_SGIS_multisample +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_RESCALE_NORMAL_EXT 0x803A +#endif + +#ifndef GL_EXT_vertex_array +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +#endif + +#ifndef GL_EXT_misc_attribute +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#endif + +#ifndef GL_SGIX_shadow +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#endif + +#ifndef GL_EXT_blend_logic_op +#endif + +#ifndef GL_SGIX_interlace +#define GL_INTERLACE_SGIX 0x8094 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E +#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F +#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 +#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 +#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 +#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 +#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 +#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 +#endif + +#ifndef GL_SGIS_texture_select +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#endif + +#ifndef GL_EXT_point_parameters +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +#endif + +#ifndef GL_SGIX_instruments +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C +#endif + +#ifndef GL_SGIX_framezoom +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#endif + +#ifndef GL_FfdMaskSGIX +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 +#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 +#define GL_DEFORMATIONS_MASK_SGIX 0x8196 +#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +#endif + +#ifndef GL_SGIX_flush_raster +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#endif + +#ifndef GL_HP_image_transform +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#endif + +#ifndef GL_INGR_palette_buffer +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#endif + +#ifndef GL_EXT_color_subtable +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_LIST_PRIORITY_SGIX 0x8182 +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#endif + +#ifndef GL_EXT_index_texture +#endif + +#ifndef GL_EXT_index_material +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +#endif + +#ifndef GL_EXT_index_func +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 +#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 +#define GL_LIGHT_ENV_MODE_SGIX 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B +#define GL_FRAGMENT_LIGHT0_SGIX 0x840C +#define GL_FRAGMENT_LIGHT1_SGIX 0x840D +#define GL_FRAGMENT_LIGHT2_SGIX 0x840E +#define GL_FRAGMENT_LIGHT3_SGIX 0x840F +#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 +#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 +#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 +#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +#endif + +#ifndef GL_WIN_phong_shading +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#endif + +#ifndef GL_WIN_specular_fog +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#endif + +#ifndef GL_EXT_light_texture +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +/* reuse GL_FRAGMENT_DEPTH_EXT */ +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#endif + +#ifndef GL_SGIX_impact_pixel_texture +#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 +#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 +#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 +#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 +#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 +#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 +#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A +#endif + +#ifndef GL_EXT_bgra +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif + +#ifndef GL_SGIX_async +#define GL_ASYNC_MARKER_SGIX 0x8329 +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D +#endif + +#ifndef GL_INTEL_texture_scissor +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 +#endif + +#ifndef GL_HP_occlusion_test +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#endif + +#ifndef GL_EXT_secondary_color +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +#endif + +#ifndef GL_EXT_multi_draw_arrays +#endif + +#ifndef GL_EXT_fog_coord +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_FOG_SCALE_SGIX 0x81FC +#define GL_FOG_SCALE_VALUE_SGIX 0x81FD +#endif + +#ifndef GL_SUNX_constant_data +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +#endif + +#ifndef GL_SUN_global_alpha +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +#endif + +#ifndef GL_SUN_triangle_list +#define GL_RESTART_SUN 0x0001 +#define GL_REPLACE_MIDDLE_SUN 0x0002 +#define GL_REPLACE_OLDEST_SUN 0x0003 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB +#endif + +#ifndef GL_SUN_vertex +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +#endif + +#ifndef GL_INGR_color_clamp +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INTERLACE_READ_INGR 0x8568 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#endif + +#ifndef GL_EXT_texture_cube_map +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_WRAP_BORDER_SUN 0x81D4 +#endif + +#ifndef GL_EXT_texture_env_add +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT GL_MODELVIEW +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 +#endif + +#ifndef GL_NV_register_combiners +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +/* reuse GL_TEXTURE0_ARB */ +/* reuse GL_TEXTURE1_ARB */ +/* reuse GL_ZERO */ +/* reuse GL_NONE */ +/* reuse GL_FOG */ +#endif + +#ifndef GL_NV_fog_distance +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +/* reuse GL_EYE_PLANE */ +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#endif + +#ifndef GL_NV_blend_square +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B +#endif + +#ifndef GL_MESA_resize_buffers +#endif + +#ifndef GL_MESA_window_pos +#endif + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_CULL_VERTEX_IBM 103050 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 +#endif + +#ifndef GL_SGIX_subsample +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 +#endif + +#ifndef GL_SGI_depth_pass_instrument +#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 +#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 +#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 +#endif + +#ifndef GL_3DFX_tbuffer +#endif + +#ifndef GL_EXT_multisample +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_CONVOLUTION_HINT_SGIX 0x8316 +#endif + +#ifndef GL_SGIX_resample +#define GL_PACK_RESAMPLE_SGIX 0x842C +#define GL_UNPACK_RESAMPLE_SGIX 0x842D +#define GL_RESAMPLE_REPLICATE_SGIX 0x842E +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 +#endif + +#ifndef GL_NV_fence +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +#endif + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_IBM 0x8370 +#endif + +#ifndef GL_NV_evaluators +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 +#endif + +#ifndef GL_NV_texture_compression_vtc +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 +#endif + +#ifndef GL_NV_texture_shader +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV +#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV +#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 +#endif + +#ifndef GL_NV_vertex_program +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SCALEBIAS_HINT_SGIX 0x8322 +#endif + +#ifndef GL_OML_interlace +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 +#endif + +#ifndef GL_OML_subsample +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 +#endif + +#ifndef GL_OML_resample +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_REG_6_ATI 0x8927 +#define GL_REG_7_ATI 0x8928 +#define GL_REG_8_ATI 0x8929 +#define GL_REG_9_ATI 0x892A +#define GL_REG_10_ATI 0x892B +#define GL_REG_11_ATI 0x892C +#define GL_REG_12_ATI 0x892D +#define GL_REG_13_ATI 0x892E +#define GL_REG_14_ATI 0x892F +#define GL_REG_15_ATI 0x8930 +#define GL_REG_16_ATI 0x8931 +#define GL_REG_17_ATI 0x8932 +#define GL_REG_18_ATI 0x8933 +#define GL_REG_19_ATI 0x8934 +#define GL_REG_20_ATI 0x8935 +#define GL_REG_21_ATI 0x8936 +#define GL_REG_22_ATI 0x8937 +#define GL_REG_23_ATI 0x8938 +#define GL_REG_24_ATI 0x8939 +#define GL_REG_25_ATI 0x893A +#define GL_REG_26_ATI 0x893B +#define GL_REG_27_ATI 0x893C +#define GL_REG_28_ATI 0x893D +#define GL_REG_29_ATI 0x893E +#define GL_REG_30_ATI 0x893F +#define GL_REG_31_ATI 0x8940 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_CON_8_ATI 0x8949 +#define GL_CON_9_ATI 0x894A +#define GL_CON_10_ATI 0x894B +#define GL_CON_11_ATI 0x894C +#define GL_CON_12_ATI 0x894D +#define GL_CON_13_ATI 0x894E +#define GL_CON_14_ATI 0x894F +#define GL_CON_15_ATI 0x8950 +#define GL_CON_16_ATI 0x8951 +#define GL_CON_17_ATI 0x8952 +#define GL_CON_18_ATI 0x8953 +#define GL_CON_19_ATI 0x8954 +#define GL_CON_20_ATI 0x8955 +#define GL_CON_21_ATI 0x8956 +#define GL_CON_22_ATI 0x8957 +#define GL_CON_23_ATI 0x8958 +#define GL_CON_24_ATI 0x8959 +#define GL_CON_25_ATI 0x895A +#define GL_CON_26_ATI 0x895B +#define GL_CON_27_ATI 0x895C +#define GL_CON_28_ATI 0x895D +#define GL_CON_29_ATI 0x895E +#define GL_CON_30_ATI 0x895F +#define GL_CON_31_ATI 0x8960 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B +#define GL_RED_BIT_ATI 0x00000001 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_STREAM0_ATI 0x876C +#define GL_VERTEX_STREAM1_ATI 0x876D +#define GL_VERTEX_STREAM2_ATI 0x876E +#define GL_VERTEX_STREAM3_ATI 0x876F +#define GL_VERTEX_STREAM4_ATI 0x8770 +#define GL_VERTEX_STREAM5_ATI 0x8771 +#define GL_VERTEX_STREAM6_ATI 0x8772 +#define GL_VERTEX_STREAM7_ATI 0x8773 +#define GL_VERTEX_SOURCE_ATI 0x8774 +#endif + +#ifndef GL_ATI_element_array +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A +#endif + +#ifndef GL_SUN_mesh_array +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SLICE_ACCUM_SUN 0x85CC +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_DEPTH_CLAMP_NV 0x864F +#endif + +#ifndef GL_NV_occlusion_query +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 +#endif + +#ifndef GL_NV_point_sprite +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 +#endif + +#ifndef GL_NV_vertex_program1_1 +#endif + +#ifndef GL_EXT_shadow_funcs +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 +#endif + +#ifndef GL_ATI_text_fragment_shader +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 +#endif + +#ifndef GL_APPLE_element_array +#define GL_ELEMENT_ARRAY_APPLE 0x8A0C +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E +#endif + +#ifndef GL_APPLE_fence +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CLIENT_APPLE 0x85B4 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_YCBCR_422_APPLE 0x85B9 +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#endif + +#ifndef GL_S3_s3tc +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#define GL_RGBA_DXT5_S3TC 0x83A4 +#define GL_RGBA4_DXT5_S3TC 0x83A5 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 +#endif + +#ifndef GL_ATI_pixel_format_float +#define GL_RGBA_FLOAT_MODE_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 +#endif + +#ifndef GL_ATI_texture_env_combine3 +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 +#endif + +#ifndef GL_ATI_texture_float +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F +#endif + +#ifndef GL_NV_float_buffer +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E +#endif + +#ifndef GL_NV_fragment_program +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 +#endif + +#ifndef GL_NV_half_float +#define GL_HALF_FLOAT_NV 0x140B +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D +#endif + +#ifndef GL_NV_primitive_restart +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F +#endif + +#ifndef GL_NV_vertex_program2 +#endif + +#ifndef GL_ATI_map_object_buffer +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#endif + +#ifndef GL_OES_read_format +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#endif + +#ifndef GL_EXT_depth_bounds_test +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D +#endif + +#ifndef GL_MESA_pack_invert +#define GL_PACK_INVERT_MESA 0x8758 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 +#endif + +#ifndef GL_EXT_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF +#endif + +#ifndef GL_NV_fragment_program_option +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 +#endif + +#ifndef GL_NV_vertex_program2_option +/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ +/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */ +#endif + +#ifndef GL_NV_vertex_program3 +/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ +#endif + +#ifndef GL_EXT_framebuffer_object +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 +#endif + +#ifndef GL_GREMEDY_string_marker +#endif + +#ifndef GL_EXT_packed_depth_stencil +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 +#endif + +#ifndef GL_EXT_stencil_clear_tag +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 +#endif + +#ifndef GL_EXT_texture_sRGB +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +#endif + +#ifndef GL_EXT_framebuffer_blit +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA +#endif + +#ifndef GL_EXT_framebuffer_multisample +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +#endif + +#ifndef GL_MESAX_texture_stack +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E +#endif + +#ifndef GL_EXT_timer_query +#define GL_TIME_ELAPSED_EXT 0x88BF +#endif + +#ifndef GL_EXT_gpu_program_parameters +#endif + +#ifndef GL_APPLE_flush_buffer_range +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 +#endif + +#ifndef GL_NV_gpu_program4 +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 +#endif + +#ifndef GL_NV_geometry_program4 +#define GL_LINES_ADJACENCY_EXT 0x000A +#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B +#define GL_TRIANGLES_ADJACENCY_EXT 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#endif + +#ifndef GL_EXT_geometry_shader4 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */ +/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */ +/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */ +/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */ +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +/* reuse GL_LINES_ADJACENCY_EXT */ +/* reuse GL_LINE_STRIP_ADJACENCY_EXT */ +/* reuse GL_TRIANGLES_ADJACENCY_EXT */ +/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ +/* reuse GL_PROGRAM_POINT_SIZE_EXT */ +#endif + +#ifndef GL_NV_vertex_program4 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD +#endif + +#ifndef GL_EXT_gpu_shader4 +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 +#endif + +#ifndef GL_EXT_draw_instanced +#endif + +#ifndef GL_EXT_packed_float +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C +#endif + +#ifndef GL_EXT_texture_array +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ +#endif + +#ifndef GL_EXT_texture_buffer_object +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E +#endif + +#ifndef GL_EXT_texture_compression_latc +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 +#endif + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE +#endif + +#ifndef GL_EXT_texture_shared_exponent +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F +#endif + +#ifndef GL_NV_depth_buffer_float +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF +#endif + +#ifndef GL_NV_fragment_program4 +#endif + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 +#endif + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA +#endif + +#ifndef GL_NV_geometry_shader4 +#endif + +#ifndef GL_NV_parameter_buffer_object +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 +#endif + +#ifndef GL_EXT_draw_buffers2 +#endif + +#ifndef GL_NV_transform_feedback +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F +#define GL_LAYER_NV 0x8DAA +#define GL_NEXT_BUFFER_NV -2 +#define GL_SKIP_COMPONENTS4_NV -3 +#define GL_SKIP_COMPONENTS3_NV -4 +#define GL_SKIP_COMPONENTS2_NV -5 +#define GL_SKIP_COMPONENTS1_NV -6 +#endif + +#ifndef GL_EXT_bindable_uniform +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF +#endif + +#ifndef GL_EXT_texture_integer +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E +#endif + +#ifndef GL_GREMEDY_frame_terminator +#endif + +#ifndef GL_NV_conditional_render +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 +#endif + +#ifndef GL_NV_present_video +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B +#endif + +#ifndef GL_EXT_transform_feedback +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +#endif + +#ifndef GL_EXT_direct_state_access +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F +#endif + +#ifndef GL_EXT_vertex_array_bgra +/* reuse GL_BGRA */ +#endif + +#ifndef GL_EXT_texture_swizzle +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 +#endif + +#ifndef GL_NV_explicit_multisample +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 +#endif + +#ifndef GL_NV_transform_feedback2 +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 +#endif + +#ifndef GL_ATI_meminfo +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD +#endif + +#ifndef GL_AMD_performance_monitor +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 +#endif + +#ifndef GL_AMD_texture_texture4 +#endif + +#ifndef GL_AMD_vertex_shader_tesselator +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 +#endif + +#ifndef GL_EXT_provoking_vertex +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F +#endif + +#ifndef GL_EXT_texture_snorm +#define GL_ALPHA_SNORM 0x9010 +#define GL_LUMINANCE_SNORM 0x9011 +#define GL_LUMINANCE_ALPHA_SNORM 0x9012 +#define GL_INTENSITY_SNORM 0x9013 +#define GL_ALPHA8_SNORM 0x9014 +#define GL_LUMINANCE8_SNORM 0x9015 +#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 +#define GL_INTENSITY8_SNORM 0x9017 +#define GL_ALPHA16_SNORM 0x9018 +#define GL_LUMINANCE16_SNORM 0x9019 +#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A +#define GL_INTENSITY16_SNORM 0x901B +/* reuse GL_RED_SNORM */ +/* reuse GL_RG_SNORM */ +/* reuse GL_RGB_SNORM */ +/* reuse GL_RGBA_SNORM */ +/* reuse GL_R8_SNORM */ +/* reuse GL_RG8_SNORM */ +/* reuse GL_RGB8_SNORM */ +/* reuse GL_RGBA8_SNORM */ +/* reuse GL_R16_SNORM */ +/* reuse GL_RG16_SNORM */ +/* reuse GL_RGB16_SNORM */ +/* reuse GL_RGBA16_SNORM */ +/* reuse GL_SIGNED_NORMALIZED */ +#endif + +#ifndef GL_AMD_draw_buffers_blend +#endif + +#ifndef GL_APPLE_texture_range +#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 +#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_STORAGE_PRIVATE_APPLE 0x85BD +/* reuse GL_STORAGE_CACHED_APPLE */ +/* reuse GL_STORAGE_SHARED_APPLE */ +#endif + +#ifndef GL_APPLE_float_pixels +#define GL_HALF_APPLE 0x140B +#define GL_RGBA_FLOAT32_APPLE 0x8814 +#define GL_RGB_FLOAT32_APPLE 0x8815 +#define GL_ALPHA_FLOAT32_APPLE 0x8816 +#define GL_INTENSITY_FLOAT32_APPLE 0x8817 +#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 +#define GL_RGBA_FLOAT16_APPLE 0x881A +#define GL_RGB_FLOAT16_APPLE 0x881B +#define GL_ALPHA_FLOAT16_APPLE 0x881C +#define GL_INTENSITY_FLOAT16_APPLE 0x881D +#define GL_LUMINANCE_FLOAT16_APPLE 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F +#define GL_COLOR_FLOAT_APPLE 0x8A0F +#endif + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 +#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 +#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 +#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 +#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 +#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 +#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 +#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 +#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 +#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 +#endif + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 +#endif + +#ifndef GL_APPLE_object_purgeable +#define GL_BUFFER_OBJECT_APPLE 0x85B3 +#define GL_RELEASED_APPLE 0x8A19 +#define GL_VOLATILE_APPLE 0x8A1A +#define GL_RETAINED_APPLE 0x8A1B +#define GL_UNDEFINED_APPLE 0x8A1C +#define GL_PURGEABLE_APPLE 0x8A1D +#endif + +#ifndef GL_APPLE_row_bytes +#define GL_PACK_ROW_BYTES_APPLE 0x8A15 +#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 +#endif + +#ifndef GL_APPLE_rgb_422 +#define GL_RGB_422_APPLE 0x8A1F +/* reuse GL_UNSIGNED_SHORT_8_8_APPLE */ +/* reuse GL_UNSIGNED_SHORT_8_8_REV_APPLE */ +#endif + +#ifndef GL_NV_video_capture +#define GL_VIDEO_BUFFER_NV 0x9020 +#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 +#define GL_FIELD_UPPER_NV 0x9022 +#define GL_FIELD_LOWER_NV 0x9023 +#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 +#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 +#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 +#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 +#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 +#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 +#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A +#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B +#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C +#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D +#define GL_PARTIAL_SUCCESS_NV 0x902E +#define GL_SUCCESS_NV 0x902F +#define GL_FAILURE_NV 0x9030 +#define GL_YCBYCR8_422_NV 0x9031 +#define GL_YCBAYCR8A_4224_NV 0x9032 +#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 +#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 +#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 +#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 +#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 +#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 +#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 +#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A +#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B +#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C +#endif + +#ifndef GL_NV_copy_image +#endif + +#ifndef GL_EXT_separate_shader_objects +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D +#endif + +#ifndef GL_NV_parameter_buffer_object2 +#endif + +#ifndef GL_NV_shader_buffer_load +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 +#endif + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 +#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 +#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 +#endif + +#ifndef GL_NV_texture_barrier +#endif + +#ifndef GL_AMD_shader_stencil_export +#endif + +#ifndef GL_AMD_seamless_cubemap_per_texture +/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */ +#endif + +#ifndef GL_AMD_conservative_depth +#endif + +#ifndef GL_EXT_shader_image_load_store +#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 +#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A +#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B +#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C +#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D +#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E +#define GL_IMAGE_1D_EXT 0x904C +#define GL_IMAGE_2D_EXT 0x904D +#define GL_IMAGE_3D_EXT 0x904E +#define GL_IMAGE_2D_RECT_EXT 0x904F +#define GL_IMAGE_CUBE_EXT 0x9050 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_IMAGE_1D_ARRAY_EXT 0x9052 +#define GL_IMAGE_2D_ARRAY_EXT 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 +#define GL_INT_IMAGE_1D_EXT 0x9057 +#define GL_INT_IMAGE_2D_EXT 0x9058 +#define GL_INT_IMAGE_3D_EXT 0x9059 +#define GL_INT_IMAGE_2D_RECT_EXT 0x905A +#define GL_INT_IMAGE_CUBE_EXT 0x905B +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D +#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C +#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D +#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 +#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 +#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF +#endif + +#ifndef GL_EXT_vertex_attrib_64bit +/* reuse GL_DOUBLE */ +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE +#define GL_DOUBLE_MAT2_EXT 0x8F46 +#define GL_DOUBLE_MAT3_EXT 0x8F47 +#define GL_DOUBLE_MAT4_EXT 0x8F48 +#define GL_DOUBLE_MAT2x3_EXT 0x8F49 +#define GL_DOUBLE_MAT2x4_EXT 0x8F4A +#define GL_DOUBLE_MAT3x2_EXT 0x8F4B +#define GL_DOUBLE_MAT3x4_EXT 0x8F4C +#define GL_DOUBLE_MAT4x2_EXT 0x8F4D +#define GL_DOUBLE_MAT4x3_EXT 0x8F4E +#endif + +#ifndef GL_NV_gpu_program5 +#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C +#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F +#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44 +#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45 +#endif + +#ifndef GL_NV_gpu_shader5 +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB +/* reuse GL_PATCHES */ +#endif + +#ifndef GL_NV_shader_buffer_store +#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010 +/* reuse GL_READ_WRITE */ +/* reuse GL_WRITE_ONLY */ +#endif + +#ifndef GL_NV_tessellation_program5 +#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 +#define GL_TESS_CONTROL_PROGRAM_NV 0x891E +#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F +#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 +#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 +#endif + +#ifndef GL_NV_vertex_attrib_integer_64bit +/* reuse GL_INT64_NV */ +/* reuse GL_UNSIGNED_INT64_NV */ +#endif + +#ifndef GL_NV_multisample_coverage +#define GL_COVERAGE_SAMPLES_NV 0x80A9 +#define GL_COLOR_SAMPLES_NV 0x8E20 +#endif + +#ifndef GL_AMD_name_gen_delete +#define GL_DATA_BUFFER_AMD 0x9151 +#define GL_PERFORMANCE_MONITOR_AMD 0x9152 +#define GL_QUERY_OBJECT_AMD 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 +#define GL_SAMPLER_OBJECT_AMD 0x9155 +#endif + +#ifndef GL_AMD_debug_output +#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 +#endif + +#ifndef GL_NV_vdpau_interop +#define GL_SURFACE_STATE_NV 0x86EB +#define GL_SURFACE_REGISTERED_NV 0x86FD +#define GL_SURFACE_MAPPED_NV 0x8700 +#define GL_WRITE_DISCARD_NV 0x88BE +#endif + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#endif + +#ifndef GL_AMD_depth_clamp_separate +#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E +#define GL_DEPTH_CLAMP_FAR_AMD 0x901F +#endif + +#ifndef GL_EXT_texture_sRGB_decode +#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 +#define GL_DECODE_EXT 0x8A49 +#define GL_SKIP_DECODE_EXT 0x8A4A +#endif + +#ifndef GL_NV_texture_multisample +#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 +#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 +#endif + +#ifndef GL_AMD_blend_minmax_factor +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D +#endif + +#ifndef GL_AMD_sample_positions +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F +#endif + +#ifndef GL_EXT_x11_sync_object +#define GL_SYNC_X11_FENCE_EXT 0x90E1 +#endif + +#ifndef GL_AMD_multi_draw_indirect +#endif + +#ifndef GL_EXT_framebuffer_multisample_blit_scaled +#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA +#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB +#endif + +#ifndef GL_NV_path_rendering +#define GL_PATH_FORMAT_SVG_NV 0x9070 +#define GL_PATH_FORMAT_PS_NV 0x9071 +#define GL_STANDARD_FONT_NAME_NV 0x9072 +#define GL_SYSTEM_FONT_NAME_NV 0x9073 +#define GL_FILE_NAME_NV 0x9074 +#define GL_PATH_STROKE_WIDTH_NV 0x9075 +#define GL_PATH_END_CAPS_NV 0x9076 +#define GL_PATH_INITIAL_END_CAP_NV 0x9077 +#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 +#define GL_PATH_JOIN_STYLE_NV 0x9079 +#define GL_PATH_MITER_LIMIT_NV 0x907A +#define GL_PATH_DASH_CAPS_NV 0x907B +#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C +#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D +#define GL_PATH_DASH_OFFSET_NV 0x907E +#define GL_PATH_CLIENT_LENGTH_NV 0x907F +#define GL_PATH_FILL_MODE_NV 0x9080 +#define GL_PATH_FILL_MASK_NV 0x9081 +#define GL_PATH_FILL_COVER_MODE_NV 0x9082 +#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 +#define GL_PATH_STROKE_MASK_NV 0x9084 +#define GL_PATH_SAMPLE_QUALITY_NV 0x9085 +#define GL_PATH_STROKE_BOUND_NV 0x9086 +#define GL_PATH_STROKE_OVERSAMPLE_COUNT_NV 0x9087 +#define GL_COUNT_UP_NV 0x9088 +#define GL_COUNT_DOWN_NV 0x9089 +#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A +#define GL_CONVEX_HULL_NV 0x908B +#define GL_MULTI_HULLS_NV 0x908C +#define GL_BOUNDING_BOX_NV 0x908D +#define GL_TRANSLATE_X_NV 0x908E +#define GL_TRANSLATE_Y_NV 0x908F +#define GL_TRANSLATE_2D_NV 0x9090 +#define GL_TRANSLATE_3D_NV 0x9091 +#define GL_AFFINE_2D_NV 0x9092 +#define GL_PROJECTIVE_2D_NV 0x9093 +#define GL_AFFINE_3D_NV 0x9094 +#define GL_PROJECTIVE_3D_NV 0x9095 +#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 +#define GL_TRANSPOSE_PROJECTIVE_2D_NV 0x9097 +#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 +#define GL_TRANSPOSE_PROJECTIVE_3D_NV 0x9099 +#define GL_UTF8_NV 0x909A +#define GL_UTF16_NV 0x909B +#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C +#define GL_PATH_COMMAND_COUNT_NV 0x909D +#define GL_PATH_COORD_COUNT_NV 0x909E +#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F +#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 +#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 +#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 +#define GL_SQUARE_NV 0x90A3 +#define GL_ROUND_NV 0x90A4 +#define GL_TRIANGULAR_NV 0x90A5 +#define GL_BEVEL_NV 0x90A6 +#define GL_MITER_REVERT_NV 0x90A7 +#define GL_MITER_TRUNCATE_NV 0x90A8 +#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 +#define GL_USE_MISSING_GLYPH_NV 0x90AA +#define GL_PATH_ERROR_POSITION_NV 0x90AB +#define GL_PATH_FOG_GEN_MODE_NV 0x90AC +#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD +#define GL_ADJACENT_PAIRS_NV 0x90AE +#define GL_FIRST_TO_REST_NV 0x90AF +#define GL_PATH_GEN_MODE_NV 0x90B0 +#define GL_PATH_GEN_COEFF_NV 0x90B1 +#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 +#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 +#define GL_PATH_STENCIL_FUNC_NV 0x90B7 +#define GL_PATH_STENCIL_REF_NV 0x90B8 +#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 +#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD +#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE +#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF +#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 +#define GL_MOVE_TO_RESETS_NV 0x90B5 +#define GL_MOVE_TO_CONTINUES_NV 0x90B6 +#define GL_CLOSE_PATH_NV 0x00 +#define GL_MOVE_TO_NV 0x02 +#define GL_RELATIVE_MOVE_TO_NV 0x03 +#define GL_LINE_TO_NV 0x04 +#define GL_RELATIVE_LINE_TO_NV 0x05 +#define GL_HORIZONTAL_LINE_TO_NV 0x06 +#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 +#define GL_VERTICAL_LINE_TO_NV 0x08 +#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 +#define GL_QUADRATIC_CURVE_TO_NV 0x0A +#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B +#define GL_CUBIC_CURVE_TO_NV 0x0C +#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D +#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E +#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F +#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 +#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 +#define GL_SMALL_CCW_ARC_TO_NV 0x12 +#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 +#define GL_SMALL_CW_ARC_TO_NV 0x14 +#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 +#define GL_LARGE_CCW_ARC_TO_NV 0x16 +#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 +#define GL_LARGE_CW_ARC_TO_NV 0x18 +#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 +#define GL_RESTART_PATH_NV 0xF0 +#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 +#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 +#define GL_RECT_NV 0xF6 +#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 +#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA +#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC +#define GL_ARC_TO_NV 0xFE +#define GL_RELATIVE_ARC_TO_NV 0xFF +#define GL_BOLD_BIT_NV 0x01 +#define GL_ITALIC_BIT_NV 0x02 +#define GL_GLYPH_WIDTH_BIT_NV 0x01 +#define GL_GLYPH_HEIGHT_BIT_NV 0x02 +#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 +#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 +#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 +#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 +#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 +#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 +#define GL_GLYPH_HAS_KERNING_NV 0x100 +#define GL_FONT_X_MIN_BOUNDS_NV 0x00010000 +#define GL_FONT_Y_MIN_BOUNDS_NV 0x00020000 +#define GL_FONT_X_MAX_BOUNDS_NV 0x00040000 +#define GL_FONT_Y_MAX_BOUNDS_NV 0x00080000 +#define GL_FONT_UNITS_PER_EM_NV 0x00100000 +#define GL_FONT_ASCENDER_NV 0x00200000 +#define GL_FONT_DESCENDER_NV 0x00400000 +#define GL_FONT_HEIGHT_NV 0x00800000 +#define GL_FONT_MAX_ADVANCE_WIDTH_NV 0x01000000 +#define GL_FONT_MAX_ADVANCE_HEIGHT_NV 0x02000000 +#define GL_FONT_UNDERLINE_POSITION_NV 0x04000000 +#define GL_FONT_UNDERLINE_THICKNESS_NV 0x08000000 +#define GL_FONT_HAS_KERNING_NV 0x10000000 +#endif + +#ifndef GL_AMD_pinned_memory +#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 +#endif + +#ifndef GL_AMD_stencil_operation_extended +#define GL_SET_AMD 0x874A +#define GL_REPLACE_VALUE_AMD 0x874B +#define GL_STENCIL_OP_VALUE_AMD 0x874C +#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D +#endif + +#ifndef GL_AMD_vertex_shader_viewport_index +#endif + +#ifndef GL_AMD_vertex_shader_layer +#endif + +#ifndef GL_NV_bindless_texture +#endif + +#ifndef GL_NV_shader_atomic_float +#endif + +#ifndef GL_AMD_query_buffer_object +#define GL_QUERY_BUFFER_AMD 0x9192 +#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 +#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 +#endif + +#ifndef GL_AMD_sparse_texture +#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A +#define GL_MIN_SPARSE_LEVEL_AMD 0x919B +#define GL_MIN_LOD_WARNING_AMD 0x919C +#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 +#endif + + +/*************************************************************/ + +#include +#ifndef GL_VERSION_2_0 +/* GL type for program/shader text */ +typedef char GLchar; +#endif + +#ifndef GL_VERSION_1_5 +/* GL types for handling large vertex buffer objects */ +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; +#endif + +#ifndef GL_ARB_vertex_buffer_object +/* GL types for handling large vertex buffer objects */ +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; +#endif + +#ifndef GL_ARB_shader_objects +/* GL types for program/shader text and shader object handles */ +typedef char GLcharARB; +typedef unsigned int GLhandleARB; +#endif + +/* GL type for "half" precision (s10e5) float data in host memory */ +#ifndef GL_ARB_half_float_pixel +typedef unsigned short GLhalfARB; +#endif + +#ifndef GL_NV_half_float +typedef unsigned short GLhalfNV; +#endif + +#ifndef GLEXT_64_TYPES_DEFINED +/* This code block is duplicated in glxext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GL_EXT_timer_query extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(__sun__) || defined(__digital__) +#include +#if defined(__STDC__) +#if defined(__arch64__) || defined(_LP64) +typedef long int int64_t; +typedef unsigned long int uint64_t; +#else +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#endif /* __arch64__ */ +#endif /* __STDC__ */ +#elif defined( __VMS ) || defined(__sgi) +#include +#elif defined(__SCO__) || defined(__USLC__) +#include +#elif defined(__UNIXOS2__) || defined(__SOL64__) +typedef long int int32_t; +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#elif defined(_WIN32) && defined(__GNUC__) +#include +#elif defined(_WIN32) +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +/* Fallback if nothing above works */ +#include +#endif +#endif + +#ifndef GL_EXT_timer_query +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif + +#ifndef GL_ARB_sync +typedef int64_t GLint64; +typedef uint64_t GLuint64; +typedef struct __GLsync *GLsync; +#endif + +#ifndef GL_ARB_cl_event +/* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */ +struct _cl_context; +struct _cl_event; +#endif + +#ifndef GL_ARB_debug_output +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +#endif + +#ifndef GL_AMD_debug_output +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +#endif + +#ifndef GL_KHR_debug +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +#endif + +#ifndef GL_NV_vdpau_interop +typedef GLintptr GLvdpauSurfaceNV; +#endif + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void APIENTRY glBlendEquation (GLenum mode); +GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, GLvoid *table); +GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params); +GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params); +GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, GLvoid *image); +GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glResetHistogram (GLenum target); +GLAPI void APIENTRY glResetMinmax (GLenum target); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); +#endif + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTexture (GLenum texture); +GLAPI void APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); +GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img); +GLAPI void APIENTRY glClientActiveTexture (GLenum texture); +GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s); +GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s); +GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s); +GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s); +GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t); +GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t); +GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t); +GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t); +GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r); +GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m); +GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m); +GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m); +GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); +#endif + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount); +GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param); +GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params); +GLAPI void APIENTRY glFogCoordf (GLfloat coord); +GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord); +GLAPI void APIENTRY glFogCoordd (GLdouble coord); +GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord); +GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v); +GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v); +GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v); +GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue); +GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v); +GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v); +GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v); +GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v); +GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v); +GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2iv (const GLint *v); +GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2sv (const GLshort *v); +GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3iv (const GLint *v); +GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3sv (const GLshort *v); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); +#endif + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsQuery (GLuint id); +GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id); +GLAPI void APIENTRY glEndQuery (GLenum target); +GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params); +GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); +GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); +GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer); +GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); +GLAPI GLvoid* APIENTRY glMapBuffer (GLenum target, GLenum access); +GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target); +GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs); +GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); +GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); +GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader); +GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name); +GLAPI void APIENTRY glCompileShader (GLuint shader); +GLAPI GLuint APIENTRY glCreateProgram (void); +GLAPI GLuint APIENTRY glCreateShader (GLenum type); +GLAPI void APIENTRY glDeleteProgram (GLuint program); +GLAPI void APIENTRY glDeleteShader (GLuint shader); +GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader); +GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index); +GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index); +GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); +GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params); +GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params); +GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid* *pointer); +GLAPI GLboolean APIENTRY glIsProgram (GLuint program); +GLAPI GLboolean APIENTRY glIsShader (GLuint shader); +GLAPI void APIENTRY glLinkProgram (GLuint program); +GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length); +GLAPI void APIENTRY glUseProgram (GLuint program); +GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0); +GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glUniform1i (GLint location, GLint v0); +GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glValidateProgram (GLuint program); +GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length); +typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#endif + +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 +/* OpenGL 3.0 also reuses entry points from these extensions: */ +/* ARB_framebuffer_object */ +/* ARB_map_buffer_range */ +/* ARB_vertex_array_object */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data); +GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data); +GLAPI void APIENTRY glEnablei (GLenum target, GLuint index); +GLAPI void APIENTRY glDisablei (GLenum target, GLuint index); +GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index); +GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedback (void); +GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode); +GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp); +GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode); +GLAPI void APIENTRY glEndConditionalRender (void); +GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params); +GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x); +GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y); +GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x); +GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y); +GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params); +GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0); +GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value); +GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value); +GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value); +GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +GLAPI const GLubyte * APIENTRY glGetStringi (GLenum name, GLuint index); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); +#endif + +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 +/* OpenGL 3.1 also reuses entry points from these extensions: */ +/* ARB_copy_buffer */ +/* ARB_uniform_buffer_object */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); +GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount); +GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount); +typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index); +#endif + +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 +/* OpenGL 3.2 also reuses entry points from these extensions: */ +/* ARB_draw_elements_base_vertex */ +/* ARB_provoking_vertex */ +/* ARB_sync */ +/* ARB_texture_multisample */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data); +GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +#endif + +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 +/* OpenGL 3.3 also reuses entry points from these extensions: */ +/* ARB_blend_func_extended */ +/* ARB_sampler_objects */ +/* ARB_explicit_attrib_location, but it has none */ +/* ARB_occlusion_query2 (no entry points) */ +/* ARB_shader_bit_encoding (no entry points) */ +/* ARB_texture_rgb10_a2ui (no entry points) */ +/* ARB_texture_swizzle (no entry points) */ +/* ARB_timer_query */ +/* ARB_vertex_type_2_10_10_10_rev */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); +#endif + +#ifndef GL_VERSION_4_0 +#define GL_VERSION_4_0 1 +/* OpenGL 4.0 also reuses entry points from these extensions: */ +/* ARB_texture_query_lod (no entry points) */ +/* ARB_draw_indirect */ +/* ARB_gpu_shader5 (no entry points) */ +/* ARB_gpu_shader_fp64 */ +/* ARB_shader_subroutine */ +/* ARB_tessellation_shader */ +/* ARB_texture_buffer_object_rgb32 (no entry points) */ +/* ARB_texture_cube_map_array (no entry points) */ +/* ARB_texture_gather (no entry points) */ +/* ARB_transform_feedback2 */ +/* ARB_transform_feedback3 */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMinSampleShading (GLfloat value); +GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLfloat value); +typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif + +#ifndef GL_VERSION_4_1 +#define GL_VERSION_4_1 1 +/* OpenGL 4.1 reuses entry points from these extensions: */ +/* ARB_ES2_compatibility */ +/* ARB_get_program_binary */ +/* ARB_separate_shader_objects */ +/* ARB_shader_precision (no entry points) */ +/* ARB_vertex_attrib_64bit */ +/* ARB_viewport_array */ +#endif + +#ifndef GL_VERSION_4_2 +#define GL_VERSION_4_2 1 +/* OpenGL 4.2 reuses entry points from these extensions: */ +/* ARB_base_instance */ +/* ARB_shading_language_420pack (no entry points) */ +/* ARB_transform_feedback_instanced */ +/* ARB_compressed_texture_pixel_storage (no entry points) */ +/* ARB_conservative_depth (no entry points) */ +/* ARB_internalformat_query */ +/* ARB_map_buffer_alignment (no entry points) */ +/* ARB_shader_atomic_counters */ +/* ARB_shader_image_load_store */ +/* ARB_shading_language_packing (no entry points) */ +/* ARB_texture_storage */ +#endif + +#ifndef GL_VERSION_4_3 +#define GL_VERSION_4_3 1 +/* OpenGL 4.3 reuses entry points from these extensions: */ +/* ARB_arrays_of_arrays (no entry points, GLSL only) */ +/* ARB_fragment_layer_viewport (no entry points, GLSL only) */ +/* ARB_shader_image_size (no entry points, GLSL only) */ +/* ARB_ES3_compatibility (no entry points) */ +/* ARB_clear_buffer_object */ +/* ARB_compute_shader */ +/* ARB_copy_image */ +/* KHR_debug (includes ARB_debug_output commands promoted to KHR without suffixes) */ +/* ARB_explicit_uniform_location (no entry points) */ +/* ARB_framebuffer_no_attachments */ +/* ARB_internalformat_query2 */ +/* ARB_invalidate_subdata */ +/* ARB_multi_draw_indirect */ +/* ARB_program_interface_query */ +/* ARB_robust_buffer_access_behavior (no entry points) */ +/* ARB_shader_storage_buffer_object */ +/* ARB_stencil_texturing (no entry points) */ +/* ARB_texture_buffer_range */ +/* ARB_texture_query_levels (no entry points) */ +/* ARB_texture_storage_multisample */ +/* ARB_texture_view */ +/* ARB_vertex_attrib_binding */ +#endif + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTextureARB (GLenum texture); +GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture); +GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s); +GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s); +GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s); +GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s); +GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t); +GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t); +GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t); +GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t); +GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r); +GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m); +GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m); +GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m); +GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +#endif + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleCoverageARB (GLfloat value, GLboolean invert); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLfloat value, GLboolean invert); +#endif + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +#endif + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, GLvoid *img); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +#endif + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights); +GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights); +GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights); +GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights); +GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights); +GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights); +GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights); +GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights); +GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glVertexBlendARB (GLint count); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); +typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); +typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); +typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); +typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); +typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); +typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index); +GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices); +GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices); +GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices); +GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 +#endif + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 +#endif + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v); +GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v); +GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v); +GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); +#endif + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index); +GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index); +GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program); +GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs); +GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, GLvoid *string); +GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, GLvoid* *pointer); +GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); +#endif + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 +/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */ +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer); +GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers); +GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers); +GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer); +GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum target, GLenum access); +GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target); +GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid* *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id); +GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id); +GLAPI void APIENTRY glEndQueryARB (GLenum target); +GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj); +GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname); +GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj); +GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType); +GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); +GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj); +GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); +GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj); +GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj); +GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj); +GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj); +GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0); +GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0); +GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name); +GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params); +GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params); +GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); +typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name); +GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 +#endif + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 +#endif + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 +#endif + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 +#endif + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 +#endif + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 +#endif + +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 +#endif + +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer); +GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers); +GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers); +GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer); +GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); +GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers); +GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers); +GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target); +GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateMipmap (GLenum target); +GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +#endif + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 +#endif + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value); +GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 +#endif + +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); +#endif + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +#endif + +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); +#endif + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 +#endif + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 +#endif + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexArray (GLuint array); +GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays); +GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays); +GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); +#endif + +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar* const *uniformNames, GLuint *uniformIndices); +GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); +GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName); +GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); +GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* const *uniformNames, GLuint *uniformIndices); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); +typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); +typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); +#endif + +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 +#endif + +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +#endif + +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 +#endif + +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 +#endif + +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex); +GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount, const GLint *basevertex); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount, const GLint *basevertex); +#endif + +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 +#endif + +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProvokingVertex (GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode); +#endif + +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 +#endif + +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags); +GLAPI GLboolean APIENTRY glIsSync (GLsync sync); +GLAPI void APIENTRY glDeleteSync (GLsync sync); +GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *params); +GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags); +typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync); +typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync); +typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +#endif + +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val); +GLAPI void APIENTRY glSampleMaski (GLuint index, GLbitfield mask); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val); +typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); +#endif + +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 +#endif + +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif + +#ifndef GL_ARB_sample_shading +#define GL_ARB_sample_shading 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMinSampleShadingARB (GLfloat value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLfloat value); +#endif + +#ifndef GL_ARB_texture_cube_map_array +#define GL_ARB_texture_cube_map_array 1 +#endif + +#ifndef GL_ARB_texture_gather +#define GL_ARB_texture_gather 1 +#endif + +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 +#endif + +#ifndef GL_ARB_shading_language_include +#define GL_ARB_shading_language_include 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); +GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name); +GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length); +GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name); +GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); +GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); +typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length); +typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); +typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); +typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params); +#endif + +#ifndef GL_ARB_texture_compression_bptc +#define GL_ARB_texture_compression_bptc 1 +#endif + +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name); +#endif + +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 +#endif + +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 +#endif + +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers); +GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers); +GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler); +GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler); +GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param); +GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param); +GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param); +GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param); +GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param); +GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param); +GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers); +typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers); +typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params); +#endif + +#ifndef GL_ARB_shader_bit_encoding +#define GL_ARB_shader_bit_encoding 1 +#endif + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 +#endif + +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 +#endif + +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target); +GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params); +#endif + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color); +GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color); +GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color); +GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +#endif + +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const GLvoid *indirect); +GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const GLvoid *indirect); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect); +#endif + +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 +#endif + +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x); +GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y); +GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); +typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params); +#endif + +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name); +GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); +GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices); +GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params); +GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name); +typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices); +typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values); +#endif + +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value); +GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values); +#endif + +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 +#endif + +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids); +GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids); +GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id); +GLAPI void APIENTRY glPauseTransformFeedback (void); +GLAPI void APIENTRY glResumeTransformFeedback (void); +GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); +#endif + +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream); +GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id); +GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index); +GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); +typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +#endif + +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReleaseShaderCompiler (void); +GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length); +GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +GLAPI void APIENTRY glDepthRangef (GLfloat n, GLfloat f); +GLAPI void APIENTRY glClearDepthf (GLfloat d); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length); +typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f); +typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d); +#endif + +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); +GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); +GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); +typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); +#endif + +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program); +GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program); +GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar* const *strings); +GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines); +GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines); +GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params); +GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0); +GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0); +GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0); +GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0); +GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1); +GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); +GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); +GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar* const *strings); +typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines); +typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +#endif + +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params); +#endif + +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v); +GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v); +GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLdouble n, GLdouble f); +GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data); +GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v); +typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLdouble n, GLdouble f); +typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data); +typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data); +#endif + +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context * context, struct _cl_event * event, GLbitfield flags); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context * context, struct _cl_event * event, GLbitfield flags); +#endif + +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const GLvoid *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +#endif + +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void); +GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values); +GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values); +GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values); +GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern); +GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table); +GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image); +GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span); +GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img); +GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); +GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img); +GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params); +GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); +typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values); +typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern); +typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table); +typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image); +typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img); +typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); +typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img); +typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +#endif + +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 +#endif + +#ifndef GL_ARB_base_instance +#define GL_ARB_base_instance 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); +#endif + +#ifndef GL_ARB_shading_language_420pack +#define GL_ARB_shading_language_420pack 1 +#endif + +#ifndef GL_ARB_transform_feedback_instanced +#define GL_ARB_transform_feedback_instanced 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei instancecount); +GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei instancecount); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); +#endif + +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_ARB_compressed_texture_pixel_storage 1 +#endif + +#ifndef GL_ARB_conservative_depth +#define GL_ARB_conservative_depth 1 +#endif + +#ifndef GL_ARB_internalformat_query +#define GL_ARB_internalformat_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +#endif + +#ifndef GL_ARB_map_buffer_alignment +#define GL_ARB_map_buffer_alignment 1 +#endif + +#ifndef GL_ARB_shader_atomic_counters +#define GL_ARB_shader_atomic_counters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); +#endif + +#ifndef GL_ARB_shader_image_load_store +#define GL_ARB_shader_image_load_store 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); +#endif + +#ifndef GL_ARB_shading_language_packing +#define GL_ARB_shading_language_packing 1 +#endif + +#ifndef GL_ARB_texture_storage +#define GL_ARB_texture_storage 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GLAPI void APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GLAPI void APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +#endif + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 +#endif + +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +GLAPI void APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message); +GLAPI void APIENTRY glPopDebugGroup (void); +GLAPI void APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +GLAPI void APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +GLAPI void APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label); +GLAPI void APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); +typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void); +typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +typedef void (APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label); +typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); +#endif + +#ifndef GL_ARB_arrays_of_arrays +#define GL_ARB_arrays_of_arrays 1 +#endif + +#ifndef GL_ARB_clear_buffer_object +#define GL_ARB_clear_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClearBufferData (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearBufferSubData (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data); +#endif + +#ifndef GL_ARB_compute_shader +#define GL_ARB_compute_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); +#endif + +#ifndef GL_ARB_copy_image +#define GL_ARB_copy_image 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +#endif + +#ifndef GL_ARB_texture_view +#define GL_ARB_texture_view 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureView (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); +#endif + +#ifndef GL_ARB_vertex_attrib_binding +#define GL_ARB_vertex_attrib_binding 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +GLAPI void APIENTRY glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +GLAPI void APIENTRY glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexAttribLFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexAttribBinding (GLuint attribindex, GLuint bindingindex); +GLAPI void APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor); +GLAPI void APIENTRY glVertexArrayBindVertexBufferEXT (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +GLAPI void APIENTRY glVertexArrayVertexAttribFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayVertexAttribIFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayVertexAttribLFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayVertexAttribBindingEXT (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +GLAPI void APIENTRY glVertexArrayVertexBindingDivisorEXT (GLuint vaobj, GLuint bindingindex, GLuint divisor); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); +typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); +typedef void (APIENTRYP PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); +#endif + +#ifndef GL_ARB_robustness_isolation +#define GL_ARB_robustness_isolation 1 +#endif + +#ifndef GL_ARB_ES3_compatibility +#define GL_ARB_ES3_compatibility 1 +#endif + +#ifndef GL_ARB_explicit_uniform_location +#define GL_ARB_explicit_uniform_location 1 +#endif + +#ifndef GL_ARB_fragment_layer_viewport +#define GL_ARB_fragment_layer_viewport 1 +#endif + +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_ARB_framebuffer_no_attachments 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param); +GLAPI void APIENTRY glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); +#endif + +#ifndef GL_ARB_internalformat_query2 +#define GL_ARB_internalformat_query2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); +#endif + +#ifndef GL_ARB_invalidate_subdata +#define GL_ARB_invalidate_subdata 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level); +GLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length); +GLAPI void APIENTRY glInvalidateBufferData (GLuint buffer); +GLAPI void APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments); +GLAPI void APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); +typedef void (APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_ARB_multi_draw_indirect +#define GL_ARB_multi_draw_indirect 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysIndirect (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); +GLAPI void APIENTRY glMultiDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); +#endif + +#ifndef GL_ARB_program_interface_query +#define GL_ARB_program_interface_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params); +GLAPI GLuint APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name); +GLAPI void APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); +GLAPI GLint APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name); +GLAPI GLint APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params); +typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); +typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); +#endif + +#ifndef GL_ARB_robust_buffer_access_behavior +#define GL_ARB_robust_buffer_access_behavior 1 +#endif + +#ifndef GL_ARB_shader_image_size +#define GL_ARB_shader_image_size 1 +#endif + +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_ARB_shader_storage_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); +#endif + +#ifndef GL_ARB_stencil_texturing +#define GL_ARB_stencil_texturing 1 +#endif + +#ifndef GL_ARB_texture_buffer_range +#define GL_ARB_texture_buffer_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferRange (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glTextureBufferRangeEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +#endif + +#ifndef GL_ARB_texture_query_levels +#define GL_ARB_texture_query_levels 1 +#endif + +#ifndef GL_ARB_texture_storage_multisample +#define GL_ARB_texture_storage_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTexStorage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTextureStorage2DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTextureStorage3DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +#endif + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 +#endif + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColorEXT (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +#endif + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +#endif + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights); +GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glResetHistogramEXT (GLenum target); +GLAPI void APIENTRY glResetMinmaxEXT (GLenum target); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); +#endif + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params); +GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params); +GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *image); +GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +#endif + +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 +#endif + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, GLvoid *table); +GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param); +GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params); +GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params); +GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 +#endif + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 +#endif + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture); +GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures); +GLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures); +GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture); +GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); +typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +#endif + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +#endif + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glArrayElementEXT (GLint i); +GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count); +GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer); +GLAPI void APIENTRY glGetPointervEXT (GLenum pname, GLvoid* *params); +GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); +typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); +typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 +#endif + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationEXT (GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 +#endif + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 +#endif + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 +#endif + +#ifndef GL_SGIX_texture_select +#define GL_SGIX_texture_select 1 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param); +GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param); +GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 +#endif + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_SGIS_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIX_instruments +#define GL_SGIX_instruments 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); +GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer); +GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p); +GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker); +GLAPI void APIENTRY glStartInstrumentsSGIX (void); +GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); +typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); +typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); +typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 +#endif + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameZoomSGIX (GLint factor); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTagSampleBufferSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +GLAPI void APIENTRY glDeformSGIX (GLbitfield mask); +GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); +#endif + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushRasterSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 +#endif + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 +#endif + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, GLvoid *data); +GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params); +GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param); +GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param); +GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 +#endif + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 +#endif + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count); +GLAPI void APIENTRY glUnlockArraysEXT (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params); +GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_SGIX_fragment_lighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode); +GLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentLightivSGIX (GLenum light, GLenum pname, const GLint *params); +GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum pname, const GLint *params); +GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum face, GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum face, GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params); +GLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +#endif + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 +#endif + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 +#endif + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glApplyTextureEXT (GLenum mode); +GLAPI void APIENTRY glTextureLightEXT (GLenum pname); +GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 +#endif + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +#endif + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker); +GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp); +GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp); +GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range); +GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range); +GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); +typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); +typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer); +GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const GLvoid* *pointer); +GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer); +GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +#endif + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetPixelTransformParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetPixelTransformParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#endif + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue); +GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v); +GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue); +GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v); +GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v); +GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue); +GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v); +GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue); +GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureNormalEXT (GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord); +GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord); +GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord); +GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord); +GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz); +GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz); +GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz); +GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz); +GLAPI void APIENTRY glTangent3ivEXT (const GLint *v); +GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz); +GLAPI void APIENTRY glTangent3svEXT (const GLshort *v); +GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz); +GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz); +GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz); +GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz); +GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v); +GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz); +GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v); +GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); +typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); +typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); +typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); +typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); +typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); +typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); +typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); +typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); +typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); +typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_SGIX_fog_scale 1 +#endif + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFinishTextureSUNX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); +#endif + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor); +GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor); +GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint factor); +GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat factor); +GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor); +GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor); +GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor); +GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +#endif + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code); +GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code); +GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code); +GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code); +GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code); +GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code); +GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const GLvoid* *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); +#endif + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *rc, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *rc, const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_blend_func_separate +#define GL_INGR_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 +#endif + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight); +GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const GLvoid *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); +#endif + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param); +GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params); +GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param); +GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); +#endif + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +#endif + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +#endif + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glResizeBuffersMESA (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); +#endif + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v); +GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v); +GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean* *pointer, GLint ptrstride); +GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +#endif + +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 +#endif + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 +#endif + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); +#endif + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 +#endif + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_SGIS_texture_color_mask 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#endif + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const GLvoid *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 +#endif + +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); +GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); +GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence); +GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence); +GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); +GLAPI void APIENTRY glFinishFenceNV (GLuint fence); +GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#endif + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 +#endif + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 +#endif + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences); +GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params); +GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs); +GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program); +GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, GLvoid* *pointer); +GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id); +GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v); +GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v); +GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform); +GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); +typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); +typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 +#endif + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 +#endif + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 +#endif + +#ifndef GL_OML_resample +#define GL_OML_resample 1 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param); +GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param); +GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param); +GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range); +GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id); +GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id); +GLAPI void APIENTRY glBeginFragmentShaderATI (void); +GLAPI void APIENTRY glEndFragmentShaderATI (void); +GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle); +GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle); +GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param); +GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const GLvoid *pointer, GLenum usage); +GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params); +GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); +typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVertexShaderEXT (void); +GLAPI void APIENTRY glEndVertexShaderEXT (void); +GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id); +GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range); +GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id); +GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1); +GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num); +GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num); +GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const GLvoid *addr); +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const GLvoid *addr); +GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr); +GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr); +GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr); +GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr); +GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr); +GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr); +GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr); +GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr); +GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); +GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id); +GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id); +GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value); +GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value); +GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value); +GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value); +GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value); +GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap); +GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, GLvoid* *data); +GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); +typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); +typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); +typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); +typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); +typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); +typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); +typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); +typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); +typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); +typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x); +GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x); +GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x); +GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x); +GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y); +GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords); +GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz); +GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream); +GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param); +GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerATI (GLenum type, const GLvoid *pointer); +GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count); +GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +#endif + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 +#endif + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id); +GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id); +GLAPI void APIENTRY glEndOcclusionQueryNV (void); +GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param); +GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 +#endif + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 +#endif + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); +#endif + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 +#endif + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const GLvoid *pointer); +GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count); +GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +#endif + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences); +GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences); +GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence); +GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name); +GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); +typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); +typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array); +GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays); +GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays); +GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer); +GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer); +GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 +#endif + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); +#endif + +#ifndef GL_ATI_pixel_format_float +#define GL_ATI_pixel_format_float 1 +/* This is really a WGL extension, but defines some associated GL enums. + * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string. + */ +#endif + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 +#endif + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 +#endif + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 +#endif + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 +/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +#endif + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y); +GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z); +GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s); +GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t); +GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r); +GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s); +GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t); +GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog); +GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog); +GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight); +GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight); +GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x); +GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y); +GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); +typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); +typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, const GLvoid *pointer); +GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +#endif + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPrimitiveRestartNV (void); +GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 +#endif + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 +#endif + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); +#endif + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 +#endif + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); +#endif + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 +#endif + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 +#endif + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 +#endif + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 +#endif + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 +#endif + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer); +GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers); +GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers); +GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer); +GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer); +GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers); +GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers); +GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target); +GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +#endif + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const GLvoid *string); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); +#endif + +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 +#endif + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); +#endif + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 +#endif + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 +#endif + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64EXT *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); +#endif + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +#endif + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); +#endif + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params); +GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +#endif + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit); +GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); +#endif + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x); +GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y); +GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x); +GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y); +GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +#endif + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params); +GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name); +GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0); +GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +#endif + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 +#endif + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 +#endif + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); +#endif + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 +#endif + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 +#endif + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 +#endif + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glClearDepthdNV (GLdouble depth); +GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +#endif + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 +#endif + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 +#endif + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 +#endif + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +#endif + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data); +GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data); +GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index); +GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index); +GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); +#endif + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedbackNV (void); +GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode); +GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); +GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name); +GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location); +GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); +typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); +#endif + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer); +GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location); +GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); +typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +#endif + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +#endif + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); +#endif + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode); +GLAPI void APIENTRY glEndConditionalRenderNV (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); +#endif + +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); +GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params); +GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); +typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params); +#endif + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedbackEXT (void); +GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +#endif + +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask); +GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask); +GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode); +GLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glMatrixPopEXT (GLenum mode); +GLAPI void APIENTRY glMatrixPushEXT (GLenum mode); +GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture); +GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +GLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data); +GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data); +GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, GLvoid* *data); +GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, GLvoid *img); +GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, GLvoid *img); +GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); +GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, GLvoid *string); +GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params); +GLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0); +GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0); +GLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0); +GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); +GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); +GLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access); +GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer); +GLAPI GLvoid* APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length); +GLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, GLvoid* *params); +GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); +GLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params); +GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target); +GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target); +GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target); +GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode); +GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs); +GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode); +GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x); +GLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y); +GLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); +typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data); +typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data); +typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid* *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, GLvoid *img); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, GLvoid *img); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params); +typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +#endif + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 +#endif + +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 +#endif + +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val); +GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask); +GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val); +typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); +#endif + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids); +GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids); +GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id); +GLAPI void APIENTRY glPauseTransformFeedbackNV (void); +GLAPI void APIENTRY glResumeTransformFeedbackNV (void); +GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +#endif + +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 +#endif + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data); +GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); +GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); +GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor); +GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor); +GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); +typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#endif + +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 +#endif + +#ifndef GL_AMD_vertex_shader_tesselator +#define GL_AMD_vertex_shader_tesselator 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor); +GLAPI void APIENTRY glTessellationModeAMD (GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 +#endif + +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +#endif + +#ifndef GL_APPLE_texture_range +#define GL_APPLE_texture_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const GLvoid *pointer); +GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, GLvoid* *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_APPLE_float_pixels +#define GL_APPLE_float_pixels 1 +#endif + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_APPLE_vertex_program_evaluators 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname); +GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname); +GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname); +GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +#endif + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 +#endif + +#ifndef GL_APPLE_object_purgeable +#define GL_APPLE_object_purgeable 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); +GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); +GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params); +#endif + +#ifndef GL_APPLE_row_bytes +#define GL_APPLE_row_bytes 1 +#endif + +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 +#endif + +#ifndef GL_NV_video_capture +#define GL_NV_video_capture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot); +GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot); +GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); +GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); +GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); +GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); +typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); +#endif + +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program); +GLAPI void APIENTRY glActiveProgramEXT (GLuint program); +GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); +typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string); +#endif + +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 +#endif + +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access); +GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target); +GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target); +GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access); +GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer); +GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer); +GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result); +GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value); +GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params); +GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value); +GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); +typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); +typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); +typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); +typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); +typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result); +typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); +typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride); +GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result); +#endif + +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureBarrierNV (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void); +#endif + +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 +#endif + +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 +#endif + +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 +#endif + +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); +#endif + +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +#endif + +#ifndef GL_NV_gpu_program5 +#define GL_NV_gpu_program5 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param); +#endif + +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x); +GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x); +GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params); +GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x); +GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x); +GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif + +#ifndef GL_NV_shader_buffer_store +#define GL_NV_shader_buffer_store 1 +#endif + +#ifndef GL_NV_tessellation_program5 +#define GL_NV_tessellation_program5 1 +#endif + +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x); +GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x); +GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +#endif + +#ifndef GL_NV_multisample_coverage +#define GL_NV_multisample_coverage 1 +#endif + +#ifndef GL_AMD_name_gen_delete +#define GL_AMD_name_gen_delete 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names); +GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names); +GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names); +typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names); +typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); +#endif + +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, GLvoid *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, GLvoid *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); +#endif + +#ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVDPAUInitNV (const GLvoid *vdpDevice, const GLvoid *getProcAddress); +GLAPI void APIENTRY glVDPAUFiniNV (void); +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +GLAPI void APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface); +GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface); +GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access); +GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); +GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const GLvoid *vdpDevice, const GLvoid *getProcAddress); +typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void); +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef void (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); +typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); +typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); +#endif + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 +#endif + +#ifndef GL_AMD_depth_clamp_separate +#define GL_AMD_depth_clamp_separate 1 +#endif + +#ifndef GL_EXT_texture_sRGB_decode +#define GL_EXT_texture_sRGB_decode 1 +#endif + +#ifndef GL_NV_texture_multisample +#define GL_NV_texture_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +#endif + +#ifndef GL_AMD_blend_minmax_factor +#define GL_AMD_blend_minmax_factor 1 +#endif + +#ifndef GL_AMD_sample_positions +#define GL_AMD_sample_positions 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val); +#endif + +#ifndef GL_EXT_x11_sync_object +#define GL_EXT_x11_sync_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); +#endif + +#ifndef GL_AMD_multi_draw_indirect +#define GL_AMD_multi_draw_indirect 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride); +GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride); +#endif + +#ifndef GL_EXT_framebuffer_multisample_blit_scaled +#define GL_EXT_framebuffer_multisample_blit_scaled 1 +#endif + +#ifndef GL_NV_path_rendering +#define GL_NV_path_rendering 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glGenPathsNV (GLsizei range); +GLAPI void APIENTRY glDeletePathsNV (GLuint path, GLsizei range); +GLAPI GLboolean APIENTRY glIsPathNV (GLuint path); +GLAPI void APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords); +GLAPI void APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const GLvoid *coords); +GLAPI void APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords); +GLAPI void APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const GLvoid *coords); +GLAPI void APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const GLvoid *pathString); +GLAPI void APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI void APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI void APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); +GLAPI void APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath); +GLAPI void APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +GLAPI void APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value); +GLAPI void APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value); +GLAPI void APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value); +GLAPI void APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value); +GLAPI void APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray); +GLAPI void APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask); +GLAPI void APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units); +GLAPI void APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask); +GLAPI void APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask); +GLAPI void APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glPathCoverDepthFuncNV (GLenum func); +GLAPI void APIENTRY glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); +GLAPI void APIENTRY glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); +GLAPI void APIENTRY glPathFogGenNV (GLenum genMode); +GLAPI void APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode); +GLAPI void APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode); +GLAPI void APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value); +GLAPI void APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value); +GLAPI void APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands); +GLAPI void APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords); +GLAPI void APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray); +GLAPI void APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +GLAPI void APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); +GLAPI void APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +GLAPI void APIENTRY glGetPathColorGenivNV (GLenum color, GLenum pname, GLint *value); +GLAPI void APIENTRY glGetPathColorGenfvNV (GLenum color, GLenum pname, GLfloat *value); +GLAPI void APIENTRY glGetPathTexGenivNV (GLenum texCoordSet, GLenum pname, GLint *value); +GLAPI void APIENTRY glGetPathTexGenfvNV (GLenum texCoordSet, GLenum pname, GLfloat *value); +GLAPI GLboolean APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y); +GLAPI GLboolean APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y); +GLAPI GLfloat APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments); +GLAPI GLboolean APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range); +typedef void (APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); +typedef GLboolean (APIENTRYP PFNGLISPATHNVPROC) (GLuint path); +typedef void (APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords); +typedef void (APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const GLvoid *coords); +typedef void (APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords); +typedef void (APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const GLvoid *coords); +typedef void (APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const GLvoid *pathString); +typedef void (APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); +typedef void (APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); +typedef void (APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +typedef void (APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value); +typedef void (APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value); +typedef void (APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); +typedef void (APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray); +typedef void (APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); +typedef void (APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func); +typedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); +typedef void (APIENTRYP PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); +typedef void (APIENTRYP PFNGLPATHFOGGENNVPROC) (GLenum genMode); +typedef void (APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value); +typedef void (APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value); +typedef void (APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands); +typedef void (APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords); +typedef void (APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray); +typedef void (APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +typedef void (APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); +typedef void (APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +typedef void (APIENTRYP PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint *value); +typedef void (APIENTRYP PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat *value); +typedef void (APIENTRYP PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint *value); +typedef void (APIENTRYP PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat *value); +typedef GLboolean (APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); +typedef GLboolean (APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); +typedef GLfloat (APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); +typedef GLboolean (APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +#endif + +#ifndef GL_AMD_pinned_memory +#define GL_AMD_pinned_memory 1 +#endif + +#ifndef GL_AMD_stencil_operation_extended +#define GL_AMD_stencil_operation_extended 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilOpValueAMD (GLenum face, GLuint value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); +#endif + +#ifndef GL_AMD_vertex_shader_viewport_index +#define GL_AMD_vertex_shader_viewport_index 1 +#endif + +#ifndef GL_AMD_vertex_shader_layer +#define GL_AMD_vertex_shader_layer 1 +#endif + +#ifndef GL_NV_bindless_texture +#define GL_NV_bindless_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint64 APIENTRY glGetTextureHandleNV (GLuint texture); +GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler); +GLAPI void APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle); +GLAPI void APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle); +GLAPI GLuint64 APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +GLAPI void APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access); +GLAPI void APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle); +GLAPI void APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value); +GLAPI void APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value); +GLAPI void APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value); +GLAPI void APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +GLAPI GLboolean APIENTRY glIsTextureHandleResidentNV (GLuint64 handle); +GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); +typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); +#endif + +#ifndef GL_NV_shader_atomic_float +#define GL_NV_shader_atomic_float 1 +#endif + +#ifndef GL_AMD_query_buffer_object +#define GL_AMD_query_buffer_object 1 +#endif + +#ifndef GL_AMD_sparse_texture +#define GL_AMD_sparse_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexStorageSparseAMD (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +GLAPI void APIENTRY glTextureStorageSparseAMD (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +typedef void (APIENTRYP PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/nel/src/3d/driver/OpenGL3/GL/glxext.h b/code/nel/src/3d/driver/OpenGL3/GL/glxext.h new file mode 100644 index 000000000..580ba347d --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/GL/glxext.h @@ -0,0 +1,1009 @@ +#ifndef __glxext_h_ +#define __glxext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2007-2012 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Function declaration macros - to move into glplatform.h */ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +/*************************************************************/ + +/* Header file version number, required by OpenGL ABI for Linux */ +/* glxext.h last updated 2012/02/29 */ +/* Current version at http://www.opengl.org/registry/ */ +#define GLX_GLXEXT_VERSION 33 + +#ifndef GLX_VERSION_1_3 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_RGBA_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_DONT_CARE 0xFFFFFFFF +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 +#endif + +#ifndef GLX_VERSION_1_4 +#define GLX_SAMPLE_BUFFERS 100000 +#define GLX_SAMPLES 100001 +#endif + +#ifndef GLX_ARB_get_proc_address +#endif + +#ifndef GLX_ARB_multisample +#define GLX_SAMPLE_BUFFERS_ARB 100000 +#define GLX_SAMPLES_ARB 100001 +#endif + +#ifndef GLX_ARB_vertex_buffer_object +#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095 +#endif + +#ifndef GLX_ARB_fbconfig_float +#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9 +#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 +#endif + +#ifndef GLX_ARB_framebuffer_sRGB +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2 +#endif + +#ifndef GLX_ARB_create_context +#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001 +#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 +#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define GLX_CONTEXT_FLAGS_ARB 0x2094 +#endif + +#ifndef GLX_ARB_create_context_profile +#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 +#endif + +#ifndef GLX_ARB_create_context_robustness +#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 +#endif + +#ifndef GLX_SGIS_multisample +#define GLX_SAMPLE_BUFFERS_SGIS 100000 +#define GLX_SAMPLES_SGIS 100001 +#endif + +#ifndef GLX_EXT_visual_info +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 +#define GLX_NONE_EXT 0x8000 +#define GLX_TRUE_COLOR_EXT 0x8002 +#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_PSEUDO_COLOR_EXT 0x8004 +#define GLX_STATIC_COLOR_EXT 0x8005 +#define GLX_GRAY_SCALE_EXT 0x8006 +#define GLX_STATIC_GRAY_EXT 0x8007 +#define GLX_TRANSPARENT_RGB_EXT 0x8008 +#define GLX_TRANSPARENT_INDEX_EXT 0x8009 +#endif + +#ifndef GLX_SGI_swap_control +#endif + +#ifndef GLX_SGI_video_sync +#endif + +#ifndef GLX_SGI_make_current_read +#endif + +#ifndef GLX_SGIX_video_source +#endif + +#ifndef GLX_EXT_visual_rating +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#define GLX_SLOW_VISUAL_EXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D +/* reuse GLX_NONE_EXT */ +#endif + +#ifndef GLX_EXT_import_context +#define GLX_SHARE_CONTEXT_EXT 0x800A +#define GLX_VISUAL_ID_EXT 0x800B +#define GLX_SCREEN_EXT 0x800C +#endif + +#ifndef GLX_SGIX_fbconfig +#define GLX_WINDOW_BIT_SGIX 0x00000001 +#define GLX_PIXMAP_BIT_SGIX 0x00000002 +#define GLX_RGBA_BIT_SGIX 0x00000001 +#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 +#define GLX_DRAWABLE_TYPE_SGIX 0x8010 +#define GLX_RENDER_TYPE_SGIX 0x8011 +#define GLX_X_RENDERABLE_SGIX 0x8012 +#define GLX_FBCONFIG_ID_SGIX 0x8013 +#define GLX_RGBA_TYPE_SGIX 0x8014 +#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 +/* reuse GLX_SCREEN_EXT */ +#endif + +#ifndef GLX_SGIX_pbuffer +#define GLX_PBUFFER_BIT_SGIX 0x00000004 +#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 +#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 +#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 +#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 +#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 +#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 +#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 +#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 +#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 +#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 +#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A +#define GLX_PRESERVED_CONTENTS_SGIX 0x801B +#define GLX_LARGEST_PBUFFER_SGIX 0x801C +#define GLX_WIDTH_SGIX 0x801D +#define GLX_HEIGHT_SGIX 0x801E +#define GLX_EVENT_MASK_SGIX 0x801F +#define GLX_DAMAGED_SGIX 0x8020 +#define GLX_SAVED_SGIX 0x8021 +#define GLX_WINDOW_SGIX 0x8022 +#define GLX_PBUFFER_SGIX 0x8023 +#endif + +#ifndef GLX_SGI_cushion +#endif + +#ifndef GLX_SGIX_video_resize +#define GLX_SYNC_FRAME_SGIX 0x00000000 +#define GLX_SYNC_SWAP_SGIX 0x00000001 +#endif + +#ifndef GLX_SGIX_dmbuffer +#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024 +#endif + +#ifndef GLX_SGIX_swap_group +#endif + +#ifndef GLX_SGIX_swap_barrier +#endif + +#ifndef GLX_SGIS_blended_overlay +#define GLX_BLENDED_RGBA_SGIS 0x8025 +#endif + +#ifndef GLX_SGIS_shared_multisample +#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 +#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 +#endif + +#ifndef GLX_SUN_get_transparent_index +#endif + +#ifndef GLX_3DFX_multisample +#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 +#define GLX_SAMPLES_3DFX 0x8051 +#endif + +#ifndef GLX_MESA_copy_sub_buffer +#endif + +#ifndef GLX_MESA_pixmap_colormap +#endif + +#ifndef GLX_MESA_release_buffers +#endif + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_3DFX_WINDOW_MODE_MESA 0x1 +#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 +#endif + +#ifndef GLX_SGIX_visual_select_group +#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 +#endif + +#ifndef GLX_OML_swap_method +#define GLX_SWAP_METHOD_OML 0x8060 +#define GLX_SWAP_EXCHANGE_OML 0x8061 +#define GLX_SWAP_COPY_OML 0x8062 +#define GLX_SWAP_UNDEFINED_OML 0x8063 +#endif + +#ifndef GLX_OML_sync_control +#endif + +#ifndef GLX_NV_float_buffer +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 +#endif + +#ifndef GLX_SGIX_hyperpipe +#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 +#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 +#define GLX_BAD_HYPERPIPE_SGIX 92 +#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 +#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 +#define GLX_PIPE_RECT_SGIX 0x00000001 +#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 +#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 +#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 +#define GLX_HYPERPIPE_ID_SGIX 0x8030 +#endif + +#ifndef GLX_MESA_agp_offset +#endif + +#ifndef GLX_EXT_fbconfig_packed_float +#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 +#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 +#endif + +#ifndef GLX_EXT_framebuffer_sRGB +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 +#endif + +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 +#define GLX_TEXTURE_FORMAT_EXT 0x20D5 +#define GLX_TEXTURE_TARGET_EXT 0x20D6 +#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 +#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 +#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 +#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA +#define GLX_TEXTURE_1D_EXT 0x20DB +#define GLX_TEXTURE_2D_EXT 0x20DC +#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD +#define GLX_FRONT_LEFT_EXT 0x20DE +#define GLX_FRONT_RIGHT_EXT 0x20DF +#define GLX_BACK_LEFT_EXT 0x20E0 +#define GLX_BACK_RIGHT_EXT 0x20E1 +#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT +#define GLX_BACK_EXT GLX_BACK_LEFT_EXT +#define GLX_AUX0_EXT 0x20E2 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX6_EXT 0x20E8 +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX9_EXT 0x20EB +#endif + +#ifndef GLX_NV_present_video +#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0 +#endif + +#ifndef GLX_NV_video_out +#define GLX_VIDEO_OUT_COLOR_NV 0x20C3 +#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 +#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5 +#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define GLX_VIDEO_OUT_FRAME_NV 0x20C8 +#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 +#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA +#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB +#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC +#endif + +#ifndef GLX_NV_swap_group +#endif + +#ifndef GLX_NV_video_capture +#define GLX_DEVICE_ID_NV 0x20CD +#define GLX_UNIQUE_ID_NV 0x20CE +#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF +#endif + +#ifndef GLX_EXT_swap_control +#define GLX_SWAP_INTERVAL_EXT 0x20F1 +#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 +#endif + +#ifndef GLX_NV_copy_image +#endif + +#ifndef GLX_INTEL_swap_event +#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000 +#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180 +#define GLX_COPY_COMPLETE_INTEL 0x8181 +#define GLX_FLIP_COMPLETE_INTEL 0x8182 +#endif + +#ifndef GLX_NV_multisample_coverage +#define GLX_COVERAGE_SAMPLES_NV 100001 +#define GLX_COLOR_SAMPLES_NV 0x20B3 +#endif + +#ifndef GLX_AMD_gpu_association +#define GLX_GPU_VENDOR_AMD 0x1F00 +#define GLX_GPU_RENDERER_STRING_AMD 0x1F01 +#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define GLX_GPU_RAM_AMD 0x21A3 +#define GLX_GPU_CLOCK_AMD 0x21A4 +#define GLX_GPU_NUM_PIPES_AMD 0x21A5 +#define GLX_GPU_NUM_SIMD_AMD 0x21A6 +#define GLX_GPU_NUM_RB_AMD 0x21A7 +#define GLX_GPU_NUM_SPI_AMD 0x21A8 +#endif + +#ifndef GLX_EXT_create_context_es2_profile +#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 +#endif + +#ifndef GLX_EXT_swap_control_tear +#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3 +#endif + +#ifndef GLX_EXT_buffer_age +#define GLX_BACK_BUFFER_AGE_EXT 0x20F4 +#endif + + +/*************************************************************/ + +#ifndef GLX_ARB_get_proc_address +typedef void (*__GLXextFuncPtr)(void); +#endif + +#ifndef GLX_SGIX_video_source +typedef XID GLXVideoSourceSGIX; +#endif + +#ifndef GLX_SGIX_fbconfig +typedef XID GLXFBConfigIDSGIX; +typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; +#endif + +#ifndef GLX_SGIX_pbuffer +typedef XID GLXPbufferSGIX; +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came for SendEvent request */ + Display *display; /* display the event was read from */ + GLXDrawable drawable; /* i.d. of Drawable */ + int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */ + int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */ + unsigned int mask; /* mask indicating which buffers are affected*/ + int x, y; + int width, height; + int count; /* if nonzero, at least this many more */ +} GLXBufferClobberEventSGIX; +#endif + +#ifndef GLX_NV_video_output +typedef unsigned int GLXVideoDeviceNV; +#endif + +#ifndef GLX_NV_video_capture +typedef XID GLXVideoCaptureDeviceNV; +#endif + +#ifndef GLEXT_64_TYPES_DEFINED +/* This code block is duplicated in glext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GLX_OML_sync_control extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(__sun__) || defined(__digital__) +#include +#if defined(__STDC__) +#if defined(__arch64__) || defined(_LP64) +typedef long int int64_t; +typedef unsigned long int uint64_t; +#else +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#endif /* __arch64__ */ +#endif /* __STDC__ */ +#elif defined( __VMS ) || defined(__sgi) +#include +#elif defined(__SCO__) || defined(__USLC__) +#include +#elif defined(__UNIXOS2__) || defined(__SOL64__) +typedef long int int32_t; +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#elif defined(_WIN32) && defined(__GNUC__) +#include +#elif defined(_WIN32) +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +#include /* Fallback option */ +#endif +#endif + +#ifndef GLX_VERSION_1_3 +#define GLX_VERSION_1_3 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXFBConfig * glXGetFBConfigs (Display *dpy, int screen, int *nelements); +extern GLXFBConfig * glXChooseFBConfig (Display *dpy, int screen, const int *attrib_list, int *nelements); +extern int glXGetFBConfigAttrib (Display *dpy, GLXFBConfig config, int attribute, int *value); +extern XVisualInfo * glXGetVisualFromFBConfig (Display *dpy, GLXFBConfig config); +extern GLXWindow glXCreateWindow (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); +extern void glXDestroyWindow (Display *dpy, GLXWindow win); +extern GLXPixmap glXCreatePixmap (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); +extern void glXDestroyPixmap (Display *dpy, GLXPixmap pixmap); +extern GLXPbuffer glXCreatePbuffer (Display *dpy, GLXFBConfig config, const int *attrib_list); +extern void glXDestroyPbuffer (Display *dpy, GLXPbuffer pbuf); +extern void glXQueryDrawable (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); +extern GLXContext glXCreateNewContext (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +extern Bool glXMakeContextCurrent (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +extern GLXDrawable glXGetCurrentReadDrawable (void); +extern Display * glXGetCurrentDisplay (void); +extern int glXQueryContext (Display *dpy, GLXContext ctx, int attribute, int *value); +extern void glXSelectEvent (Display *dpy, GLXDrawable draw, unsigned long event_mask); +extern void glXGetSelectedEvent (Display *dpy, GLXDrawable draw, unsigned long *event_mask); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); +typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); +typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); +typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); +typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); +typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); +typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); +typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void); +typedef Display * ( * PFNGLXGETCURRENTDISPLAYPROC) (void); +typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); +typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); +typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); +#endif + +#ifndef GLX_VERSION_1_4 +#define GLX_VERSION_1_4 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *procName); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName); +#endif + +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName); +#endif + +#ifndef GLX_ARB_multisample +#define GLX_ARB_multisample 1 +#endif + +#ifndef GLX_ARB_fbconfig_float +#define GLX_ARB_fbconfig_float 1 +#endif + +#ifndef GLX_ARB_framebuffer_sRGB +#define GLX_ARB_framebuffer_sRGB 1 +#endif + +#ifndef GLX_ARB_create_context +#define GLX_ARB_create_context 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXContext glXCreateContextAttribsARB (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); +#endif + +#ifndef GLX_ARB_create_context_profile +#define GLX_ARB_create_context_profile 1 +#endif + +#ifndef GLX_ARB_create_context_robustness +#define GLX_ARB_create_context_robustness 1 +#endif + +#ifndef GLX_SGIS_multisample +#define GLX_SGIS_multisample 1 +#endif + +#ifndef GLX_EXT_visual_info +#define GLX_EXT_visual_info 1 +#endif + +#ifndef GLX_SGI_swap_control +#define GLX_SGI_swap_control 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXSwapIntervalSGI (int interval); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); +#endif + +#ifndef GLX_SGI_video_sync +#define GLX_SGI_video_sync 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXGetVideoSyncSGI (unsigned int *count); +extern int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int *count); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count); +typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count); +#endif + +#ifndef GLX_SGI_make_current_read +#define GLX_SGI_make_current_read 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXMakeCurrentReadSGI (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +extern GLXDrawable glXGetCurrentReadDrawableSGI (void); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); +#endif + +#ifndef GLX_SGIX_video_source +#define GLX_SGIX_video_source 1 +#ifdef _VL_H +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode); +extern void glXDestroyGLXVideoSourceSGIX (Display *dpy, GLXVideoSourceSGIX glxvideosource); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode); +typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource); +#endif /* _VL_H */ +#endif + +#ifndef GLX_EXT_visual_rating +#define GLX_EXT_visual_rating 1 +#endif + +#ifndef GLX_EXT_import_context +#define GLX_EXT_import_context 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Display * glXGetCurrentDisplayEXT (void); +extern int glXQueryContextInfoEXT (Display *dpy, GLXContext context, int attribute, int *value); +extern GLXContextID glXGetContextIDEXT (const GLXContext context); +extern GLXContext glXImportContextEXT (Display *dpy, GLXContextID contextID); +extern void glXFreeContextEXT (Display *dpy, GLXContext context); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void); +typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value); +typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); +typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID); +typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context); +#endif + +#ifndef GLX_SGIX_fbconfig +#define GLX_SGIX_fbconfig 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXGetFBConfigAttribSGIX (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value); +extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *dpy, int screen, int *attrib_list, int *nelements); +extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap); +extern GLXContext glXCreateContextWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct); +extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *dpy, GLXFBConfigSGIX config); +extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *dpy, XVisualInfo *vis); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value); +typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements); +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap); +typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct); +typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config); +typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis); +#endif + +#ifndef GLX_SGIX_pbuffer +#define GLX_SGIX_pbuffer 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list); +extern void glXDestroyGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf); +extern int glXQueryGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value); +extern void glXSelectEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long mask); +extern void glXGetSelectedEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long *mask); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list); +typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf); +typedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask); +typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask); +#endif + +#ifndef GLX_SGI_cushion +#define GLX_SGI_cushion 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXCushionSGI (Display *dpy, Window window, float cushion); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion); +#endif + +#ifndef GLX_SGIX_video_resize +#define GLX_SGIX_video_resize 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXBindChannelToWindowSGIX (Display *display, int screen, int channel, Window window); +extern int glXChannelRectSGIX (Display *display, int screen, int channel, int x, int y, int w, int h); +extern int glXQueryChannelRectSGIX (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); +extern int glXQueryChannelDeltasSGIX (Display *display, int screen, int channel, int *x, int *y, int *w, int *h); +extern int glXChannelRectSyncSGIX (Display *display, int screen, int channel, GLenum synctype); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window); +typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h); +typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); +typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h); +typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype); +#endif + +#ifndef GLX_SGIX_dmbuffer +#define GLX_SGIX_dmbuffer 1 +#ifdef _DM_BUFFER_H_ +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXAssociateDMPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer); +#endif /* _DM_BUFFER_H_ */ +#endif + +#ifndef GLX_SGIX_swap_group +#define GLX_SGIX_swap_group 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXJoinSwapGroupSGIX (Display *dpy, GLXDrawable drawable, GLXDrawable member); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); +#endif + +#ifndef GLX_SGIX_swap_barrier +#define GLX_SGIX_swap_barrier 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXBindSwapBarrierSGIX (Display *dpy, GLXDrawable drawable, int barrier); +extern Bool glXQueryMaxSwapBarriersSGIX (Display *dpy, int screen, int *max); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier); +typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max); +#endif + +#ifndef GLX_SUN_get_transparent_index +#define GLX_SUN_get_transparent_index 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Status glXGetTransparentIndexSUN (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex); +#endif + +#ifndef GLX_MESA_copy_sub_buffer +#define GLX_MESA_copy_sub_buffer 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXCopySubBufferMESA (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height); +#endif + +#ifndef GLX_MESA_pixmap_colormap +#define GLX_MESA_pixmap_colormap 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXPixmap glXCreateGLXPixmapMESA (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); +#endif + +#ifndef GLX_MESA_release_buffers +#define GLX_MESA_release_buffers 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXReleaseBuffersMESA (Display *dpy, GLXDrawable drawable); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable); +#endif + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_MESA_set_3dfx_mode 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXSet3DfxModeMESA (int mode); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode); +#endif + +#ifndef GLX_SGIX_visual_select_group +#define GLX_SGIX_visual_select_group 1 +#endif + +#ifndef GLX_OML_swap_method +#define GLX_OML_swap_method 1 +#endif + +#ifndef GLX_OML_sync_control +#define GLX_OML_sync_control 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXGetSyncValuesOML (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc); +extern Bool glXGetMscRateOML (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator); +extern int64_t glXSwapBuffersMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); +extern Bool glXWaitForMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc); +extern Bool glXWaitForSbcOML (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc); +typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator); +typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); +typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc); +typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc); +#endif + +#ifndef GLX_NV_float_buffer +#define GLX_NV_float_buffer 1 +#endif + +#ifndef GLX_SGIX_hyperpipe +#define GLX_SGIX_hyperpipe 1 + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int networkId; +} GLXHyperpipeNetworkSGIX; + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int channel; + unsigned int + participationType; + int timeSlice; +} GLXHyperpipeConfigSGIX; + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int srcXOrigin, srcYOrigin, srcWidth, srcHeight; + int destXOrigin, destYOrigin, destWidth, destHeight; +} GLXPipeRect; + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int XOrigin, YOrigin, maxHeight, maxWidth; +} GLXPipeRectLimits; + +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *dpy, int *npipes); +extern int glXHyperpipeConfigSGIX (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId); +extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *dpy, int hpId, int *npipes); +extern int glXDestroyHyperpipeConfigSGIX (Display *dpy, int hpId); +extern int glXBindHyperpipeSGIX (Display *dpy, int hpId); +extern int glXQueryHyperpipeBestAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList); +extern int glXHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList); +extern int glXQueryHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes); +typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId); +typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes); +typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList); +typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList); +typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList); +#endif + +#ifndef GLX_MESA_agp_offset +#define GLX_MESA_agp_offset 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern unsigned int glXGetAGPOffsetMESA (const void *pointer); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer); +#endif + +#ifndef GLX_EXT_fbconfig_packed_float +#define GLX_EXT_fbconfig_packed_float 1 +#endif + +#ifndef GLX_EXT_framebuffer_sRGB +#define GLX_EXT_framebuffer_sRGB 1 +#endif + +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_EXT_texture_from_pixmap 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXBindTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list); +extern void glXReleaseTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer); +#endif + +#ifndef GLX_NV_present_video +#define GLX_NV_present_video 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern unsigned int * glXEnumerateVideoDevicesNV (Display *dpy, int screen, int *nelements); +extern int glXBindVideoDeviceNV (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef unsigned int * ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements); +typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list); +#endif + +#ifndef GLX_NV_video_output +#define GLX_NV_video_output 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXGetVideoDeviceNV (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice); +extern int glXReleaseVideoDeviceNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice); +extern int glXBindVideoImageNV (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer); +extern int glXReleaseVideoImageNV (Display *dpy, GLXPbuffer pbuf); +extern int glXSendPbufferToVideoNV (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock); +extern int glXGetVideoInfoNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice); +typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice); +typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer); +typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display *dpy, GLXPbuffer pbuf); +typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock); +typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +#endif + +#ifndef GLX_NV_swap_group +#define GLX_NV_swap_group 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXJoinSwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint group); +extern Bool glXBindSwapBarrierNV (Display *dpy, GLuint group, GLuint barrier); +extern Bool glXQuerySwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier); +extern Bool glXQueryMaxSwapGroupsNV (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers); +extern Bool glXQueryFrameCountNV (Display *dpy, int screen, GLuint *count); +extern Bool glXResetFrameCountNV (Display *dpy, int screen); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint group); +typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display *dpy, GLuint group, GLuint barrier); +typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier); +typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers); +typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display *dpy, int screen, GLuint *count); +typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display *dpy, int screen); +#endif + +#ifndef GLX_NV_video_capture +#define GLX_NV_video_capture 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXBindVideoCaptureDeviceNV (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device); +extern GLXVideoCaptureDeviceNV * glXEnumerateVideoCaptureDevicesNV (Display *dpy, int screen, int *nelements); +extern void glXLockVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device); +extern int glXQueryVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value); +extern void glXReleaseVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device); +typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display *dpy, int screen, int *nelements); +typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device); +typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value); +typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device); +#endif + +#ifndef GLX_EXT_swap_control +#define GLX_EXT_swap_control 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXSwapIntervalEXT (Display *dpy, GLXDrawable drawable, int interval); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable, int interval); +#endif + +#ifndef GLX_NV_copy_image +#define GLX_NV_copy_image 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif + +#ifndef GLX_INTEL_swap_event +#define GLX_INTEL_swap_event 1 +#endif + +#ifndef GLX_NV_multisample_coverage +#define GLX_NV_multisample_coverage 1 +#endif + +#ifndef GLX_EXT_swap_control_tear +#define GLX_EXT_swap_control_tear 1 +#endif + +#ifndef GLX_EXT_buffer_age +#define GLX_EXT_buffer_age 1 +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/nel/src/3d/driver/OpenGL3/GL/wglext.h b/code/nel/src/3d/driver/OpenGL3/GL/wglext.h new file mode 100644 index 000000000..b5dc7bf7f --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/GL/wglext.h @@ -0,0 +1,943 @@ +#ifndef __wglext_h_ +#define __wglext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2007-2012 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Function declaration macros - to move into glplatform.h */ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +/*************************************************************/ + +/* Header file version number */ +/* wglext.h last updated 2012/01/04 */ +/* Current version at http://www.opengl.org/registry/ */ +#define WGL_WGLEXT_VERSION 24 + +#ifndef WGL_ARB_buffer_region +#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 +#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 +#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 +#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 +#endif + +#ifndef WGL_ARB_multisample +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 +#endif + +#ifndef WGL_ARB_extensions_string +#endif + +#ifndef WGL_ARB_pixel_format +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NEED_PALETTE_ARB 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 +#define WGL_TRANSPARENT_ARB 0x200A +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B +#define WGL_SHARE_DEPTH_ARB 0x200C +#define WGL_SHARE_STENCIL_ARB 0x200D +#define WGL_SHARE_ACCUM_ARB 0x200E +#define WGL_SUPPORT_GDI_ARB 0x200F +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_STEREO_ARB 0x2012 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201A +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_ALPHA_SHIFT_ARB 0x201C +#define WGL_ACCUM_BITS_ARB 0x201D +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_SWAP_EXCHANGE_ARB 0x2028 +#define WGL_SWAP_COPY_ARB 0x2029 +#define WGL_SWAP_UNDEFINED_ARB 0x202A +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C +#endif + +#ifndef WGL_ARB_make_current_read +#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 +#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 +#endif + +#ifndef WGL_ARB_pbuffer +#define WGL_DRAW_TO_PBUFFER_ARB 0x202D +#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E +#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 +#define WGL_PBUFFER_LARGEST_ARB 0x2033 +#define WGL_PBUFFER_WIDTH_ARB 0x2034 +#define WGL_PBUFFER_HEIGHT_ARB 0x2035 +#define WGL_PBUFFER_LOST_ARB 0x2036 +#endif + +#ifndef WGL_ARB_render_texture +#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 +#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 +#define WGL_TEXTURE_FORMAT_ARB 0x2072 +#define WGL_TEXTURE_TARGET_ARB 0x2073 +#define WGL_MIPMAP_TEXTURE_ARB 0x2074 +#define WGL_TEXTURE_RGB_ARB 0x2075 +#define WGL_TEXTURE_RGBA_ARB 0x2076 +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 +#define WGL_TEXTURE_1D_ARB 0x2079 +#define WGL_TEXTURE_2D_ARB 0x207A +#define WGL_MIPMAP_LEVEL_ARB 0x207B +#define WGL_CUBE_MAP_FACE_ARB 0x207C +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 +#define WGL_FRONT_LEFT_ARB 0x2083 +#define WGL_FRONT_RIGHT_ARB 0x2084 +#define WGL_BACK_LEFT_ARB 0x2085 +#define WGL_BACK_RIGHT_ARB 0x2086 +#define WGL_AUX0_ARB 0x2087 +#define WGL_AUX1_ARB 0x2088 +#define WGL_AUX2_ARB 0x2089 +#define WGL_AUX3_ARB 0x208A +#define WGL_AUX4_ARB 0x208B +#define WGL_AUX5_ARB 0x208C +#define WGL_AUX6_ARB 0x208D +#define WGL_AUX7_ARB 0x208E +#define WGL_AUX8_ARB 0x208F +#define WGL_AUX9_ARB 0x2090 +#endif + +#ifndef WGL_ARB_pixel_format_float +#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 +#endif + +#ifndef WGL_ARB_framebuffer_sRGB +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 +#endif + +#ifndef WGL_ARB_create_context +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define ERROR_INVALID_VERSION_ARB 0x2095 +#endif + +#ifndef WGL_ARB_create_context_profile +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define ERROR_INVALID_PROFILE_ARB 0x2096 +#endif + +#ifndef WGL_ARB_create_context_robustness +#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 +#endif + +#ifndef WGL_EXT_make_current_read +#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 +#endif + +#ifndef WGL_EXT_pixel_format +#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 +#define WGL_DRAW_TO_WINDOW_EXT 0x2001 +#define WGL_DRAW_TO_BITMAP_EXT 0x2002 +#define WGL_ACCELERATION_EXT 0x2003 +#define WGL_NEED_PALETTE_EXT 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 +#define WGL_SWAP_METHOD_EXT 0x2007 +#define WGL_NUMBER_OVERLAYS_EXT 0x2008 +#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 +#define WGL_TRANSPARENT_EXT 0x200A +#define WGL_TRANSPARENT_VALUE_EXT 0x200B +#define WGL_SHARE_DEPTH_EXT 0x200C +#define WGL_SHARE_STENCIL_EXT 0x200D +#define WGL_SHARE_ACCUM_EXT 0x200E +#define WGL_SUPPORT_GDI_EXT 0x200F +#define WGL_SUPPORT_OPENGL_EXT 0x2010 +#define WGL_DOUBLE_BUFFER_EXT 0x2011 +#define WGL_STEREO_EXT 0x2012 +#define WGL_PIXEL_TYPE_EXT 0x2013 +#define WGL_COLOR_BITS_EXT 0x2014 +#define WGL_RED_BITS_EXT 0x2015 +#define WGL_RED_SHIFT_EXT 0x2016 +#define WGL_GREEN_BITS_EXT 0x2017 +#define WGL_GREEN_SHIFT_EXT 0x2018 +#define WGL_BLUE_BITS_EXT 0x2019 +#define WGL_BLUE_SHIFT_EXT 0x201A +#define WGL_ALPHA_BITS_EXT 0x201B +#define WGL_ALPHA_SHIFT_EXT 0x201C +#define WGL_ACCUM_BITS_EXT 0x201D +#define WGL_ACCUM_RED_BITS_EXT 0x201E +#define WGL_ACCUM_GREEN_BITS_EXT 0x201F +#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 +#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 +#define WGL_DEPTH_BITS_EXT 0x2022 +#define WGL_STENCIL_BITS_EXT 0x2023 +#define WGL_AUX_BUFFERS_EXT 0x2024 +#define WGL_NO_ACCELERATION_EXT 0x2025 +#define WGL_GENERIC_ACCELERATION_EXT 0x2026 +#define WGL_FULL_ACCELERATION_EXT 0x2027 +#define WGL_SWAP_EXCHANGE_EXT 0x2028 +#define WGL_SWAP_COPY_EXT 0x2029 +#define WGL_SWAP_UNDEFINED_EXT 0x202A +#define WGL_TYPE_RGBA_EXT 0x202B +#define WGL_TYPE_COLORINDEX_EXT 0x202C +#endif + +#ifndef WGL_EXT_pbuffer +#define WGL_DRAW_TO_PBUFFER_EXT 0x202D +#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E +#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 +#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 +#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 +#define WGL_PBUFFER_LARGEST_EXT 0x2033 +#define WGL_PBUFFER_WIDTH_EXT 0x2034 +#define WGL_PBUFFER_HEIGHT_EXT 0x2035 +#endif + +#ifndef WGL_EXT_depth_float +#define WGL_DEPTH_FLOAT_EXT 0x2040 +#endif + +#ifndef WGL_3DFX_multisample +#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 +#define WGL_SAMPLES_3DFX 0x2061 +#endif + +#ifndef WGL_EXT_multisample +#define WGL_SAMPLE_BUFFERS_EXT 0x2041 +#define WGL_SAMPLES_EXT 0x2042 +#endif + +#ifndef WGL_I3D_digital_video_control +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 +#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 +#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 +#endif + +#ifndef WGL_I3D_gamma +#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E +#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F +#endif + +#ifndef WGL_I3D_genlock +#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 +#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045 +#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046 +#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047 +#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 +#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 +#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A +#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B +#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C +#endif + +#ifndef WGL_I3D_image_buffer +#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 +#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 +#endif + +#ifndef WGL_I3D_swap_frame_lock +#endif + +#ifndef WGL_NV_render_depth_texture +#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 +#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 +#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 +#define WGL_DEPTH_COMPONENT_NV 0x20A7 +#endif + +#ifndef WGL_NV_render_texture_rectangle +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 +#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 +#endif + +#ifndef WGL_ATI_pixel_format_float +#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 +#endif + +#ifndef WGL_NV_float_buffer +#define WGL_FLOAT_COMPONENTS_NV 0x20B0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 +#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 +#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 +#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 +#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 +#endif + +#ifndef WGL_3DL_stereo_control +#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 +#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 +#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 +#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 +#endif + +#ifndef WGL_EXT_pixel_format_packed_float +#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 +#endif + +#ifndef WGL_EXT_framebuffer_sRGB +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 +#endif + +#ifndef WGL_NV_present_video +#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 +#endif + +#ifndef WGL_NV_video_out +#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 +#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 +#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 +#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 +#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 +#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 +#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define WGL_VIDEO_OUT_FRAME 0x20C8 +#define WGL_VIDEO_OUT_FIELD_1 0x20C9 +#define WGL_VIDEO_OUT_FIELD_2 0x20CA +#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB +#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC +#endif + +#ifndef WGL_NV_swap_group +#endif + +#ifndef WGL_NV_gpu_affinity +#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 +#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 +#endif + +#ifndef WGL_AMD_gpu_association +#define WGL_GPU_VENDOR_AMD 0x1F00 +#define WGL_GPU_RENDERER_STRING_AMD 0x1F01 +#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define WGL_GPU_RAM_AMD 0x21A3 +#define WGL_GPU_CLOCK_AMD 0x21A4 +#define WGL_GPU_NUM_PIPES_AMD 0x21A5 +#define WGL_GPU_NUM_SIMD_AMD 0x21A6 +#define WGL_GPU_NUM_RB_AMD 0x21A7 +#define WGL_GPU_NUM_SPI_AMD 0x21A8 +#endif + +#ifndef WGL_NV_video_capture +#define WGL_UNIQUE_ID_NV 0x20CE +#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF +#endif + +#ifndef WGL_NV_copy_image +#endif + +#ifndef WGL_NV_multisample_coverage +#define WGL_COVERAGE_SAMPLES_NV 0x2042 +#define WGL_COLOR_SAMPLES_NV 0x20B9 +#endif + +#ifndef WGL_EXT_create_context_es2_profile +#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 +#endif + +#ifndef WGL_NV_DX_interop +#define WGL_ACCESS_READ_ONLY_NV 0x00000000 +#define WGL_ACCESS_READ_WRITE_NV 0x00000001 +#define WGL_ACCESS_WRITE_DISCARD_NV 0x00000002 +#endif + +#ifndef WGL_NV_DX_interop2 +#endif + +#ifndef WGL_EXT_swap_control_tear +#endif + + +/*************************************************************/ + +#ifndef WGL_ARB_pbuffer +DECLARE_HANDLE(HPBUFFERARB); +#endif +#ifndef WGL_EXT_pbuffer +DECLARE_HANDLE(HPBUFFEREXT); +#endif +#ifndef WGL_NV_present_video +DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); +#endif +#ifndef WGL_NV_video_output +DECLARE_HANDLE(HPVIDEODEV); +#endif +#ifndef WGL_NV_gpu_affinity +DECLARE_HANDLE(HPGPUNV); +DECLARE_HANDLE(HGPUNV); + +typedef struct _GPU_DEVICE { + DWORD cb; + CHAR DeviceName[32]; + CHAR DeviceString[128]; + DWORD Flags; + RECT rcVirtualScreen; +} GPU_DEVICE, *PGPU_DEVICE; +#endif +#ifndef WGL_NV_video_capture +DECLARE_HANDLE(HVIDEOINPUTDEVICENV); +#endif + +#ifndef WGL_ARB_buffer_region +#define WGL_ARB_buffer_region 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType); +extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion); +extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height); +extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); +typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); +typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); +typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +#endif + +#ifndef WGL_ARB_multisample +#define WGL_ARB_multisample 1 +#endif + +#ifndef WGL_ARB_extensions_string +#define WGL_ARB_extensions_string 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern const char * WINAPI wglGetExtensionsStringARB (HDC hdc); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); +#endif + +#ifndef WGL_ARB_pixel_format +#define WGL_ARB_pixel_format 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues); +extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues); +extern BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +#endif + +#ifndef WGL_ARB_make_current_read +#define WGL_ARB_make_current_read 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +extern HDC WINAPI wglGetCurrentReadDCARB (void); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void); +#endif + +#ifndef WGL_ARB_pbuffer +#define WGL_ARB_pbuffer 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); +extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer); +extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC); +extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer); +extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue); +#endif + +#ifndef WGL_ARB_render_texture +#define WGL_ARB_render_texture 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer); +extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer); +extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList); +#endif + +#ifndef WGL_ARB_pixel_format_float +#define WGL_ARB_pixel_format_float 1 +#endif + +#ifndef WGL_ARB_framebuffer_sRGB +#define WGL_ARB_framebuffer_sRGB 1 +#endif + +#ifndef WGL_ARB_create_context +#define WGL_ARB_create_context 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList); +#endif + +#ifndef WGL_ARB_create_context_profile +#define WGL_ARB_create_context_profile 1 +#endif + +#ifndef WGL_ARB_create_context_robustness +#define WGL_ARB_create_context_robustness 1 +#endif + +#ifndef WGL_EXT_display_color_table +#define WGL_EXT_display_color_table 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id); +extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length); +extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id); +extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length); +typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); +#endif + +#ifndef WGL_EXT_extensions_string +#define WGL_EXT_extensions_string 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern const char * WINAPI wglGetExtensionsStringEXT (void); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); +#endif + +#ifndef WGL_EXT_make_current_read +#define WGL_EXT_make_current_read 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +extern HDC WINAPI wglGetCurrentReadDCEXT (void); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void); +#endif + +#ifndef WGL_EXT_pbuffer +#define WGL_EXT_pbuffer 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); +extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer); +extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC); +extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer); +extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue); +#endif + +#ifndef WGL_EXT_pixel_format +#define WGL_EXT_pixel_format 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues); +extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues); +extern BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +#endif + +#ifndef WGL_EXT_swap_control +#define WGL_EXT_swap_control 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglSwapIntervalEXT (int interval); +extern int WINAPI wglGetSwapIntervalEXT (void); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); +typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); +#endif + +#ifndef WGL_EXT_depth_float +#define WGL_EXT_depth_float 1 +#endif + +#ifndef WGL_NV_vertex_array_range +#define WGL_NV_vertex_array_range 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern void* WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +extern void WINAPI wglFreeMemoryNV (void *pointer); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); +#endif + +#ifndef WGL_3DFX_multisample +#define WGL_3DFX_multisample 1 +#endif + +#ifndef WGL_EXT_multisample +#define WGL_EXT_multisample 1 +#endif + +#ifndef WGL_OML_sync_control +#define WGL_OML_sync_control 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc); +extern BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator); +extern INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +extern BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc); +extern BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc); +typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator); +typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc); +typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc); +#endif + +#ifndef WGL_I3D_digital_video_control +#define WGL_I3D_digital_video_control 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue); +extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue); +typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue); +#endif + +#ifndef WGL_I3D_gamma +#define WGL_I3D_gamma 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue); +extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue); +extern BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue); +extern BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue); +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue); +#endif + +#ifndef WGL_I3D_genlock +#define WGL_I3D_genlock 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglEnableGenlockI3D (HDC hDC); +extern BOOL WINAPI wglDisableGenlockI3D (HDC hDC); +extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag); +extern BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource); +extern BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource); +extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge); +extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge); +extern BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate); +extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate); +extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay); +extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay); +extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge); +typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay); +typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay); +#endif + +#ifndef WGL_I3D_image_buffer +#define WGL_I3D_image_buffer 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags); +extern BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress); +extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count); +extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); +typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); +typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count); +typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count); +#endif + +#ifndef WGL_I3D_swap_frame_lock +#define WGL_I3D_swap_frame_lock 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglEnableFrameLockI3D (void); +extern BOOL WINAPI wglDisableFrameLockI3D (void); +extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag); +extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag); +#endif + +#ifndef WGL_I3D_swap_frame_usage +#define WGL_I3D_swap_frame_usage 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetFrameUsageI3D (float *pUsage); +extern BOOL WINAPI wglBeginFrameTrackingI3D (void); +extern BOOL WINAPI wglEndFrameTrackingI3D (void); +extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage); +typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); +#endif + +#ifndef WGL_ATI_pixel_format_float +#define WGL_ATI_pixel_format_float 1 +#endif + +#ifndef WGL_NV_float_buffer +#define WGL_NV_float_buffer 1 +#endif + +#ifndef WGL_3DL_stereo_control +#define WGL_3DL_stereo_control 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); +#endif + +#ifndef WGL_EXT_pixel_format_packed_float +#define WGL_EXT_pixel_format_packed_float 1 +#endif + +#ifndef WGL_EXT_framebuffer_sRGB +#define WGL_EXT_framebuffer_sRGB 1 +#endif + +#ifndef WGL_NV_present_video +#define WGL_NV_present_video 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern int WINAPI wglEnumerateVideoDevicesNV (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList); +extern BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList); +extern BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList); +typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList); +typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue); +#endif + +#ifndef WGL_NV_video_output +#define WGL_NV_video_output 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice); +extern BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice); +extern BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); +extern BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer); +extern BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock); +extern BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); +typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock); +typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +#endif + +#ifndef WGL_NV_swap_group +#define WGL_NV_swap_group 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group); +extern BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier); +extern BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier); +extern BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers); +extern BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count); +extern BOOL WINAPI wglResetFrameCountNV (HDC hDC); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); +typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); +typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier); +typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count); +typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); +#endif + +#ifndef WGL_NV_gpu_affinity +#define WGL_NV_gpu_affinity 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu); +extern BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); +extern HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList); +extern BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); +extern BOOL WINAPI wglDeleteDCNV (HDC hdc); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); +typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); +typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); +typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); +typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc); +#endif + +#ifndef WGL_AMD_gpu_association +#define WGL_AMD_gpu_association 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids); +extern INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data); +extern UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc); +extern HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id); +extern HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList); +extern BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc); +extern BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc); +extern HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void); +extern VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids); +typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data); +typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList); +typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); +typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); +typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif + +#ifndef WGL_NV_video_capture +#define WGL_NV_video_capture 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +extern UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList); +extern BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +extern BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue); +extern BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList); +typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +#endif + +#ifndef WGL_NV_copy_image +#define WGL_NV_copy_image 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif + +#ifndef WGL_NV_multisample_coverage +#define WGL_NV_multisample_coverage 1 +#endif + +#ifndef WGL_NV_DX_interop +#define WGL_NV_DX_interop 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglDXSetResourceShareHandleNV (void *dxObject, HANDLE shareHandle); +extern HANDLE WINAPI wglDXOpenDeviceNV (void *dxDevice); +extern BOOL WINAPI wglDXCloseDeviceNV (HANDLE hDevice); +extern HANDLE WINAPI wglDXRegisterObjectNV (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access); +extern BOOL WINAPI wglDXUnregisterObjectNV (HANDLE hDevice, HANDLE hObject); +extern BOOL WINAPI wglDXObjectAccessNV (HANDLE hObject, GLenum access); +extern BOOL WINAPI wglDXLockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects); +extern BOOL WINAPI wglDXUnlockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void *dxObject, HANDLE shareHandle); +typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void *dxDevice); +typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice); +typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access); +typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject); +typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access); +typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects); +typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects); +#endif + +#ifndef WGL_NV_DX_interop2 +#define WGL_NV_DX_interop2 1 +#endif + +#ifndef WGL_EXT_swap_control_tear +#define WGL_EXT_swap_control_tear 1 +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/nel/src/3d/driver/OpenGL3/GLES/egl.h b/code/nel/src/3d/driver/OpenGL3/GLES/egl.h new file mode 100644 index 000000000..5778e0050 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/GLES/egl.h @@ -0,0 +1,15 @@ +/* + * Skeleton egl.h to provide compatibility for early GLES 1.0 + * applications. Several early implementations included gl.h + * in egl.h leading applications to include only egl.h + * + * $Revision: 6252 $ on $Date:: 2008-08-06 16:35:08 -0700 #$ + */ + +#ifndef __legacy_egl_h_ +#define __legacy_egl_h_ + +#include +#include + +#endif /* __legacy_egl_h_ */ diff --git a/code/nel/src/3d/driver/OpenGL3/GLES/gl.h b/code/nel/src/3d/driver/OpenGL3/GLES/gl.h new file mode 100644 index 000000000..5b8d85a92 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/GLES/gl.h @@ -0,0 +1,770 @@ +#ifndef __gl_h_ +#define __gl_h_ + +/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This document is licensed under the SGI Free Software B License Version + * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . + */ + +typedef void GLvoid; +typedef char GLchar; +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef khronos_int8_t GLbyte; +typedef short GLshort; +typedef int GLint; +typedef int GLsizei; +typedef khronos_uint8_t GLubyte; +typedef unsigned short GLushort; +typedef unsigned int GLuint; +typedef khronos_float_t GLfloat; +typedef khronos_float_t GLclampf; +typedef khronos_int32_t GLfixed; +typedef khronos_int32_t GLclampx; + +typedef khronos_intptr_t GLintptr; +typedef khronos_ssize_t GLsizeiptr; + + +/*************************************************************/ + +/* OpenGL ES core versions */ +#define GL_VERSION_ES_CM_1_0 1 +#define GL_VERSION_ES_CL_1_0 1 +#define GL_VERSION_ES_CM_1_1 1 +#define GL_VERSION_ES_CL_1_1 1 + +/* ClearBufferMask */ +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_COLOR_BUFFER_BIT 0x00004000 + +/* Boolean */ +#define GL_FALSE 0 +#define GL_TRUE 1 + +/* BeginMode */ +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 + +/* AlphaFunction */ +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 + +/* BlendingFactorDest */ +#define GL_ZERO 0 +#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 + +/* BlendingFactorSrc */ +/* GL_ZERO */ +/* GL_ONE */ +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +/* GL_SRC_ALPHA */ +/* GL_ONE_MINUS_SRC_ALPHA */ +/* GL_DST_ALPHA */ +/* GL_ONE_MINUS_DST_ALPHA */ + +/* ClipPlaneName */ +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 + +/* ColorMaterialFace */ +/* GL_FRONT_AND_BACK */ + +/* ColorMaterialParameter */ +/* GL_AMBIENT_AND_DIFFUSE */ + +/* ColorPointerType */ +/* GL_UNSIGNED_BYTE */ +/* GL_FLOAT */ +/* GL_FIXED */ + +/* CullFaceMode */ +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_FRONT_AND_BACK 0x0408 + +/* DepthFunction */ +/* GL_NEVER */ +/* GL_LESS */ +/* GL_EQUAL */ +/* GL_LEQUAL */ +/* GL_GREATER */ +/* GL_NOTEQUAL */ +/* GL_GEQUAL */ +/* GL_ALWAYS */ + +/* EnableCap */ +#define GL_FOG 0x0B60 +#define GL_LIGHTING 0x0B50 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_CULL_FACE 0x0B44 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_BLEND 0x0BE2 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_DITHER 0x0BD0 +#define GL_STENCIL_TEST 0x0B90 +#define GL_DEPTH_TEST 0x0B71 +/* GL_LIGHT0 */ +/* GL_LIGHT1 */ +/* GL_LIGHT2 */ +/* GL_LIGHT3 */ +/* GL_LIGHT4 */ +/* GL_LIGHT5 */ +/* GL_LIGHT6 */ +/* GL_LIGHT7 */ +#define GL_POINT_SMOOTH 0x0B10 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_NORMALIZE 0x0BA1 +#define GL_RESCALE_NORMAL 0x803A +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 + +/* ErrorCode */ +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 + +/* FogMode */ +/* GL_LINEAR */ +#define GL_EXP 0x0800 +#define GL_EXP2 0x0801 + +/* FogParameter */ +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 + +/* FrontFaceDirection */ +#define GL_CW 0x0900 +#define GL_CCW 0x0901 + +/* GetPName */ +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_LINE_WIDTH 0x0B21 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_SHADE_MODEL 0x0B54 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_VIEWPORT 0x0BA2 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB + +/* GetTextureParameter */ +/* GL_TEXTURE_MAG_FILTER */ +/* GL_TEXTURE_MIN_FILTER */ +/* GL_TEXTURE_WRAP_S */ +/* GL_TEXTURE_WRAP_T */ + +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 + +/* HintMode */ +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 + +/* HintTarget */ +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_FOG_HINT 0x0C54 +#define GL_GENERATE_MIPMAP_HINT 0x8192 + +/* LightModelParameter */ +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 + +/* LightParameter */ +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 + +/* DataType */ +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_FLOAT 0x1406 +#define GL_FIXED 0x140C + +/* LogicOp */ +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F + +/* MaterialFace */ +/* GL_FRONT_AND_BACK */ + +/* MaterialParameter */ +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +/* GL_AMBIENT */ +/* GL_DIFFUSE */ +/* GL_SPECULAR */ + +/* MatrixMode */ +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 + +/* NormalPointerType */ +/* GL_BYTE */ +/* GL_SHORT */ +/* GL_FLOAT */ +/* GL_FIXED */ + +/* PixelFormat */ +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A + +/* PixelStoreParameter */ +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_ALIGNMENT 0x0D05 + +/* PixelType */ +/* GL_UNSIGNED_BYTE */ +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 + +/* ShadingModel */ +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 + +/* StencilFunction */ +/* GL_NEVER */ +/* GL_LESS */ +/* GL_EQUAL */ +/* GL_LEQUAL */ +/* GL_GREATER */ +/* GL_NOTEQUAL */ +/* GL_GEQUAL */ +/* GL_ALWAYS */ + +/* StencilOp */ +/* GL_ZERO */ +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +/* GL_INVERT */ + +/* StringName */ +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 + +/* TexCoordPointerType */ +/* GL_SHORT */ +/* GL_FLOAT */ +/* GL_FIXED */ +/* GL_BYTE */ + +/* TextureEnvMode */ +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +/* GL_BLEND */ +#define GL_ADD 0x0104 +/* GL_REPLACE */ + +/* TextureEnvParameter */ +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 + +/* TextureEnvTarget */ +#define GL_TEXTURE_ENV 0x2300 + +/* TextureMagFilter */ +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 + +/* TextureMinFilter */ +/* GL_NEAREST */ +/* GL_LINEAR */ +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 + +/* TextureParameterName */ +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_GENERATE_MIPMAP 0x8191 + +/* TextureTarget */ +/* GL_TEXTURE_2D */ + +/* TextureUnit */ +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 + +/* TextureWrapMode */ +#define GL_REPEAT 0x2901 +#define GL_CLAMP_TO_EDGE 0x812F + +/* VertexPointerType */ +/* GL_SHORT */ +/* GL_FLOAT */ +/* GL_FIXED */ +/* GL_BYTE */ + +/* LightName */ +#define GL_LIGHT0 0x4000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 + +/* Buffer Objects */ +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 + +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A + +#define GL_STATIC_DRAW 0x88E4 +#define GL_DYNAMIC_DRAW 0x88E8 + +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 + +/* Texture combine + dot3 */ +#define GL_SUBTRACT 0x84E7 +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A + +#define GL_ALPHA_SCALE 0x0D1C + +#define GL_SRC0_RGB 0x8580 +#define GL_SRC1_RGB 0x8581 +#define GL_SRC2_RGB 0x8582 +#define GL_SRC0_ALPHA 0x8588 +#define GL_SRC1_ALPHA 0x8589 +#define GL_SRC2_ALPHA 0x858A + +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF + +/*------------------------------------------------------------------------* + * required OES extension tokens + *------------------------------------------------------------------------*/ + +/* OES_read_format */ +#ifndef GL_OES_read_format +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#endif + +/* GL_OES_compressed_paletted_texture */ +#ifndef GL_OES_compressed_paletted_texture +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 +#endif + +/* OES_point_size_array */ +#ifndef GL_OES_point_size_array +#define GL_POINT_SIZE_ARRAY_OES 0x8B9C +#define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A +#define GL_POINT_SIZE_ARRAY_STRIDE_OES 0x898B +#define GL_POINT_SIZE_ARRAY_POINTER_OES 0x898C +#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES 0x8B9F +#endif + +/* GL_OES_point_sprite */ +#ifndef GL_OES_point_sprite +#define GL_POINT_SPRITE_OES 0x8861 +#define GL_COORD_REPLACE_OES 0x8862 +#endif + +/*************************************************************/ + +/* Available only in Common profile */ +GL_API void GL_APIENTRY glAlphaFunc (GLenum func, GLclampf ref); +GL_API void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GL_API void GL_APIENTRY glClearDepthf (GLclampf depth); +GL_API void GL_APIENTRY glClipPlanef (GLenum plane, const GLfloat *equation); +GL_API void GL_APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GL_API void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar); +GL_API void GL_APIENTRY glFogf (GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glFogfv (GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat eqn[4]); +GL_API void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetTexEnvfv (GLenum env, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glLightModelf (GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glLightModelfv (GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glLineWidth (GLfloat width); +GL_API void GL_APIENTRY glLoadMatrixf (const GLfloat *m); +GL_API void GL_APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glMultMatrixf (const GLfloat *m); +GL_API void GL_APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GL_API void GL_APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); +GL_API void GL_APIENTRY glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +GL_API void GL_APIENTRY glPointParameterf (GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glPointSize (GLfloat size); +GL_API void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GL_API void GL_APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GL_API void GL_APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); +GL_API void GL_APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); + +/* Available in both Common and Common-Lite profiles */ +GL_API void GL_APIENTRY glActiveTexture (GLenum texture); +GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLclampx ref); +GL_API void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GL_API void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); +GL_API void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GL_API void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +GL_API void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +GL_API void GL_APIENTRY glClear (GLbitfield mask); +GL_API void GL_APIENTRY glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +GL_API void GL_APIENTRY glClearDepthx (GLclampx depth); +GL_API void GL_APIENTRY glClearStencil (GLint s); +GL_API void GL_APIENTRY glClientActiveTexture (GLenum texture); +GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation); +GL_API void GL_APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GL_API void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GL_API void GL_APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +GL_API void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +GL_API void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GL_API void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GL_API void GL_APIENTRY glCullFace (GLenum mode); +GL_API void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); +GL_API void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GL_API void GL_APIENTRY glDepthFunc (GLenum func); +GL_API void GL_APIENTRY glDepthMask (GLboolean flag); +GL_API void GL_APIENTRY glDepthRangex (GLclampx zNear, GLclampx zFar); +GL_API void GL_APIENTRY glDisable (GLenum cap); +GL_API void GL_APIENTRY glDisableClientState (GLenum array); +GL_API void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GL_API void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +GL_API void GL_APIENTRY glEnable (GLenum cap); +GL_API void GL_APIENTRY glEnableClientState (GLenum array); +GL_API void GL_APIENTRY glFinish (void); +GL_API void GL_APIENTRY glFlush (void); +GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glFrontFace (GLenum mode); +GL_API void GL_APIENTRY glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +GL_API void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GL_API void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed eqn[4]); +GL_API void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); +GL_API void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures); +GL_API GLenum GL_APIENTRY glGetError (void); +GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetPointerv (GLenum pname, GLvoid **params); +GL_API const GLubyte * GL_APIENTRY glGetString (GLenum name); +GL_API void GL_APIENTRY glGetTexEnviv (GLenum env, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetTexEnvxv (GLenum env, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glHint (GLenum target, GLenum mode); +GL_API GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); +GL_API GLboolean GL_APIENTRY glIsEnabled (GLenum cap); +GL_API GLboolean GL_APIENTRY glIsTexture (GLuint texture); +GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glLineWidthx (GLfixed width); +GL_API void GL_APIENTRY glLoadIdentity (void); +GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m); +GL_API void GL_APIENTRY glLogicOp (GLenum opcode); +GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glMatrixMode (GLenum mode); +GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m); +GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz); +GL_API void GL_APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +GL_API void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); +GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glPointSizex (GLfixed size); +GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units); +GL_API void GL_APIENTRY glPopMatrix (void); +GL_API void GL_APIENTRY glPushMatrix (void); +GL_API void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); +GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert); +GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GL_API void GL_APIENTRY glShadeModel (GLenum mode); +GL_API void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GL_API void GL_APIENTRY glStencilMask (GLuint mask); +GL_API void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GL_API void GL_APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); +GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); +GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GL_API void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +/*------------------------------------------------------------------------* + * Required OES extension functions + *------------------------------------------------------------------------*/ + +/* GL_OES_read_format */ +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 +#endif + +/* GL_OES_compressed_paletted_texture */ +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 +#endif + +/* GL_OES_point_size_array */ +#ifndef GL_OES_point_size_array +#define GL_OES_point_size_array 1 +GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +/* GL_OES_point_sprite */ +#ifndef GL_OES_point_sprite +#define GL_OES_point_sprite 1 +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __gl_h_ */ + diff --git a/code/nel/src/3d/driver/OpenGL3/GLES/glext.h b/code/nel/src/3d/driver/OpenGL3/GLES/glext.h new file mode 100644 index 000000000..5b46ae6d0 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/GLES/glext.h @@ -0,0 +1,1278 @@ +#ifndef __glext_h_ +#define __glext_h_ + +/* $Revision: 19260 $ on $Date:: 2012-09-20 11:30:36 -0700 #$ */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This document is licensed under the SGI Free Software B License Version + * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . + */ + +#ifndef GL_APIENTRYP +# define GL_APIENTRYP GL_APIENTRY* +#endif + +/*------------------------------------------------------------------------* + * OES extension tokens + *------------------------------------------------------------------------*/ + +/* GL_OES_blend_equation_separate */ +#ifndef GL_OES_blend_equation_separate +/* BLEND_EQUATION_RGB_OES same as BLEND_EQUATION_OES */ +#define GL_BLEND_EQUATION_RGB_OES 0x8009 +#define GL_BLEND_EQUATION_ALPHA_OES 0x883D +#endif + +/* GL_OES_blend_func_separate */ +#ifndef GL_OES_blend_func_separate +#define GL_BLEND_DST_RGB_OES 0x80C8 +#define GL_BLEND_SRC_RGB_OES 0x80C9 +#define GL_BLEND_DST_ALPHA_OES 0x80CA +#define GL_BLEND_SRC_ALPHA_OES 0x80CB +#endif + +/* GL_OES_blend_subtract */ +#ifndef GL_OES_blend_subtract +#define GL_BLEND_EQUATION_OES 0x8009 +#define GL_FUNC_ADD_OES 0x8006 +#define GL_FUNC_SUBTRACT_OES 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_OES 0x800B +#endif + +/* GL_OES_compressed_ETC1_RGB8_texture */ +#ifndef GL_OES_compressed_ETC1_RGB8_texture +#define GL_ETC1_RGB8_OES 0x8D64 +#endif + +/* GL_OES_depth24 */ +#ifndef GL_OES_depth24 +#define GL_DEPTH_COMPONENT24_OES 0x81A6 +#endif + +/* GL_OES_depth32 */ +#ifndef GL_OES_depth32 +#define GL_DEPTH_COMPONENT32_OES 0x81A7 +#endif + +/* GL_OES_draw_texture */ +#ifndef GL_OES_draw_texture +#define GL_TEXTURE_CROP_RECT_OES 0x8B9D +#endif + +/* GL_OES_EGL_image */ +#ifndef GL_OES_EGL_image +typedef void* GLeglImageOES; +#endif + +/* GL_OES_EGL_image_external */ +#ifndef GL_OES_EGL_image_external +/* GLeglImageOES defined in GL_OES_EGL_image already. */ +#define GL_TEXTURE_EXTERNAL_OES 0x8D65 +#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 +#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 +#endif + +/* GL_OES_element_index_uint */ +#ifndef GL_OES_element_index_uint +#define GL_UNSIGNED_INT 0x1405 +#endif + +/* GL_OES_fixed_point */ +#ifndef GL_OES_fixed_point +#define GL_FIXED_OES 0x140C +#endif + +/* GL_OES_framebuffer_object */ +#ifndef GL_OES_framebuffer_object +#define GL_NONE_OES 0 +#define GL_FRAMEBUFFER_OES 0x8D40 +#define GL_RENDERBUFFER_OES 0x8D41 +#define GL_RGBA4_OES 0x8056 +#define GL_RGB5_A1_OES 0x8057 +#define GL_RGB565_OES 0x8D62 +#define GL_DEPTH_COMPONENT16_OES 0x81A5 +#define GL_RENDERBUFFER_WIDTH_OES 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_OES 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_OES 0x8D44 +#define GL_RENDERBUFFER_RED_SIZE_OES 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_OES 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_OES 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_OES 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_OES 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_OES 0x8D55 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES 0x8CD3 +#define GL_COLOR_ATTACHMENT0_OES 0x8CE0 +#define GL_DEPTH_ATTACHMENT_OES 0x8D00 +#define GL_STENCIL_ATTACHMENT_OES 0x8D20 +#define GL_FRAMEBUFFER_COMPLETE_OES 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES 0x8CDA +#define GL_FRAMEBUFFER_UNSUPPORTED_OES 0x8CDD +#define GL_FRAMEBUFFER_BINDING_OES 0x8CA6 +#define GL_RENDERBUFFER_BINDING_OES 0x8CA7 +#define GL_MAX_RENDERBUFFER_SIZE_OES 0x84E8 +#define GL_INVALID_FRAMEBUFFER_OPERATION_OES 0x0506 +#endif + +/* GL_OES_mapbuffer */ +#ifndef GL_OES_mapbuffer +#define GL_WRITE_ONLY_OES 0x88B9 +#define GL_BUFFER_ACCESS_OES 0x88BB +#define GL_BUFFER_MAPPED_OES 0x88BC +#define GL_BUFFER_MAP_POINTER_OES 0x88BD +#endif + +/* GL_OES_matrix_get */ +#ifndef GL_OES_matrix_get +#define GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES 0x898D +#define GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES 0x898E +#define GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES 0x898F +#endif + +/* GL_OES_matrix_palette */ +#ifndef GL_OES_matrix_palette +#define GL_MAX_VERTEX_UNITS_OES 0x86A4 +#define GL_MAX_PALETTE_MATRICES_OES 0x8842 +#define GL_MATRIX_PALETTE_OES 0x8840 +#define GL_MATRIX_INDEX_ARRAY_OES 0x8844 +#define GL_WEIGHT_ARRAY_OES 0x86AD +#define GL_CURRENT_PALETTE_MATRIX_OES 0x8843 +#define GL_MATRIX_INDEX_ARRAY_SIZE_OES 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_OES 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_OES 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_OES 0x8849 +#define GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES 0x8B9E +#define GL_WEIGHT_ARRAY_SIZE_OES 0x86AB +#define GL_WEIGHT_ARRAY_TYPE_OES 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_OES 0x86AA +#define GL_WEIGHT_ARRAY_POINTER_OES 0x86AC +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_OES 0x889E +#endif + +/* GL_OES_packed_depth_stencil */ +#ifndef GL_OES_packed_depth_stencil +#define GL_DEPTH_STENCIL_OES 0x84F9 +#define GL_UNSIGNED_INT_24_8_OES 0x84FA +#define GL_DEPTH24_STENCIL8_OES 0x88F0 +#endif + +/* GL_OES_required_internalformat */ +/* No new tokens introduced by this extension. */ + +/* GL_OES_rgb8_rgba8 */ +#ifndef GL_OES_rgb8_rgba8 +#define GL_RGB8_OES 0x8051 +#define GL_RGBA8_OES 0x8058 +#endif + +/* GL_OES_stencil1 */ +#ifndef GL_OES_stencil1 +#define GL_STENCIL_INDEX1_OES 0x8D46 +#endif + +/* GL_OES_stencil4 */ +#ifndef GL_OES_stencil4 +#define GL_STENCIL_INDEX4_OES 0x8D47 +#endif + +/* GL_OES_stencil8 */ +#ifndef GL_OES_stencil8 +#define GL_STENCIL_INDEX8_OES 0x8D48 +#endif + +/* GL_OES_stencil_wrap */ +#ifndef GL_OES_stencil_wrap +#define GL_INCR_WRAP_OES 0x8507 +#define GL_DECR_WRAP_OES 0x8508 +#endif + +/* GL_OES_texture_cube_map */ +#ifndef GL_OES_texture_cube_map +#define GL_NORMAL_MAP_OES 0x8511 +#define GL_REFLECTION_MAP_OES 0x8512 +#define GL_TEXTURE_CUBE_MAP_OES 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_OES 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES 0x851A +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES 0x851C +#define GL_TEXTURE_GEN_MODE_OES 0x2500 +#define GL_TEXTURE_GEN_STR_OES 0x8D60 +#endif + +/* GL_OES_texture_mirrored_repeat */ +#ifndef GL_OES_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_OES 0x8370 +#endif + +/* GL_OES_vertex_array_object */ +#ifndef GL_OES_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5 +#endif + +/*------------------------------------------------------------------------* + * AMD extension tokens + *------------------------------------------------------------------------*/ + +/* GL_AMD_compressed_3DC_texture */ +#ifndef GL_AMD_compressed_3DC_texture +#define GL_3DC_X_AMD 0x87F9 +#define GL_3DC_XY_AMD 0x87FA +#endif + +/* GL_AMD_compressed_ATC_texture */ +#ifndef GL_AMD_compressed_ATC_texture +#define GL_ATC_RGB_AMD 0x8C92 +#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 +#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE +#endif + +/*------------------------------------------------------------------------* + * APPLE extension tokens + *------------------------------------------------------------------------*/ + +/* GL_APPLE_copy_texture_levels */ +/* No new tokens introduced by this extension. */ + +/* GL_APPLE_framebuffer_multisample */ +#ifndef GL_APPLE_framebuffer_multisample +#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 +#define GL_MAX_SAMPLES_APPLE 0x8D57 +#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA +#endif + +/* GL_APPLE_sync */ +#ifndef GL_APPLE_sync + +/* These types are defined with reference to + * in the Apple extension spec, but here we use the Khronos + * portable types in khrplatform.h, and assume those types + * are always defined. + * If any other extensions using these types are defined, + * the typedefs must move out of this block and be shared. + */ +typedef khronos_int64_t GLint64; +typedef khronos_uint64_t GLuint64; +typedef struct __GLsync *GLsync; + +#define GL_SYNC_OBJECT_APPLE 0x8A53 +#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111 +#define GL_OBJECT_TYPE_APPLE 0x9112 +#define GL_SYNC_CONDITION_APPLE 0x9113 +#define GL_SYNC_STATUS_APPLE 0x9114 +#define GL_SYNC_FLAGS_APPLE 0x9115 +#define GL_SYNC_FENCE_APPLE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117 +#define GL_UNSIGNALED_APPLE 0x9118 +#define GL_SIGNALED_APPLE 0x9119 +#define GL_ALREADY_SIGNALED_APPLE 0x911A +#define GL_TIMEOUT_EXPIRED_APPLE 0x911B +#define GL_CONDITION_SATISFIED_APPLE 0x911C +#define GL_WAIT_FAILED_APPLE 0x911D +#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001 +#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull +#endif + +/* GL_APPLE_texture_2D_limited_npot */ +/* No new tokens introduced by this extension. */ + +/* GL_APPLE_texture_format_BGRA8888 */ +#ifndef GL_APPLE_texture_format_BGRA8888 +#define GL_BGRA_EXT 0x80E1 +#endif + +/* GL_APPLE_texture_max_level */ +#ifndef GL_APPLE_texture_max_level +#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D +#endif + +/*------------------------------------------------------------------------* + * ARM extension tokens + *------------------------------------------------------------------------*/ + +/* GL_ARM_rgba8 */ +/* No new tokens introduced by this extension. */ + +/*------------------------------------------------------------------------* + * EXT extension tokens + *------------------------------------------------------------------------*/ + +/* GL_EXT_blend_minmax */ +#ifndef GL_EXT_blend_minmax +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#endif + +/* GL_EXT_discard_framebuffer */ +#ifndef GL_EXT_discard_framebuffer +#define GL_COLOR_EXT 0x1800 +#define GL_DEPTH_EXT 0x1801 +#define GL_STENCIL_EXT 0x1802 +#endif + +/* GL_EXT_map_buffer_range */ +#ifndef GL_EXT_map_buffer_range +#define GL_MAP_READ_BIT_EXT 0x0001 +#define GL_MAP_WRITE_BIT_EXT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 +#endif + +/* GL_EXT_multisampled_render_to_texture */ +#ifndef GL_EXT_multisampled_render_to_texture +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C +/* reuse values from GL_EXT_framebuffer_multisample (desktop extension) */ +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +#endif + +/* GL_EXT_multi_draw_arrays */ +/* No new tokens introduced by this extension. */ + +/* GL_EXT_read_format_bgra */ +#ifndef GL_EXT_read_format_bgra +#define GL_BGRA_EXT 0x80E1 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 +#endif + +/* GL_EXT_robustness */ +#ifndef GL_EXT_robustness +/* reuse GL_NO_ERROR */ +#define GL_GUILTY_CONTEXT_RESET_EXT 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255 +#define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3 +#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256 +#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252 +#define GL_NO_RESET_NOTIFICATION_EXT 0x8261 +#endif + +/* GL_EXT_sRGB */ +#ifndef GL_EXT_sRGB +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210 +#endif + +/* GL_EXT_texture_compression_dxt1 */ +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#endif + +/* GL_EXT_texture_filter_anisotropic */ +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +/* GL_EXT_texture_format_BGRA8888 */ +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_BGRA_EXT 0x80E1 +#endif + +/* GL_EXT_texture_lod_bias */ +#ifndef GL_EXT_texture_lod_bias +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif + +/* GL_EXT_texture_storage */ +#ifndef GL_EXT_texture_storage +#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F +#define GL_ALPHA8_EXT 0x803C +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_RGBA32F_EXT 0x8814 +#define GL_RGB32F_EXT 0x8815 +#define GL_ALPHA32F_EXT 0x8816 +#define GL_LUMINANCE32F_EXT 0x8818 +#define GL_LUMINANCE_ALPHA32F_EXT 0x8819 +/* reuse GL_RGBA16F_EXT */ +#define GL_RGB16F_EXT 0x881B +#define GL_ALPHA16F_EXT 0x881C +#define GL_LUMINANCE16F_EXT 0x881E +#define GL_LUMINANCE_ALPHA16F_EXT 0x881F +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGB10_EXT 0x8052 +#define GL_BGRA8_EXT 0x93A1 +#endif + +/*------------------------------------------------------------------------* + * IMG extension tokens + *------------------------------------------------------------------------*/ + +/* GL_IMG_read_format */ +#ifndef GL_IMG_read_format +#define GL_BGRA_IMG 0x80E1 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365 +#endif + +/* GL_IMG_texture_compression_pvrtc */ +#ifndef GL_IMG_texture_compression_pvrtc +#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 +#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 +#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 +#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 +#endif + +/* GL_IMG_texture_env_enhanced_fixed_function */ +#ifndef GL_IMG_texture_env_enhanced_fixed_function +#define GL_MODULATE_COLOR_IMG 0x8C04 +#define GL_RECIP_ADD_SIGNED_ALPHA_IMG 0x8C05 +#define GL_TEXTURE_ALPHA_MODULATE_IMG 0x8C06 +#define GL_FACTOR_ALPHA_MODULATE_IMG 0x8C07 +#define GL_FRAGMENT_ALPHA_MODULATE_IMG 0x8C08 +#define GL_ADD_BLEND_IMG 0x8C09 +#define GL_DOT3_RGBA_IMG 0x86AF +#endif + +/* GL_IMG_user_clip_plane */ +#ifndef GL_IMG_user_clip_plane +#define GL_CLIP_PLANE0_IMG 0x3000 +#define GL_CLIP_PLANE1_IMG 0x3001 +#define GL_CLIP_PLANE2_IMG 0x3002 +#define GL_CLIP_PLANE3_IMG 0x3003 +#define GL_CLIP_PLANE4_IMG 0x3004 +#define GL_CLIP_PLANE5_IMG 0x3005 +#define GL_MAX_CLIP_PLANES_IMG 0x0D32 +#endif + +/* GL_IMG_multisampled_render_to_texture */ +#ifndef GL_IMG_multisampled_render_to_texture +#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134 +#define GL_MAX_SAMPLES_IMG 0x9135 +#define GL_TEXTURE_SAMPLES_IMG 0x9136 +#endif + +/*------------------------------------------------------------------------* + * NV extension tokens + *------------------------------------------------------------------------*/ + +/* GL_NV_fence */ +#ifndef GL_NV_fence +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +#endif + +/*------------------------------------------------------------------------* + * QCOM extension tokens + *------------------------------------------------------------------------*/ + +/* GL_QCOM_driver_control */ +/* No new tokens introduced by this extension. */ + +/* GL_QCOM_extended_get */ +#ifndef GL_QCOM_extended_get +#define GL_TEXTURE_WIDTH_QCOM 0x8BD2 +#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 +#define GL_TEXTURE_DEPTH_QCOM 0x8BD4 +#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 +#define GL_TEXTURE_FORMAT_QCOM 0x8BD6 +#define GL_TEXTURE_TYPE_QCOM 0x8BD7 +#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 +#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 +#define GL_TEXTURE_TARGET_QCOM 0x8BDA +#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB +#define GL_STATE_RESTORE 0x8BDC +#endif + +/* GL_QCOM_extended_get2 */ +/* No new tokens introduced by this extension. */ + +/* GL_QCOM_perfmon_global_mode */ +#ifndef GL_QCOM_perfmon_global_mode +#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 +#endif + +/* GL_QCOM_writeonly_rendering */ +#ifndef GL_QCOM_writeonly_rendering +#define GL_WRITEONLY_RENDERING_QCOM 0x8823 +#endif + +/* GL_QCOM_tiled_rendering */ +#ifndef GL_QCOM_tiled_rendering +#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 +#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 +#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 +#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 +#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 +#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 +#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 +#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 +#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 +#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 +#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 +#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 +#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 +#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 +#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 +#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 +#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 +#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 +#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 +#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 +#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 +#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 +#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 +#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 +#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 +#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 +#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 +#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 +#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 +#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 +#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 +#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 +#endif + +/*------------------------------------------------------------------------* + * End of extension tokens, start of corresponding extension functions + *------------------------------------------------------------------------*/ + +/*------------------------------------------------------------------------* + * OES extension functions + *------------------------------------------------------------------------*/ + +/* GL_OES_blend_equation_separate */ +#ifndef GL_OES_blend_equation_separate +#define GL_OES_blend_equation_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glBlendEquationSeparateOES (GLenum modeRGB, GLenum modeAlpha); +#endif +typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEOESPROC) (GLenum modeRGB, GLenum modeAlpha); +#endif + +/* GL_OES_blend_func_separate */ +#ifndef GL_OES_blend_func_separate +#define GL_OES_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glBlendFuncSeparateOES (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif +typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEOESPROC) (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif + +/* GL_OES_blend_subtract */ +#ifndef GL_OES_blend_subtract +#define GL_OES_blend_subtract 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glBlendEquationOES (GLenum mode); +#endif +typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONOESPROC) (GLenum mode); +#endif + +/* GL_OES_byte_coordinates */ +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 +#endif + +/* GL_OES_compressed_ETC1_RGB8_texture */ +#ifndef GL_OES_compressed_ETC1_RGB8_texture +#define GL_OES_compressed_ETC1_RGB8_texture 1 +#endif + +/* GL_OES_depth24 */ +#ifndef GL_OES_depth24 +#define GL_OES_depth24 1 +#endif + +/* GL_OES_depth32 */ +#ifndef GL_OES_depth32 +#define GL_OES_depth32 1 +#endif + +/* GL_OES_draw_texture */ +#ifndef GL_OES_draw_texture +#define GL_OES_draw_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glDrawTexsOES (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height); +GL_API void GL_APIENTRY glDrawTexiOES (GLint x, GLint y, GLint z, GLint width, GLint height); +GL_API void GL_APIENTRY glDrawTexxOES (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height); +GL_API void GL_APIENTRY glDrawTexsvOES (const GLshort *coords); +GL_API void GL_APIENTRY glDrawTexivOES (const GLint *coords); +GL_API void GL_APIENTRY glDrawTexxvOES (const GLfixed *coords); +GL_API void GL_APIENTRY glDrawTexfOES (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height); +GL_API void GL_APIENTRY glDrawTexfvOES (const GLfloat *coords); +#endif +typedef void (GL_APIENTRYP PFNGLDRAWTEXSOESPROC) (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height); +typedef void (GL_APIENTRYP PFNGLDRAWTEXIOESPROC) (GLint x, GLint y, GLint z, GLint width, GLint height); +typedef void (GL_APIENTRYP PFNGLDRAWTEXXOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height); +typedef void (GL_APIENTRYP PFNGLDRAWTEXSVOESPROC) (const GLshort *coords); +typedef void (GL_APIENTRYP PFNGLDRAWTEXIVOESPROC) (const GLint *coords); +typedef void (GL_APIENTRYP PFNGLDRAWTEXXVOESPROC) (const GLfixed *coords); +typedef void (GL_APIENTRYP PFNGLDRAWTEXFOESPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height); +typedef void (GL_APIENTRYP PFNGLDRAWTEXFVOESPROC) (const GLfloat *coords); +#endif + +/* GL_OES_EGL_image */ +#ifndef GL_OES_EGL_image +#define GL_OES_EGL_image 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); +GL_API void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); +#endif +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); +#endif + +/* GL_OES_EGL_image_external */ +#ifndef GL_OES_EGL_image_external +#define GL_OES_EGL_image_external 1 +/* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */ +#endif + +/* GL_OES_element_index_uint */ +#ifndef GL_OES_element_index_uint +#define GL_OES_element_index_uint 1 +#endif + +/* GL_OES_extended_matrix_palette */ +#ifndef GL_OES_extended_matrix_palette +#define GL_OES_extended_matrix_palette 1 +#endif + +/* GL_OES_fbo_render_mipmap */ +#ifndef GL_OES_fbo_render_mipmap +#define GL_OES_fbo_render_mipmap 1 +#endif + +/* GL_OES_fixed_point */ +#ifndef GL_OES_fixed_point +#define GL_OES_fixed_point 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glAlphaFuncxOES (GLenum func, GLclampx ref); +GL_API void GL_APIENTRY glClearColorxOES (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +GL_API void GL_APIENTRY glClearDepthxOES (GLclampx depth); +GL_API void GL_APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation); +GL_API void GL_APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GL_API void GL_APIENTRY glDepthRangexOES (GLclampx zNear, GLclampx zFar); +GL_API void GL_APIENTRY glFogxOES (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glFogxvOES (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glFrustumxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +GL_API void GL_APIENTRY glGetClipPlanexOES (GLenum pname, GLfixed eqn[4]); +GL_API void GL_APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetLightxvOES (GLenum light, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetMaterialxvOES (GLenum face, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetTexEnvxvOES (GLenum env, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glLightModelxOES (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glLineWidthxOES (GLfixed width); +GL_API void GL_APIENTRY glLoadMatrixxOES (const GLfixed *m); +GL_API void GL_APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glMultMatrixxOES (const GLfixed *m); +GL_API void GL_APIENTRY glMultiTexCoord4xOES (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +GL_API void GL_APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz); +GL_API void GL_APIENTRY glOrthoxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +GL_API void GL_APIENTRY glPointParameterxOES (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glPointSizexOES (GLfixed size); +GL_API void GL_APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units); +GL_API void GL_APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glSampleCoveragexOES (GLclampx value, GLboolean invert); +GL_API void GL_APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z); +#endif +typedef void (GL_APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLclampx ref); +typedef void (GL_APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +typedef void (GL_APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLclampx depth); +typedef void (GL_APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation); +typedef void (GL_APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (GL_APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLclampx zNear, GLclampx zFar); +typedef void (GL_APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum pname, GLfixed eqn[4]); +typedef void (GL_APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params); +typedef void (GL_APIENTRYP PFNGLGETLIGHTXVOESPROC) (GLenum light, GLenum pname, GLfixed *params); +typedef void (GL_APIENTRYP PFNGLGETMATERIALXVOESPROC) (GLenum face, GLenum pname, GLfixed *params); +typedef void (GL_APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum env, GLenum pname, GLfixed *params); +typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); +typedef void (GL_APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width); +typedef void (GL_APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m); +typedef void (GL_APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m); +typedef void (GL_APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +typedef void (GL_APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz); +typedef void (GL_APIENTRYP PFNGLORTHOXOESPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXOESPROC) (GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size); +typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units); +typedef void (GL_APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEXOESPROC) (GLclampx value, GLboolean invert); +typedef void (GL_APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (GL_APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); +#endif + +/* GL_OES_framebuffer_object */ +#ifndef GL_OES_framebuffer_object +#define GL_OES_framebuffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API GLboolean GL_APIENTRY glIsRenderbufferOES (GLuint renderbuffer); +GL_API void GL_APIENTRY glBindRenderbufferOES (GLenum target, GLuint renderbuffer); +GL_API void GL_APIENTRY glDeleteRenderbuffersOES (GLsizei n, const GLuint* renderbuffers); +GL_API void GL_APIENTRY glGenRenderbuffersOES (GLsizei n, GLuint* renderbuffers); +GL_API void GL_APIENTRY glRenderbufferStorageOES (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GL_API void GL_APIENTRY glGetRenderbufferParameterivOES (GLenum target, GLenum pname, GLint* params); +GL_API GLboolean GL_APIENTRY glIsFramebufferOES (GLuint framebuffer); +GL_API void GL_APIENTRY glBindFramebufferOES (GLenum target, GLuint framebuffer); +GL_API void GL_APIENTRY glDeleteFramebuffersOES (GLsizei n, const GLuint* framebuffers); +GL_API void GL_APIENTRY glGenFramebuffersOES (GLsizei n, GLuint* framebuffers); +GL_API GLenum GL_APIENTRY glCheckFramebufferStatusOES (GLenum target); +GL_API void GL_APIENTRY glFramebufferRenderbufferOES (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GL_API void GL_APIENTRY glFramebufferTexture2DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GL_API void GL_APIENTRY glGetFramebufferAttachmentParameterivOES (GLenum target, GLenum attachment, GLenum pname, GLint* params); +GL_API void GL_APIENTRY glGenerateMipmapOES (GLenum target); +#endif +typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFEROESPROC) (GLuint renderbuffer); +typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFEROESPROC) (GLenum target, GLuint renderbuffer); +typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSOESPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSOESPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVOESPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFEROESPROC) (GLuint framebuffer); +typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFEROESPROC) (GLenum target, GLuint framebuffer); +typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSOESPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSOESPROC) (GLsizei n, GLuint* framebuffers); +typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSOESPROC) (GLenum target); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEROESPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPOESPROC) (GLenum target); +#endif + +/* GL_OES_mapbuffer */ +#ifndef GL_OES_mapbuffer +#define GL_OES_mapbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); +GL_API GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); +GL_API void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid ** params); +#endif +typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); +typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); +typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid ** params); +#endif + +/* GL_OES_matrix_get */ +#ifndef GL_OES_matrix_get +#define GL_OES_matrix_get 1 +#endif + +/* GL_OES_matrix_palette */ +#ifndef GL_OES_matrix_palette +#define GL_OES_matrix_palette 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glCurrentPaletteMatrixOES (GLuint matrixpaletteindex); +GL_API void GL_APIENTRY glLoadPaletteFromModelViewMatrixOES (void); +GL_API void GL_APIENTRY glMatrixIndexPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glWeightPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif +typedef void (GL_APIENTRYP PFNGLCURRENTPALETTEMATRIXOESPROC) (GLuint matrixpaletteindex); +typedef void (GL_APIENTRYP PFNGLLOADPALETTEFROMMODELVIEWMATRIXOESPROC) (void); +typedef void (GL_APIENTRYP PFNGLMATRIXINDEXPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GL_APIENTRYP PFNGLWEIGHTPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +/* GL_OES_packed_depth_stencil */ +#ifndef GL_OES_packed_depth_stencil +#define GL_OES_packed_depth_stencil 1 +#endif + +/* GL_OES_required_internalformat */ +#ifndef GL_OES_required_internalformat +#define GL_OES_required_internalformat 1 +#endif + +/* GL_OES_query_matrix */ +#ifndef GL_OES_query_matrix +#define GL_OES_query_matrix 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES (GLfixed mantissa[16], GLint exponent[16]); +#endif +typedef GLbitfield (GL_APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed mantissa[16], GLint exponent[16]); +#endif + +/* GL_OES_rgb8_rgba8 */ +#ifndef GL_OES_rgb8_rgba8 +#define GL_OES_rgb8_rgba8 1 +#endif + +/* GL_OES_single_precision */ +#ifndef GL_OES_single_precision +#define GL_OES_single_precision 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glDepthRangefOES (GLclampf zNear, GLclampf zFar); +GL_API void GL_APIENTRY glFrustumfOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +GL_API void GL_APIENTRY glOrthofOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +GL_API void GL_APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation); +GL_API void GL_APIENTRY glGetClipPlanefOES (GLenum pname, GLfloat eqn[4]); +GL_API void GL_APIENTRY glClearDepthfOES (GLclampf depth); +#endif +typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf zNear, GLclampf zFar); +typedef void (GL_APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GL_APIENTRYP PFNGLORTHOFOESPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GL_APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation); +typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum pname, GLfloat eqn[4]); +typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth); +#endif + +/* GL_OES_stencil1 */ +#ifndef GL_OES_stencil1 +#define GL_OES_stencil1 1 +#endif + +/* GL_OES_stencil4 */ +#ifndef GL_OES_stencil4 +#define GL_OES_stencil4 1 +#endif + +/* GL_OES_stencil8 */ +#ifndef GL_OES_stencil8 +#define GL_OES_stencil8 1 +#endif + +/* GL_OES_stencil_wrap */ +#ifndef GL_OES_stencil_wrap +#define GL_OES_stencil_wrap 1 +#endif + +/* GL_OES_texture_cube_map */ +#ifndef GL_OES_texture_cube_map +#define GL_OES_texture_cube_map 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glTexGenfOES (GLenum coord, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glTexGenfvOES (GLenum coord, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glTexGeniOES (GLenum coord, GLenum pname, GLint param); +GL_API void GL_APIENTRY glTexGenivOES (GLenum coord, GLenum pname, const GLint *params); +GL_API void GL_APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glGetTexGenfvOES (GLenum coord, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetTexGenivOES (GLenum coord, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params); +#endif +typedef void (GL_APIENTRYP PFNGLTEXGENFOESPROC) (GLenum coord, GLenum pname, GLfloat param); +typedef void (GL_APIENTRYP PFNGLTEXGENFVOESPROC) (GLenum coord, GLenum pname, const GLfloat *params); +typedef void (GL_APIENTRYP PFNGLTEXGENIOESPROC) (GLenum coord, GLenum pname, GLint param); +typedef void (GL_APIENTRYP PFNGLTEXGENIVOESPROC) (GLenum coord, GLenum pname, const GLint *params); +typedef void (GL_APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLGETTEXGENFVOESPROC) (GLenum coord, GLenum pname, GLfloat *params); +typedef void (GL_APIENTRYP PFNGLGETTEXGENIVOESPROC) (GLenum coord, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params); +#endif + +/* GL_OES_texture_env_crossbar */ +#ifndef GL_OES_texture_env_crossbar +#define GL_OES_texture_env_crossbar 1 +#endif + +/* GL_OES_texture_mirrored_repeat */ +#ifndef GL_OES_texture_mirrored_repeat +#define GL_OES_texture_mirrored_repeat 1 +#endif + +/* GL_OES_vertex_array_object */ +#ifndef GL_OES_vertex_array_object +#define GL_OES_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glBindVertexArrayOES (GLuint array); +GL_API void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays); +GL_API void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays); +GL_API GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array); +#endif +typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array); +typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays); +typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array); +#endif + +/*------------------------------------------------------------------------* + * AMD extension functions + *------------------------------------------------------------------------*/ + +/* GL_AMD_compressed_3DC_texture */ +#ifndef GL_AMD_compressed_3DC_texture +#define GL_AMD_compressed_3DC_texture 1 +#endif + +/* GL_AMD_compressed_ATC_texture */ +#ifndef GL_AMD_compressed_ATC_texture +#define GL_AMD_compressed_ATC_texture 1 +#endif + +/*------------------------------------------------------------------------* + * APPLE extension functions + *------------------------------------------------------------------------*/ + +/* GL_APPLE_copy_texture_levels */ +#ifndef GL_APPLE_copy_texture_levels +#define GL_APPLE_copy_texture_levels 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); +#endif +typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); +#endif + +/* GL_APPLE_framebuffer_multisample */ +#ifndef GL_APPLE_framebuffer_multisample +#define GL_APPLE_framebuffer_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum, GLsizei, GLenum, GLsizei, GLsizei); +GL_API void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); +#endif + +/* GL_APPLE_sync */ +#ifndef GL_APPLE_sync +#define GL_APPLE_sync 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags); +GL_API GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync); +GL_API void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync); +GL_API GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); +GL_API void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); +GL_API void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params); +GL_API void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +#endif +typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags); +typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync); +typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync); +typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params); +typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +#endif + +/* GL_APPLE_texture_2D_limited_npot */ +#ifndef GL_APPLE_texture_2D_limited_npot +#define GL_APPLE_texture_2D_limited_npot 1 +#endif + +/* GL_APPLE_texture_format_BGRA8888 */ +#ifndef GL_APPLE_texture_format_BGRA8888 +#define GL_APPLE_texture_format_BGRA8888 1 +#endif + +/* GL_APPLE_texture_max_level */ +#ifndef GL_APPLE_texture_max_level +#define GL_APPLE_texture_max_level 1 +#endif + +/*------------------------------------------------------------------------* + * ARM extension functions + *------------------------------------------------------------------------*/ + +/* GL_ARM_rgba8 */ +#ifndef GL_ARM_rgba8 +#define GL_ARM_rgba8 1 +#endif + +/*------------------------------------------------------------------------* + * EXT extension functions + *------------------------------------------------------------------------*/ + +/* GL_EXT_blend_minmax */ +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#endif + +/* GL_EXT_discard_framebuffer */ +#ifndef GL_EXT_discard_framebuffer +#define GL_EXT_discard_framebuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments); +#endif +typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); +#endif + +/* GL_EXT_map_buffer_range */ +#ifndef GL_EXT_map_buffer_range +#define GL_EXT_map_buffer_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY *glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +GL_API void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length); +#endif +typedef void* (GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +#endif + +/* GL_EXT_multisampled_render_to_texture */ +#ifndef GL_EXT_multisampled_render_to_texture +#define GL_EXT_multisampled_render_to_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei); +GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei); +#endif +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +#endif + +/* GL_EXT_multi_draw_arrays */ +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); +GL_API void GL_APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif + +/* GL_EXT_read_format_bgra */ +#ifndef GL_EXT_read_format_bgra +#define GL_EXT_read_format_bgra 1 +#endif + +/* GL_EXT_robustness */ +#ifndef GL_EXT_robustness +#define GL_EXT_robustness 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void); +GL_API void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +GL_API void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, float *params); +GL_API void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params); +#endif +typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void); +typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, float *params); +typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); +#endif + +/* GL_EXT_sRGB */ +#ifndef GL_EXT_sRGB +#define GL_EXT_sRGB 1 +#endif + +/* GL_EXT_texture_compression_dxt1 */ +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 +#endif + +/* GL_EXT_texture_filter_anisotropic */ +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +/* GL_EXT_texture_format_BGRA8888 */ +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_EXT_texture_format_BGRA8888 1 +#endif + +/* GL_EXT_texture_lod_bias */ +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#endif + +/* GL_EXT_texture_storage */ +#ifndef GL_EXT_texture_storage +#define GL_EXT_texture_storage 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GL_API void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GL_API void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +GL_API void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GL_API void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GL_API void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +#endif +typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +#endif + +/*------------------------------------------------------------------------* + * IMG extension functions + *------------------------------------------------------------------------*/ + +/* GL_IMG_read_format */ +#ifndef GL_IMG_read_format +#define GL_IMG_read_format 1 +#endif + +/* GL_IMG_texture_compression_pvrtc */ +#ifndef GL_IMG_texture_compression_pvrtc +#define GL_IMG_texture_compression_pvrtc 1 +#endif + +/* GL_IMG_texture_env_enhanced_fixed_function */ +#ifndef GL_IMG_texture_env_enhanced_fixed_function +#define GL_IMG_texture_env_enhanced_fixed_function 1 +#endif + +/* GL_IMG_user_clip_plane */ +#ifndef GL_IMG_user_clip_plane +#define GL_IMG_user_clip_plane 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glClipPlanefIMG (GLenum, const GLfloat *); +GL_API void GL_APIENTRY glClipPlanexIMG (GLenum, const GLfixed *); +#endif +typedef void (GL_APIENTRYP PFNGLCLIPPLANEFIMGPROC) (GLenum p, const GLfloat *eqn); +typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMGPROC) (GLenum p, const GLfixed *eqn); +#endif + +/* GL_IMG_multisampled_render_to_texture */ +#ifndef GL_IMG_multisampled_render_to_texture +#define GL_IMG_multisampled_render_to_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum, GLsizei, GLenum, GLsizei, GLsizei); +GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei); +#endif +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +#endif + +/*------------------------------------------------------------------------* + * NV extension functions + *------------------------------------------------------------------------*/ + +/* NV_fence */ +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); +GL_API void GL_APIENTRY glGenFencesNV (GLsizei, GLuint *); +GL_API GLboolean GL_APIENTRY glIsFenceNV (GLuint); +GL_API GLboolean GL_APIENTRY glTestFenceNV (GLuint); +GL_API void GL_APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); +GL_API void GL_APIENTRY glFinishFenceNV (GLuint); +GL_API void GL_APIENTRY glSetFenceNV (GLuint, GLenum); +#endif +typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#endif + +/*------------------------------------------------------------------------* + * QCOM extension functions + *------------------------------------------------------------------------*/ + +/* GL_QCOM_driver_control */ +#ifndef GL_QCOM_driver_control +#define GL_QCOM_driver_control 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls); +GL_API void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); +GL_API void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl); +GL_API void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl); +#endif +typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); +typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); +typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +#endif + +/* GL_QCOM_extended_get */ +#ifndef GL_QCOM_extended_get +#define GL_QCOM_extended_get 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures); +GL_API void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); +GL_API void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); +GL_API void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); +GL_API void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param); +GL_API void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); +GL_API void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params); +#endif +typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures); +typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); +typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params); +#endif + +/* GL_QCOM_extended_get2 */ +#ifndef GL_QCOM_extended_get2 +#define GL_QCOM_extended_get2 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders); +GL_API void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms); +GL_API GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program); +GL_API void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length); +#endif +typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders); +typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms); +typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); +typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length); +#endif + +/* GL_QCOM_perfmon_global_mode */ +#ifndef GL_QCOM_perfmon_global_mode +#define GL_QCOM_perfmon_global_mode 1 +#endif + +/* GL_QCOM_writeonly_rendering */ +#ifndef GL_QCOM_writeonly_rendering +#define GL_QCOM_writeonly_rendering 1 +#endif + +/* GL_QCOM_tiled_rendering */ +#ifndef GL_QCOM_tiled_rendering +#define GL_QCOM_tiled_rendering 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); +GL_API void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask); +#endif +typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); +typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __glext_h_ */ + diff --git a/code/nel/src/3d/driver/OpenGL3/GLES/glplatform.h b/code/nel/src/3d/driver/OpenGL3/GLES/glplatform.h new file mode 100644 index 000000000..2db6ee2ca --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/GLES/glplatform.h @@ -0,0 +1,30 @@ +#ifndef __glplatform_h_ +#define __glplatform_h_ + +/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */ + +/* + * This document is licensed under the SGI Free Software B License Version + * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . + */ + +/* Platform-specific types and definitions for OpenGL ES 1.X gl.h + * + * Adopters may modify khrplatform.h and this file to suit their platform. + * You are encouraged to submit all modifications to the Khronos group so that + * they can be included in future versions of this file. Please submit changes + * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) + * by filing a bug against product "OpenGL-ES" component "Registry". + */ + +#include + +#ifndef GL_API +#define GL_API KHRONOS_APICALL +#endif + +#ifndef GL_APIENTRY +#define GL_APIENTRY KHRONOS_APIENTRY +#endif + +#endif /* __glplatform_h_ */ diff --git a/code/nel/src/3d/driver/OpenGL3/KHR/khrplatform.h b/code/nel/src/3d/driver/OpenGL3/KHR/khrplatform.h new file mode 100644 index 000000000..ee2ab4fd7 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/KHR/khrplatform.h @@ -0,0 +1,302 @@ +#ifndef __khrplatform_h_ +#define __khrplatform_h_ + +/* +** Copyright (c) 2008-2009 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Khronos platform-specific types and definitions. + * + * $Revision: 1.5 $ on $Date: 2010/06/03 16:51:55 $ + * + * Adopters may modify this file to suit their platform. Adopters are + * encouraged to submit platform specific modifications to the Khronos + * group so that they can be included in future versions of this file. + * Please submit changes by sending them to the public Khronos Bugzilla + * (http://khronos.org/bugzilla) by filing a bug against product + * "Khronos (general)" component "Registry". + * + * A predefined template which fills in some of the bug fields can be + * reached using http://tinyurl.com/khrplatform-h-bugreport, but you + * must create a Bugzilla login first. + * + * + * See the Implementer's Guidelines for information about where this file + * should be located on your system and for more details of its use: + * http://www.khronos.org/registry/implementers_guide.pdf + * + * This file should be included as + * #include + * by Khronos client API header files that use its types and defines. + * + * The types in khrplatform.h should only be used to define API-specific types. + * + * Types defined in khrplatform.h: + * khronos_int8_t signed 8 bit + * khronos_uint8_t unsigned 8 bit + * khronos_int16_t signed 16 bit + * khronos_uint16_t unsigned 16 bit + * khronos_int32_t signed 32 bit + * khronos_uint32_t unsigned 32 bit + * khronos_int64_t signed 64 bit + * khronos_uint64_t unsigned 64 bit + * khronos_intptr_t signed same number of bits as a pointer + * khronos_uintptr_t unsigned same number of bits as a pointer + * khronos_ssize_t signed size + * khronos_usize_t unsigned size + * khronos_float_t signed 32 bit floating point + * khronos_time_ns_t unsigned 64 bit time in nanoseconds + * khronos_utime_nanoseconds_t unsigned time interval or absolute time in + * nanoseconds + * khronos_stime_nanoseconds_t signed time interval in nanoseconds + * khronos_boolean_enum_t enumerated boolean type. This should + * only be used as a base type when a client API's boolean type is + * an enum. Client APIs which use an integer or other type for + * booleans cannot use this as the base type for their boolean. + * + * Tokens defined in khrplatform.h: + * + * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. + * + * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. + * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. + * + * Calling convention macros defined in this file: + * KHRONOS_APICALL + * KHRONOS_APIENTRY + * KHRONOS_APIATTRIBUTES + * + * These may be used in function prototypes as: + * + * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( + * int arg1, + * int arg2) KHRONOS_APIATTRIBUTES; + */ + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APICALL + *------------------------------------------------------------------------- + * This precedes the return type of the function in the function prototype. + */ + +#if (defined(_WIN32) || defined(__VC32__)) && !defined(__SCITECH_SNAP__) && !defined(__WINSCW__) +# if defined (_DLL_EXPORTS) +# define KHRONOS_APICALL __declspec(dllexport) +# else +# define KHRONOS_APICALL __declspec(dllimport) +# endif +#elif defined (__SYMBIAN32__) +# if defined (__GCC32__) +# define KHRONOS_APICALL __declspec(dllexport) +# else +# define KHRONOS_APICALL IMPORT_C +# endif +#else +# define KHRONOS_APICALL +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APIENTRY + *------------------------------------------------------------------------- + * This follows the return type of the function and precedes the function + * name in the function prototype. + */ +#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) && !defined(__WINSCW__) + /* Win32 but not WinCE */ +# define KHRONOS_APIENTRY __stdcall +#else +# define KHRONOS_APIENTRY +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APIATTRIBUTES + *------------------------------------------------------------------------- + * This follows the closing parenthesis of the function prototype arguments. + */ +#if defined (__ARMCC_2__) +#define KHRONOS_APIATTRIBUTES __softfp +#else +#define KHRONOS_APIATTRIBUTES +#endif + +/*------------------------------------------------------------------------- + * basic type definitions + *-----------------------------------------------------------------------*/ +#if defined(__SYMBIAN32__) + +#include + +typedef TInt32 khronos_int32_t; +typedef TUint32 khronos_uint32_t; +typedef TInt64 khronos_int64_t; +typedef TUint64 khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) + + +/* + * Using + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(__VMS ) || defined(__sgi) + +/* + * Using + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) + +/* + * Win32 + */ +typedef __int32 khronos_int32_t; +typedef unsigned __int32 khronos_uint32_t; +typedef __int64 khronos_int64_t; +typedef unsigned __int64 khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(__sun__) || defined(__digital__) + +/* + * Sun or Digital + */ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#if defined(__arch64__) || defined(_LP64) +typedef long int khronos_int64_t; +typedef unsigned long int khronos_uint64_t; +#else +typedef long long int khronos_int64_t; +typedef unsigned long long int khronos_uint64_t; +#endif /* __arch64__ */ +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(_UITRON_) + +/* + * uITRON + */ +typedef signed int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +typedef long long khronos_int64_t; +typedef unsigned long long khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + + +#elif 0 + +/* + * Hypothetical platform with no float or int64 support + */ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#define KHRONOS_SUPPORT_INT64 0 +#define KHRONOS_SUPPORT_FLOAT 0 + +#else + +/* + * Generic fallback + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#endif + + +/* + * Types that are (so far) the same on all platforms + */ +typedef signed char khronos_int8_t; +typedef unsigned char khronos_uint8_t; +typedef signed short int khronos_int16_t; +typedef unsigned short int khronos_uint16_t; +typedef signed long int khronos_intptr_t; +typedef unsigned long int khronos_uintptr_t; +typedef signed long int khronos_ssize_t; +typedef unsigned long int khronos_usize_t; + +#if KHRONOS_SUPPORT_FLOAT +/* + * Float type + */ +typedef float khronos_float_t; +#endif + +#if KHRONOS_SUPPORT_INT64 +/* Time types + * + * These types can be used to represent a time interval in nanoseconds or + * an absolute Unadjusted System Time. Unadjusted System Time is the number + * of nanoseconds since some arbitrary system event (e.g. since the last + * time the system booted). The Unadjusted System Time is an unsigned + * 64 bit value that wraps back to 0 every 584 years. Time intervals + * may be either signed or unsigned. + */ +typedef khronos_uint64_t khronos_utime_nanoseconds_t; +typedef khronos_int64_t khronos_stime_nanoseconds_t; +#endif + +/* + * Dummy value used to pad enum types to 32 bits. + */ +#ifndef KHRONOS_MAX_ENUM +#define KHRONOS_MAX_ENUM 0x7FFFFFFF +#endif + +/* + * Enumerated boolean type + * + * Values other than zero should be considered to be true. Therefore + * comparisons should not be made against KHRONOS_TRUE. + */ +typedef enum { + KHRONOS_FALSE = 0, + KHRONOS_TRUE = 1, + KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM +} khronos_boolean_enum_t; + +#endif /* __khrplatform_h_ */ diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp new file mode 100644 index 000000000..29e14a1a0 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp @@ -0,0 +1,2947 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "stdopengl.h" +#include "driver_opengl.h" +#include "driver_opengl_extension.h" + +// by default, we disable the windows menu keys (F10, ALT and ALT+SPACE key doesn't freeze or open the menu) +#define NL_DISABLE_MENU + +#include "nel/3d/viewport.h" +#include "nel/3d/scissor.h" +#include "nel/3d/u_driver.h" +#include "nel/3d/vertex_buffer.h" +#include "nel/3d/light.h" +#include "nel/3d/index_buffer.h" +#include "nel/misc/rect.h" +#include "nel/misc/di_event_emitter.h" +#include "nel/misc/mouse_device.h" +#include "nel/misc/hierarchical_timer.h" +#include "nel/misc/dynloadlib.h" +#include "driver_opengl_vertex_buffer_hard.h" + + +using namespace std; +using namespace NLMISC; + + + + + +// *************************************************************************** +// try to allocate 16Mo by default of AGP Ram. +#define NL3D_DRV_VERTEXARRAY_AGP_INIT_SIZE (16384*1024) + + + +// *************************************************************************** +#ifndef NL_STATIC + +#ifdef NL_OS_WINDOWS +// dllmain:: +BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) +{ + if (fdwReason == DLL_PROCESS_ATTACH) + { + // Yoyo: Vianney change: don't need to call initDebug() anymore. + // initDebug(); + } + return true; +} + +#endif /* NL_OS_WINDOWS */ + +#ifdef USE_OPENGLES + +class CDriverGLEsNelLibrary : public INelLibrary { + void onLibraryLoaded(bool firstTime) { } + void onLibraryUnloaded(bool lastTime) { } +}; +NLMISC_DECL_PURE_LIB(CDriverGLEsNelLibrary) + +#else + +class CDriverGLNelLibrary : public INelLibrary { + void onLibraryLoaded(bool firstTime) { } + void onLibraryUnloaded(bool lastTime) { } +}; +NLMISC_DECL_PURE_LIB(CDriverGLNelLibrary) + +#endif + +#endif /* #ifndef NL_STATIC */ + +namespace NL3D { + +#ifdef NL_STATIC + +#ifdef USE_OPENGLES + +IDriver* createGlEsDriverInstance () +{ + return new NLDRIVERGLES::CDriverGL; +} + +#else + +IDriver* createGlDriverInstance () +{ + return new NLDRIVERGL::CDriverGL; +} + +#endif + +#else + +#ifdef NL_OS_WINDOWS + +__declspec(dllexport) IDriver* NL3D_createIDriverInstance () +{ + return new CDriverGL; +} + +__declspec(dllexport) uint32 NL3D_interfaceVersion () +{ + return IDriver::InterfaceVersion; +} + +#elif defined (NL_OS_UNIX) + +extern "C" +{ + IDriver* NL3D_createIDriverInstance () + { + return new CDriverGL; + } + + uint32 NL3D_interfaceVersion () + { + return IDriver::InterfaceVersion; + } +} + +#endif // NL_OS_WINDOWS + +#endif // NL_STATIC + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + +CMaterial::CTexEnv CDriverGL::_TexEnvReplace; + + +#ifdef NL_OS_WINDOWS +uint CDriverGL::_Registered=0; +#endif // NL_OS_WINDOWS + +// Version of the driver. Not the interface version!! Increment when implementation of the driver change. +const uint32 CDriverGL::ReleaseVersion = 0x11; + +// Number of register to allocate for the EXTVertexShader extension +const uint CDriverGL::_EVSNumConstant = 97; + +GLenum CDriverGL::NLCubeFaceToGLCubeFace[6] = +{ + GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, + GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, + GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, + GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB +}; + +// *************************************************************************** +CDriverGL::CDriverGL() +{ + H_AUTO_OGL(CDriverGL_CDriverGL) + +#ifdef USE_OPENGLES + + _EglDisplay = 0; + _EglContext = 0; + _EglSurface = 0; + +#elif defined(NL_OS_WINDOWS) + + _PBuffer = NULL; + _hRC = NULL; + _hDC = NULL; + +#elif defined(NL_OS_MAC) + + _ctx = nil; + _glView = nil; + _backBufferHeight = 0; + _backBufferWidth = 0; + + // autorelease pool for memory management + _autoreleasePool = [[NSAutoreleasePool alloc] init]; + + // init the application object + [NSApplication sharedApplication]; + + // create the menu in the top screen bar + setupApplicationMenu(); + + // finish the application launching + [NSApp finishLaunching]; + +#elif defined (NL_OS_UNIX) + + _dpy = 0; + _visual_info = NULL; + +# ifdef XF86VIDMODE + // zero the old screen mode + memset(&_OldScreenMode, 0, sizeof(_OldScreenMode)); +# endif //XF86VIDMODE + +#endif // NL_OS_UNIX + + _ColorDepth = ColorDepth32; + + _DefaultCursor = EmptyCursor; + _BlankCursor = EmptyCursor; + + _AlphaBlendedCursorSupported = false; + _AlphaBlendedCursorSupportRetrieved = false; + _CurrCol = CRGBA::White; + _CurrRot = 0; + _CurrHotSpotX = 0; + _CurrHotSpotY = 0; + _CursorScale = 1.f; + _MouseCaptured = false; + + _NeedToRestaureGammaRamp = false; + + _win = EmptyWindow; + _WindowX = 0; + _WindowY = 0; + _WindowVisible = true; + _DestroyWindow = false; + _Maximized = false; + + _CurrentMode.Width = 0; + _CurrentMode.Height = 0; + _CurrentMode.Depth = 0; + _CurrentMode.OffScreen = false; + _CurrentMode.Windowed = true; + _CurrentMode.AntiAlias = -1; + + _Interval = 1; + _Resizable = false; + + _DecorationWidth = 0; + _DecorationHeight = 0; + + _CurrentMaterial=NULL; + _Initialized = false; + + _FogEnabled= false; + _FogEnd = _FogStart = 0.f; + _CurrentFogColor[0]= 0; + _CurrentFogColor[1]= 0; + _CurrentFogColor[2]= 0; + _CurrentFogColor[3]= 0; + + _RenderTargetFBO = false; + + _LightSetupDirty= false; + _ModelViewMatrixDirty= false; + _RenderSetupDirty= false; + // All lights default pos. + uint i; + for(i=0;i lines; + explode(_Extensions.toString(), string("\n"), lines); + for(uint i = 0; i < lines.size(); i++) + nlinfo("3D: %s", lines[i].c_str()); + +#ifdef USE_OPENGLES + registerEGlExtensions(_Extensions, _EglDisplay); +#elif defined(NL_OS_WINDOWS) + registerWGlExtensions(_Extensions, _hDC); +#elif defined(NL_OS_MAC) +#elif defined(NL_OS_UNIX) + registerGlXExtensions(_Extensions, _dpy, DefaultScreen(_dpy)); +#endif // NL_OS_WINDOWS + + // Check required extensions!! + // ARBMultiTexture is a OpenGL 1.2 required extension. + if(!_Extensions.ARBMultiTexture) + { + nlwarning("Missing Required GL extension: GL_ARB_multitexture. Update your driver"); + throw EBadDisplay("Missing Required GL extension: GL_ARB_multitexture. Update your driver"); + } + + if(!_Extensions.EXTTextureEnvCombine) + { + nlwarning("Missing Important GL extension: GL_EXT_texture_env_combine => All envcombine are setup to GL_MODULATE!!!"); + } + + // Get num of light for this driver + int numLight; + glGetIntegerv (GL_MAX_LIGHTS, &numLight); + _MaxDriverLight=(uint)numLight; + if (_MaxDriverLight>MaxLight) + _MaxDriverLight=MaxLight; + + // All User Light are disabled by Default + uint i; + for(i=0;i::max(); // cant' know the value.. + } +#ifndef USE_OPENGLES + // Next with NVidia ext + else if(_Extensions.NVVertexArrayRange) + { + _AGPVertexArrayRange= new CVertexArrayRangeNVidia(this); + _VRAMVertexArrayRange= new CVertexArrayRangeNVidia(this); + _SupportVBHard= true; + _MaxVerticesByVBHard= _Extensions.NVVertexArrayRangeMaxVertex; + } + else if(_Extensions.ATITextureEnvCombine3 && _Extensions.ATIVertexArrayObject) + { + // NB + // on Radeon 9200 and below : ATI_vertex_array_object is better (no direct access to AGP with ARB_vertex_buffer_object -> slow unlock) + // on Radeon 9500 and above : ARB_vertex_buffer_object is better + if (!_Extensions.ATIMapObjectBuffer) + { + _AGPVertexArrayRange= new CVertexArrayRangeATI(this); + _VRAMVertexArrayRange= new CVertexArrayRangeATI(this); + // BAD ATI extension scheme. + _SlowUnlockVBHard= true; + } + else + { + _AGPVertexArrayRange= new CVertexArrayRangeMapObjectATI(this); + _VRAMVertexArrayRange= new CVertexArrayRangeMapObjectATI(this); + } + _SupportVBHard= true; + // _MaxVerticesByVBHard= 65535; // should always work with recent drivers. + // tmp fix for ati + _MaxVerticesByVBHard= 16777216; + } +#endif + + // Reset VertexArrayRange. + _CurrentVertexArrayRange= NULL; + _CurrentVertexBufferHard= NULL; + _NVCurrentVARPtr= NULL; + _NVCurrentVARSize= 0; + + if (_SupportVBHard) + { + // try to allocate 16Mo by default of AGP Ram. + initVertexBufferHard(NL3D_DRV_VERTEXARRAY_AGP_INIT_SIZE, 0); + + // If not success to allocate at least a minimum space in AGP, then disable completely VBHard feature + if( _AGPVertexArrayRange->sizeAllocated()==0 ) + { + // reset any allocated VRAM space. + resetVertexArrayRange(); + + // delete containers + delete _AGPVertexArrayRange; + delete _VRAMVertexArrayRange; + _AGPVertexArrayRange= NULL; + _VRAMVertexArrayRange= NULL; + + // disable. + _SupportVBHard= false; + _SlowUnlockVBHard= false; + _MaxVerticesByVBHard= 0; + } + } + + // Init embm if present + //=========================================================== + initEMBM(); + + // Init fragment shaders if present + //=========================================================== + initFragmentShaders(); + + // Activate the default texture environnments for all stages. + //=========================================================== + for(uint stage=0;stageisBloomTexture() && tex->mipMapOff() + && (!isPowerOf2(tex->getWidth()) || !isPowerOf2(tex->getHeight()))); +} + +// *************************************************************************** +bool CDriverGL::activeFrameBufferObject(ITexture * tex) +{ + if(supportFrameBufferObject()/* && supportPackedDepthStencil()*/) + { + if(tex) + { + CTextureDrvInfosGL* gltext = (CTextureDrvInfosGL*)(ITextureDrvInfos*)(tex->TextureDrvShare->DrvTexture); + return gltext->activeFrameBufferObject(tex); + } + else + { +#ifdef USE_OPENGLES + nglBindFramebufferOES(GL_FRAMEBUFFER_OES, 0); +#else + nglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); +#endif + return true; + } + } + + return false; +} + +// -------------------------------------------------- +void CDriverGL::disableHardwareVertexProgram() +{ + H_AUTO_OGL(CDriverGL_disableHardwareVertexProgram) + _Extensions.DisableHardwareVertexProgram= true; +} + +// *************************************************************************** +void CDriverGL::disableHardwareVertexArrayAGP() +{ + H_AUTO_OGL(CDriverGL_disableHardwareVertexArrayAGP) + _Extensions.DisableHardwareVertexArrayAGP= true; +} + +// *************************************************************************** +void CDriverGL::disableHardwareTextureShader() +{ + H_AUTO_OGL(CDriverGL_disableHardwareTextureShader) + _Extensions.DisableHardwareTextureShader= true; +} + +// -------------------------------------------------- +void CDriverGL::resetTextureShaders() +{ + H_AUTO_OGL(CDriverGL_resetTextureShaders); + +#ifndef USE_OPENGLES + if (_Extensions.NVTextureShader) + { + glEnable(GL_TEXTURE_SHADER_NV); + + for (uint stage = 0; stage < inlGetNumTextStages(); ++stage) + { + _DriverGLStates.activeTextureARB(stage); + if (stage != 0) + { + glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + stage - 1); + } + + glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_NONE); + + _CurrentTexAddrMode[stage] = GL_NONE; + } + + glDisable(GL_TEXTURE_SHADER_NV); + + _NVTextureShaderEnabled = false; + } +#endif +} + +// -------------------------------------------------- +bool CDriverGL::isTextureExist(const ITexture&tex) +{ + H_AUTO_OGL(CDriverGL_isTextureExist) + bool result; + + // Create the shared Name. + std::string name; + getTextureShareName (tex, name); + + { + CSynchronized::CAccessor access(&_SyncTexDrvInfos); + TTexDrvInfoPtrMap &rTexDrvInfos = access.value(); + result = (rTexDrvInfos.find(name) != rTexDrvInfos.end()); + } + return result; +} + +// -------------------------------------------------- +bool CDriverGL::clear2D(CRGBA rgba) +{ + H_AUTO_OGL(CDriverGL_clear2D) + glClearColor((float)rgba.R/255.0f,(float)rgba.G/255.0f,(float)rgba.B/255.0f,(float)rgba.A/255.0f); + + glClear(GL_COLOR_BUFFER_BIT); + + return true; +} + +// -------------------------------------------------- +bool CDriverGL::clearZBuffer(float zval) +{ + H_AUTO_OGL(CDriverGL_clearZBuffer); + +#ifdef USE_OPENGLES + glClearDepthf(zval); +#else + glClearDepth(zval); +#endif + + _DriverGLStates.enableZWrite(true); + glClear(GL_DEPTH_BUFFER_BIT); + + return true; +} + +// -------------------------------------------------- +bool CDriverGL::clearStencilBuffer(float stencilval) +{ + H_AUTO_OGL(CDriverGL_clearStencilBuffer) + glClearStencil((int)stencilval); + + glClear(GL_STENCIL_BUFFER_BIT); + + return true; +} + +// -------------------------------------------------- +void CDriverGL::setColorMask (bool bRed, bool bGreen, bool bBlue, bool bAlpha) +{ + H_AUTO_OGL(CDriverGL_setColorMask ) + glColorMask (bRed, bGreen, bBlue, bAlpha); +} + +// -------------------------------------------------- +bool CDriverGL::swapBuffers() +{ + H_AUTO_OGL(CDriverGL_swapBuffers) + + ++ _SwapBufferCounter; + // Reset texture shaders + //resetTextureShaders(); + activeVertexProgram(NULL); + +#ifndef USE_OPENGLES + /* Yoyo: must do this (GeForce bug ??) else weird results if end render with a VBHard. + Setup a std vertex buffer to ensure NVidia synchronisation. + */ + if (!_Extensions.ARBVertexBufferObject && _Extensions.NVVertexArrayRange) + { + static CVertexBuffer dummyVB; + static bool dummyVBinit= false; + if(!dummyVBinit) + { + dummyVBinit= true; + // setup a full feature VB (maybe not useful ... :( ). + dummyVB.setVertexFormat(CVertexBuffer::PositionFlag|CVertexBuffer::NormalFlag| + CVertexBuffer::PrimaryColorFlag|CVertexBuffer::SecondaryColorFlag| + CVertexBuffer::TexCoord0Flag|CVertexBuffer::TexCoord1Flag| + CVertexBuffer::TexCoord2Flag|CVertexBuffer::TexCoord3Flag + ); + // some vertices. + dummyVB.setNumVertices(10); + } + // activate each frame to close VBHard rendering. + // NVidia: This also force a SetFence on if last VB was a VBHard, "closing" it before swap. + // + activeVertexBuffer(dummyVB); + nlassert(_CurrentVertexBufferHard==NULL); + } + + /* PATCH For Possible NVidia Synchronisation. + /*/ + // Because of Bug with GeForce, must finishFence() for all VBHard. + /*set::iterator itVBHard= _VertexBufferHardSet.Set.begin(); + while(itVBHard != _VertexBufferHardSet.Set.end() ) + { + // Need only to do it for NVidia VB ones. + if((*itVBHard)->NVidiaVertexBufferHard) + { + CVertexBufferHardGLNVidia *vbHardNV= static_cast(*itVBHard); + // If needed, "flush" these VB. + vbHardNV->finishFence(); + } + itVBHard++; + }*/ + /* Need to Do this code only if Synchronisation PATCH before not done! + AS NV_Fence GeForce Implementation says. Test each frame the NVFence, until completion. + NB: finish is not required here. Just test. This is like a "non block synchronisation" + */ + if (!_Extensions.ARBVertexBufferObject && _Extensions.NVVertexArrayRange) + { + set::iterator itVBHard= _VertexBufferHardSet.Set.begin(); + while(itVBHard != _VertexBufferHardSet.Set.end() ) + { + if((*itVBHard)->VBType == IVertexBufferHardGL::NVidiaVB) + { + CVertexBufferHardGLNVidia *vbHardNV= static_cast(*itVBHard); + if(vbHardNV->isFenceSet()) + { + // update Fence Cache. + vbHardNV->testFence(); + } + } + itVBHard++; + } + } +#endif + +#ifdef NL_OS_WINDOWS + if (_EventEmitter.getNumEmitters() > 1) // is direct input running ? + { + // flush direct input messages if any + NLMISC::safe_cast(_EventEmitter.getEmitter(1))->poll(); + } +#endif + + if (!_WndActive) + { + if (_AGPVertexArrayRange) _AGPVertexArrayRange->updateLostBuffers(); + if (_VRAMVertexArrayRange) _VRAMVertexArrayRange->updateLostBuffers(); + } + +#ifdef USE_OPENGLES + + eglSwapBuffers (_EglDisplay, _EglSurface); + +#elif defined(NL_OS_WINDOWS) + + SwapBuffers(_hDC); + +#elif defined(NL_OS_MAC) + + // TODO: maybe do this somewhere else? + if(_DestroyWindow) + { + [_autoreleasePool release]; + _autoreleasePool = [[NSAutoreleasePool alloc] init]; + } + + [_ctx flushBuffer]; + +#elif defined (NL_OS_UNIX) + + glXSwapBuffers(_dpy, _win); + +#endif // NL_OS_WINDOWS + +#ifndef USE_OPENGLES + // Activate the default texture environnments for all stages. + //=========================================================== + // This is not a requirement, but it ensure a more stable state each frame. + // (well, maybe the good reason is "it hides much more the bugs" :o) ). + for(uint stage=0;stageupdateLostBuffers(); + if (_VRAMVertexArrayRange) _VRAMVertexArrayRange->updateLostBuffers(); + return true; +} + +// -------------------------------------------------- +bool CDriverGL::release() +{ + H_AUTO_OGL(CDriverGL_release) + + // release only if the driver was initialized + if (!_Initialized) return true; + + // hide window + showWindow(false); + + // Call IDriver::release() before, to destroy textures, shaders and VBs... + IDriver::release(); + + _SwapBufferCounter = 0; + + // delete querries + while (!_OcclusionQueryList.empty()) + { + deleteOcclusionQuery(_OcclusionQueryList.front()); + } + + deleteFragmentShaders(); + + // release caustic cube map +// _CauticCubeMap = NULL; + + // Reset VertexArrayRange. + resetVertexArrayRange(); + + // delete containers + delete _AGPVertexArrayRange; + delete _VRAMVertexArrayRange; + _AGPVertexArrayRange= NULL; + _VRAMVertexArrayRange= NULL; + + // destroy window and associated ressources + destroyWindow(); + + // other uninitializations + unInit(); + + // released + _Initialized= false; + + return true; +} + +// -------------------------------------------------- +void CDriverGL::setupViewport (const class CViewport& viewport) +{ + H_AUTO_OGL(CDriverGL_setupViewport ) + + if (_win == EmptyWindow) return; + + // Setup gl viewport + uint32 clientWidth, clientHeight; + getWindowSize(clientWidth, clientHeight); + + // Backup the viewport + _CurrViewport = viewport; + + // Get viewport + float x; + float y; + float width; + float height; + viewport.getValues (x, y, width, height); + + // Render to texture : adjuste the viewport + if (_TextureTarget) + { + float factorX = 1; + float factorY = 1; + if(clientWidth) + factorX = (float)_TextureTarget->getWidth() / (float)clientWidth; + if(clientHeight) + factorY = (float)_TextureTarget->getHeight() / (float)clientHeight; + x *= factorX; + y *= factorY; + width *= factorX; + height *= factorY; + } + + // Setup gl viewport + sint ix=(sint)((float)clientWidth*x+0.5f); + clamp (ix, 0, (sint)clientWidth); + sint iy=(sint)((float)clientHeight*y+0.5f); + clamp (iy, 0, (sint)clientHeight); + sint iwidth=(sint)((float)clientWidth*width+0.5f); + clamp (iwidth, 0, (sint)clientWidth-ix); + sint iheight=(sint)((float)clientHeight*height+0.5f); + clamp (iheight, 0, (sint)clientHeight-iy); + glViewport (ix, iy, iwidth, iheight); +} + +// -------------------------------------------------- +void CDriverGL::getViewport(CViewport &viewport) +{ + H_AUTO_OGL(CDriverGL_getViewport) + viewport = _CurrViewport; +} + +// -------------------------------------------------- +void CDriverGL::setupScissor (const class CScissor& scissor) +{ + H_AUTO_OGL(CDriverGL_setupScissor ) + + if (_win == EmptyWindow) return; + + // Setup gl viewport + uint32 clientWidth, clientHeight; + getWindowSize(clientWidth, clientHeight); + + // Backup the scissor + _CurrScissor= scissor; + + // Get scissor + float x= scissor.X; + float y= scissor.Y; + float width= scissor.Width; + float height= scissor.Height; + + // Render to texture : adjuste the scissor + if (_TextureTarget) + { + float factorX = 1; + float factorY = 1; + if(clientWidth) + factorX = (float) _TextureTarget->getWidth() / (float)clientWidth; + if(clientHeight) + factorY = (float) _TextureTarget->getHeight() / (float)clientHeight; + x *= factorX; + y *= factorY; + width *= factorX; + height *= factorY; + } + + // enable or disable Scissor, but AFTER textureTarget adjust + if(x==0.f && y==0.f && width>=1.f && height>=1.f) + { + glDisable(GL_SCISSOR_TEST); + } + else + { + // Setup gl scissor + sint ix0=(sint)floor((float)clientWidth * x + 0.5f); + clamp (ix0, 0, (sint)clientWidth); + sint iy0=(sint)floor((float)clientHeight* y + 0.5f); + clamp (iy0, 0, (sint)clientHeight); + + sint ix1=(sint)floor((float)clientWidth * (x+width) + 0.5f ); + clamp (ix1, 0, (sint)clientWidth); + sint iy1=(sint)floor((float)clientHeight* (y+height) + 0.5f ); + clamp (iy1, 0, (sint)clientHeight); + + sint iwidth= ix1 - ix0; + clamp (iwidth, 0, (sint)clientWidth); + sint iheight= iy1 - iy0; + clamp (iheight, 0, (sint)clientHeight); + + glScissor (ix0, iy0, iwidth, iheight); + glEnable(GL_SCISSOR_TEST); + } +} + +uint8 CDriverGL::getBitPerPixel () +{ + H_AUTO_OGL(CDriverGL_getBitPerPixel ) + return _CurrentMode.Depth; +} + +const char *CDriverGL::getVideocardInformation () +{ + H_AUTO_OGL(CDriverGL_getVideocardInformation) + static char name[1024]; + + if (!_Initialized) return "OpenGL isn't initialized"; + + const char *vendor = (const char *) glGetString (GL_VENDOR); + const char *renderer = (const char *) glGetString (GL_RENDERER); + const char *version = (const char *) glGetString (GL_VERSION); + + smprintf(name, 1024, "OpenGL / %s / %s / %s", vendor, renderer, version); + return name; +} + +bool CDriverGL::clipRect(NLMISC::CRect &rect) +{ + H_AUTO_OGL(CDriverGL_clipRect) + // Clip the wanted rectangle with window. + uint32 width, height; + getWindowSize(width, height); + + sint32 xr=rect.right() ,yr=rect.bottom(); + + clamp((sint32&)rect.X, (sint32)0, (sint32)width); + clamp((sint32&)rect.Y, (sint32)0, (sint32)height); + clamp((sint32&)xr, (sint32)rect.X, (sint32)width); + clamp((sint32&)yr, (sint32)rect.Y, (sint32)height); + rect.Width= xr-rect.X; + rect.Height= yr-rect.Y; + + return rect.Width>0 && rect.Height>0; +} + +void CDriverGL::getBufferPart (CBitmap &bitmap, NLMISC::CRect &rect) +{ + H_AUTO_OGL(CDriverGL_getBufferPart ) + bitmap.reset(); + + if(clipRect(rect)) + { + bitmap.resize(rect.Width, rect.Height, CBitmap::RGBA); + glReadPixels (rect.X, rect.Y, rect.Width, rect.Height, GL_RGBA, GL_UNSIGNED_BYTE, bitmap.getPixels ().getPtr()); + } +} + +void CDriverGL::getZBufferPart (std::vector &zbuffer, NLMISC::CRect &rect) +{ + H_AUTO_OGL(CDriverGL_getZBufferPart ) + zbuffer.clear(); + + if(clipRect(rect)) + { + zbuffer.resize(rect.Width*rect.Height); + +#ifdef USE_OPENGLES + glReadPixels (rect.X, rect.Y, rect.Width, rect.Height, GL_DEPTH_COMPONENT16_OES, GL_FLOAT, &(zbuffer[0])); +#else + glPixelTransferf(GL_DEPTH_SCALE, 1.0f) ; + glPixelTransferf(GL_DEPTH_BIAS, 0.f) ; + glReadPixels (rect.X, rect.Y, rect.Width, rect.Height, GL_DEPTH_COMPONENT , GL_FLOAT, &(zbuffer[0])); +#endif + } +} + +void CDriverGL::getZBuffer (std::vector &zbuffer) +{ + H_AUTO_OGL(CDriverGL_getZBuffer ) + CRect rect(0,0); + getWindowSize(rect.Width, rect.Height); + getZBufferPart(zbuffer, rect); +} + +void CDriverGL::getBuffer (CBitmap &bitmap) +{ + H_AUTO_OGL(CDriverGL_getBuffer ) + CRect rect(0,0); + getWindowSize(rect.Width, rect.Height); + getBufferPart(bitmap, rect); + bitmap.flipV(); +} + +bool CDriverGL::fillBuffer (CBitmap &bitmap) +{ + H_AUTO_OGL(CDriverGL_fillBuffer ) + CRect rect(0,0); + getWindowSize(rect.Width, rect.Height); + if( rect.Width!=bitmap.getWidth() || rect.Height!=bitmap.getHeight() || bitmap.getPixelFormat()!=CBitmap::RGBA ) + return false; + +#ifdef USE_OPENGLES + GLuint textureId; + glGenTextures(1, &textureId); + glBindTexture(GL_TEXTURE_2D, textureId); + glPixelStorei(GL_UNPACK_ALIGNMENT,1); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, rect.Width, rect.Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, &(bitmap.getPixels()[0])); +// glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, smBackgroundCrop,0); + nglDrawTexfOES(0.f, 0.f, 0.f, 1.f, 1.f); +#else + glPixelStorei(GL_UNPACK_ALIGNMENT,1); + glDrawPixels (rect.Width, rect.Height, GL_RGBA, GL_UNSIGNED_BYTE, &(bitmap.getPixels()[0]) ); +#endif + + return true; +} + +// *************************************************************************** +void CDriverGL::copyFrameBufferToTexture(ITexture *tex, + uint32 level, + uint32 offsetx, + uint32 offsety, + uint32 x, + uint32 y, + uint32 width, + uint32 height, + uint cubeFace /*= 0*/ + ) +{ + H_AUTO_OGL(CDriverGL_copyFrameBufferToTexture) + bool compressed = false; + getGlTextureFormat(*tex, compressed); + nlassert(!compressed); + // first, mark the texture as valid, and make sure there is a corresponding texture in the device memory + setupTexture(*tex); + CTextureDrvInfosGL* gltext = (CTextureDrvInfosGL*)(ITextureDrvInfos*)(tex->TextureDrvShare->DrvTexture); + //if (_RenderTargetFBO) + // gltext->activeFrameBufferObject(NULL); + _DriverGLStates.activeTextureARB(0); + // setup texture mode, after activeTextureARB() + CDriverGLStates::TTextureMode textureMode= CDriverGLStates::Texture2D; + +#ifndef USE_OPENGLES + if(gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV) + textureMode = CDriverGLStates::TextureRect; +#endif + + _DriverGLStates.setTextureMode(textureMode); + if (tex->isTextureCube()) + { + if(_Extensions.ARBTextureCubeMap) + { + glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID); + glCopyTexSubImage2D(NLCubeFaceToGLCubeFace[cubeFace], level, offsetx, offsety, x, y, width, height); + } + } + else + { + glBindTexture(gltext->TextureMode, gltext->ID); + glCopyTexSubImage2D(gltext->TextureMode, level, offsetx, offsety, x, y, width, height); + } + // disable texturing. + _DriverGLStates.setTextureMode(CDriverGLStates::TextureDisabled); + _CurrentTexture[0] = NULL; + _CurrentTextureInfoGL[0] = NULL; + //if (_RenderTargetFBO) + // gltext->activeFrameBufferObject(tex); +} + +// *************************************************************************** +void CDriverGL::setPolygonMode (TPolygonMode mode) +{ + H_AUTO_OGL(CDriverGL_setPolygonMode ) + IDriver::setPolygonMode (mode); + +#ifndef USE_OPENGLES + // Set the polygon mode + switch (_PolygonMode) + { + case Filled: + glPolygonMode (GL_FRONT_AND_BACK, GL_FILL); + break; + case Line: + glPolygonMode (GL_FRONT_AND_BACK, GL_LINE); + break; + case Point: + glPolygonMode (GL_FRONT_AND_BACK, GL_POINT); + break; + } +#endif +} + +// *************************************************************************** +bool CDriverGL::fogEnabled() +{ + H_AUTO_OGL(CDriverGL_fogEnabled) + return _FogEnabled; +} + +// *************************************************************************** +void CDriverGL::enableFog(bool enable) +{ + H_AUTO_OGL(CDriverGL_enableFog) + _DriverGLStates.enableFog(enable); + _FogEnabled= enable; +} + +// *************************************************************************** +void CDriverGL::setupFog(float start, float end, CRGBA color) +{ + H_AUTO_OGL(CDriverGL_setupFog) + glFogf(GL_FOG_MODE, GL_LINEAR); + glFogf(GL_FOG_START, start); + glFogf(GL_FOG_END, end); + + _CurrentFogColor[0]= color.R/255.0f; + _CurrentFogColor[1]= color.G/255.0f; + _CurrentFogColor[2]= color.B/255.0f; + _CurrentFogColor[3]= color.A/255.0f; + + glFogfv(GL_FOG_COLOR, _CurrentFogColor); + + /** Special : with vertex program, using the extension EXT_vertex_shader, fog is emulated using 1 more constant to scale result to [0, 1] + */ + if (_Extensions.EXTVertexShader && !_Extensions.NVVertexProgram && !_Extensions.ARBVertexProgram) + { + if (!_ATIFogRangeFixed) + { + // last constant is used to store fog information (fog must be rescaled to [0, 1], because of a driver bug) + if (start != end) + { + setConstant(_EVSNumConstant, 1.f / (start - end), - end / (start - end), 0, 0); + } + else + { + setConstant(_EVSNumConstant, 0.f, 0, 0, 0); + } + } + } + _FogStart = start; + _FogEnd = end; +} + +// *************************************************************************** +float CDriverGL::getFogStart() const +{ + H_AUTO_OGL(CDriverGL_getFogStart) + return _FogStart; +} + +// *************************************************************************** +float CDriverGL::getFogEnd() const +{ + H_AUTO_OGL(CDriverGL_getFogEnd) + return _FogEnd; +} + +// *************************************************************************** +CRGBA CDriverGL::getFogColor() const +{ + H_AUTO_OGL(CDriverGL_getFogColor) + CRGBA ret; + ret.R= (uint8)(_CurrentFogColor[0]*255); + ret.G= (uint8)(_CurrentFogColor[1]*255); + ret.B= (uint8)(_CurrentFogColor[2]*255); + ret.A= (uint8)(_CurrentFogColor[3]*255); + return ret; +} + + +// *************************************************************************** +void CDriverGL::profileRenderedPrimitives(CPrimitiveProfile &pIn, CPrimitiveProfile &pOut) +{ + H_AUTO_OGL(CDriverGL_profileRenderedPrimitives) + pIn= _PrimitiveProfileIn; + pOut= _PrimitiveProfileOut; +} + + +// *************************************************************************** +uint32 CDriverGL::profileAllocatedTextureMemory() +{ + H_AUTO_OGL(CDriverGL_profileAllocatedTextureMemory) + return _AllocatedTextureMemory; +} + + +// *************************************************************************** +uint32 CDriverGL::profileSetupedMaterials() const +{ + H_AUTO_OGL(CDriverGL_profileSetupedMaterials) + return _NbSetupMaterialCall; +} + + +// *************************************************************************** +uint32 CDriverGL::profileSetupedModelMatrix() const +{ + H_AUTO_OGL(CDriverGL_profileSetupedModelMatrix) + + return _NbSetupModelMatrixCall; +} + + +// *************************************************************************** +void CDriverGL::enableUsedTextureMemorySum (bool enable) +{ + H_AUTO_OGL(CDriverGL_enableUsedTextureMemorySum ) + + if (enable) + nlinfo ("3D: PERFORMANCE INFO: enableUsedTextureMemorySum has been set to true in CDriverGL"); + _SumTextureMemoryUsed=enable; +} + + +// *************************************************************************** +uint32 CDriverGL::getUsedTextureMemory() const +{ + H_AUTO_OGL(CDriverGL_getUsedTextureMemory) + + // Sum memory used + uint32 memory=0; + + // For each texture used + set::const_iterator ite=_TextureUsed.begin(); + while (ite!=_TextureUsed.end()) + { + // Get the gl texture + CTextureDrvInfosGL* gltext; + gltext= (*ite); + + // Sum the memory used by this texture + memory+=gltext->TextureMemory; + + // Next texture + ite++; + } + + // Return the count + return memory; +} + + +// *************************************************************************** +bool CDriverGL::supportTextureShaders() const +{ + H_AUTO_OGL(CDriverGL_supportTextureShaders) + + // fully supported by NV_TEXTURE_SHADER + return _Extensions.NVTextureShader; +} + +// *************************************************************************** +bool CDriverGL::isWaterShaderSupported() const +{ + H_AUTO_OGL(CDriverGL_isWaterShaderSupported); + + if(_Extensions.ARBFragmentProgram && ARBWaterShader[0] != 0) return true; + + if (!_Extensions.EXTVertexShader && !_Extensions.NVVertexProgram && !_Extensions.ARBVertexProgram) return false; // should support vertex programs + if (!_Extensions.NVTextureShader && !_Extensions.ATIFragmentShader && !_Extensions.ARBFragmentProgram) return false; + return true; +} + +// *************************************************************************** +bool CDriverGL::isTextureAddrModeSupported(CMaterial::TTexAddressingMode /* mode */) const +{ + H_AUTO_OGL(CDriverGL_isTextureAddrModeSupported) + + if (_Extensions.NVTextureShader) + { + // all the given addessing mode are supported with this extension + return true; + } + else + { + return false; + } +} + +// *************************************************************************** +void CDriverGL::setMatrix2DForTextureOffsetAddrMode(const uint stage, const float mat[4]) +{ + H_AUTO_OGL(CDriverGL_setMatrix2DForTextureOffsetAddrMode) + + if (!supportTextureShaders()) return; + //nlassert(supportTextureShaders()); + nlassert(stage < inlGetNumTextStages() ); + _DriverGLStates.activeTextureARB(stage); + +#ifndef USE_OPENGLES + glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, mat); +#endif +} + + +// *************************************************************************** +void CDriverGL::enableNVTextureShader(bool enabled) +{ + H_AUTO_OGL(CDriverGL_enableNVTextureShader) + + if (enabled != _NVTextureShaderEnabled) + { +#ifndef USE_OPENGLES + if (enabled) + { + glEnable(GL_TEXTURE_SHADER_NV); + } + else + { + glDisable(GL_TEXTURE_SHADER_NV); + } +#endif + _NVTextureShaderEnabled = enabled; + } +} + +// *************************************************************************** +void CDriverGL::checkForPerPixelLightingSupport() +{ + H_AUTO_OGL(CDriverGL_checkForPerPixelLightingSupport) + + // we need at least 3 texture stages and cube map support + EnvCombine4 or 3 support + // TODO : support for EnvCombine3 + // TODO : support for less than 3 stages + + _SupportPerPixelShaderNoSpec = (_Extensions.NVTextureEnvCombine4 || _Extensions.ATITextureEnvCombine3) + && _Extensions.ARBTextureCubeMap + && _Extensions.NbTextureStages >= 3 + && (_Extensions.NVVertexProgram || _Extensions.ARBVertexProgram || _Extensions.EXTVertexShader); + + _SupportPerPixelShader = (_Extensions.NVTextureEnvCombine4 || _Extensions.ATITextureEnvCombine3) + && _Extensions.ARBTextureCubeMap + && _Extensions.NbTextureStages >= 2 + && (_Extensions.NVVertexProgram || _Extensions.ARBVertexProgram || _Extensions.EXTVertexShader); +} + +// *************************************************************************** +bool CDriverGL::supportPerPixelLighting(bool specular) const +{ + H_AUTO_OGL(CDriverGL_supportPerPixelLighting) + + return specular ? _SupportPerPixelShader : _SupportPerPixelShaderNoSpec; +} + +// *************************************************************************** +void CDriverGL::setPerPixelLightingLight(CRGBA diffuse, CRGBA specular, float shininess) +{ + H_AUTO_OGL(CDriverGL_setPerPixelLightingLight) + + _PPLExponent = shininess; + _PPLightDiffuseColor = diffuse; + _PPLightSpecularColor = specular; +} + +// *************************************************************************** +bool CDriverGL::supportBlendConstantColor() const +{ + H_AUTO_OGL(CDriverGL_supportBlendConstantColor) + return _Extensions.EXTBlendColor; +} + +// *************************************************************************** +void CDriverGL::setBlendConstantColor(NLMISC::CRGBA col) +{ + H_AUTO_OGL(CDriverGL_setBlendConstantColor) + + // bkup + _CurrentBlendConstantColor= col; + + // update GL + if(!_Extensions.EXTBlendColor) + return; + +#ifndef USE_OPENGLES + static const float OO255= 1.0f/255; + nglBlendColorEXT(col.R*OO255, col.G*OO255, col.B*OO255, col.A*OO255); +#endif +} + +// *************************************************************************** +NLMISC::CRGBA CDriverGL::getBlendConstantColor() const +{ + H_AUTO_OGL(CDriverGL_CDriverGL) + + return _CurrentBlendConstantColor; +} + +// *************************************************************************** +uint CDriverGL::getNbTextureStages() const +{ + H_AUTO_OGL(CDriverGL_getNbTextureStages) + return inlGetNumTextStages(); +} + +// *************************************************************************** +void CDriverGL::refreshProjMatrixFromGL() +{ + H_AUTO_OGL(CDriverGL_refreshProjMatrixFromGL) + + if (!_ProjMatDirty) return; + float mat[16]; + glGetFloatv(GL_PROJECTION_MATRIX, mat); + _GLProjMat.set(mat); + _ProjMatDirty = false; +} + +// *************************************************************************** +bool CDriverGL::supportEMBM() const +{ + H_AUTO_OGL(CDriverGL_supportEMBM); + + // For now, supported via ATI extension + return _Extensions.ATIEnvMapBumpMap; +} + +// *************************************************************************** +bool CDriverGL::isEMBMSupportedAtStage(uint stage) const +{ + H_AUTO_OGL(CDriverGL_isEMBMSupportedAtStage) + + nlassert(supportEMBM()); + nlassert(stage < IDRV_MAT_MAXTEXTURES); + return _StageSupportEMBM[stage]; +} + +// *************************************************************************** +void CDriverGL::setEMBMMatrix(const uint stage,const float mat[4]) +{ + H_AUTO_OGL(CDriverGL_setEMBMMatrix) + +#ifndef USE_OPENGLES + nlassert(supportEMBM()); + nlassert(stage < IDRV_MAT_MAXTEXTURES); + // + if (_Extensions.ATIEnvMapBumpMap) + { + _DriverGLStates.activeTextureARB(stage); + nglTexBumpParameterfvATI(GL_BUMP_ROT_MATRIX_ATI, const_cast(mat)); + } +#endif +} + +// *************************************************************************** +void CDriverGL::initEMBM() +{ + H_AUTO_OGL(CDriverGL_initEMBM); + +#ifndef USE_OPENGLES + if (supportEMBM()) + { + std::fill(_StageSupportEMBM, _StageSupportEMBM + IDRV_MAT_MAXTEXTURES, false); + if (_Extensions.ATIEnvMapBumpMap) + { + // Test which stage support EMBM + GLint numEMBMUnits; + + nglGetTexBumpParameterivATI(GL_BUMP_NUM_TEX_UNITS_ATI, &numEMBMUnits); + + std::vector EMBMUnits(numEMBMUnits); + + // get array of units that supports EMBM + nglGetTexBumpParameterivATI(GL_BUMP_TEX_UNITS_ATI, &EMBMUnits[0]); + + numEMBMUnits = std::min(numEMBMUnits, (GLint) _Extensions.NbTextureStages); + + EMBMUnits.resize(numEMBMUnits); + + uint k; + for(k = 0; k < EMBMUnits.size(); ++k) + { + uint stage = EMBMUnits[k] - GL_TEXTURE0_ARB; + if (stage < (IDRV_MAT_MAXTEXTURES - 1)) + { + _StageSupportEMBM[stage] = true; + } + } + // setup each stage to apply the bump map to the next stage (or previous if there's an unit at the last stage) + for(k = 0; k < (uint) _Extensions.NbTextureStages; ++k) + { + if (_StageSupportEMBM[k]) + { + // setup each stage so that it apply EMBM on the next stage + _DriverGLStates.activeTextureARB(k); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); + if (k != (uint) (_Extensions.NbTextureStages - 1)) + { + glTexEnvi(GL_TEXTURE_ENV, GL_BUMP_TARGET_ATI, GL_TEXTURE0_ARB + k + 1); + } + else + { + glTexEnvi(GL_TEXTURE_ENV, GL_BUMP_TARGET_ATI, GL_TEXTURE0_ARB); + } + } + } + _DriverGLStates.activeTextureARB(0); + } + } +#endif +} + +// *************************************************************************** +/** Water fragment program with extension ARB_fragment_program + */ +static const char *WaterCodeNoDiffuseForARBFragmentProgram = +"!!ARBfp1.0 \n\ +OPTION ARB_precision_hint_nicest; \n\ +PARAM bump0ScaleBias = program.env[0]; \n\ +PARAM bump1ScaleBias = program.env[1]; \n\ +ATTRIB bump0TexCoord = fragment.texcoord[0]; \n\ +ATTRIB bump1TexCoord = fragment.texcoord[1]; \n\ +ATTRIB envMapTexCoord = fragment.texcoord[2]; \n\ +OUTPUT oCol = result.color; \n\ +TEMP bmValue; \n\ +#read bump map 0 \n\ +TEX bmValue, bump0TexCoord, texture[0], 2D; \n\ +#bias result (include scaling) \n\ +MAD bmValue, bmValue, bump0ScaleBias.xxxx, bump0ScaleBias.yyzz; \n\ +ADD bmValue, bmValue, bump1TexCoord; \n\ +#read bump map 1 \n\ +TEX bmValue, bmValue, texture[1], 2D; \n\ +#bias result (include scaling) \n\ +MAD bmValue, bmValue, bump1ScaleBias.xxxx, bump1ScaleBias.yyzz; \n\ +#add envmap coord \n\ +ADD bmValue, bmValue, envMapTexCoord; \n\ +#read envmap \n\ +TEX oCol, bmValue, texture[2], 2D; \n\ +END "; + +static const char *WaterCodeNoDiffuseWithFogForARBFragmentProgram = +"!!ARBfp1.0 \n\ +OPTION ARB_precision_hint_nicest; \n\ +PARAM bump0ScaleBias = program.env[0]; \n\ +PARAM bump1ScaleBias = program.env[1]; \n\ +PARAM fogColor = state.fog.color; \n\ +PARAM fogFactor = program.env[2]; \n\ +ATTRIB bump0TexCoord = fragment.texcoord[0]; \n\ +ATTRIB bump1TexCoord = fragment.texcoord[1]; \n\ +ATTRIB envMapTexCoord = fragment.texcoord[2]; \n\ +ATTRIB fogValue = fragment.fogcoord; \n\ +OUTPUT oCol = result.color; \n\ +TEMP bmValue; \n\ +TEMP envMap; \n\ +TEMP tmpFog; \n\ +#read bump map 0 \n\ +TEX bmValue, bump0TexCoord, texture[0], 2D; \n\ +#bias result (include scaling) \n\ +MAD bmValue, bmValue, bump0ScaleBias.xxxx, bump0ScaleBias.yyzz; \n\ +ADD bmValue, bmValue, bump1TexCoord; \n\ +#read bump map 1 \n\ +TEX bmValue, bmValue, texture[1], 2D; \n\ +#bias result (include scaling) \n\ +MAD bmValue, bmValue, bump1ScaleBias.xxxx, bump1ScaleBias.yyzz; \n\ +#add envmap coord \n\ +ADD bmValue, bmValue, envMapTexCoord; \n\ +#read envmap \n\ +TEX envMap, bmValue, texture[2], 2D; \n\ +#compute fog \n\ +MAD_SAT tmpFog, fogValue.x, fogFactor.x, fogFactor.y; \n\ +LRP oCol, tmpFog.x, envMap, fogColor; \n\ +END "; + +// ************************************************************************************** +/** Water fragment program with extension ARB_fragment_program and a diffuse map applied + */ +static const char *WaterCodeForARBFragmentProgram = +"!!ARBfp1.0 \n\ +OPTION ARB_precision_hint_nicest; \n\ +PARAM bump0ScaleBias = program.env[0]; \n\ +PARAM bump1ScaleBias = program.env[1]; \n\ +ATTRIB bump0TexCoord = fragment.texcoord[0]; \n\ +ATTRIB bump1TexCoord = fragment.texcoord[1]; \n\ +ATTRIB envMapTexCoord = fragment.texcoord[2]; \n\ +ATTRIB diffuseTexCoord = fragment.texcoord[3]; \n\ +OUTPUT oCol = result.color; \n\ +TEMP bmValue; \n\ +TEMP diffuse; \n\ +TEMP envMap; \n\ +#read bump map 0 \n\ +TEX bmValue, bump0TexCoord, texture[0], 2D; \n\ +#bias result (include scaling) \n\ +MAD bmValue, bmValue, bump0ScaleBias.xxxx, bump0ScaleBias.yyzz; \n\ +ADD bmValue, bmValue, bump1TexCoord; \n\ +#read bump map 1 \n\ +TEX bmValue, bmValue, texture[1], 2D; \n\ +#bias result (include scaling) \n\ +MAD bmValue, bmValue, bump1ScaleBias.xxxx, bump1ScaleBias.yyzz; \n\ +#add envmap coord \n\ +ADD bmValue, bmValue, envMapTexCoord; \n\ +#read envmap \n\ +TEX envMap, bmValue, texture[2], 2D; \n\ +#read diffuse \n\ +TEX diffuse, diffuseTexCoord, texture[3], 2D; \n\ +#modulate diffuse and envmap to get result \n\ +MUL oCol, diffuse, envMap; \n\ +END "; + +static const char *WaterCodeWithFogForARBFragmentProgram = +"!!ARBfp1.0 \n\ +OPTION ARB_precision_hint_nicest; \n\ +PARAM bump0ScaleBias = program.env[0]; \n\ +PARAM bump1ScaleBias = program.env[1]; \n\ +PARAM fogColor = state.fog.color; \n\ +PARAM fogFactor = program.env[2]; \n\ +ATTRIB bump0TexCoord = fragment.texcoord[0]; \n\ +ATTRIB bump1TexCoord = fragment.texcoord[1]; \n\ +ATTRIB envMapTexCoord = fragment.texcoord[2]; \n\ +ATTRIB diffuseTexCoord = fragment.texcoord[3]; \n\ +ATTRIB fogValue = fragment.fogcoord; \n\ +OUTPUT oCol = result.color; \n\ +TEMP bmValue; \n\ +TEMP diffuse; \n\ +TEMP envMap; \n\ +TEMP tmpFog; \n\ +#read bump map 0 \n\ +TEX bmValue, bump0TexCoord, texture[0], 2D; \n\ +#bias result (include scaling) \n\ +MAD bmValue, bmValue, bump0ScaleBias.xxxx, bump0ScaleBias.yyzz; \n\ +ADD bmValue, bmValue, bump1TexCoord; \n\ +#read bump map 1 \n\ +TEX bmValue, bmValue, texture[1], 2D; \n\ +#bias result (include scaling) \n\ +MAD bmValue, bmValue, bump1ScaleBias.xxxx, bump1ScaleBias.yyzz; \n\ +#add envmap coord \n\ +ADD bmValue, bmValue, envMapTexCoord; \n\ +TEX envMap, bmValue, texture[2], 2D; \n\ +TEX diffuse, diffuseTexCoord, texture[3], 2D; \n\ +MAD_SAT tmpFog, fogValue.x, fogFactor.x, fogFactor.y; \n\ +#modulate diffuse and envmap to get result \n\ +MUL diffuse, diffuse, envMap; \n\ +LRP oCol, tmpFog.x, diffuse, fogColor; \n\ +END "; + +// *************************************************************************** +/** Load a ARB_fragment_program_code, and ensure it is loaded natively + */ +uint loadARBFragmentProgramStringNative(const char *prog, bool forceNativePrograms) +{ + H_AUTO_OGL(loadARBFragmentProgramStringNative); + if (!prog) + { + nlwarning("The param 'prog' is null, cannot load"); + return 0; + } + +#ifndef USE_OPENGLES + GLuint progID; + nglGenProgramsARB(1, &progID); + if (!progID) + { + nlwarning("glGenProgramsARB returns a progID NULL"); + return 0; + } + nglBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, progID); + GLint errorPos, isNative; + nglProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, (GLsizei)strlen(prog), prog); + nglBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0); + glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorPos); + nglGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &isNative); + if (errorPos == -1) + { + if (!isNative && forceNativePrograms) + { + nlwarning("Fragment program isn't supported natively; purging program"); + nglDeleteProgramsARB(1, &progID); + return 0; + } + return progID; + } + else + { + nlwarning("init fragment program failed: errorPos: %d isNative: %d: %s", errorPos, isNative, (const char*)glGetString(GL_PROGRAM_ERROR_STRING_ARB)); + } +#endif + + return 0; +} + +// *************************************************************************** +/** R200 Fragment Shader : + * Send fragment shader to fetch a perturbed envmap from the addition of 2 bumpmap + * The result is in R2 after the 2nd pass + */ +static void fetchPerturbedEnvMapR200() +{ + H_AUTO_OGL(CDriverGL_fetchPerturbedEnvMapR200); + +#ifndef USE_OPENGLES + //////////// + // PASS 1 // + //////////// + nglSampleMapATI(GL_REG_0_ATI, GL_TEXTURE0_ARB, GL_SWIZZLE_STR_ATI); // sample bump map 0 + nglSampleMapATI(GL_REG_1_ATI, GL_TEXTURE1_ARB, GL_SWIZZLE_STR_ATI); // sample bump map 1 + nglPassTexCoordATI(GL_REG_2_ATI, GL_TEXTURE2_ARB, GL_SWIZZLE_STR_ATI); // get texcoord for envmap + + nglColorFragmentOp3ATI(GL_MAD_ATI, GL_REG_2_ATI, GL_NONE, GL_NONE, GL_REG_0_ATI, GL_NONE, GL_BIAS_BIT_ATI|GL_2X_BIT_ATI, GL_CON_0_ATI, GL_NONE, GL_NONE, GL_REG_2_ATI, GL_NONE, GL_NONE); // scale bumpmap 1 & add envmap coords + nglColorFragmentOp3ATI(GL_MAD_ATI, GL_REG_2_ATI, GL_NONE, GL_NONE, GL_REG_1_ATI, GL_NONE, GL_BIAS_BIT_ATI|GL_2X_BIT_ATI, GL_CON_1_ATI, GL_NONE, GL_NONE, GL_REG_2_ATI, GL_NONE, GL_NONE); // scale bumpmap 2 & add to bump map 1 + + //////////// + // PASS 2 // + //////////// + nglSampleMapATI(GL_REG_2_ATI, GL_REG_2_ATI, GL_SWIZZLE_STR_ATI); // fetch envmap at perturbed texcoords +#endif +} + +// *************************************************************************** +void CDriverGL::forceNativeFragmentPrograms(bool nativeOnly) +{ + _ForceNativeFragmentPrograms = nativeOnly; +} + +// *************************************************************************** +void CDriverGL::initFragmentShaders() +{ + H_AUTO_OGL(CDriverGL_initFragmentShaders); + +#ifndef USE_OPENGLES + /////////////////// + // WATER SHADERS // + /////////////////// + + // the ARB_fragment_program is prioritary over other extensions when present + if (_Extensions.ARBFragmentProgram) + { + nlinfo("WATER: Try ARB_fragment_program"); + ARBWaterShader[0] = loadARBFragmentProgramStringNative(WaterCodeNoDiffuseForARBFragmentProgram, _ForceNativeFragmentPrograms); + ARBWaterShader[1] = loadARBFragmentProgramStringNative(WaterCodeNoDiffuseWithFogForARBFragmentProgram, _ForceNativeFragmentPrograms); + ARBWaterShader[2] = loadARBFragmentProgramStringNative(WaterCodeForARBFragmentProgram, _ForceNativeFragmentPrograms); + ARBWaterShader[3] = loadARBFragmentProgramStringNative(WaterCodeWithFogForARBFragmentProgram, _ForceNativeFragmentPrograms); + bool ok = true; + for(uint k = 0; k < 4; ++k) + { + if (!ARBWaterShader[k]) + { + ok = false; + deleteARBFragmentPrograms(); + nlwarning("WATER: fragment %d is not loaded, not using ARB_fragment_program at all", k); + break; + } + } + if (ok) + { + nlinfo("WATER: ARB_fragment_program OK, Use it"); + return; + } + } + + if (_Extensions.ATIFragmentShader) + { + nlinfo("WATER: Try ATI_fragment_program"); + /////////// + // WATER // + /////////// + ATIWaterShaderHandleNoDiffuseMap = nglGenFragmentShadersATI(1); + + ATIWaterShaderHandle = nglGenFragmentShadersATI(1); + + if (!ATIWaterShaderHandle || !ATIWaterShaderHandleNoDiffuseMap) + { + ATIWaterShaderHandleNoDiffuseMap = ATIWaterShaderHandle = 0; + nlwarning("Couldn't generate water shader using ATI_fragment_shader !"); + } + else + { + glGetError(); + // Water shader for R200 : we just add the 2 bump map contributions (du, dv). We then use this contribution to perturbate the envmap + nglBindFragmentShaderATI(ATIWaterShaderHandleNoDiffuseMap); + nglBeginFragmentShaderATI(); + // + fetchPerturbedEnvMapR200(); + nglColorFragmentOp1ATI(GL_MOV_ATI, GL_REG_0_ATI, GL_NONE, GL_NONE, GL_REG_2_ATI, GL_NONE, GL_NONE); + nglAlphaFragmentOp1ATI(GL_MOV_ATI, GL_REG_0_ATI, GL_NONE, GL_REG_2_ATI, GL_NONE, GL_NONE); + // + nglEndFragmentShaderATI(); + GLenum error = glGetError(); + nlassert(error == GL_NONE); + + // The same but with a diffuse map added + nglBindFragmentShaderATI(ATIWaterShaderHandle); + nglBeginFragmentShaderATI(); + // + fetchPerturbedEnvMapR200(); + + nglSampleMapATI(GL_REG_3_ATI, GL_TEXTURE3_ARB, GL_SWIZZLE_STR_ATI); // fetch envmap at perturbed texcoords + nglColorFragmentOp2ATI(GL_MUL_ATI, GL_REG_0_ATI, GL_NONE, GL_NONE, GL_REG_3_ATI, GL_NONE, GL_NONE, GL_REG_2_ATI, GL_NONE, GL_NONE); // scale bumpmap 1 & add envmap coords + nglAlphaFragmentOp2ATI(GL_MUL_ATI, GL_REG_0_ATI, GL_NONE, GL_REG_3_ATI, GL_NONE, GL_NONE, GL_REG_2_ATI, GL_NONE, GL_NONE); + + nglEndFragmentShaderATI(); + error = glGetError(); + nlassert(error == GL_NONE); + nglBindFragmentShaderATI(0); + } + + //////////// + // CLOUDS // + //////////// + ATICloudShaderHandle = nglGenFragmentShadersATI(1); + + if (!ATICloudShaderHandle) + { + nlwarning("Couldn't generate cloud shader using ATI_fragment_shader !"); + } + else + { + glGetError(); + nglBindFragmentShaderATI(ATICloudShaderHandle); + nglBeginFragmentShaderATI(); + // + nglSampleMapATI(GL_REG_0_ATI, GL_TEXTURE0_ARB, GL_SWIZZLE_STR_ATI); // sample texture 0 + nglSampleMapATI(GL_REG_1_ATI, GL_TEXTURE1_ARB, GL_SWIZZLE_STR_ATI); // sample texture 1 + // lerp between tex 0 & tex 1 using diffuse alpha + nglAlphaFragmentOp3ATI(GL_LERP_ATI, GL_REG_0_ATI, GL_NONE, GL_PRIMARY_COLOR_ARB, GL_NONE, GL_NONE, GL_REG_0_ATI, GL_NONE, GL_NONE, GL_REG_1_ATI, GL_NONE, GL_NONE); + //nglAlphaFragmentOp1ATI(GL_MOV_ATI, GL_REG_0_ATI, GL_NONE, GL_REG_0_ATI, GL_NONE, GL_NONE); + // output 0 as RGB + //nglColorFragmentOp1ATI(GL_MOV_ATI, GL_REG_0_ATI, GL_NONE, GL_NONE, GL_ZERO, GL_NONE, GL_NONE); + // output alpha multiplied by constant 0 + nglAlphaFragmentOp2ATI(GL_MUL_ATI, GL_REG_0_ATI, GL_NONE, GL_REG_0_ATI, GL_NONE, GL_NONE, GL_CON_0_ATI, GL_NONE, GL_NONE); + nglEndFragmentShaderATI(); + GLenum error = glGetError(); + nlassert(error == GL_NONE); + nglBindFragmentShaderATI(0); + } + } + + // if none of the previous programs worked, fallback on NV_texture_shader, or (todo) simpler shader +#endif +} + +// *************************************************************************** +void CDriverGL::deleteARBFragmentPrograms() +{ + H_AUTO_OGL(CDriverGL_deleteARBFragmentPrograms); + +#ifndef USE_OPENGLES + for(uint k = 0; k < 4; ++k) + { + if (ARBWaterShader[k]) + { + GLuint progId = (GLuint) ARBWaterShader[k]; + nglDeleteProgramsARB(1, &progId); + ARBWaterShader[k] = 0; + } + } +#endif +} + +// *************************************************************************** +void CDriverGL::deleteFragmentShaders() +{ + H_AUTO_OGL(CDriverGL_deleteFragmentShaders) + +#ifndef USE_OPENGLES + deleteARBFragmentPrograms(); + + if (ATIWaterShaderHandleNoDiffuseMap) + { + nglDeleteFragmentShaderATI((GLuint) ATIWaterShaderHandleNoDiffuseMap); + ATIWaterShaderHandleNoDiffuseMap = 0; + } + if (ATIWaterShaderHandle) + { + nglDeleteFragmentShaderATI((GLuint) ATIWaterShaderHandle); + ATIWaterShaderHandle = 0; + } + if (ATICloudShaderHandle) + { + nglDeleteFragmentShaderATI((GLuint) ATICloudShaderHandle); + ATICloudShaderHandle = 0; + } +#endif +} + +// *************************************************************************** +void CDriverGL::finish() +{ + H_AUTO_OGL(CDriverGL_finish) + glFinish(); +} + +// *************************************************************************** +void CDriverGL::flush() +{ + H_AUTO_OGL(CDriverGL_flush) + glFlush(); +} + +// *************************************************************************** +void CDriverGL::setSwapVBLInterval(uint interval) +{ + H_AUTO_OGL(CDriverGL_setSwapVBLInterval) + + if (!_Initialized) + return; + + bool res = true; + +#ifdef USE_OPENGLES + res = eglSwapInterval(_EglDisplay, _Interval) == EGL_TRUE; +#elif defined(NL_OS_WINDOWS) + if(_Extensions.WGLEXTSwapControl) + { + res = nwglSwapIntervalEXT(_Interval) == TRUE; + } +#elif defined(NL_OS_MAC) +#elif defined(NL_OS_UNIX) + if (_win && _Extensions.GLXEXTSwapControl) + { + res = nglXSwapIntervalEXT(_dpy, _win, interval) == 0; + } + else if (_Extensions.GLXSGISwapControl) + { + res = nglXSwapIntervalSGI(interval) == 0; + } + else if (_Extensions.GLXMESASwapControl) + { + res = nglXSwapIntervalMESA(interval) == 0; + } +#endif + + if (res) + { + _Interval = interval; + } + else + { + nlwarning("Could not set swap interval"); + } +} + +// *************************************************************************** +uint CDriverGL::getSwapVBLInterval() +{ + H_AUTO_OGL(CDriverGL_getSwapVBLInterval) + +#ifdef USE_OPENGLES +#elif defined(NL_OS_WINDOWS) + if(_Extensions.WGLEXTSwapControl) + { + return nwglGetSwapIntervalEXT(); + } +#elif defined(NL_OS_MAC) +#elif defined(NL_OS_UNIX) + if (_win && _Extensions.GLXEXTSwapControl) + { + uint swap, maxSwap; + glXQueryDrawable(_dpy, _win, GLX_SWAP_INTERVAL_EXT, &swap); + glXQueryDrawable(_dpy, _win, GLX_MAX_SWAP_INTERVAL_EXT, &maxSwap); + nlwarning("The swap interval is %u and the max swap interval is %u", swap, maxSwap); + return swap; + } + else if (_Extensions.GLXMESASwapControl) + { + return nglXGetSwapIntervalMESA(); + } +#endif + + return _Interval; +} + +// *************************************************************************** +void CDriverGL::enablePolygonSmoothing(bool smooth) +{ + H_AUTO_OGL(CDriverGL_enablePolygonSmoothing); + +#ifndef USE_OPENGLES + if(smooth) + glEnable(GL_POLYGON_SMOOTH); + else + glDisable(GL_POLYGON_SMOOTH); +#endif + + _PolygonSmooth= smooth; +} + +// *************************************************************************** +bool CDriverGL::isPolygonSmoothingEnabled() const +{ + H_AUTO_OGL(CDriverGL_isPolygonSmoothingEnabled) + + return _PolygonSmooth; +} + +// *************************************************************************** +void CDriverGL::startProfileVBHardLock() +{ + if(_VBHardProfiling) + return; + + // start + _VBHardProfiles.clear(); + _VBHardProfiles.reserve(50); + _VBHardProfiling= true; + _CurVBHardLockCount= 0; + _NumVBHardProfileFrame= 0; +} + +// *************************************************************************** +void CDriverGL::endProfileVBHardLock(vector &result) +{ + if(!_VBHardProfiling) + return; + + // Fill infos. + result.clear(); + result.resize(_VBHardProfiles.size() + 1); + float total= 0; + for(uint i=0;i<_VBHardProfiles.size();i++) + { + const uint tmpSize= 256; + char tmp[tmpSize]; + CVBHardProfile &vbProf= _VBHardProfiles[i]; + const char *vbName; + if(vbProf.VBHard && !vbProf.VBHard->getName().empty()) + { + vbName= vbProf.VBHard->getName().c_str(); + } + else + { + vbName= "????"; + } + // Display in ms. + float timeLock= (float)CTime::ticksToSecond(vbProf.AccumTime)*1000 / max(_NumVBHardProfileFrame,1U); + smprintf(tmp, tmpSize, "%16s%c: %2.3f ms", vbName, vbProf.Change?'*':' ', timeLock ); + total+= timeLock; + + result[i]= tmp; + } + result[_VBHardProfiles.size()]= toString("Total: %2.3f", total); + + // clear. + _VBHardProfiling= false; + contReset(_VBHardProfiles); +} + +// *************************************************************************** +void CDriverGL::appendVBHardLockProfile(NLMISC::TTicks time, CVertexBuffer *vb) +{ + // must allocate a new place? + if(_CurVBHardLockCount>=_VBHardProfiles.size()) + { + _VBHardProfiles.resize(_VBHardProfiles.size()+1); + // set the original VBHard + _VBHardProfiles[_CurVBHardLockCount].VBHard= vb; + } + + // Accumulate. + _VBHardProfiles[_CurVBHardLockCount].AccumTime+= time; + // if change of VBHard for this chrono place + if(_VBHardProfiles[_CurVBHardLockCount].VBHard != vb) + { + // flag, and set new + _VBHardProfiles[_CurVBHardLockCount].VBHard= vb; + _VBHardProfiles[_CurVBHardLockCount].Change= true; + } + + // next! + _CurVBHardLockCount++; +} + +// *************************************************************************** +void CDriverGL::startProfileIBLock() +{ + // not implemented +} + +// *************************************************************************** +void CDriverGL::endProfileIBLock(std::vector &/* result */) +{ + // not implemented +} + +// *************************************************************************** +void CDriverGL::profileIBAllocation(std::vector &/* result */) +{ + // not implemented +} + +// *************************************************************************** +void CDriverGL::profileVBHardAllocation(std::vector &result) +{ + result.clear(); + result.reserve(1000); + result.push_back(toString("Memory Allocated: %4d Ko in AGP / %4d Ko in VRAM", + getAvailableVertexAGPMemory()/1000, getAvailableVertexVRAMMemory()/1000 )); + result.push_back(toString("Num VBHard: %d", _VertexBufferHardSet.Set.size())); + + uint totalMemUsed= 0; + set::iterator it; + for(it= _VertexBufferHardSet.Set.begin(); it!=_VertexBufferHardSet.Set.end(); it++) + { + IVertexBufferHardGL *vbHard= *it; + if(vbHard) + { + uint vSize= vbHard->VB->getVertexSize(); + uint numVerts= vbHard->VB->getNumVertices(); + totalMemUsed+= vSize*numVerts; + } + } + result.push_back(toString("Mem Used: %4d Ko", totalMemUsed/1000) ); + + for(it= _VertexBufferHardSet.Set.begin(); it!=_VertexBufferHardSet.Set.end(); it++) + { + IVertexBufferHardGL *vbHard= *it; + if(vbHard) + { + uint vSize= vbHard->VB->getVertexSize(); + uint numVerts= vbHard->VB->getNumVertices(); + result.push_back(toString(" %16s: %4d ko (format: %d / numVerts: %d)", + vbHard->VB->getName().c_str(), vSize*numVerts/1000, vSize, numVerts )); + } + } +} + +// *************************************************************************** +bool CDriverGL::supportCloudRenderSinglePass() const +{ + H_AUTO_OGL(CDriverGL_supportCloudRenderSinglePass) + + //return _Extensions.NVTextureEnvCombine4 || (_Extensions.ATIXTextureEnvRoute && _Extensions.EXTTextureEnvCombine); + // there are slowdown for now with ati fragment shader... don't know why + return _Extensions.NVTextureEnvCombine4 || _Extensions.ATIFragmentShader; +} + +// *************************************************************************** +void CDriverGL::retrieveATIDriverVersion() +{ + H_AUTO_OGL(CDriverGL_retrieveATIDriverVersion) + _ATIDriverVersion = 0; + // we may need this driver version to fix flaws of previous ati drivers version (fog issue with V.P) +#ifdef NL_OS_WINDOWS + // get from the registry + HKEY parentKey; + // open key about current video card + LONG result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E968-E325-11CE-BFC1-08002BE10318}", 0, KEY_READ, &parentKey); + if (result == ERROR_SUCCESS) + { + // find last config + DWORD keyIndex = 0; + uint latestConfigVersion = 0; + char subKeyName[256]; + char latestSubKeyName[256] = ""; + DWORD nameBufferSize = sizeof(subKeyName) / sizeof(subKeyName[0]); + FILETIME lastWriteTime; + bool configFound = false; + for(;;) + { + nameBufferSize = sizeof(subKeyName) / sizeof(subKeyName[0]); + result = RegEnumKeyEx(parentKey, keyIndex, subKeyName, &nameBufferSize, NULL, NULL, NULL, &lastWriteTime); + if (result == ERROR_NO_MORE_ITEMS) break; + if (result == ERROR_SUCCESS) + { + // see if the name is numerical. + bool isNumerical = true; + for(uint k = 0; k < nameBufferSize; ++k) + { + if (!isdigit(subKeyName[k])) + { + isNumerical = false; + break; + } + } + if (isNumerical) + { + uint configVersion; + fromString((const char*)subKeyName, configVersion); + if (configVersion >= latestConfigVersion) + { + configFound = true; + latestConfigVersion = configVersion; + strcpy(latestSubKeyName, subKeyName); + } + } + ++ keyIndex; + } + else + { + RegCloseKey(parentKey); + return; + } + } + if (configFound) + { + HKEY subKey; + result = RegOpenKeyEx(parentKey, latestSubKeyName, 0, KEY_READ, &subKey); + if (result == ERROR_SUCCESS) + { + // see if it is a radeon card + DWORD valueType; + char driverDesc[256]; + DWORD driverDescBufSize = sizeof(driverDesc) / sizeof(driverDesc[0]); + result = RegQueryValueEx(subKey, "DriverDesc", NULL, &valueType, (unsigned char *) driverDesc, &driverDescBufSize); + if (result == ERROR_SUCCESS && valueType == REG_SZ) + { + toLower(driverDesc); + if (strstr(driverDesc, "radeon")) // is it a radeon card ? + { + char driverVersion[256]; + DWORD driverVersionBufSize = sizeof(driverVersion) / sizeof(driverVersion[0]); + result = RegQueryValueEx(subKey, "DriverVersion", NULL, &valueType, (unsigned char *) driverVersion, &driverVersionBufSize); + if (result == ERROR_SUCCESS && valueType == REG_SZ) + { + int subVersionNumber[4]; + if (sscanf(driverVersion, "%d.%d.%d.%d", &subVersionNumber[0], &subVersionNumber[1], &subVersionNumber[2], &subVersionNumber[3]) == 4) + { + _ATIDriverVersion = (uint) subVersionNumber[3]; + /** see if fog range for V.P is bad in that driver version (is so, do a fix during vertex program conversion to EXT_vertex_shader + * In earlier versions of the driver, fog coordinates had to be output in the [0, 1] range + * From the 6.14.10.6343 driver, fog output must be in world units + */ + if (_ATIDriverVersion < 6343) + { + _ATIFogRangeFixed = false; + } + } + } + } + } + } + RegCloseKey(subKey); + } + RegCloseKey(parentKey); + } +#elif defined(NL_OS_MAC) +# warning "OpenGL Driver: Missing Mac Implementation for ATI version retrieval" + nlwarning("OpenGL Driver: Missing Mac Implementation for ATI version retrieval"); + +#elif defined (NL_OS_UNIX) + // TODO for Linux: implement retrieveATIDriverVersion... assuming versions under linux are probably different +#endif +} + +// *************************************************************************** +bool CDriverGL::supportMADOperator() const +{ + H_AUTO_OGL(CDriverGL_supportMADOperator) + + return _Extensions.NVTextureEnvCombine4 || _Extensions.ATITextureEnvCombine3; +} + +// *************************************************************************** +uint CDriverGL::getNumAdapter() const +{ + H_AUTO_OGL(CDriverGL_getNumAdapter) + + return 1; +} + +// *************************************************************************** +bool CDriverGL::getAdapter(uint adapter, CAdapter &desc) const +{ + H_AUTO_OGL(CDriverGL_getAdapter) + + if (adapter == 0) + { + desc.DeviceName = (const char *) glGetString (GL_RENDERER); + desc.Driver = (const char *) glGetString (GL_VERSION); + desc.Vendor= (const char *) glGetString (GL_VENDOR); + + desc.Description = "Default OpenGL adapter"; + desc.DeviceId = 0; + desc.DriverVersion = 0; + desc.Revision = 0; + desc.SubSysId = 0; + desc.VendorId = 0; + return true; + } + return false; +} + +// *************************************************************************** +bool CDriverGL::setAdapter(uint adapter) +{ + H_AUTO_OGL(CDriverGL_setAdapter) + + return adapter == 0; +} + +// *************************************************************************** +CVertexBuffer::TVertexColorType CDriverGL::getVertexColorFormat() const +{ + H_AUTO_OGL(CDriverGL_CDriverGL) + + return CVertexBuffer::TRGBA; +} + +// *************************************************************************** +bool CDriverGL::activeShader(CShader * /* shd */) +{ + H_AUTO_OGL(CDriverGL_activeShader) + + return false; +} + +// *************************************************************************** +void CDriverGL::startBench (bool wantStandardDeviation, bool quick, bool reset) +{ + CHTimer::startBench (wantStandardDeviation, quick, reset); +} + +// *************************************************************************** +void CDriverGL::endBench () +{ + CHTimer::endBench (); +} + +// *************************************************************************** +void CDriverGL::displayBench (class NLMISC::CLog *log) +{ + // diplay + CHTimer::displayHierarchicalByExecutionPathSorted(log, CHTimer::TotalTime, true, 48, 2); + CHTimer::displayHierarchical(log, true, 48, 2); + CHTimer::displayByExecutionPath(log, CHTimer::TotalTime); + CHTimer::display(log, CHTimer::TotalTime); + CHTimer::display(log, CHTimer::TotalTimeWithoutSons); +} + +#ifdef NL_DEBUG +void CDriverGL::dumpMappedBuffers() +{ + _AGPVertexArrayRange->dumpMappedBuffers(); +} +#endif + +// *************************************************************************** +void CDriverGL::checkTextureOn() const +{ + H_AUTO_OGL(CDriverGL_checkTextureOn) + // tmp for debug + CDriverGLStates &dgs = const_cast(_DriverGLStates); + uint currTexStage = dgs.getActiveTextureARB(); + for(uint k = 0; k < this->getNbTextureStages(); ++k) + { + dgs.activeTextureARB(k); + GLboolean flag2D; + GLboolean flagCM; + GLboolean flagTR; + glGetBooleanv(GL_TEXTURE_2D, &flag2D); + glGetBooleanv(GL_TEXTURE_CUBE_MAP_ARB, &flagCM); +#ifdef USE_OPENGLES + flagTR = true; // always true in OpenGL ES +#else + glGetBooleanv(GL_TEXTURE_RECTANGLE_NV, &flagTR); +#endif + switch(dgs.getTextureMode()) + { + case CDriverGLStates::TextureDisabled: + nlassert(!flag2D); + nlassert(!flagCM); + break; + case CDriverGLStates::Texture2D: + nlassert(flag2D); + nlassert(!flagCM); + break; + case CDriverGLStates::TextureRect: + nlassert(flagTR); + nlassert(!flagCM); + break; + case CDriverGLStates::TextureCubeMap: + nlassert(!flag2D); + nlassert(flagCM); + break; + default: + break; + } + } + dgs.activeTextureARB(currTexStage); +} + +// *************************************************************************** +bool CDriverGL::supportOcclusionQuery() const +{ + H_AUTO_OGL(CDriverGL_supportOcclusionQuery) + return _Extensions.NVOcclusionQuery; +} + +// *************************************************************************** +bool CDriverGL::supportTextureRectangle() const +{ + H_AUTO_OGL(CDriverGL_supportTextureRectangle); + + return (_Extensions.NVTextureRectangle || _Extensions.EXTTextureRectangle || _Extensions.ARBTextureRectangle); +} + +// *************************************************************************** +bool CDriverGL::supportPackedDepthStencil() const +{ + H_AUTO_OGL(CDriverGL_supportPackedDepthStencil); + + return _Extensions.PackedDepthStencil; +} + +// *************************************************************************** +bool CDriverGL::supportFrameBufferObject() const +{ + H_AUTO_OGL(CDriverGL_supportFrameBufferObject); + + return _Extensions.FrameBufferObject; +} + +// *************************************************************************** +IOcclusionQuery *CDriverGL::createOcclusionQuery() +{ + H_AUTO_OGL(CDriverGL_createOcclusionQuery) + nlassert(_Extensions.NVOcclusionQuery); + +#ifndef USE_OPENGLES + GLuint id; + nglGenOcclusionQueriesNV(1, &id); + if (id == 0) return NULL; + COcclusionQueryGL *oqgl = new COcclusionQueryGL; + oqgl->Driver = this; + oqgl->ID = id; + oqgl->OcclusionType = IOcclusionQuery::NotAvailable; + _OcclusionQueryList.push_front(oqgl); + oqgl->Iterator = _OcclusionQueryList.begin(); + oqgl->VisibleCount = 0; + return oqgl; +#else + return NULL; +#endif +} + +// *************************************************************************** +void CDriverGL::deleteOcclusionQuery(IOcclusionQuery *oq) +{ + H_AUTO_OGL(CDriverGL_deleteOcclusionQuery); + +#ifndef USE_OPENGLES + if (!oq) return; + COcclusionQueryGL *oqgl = NLMISC::safe_cast(oq); + nlassert((CDriverGL *) oqgl->Driver == this); // should come from the same driver + oqgl->Driver = NULL; + nlassert(oqgl->ID != 0); + GLuint id = oqgl->ID; + nglDeleteOcclusionQueriesNV(1, &id); + _OcclusionQueryList.erase(oqgl->Iterator); + if (oqgl == _CurrentOcclusionQuery) + { + _CurrentOcclusionQuery = NULL; + } + delete oqgl; +#endif +} + +// *************************************************************************** +void COcclusionQueryGL::begin() +{ + H_AUTO_OGL(COcclusionQueryGL_begin); + +#ifndef USE_OPENGLES + nlassert(Driver); + nlassert(Driver->_CurrentOcclusionQuery == NULL); // only one query at a time + nlassert(ID); + nglBeginOcclusionQueryNV(ID); + Driver->_CurrentOcclusionQuery = this; + OcclusionType = NotAvailable; + VisibleCount = 0; +#endif +} + +// *************************************************************************** +void COcclusionQueryGL::end() +{ + H_AUTO_OGL(COcclusionQueryGL_end); + +#ifndef USE_OPENGLES + nlassert(Driver); + nlassert(Driver->_CurrentOcclusionQuery == this); // only one query at a time + nlassert(ID); + nglEndOcclusionQueryNV(); + Driver->_CurrentOcclusionQuery = NULL; +#endif +} + +// *************************************************************************** +IOcclusionQuery::TOcclusionType COcclusionQueryGL::getOcclusionType() +{ + H_AUTO_OGL(COcclusionQueryGL_getOcclusionType); + +#ifndef USE_OPENGLES + nlassert(Driver); + nlassert(ID); + nlassert(Driver->_CurrentOcclusionQuery != this); // can't query result between a begin/end pair! + if (OcclusionType == NotAvailable) + { + GLuint result; + // retrieve result + nglGetOcclusionQueryuivNV(ID, GL_PIXEL_COUNT_AVAILABLE_NV, &result); + if (result != GL_FALSE) + { + nglGetOcclusionQueryuivNV(ID, GL_PIXEL_COUNT_NV, &result); + OcclusionType = result != 0 ? NotOccluded : Occluded; + VisibleCount = (uint) result; + // Note : we could return the exact number of pixels that passed the z-test, but this value is not supported by all implementation (Direct3D ...) + } + } +#endif + return OcclusionType; +} + +// *************************************************************************** +uint COcclusionQueryGL::getVisibleCount() +{ + H_AUTO_OGL(COcclusionQueryGL_getVisibleCount) + nlassert(Driver); + nlassert(ID); + nlassert(Driver->_CurrentOcclusionQuery != this); // can't query result between a begin/end pair! + if (getOcclusionType() == NotAvailable) return 0; + return VisibleCount; +} + +// *************************************************************************** +void CDriverGL::setDepthRange(float znear, float zfar) +{ + H_AUTO_OGL(CDriverGL_setDepthRange) + _DriverGLStates.setDepthRange(znear, zfar); +} + +// *************************************************************************** +void CDriverGL::getDepthRange(float &znear, float &zfar) const +{ + H_AUTO_OGL(CDriverGL_getDepthRange) + _DriverGLStates.getDepthRange(znear, zfar); +} + +// *************************************************************************** +void CDriverGL::setCullMode(TCullMode cullMode) +{ + H_AUTO_OGL(CDriverGL_setCullMode) + _DriverGLStates.setCullMode((CDriverGLStates::TCullMode) cullMode); +} + +// *************************************************************************** +CDriverGL::TCullMode CDriverGL::getCullMode() const +{ + H_AUTO_OGL(CDriverGL_CDriverGL) + return (CDriverGL::TCullMode) _DriverGLStates.getCullMode(); +} + +// *************************************************************************** +void CDriverGL::enableStencilTest(bool enable) +{ + H_AUTO_OGL(CDriverGL_CDriverGL) + _DriverGLStates.enableStencilTest(enable); +} + +// *************************************************************************** +bool CDriverGL::isStencilTestEnabled() const +{ + H_AUTO_OGL(CDriverGL_CDriverGL) + return _DriverGLStates.isStencilTestEnabled(); +} + +// *************************************************************************** +void CDriverGL::stencilFunc(TStencilFunc stencilFunc, int ref, uint mask) +{ + H_AUTO_OGL(CDriverGL_CDriverGL) + + GLenum glstencilFunc = 0; + + switch(stencilFunc) + { + case IDriver::never: glstencilFunc=GL_NEVER; break; + case IDriver::less: glstencilFunc=GL_LESS; break; + case IDriver::lessequal: glstencilFunc=GL_LEQUAL; break; + case IDriver::equal: glstencilFunc=GL_EQUAL; break; + case IDriver::notequal: glstencilFunc=GL_NOTEQUAL; break; + case IDriver::greaterequal: glstencilFunc=GL_GEQUAL; break; + case IDriver::greater: glstencilFunc=GL_GREATER; break; + case IDriver::always: glstencilFunc=GL_ALWAYS; break; + default: nlstop; + } + + _DriverGLStates.stencilFunc(glstencilFunc, (GLint)ref, (GLuint)mask); +} + +// *************************************************************************** +void CDriverGL::stencilOp(TStencilOp fail, TStencilOp zfail, TStencilOp zpass) +{ + H_AUTO_OGL(CDriverGL_CDriverGL) + + GLenum glFail = 0, glZFail = 0, glZPass = 0; + + switch(fail) + { + case IDriver::keep: glFail=GL_KEEP; break; + case IDriver::zero: glFail=GL_ZERO; break; + case IDriver::replace: glFail=GL_REPLACE; break; + case IDriver::incr: glFail=GL_INCR; break; + case IDriver::decr: glFail=GL_DECR; break; + case IDriver::invert: glFail=GL_INVERT; break; + default: nlstop; + } + + switch(zfail) + { + case IDriver::keep: glZFail=GL_KEEP; break; + case IDriver::zero: glZFail=GL_ZERO; break; + case IDriver::replace: glZFail=GL_REPLACE; break; + case IDriver::incr: glZFail=GL_INCR; break; + case IDriver::decr: glZFail=GL_DECR; break; + case IDriver::invert: glZFail=GL_INVERT; break; + default: nlstop; + } + + switch(zpass) + { + case IDriver::keep: glZPass=GL_KEEP; break; + case IDriver::zero: glZPass=GL_ZERO; break; + case IDriver::replace: glZPass=GL_REPLACE; break; + case IDriver::incr: glZPass=GL_INCR; break; + case IDriver::decr: glZPass=GL_DECR; break; + case IDriver::invert: glZPass=GL_INVERT; break; + default: nlstop; + } + + _DriverGLStates.stencilOp(glFail, glZFail, glZPass); +} + +// *************************************************************************** +void CDriverGL::stencilMask(uint mask) +{ + H_AUTO_OGL(CDriverGL_CDriverGL) + + _DriverGLStates.stencilMask((GLuint)mask); +} + +// *************************************************************************** +void CDriverGL::getNumPerStageConstant(uint &lightedMaterial, uint &unlightedMaterial) const +{ + lightedMaterial = inlGetNumTextStages(); + unlightedMaterial = inlGetNumTextStages(); +} + +// *************************************************************************** +void CDriverGL::beginDialogMode() +{ +} + +// *************************************************************************** +void CDriverGL::endDialogMode() +{ +} + +// *************************************************************************** +void displayGLError(GLenum error) +{ + switch(error) + { + case GL_NO_ERROR: nlwarning("GL_NO_ERROR"); break; + case GL_INVALID_ENUM: nlwarning("GL_INVALID_ENUM"); break; + case GL_INVALID_VALUE: nlwarning("GL_INVALID_VALUE"); break; + case GL_INVALID_OPERATION: nlwarning("GL_INVALID_OPERATION"); break; + case GL_STACK_OVERFLOW: nlwarning("GL_STACK_OVERFLOW"); break; + case GL_STACK_UNDERFLOW: nlwarning("GL_STACK_UNDERFLOW"); break; + case GL_OUT_OF_MEMORY: nlwarning("GL_OUT_OF_MEMORY"); break; + default: + nlwarning("GL_ERROR"); + break; + } +} + +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} // NL3D diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl.def b/code/nel/src/3d/driver/OpenGL3/driver_opengl.def new file mode 100644 index 000000000..bfe648552 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl.def @@ -0,0 +1,2 @@ +EXPORTS NL3D_createIDriverInstance +EXPORTS NL3D_interfaceVersion diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl.h b/code/nel/src/3d/driver/OpenGL3/driver_opengl.h new file mode 100644 index 000000000..bfe73492d --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl.h @@ -0,0 +1,1527 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef NL_DRIVER_OPENGL_H +#define NL_DRIVER_OPENGL_H + +#include "nel/misc/types_nl.h" + +//#define NL_PROFILE_DRIVER_OGL +#ifdef NL_PROFILE_DRIVER_OGL +# define H_AUTO_OGL(label) H_AUTO(label) +#else +# define H_AUTO_OGL(label) +#endif + +#ifdef NL_OS_MAC +# import +# import "mac/cocoa_opengl_view.h" +#elif defined (NL_OS_UNIX) +# ifdef XF86VIDMODE +# include +# endif //XF86VIDMODE +#endif // NL_OS_UNIX + +#include "nel/misc/matrix.h" +#include "nel/misc/smart_ptr.h" +#include "nel/misc/rgba.h" +#include "nel/misc/event_emitter.h" +#include "nel/misc/bit_set.h" +#include "nel/misc/hierarchical_timer.h" +#include "nel/misc/bitmap.h" +#include "nel/misc/common.h" +#include "nel/misc/heap_memory.h" +#include "nel/misc/event_emitter_multi.h" +#include "nel/misc/time_nl.h" + +#include "nel/3d/driver.h" +#include "nel/3d/material.h" +#include "nel/3d/shader.h" +#include "nel/3d/vertex_buffer.h" +#include "nel/3d/ptr_set.h" +#include "nel/3d/texture_cube.h" +#include "nel/3d/vertex_program_parse.h" +#include "nel/3d/viewport.h" +#include "nel/3d/scissor.h" +#include "nel/3d/light.h" +#include "nel/3d/occlusion_query.h" + +#include "driver_opengl_states.h" +#include "driver_opengl_extension.h" + + +#ifdef NL_OS_WINDOWS +#include "nel/misc/win_event_emitter.h" +#elif defined(NL_OS_MAC) +#include "mac/cocoa_event_emitter.h" +#elif defined (NL_OS_UNIX) +#include "unix_event_emitter.h" +#endif // NL_OS_UNIX + + +// For optimisation consideration, allow 256 lightmaps at max. +#define NL3D_DRV_MAX_LIGHTMAP 256 + + +/* +#define CHECK_GL_ERROR { \ + GLenum error = glGetError(); \ + if (error != GL_NO_ERROR)\ + {\ + displayGLError(error);\ + nlassert(0);\ + }\ +} +*/ + +#define UNSUPPORTED_INDEX_OFFSET_MSG "Unsupported by driver, check IDriver::supportIndexOffset." + +using NLMISC::CMatrix; +using NLMISC::CVector; + +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + +class CDriverGL; +class IVertexArrayRange; +class IVertexBufferHardGL; +class COcclusionQueryGL; + +void displayGLError(GLenum error); + +#ifdef NL_OS_WINDOWS + +bool GlWndProc(CDriverGL *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); +typedef HCURSOR nlCursor; +#define EmptyCursor (nlCursor)NULL + +#elif defined (NL_OS_MAC) + +bool GlWndProc(CDriverGL *driver, const void* e); +typedef void* nlCursor; +#define EmptyCursor (nlCursor)NULL + +#elif defined (NL_OS_UNIX) + +bool GlWndProc(CDriverGL *driver, XEvent &e); +typedef Cursor nlCursor; +#define EmptyCursor None + +#endif + +typedef std::list TOcclusionQueryList; + +// *************************************************************************** +class COcclusionQueryGL : public IOcclusionQuery +{ +public: + GLuint ID; // id of gl object + NLMISC::CRefPtr Driver; // owner driver + TOcclusionQueryList::iterator Iterator; // iterator in owner driver list of queries + TOcclusionType OcclusionType; // current type of occlusion + uint VisibleCount; // number of samples that passed the test + // From IOcclusionQuery + virtual void begin(); + virtual void end(); + virtual TOcclusionType getOcclusionType(); + virtual uint getVisibleCount(); +}; + +// *************************************************************************** +class CTextureDrvInfosGL : public ITextureDrvInfos +{ +public: + /* + ANY DATA ADDED HERE MUST BE SWAPPED IN swapTextureHandle() !! + */ + + // The GL Id. + GLuint ID; + // Is the internal format of the texture is a compressed one? + bool Compressed; + // Is the internal format of the texture has mipmaps? + bool MipMap; + + // This is the computed size of what memory this texture take. + uint32 TextureMemory; + // This is the owner driver. + CDriverGL *_Driver; + + // enum to use for this texture (GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_NV..) + GLenum TextureMode; + + // FBO Id + GLuint FBOId; + + // depth stencil FBO id + GLuint DepthFBOId; + GLuint StencilFBOId; + + bool InitFBO; + bool AttachDepthStencil; + bool UsePackedDepthStencil; + + // The current wrap modes assigned to the texture. + ITexture::TWrapMode WrapS; + ITexture::TWrapMode WrapT; + ITexture::TMagFilter MagFilter; + ITexture::TMinFilter MinFilter; + + // The gl id is auto created here. + CTextureDrvInfosGL(IDriver *drv, ItTexDrvInfoPtrMap it, CDriverGL *drvGl, bool isRectangleTexture); + // The gl id is auto deleted here. + ~CTextureDrvInfosGL(); + // For Debug info. return the memory cost of this texture + virtual uint getTextureMemoryUsed() const {return TextureMemory;} + + bool initFrameBufferObject(ITexture * tex); + bool activeFrameBufferObject(ITexture * tex); +}; + + +// *************************************************************************** +class CVBDrvInfosGL : public IVBDrvInfos +{ +public: + CVBDrvInfosGL(CDriverGL *drv, ItVBDrvInfoPtrList it, CVertexBuffer *vb); + + // Verex buffer hard ? + IVertexBufferHardGL *_VBHard; + class CDriverGL *_DriverGL; + uint8 *_SystemMemory; + + + // From IVBDrvInfos + virtual ~CVBDrvInfosGL(); + virtual uint8 *lock (uint first, uint last, bool readOnly); + virtual void unlock (uint first, uint last); +}; + + +// *************************************************************************** +class CShaderGL : public IMaterialDrvInfos +{ +public: + GLenum SrcBlend; + GLenum DstBlend; + GLenum ZComp; + + GLfloat Emissive[4]; + GLfloat Ambient[4]; + GLfloat Diffuse[4]; + GLfloat Specular[4]; + // For fast comp. + uint32 PackedEmissive; + uint32 PackedAmbient; + uint32 PackedDiffuse; + uint32 PackedSpecular; + + // The supported Shader type. + CMaterial::TShader SupportedShader; + + CShaderGL(IDriver *drv, ItMatDrvInfoPtrList it) : IMaterialDrvInfos(drv, it) {} +}; + + +// *************************************************************************** +/// Info for the last VertexBuffer setuped (iether normal or hard). +class CVertexBufferInfo +{ +public: + uint16 VertexFormat; + uint16 VertexSize; + uint32 NumVertices; + CVertexBuffer::TType Type[CVertexBuffer::NumValue]; + uint8 UVRouting[CVertexBuffer::MaxStage]; + + // NB: ptrs are invalid if VertexFormat does not support the compoennt. must test VertexFormat, not the ptr. + void *ValuePtr[CVertexBuffer::NumValue]; + + + enum TVBMode { TVBModeNone = 0, SysMem, HwNVIDIA, HwARB, HwATI }; // standard VBs, or Hard VBs using different extensions + + // Kind of vb + TVBMode VBMode; + // the handle of ATI or ARB vertex object + uint VertexObjectId; + + CVertexBufferInfo() + { + VBMode = TVBModeNone; + } + + void setupVertexBuffer(CVertexBuffer &vb); + void setupVertexBufferHard(IVertexBufferHardGL &vb); +}; + + + +// *************************************************************************** +/// Info for the last IndexBuffer setuped (iether normal or hard). +class CIndexBufferInfo +{ +public: + const void *_Values; + CIndexBuffer::TFormat _Format; + + CIndexBufferInfo (); + void setupIndexBuffer(CIndexBuffer &vb); +}; + + + +// *************************************************************************** +class CDriverGL : public IDriver +{ +public: + + // Some constants + enum { MaxLight=8 }; + + CDriverGL(); + virtual ~CDriverGL(); + + virtual bool isLost() const { return false; } // there's no notion of 'lost device" in OpenGL + + virtual bool init (uint windowIcon = 0, emptyProc exitFunc = 0); + + virtual void disableHardwareVertexProgram(); + virtual void disableHardwareVertexArrayAGP(); + virtual void disableHardwareTextureShader(); + + virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable) throw(EBadDisplay); + virtual bool setMode(const GfxMode& mode); + virtual bool getModes(std::vector &modes); + virtual bool getCurrentScreenMode(GfxMode &mode); + virtual void beginDialogMode(); + virtual void endDialogMode(); + + /// Set title of the NeL window + virtual void setWindowTitle(const ucstring &title); + + /// Set icon(s) of the NeL window + virtual void setWindowIcon(const std::vector &bitmaps); + + /// Set position of the NeL window + virtual void setWindowPos(sint32 x, sint32 y); + + /// Show or hide the NeL window + virtual void showWindow(bool show); + + virtual nlWindow getDisplay() + { + return _win; + } + + virtual bool copyTextToClipboard(const ucstring &text); + virtual bool pasteTextFromClipboard(ucstring &text); + + virtual uint32 getAvailableVertexAGPMemory (); + virtual uint32 getAvailableVertexVRAMMemory (); + + virtual emptyProc getWindowProc(); + + virtual bool activate(); + + virtual uint getNbTextureStages() const; + + virtual bool isTextureExist(const ITexture&tex); + + virtual NLMISC::IEventEmitter *getEventEmitter() { return&_EventEmitter; }; + + virtual bool clear2D(CRGBA rgba); + + virtual bool clearZBuffer(float zval=1); + virtual bool clearStencilBuffer(float stencilval=0); + virtual void setColorMask (bool bRed, bool bGreen, bool bBlue, bool bAlpha); + virtual void setDepthRange(float znear, float zfar); + virtual void getDepthRange(float &znear, float &zfar) const; + + virtual bool setupTexture (ITexture& tex); + + virtual bool setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, bool bMustRecreateSharedTexture= false); + virtual bool uploadTexture (ITexture& tex, NLMISC::CRect& rect, uint8 nNumMipMap); + virtual bool uploadTextureCube (ITexture& tex, NLMISC::CRect& rect, uint8 nNumMipMap, uint8 nNumFace); + + virtual void forceDXTCCompression(bool dxtcComp); + virtual void setAnisotropicFilter(sint filter); + + virtual void forceTextureResize(uint divisor); + + virtual void forceNativeFragmentPrograms(bool nativeOnly); + + /// Setup texture env functions. Used by setupMaterial + void setTextureEnvFunction(uint stage, CMaterial& mat); + + /// setup the texture matrix for a given number of stages (starting from 0) + void setupUserTextureMatrix(uint numStages, CMaterial& mat); + + /// disable all texture matrix + void disableUserTextureMatrix(); + + /// For objects with caustics, setup the first texture (which actually is the one from the material) + /*static inline void setupCausticsFirstTex(const CMaterial &mat); + + /// For objects with caustics, setup the caustic texture itself + static inline void setupCausticsSecondTex(uint stage);*/ + + virtual bool setupMaterial(CMaterial& mat); + + virtual void startSpecularBatch(); + virtual void endSpecularBatch(); + + virtual void setFrustum(float left, float right, float bottom, float top, float znear, float zfar, bool perspective = true); + virtual void setFrustumMatrix(CMatrix &frust); + virtual CMatrix getFrustumMatrix(); + virtual float getClipSpaceZMin() const { return -1.f; } + + virtual void setupViewMatrix(const CMatrix& mtx); + + virtual void setupViewMatrixEx(const CMatrix& mtx, const CVector &cameraPos); + + virtual void setupModelMatrix(const CMatrix& mtx); + + virtual CMatrix getViewMatrix() const; + + virtual bool activeShader(CShader *shd); + + virtual void forceNormalize(bool normalize) + { + _ForceNormalize= normalize; + // if ForceNormalize, must enable GLNormalize now. + if(normalize) + enableGlNormalize(true); + } + + virtual bool isForceNormalize() const + { + return _ForceNormalize; + } + + virtual void getNumPerStageConstant(uint &lightedMaterial, uint &unlightedMaterial) const; + + virtual bool supportVertexBufferHard() const; + + virtual bool supportVolatileVertexBuffer() const; + + virtual bool supportCloudRenderSinglePass() const; + + virtual bool supportIndexOffset() const { return false; /* feature only supported in D3D for now */ } + + + virtual bool slowUnlockVertexBufferHard() const; + + virtual uint getMaxVerticesByVertexBufferHard() const; + + virtual bool initVertexBufferHard(uint agpMem, uint vramMem); + + virtual bool activeVertexBuffer(CVertexBuffer& VB); + + virtual bool activeIndexBuffer(CIndexBuffer& IB); + + virtual void mapTextureStageToUV(uint stage, uint uv); + + virtual bool renderLines(CMaterial& mat, uint32 firstIndex, uint32 nlines); + virtual bool renderTriangles(CMaterial& Mat, uint32 firstIndex, uint32 ntris); + virtual bool renderSimpleTriangles(uint32 firstTri, uint32 ntris); + virtual bool renderRawPoints(CMaterial& Mat, uint32 startIndex, uint32 numPoints); + virtual bool renderRawLines(CMaterial& Mat, uint32 startIndex, uint32 numLines); + virtual bool renderRawTriangles(CMaterial& Mat, uint32 startIndex, uint32 numTris); + virtual bool renderRawQuads(CMaterial& Mat, uint32 startIndex, uint32 numQuads); + // + virtual bool renderLinesWithIndexOffset(CMaterial& /* mat */, uint32 /* firstIndex */, uint32 /* nlines */, uint /* indexOffset */) { nlassertex(0, (UNSUPPORTED_INDEX_OFFSET_MSG)); return false; } + virtual bool renderTrianglesWithIndexOffset(CMaterial& /* mat */, uint32 /* firstIndex */, uint32 /* ntris */, uint /* indexOffset */) { nlassertex(0, (UNSUPPORTED_INDEX_OFFSET_MSG)); return false; } + virtual bool renderSimpleTrianglesWithIndexOffset(uint32 /* firstIndex */, uint32 /* ntris */, uint /* indexOffset */) { nlassertex(0, (UNSUPPORTED_INDEX_OFFSET_MSG)); return false; } + + virtual bool swapBuffers(); + + virtual void setSwapVBLInterval(uint interval); + + virtual uint getSwapVBLInterval(); + + virtual void profileRenderedPrimitives(CPrimitiveProfile &pIn, CPrimitiveProfile &pOut); + + virtual uint32 profileAllocatedTextureMemory(); + + virtual uint32 profileSetupedMaterials() const; + + virtual uint32 profileSetupedModelMatrix() const; + + void enableUsedTextureMemorySum (bool enable); + + uint32 getUsedTextureMemory() const; + + virtual void startProfileVBHardLock(); + + virtual void endProfileVBHardLock(std::vector &result); + + virtual void profileVBHardAllocation(std::vector &result); + + virtual void startProfileIBLock(); + + virtual void endProfileIBLock(std::vector &result); + + virtual void profileIBAllocation(std::vector &result); + + virtual bool release(); + + virtual TMessageBoxId systemMessageBox (const char* message, const char* title, TMessageBoxType type=okType, TMessageBoxIcon icon=noIcon); + + virtual void setupScissor (const class CScissor& scissor); + + virtual void setupViewport (const class CViewport& viewport); + + virtual void getViewport(CViewport &viewport); + + + virtual uint32 getImplementationVersion () const + { + return ReleaseVersion; + } + + virtual const char* getDriverInformation () + { + return "Opengl 1.2 NeL Driver"; + } + + virtual const char* getVideocardInformation (); + + virtual bool isActive (); + + virtual uint8 getBitPerPixel (); + + virtual void showCursor (bool b); + + // between 0.0 and 1.0 + virtual void setMousePos(float x, float y); + + virtual void setCapture (bool b); + + // see if system cursor is currently captured + virtual bool isSystemCursorCaptured(); + + // Add a new cursor (name is case unsensitive) + virtual void addCursor(const std::string &name, const NLMISC::CBitmap &bitmap); + + // Display a cursor from its name (case unsensitive) + virtual void setCursor(const std::string &name, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY, bool forceRebuild = false); + + // Change default scale for all cursors + virtual void setCursorScale(float scale); + + virtual NLMISC::IMouseDevice *enableLowLevelMouse(bool enable, bool exclusive); + + virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable); + + virtual NLMISC::IInputDeviceManager *getLowLevelInputDeviceManager(); + + virtual uint getDoubleClickDelay(bool hardwareMouse); + + virtual void getWindowSize (uint32 &width, uint32 &height); + + virtual void getWindowPos (sint32 &x, sint32 &y); + + virtual void getBuffer (CBitmap &bitmap); + + virtual void getZBuffer (std::vector &zbuffer); + + virtual void getBufferPart (CBitmap &bitmap, NLMISC::CRect &rect); + + // copy the first texture in a second one of different dimensions + virtual bool stretchRect(ITexture * srcText, NLMISC::CRect &srcRect, ITexture * destText, NLMISC::CRect &destRect); + + // return true if driver support Bloom effect. + virtual bool supportBloomEffect() const; + + // return true if driver support non-power of two textures + virtual bool supportNonPowerOfTwoTextures() const; + + virtual bool activeFrameBufferObject(ITexture * tex); + + virtual void getZBufferPart (std::vector &zbuffer, NLMISC::CRect &rect); + + virtual bool setRenderTarget (ITexture *tex, uint32 x, uint32 y, uint32 width, uint32 height, + uint32 mipmapLevel, uint32 cubeFace); + + virtual bool copyTargetToTexture (ITexture *tex, uint32 offsetx, uint32 offsety, uint32 x, uint32 y, + uint32 width, uint32 height, uint32 mipmapLevel); + + virtual bool getRenderTargetSize (uint32 &width, uint32 &height); + + + virtual bool fillBuffer (CBitmap &bitmap); + + virtual void setPolygonMode (TPolygonMode mode); + + virtual uint getMaxLight () const; + + virtual void setLight (uint8 num, const CLight& light); + + virtual void enableLight (uint8 num, bool enable=true); + + virtual void setPerPixelLightingLight(CRGBA diffuse, CRGBA specular, float shininess); + + virtual void setLightMapDynamicLight (bool enable, const CLight& light); + + virtual void setAmbientColor (CRGBA color); + + /// \name Fog support. + // @{ + virtual bool fogEnabled(); + virtual void enableFog(bool enable); + /// setup fog parameters. fog must enabled to see result. start and end are in [0,1] range. + virtual void setupFog(float start, float end, CRGBA color); + virtual float getFogStart() const; + virtual float getFogEnd() const; + virtual CRGBA getFogColor() const; + // @} + + /// \name texture addressing modes + // @{ + virtual bool supportTextureShaders() const; + + virtual bool isWaterShaderSupported() const; + + virtual bool isTextureAddrModeSupported(CMaterial::TTexAddressingMode mode) const; + + virtual void setMatrix2DForTextureOffsetAddrMode(const uint stage, const float mat[4]); + // @} + + /// \name EMBM support + // @{ + virtual bool supportEMBM() const; + virtual bool isEMBMSupportedAtStage(uint stage) const; + virtual void setEMBMMatrix(const uint stage, const float mat[4]); + // @} + + virtual bool supportPerPixelLighting(bool specular) const; + + + /// \name Misc + // @{ + virtual bool supportBlendConstantColor() const; + virtual void setBlendConstantColor(NLMISC::CRGBA col); + virtual NLMISC::CRGBA getBlendConstantColor() const; + virtual bool setMonitorColorProperties (const CMonitorColorProperties &properties); + virtual void finish(); + virtual void flush(); + virtual void enablePolygonSmoothing(bool smooth); + virtual bool isPolygonSmoothingEnabled() const; + // @} + + + virtual void swapTextureHandle(ITexture &tex0, ITexture &tex1); + + virtual uint getTextureHandle(const ITexture&tex); + + /// \name Material multipass. + /** NB: setupMaterial() must be called before thoses methods. + * NB: This is intended to be use with the rendering of simple primitives. + * NB: Other render calls performs the needed setup automatically + */ + // @{ + /// init multipass for _CurrentMaterial. return number of pass required to render this material. + virtual sint beginMaterialMultiPass() { return beginMultiPass(); } + /// active the ith pass of this material. + virtual void setupMaterialPass(uint pass) { setupPass(pass); } + /// end multipass for this material. + virtual void endMaterialMultiPass() { endMultiPass(); } + // @} + + /// Adaptor information + virtual uint getNumAdapter() const; + virtual bool getAdapter(uint adapter, CAdapter &desc) const; + virtual bool setAdapter(uint adapter); + + virtual CVertexBuffer::TVertexColorType getVertexColorFormat() const; + + // Bench + virtual void startBench (bool wantStandardDeviation = false, bool quick = false, bool reset = true); + virtual void endBench (); + virtual void displayBench (class NLMISC::CLog *log); + + virtual bool supportOcclusionQuery() const; + virtual IOcclusionQuery *createOcclusionQuery(); + virtual void deleteOcclusionQuery(IOcclusionQuery *oq); + + // Test whether this device supports the frame buffer object mecanism + virtual bool supportTextureRectangle() const; + virtual bool supportFrameBufferObject() const; + virtual bool supportPackedDepthStencil() const; + + virtual uint64 getSwapBufferCounter() const { return _SwapBufferCounter; } + + virtual void setCullMode(TCullMode cullMode); + virtual TCullMode getCullMode() const; + + virtual void enableStencilTest(bool enable); + virtual bool isStencilTestEnabled() const; + virtual void stencilFunc(TStencilFunc stencilFunc, int ref, uint mask); + virtual void stencilOp(TStencilOp fail, TStencilOp zfail, TStencilOp zpass); + virtual void stencilMask(uint mask); + + GfxMode _CurrentMode; + sint32 _WindowX; + sint32 _WindowY; + +#ifdef NL_OS_MAC + NLMISC::CCocoaEventEmitter _EventEmitter; +#endif + +private: + virtual class IVertexBufferHardGL *createVertexBufferHard(uint size, uint numVertices, CVertexBuffer::TPreferredMemory vbType, CVertexBuffer *vb); + friend class CTextureDrvInfosGL; + friend class CVertexProgamDrvInfosGL; + +private: + // Version of the driver. Not the interface version!! Increment when implementation of the driver change. + static const uint32 ReleaseVersion; + + // Windows + nlWindow _win; + bool _WindowVisible; + bool _DestroyWindow; + bool _Maximized; + uint _Interval; + bool _Resizable; + + sint32 _DecorationWidth; + sint32 _DecorationHeight; + + // cursors + enum TColorDepth { ColorDepth16 = 0, ColorDepth32, ColorDepthCount }; + + TColorDepth _ColorDepth; + std::string _CurrName; + NLMISC::CRGBA _CurrCol; + uint8 _CurrRot; + uint _CurrHotSpotX; + uint _CurrHotSpotY; + float _CursorScale; + bool _MouseCaptured; + + nlCursor _DefaultCursor; + nlCursor _BlankCursor; + + bool _AlphaBlendedCursorSupported; + bool _AlphaBlendedCursorSupportRetrieved; + + class CCursor + { + public: + NLMISC::CBitmap Src; + TColorDepth ColorDepth; + uint OrigHeight; + float HotspotScale; + uint HotspotOffsetX; + uint HotspotOffsetY; + sint HotSpotX; + sint HotSpotY; + nlCursor Cursor; + NLMISC::CRGBA Col; + uint8 Rot; +#if defined(NL_OS_UNIX) && !defined(NL_OS_MAC) + Display *Dpy; +#endif + public: + CCursor(); + ~CCursor(); + CCursor& operator= (const CCursor& from); + + void reset(); + }; + + struct CStrCaseUnsensitiveCmp + { + bool operator()(const std::string &lhs, const std::string &rhs) const + { + return NLMISC::nlstricmp(lhs, rhs) < 0; + } + }; + + typedef std::map TCursorMap; + + TCursorMap _Cursors; + +#ifdef USE_OPENGLES + EGLDisplay _EglDisplay; + EGLContext _EglContext; + EGLSurface _EglSurface; +#elif defined(NL_OS_WINDOWS) + HGLRC _hRC; + HDC _hDC; + PIXELFORMATDESCRIPTOR _pfd; + + // Off-screen rendering in Dib section + HPBUFFERARB _PBuffer; +#elif defined(NL_OS_MAC) + NSOpenGLContext* _ctx; +#elif defined(NL_OS_UNIX) + GLXContext _ctx; +#endif + +#ifdef NL_OS_WINDOWS + + bool convertBitmapToIcon(const NLMISC::CBitmap &bitmap, HICON &icon, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col = NLMISC::CRGBA::White, sint hotSpotX = 0, sint hotSpotY = 0, bool cursor = false); + + friend bool GlWndProc(CDriverGL *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); + + static uint _Registered; + DEVMODE _OldScreenMode; + NLMISC::CEventEmitterMulti _EventEmitter; // this can contains a win emitter and eventually a direct input emitter + +#elif defined(NL_OS_MAC) + + friend bool GlWndProc(CDriverGL*, const void*); + + CocoaOpenGLView* _glView; + NSAutoreleasePool* _autoreleasePool; + uint16 _backBufferHeight; + uint16 _backBufferWidth; + + NSView* containerView() { return (NSView*)_win; } + void setupApplicationMenu(); + +#elif defined (NL_OS_UNIX) + + bool convertBitmapToIcon(const NLMISC::CBitmap &bitmap, std::vector &icon); + + friend bool GlWndProc(CDriverGL *driver, XEvent &e); + + Display* _dpy; + NLMISC::CUnixEventEmitter _EventEmitter; + XVisualInfo* _visual_info; + uint32 _xrandr_version; + uint32 _xvidmode_version; + uint32 _xrender_version; + +#ifdef HAVE_XRANDR + sint _OldSizeID; +#endif // HAVE_XRANDR + +#ifdef XF86VIDMODE + sint _OldDotClock; // old dotclock + XF86VidModeModeLine _OldScreenMode; // old modeline + sint _OldX, _OldY; //Viewport settings +#endif //XF86VIDMODE + +#endif // NL_OS_UNIX + + bool _Initialized; + + /// \name Driver Caps. + // @{ + // OpenGL extensions Extensions. + CGlExtensions _Extensions; + // @} + + + // The forceNormalize() state. + bool _ForceNormalize; + + // To know if light setup has been changed from last render() ( any call to setupViewMatrix() or setLight() ). + bool _LightSetupDirty; + + // To know if the modelview matrix setup has been changed from last render() (any call to setupViewMatrix() / setupModelMatrix() ). + bool _ModelViewMatrixDirty; + + // To know if the projection matrix has been changed + bool _ProjMatDirty; + + // Mirror the gl projection matrix when _ProjMatDirty = false + NLMISC::CMatrix _GLProjMat; + + // Ored of _LightSetupDirty and _ModelViewMatrixDirty + bool _RenderSetupDirty; + + // Backup znear and zfar + float _OODeltaZ; + + // Current View matrix, in NEL basis. This is the parameter passed in setupViewMatrix*(). + CMatrix _UserViewMtx; + // Current (OpenGL basis) View matrix. + // NB: if setuped with setupViewMatrixEx(), _ViewMtx.Pos()==(0,0,0) + CMatrix _ViewMtx; + // Matrix used for specular + CMatrix _SpecularTexMtx; + // Precision ZBuffer: The Current cameraPosition, to remove from each model Position. + CVector _PZBCameraPos; + + + // Current computed (OpenGL basis) ModelView matrix. + // NB: This matrix have already substracted the _PZBCameraPos + // Hence this matrix represent the Exact eye-space basis (only _ViewMtx is a bit tricky). + CMatrix _ModelViewMatrix; + + // Fog. + bool _FogEnabled; + float _FogEnd, _FogStart; + GLfloat _CurrentFogColor[4]; + + + + // current viewport and scissor + CViewport _CurrViewport; + CScissor _CurrScissor; + + // viewport before call to setRenderTarget, if BFO extension is supported + CViewport _OldViewport; + + bool _RenderTargetFBO; + + + // Num lights return by GL_MAX_LIGHTS + uint _MaxDriverLight; + // real mirror of GL state + uint _LightMode[MaxLight]; // Light mode. + CVector _WorldLightPos[MaxLight]; // World position of the lights. + CVector _WorldLightDirection[MaxLight]; // World direction of the lights. + bool _LightDirty[MaxLight]; // Light that need a View position setup in refreshRenderSetup(). + // For Lightmap Dynamic Lighting + CLight _LightMapDynamicLight; + bool _LightMapDynamicLightEnabled; + bool _LightMapDynamicLightDirty; + // this is the backup of standard lighting (cause GL states may be modified by Lightmap Dynamic Lighting) + CLight _UserLight0; + bool _UserLightEnable[MaxLight]; + + //\name description of the per pixel light + // @{ + void checkForPerPixelLightingSupport(); + bool _SupportPerPixelShader; + bool _SupportPerPixelShaderNoSpec; + float _PPLExponent; + NLMISC::CRGBA _PPLightDiffuseColor; + NLMISC::CRGBA _PPLightSpecularColor; + // @} + + + + /// \name Prec settings, for optimisation. + // @{ + + // Special Texture environnements. + enum CTexEnvSpecial { + TexEnvSpecialDisabled= 0, + TexEnvSpecialLightMap, + TexEnvSpecialSpecularStage1, + TexEnvSpecialSpecularStage1NoText, + TexEnvSpecialPPLStage0, + TexEnvSpecialPPLStage2, + TexEnvSpecialCloudStage0, + TexEnvSpecialCloudStage1 + }; + + // NB: CRefPtr are not used for mem/spped optimisation. setupMaterial() and setupTexture() reset those states. + CMaterial* _CurrentMaterial; + CMaterial::TShader _CurrentMaterialSupportedShader; + + /* NB : this pointers handles the caching of glBindTexture() and setTextureMode() calls. + */ + ITexture* _CurrentTexture[IDRV_MAT_MAXTEXTURES]; + + CTextureDrvInfosGL* _CurrentTextureInfoGL[IDRV_MAT_MAXTEXTURES]; + CMaterial::CTexEnv _CurrentTexEnv[IDRV_MAT_MAXTEXTURES]; + // Special Texture Environnement. + CTexEnvSpecial _CurrentTexEnvSpecial[IDRV_MAT_MAXTEXTURES]; + // Texture addressing mode + GLenum _CurrentTexAddrMode[IDRV_MAT_MAXTEXTURES]; + // Reset texture shaders to their initial state if they are used + void resetTextureShaders(); + /** set texture shaders from stage 0 to stage IDRV_MAT_MAXTEXTURES - 1 + * textures are needed to setup the right kind of shader (cubic or 2d texture) + */ + void setTextureShaders(const uint8 *addressingModes, const NLMISC::CSmartPtr *textures); + // activation of texture shaders + bool _NVTextureShaderEnabled; + // Which stages support EMBM + bool _StageSupportEMBM[IDRV_MAT_MAXTEXTURES]; + // Anisotropic filtering value + float _AnisotropicFilter; + + // Prec settings for material. + CDriverGLStates _DriverGLStates; + // Optim: To not test change in Materials states if just texture has changed. Very useful for landscape. + uint32 _MaterialAllTextureTouchedFlag; + + // @} + + bool _CurrentGlNormalize; + +private: + bool createContext(); + bool setupDisplay(); + bool unInit(); + + bool createWindow(const GfxMode& mode); + bool destroyWindow(); + + enum EWindowStyle { EWSWindowed, EWSFullscreen }; + + void setWindowSize(uint32 width, uint32 height); + + EWindowStyle getWindowStyle() const; + bool setWindowStyle(EWindowStyle windowStyle); + + // Methods to manage screen resolutions + bool restoreScreenMode(); + bool saveScreenMode(); + bool setScreenMode(const GfxMode &mode); + + // Test if cursor is in the client area. always true when software cursor is used and window visible + // (displayed in software when DirectInput is used) + bool isSystemCursorInClientArea(); + + // Check if RGBA cursors are supported + bool isAlphaBlendedCursorSupported(); + + // Update cursor appearance + void updateCursor(bool forceRebuild = false); + + // Create default cursors + void createCursors(); + + // Release all cursors + void releaseCursors(); + + // Convert a NLMISC::CBitmap to nlCursor + bool convertBitmapToCursor(const NLMISC::CBitmap &bitmap, nlCursor &cursor, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col, sint hotSpotX, sint hotSpotY); + + // Return the best cursor size depending on specified width and height + bool getBestCursorSize(uint srcWidth, uint srcHeight, uint &dstWidth, uint &dstHeight); + + // build a cursor from src, src should have the same size that the hardware cursor + // or a assertion is thrown + nlCursor buildCursor(const NLMISC::CBitmap &src, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY); + + // reset the cursor shape to the system arrow + void setSystemArrow(); + + // Get the proj matrix setupped in GL + void refreshProjMatrixFromGL(); + + bool setupVertexBuffer(CVertexBuffer& VB); + // Activate Texture Environnement. Do it with caching. + bool activateTexture(uint stage, ITexture *tex); + // NB: this test _CurrentTexEnv[] and _CurrentTexEnvSpecial[]. + void activateTexEnvMode(uint stage, const CMaterial::CTexEnv &env); + void activateTexEnvColor(uint stage, const CMaterial::CTexEnv &env); + // Force Activate Texture Environnement. no caching here. TexEnvSpecial is disabled. + void forceActivateTexEnvMode(uint stage, const CMaterial::CTexEnv &env); + void activateTexEnvColor(uint stage, NLMISC::CRGBA col); + void forceActivateTexEnvColor(uint stage, NLMISC::CRGBA col) + { + static const float OO255= 1.0f/255; + _CurrentTexEnv[stage].ConstantColor= col; + // Setup the gl cte color. + _DriverGLStates.activeTextureARB(stage); + GLfloat glcol[4]; + glcol[0]= col.R*OO255; + glcol[1]= col.G*OO255; + glcol[2]= col.B*OO255; + glcol[3]= col.A*OO255; + glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, glcol); + } + void forceActivateTexEnvColor(uint stage, const CMaterial::CTexEnv &env) + { + H_AUTO_OGL(CDriverGL_forceActivateTexEnvColor) + forceActivateTexEnvColor(stage, env.ConstantColor); + } + + + /// nv texture shaders. Should be used only if this caps is present! + void enableNVTextureShader(bool enabled); + // check nv texture shader consistency + void verifyNVTextureShaderConfig(); + + // Called by doRefreshRenderSetup(). set _LightSetupDirty to false + void cleanLightSetup (); + + // According to extensions, retrieve GL tex format of the texture. + GLint getGlTextureFormat(ITexture& tex, bool &compressed); + + + // Clip the wanted rectangle with window. return true if rect is not NULL. + bool clipRect(NLMISC::CRect &rect); + + // Copy the frame buffer to a texture + void copyFrameBufferToTexture(ITexture *tex, + uint32 level, + uint32 offsetx, + uint32 offsety, + uint32 x, + uint32 y, + uint32 width, + uint32 height, + uint cubeFace = 0 + ); + // is this texture a rectangle texture ? + virtual bool isTextureRectangle(ITexture * tex) const; + + /// \name Material multipass. + /** NB: setupMaterial() must be called before thoses methods. + */ + // @{ + /// init multipass for _CurrentMaterial. return number of pass required to render this material. + sint beginMultiPass(); + /// active the ith pass of this material. + void setupPass(uint pass); + /// end multipass for this material. + void endMultiPass(); + // @} + + /// LastVB for UV setup. + CVertexBufferInfo _LastVB; + CIndexBufferInfo _LastIB; + + /// setup a texture stage with an UV from VB. + void setupUVPtr(uint stage, CVertexBufferInfo &VB, uint uvId); + + + /// \name Lightmap. + // @{ + void computeLightMapInfos(const CMaterial &mat); + sint beginLightMapMultiPass(); + void setupLightMapPass(uint pass); + void endLightMapMultiPass(); + + /// Temp Variables computed in beginLightMapMultiPass(). Reused in setupLightMapPass(). + uint _NLightMaps; + uint _NLightMapPerPass; + uint _NLightMapPass; + bool _LightMapNoMulAddFallBack; + // This array is the LUT from lmapId in [0, _NLightMaps[, to original lightmap id in material. + std::vector _LightMapLUT; + + // last stage env. + CMaterial::CTexEnv _LightMapLastStageEnv; + + // Caching + bool _LastVertexSetupIsLightMap; + sint8 _LightMapUVMap[IDRV_MAT_MAXTEXTURES]; + + // restore std vertex Setup. + void resetLightMapVertexSetup(); + + // @} + + /// \name Specular. + // @{ + sint beginSpecularMultiPass(); + void setupSpecularPass(uint pass); + void endSpecularMultiPass(); + void setupSpecularBegin(); + void setupSpecularEnd(); + bool _SpecularBatchOn; + // @} + + + /// \name Water + // @{ + sint beginWaterMultiPass(); + void setupWaterPass(uint pass); + void endWaterMultiPass(); + // @} + + /// \name Per pixel lighting + // @{ + // per pixel lighting with specular + sint beginPPLMultiPass(); + void setupPPLPass(uint pass); + void endPPLMultiPass(); + + // per pixel lighting, no specular + sint beginPPLNoSpecMultiPass(); + void setupPPLNoSpecPass(uint pass); + void endPPLNoSpecMultiPass(); + + typedef NLMISC::CSmartPtr TSPTextureCube; + typedef std::vector TTexCubeVect; + TTexCubeVect _SpecularTextureCubes; // the cube maps used to compute the specular lighting. + + + /// get (and if necessary, build) a cube map used for specular lighting. The range for exponent is limited, and only the best fit is used + CTextureCube *getSpecularCubeMap(uint exp); + + // get (and if necessary, build) the cube map used for diffuse lighting + CTextureCube *getDiffuseCubeMap() { return getSpecularCubeMap(1); } + + + + // @} + + /// \name Caustics + // @{ + /*sint beginCausticsMultiPass(const CMaterial &mat); + void setupCausticsPass(const CMaterial &mat, uint pass); + void endCausticsMultiPass(const CMaterial &mat);*/ + // @} + + /// \name Cloud Shader + sint beginCloudMultiPass (); + void setupCloudPass (uint pass); + void endCloudMultiPass (); + // @} + + + /// setup GL arrays, with a vb info. + void setupGlArrays(CVertexBufferInfo &vb); + + /// Tools fct used by setupGLArrays + void setupGlArraysStd(CVertexBufferInfo &vb); + void setupGlArraysForNVVertexProgram(CVertexBufferInfo &vb); + void setupGlArraysForARBVertexProgram(CVertexBufferInfo &vb); + void setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb); + void toggleGlArraysForNVVertexProgram(); + void toggleGlArraysForARBVertexProgram(); + void toggleGlArraysForEXTVertexShader(); + + /// Test/activate normalisation of normal. + void enableGlNormalize(bool normalize) + { + if(_CurrentGlNormalize!=normalize) + { + _CurrentGlNormalize= normalize; + if(normalize) + glEnable(GL_NORMALIZE); + else + glDisable(GL_NORMALIZE); + } + } + + // refresh matrixes and lights. + void refreshRenderSetup() + { + // check if something to change. + if(_RenderSetupDirty) + { + doRefreshRenderSetup(); + } + } + void doRefreshRenderSetup(); + + void setLightInternal(uint8 num, const CLight& light); + void enableLightInternal(uint8 num, bool enable); + void setupLightMapDynamicLighting(bool enable); + + + /// \name VertexBufferHard + // @{ + CPtrSet _VertexBufferHardSet; + friend class CVertexArrayRangeNVidia; + friend class CVertexBufferHardGLNVidia; + friend class CVertexArrayRangeATI; + friend class CVertexArrayRangeARB; + friend class CVertexBufferHardARB; + friend class CVertexBufferHardGLATI; + friend class CVertexArrayRangeMapObjectATI; + friend class CVertexBufferHardGLMapObjectATI; + friend class CVBDrvInfosGL; + + // The VertexArrayRange activated. + IVertexArrayRange *_CurrentVertexArrayRange; + // The VertexBufferHardGL activated. + IVertexBufferHardGL *_CurrentVertexBufferHard; + // current setup passed to nglVertexArrayRangeNV() + void *_NVCurrentVARPtr; + uint32 _NVCurrentVARSize; + + // Info got from ATI or NVidia extension. + bool _SupportVBHard; + bool _SlowUnlockVBHard; + uint32 _MaxVerticesByVBHard; + + // The AGP VertexArrayRange. + IVertexArrayRange *_AGPVertexArrayRange; + // The VRAM VertexArrayRange. + IVertexArrayRange *_VRAMVertexArrayRange; + + + void resetVertexArrayRange(); + + void fenceOnCurVBHardIfNeeded(IVertexBufferHardGL *newVBHard); + + + // @} + + + /// \name Profiling + // @{ + CPrimitiveProfile _PrimitiveProfileIn; + CPrimitiveProfile _PrimitiveProfileOut; + uint32 _AllocatedTextureMemory; + uint32 _NbSetupMaterialCall; + uint32 _NbSetupModelMatrixCall; + bool _SumTextureMemoryUsed; + std::set _TextureUsed; + uint computeMipMapMemoryUsage(uint w, uint h, GLint glfmt) const; + + // VBHard Lock Profiling + struct CVBHardProfile + { + NLMISC::CRefPtr VBHard; + NLMISC::TTicks AccumTime; + // true if the VBHard was not always the same for the same chronogical place. + bool Change; + CVBHardProfile() + { + AccumTime= 0; + Change= false; + } + }; + // The Profiles in chronogical order. + bool _VBHardProfiling; + std::vector _VBHardProfiles; + uint _CurVBHardLockCount; + uint _NumVBHardProfileFrame; + void appendVBHardLockProfile(NLMISC::TTicks time, CVertexBuffer *vb); + + // @} + + /// \name Vertex program interface + // @{ + + bool isVertexProgramSupported () const; + bool isVertexProgramEmulated () const; + bool activeVertexProgram (CVertexProgram *program); + void setConstant (uint index, float, float, float, float); + void setConstant (uint index, double, double, double, double); + void setConstant (uint indexStart, const NLMISC::CVector& value); + void setConstant (uint indexStart, const NLMISC::CVectorD& value); + void setConstant (uint index, uint num, const float *src); + void setConstant (uint index, uint num, const double *src); + void setConstantMatrix (uint index, IDriver::TMatrix matrix, IDriver::TTransform transform); + void setConstantFog (uint index); + void enableVertexProgramDoubleSidedColor(bool doubleSided); + bool supportVertexProgramDoubleSidedColor() const; + + virtual bool supportMADOperator() const ; + + + // @} + + /// \name Vertex program implementation + // @{ + bool activeNVVertexProgram (CVertexProgram *program); + bool activeARBVertexProgram (CVertexProgram *program); + bool activeEXTVertexShader (CVertexProgram *program); + //@} + + + + /// \fallback for material shaders + // @{ + /// test whether the given shader is supported, and gives back a supported shader + CMaterial::TShader getSupportedShader(CMaterial::TShader shader); + // @} + + bool isVertexProgramEnabled () const + { + // Don't use glIsEnabled, too slow. + return _VertexProgramEnabled; + } + + // Track state of activeVertexProgram() + bool _VertexProgramEnabled; + // Say if last setupGlArrays() was a VertexProgram setup. + bool _LastSetupGLArrayVertexProgram; + + // The last vertex program that was setupped + NLMISC::CRefPtr _LastSetuppedVP; + + bool _ForceDXTCCompression; + /// Divisor for textureResize (power). + uint _ForceTextureResizePower; + // enforcement of native fragment program check + bool _ForceNativeFragmentPrograms; + + + // user texture matrix + NLMISC::CMatrix _UserTexMat[IDRV_MAT_MAXTEXTURES]; + uint _UserTexMatEnabled; // bitm ask for user texture coords + //NLMISC::CMatrix _UserTexMat[IDRV_MAT_MAXTEXTURES]; + + // Static const + static const uint NumCoordinatesType[CVertexBuffer::NumType]; + static const uint GLType[CVertexBuffer::NumType]; + static const uint GLVertexAttribIndex[CVertexBuffer::NumValue]; + static const bool GLTypeIsIntegral[CVertexBuffer::NumType]; + static const uint GLMatrix[IDriver::NumMatrix]; + static const uint GLTransform[IDriver::NumTransform]; + + /// \name Caustics shaders + // @{ + NLMISC::CSmartPtr _CausticCubeMap; // a cube map used for the rendering of caustics + static void initCausticCubeMap(); + // @} + + /// Same as getNbTextureStages(), but faster because inline, and not virtual!! + uint inlGetNumTextStages() const { return _Extensions.NbTextureStages; } + + + NLMISC::CRGBA _CurrentBlendConstantColor; + + /// \name EXTVertexShader specifics. + // @{ + // Variants offset used for : + // Secondary color + // Fog Coords + // Skin Weight + // Palette Skin + // This mean that they must have 4 components + public: + enum EEVSVariants { EVSSecondaryColorVariant = 0, EVSFogCoordsVariant = 1, EVSSkinWeightVariant = 2, EVSPaletteSkinVariant = 3, EVSNumVariants }; + private: + // Handle for standard gl arrays + GLuint _EVSPositionHandle; + GLuint _EVSNormalHandle; + GLuint _EVSColorHandle; + GLuint _EVSTexHandle[8]; + // Handle of the first constant c[0]. In vertex program we have 96 constant c[0] .. c[95] + GLuint _EVSConstantHandle; + // number of constant + static const uint _EVSNumConstant; + // + bool setupEXTVertexShader(const CVPParser::TProgram &program, GLuint id, uint variants[EVSNumVariants], uint16 &usedInputRegisters); + bool setupARBVertexProgram (const CVPParser::TProgram &parsedProgram, GLuint id, bool &specularWritten); + // + // @} + + // init EMBM settings (set each stage to modify the next) + void initEMBM(); + + + + // Monitor color parameters backup + bool _NeedToRestaureGammaRamp; + uint16 _GammaRampBackuped[3*256]; + + + /// \fragment shaders + // @{ + + GLuint ATIWaterShaderHandleNoDiffuseMap; // water support on R200 + GLuint ATIWaterShaderHandle; // water support on R200 + GLuint ATICloudShaderHandle; // cloud support for R200 and more + + GLuint ARBWaterShader[4]; // water support on R300, NV30 & the like + + + void initFragmentShaders(); + void deleteFragmentShaders(); + void deleteARBFragmentPrograms(); + + void setupWaterPassR200(const CMaterial &mat); + void setupWaterPassARB(const CMaterial &mat); + void setupWaterPassNV20(const CMaterial &mat); + // @} + + + bool _PolygonSmooth; + + // driver version for ATI hardware (0 if unknown) + uint _ATIDriverVersion; + bool _ATIFogRangeFixed; + + void retrieveATIDriverVersion(); + + /// \Render to texture + // @{ + CSmartPtr _TextureTarget; + uint32 _TextureTargetLevel; + uint32 _TextureTargetX; + uint32 _TextureTargetY; + uint32 _TextureTargetWidth; + uint32 _TextureTargetHeight; + bool _TextureTargetUpload; + uint _TextureTargetCubeFace; + // @} + // misc +public: + static GLenum NLCubeFaceToGLCubeFace[6]; + static CMaterial::CTexEnv _TexEnvReplace; + // occlusion query + TOcclusionQueryList _OcclusionQueryList; + COcclusionQueryGL *_CurrentOcclusionQuery; +protected: + // is the window active , + bool _WndActive; + uint64 _SwapBufferCounter; +public: + void incrementResetCounter() { ++_ResetCounter; } + bool isWndActive() const { return _WndActive; } + const IVertexBufferHardGL *getCurrentVertexBufferHard() const { return _CurrentVertexBufferHard; } + // For debug : dump list of mapped buffers + #ifdef NL_DEBUG + void dumpMappedBuffers(); + #endif + + emptyProc ExitFunc; + + // tmp for debug + void checkTextureOn() const; +private: + /** Bind a texture at stage 0 for the good texture mode(2d or cube) + * Parameters / part of the texture are ready to be changed in the gl after that + * _CurrentTexture & _CurrentTextureInfoGL are not modified ! + */ + inline void bindTextureWithMode(ITexture &tex); + /** Force to set clamp & wrap mode for the given texture + * Setup is done for texture currently bind to the gl, so calling bindTextureWithMode is necessary + */ + inline void setupTextureBasicParameters(ITexture &tex); + +}; + +// *************************************************************************** +class CVertexProgamDrvInfosGL : public IVertexProgramDrvInfos +{ +public: + // The GL Id. + GLuint ID; + + // ARB_vertex_program specific -> must know if specular part is written + bool SpecularWritten; + + /** EXTVertexShader specific + * handle of allocated variants + */ + GLuint Variants[CDriverGL::EVSNumVariants]; + /** EXTVertexShader specific + * Used input registers. + * This allow to activate only the gl arrays that are needed by a given shader. + */ + uint16 UsedVertexComponents; + + + // The gl id is auto created here. + CVertexProgamDrvInfosGL (CDriverGL *drv, ItVtxPrgDrvInfoPtrList it); +}; + +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} // NL3D + +#endif // NL_DRIVER_OPENGL_H diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.cpp new file mode 100644 index 000000000..d38ff8f51 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.cpp @@ -0,0 +1,1853 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#include "stdopengl.h" +#include "driver_opengl.h" +#include "driver_opengl_extension.h" + +#include "nel/misc/common.h" + +#include "nel/3d/material.h" + +using namespace std; +using namespace NLMISC; + +// *************************************************************************** +#ifdef USE_OPENGLES +#define nglGetProcAddress eglGetProcAddress +#elif defined(NL_OS_WINDOWS) +#define nglGetProcAddress wglGetProcAddress +#elif defined(NL_OS_MAC) +// #include +// glXGetProcAddressARB doesn't work correctly on MAC +// void *nglGetProcAddress(const char *name) +// { +// NSSymbol symbol; +// char *symbolName; +// symbolName = (char*)malloc (strlen (name) + 2); +// strcpy(symbolName + 1, name); +// symbolName[0] = '_'; +// symbol = NULL; +// if (NSIsSymbolNameDefined (symbolName)) symbol = NSLookupAndBindSymbol (symbolName); +// free (symbolName); +// return symbol ? NSAddressOfSymbol (symbol) : NULL; +// } + +// NSAddressOfSymbol, NSIsSymbolNameDefined, NSLookupAndBindSymbol are deprecated +#include +void *nglGetProcAddress(const char *name) +{ + return dlsym(RTLD_DEFAULT, name); +} + +#elif defined (NL_OS_UNIX) +void (*nglGetProcAddress(const char *procName))() +{ + return glXGetProcAddressARB((const GLubyte *)procName); +} +#endif // NL_OS_WINDOWS + + +// *************************************************************************** +// The exported function names + +#ifdef USE_OPENGLES + +// GL_OES_mapbuffer +NEL_PFNGLMAPBUFFEROESPROC nglMapBufferOES; +NEL_PFNGLUNMAPBUFFEROESPROC nglUnmapBufferOES; +NEL_PFNGLGETBUFFERPOINTERVOESPROC nglGetBufferPointervOES; + +NEL_PFNGLBUFFERSUBDATAPROC nglBufferSubData; + +PFNGLDRAWTEXFOESPROC nglDrawTexfOES; + +// GL_OES_framebuffer_object +NEL_PFNGLISRENDERBUFFEROESPROC nglIsRenderbufferOES; +NEL_PFNGLBINDRENDERBUFFEROESPROC nglBindRenderbufferOES; +NEL_PFNGLDELETERENDERBUFFERSOESPROC nglDeleteRenderbuffersOES; +NEL_PFNGLGENRENDERBUFFERSOESPROC nglGenRenderbuffersOES; +NEL_PFNGLRENDERBUFFERSTORAGEOESPROC nglRenderbufferStorageOES; +NEL_PFNGLGETRENDERBUFFERPARAMETERIVOESPROC nglGetRenderbufferParameterivOES; +NEL_PFNGLISFRAMEBUFFEROESPROC nglIsFramebufferOES; +NEL_PFNGLBINDFRAMEBUFFEROESPROC nglBindFramebufferOES; +NEL_PFNGLDELETEFRAMEBUFFERSOESPROC nglDeleteFramebuffersOES; +NEL_PFNGLGENFRAMEBUFFERSOESPROC nglGenFramebuffersOES; +NEL_PFNGLCHECKFRAMEBUFFERSTATUSOESPROC nglCheckFramebufferStatusOES; +NEL_PFNGLFRAMEBUFFERRENDERBUFFEROESPROC nglFramebufferRenderbufferOES; +NEL_PFNGLFRAMEBUFFERTEXTURE2DOESPROC nglFramebufferTexture2DOES; +NEL_PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC nglGetFramebufferAttachmentParameterivOES; +NEL_PFNGLGENERATEMIPMAPOESPROC nglGenerateMipmapOES; + +// GL_OES_texture_cube_map +NEL_PFNGLTEXGENFOESPROC nglTexGenfOES; +NEL_PFNGLTEXGENFVOESPROC nglTexGenfvOES; +NEL_PFNGLTEXGENIOESPROC nglTexGeniOES; +NEL_PFNGLTEXGENIVOESPROC nglTexGenivOES; +NEL_PFNGLTEXGENXOESPROC nglTexGenxOES; +NEL_PFNGLTEXGENXVOESPROC nglTexGenxvOES; +NEL_PFNGLGETTEXGENFVOESPROC nglGetTexGenfvOES; +NEL_PFNGLGETTEXGENIVOESPROC nglGetTexGenivOES; +NEL_PFNGLGETTEXGENXVOESPROC nglGetTexGenxvOES; + +#else + +// ARB_multitexture +NEL_PFNGLACTIVETEXTUREARBPROC nglActiveTextureARB; +NEL_PFNGLCLIENTACTIVETEXTUREARBPROC nglClientActiveTextureARB; + +NEL_PFNGLMULTITEXCOORD1SARBPROC nglMultiTexCoord1sARB; +NEL_PFNGLMULTITEXCOORD1IARBPROC nglMultiTexCoord1iARB; +NEL_PFNGLMULTITEXCOORD1FARBPROC nglMultiTexCoord1fARB; +NEL_PFNGLMULTITEXCOORD1DARBPROC nglMultiTexCoord1dARB; +NEL_PFNGLMULTITEXCOORD2SARBPROC nglMultiTexCoord2sARB; +NEL_PFNGLMULTITEXCOORD2IARBPROC nglMultiTexCoord2iARB; +NEL_PFNGLMULTITEXCOORD2FARBPROC nglMultiTexCoord2fARB; +NEL_PFNGLMULTITEXCOORD2DARBPROC nglMultiTexCoord2dARB; +NEL_PFNGLMULTITEXCOORD3SARBPROC nglMultiTexCoord3sARB; +NEL_PFNGLMULTITEXCOORD3IARBPROC nglMultiTexCoord3iARB; +NEL_PFNGLMULTITEXCOORD3FARBPROC nglMultiTexCoord3fARB; +NEL_PFNGLMULTITEXCOORD3DARBPROC nglMultiTexCoord3dARB; +NEL_PFNGLMULTITEXCOORD4SARBPROC nglMultiTexCoord4sARB; +NEL_PFNGLMULTITEXCOORD4IARBPROC nglMultiTexCoord4iARB; +NEL_PFNGLMULTITEXCOORD4FARBPROC nglMultiTexCoord4fARB; +NEL_PFNGLMULTITEXCOORD4DARBPROC nglMultiTexCoord4dARB; + +NEL_PFNGLMULTITEXCOORD1SVARBPROC nglMultiTexCoord1svARB; +NEL_PFNGLMULTITEXCOORD1IVARBPROC nglMultiTexCoord1ivARB; +NEL_PFNGLMULTITEXCOORD1FVARBPROC nglMultiTexCoord1fvARB; +NEL_PFNGLMULTITEXCOORD1DVARBPROC nglMultiTexCoord1dvARB; +NEL_PFNGLMULTITEXCOORD2SVARBPROC nglMultiTexCoord2svARB; +NEL_PFNGLMULTITEXCOORD2IVARBPROC nglMultiTexCoord2ivARB; +NEL_PFNGLMULTITEXCOORD2FVARBPROC nglMultiTexCoord2fvARB; +NEL_PFNGLMULTITEXCOORD2DVARBPROC nglMultiTexCoord2dvARB; +NEL_PFNGLMULTITEXCOORD3SVARBPROC nglMultiTexCoord3svARB; +NEL_PFNGLMULTITEXCOORD3IVARBPROC nglMultiTexCoord3ivARB; +NEL_PFNGLMULTITEXCOORD3FVARBPROC nglMultiTexCoord3fvARB; +NEL_PFNGLMULTITEXCOORD3DVARBPROC nglMultiTexCoord3dvARB; +NEL_PFNGLMULTITEXCOORD4SVARBPROC nglMultiTexCoord4svARB; +NEL_PFNGLMULTITEXCOORD4IVARBPROC nglMultiTexCoord4ivARB; +NEL_PFNGLMULTITEXCOORD4FVARBPROC nglMultiTexCoord4fvARB; +NEL_PFNGLMULTITEXCOORD4DVARBPROC nglMultiTexCoord4dvARB; + +// ARB_TextureCompression. +NEL_PFNGLCOMPRESSEDTEXIMAGE3DARBPROC nglCompressedTexImage3DARB; +NEL_PFNGLCOMPRESSEDTEXIMAGE2DARBPROC nglCompressedTexImage2DARB; +NEL_PFNGLCOMPRESSEDTEXIMAGE1DARBPROC nglCompressedTexImage1DARB; +NEL_PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC nglCompressedTexSubImage3DARB; +NEL_PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC nglCompressedTexSubImage2DARB; +NEL_PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC nglCompressedTexSubImage1DARB; +NEL_PFNGLGETCOMPRESSEDTEXIMAGEARBPROC nglGetCompressedTexImageARB; + +// VertexArrayRangeNV. +NEL_PFNGLFLUSHVERTEXARRAYRANGENVPROC nglFlushVertexArrayRangeNV; +NEL_PFNGLVERTEXARRAYRANGENVPROC nglVertexArrayRangeNV; + +// FenceNV. +NEL_PFNGLDELETEFENCESNVPROC nglDeleteFencesNV; +NEL_PFNGLGENFENCESNVPROC nglGenFencesNV; +NEL_PFNGLISFENCENVPROC nglIsFenceNV; +NEL_PFNGLTESTFENCENVPROC nglTestFenceNV; +NEL_PFNGLGETFENCEIVNVPROC nglGetFenceivNV; +NEL_PFNGLFINISHFENCENVPROC nglFinishFenceNV; +NEL_PFNGLSETFENCENVPROC nglSetFenceNV; + +// VertexWeighting. +NEL_PFNGLVERTEXWEIGHTFEXTPROC nglVertexWeightfEXT; +NEL_PFNGLVERTEXWEIGHTFVEXTPROC nglVertexWeightfvEXT; +NEL_PFNGLVERTEXWEIGHTPOINTEREXTPROC nglVertexWeightPointerEXT; + +// VertexProgramExtension. +NEL_PFNGLAREPROGRAMSRESIDENTNVPROC nglAreProgramsResidentNV; +NEL_PFNGLBINDPROGRAMNVPROC nglBindProgramNV; +NEL_PFNGLDELETEPROGRAMSNVPROC nglDeleteProgramsNV; +NEL_PFNGLEXECUTEPROGRAMNVPROC nglExecuteProgramNV; +NEL_PFNGLGENPROGRAMSNVPROC nglGenProgramsNV; +NEL_PFNGLGETPROGRAMPARAMETERDVNVPROC nglGetProgramParameterdvNV; +NEL_PFNGLGETPROGRAMPARAMETERFVNVPROC nglGetProgramParameterfvNV; +NEL_PFNGLGETPROGRAMIVNVPROC nglGetProgramivNV; +NEL_PFNGLGETPROGRAMSTRINGNVPROC nglGetProgramStringNV; +NEL_PFNGLGETTRACKMATRIXIVNVPROC nglGetTrackMatrixivNV; +NEL_PFNGLGETVERTEXATTRIBDVNVPROC nglGetVertexAttribdvNV; +NEL_PFNGLGETVERTEXATTRIBFVNVPROC nglGetVertexAttribfvNV; +NEL_PFNGLGETVERTEXATTRIBIVNVPROC nglGetVertexAttribivNV; +NEL_PFNGLGETVERTEXATTRIBPOINTERVNVPROC nglGetVertexAttribPointervNV; +NEL_PFNGLISPROGRAMNVPROC nglIsProgramNV; +NEL_PFNGLLOADPROGRAMNVPROC nglLoadProgramNV; +NEL_PFNGLPROGRAMPARAMETER4DNVPROC nglProgramParameter4dNV; +NEL_PFNGLPROGRAMPARAMETER4DVNVPROC nglProgramParameter4dvNV; +NEL_PFNGLPROGRAMPARAMETER4FNVPROC nglProgramParameter4fNV; +NEL_PFNGLPROGRAMPARAMETER4FVNVPROC nglProgramParameter4fvNV; +NEL_PFNGLPROGRAMPARAMETERS4DVNVPROC nglProgramParameters4dvNV; +NEL_PFNGLPROGRAMPARAMETERS4FVNVPROC nglProgramParameters4fvNV; +NEL_PFNGLREQUESTRESIDENTPROGRAMSNVPROC nglRequestResidentProgramsNV; +NEL_PFNGLTRACKMATRIXNVPROC nglTrackMatrixNV; +NEL_PFNGLVERTEXATTRIBPOINTERNVPROC nglVertexAttribPointerNV; +NEL_PFNGLVERTEXATTRIB1DNVPROC nglVertexAttrib1dNV; +NEL_PFNGLVERTEXATTRIB1DVNVPROC nglVertexAttrib1dvNV; +NEL_PFNGLVERTEXATTRIB1FNVPROC nglVertexAttrib1fNV; +NEL_PFNGLVERTEXATTRIB1FVNVPROC nglVertexAttrib1fvNV; +NEL_PFNGLVERTEXATTRIB1SNVPROC nglVertexAttrib1sNV; +NEL_PFNGLVERTEXATTRIB1SVNVPROC nglVertexAttrib1svNV; +NEL_PFNGLVERTEXATTRIB2DNVPROC nglVertexAttrib2dNV; +NEL_PFNGLVERTEXATTRIB2DVNVPROC nglVertexAttrib2dvNV; +NEL_PFNGLVERTEXATTRIB2FNVPROC nglVertexAttrib2fNV; +NEL_PFNGLVERTEXATTRIB2FVNVPROC nglVertexAttrib2fvNV; +NEL_PFNGLVERTEXATTRIB2SNVPROC nglVertexAttrib2sNV; +NEL_PFNGLVERTEXATTRIB2SVNVPROC nglVertexAttrib2svNV; +NEL_PFNGLVERTEXATTRIB3DNVPROC nglVertexAttrib3dNV; +NEL_PFNGLVERTEXATTRIB3DVNVPROC nglVertexAttrib3dvNV; +NEL_PFNGLVERTEXATTRIB3FNVPROC nglVertexAttrib3fNV; +NEL_PFNGLVERTEXATTRIB3FVNVPROC nglVertexAttrib3fvNV; +NEL_PFNGLVERTEXATTRIB3SNVPROC nglVertexAttrib3sNV; +NEL_PFNGLVERTEXATTRIB3SVNVPROC nglVertexAttrib3svNV; +NEL_PFNGLVERTEXATTRIB4DNVPROC nglVertexAttrib4dNV; +NEL_PFNGLVERTEXATTRIB4DVNVPROC nglVertexAttrib4dvNV; +NEL_PFNGLVERTEXATTRIB4FNVPROC nglVertexAttrib4fNV; +NEL_PFNGLVERTEXATTRIB4FVNVPROC nglVertexAttrib4fvNV; +NEL_PFNGLVERTEXATTRIB4SNVPROC nglVertexAttrib4sNV; +NEL_PFNGLVERTEXATTRIB4SVNVPROC nglVertexAttrib4svNV; +NEL_PFNGLVERTEXATTRIB4UBVNVPROC nglVertexAttrib4ubvNV; +NEL_PFNGLVERTEXATTRIBS1DVNVPROC nglVertexAttribs1dvNV; +NEL_PFNGLVERTEXATTRIBS1FVNVPROC nglVertexAttribs1fvNV; +NEL_PFNGLVERTEXATTRIBS1SVNVPROC nglVertexAttribs1svNV; +NEL_PFNGLVERTEXATTRIBS2DVNVPROC nglVertexAttribs2dvNV; +NEL_PFNGLVERTEXATTRIBS2FVNVPROC nglVertexAttribs2fvNV; +NEL_PFNGLVERTEXATTRIBS2SVNVPROC nglVertexAttribs2svNV; +NEL_PFNGLVERTEXATTRIBS3DVNVPROC nglVertexAttribs3dvNV; +NEL_PFNGLVERTEXATTRIBS3FVNVPROC nglVertexAttribs3fvNV; +NEL_PFNGLVERTEXATTRIBS3SVNVPROC nglVertexAttribs3svNV; +NEL_PFNGLVERTEXATTRIBS4DVNVPROC nglVertexAttribs4dvNV; +NEL_PFNGLVERTEXATTRIBS4FVNVPROC nglVertexAttribs4fvNV; +NEL_PFNGLVERTEXATTRIBS4SVNVPROC nglVertexAttribs4svNV; +NEL_PFNGLVERTEXATTRIBS4UBVNVPROC nglVertexAttribs4ubvNV; + +// VertexShaderExt extension +NEL_PFNGLBEGINVERTEXSHADEREXTPROC nglBeginVertexShaderEXT; +NEL_PFNGLENDVERTEXSHADEREXTPROC nglEndVertexShaderEXT; +NEL_PFNGLBINDVERTEXSHADEREXTPROC nglBindVertexShaderEXT; +NEL_PFNGLGENVERTEXSHADERSEXTPROC nglGenVertexShadersEXT; +NEL_PFNGLDELETEVERTEXSHADEREXTPROC nglDeleteVertexShaderEXT; +NEL_PFNGLSHADEROP1EXTPROC nglShaderOp1EXT; +NEL_PFNGLSHADEROP2EXTPROC nglShaderOp2EXT; +NEL_PFNGLSHADEROP3EXTPROC nglShaderOp3EXT; +NEL_PFNGLSWIZZLEEXTPROC nglSwizzleEXT; +NEL_PFNGLWRITEMASKEXTPROC nglWriteMaskEXT; +NEL_PFNGLINSERTCOMPONENTEXTPROC nglInsertComponentEXT; +NEL_PFNGLEXTRACTCOMPONENTEXTPROC nglExtractComponentEXT; +NEL_PFNGLGENSYMBOLSEXTPROC nglGenSymbolsEXT; +NEL_PFNGLSETINVARIANTEXTPROC nglSetInvariantEXT; +NEL_PFNGLSETLOCALCONSTANTEXTPROC nglSetLocalConstantEXT; +NEL_PFNGLVARIANTPOINTEREXTPROC nglVariantPointerEXT; +NEL_PFNGLENABLEVARIANTCLIENTSTATEEXTPROC nglEnableVariantClientStateEXT; +NEL_PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC nglDisableVariantClientStateEXT; +NEL_PFNGLBINDLIGHTPARAMETEREXTPROC nglBindLightParameterEXT; +NEL_PFNGLBINDMATERIALPARAMETEREXTPROC nglBindMaterialParameterEXT; +NEL_PFNGLBINDTEXGENPARAMETEREXTPROC nglBindTexGenParameterEXT; +NEL_PFNGLBINDTEXTUREUNITPARAMETEREXTPROC nglBindTextureUnitParameterEXT; +NEL_PFNGLBINDPARAMETEREXTPROC nglBindParameterEXT; +NEL_PFNGLISVARIANTENABLEDEXTPROC nglIsVariantEnabledEXT; +NEL_PFNGLGETVARIANTBOOLEANVEXTPROC nglGetVariantBooleanvEXT; +NEL_PFNGLGETVARIANTINTEGERVEXTPROC nglGetVariantIntegervEXT; +NEL_PFNGLGETVARIANTFLOATVEXTPROC nglGetVariantFloatvEXT; +NEL_PFNGLGETVARIANTPOINTERVEXTPROC nglGetVariantPointervEXT; +NEL_PFNGLGETINVARIANTBOOLEANVEXTPROC nglGetInvariantBooleanvEXT; +NEL_PFNGLGETINVARIANTINTEGERVEXTPROC nglGetInvariantIntegervEXT; +NEL_PFNGLGETINVARIANTFLOATVEXTPROC nglGetInvariantFloatvEXT; +NEL_PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC nglGetLocalConstantBooleanvEXT; +NEL_PFNGLGETLOCALCONSTANTINTEGERVEXTPROC nglGetLocalConstantIntegervEXT; +NEL_PFNGLGETLOCALCONSTANTFLOATVEXTPROC nglGetLocalConstantFloatvEXT; + +// SecondaryColor extension +NEL_PFNGLSECONDARYCOLOR3BEXTPROC nglSecondaryColor3bEXT; +NEL_PFNGLSECONDARYCOLOR3BVEXTPROC nglSecondaryColor3bvEXT; +NEL_PFNGLSECONDARYCOLOR3DEXTPROC nglSecondaryColor3dEXT; +NEL_PFNGLSECONDARYCOLOR3DVEXTPROC nglSecondaryColor3dvEXT; +NEL_PFNGLSECONDARYCOLOR3FEXTPROC nglSecondaryColor3fEXT; +NEL_PFNGLSECONDARYCOLOR3FVEXTPROC nglSecondaryColor3fvEXT; +NEL_PFNGLSECONDARYCOLOR3IEXTPROC nglSecondaryColor3iEXT; +NEL_PFNGLSECONDARYCOLOR3IVEXTPROC nglSecondaryColor3ivEXT; +NEL_PFNGLSECONDARYCOLOR3SEXTPROC nglSecondaryColor3sEXT; +NEL_PFNGLSECONDARYCOLOR3SVEXTPROC nglSecondaryColor3svEXT; +NEL_PFNGLSECONDARYCOLOR3UBEXTPROC nglSecondaryColor3ubEXT; +NEL_PFNGLSECONDARYCOLOR3UBVEXTPROC nglSecondaryColor3ubvEXT; +NEL_PFNGLSECONDARYCOLOR3UIEXTPROC nglSecondaryColor3uiEXT; +NEL_PFNGLSECONDARYCOLOR3UIVEXTPROC nglSecondaryColor3uivEXT; +NEL_PFNGLSECONDARYCOLOR3USEXTPROC nglSecondaryColor3usEXT; +NEL_PFNGLSECONDARYCOLOR3USVEXTPROC nglSecondaryColor3usvEXT; +NEL_PFNGLSECONDARYCOLORPOINTEREXTPROC nglSecondaryColorPointerEXT; + +// BlendColor extension +NEL_PFNGLBLENDCOLOREXTPROC nglBlendColorEXT; + +//======================== +NEL_PFNGLNEWOBJECTBUFFERATIPROC nglNewObjectBufferATI; +NEL_PFNGLISOBJECTBUFFERATIPROC nglIsObjectBufferATI; +NEL_PFNGLUPDATEOBJECTBUFFERATIPROC nglUpdateObjectBufferATI; +NEL_PFNGLGETOBJECTBUFFERFVATIPROC nglGetObjectBufferfvATI; +NEL_PFNGLGETOBJECTBUFFERIVATIPROC nglGetObjectBufferivATI; +NEL_PFNGLDELETEOBJECTBUFFERATIPROC nglDeleteObjectBufferATI; +NEL_PFNGLARRAYOBJECTATIPROC nglArrayObjectATI; +NEL_PFNGLGETARRAYOBJECTFVATIPROC nglGetArrayObjectfvATI; +NEL_PFNGLGETARRAYOBJECTIVATIPROC nglGetArrayObjectivATI; +NEL_PFNGLVARIANTARRAYOBJECTATIPROC nglVariantArrayObjectATI; +NEL_PFNGLGETVARIANTARRAYOBJECTFVATIPROC nglGetVariantArrayObjectfvATI; +NEL_PFNGLGETVARIANTARRAYOBJECTIVATIPROC nglGetVariantArrayObjectivATI; + +// GL_ATI_map_object_buffer +NEL_PFNGLMAPOBJECTBUFFERATIPROC nglMapObjectBufferATI; +NEL_PFNGLUNMAPOBJECTBUFFERATIPROC nglUnmapObjectBufferATI; + +// GL_ATI_vertex_attrib_array_object +NEL_PFNGLVERTEXATTRIBARRAYOBJECTATIPROC nglVertexAttribArrayObjectATI; +NEL_PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC nglGetVertexAttribArrayObjectfvATI; +NEL_PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC nglGetVertexAttribArrayObjectivATI; + +// GL_ATI_envmap_bumpmap extension +PFNGLTEXBUMPPARAMETERIVATIPROC nglTexBumpParameterivATI; +PFNGLTEXBUMPPARAMETERFVATIPROC nglTexBumpParameterfvATI; +PFNGLGETTEXBUMPPARAMETERIVATIPROC nglGetTexBumpParameterivATI; +PFNGLGETTEXBUMPPARAMETERFVATIPROC nglGetTexBumpParameterfvATI; + +// GL_ATI_fragment_shader extension +NEL_PFNGLGENFRAGMENTSHADERSATIPROC nglGenFragmentShadersATI; +NEL_PFNGLBINDFRAGMENTSHADERATIPROC nglBindFragmentShaderATI; +NEL_PFNGLDELETEFRAGMENTSHADERATIPROC nglDeleteFragmentShaderATI; +NEL_PFNGLBEGINFRAGMENTSHADERATIPROC nglBeginFragmentShaderATI; +NEL_PFNGLENDFRAGMENTSHADERATIPROC nglEndFragmentShaderATI; +NEL_PFNGLPASSTEXCOORDATIPROC nglPassTexCoordATI; +NEL_PFNGLSAMPLEMAPATIPROC nglSampleMapATI; +NEL_PFNGLCOLORFRAGMENTOP1ATIPROC nglColorFragmentOp1ATI; +NEL_PFNGLCOLORFRAGMENTOP2ATIPROC nglColorFragmentOp2ATI; +NEL_PFNGLCOLORFRAGMENTOP3ATIPROC nglColorFragmentOp3ATI; +NEL_PFNGLALPHAFRAGMENTOP1ATIPROC nglAlphaFragmentOp1ATI; +NEL_PFNGLALPHAFRAGMENTOP2ATIPROC nglAlphaFragmentOp2ATI; +NEL_PFNGLALPHAFRAGMENTOP3ATIPROC nglAlphaFragmentOp3ATI; +NEL_PFNGLSETFRAGMENTSHADERCONSTANTATIPROC nglSetFragmentShaderConstantATI; + +// GL_ARB_fragment_program +// the following functions are the sames than with GL_ARB_vertex_program +//NEL_PFNGLPROGRAMSTRINGARBPROC nglProgramStringARB; +//NEL_PFNGLBINDPROGRAMARBPROC nglBindProgramARB; +//NEL_PFNGLDELETEPROGRAMSARBPROC nglDeleteProgramsARB; +//NEL_PFNGLGENPROGRAMSARBPROC nglGenProgramsARB; +//NEL_PFNGLPROGRAMENVPARAMETER4DARBPROC nglProgramEnvParameter4dARB; +//NEL_PFNGLPROGRAMENVPARAMETER4DVARBPROC nglProgramEnvParameter4dvARB; +//NEL_PFNGLPROGRAMENVPARAMETER4FARBPROC nglProgramEnvParameter4fARB; +//NEL_PFNGLPROGRAMENVPARAMETER4FVARBPROC nglProgramEnvParameter4fvARB; +NEL_PFNGLPROGRAMLOCALPARAMETER4DARBPROC nglGetProgramLocalParameter4dARB; +NEL_PFNGLPROGRAMLOCALPARAMETER4DVARBPROC nglGetProgramLocalParameter4dvARB; +NEL_PFNGLPROGRAMLOCALPARAMETER4FARBPROC nglGetProgramLocalParameter4fARB; +NEL_PFNGLPROGRAMLOCALPARAMETER4FVARBPROC nglGetProgramLocalParameter4fvARB; +//NEL_PFNGLGETPROGRAMENVPARAMETERDVARBPROC nglGetProgramEnvParameterdvARB; +//NEL_PFNGLGETPROGRAMENVPARAMETERFVARBPROC nglGetProgramEnvParameterfvARB; +//NEL_PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC nglGetProgramLocalParameterdvARB; +//NEL_PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC nglGetProgramLocalParameterfvARB; +//NEL_PFNGLGETPROGRAMIVARBPROC nglGetProgramivARB; +//NEL_PFNGLGETPROGRAMSTRINGARBPROC nglGetProgramStringARB; +//NEL_PFNGLISPROGRAMARBPROC nglIsProgramARB; + +// GL_ARB_vertex_buffer_object +PFNGLBINDBUFFERARBPROC nglBindBufferARB; +PFNGLDELETEBUFFERSARBPROC nglDeleteBuffersARB; +PFNGLGENBUFFERSARBPROC nglGenBuffersARB; +PFNGLISBUFFERARBPROC nglIsBufferARB; +PFNGLBUFFERDATAARBPROC nglBufferDataARB; +PFNGLBUFFERSUBDATAARBPROC nglBufferSubDataARB; +PFNGLGETBUFFERSUBDATAARBPROC nglGetBufferSubDataARB; +PFNGLMAPBUFFERARBPROC nglMapBufferARB; +PFNGLUNMAPBUFFERARBPROC nglUnmapBufferARB; +PFNGLGETBUFFERPARAMETERIVARBPROC nglGetBufferParameterivARB; +PFNGLGETBUFFERPOINTERVARBPROC nglGetBufferPointervARB; + +// GL_ARB_vertex_program +PFNGLVERTEXATTRIB1SARBPROC nglVertexAttrib1sARB; +PFNGLVERTEXATTRIB1FARBPROC nglVertexAttrib1fARB; +PFNGLVERTEXATTRIB1DARBPROC nglVertexAttrib1dARB; +PFNGLVERTEXATTRIB2SARBPROC nglVertexAttrib2sARB; +PFNGLVERTEXATTRIB2FARBPROC nglVertexAttrib2fARB; +PFNGLVERTEXATTRIB2DARBPROC nglVertexAttrib2dARB; +PFNGLVERTEXATTRIB3SARBPROC nglVertexAttrib3sARB; +PFNGLVERTEXATTRIB3FARBPROC nglVertexAttrib3fARB; +PFNGLVERTEXATTRIB3DARBPROC nglVertexAttrib3dARB; +PFNGLVERTEXATTRIB4SARBPROC nglVertexAttrib4sARB; +PFNGLVERTEXATTRIB4FARBPROC nglVertexAttrib4fARB; +PFNGLVERTEXATTRIB4DARBPROC nglVertexAttrib4dARB; +PFNGLVERTEXATTRIB4NUBARBPROC nglVertexAttrib4NubARB; +PFNGLVERTEXATTRIB1SVARBPROC nglVertexAttrib1svARB; +PFNGLVERTEXATTRIB1FVARBPROC nglVertexAttrib1fvARB; +PFNGLVERTEXATTRIB1DVARBPROC nglVertexAttrib1dvARB; +PFNGLVERTEXATTRIB2SVARBPROC nglVertexAttrib2svARB; +PFNGLVERTEXATTRIB2FVARBPROC nglVertexAttrib2fvARB; +PFNGLVERTEXATTRIB2DVARBPROC nglVertexAttrib2dvARB; +PFNGLVERTEXATTRIB3SVARBPROC nglVertexAttrib3svARB; +PFNGLVERTEXATTRIB3FVARBPROC nglVertexAttrib3fvARB; +PFNGLVERTEXATTRIB3DVARBPROC nglVertexAttrib3dvARB; +PFNGLVERTEXATTRIB4BVARBPROC nglVertexAttrib4bvARB; +PFNGLVERTEXATTRIB4SVARBPROC nglVertexAttrib4svARB; +PFNGLVERTEXATTRIB4IVARBPROC nglVertexAttrib4ivARB; +PFNGLVERTEXATTRIB4UBVARBPROC nglVertexAttrib4ubvARB; +PFNGLVERTEXATTRIB4USVARBPROC nglVertexAttrib4usvARB; +PFNGLVERTEXATTRIB4UIVARBPROC nglVertexAttrib4uivARB; +PFNGLVERTEXATTRIB4FVARBPROC nglVertexAttrib4fvARB; +PFNGLVERTEXATTRIB4DVARBPROC nglVertexAttrib4dvARB; +PFNGLVERTEXATTRIB4NBVARBPROC nglVertexAttrib4NbvARB; +PFNGLVERTEXATTRIB4NSVARBPROC nglVertexAttrib4NsvARB; +PFNGLVERTEXATTRIB4NIVARBPROC nglVertexAttrib4NivARB; +PFNGLVERTEXATTRIB4NUBVARBPROC nglVertexAttrib4NubvARB; +PFNGLVERTEXATTRIB4NUSVARBPROC nglVertexAttrib4NusvARB; +PFNGLVERTEXATTRIB4NUIVARBPROC nglVertexAttrib4NuivARB; +PFNGLVERTEXATTRIBPOINTERARBPROC nglVertexAttribPointerARB; +PFNGLENABLEVERTEXATTRIBARRAYARBPROC nglEnableVertexAttribArrayARB; +PFNGLDISABLEVERTEXATTRIBARRAYARBPROC nglDisableVertexAttribArrayARB; +PFNGLPROGRAMSTRINGARBPROC nglProgramStringARB; +PFNGLBINDPROGRAMARBPROC nglBindProgramARB; +PFNGLDELETEPROGRAMSARBPROC nglDeleteProgramsARB; +PFNGLGENPROGRAMSARBPROC nglGenProgramsARB; +PFNGLPROGRAMENVPARAMETER4FARBPROC nglProgramEnvParameter4fARB; +PFNGLPROGRAMENVPARAMETER4DARBPROC nglProgramEnvParameter4dARB; +PFNGLPROGRAMENVPARAMETER4FVARBPROC nglProgramEnvParameter4fvARB; +PFNGLPROGRAMENVPARAMETER4DVARBPROC nglProgramEnvParameter4dvARB; +PFNGLPROGRAMLOCALPARAMETER4FARBPROC nglProgramLocalParameter4fARB; +PFNGLPROGRAMLOCALPARAMETER4DARBPROC nglProgramLocalParameter4dARB; +PFNGLPROGRAMLOCALPARAMETER4FVARBPROC nglProgramLocalParameter4fvARB; +PFNGLPROGRAMLOCALPARAMETER4DVARBPROC nglProgramLocalParameter4dvARB; +PFNGLGETPROGRAMENVPARAMETERFVARBPROC nglGetProgramEnvParameterfvARB; +PFNGLGETPROGRAMENVPARAMETERDVARBPROC nglGetProgramEnvParameterdvARB; +PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC nglGetProgramLocalParameterfvARB; +PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC nglGetProgramLocalParameterdvARB; +PFNGLGETPROGRAMIVARBPROC nglGetProgramivARB; +PFNGLGETPROGRAMSTRINGARBPROC nglGetProgramStringARB; +PFNGLGETVERTEXATTRIBDVARBPROC nglGetVertexAttribdvARB; +PFNGLGETVERTEXATTRIBFVARBPROC nglGetVertexAttribfvARB; +PFNGLGETVERTEXATTRIBIVARBPROC nglGetVertexAttribivARB; +PFNGLGETVERTEXATTRIBPOINTERVARBPROC nglGetVertexAttribPointervARB; +PFNGLISPROGRAMARBPROC nglIsProgramARB; + +// NV_occlusion_query +NEL_PFNGLGENOCCLUSIONQUERIESNVPROC nglGenOcclusionQueriesNV; +NEL_PFNGLDELETEOCCLUSIONQUERIESNVPROC nglDeleteOcclusionQueriesNV; +NEL_PFNGLISOCCLUSIONQUERYNVPROC nglIsOcclusionQueryNV; +NEL_PFNGLBEGINOCCLUSIONQUERYNVPROC nglBeginOcclusionQueryNV; +NEL_PFNGLENDOCCLUSIONQUERYNVPROC nglEndOcclusionQueryNV; +NEL_PFNGLGETOCCLUSIONQUERYIVNVPROC nglGetOcclusionQueryivNV; +NEL_PFNGLGETOCCLUSIONQUERYUIVNVPROC nglGetOcclusionQueryuivNV; + +// GL_EXT_framebuffer_object +NEL_PFNGLISRENDERBUFFEREXTPROC nglIsRenderbufferEXT; +NEL_PFNGLISFRAMEBUFFEREXTPROC nglIsFramebufferEXT; +NEL_PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC nglCheckFramebufferStatusEXT; +NEL_PFNGLGENFRAMEBUFFERSEXTPROC nglGenFramebuffersEXT; +NEL_PFNGLBINDFRAMEBUFFEREXTPROC nglBindFramebufferEXT; +NEL_PFNGLFRAMEBUFFERTEXTURE2DEXTPROC nglFramebufferTexture2DEXT; +NEL_PFNGLGENRENDERBUFFERSEXTPROC nglGenRenderbuffersEXT; +NEL_PFNGLBINDRENDERBUFFEREXTPROC nglBindRenderbufferEXT; +NEL_PFNGLRENDERBUFFERSTORAGEEXTPROC nglRenderbufferStorageEXT; +NEL_PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC nglFramebufferRenderbufferEXT; +NEL_PFNGLDELETERENDERBUFFERSEXTPROC nglDeleteRenderbuffersEXT; +NEL_PFNGLDELETEFRAMEBUFFERSEXTPROC nglDeleteFramebuffersEXT; +NEL_PFNGETRENDERBUFFERPARAMETERIVEXTPROC nglGetRenderbufferParameterivEXT; +NEL_PFNGENERATEMIPMAPEXTPROC nglGenerateMipmapEXT; + +// GL_EXT_framebuffer_blit +NEL_PFNGLBLITFRAMEBUFFEREXTPROC nglBlitFramebufferEXT; + +// GL_EXT_framebuffer_multisample +NEL_PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC nglRenderbufferStorageMultisampleEXT; + +// GL_ARB_multisample +NEL_PFNGLSAMPLECOVERAGEARBPROC nglSampleCoverageARB; + +#ifdef NL_OS_WINDOWS +PFNWGLALLOCATEMEMORYNVPROC nwglAllocateMemoryNV; +PFNWGLFREEMEMORYNVPROC nwglFreeMemoryNV; + +// Pbuffer extension +PFNWGLCREATEPBUFFERARBPROC nwglCreatePbufferARB; +PFNWGLGETPBUFFERDCARBPROC nwglGetPbufferDCARB; +PFNWGLRELEASEPBUFFERDCARBPROC nwglReleasePbufferDCARB; +PFNWGLDESTROYPBUFFERARBPROC nwglDestroyPbufferARB; +PFNWGLQUERYPBUFFERARBPROC nwglQueryPbufferARB; + +// Get Pixel format extension +PFNWGLGETPIXELFORMATATTRIBIVARBPROC nwglGetPixelFormatAttribivARB; +PFNWGLGETPIXELFORMATATTRIBFVARBPROC nwglGetPixelFormatAttribfvARB; +PFNWGLCHOOSEPIXELFORMATARBPROC nwglChoosePixelFormatARB; + +// Swap control extension +PFNWGLSWAPINTERVALEXTPROC nwglSwapIntervalEXT; +PFNWGLGETSWAPINTERVALEXTPROC nwglGetSwapIntervalEXT; + +// WGL_ARB_extensions_string +PFNWGLGETEXTENSIONSSTRINGARBPROC nwglGetExtensionsStringARB; + +#elif defined(NL_OS_MAC) +#elif defined(NL_OS_UNIX) + +NEL_PFNGLXALLOCATEMEMORYNVPROC nglXAllocateMemoryNV; +NEL_PFNGLXFREEMEMORYNVPROC nglXFreeMemoryNV; + +// Swap control extensions +NEL_PFNGLXSWAPINTERVALEXTPROC nglXSwapIntervalEXT; + +PFNGLXSWAPINTERVALSGIPROC nglXSwapIntervalSGI; + +NEL_PFNGLXSWAPINTERVALMESAPROC nglXSwapIntervalMESA; +NEL_PFNGLXGETSWAPINTERVALMESAPROC nglXGetSwapIntervalMESA; + +#endif + +#endif // USE_OPENGLES + +// *************************************************************************** +// *************************************************************************** +// *************************************************************************** +// *************************************************************************** + + +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + +#define CHECK_EXT(ext_str) \ + if(strstr(glext, ext_str)==NULL) { nlwarning("3D: OpengGL extension '%s' was not found", ext_str); return false; } else { nldebug("3D: OpengGL Extension '%s' found", ext_str); } + +// Debug: don't return false if the procaddr returns 0 +// It means that it can crash if nel calls this extension but at least we have a warning to know why the extension is available but not the procaddr +#define CHECK_ADDRESS(type, ext) \ + n##ext=(type)nglGetProcAddress(#ext); \ + if(!n##ext) { nlwarning("3D: GetProcAddress(\"%s\") returns NULL", #ext); return false; } else { /*nldebug("3D: GetProcAddress(\"%s\") succeed", #ext);*/ } + +// *************************************************************************** +// Extensions registrations, and Windows function Registration. + +// ********************************* +static bool setupARBMultiTexture(const char *glext) +{ + H_AUTO_OGL(setupARBMultiTexture); + +#ifndef USE_OPENGLES + CHECK_EXT("GL_ARB_multitexture"); + + CHECK_ADDRESS(NEL_PFNGLACTIVETEXTUREARBPROC, glActiveTextureARB); + CHECK_ADDRESS(NEL_PFNGLCLIENTACTIVETEXTUREARBPROC, glClientActiveTextureARB); + + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD1SARBPROC, glMultiTexCoord1sARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD1IARBPROC, glMultiTexCoord1iARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD1FARBPROC, glMultiTexCoord1fARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD1DARBPROC, glMultiTexCoord1dARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD2SARBPROC, glMultiTexCoord2sARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD2IARBPROC, glMultiTexCoord2iARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD2FARBPROC, glMultiTexCoord2fARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD2DARBPROC, glMultiTexCoord2dARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD3SARBPROC, glMultiTexCoord3sARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD3IARBPROC, glMultiTexCoord3iARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD3FARBPROC, glMultiTexCoord3fARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD3DARBPROC, glMultiTexCoord3dARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD4SARBPROC, glMultiTexCoord4sARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD4IARBPROC, glMultiTexCoord4iARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD4FARBPROC, glMultiTexCoord4fARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD4DARBPROC, glMultiTexCoord4dARB); + + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD1SVARBPROC, glMultiTexCoord1svARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD1IVARBPROC, glMultiTexCoord1ivARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD1FVARBPROC, glMultiTexCoord1fvARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD1DVARBPROC, glMultiTexCoord1dvARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD2SVARBPROC, glMultiTexCoord2svARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD2IVARBPROC, glMultiTexCoord2ivARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD2FVARBPROC, glMultiTexCoord2fvARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD2DVARBPROC, glMultiTexCoord2dvARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD3SVARBPROC, glMultiTexCoord3svARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD3IVARBPROC, glMultiTexCoord3ivARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD3FVARBPROC, glMultiTexCoord3fvARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD3DVARBPROC, glMultiTexCoord3dvARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD4SVARBPROC, glMultiTexCoord4svARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD4IVARBPROC, glMultiTexCoord4ivARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD4FVARBPROC, glMultiTexCoord4fvARB); + CHECK_ADDRESS(NEL_PFNGLMULTITEXCOORD4DVARBPROC, glMultiTexCoord4dvARB); +#endif + + return true; +} + +// ********************************* +static bool setupEXTTextureEnvCombine(const char *glext) +{ + H_AUTO_OGL(setupEXTTextureEnvCombine); + +#ifdef USE_OPENGLES + return true; +#else + return (strstr(glext, "GL_EXT_texture_env_combine")!=NULL || strstr(glext, "GL_ARB_texture_env_combine")!=NULL); +#endif +} + + +// ********************************* +static bool setupARBTextureCompression(const char *glext) +{ + H_AUTO_OGL(setupARBTextureCompression); + +#ifndef USE_OPENGLES + CHECK_EXT("GL_ARB_texture_compression"); + + CHECK_ADDRESS(NEL_PFNGLCOMPRESSEDTEXIMAGE3DARBPROC, glCompressedTexImage3DARB); + CHECK_ADDRESS(NEL_PFNGLCOMPRESSEDTEXIMAGE2DARBPROC, glCompressedTexImage2DARB); + CHECK_ADDRESS(NEL_PFNGLCOMPRESSEDTEXIMAGE1DARBPROC, glCompressedTexImage1DARB); + CHECK_ADDRESS(NEL_PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC, glCompressedTexSubImage3DARB); + CHECK_ADDRESS(NEL_PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC, glCompressedTexSubImage2DARB); + CHECK_ADDRESS(NEL_PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC, glCompressedTexSubImage1DARB); + CHECK_ADDRESS(NEL_PFNGLGETCOMPRESSEDTEXIMAGEARBPROC, glGetCompressedTexImageARB); +#endif + + return true; +} + +// ********************************* +static bool setupARBTextureNonPowerOfTwo(const char *glext) +{ + H_AUTO_OGL(setupARBTextureCompression); + +#ifndef USE_OPENGLES + CHECK_EXT("GL_ARB_texture_non_power_of_two"); +#endif + + return true; +} + +// *************************************************************************** +static bool setupOESMapBuffer(const char *glext) +{ + H_AUTO_OGL(setupOESMapBuffer); + + CHECK_EXT("OES_mapbuffer"); + +#ifdef USE_OPENGLES + CHECK_ADDRESS(NEL_PFNGLMAPBUFFEROESPROC, glMapBufferOES); + CHECK_ADDRESS(NEL_PFNGLUNMAPBUFFEROESPROC, glUnmapBufferOES); + CHECK_ADDRESS(NEL_PFNGLGETBUFFERPOINTERVOESPROC, glGetBufferPointervOES); +#endif + + return true; +} + +// *************************************************************************** +static bool setupOESDrawTexture(const char *glext) +{ + H_AUTO_OGL(setupOESDrawTexture); + + CHECK_EXT("OES_draw_texture"); + +#ifdef USE_OPENGLES + CHECK_ADDRESS(PFNGLDRAWTEXFOESPROC, glDrawTexfOES); +#endif + + return true; +} + +// ********************************* +static bool setupNVVertexArrayRange(const char *glext) +{ + H_AUTO_OGL(setupNVVertexArrayRange); + + // Test if VAR is present. + CHECK_EXT("GL_NV_vertex_array_range"); + + // Tess Fence too. + CHECK_EXT("GL_NV_fence"); + +#ifndef USE_OPENGLES + // Get VAR address. + CHECK_ADDRESS(NEL_PFNGLFLUSHVERTEXARRAYRANGENVPROC, glFlushVertexArrayRangeNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXARRAYRANGENVPROC, glVertexArrayRangeNV); + +#ifdef NL_OS_WINDOWS + CHECK_ADDRESS(PFNWGLALLOCATEMEMORYNVPROC, wglAllocateMemoryNV); + CHECK_ADDRESS(PFNWGLFREEMEMORYNVPROC, wglFreeMemoryNV); +#elif defined(NL_OS_UNIX) && !defined(NL_OS_MAC) + CHECK_ADDRESS(NEL_PFNGLXALLOCATEMEMORYNVPROC, glXAllocateMemoryNV); + CHECK_ADDRESS(NEL_PFNGLXFREEMEMORYNVPROC, glXFreeMemoryNV); +#endif + + // Get fence address. + CHECK_ADDRESS(NEL_PFNGLDELETEFENCESNVPROC, glDeleteFencesNV); + CHECK_ADDRESS(NEL_PFNGLGENFENCESNVPROC, glGenFencesNV); + CHECK_ADDRESS(NEL_PFNGLISFENCENVPROC, glIsFenceNV); + CHECK_ADDRESS(NEL_PFNGLTESTFENCENVPROC, glTestFenceNV); + CHECK_ADDRESS(NEL_PFNGLGETFENCEIVNVPROC, glGetFenceivNV); + CHECK_ADDRESS(NEL_PFNGLFINISHFENCENVPROC, glFinishFenceNV); + CHECK_ADDRESS(NEL_PFNGLSETFENCENVPROC, glSetFenceNV); +#endif + + return true; +} + +// ********************************* +static bool setupEXTTextureCompressionS3TC(const char *glext) +{ + H_AUTO_OGL(setupEXTTextureCompressionS3TC); + +#ifdef USE_OPENGLES + CHECK_EXT("EXT_texture_compression_s3tc"); + // TODO: check also for EXT_texture_compression_dxt1 +#else + CHECK_EXT("GL_EXT_texture_compression_s3tc"); + // TODO: check also for GL_S3_s3tc, GL_EXT_texture_compression_dxt1 +#endif + + return true; +} + +// ********************************* +static bool setupEXTVertexWeighting(const char *glext) +{ + H_AUTO_OGL(setupEXTVertexWeighting); + CHECK_EXT("GL_EXT_vertex_weighting"); + +#ifndef USE_OPENGLES + CHECK_ADDRESS(NEL_PFNGLVERTEXWEIGHTFEXTPROC, glVertexWeightfEXT); + CHECK_ADDRESS(NEL_PFNGLVERTEXWEIGHTFVEXTPROC, glVertexWeightfvEXT); + CHECK_ADDRESS(NEL_PFNGLVERTEXWEIGHTPOINTEREXTPROC, glVertexWeightPointerEXT); +#endif + + return true; +} + + +// ********************************* +static bool setupEXTSeparateSpecularColor(const char *glext) +{ + H_AUTO_OGL(setupEXTSeparateSpecularColor); + CHECK_EXT("GL_EXT_separate_specular_color"); + return true; +} + + +// ********************************* +static bool setupNVTextureEnvCombine4(const char *glext) +{ + H_AUTO_OGL(setupNVTextureEnvCombine4); + CHECK_EXT("GL_NV_texture_env_combine4"); + return true; +} + +// ********************************* +static bool setupATITextureEnvCombine3(const char *glext) +{ + H_AUTO_OGL(setupATITextureEnvCombine3); + +// reenabled to allow bloom on mac, TODO: cleanly fix the water issue +// i think this issue was mtp target related - is this the case in ryzom too? +// #ifdef NL_OS_MAC +// // Water doesn't render on GeForce 8600M GT (on MAC OS X) if this extension is enabled +// return false; +// #endif + + CHECK_EXT("GL_ATI_texture_env_combine3"); + return true; +} + +// ********************************* +static bool setupATIXTextureEnvRoute(const char * /* glext */) +{ + H_AUTO_OGL(setupATIXTextureEnvRoute); + return false; +// CHECK_EXT("GL_ATIX_texture_env_route"); +// return true; +} + +// ********************************* +static bool setupATIEnvMapBumpMap(const char *glext) +{ + H_AUTO_OGL(setupATIEnvMapBumpMap); + CHECK_EXT("GL_ATI_envmap_bumpmap"); + + GLint num = -1; + +#ifndef USE_OPENGLES + CHECK_ADDRESS(PFNGLTEXBUMPPARAMETERIVATIPROC, glTexBumpParameterivATI); + CHECK_ADDRESS(PFNGLTEXBUMPPARAMETERFVATIPROC, glTexBumpParameterfvATI); + CHECK_ADDRESS(PFNGLGETTEXBUMPPARAMETERIVATIPROC, glGetTexBumpParameterivATI); + CHECK_ADDRESS(PFNGLGETTEXBUMPPARAMETERFVATIPROC, glGetTexBumpParameterfvATI); + + // Check for broken ATI drivers and disable EMBM if we caught one. + // Reminder: This code crashes with Catalyst 7.11 fglrx drivers! + nglGetTexBumpParameterivATI(GL_BUMP_NUM_TEX_UNITS_ATI, &num); +#endif + + return num > 0; +} + +// ********************************* +static bool setupARBTextureCubeMap(const char *glext) +{ + H_AUTO_OGL(setupARBTextureCubeMap); + +#ifdef USE_OPENGLES + CHECK_EXT("OES_texture_cube_map"); + + CHECK_ADDRESS(NEL_PFNGLTEXGENFOESPROC, glTexGenfOES); + CHECK_ADDRESS(NEL_PFNGLTEXGENFVOESPROC, glTexGenfvOES); + CHECK_ADDRESS(NEL_PFNGLTEXGENIOESPROC, glTexGeniOES); + CHECK_ADDRESS(NEL_PFNGLTEXGENIVOESPROC, glTexGenivOES); + CHECK_ADDRESS(NEL_PFNGLTEXGENXOESPROC, glTexGenxOES); + CHECK_ADDRESS(NEL_PFNGLTEXGENXVOESPROC, glTexGenxvOES); + CHECK_ADDRESS(NEL_PFNGLGETTEXGENFVOESPROC, glGetTexGenfvOES); + CHECK_ADDRESS(NEL_PFNGLGETTEXGENIVOESPROC, glGetTexGenivOES); + CHECK_ADDRESS(NEL_PFNGLGETTEXGENXVOESPROC, glGetTexGenxvOES); +#else + CHECK_EXT("GL_ARB_texture_cube_map"); +#endif + + return true; +} + + +// ********************************* +static bool setupNVVertexProgram(const char *glext) +{ + H_AUTO_OGL(setupNVVertexProgram); + +// reenabled to allow bloom on mac, TODO: cleanly fix the water issue +// i think this issue was mtp target related - is this the case in ryzom too? +// #ifdef NL_OS_MAC +// // Water doesn't render on GeForce 8600M GT (on MAC OS X) if this extension is enabled +// return false; +// #endif + + CHECK_EXT("GL_NV_vertex_program"); + +#ifndef USE_OPENGLES + CHECK_ADDRESS(NEL_PFNGLAREPROGRAMSRESIDENTNVPROC, glAreProgramsResidentNV); + CHECK_ADDRESS(NEL_PFNGLBINDPROGRAMNVPROC, glBindProgramNV); + CHECK_ADDRESS(NEL_PFNGLDELETEPROGRAMSNVPROC, glDeleteProgramsNV); + CHECK_ADDRESS(NEL_PFNGLEXECUTEPROGRAMNVPROC, glExecuteProgramNV); + CHECK_ADDRESS(NEL_PFNGLGENPROGRAMSNVPROC, glGenProgramsNV); + CHECK_ADDRESS(NEL_PFNGLGETPROGRAMPARAMETERDVNVPROC, glGetProgramParameterdvNV); + CHECK_ADDRESS(NEL_PFNGLGETPROGRAMPARAMETERFVNVPROC, glGetProgramParameterfvNV); + CHECK_ADDRESS(NEL_PFNGLGETPROGRAMIVNVPROC, glGetProgramivNV); + CHECK_ADDRESS(NEL_PFNGLGETPROGRAMSTRINGNVPROC, glGetProgramStringNV); + CHECK_ADDRESS(NEL_PFNGLGETTRACKMATRIXIVNVPROC, glGetTrackMatrixivNV); + CHECK_ADDRESS(NEL_PFNGLGETVERTEXATTRIBDVNVPROC, glGetVertexAttribdvNV); + CHECK_ADDRESS(NEL_PFNGLGETVERTEXATTRIBFVNVPROC, glGetVertexAttribfvNV); + CHECK_ADDRESS(NEL_PFNGLGETVERTEXATTRIBIVNVPROC, glGetVertexAttribivNV); + CHECK_ADDRESS(NEL_PFNGLGETVERTEXATTRIBPOINTERVNVPROC, glGetVertexAttribPointervNV); + CHECK_ADDRESS(NEL_PFNGLISPROGRAMNVPROC, glIsProgramNV); + CHECK_ADDRESS(NEL_PFNGLLOADPROGRAMNVPROC, glLoadProgramNV); + CHECK_ADDRESS(NEL_PFNGLPROGRAMPARAMETER4DNVPROC, glProgramParameter4dNV); + CHECK_ADDRESS(NEL_PFNGLPROGRAMPARAMETER4DVNVPROC, glProgramParameter4dvNV); + CHECK_ADDRESS(NEL_PFNGLPROGRAMPARAMETER4FNVPROC, glProgramParameter4fNV); + CHECK_ADDRESS(NEL_PFNGLPROGRAMPARAMETER4FVNVPROC, glProgramParameter4fvNV); + CHECK_ADDRESS(NEL_PFNGLPROGRAMPARAMETERS4DVNVPROC, glProgramParameters4dvNV); + CHECK_ADDRESS(NEL_PFNGLPROGRAMPARAMETERS4FVNVPROC, glProgramParameters4fvNV); + CHECK_ADDRESS(NEL_PFNGLREQUESTRESIDENTPROGRAMSNVPROC, glRequestResidentProgramsNV); + CHECK_ADDRESS(NEL_PFNGLTRACKMATRIXNVPROC, glTrackMatrixNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBPOINTERNVPROC, glVertexAttribPointerNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB1DNVPROC, glVertexAttrib1dNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB1DVNVPROC, glVertexAttrib1dvNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB1FNVPROC, glVertexAttrib1fNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB1FVNVPROC, glVertexAttrib1fvNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB1SNVPROC, glVertexAttrib1sNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB1SVNVPROC, glVertexAttrib1svNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB2DNVPROC, glVertexAttrib2dNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB2DVNVPROC, glVertexAttrib2dvNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB2FNVPROC, glVertexAttrib2fNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB2FVNVPROC, glVertexAttrib2fvNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB2SNVPROC, glVertexAttrib2sNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB2SVNVPROC, glVertexAttrib2svNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB3DNVPROC, glVertexAttrib3dNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB3DVNVPROC, glVertexAttrib3dvNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB3FNVPROC, glVertexAttrib3fNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB3FVNVPROC, glVertexAttrib3fvNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB3SNVPROC, glVertexAttrib3sNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB3SVNVPROC, glVertexAttrib3svNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB4DNVPROC, glVertexAttrib4dNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB4DVNVPROC, glVertexAttrib4dvNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB4FNVPROC, glVertexAttrib4fNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB4FVNVPROC, glVertexAttrib4fvNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB4SNVPROC, glVertexAttrib4sNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB4SVNVPROC, glVertexAttrib4svNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB4UBVNVPROC, glVertexAttrib4ubvNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS1DVNVPROC, glVertexAttribs1dvNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS1FVNVPROC, glVertexAttribs1fvNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS1SVNVPROC, glVertexAttribs1svNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS2DVNVPROC, glVertexAttribs2dvNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS2FVNVPROC, glVertexAttribs2fvNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS2SVNVPROC, glVertexAttribs2svNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS3DVNVPROC, glVertexAttribs3dvNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS3FVNVPROC, glVertexAttribs3fvNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS3SVNVPROC, glVertexAttribs3svNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS4DVNVPROC, glVertexAttribs4dvNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS4FVNVPROC, glVertexAttribs4fvNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS4SVNVPROC, glVertexAttribs4svNV); + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS4UBVNVPROC, glVertexAttribs4ubvNV); +#endif + + return true; +} + +// ********************************* +static bool setupEXTVertexShader(const char *glext) +{ + H_AUTO_OGL(setupEXTVertexShader); + CHECK_EXT("GL_EXT_vertex_shader"); + +#ifndef USE_OPENGLES + CHECK_ADDRESS(NEL_PFNGLBEGINVERTEXSHADEREXTPROC, glBeginVertexShaderEXT); + CHECK_ADDRESS(NEL_PFNGLENDVERTEXSHADEREXTPROC, glEndVertexShaderEXT); + CHECK_ADDRESS(NEL_PFNGLBINDVERTEXSHADEREXTPROC, glBindVertexShaderEXT); + CHECK_ADDRESS(NEL_PFNGLGENVERTEXSHADERSEXTPROC, glGenVertexShadersEXT); + CHECK_ADDRESS(NEL_PFNGLDELETEVERTEXSHADEREXTPROC, glDeleteVertexShaderEXT); + CHECK_ADDRESS(NEL_PFNGLSHADEROP1EXTPROC, glShaderOp1EXT); + CHECK_ADDRESS(NEL_PFNGLSHADEROP2EXTPROC, glShaderOp2EXT); + CHECK_ADDRESS(NEL_PFNGLSHADEROP3EXTPROC, glShaderOp3EXT); + CHECK_ADDRESS(NEL_PFNGLSWIZZLEEXTPROC, glSwizzleEXT); + CHECK_ADDRESS(NEL_PFNGLWRITEMASKEXTPROC, glWriteMaskEXT); + CHECK_ADDRESS(NEL_PFNGLINSERTCOMPONENTEXTPROC, glInsertComponentEXT); + CHECK_ADDRESS(NEL_PFNGLEXTRACTCOMPONENTEXTPROC, glExtractComponentEXT); + CHECK_ADDRESS(NEL_PFNGLGENSYMBOLSEXTPROC, glGenSymbolsEXT); + CHECK_ADDRESS(NEL_PFNGLSETINVARIANTEXTPROC, glSetInvariantEXT); + CHECK_ADDRESS(NEL_PFNGLSETLOCALCONSTANTEXTPROC, glSetLocalConstantEXT); + CHECK_ADDRESS(NEL_PFNGLVARIANTPOINTEREXTPROC, glVariantPointerEXT); + CHECK_ADDRESS(NEL_PFNGLENABLEVARIANTCLIENTSTATEEXTPROC, glEnableVariantClientStateEXT); + CHECK_ADDRESS(NEL_PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC, glDisableVariantClientStateEXT); + CHECK_ADDRESS(NEL_PFNGLBINDLIGHTPARAMETEREXTPROC, glBindLightParameterEXT); + CHECK_ADDRESS(NEL_PFNGLBINDMATERIALPARAMETEREXTPROC, glBindMaterialParameterEXT); + CHECK_ADDRESS(NEL_PFNGLBINDTEXGENPARAMETEREXTPROC, glBindTexGenParameterEXT); + CHECK_ADDRESS(NEL_PFNGLBINDTEXTUREUNITPARAMETEREXTPROC, glBindTextureUnitParameterEXT); + CHECK_ADDRESS(NEL_PFNGLBINDPARAMETEREXTPROC, glBindParameterEXT); + CHECK_ADDRESS(NEL_PFNGLISVARIANTENABLEDEXTPROC, glIsVariantEnabledEXT); + CHECK_ADDRESS(NEL_PFNGLGETVARIANTBOOLEANVEXTPROC, glGetVariantBooleanvEXT); + CHECK_ADDRESS(NEL_PFNGLGETVARIANTINTEGERVEXTPROC, glGetVariantIntegervEXT); + CHECK_ADDRESS(NEL_PFNGLGETVARIANTFLOATVEXTPROC, glGetVariantFloatvEXT); + CHECK_ADDRESS(NEL_PFNGLGETVARIANTPOINTERVEXTPROC, glGetVariantPointervEXT); + CHECK_ADDRESS(NEL_PFNGLGETINVARIANTBOOLEANVEXTPROC, glGetInvariantBooleanvEXT); + CHECK_ADDRESS(NEL_PFNGLGETINVARIANTINTEGERVEXTPROC, glGetInvariantIntegervEXT); + CHECK_ADDRESS(NEL_PFNGLGETINVARIANTFLOATVEXTPROC, glGetInvariantFloatvEXT); + CHECK_ADDRESS(NEL_PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC, glGetLocalConstantBooleanvEXT); + CHECK_ADDRESS(NEL_PFNGLGETLOCALCONSTANTINTEGERVEXTPROC, glGetLocalConstantIntegervEXT); + CHECK_ADDRESS(NEL_PFNGLGETLOCALCONSTANTFLOATVEXTPROC, glGetLocalConstantFloatvEXT); + + // we require at least 128 instructions, 15 local register (r0, r1,..,r11) + 3 temporary vector for swizzle emulation + 1 vector for indexing temp + 3 temporary scalar for LOGG, EXPP and LIT emulation, 1 address register + // we require 11 variants (4 textures + position + normal + primary color + secondary color + weight + palette skin + fog) + // we also require 2 local constants (0 and 1) + // 96 invariants (c[0], c[1] ..) + 1 invariants for fog emulation (fog coordinate must range from 0 to 1 with EXT_VERTEX_shader) + GLint numVSInst; + glGetIntegerv(GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT, &numVSInst); + if (numVSInst < 128) return false; + // + GLint numVSLocals; + glGetIntegerv(GL_MAX_VERTEX_SHADER_LOCALS_EXT, &numVSLocals); + if (numVSLocals < 4 * (12 + 4) + 1 + 3) + { + nlwarning("EXT_vertex_shader extension has not much register. Some vertex program may fail loading"); + return false; + } + // + GLint numVSLocalConstants; + glGetIntegerv(GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT, &numVSLocalConstants); + if (numVSLocalConstants < 2) return false; + // + GLint numVSInvariants; + glGetIntegerv(GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT, &numVSInvariants); + if (numVSInvariants < 96 + 1) return false; + // + GLint numVSVariants; + glGetIntegerv(GL_MAX_VERTEX_SHADER_VARIANTS_EXT, &numVSVariants); + if (numVSInvariants < 4) return false; +#endif + + return true; + +} + + +// ********************************* +static bool setupEXTSecondaryColor(const char *glext) +{ + H_AUTO_OGL(setupEXTSecondaryColor); + CHECK_EXT("GL_EXT_secondary_color"); + +#ifndef USE_OPENGLES + CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3BEXTPROC, glSecondaryColor3bEXT); + CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3BVEXTPROC, glSecondaryColor3bvEXT); + CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3DEXTPROC, glSecondaryColor3dEXT); + CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3DVEXTPROC, glSecondaryColor3dvEXT); + CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3FEXTPROC, glSecondaryColor3fEXT); + CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3FVEXTPROC, glSecondaryColor3fvEXT); + CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3IEXTPROC, glSecondaryColor3iEXT); + CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3IVEXTPROC, glSecondaryColor3ivEXT); + CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3SEXTPROC, glSecondaryColor3sEXT); + CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3SVEXTPROC, glSecondaryColor3svEXT); + CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3UBEXTPROC, glSecondaryColor3ubEXT); + CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3UBVEXTPROC, glSecondaryColor3ubvEXT); + CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3UIEXTPROC, glSecondaryColor3uiEXT); + CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3UIVEXTPROC, glSecondaryColor3uivEXT); + CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3USEXTPROC, glSecondaryColor3usEXT); + CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3USVEXTPROC, glSecondaryColor3usvEXT); + CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLORPOINTEREXTPROC, glSecondaryColorPointerEXT); +#endif + + return true; +} + +// ********************************* +static bool setupWGLARBPBuffer(const char *glext) +{ + H_AUTO_OGL(setupWGLARBPBuffer); + CHECK_EXT("WGL_ARB_pbuffer"); + +#ifndef USE_OPENGLES +#ifdef NL_OS_WINDOWS + CHECK_ADDRESS(PFNWGLCREATEPBUFFERARBPROC, wglCreatePbufferARB); + CHECK_ADDRESS(PFNWGLGETPBUFFERDCARBPROC, wglGetPbufferDCARB); + CHECK_ADDRESS(PFNWGLRELEASEPBUFFERDCARBPROC, wglReleasePbufferDCARB); + CHECK_ADDRESS(PFNWGLDESTROYPBUFFERARBPROC, wglDestroyPbufferARB); + CHECK_ADDRESS(PFNWGLQUERYPBUFFERARBPROC, wglQueryPbufferARB); +#endif +#endif + + return true; +} + +// ********************************* +static bool setupARBMultisample(const char *glext) +{ + H_AUTO_OGL(setupARBMultisample); + CHECK_EXT("GL_ARB_multisample"); + +#ifndef USE_OPENGLES + CHECK_ADDRESS(NEL_PFNGLSAMPLECOVERAGEARBPROC, glSampleCoverageARB); +#endif + + return true; +} + +#ifdef NL_OS_WINDOWS +// ********************************* +static bool setupWGLARBPixelFormat (const char *glext) +{ + H_AUTO_OGL(setupWGLARBPixelFormat); + CHECK_EXT("WGL_ARB_pixel_format"); + +#ifndef USE_OPENGLES + CHECK_ADDRESS(PFNWGLGETPIXELFORMATATTRIBIVARBPROC, wglGetPixelFormatAttribivARB); + CHECK_ADDRESS(PFNWGLGETPIXELFORMATATTRIBFVARBPROC, wglGetPixelFormatAttribfvARB); + CHECK_ADDRESS(PFNWGLCHOOSEPIXELFORMATARBPROC, wglChoosePixelFormatARB); +#endif + + return true; +} +#endif + +// ********************************* +static bool setupNVTextureShader(const char *glext) +{ + H_AUTO_OGL(setupNVTextureShader); + +// reenabled to allow bloom on mac, TODO: cleanly fix the water issue +// i think this issue was mtp target related - is this the case in ryzom too? +// #ifdef NL_OS_MAC +// // Water doesn't render on GeForce 8600M GT (on MAC OS X) if this extension is enabled +// return false; +// #endif + + CHECK_EXT("GL_NV_texture_shader"); + return true; +} + + +// ********************************* +static bool setupEXTBlendColor(const char *glext) +{ + H_AUTO_OGL(setupEXTBlendColor); + CHECK_EXT("GL_EXT_blend_color"); + +#ifndef USE_OPENGLES + CHECK_ADDRESS(NEL_PFNGLBLENDCOLOREXTPROC, glBlendColorEXT); +#endif + + return true; +} + +// ********************************* +static bool setupNVVertexArrayRange2(const char *glext) +{ + H_AUTO_OGL(setupNVVertexArrayRange2); + CHECK_EXT("GL_NV_vertex_array_range2"); + return true; +} + + +// ********************************* +static bool setupATIVertexArrayObject(const char *glext) +{ + H_AUTO_OGL(setupATIVertexArrayObject); + CHECK_EXT("GL_ATI_vertex_array_object"); + +#ifndef USE_OPENGLES + CHECK_ADDRESS(NEL_PFNGLNEWOBJECTBUFFERATIPROC, glNewObjectBufferATI); + CHECK_ADDRESS(NEL_PFNGLISOBJECTBUFFERATIPROC, glIsObjectBufferATI); + CHECK_ADDRESS(NEL_PFNGLUPDATEOBJECTBUFFERATIPROC, glUpdateObjectBufferATI); + CHECK_ADDRESS(NEL_PFNGLGETOBJECTBUFFERFVATIPROC, glGetObjectBufferfvATI); + CHECK_ADDRESS(NEL_PFNGLGETOBJECTBUFFERIVATIPROC, glGetObjectBufferivATI); + + nglDeleteObjectBufferATI = (NEL_PFNGLDELETEOBJECTBUFFERATIPROC)nglGetProcAddress("nglDeleteObjectBufferATI"); + + if(!nglDeleteObjectBufferATI) + { + // seems that on matrox parhelia driver, this procedure is named nglFreeObjectBufferATI !! + nglDeleteObjectBufferATI = (NEL_PFNGLDELETEOBJECTBUFFERATIPROC)nglGetProcAddress("nglFreeObjectBufferATI"); + if(!nglDeleteObjectBufferATI) return false; + } + + CHECK_ADDRESS(NEL_PFNGLARRAYOBJECTATIPROC, glArrayObjectATI); + CHECK_ADDRESS(NEL_PFNGLGETARRAYOBJECTFVATIPROC, glGetArrayObjectfvATI); + CHECK_ADDRESS(NEL_PFNGLGETARRAYOBJECTIVATIPROC, glGetArrayObjectivATI); + + if(strstr(glext, "GL_EXT_vertex_shader") != NULL) + { + // the following exist only if ext vertex shader is present + CHECK_ADDRESS(NEL_PFNGLVARIANTARRAYOBJECTATIPROC, glVariantArrayObjectATI); + CHECK_ADDRESS(NEL_PFNGLGETVARIANTARRAYOBJECTFVATIPROC, glGetVariantArrayObjectfvATI); + CHECK_ADDRESS(NEL_PFNGLGETVARIANTARRAYOBJECTIVATIPROC, glGetVariantArrayObjectivATI); + } +#endif + + return true; +} + + +static bool setupATIMapObjectBuffer(const char *glext) +{ + H_AUTO_OGL(setupATIMapObjectBuffer); + CHECK_EXT("GL_ATI_map_object_buffer"); + +#ifndef USE_OPENGLES + CHECK_ADDRESS(NEL_PFNGLMAPOBJECTBUFFERATIPROC, glMapObjectBufferATI); + CHECK_ADDRESS(NEL_PFNGLUNMAPOBJECTBUFFERATIPROC, glUnmapObjectBufferATI); +#endif + + return true; +} + + + +// ********************************* +static bool setupATIFragmentShader(const char *glext) +{ + H_AUTO_OGL(setupATIFragmentShader); + CHECK_EXT("GL_ATI_fragment_shader"); + +#ifndef USE_OPENGLES + CHECK_ADDRESS(NEL_PFNGLGENFRAGMENTSHADERSATIPROC, glGenFragmentShadersATI); + CHECK_ADDRESS(NEL_PFNGLBINDFRAGMENTSHADERATIPROC, glBindFragmentShaderATI); + CHECK_ADDRESS(NEL_PFNGLDELETEFRAGMENTSHADERATIPROC, glDeleteFragmentShaderATI); + CHECK_ADDRESS(NEL_PFNGLBEGINFRAGMENTSHADERATIPROC, glBeginFragmentShaderATI); + CHECK_ADDRESS(NEL_PFNGLENDFRAGMENTSHADERATIPROC, glEndFragmentShaderATI); + CHECK_ADDRESS(NEL_PFNGLPASSTEXCOORDATIPROC, glPassTexCoordATI); + CHECK_ADDRESS(NEL_PFNGLSAMPLEMAPATIPROC, glSampleMapATI); + CHECK_ADDRESS(NEL_PFNGLCOLORFRAGMENTOP1ATIPROC, glColorFragmentOp1ATI); + CHECK_ADDRESS(NEL_PFNGLCOLORFRAGMENTOP2ATIPROC, glColorFragmentOp2ATI); + CHECK_ADDRESS(NEL_PFNGLCOLORFRAGMENTOP3ATIPROC, glColorFragmentOp3ATI); + CHECK_ADDRESS(NEL_PFNGLALPHAFRAGMENTOP1ATIPROC, glAlphaFragmentOp1ATI); + CHECK_ADDRESS(NEL_PFNGLALPHAFRAGMENTOP2ATIPROC, glAlphaFragmentOp2ATI); + CHECK_ADDRESS(NEL_PFNGLALPHAFRAGMENTOP3ATIPROC, glAlphaFragmentOp3ATI); + CHECK_ADDRESS(NEL_PFNGLSETFRAGMENTSHADERCONSTANTATIPROC, glSetFragmentShaderConstantATI); +#endif + + return true; +} + +// ********************************* +static bool setupATIVertexAttribArrayObject(const char *glext) +{ + H_AUTO_OGL(setupATIVertexAttribArrayObject); + CHECK_EXT("GL_ATI_vertex_attrib_array_object"); + +#ifndef USE_OPENGLES + CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBARRAYOBJECTATIPROC, glVertexAttribArrayObjectATI); + CHECK_ADDRESS(NEL_PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC, glGetVertexAttribArrayObjectfvATI); + CHECK_ADDRESS(NEL_PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC, glGetVertexAttribArrayObjectivATI); +#endif + + return true; +} + +// ********************************* +static bool setupARBFragmentProgram(const char *glext) +{ + H_AUTO_OGL(setupARBFragmentProgram); + CHECK_EXT("GL_ARB_fragment_program"); + +#ifndef USE_OPENGLES + CHECK_ADDRESS(NEL_PFNGLPROGRAMSTRINGARBPROC, glProgramStringARB); + CHECK_ADDRESS(NEL_PFNGLBINDPROGRAMARBPROC, glBindProgramARB); + CHECK_ADDRESS(NEL_PFNGLDELETEPROGRAMSARBPROC, glDeleteProgramsARB); + CHECK_ADDRESS(NEL_PFNGLGENPROGRAMSARBPROC, glGenProgramsARB); + CHECK_ADDRESS(NEL_PFNGLPROGRAMENVPARAMETER4DARBPROC, glProgramEnvParameter4dARB); + CHECK_ADDRESS(NEL_PFNGLPROGRAMENVPARAMETER4DVARBPROC, glProgramEnvParameter4dvARB); + CHECK_ADDRESS(NEL_PFNGLPROGRAMENVPARAMETER4FARBPROC, glProgramEnvParameter4fARB); + CHECK_ADDRESS(NEL_PFNGLPROGRAMENVPARAMETER4FVARBPROC, glProgramEnvParameter4fvARB); + CHECK_ADDRESS(NEL_PFNGLPROGRAMLOCALPARAMETER4DARBPROC, glProgramLocalParameter4dARB); + CHECK_ADDRESS(NEL_PFNGLPROGRAMLOCALPARAMETER4DVARBPROC, glProgramLocalParameter4dvARB); + CHECK_ADDRESS(NEL_PFNGLPROGRAMLOCALPARAMETER4FARBPROC, glProgramLocalParameter4fARB); + CHECK_ADDRESS(NEL_PFNGLPROGRAMLOCALPARAMETER4FVARBPROC, glProgramLocalParameter4fvARB); + CHECK_ADDRESS(NEL_PFNGLGETPROGRAMENVPARAMETERDVARBPROC, glGetProgramEnvParameterdvARB); + CHECK_ADDRESS(NEL_PFNGLGETPROGRAMENVPARAMETERFVARBPROC, glGetProgramEnvParameterfvARB); + CHECK_ADDRESS(NEL_PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC, glGetProgramLocalParameterdvARB); + CHECK_ADDRESS(NEL_PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC, glGetProgramLocalParameterfvARB); + CHECK_ADDRESS(NEL_PFNGLGETPROGRAMIVARBPROC, glGetProgramivARB); + CHECK_ADDRESS(NEL_PFNGLGETPROGRAMSTRINGARBPROC, glGetProgramStringARB); + CHECK_ADDRESS(NEL_PFNGLISPROGRAMARBPROC, glIsProgramARB); +#endif + + return true; +} + +// *************************************************************************** +static bool setupARBVertexBufferObject(const char *glext) +{ + H_AUTO_OGL(setupARBVertexBufferObject); + +#ifndef USE_OPENGLES + CHECK_EXT("GL_ARB_vertex_buffer_object"); + + CHECK_ADDRESS(PFNGLBINDBUFFERARBPROC, glBindBufferARB); + CHECK_ADDRESS(PFNGLDELETEBUFFERSARBPROC, glDeleteBuffersARB); + CHECK_ADDRESS(PFNGLGENBUFFERSARBPROC, glGenBuffersARB); + CHECK_ADDRESS(PFNGLISBUFFERARBPROC, glIsBufferARB); + CHECK_ADDRESS(PFNGLBUFFERDATAARBPROC, glBufferDataARB); + CHECK_ADDRESS(PFNGLBUFFERSUBDATAARBPROC, glBufferSubDataARB); + CHECK_ADDRESS(PFNGLGETBUFFERSUBDATAARBPROC, glGetBufferSubDataARB); + CHECK_ADDRESS(PFNGLMAPBUFFERARBPROC, glMapBufferARB); + CHECK_ADDRESS(PFNGLUNMAPBUFFERARBPROC, glUnmapBufferARB); + CHECK_ADDRESS(PFNGLGETBUFFERPARAMETERIVARBPROC, glGetBufferParameterivARB); + CHECK_ADDRESS(PFNGLGETBUFFERPOINTERVARBPROC, glGetBufferPointervARB); +#endif + + return true; +} + +// *************************************************************************** +static bool setupARBVertexProgram(const char *glext) +{ + H_AUTO_OGL(setupARBVertexProgram); + CHECK_EXT("GL_ARB_vertex_program"); + +#ifndef USE_OPENGLES + CHECK_ADDRESS(PFNGLVERTEXATTRIB1SARBPROC, glVertexAttrib1sARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB1FARBPROC, glVertexAttrib1fARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB1DARBPROC, glVertexAttrib1dARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB2SARBPROC, glVertexAttrib2sARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB2FARBPROC, glVertexAttrib2fARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB2DARBPROC, glVertexAttrib2dARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB3SARBPROC, glVertexAttrib3sARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB3FARBPROC, glVertexAttrib3fARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB3DARBPROC, glVertexAttrib3dARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4SARBPROC, glVertexAttrib4sARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4FARBPROC, glVertexAttrib4fARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4DARBPROC, glVertexAttrib4dARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4NUBARBPROC, glVertexAttrib4NubARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB1SVARBPROC, glVertexAttrib1svARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB1FVARBPROC, glVertexAttrib1fvARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB1DVARBPROC, glVertexAttrib1dvARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB2SVARBPROC, glVertexAttrib2svARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB2FVARBPROC, glVertexAttrib2fvARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB2DVARBPROC, glVertexAttrib2dvARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB3SVARBPROC, glVertexAttrib3svARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB3FVARBPROC, glVertexAttrib3fvARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB3DVARBPROC, glVertexAttrib3dvARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4BVARBPROC, glVertexAttrib4bvARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4SVARBPROC, glVertexAttrib4svARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4IVARBPROC, glVertexAttrib4ivARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4UBVARBPROC, glVertexAttrib4ubvARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4USVARBPROC, glVertexAttrib4usvARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4UIVARBPROC, glVertexAttrib4uivARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4FVARBPROC, glVertexAttrib4fvARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4DVARBPROC, glVertexAttrib4dvARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4NBVARBPROC, glVertexAttrib4NbvARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4NSVARBPROC, glVertexAttrib4NsvARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4NIVARBPROC, glVertexAttrib4NivARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4NUBVARBPROC, glVertexAttrib4NubvARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4NUSVARBPROC, glVertexAttrib4NusvARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIB4NUIVARBPROC, glVertexAttrib4NuivARB); + CHECK_ADDRESS(PFNGLVERTEXATTRIBPOINTERARBPROC, glVertexAttribPointerARB); + CHECK_ADDRESS(PFNGLENABLEVERTEXATTRIBARRAYARBPROC, glEnableVertexAttribArrayARB); + CHECK_ADDRESS(PFNGLDISABLEVERTEXATTRIBARRAYARBPROC, glDisableVertexAttribArrayARB); + CHECK_ADDRESS(PFNGLPROGRAMSTRINGARBPROC, glProgramStringARB); + CHECK_ADDRESS(PFNGLBINDPROGRAMARBPROC, glBindProgramARB); + CHECK_ADDRESS(PFNGLDELETEPROGRAMSARBPROC, glDeleteProgramsARB); + CHECK_ADDRESS(PFNGLGENPROGRAMSARBPROC, glGenProgramsARB); + CHECK_ADDRESS(PFNGLPROGRAMENVPARAMETER4FARBPROC, glProgramEnvParameter4fARB); + CHECK_ADDRESS(PFNGLPROGRAMENVPARAMETER4DARBPROC, glProgramEnvParameter4dARB); + CHECK_ADDRESS(PFNGLPROGRAMENVPARAMETER4FVARBPROC, glProgramEnvParameter4fvARB); + CHECK_ADDRESS(PFNGLPROGRAMENVPARAMETER4DVARBPROC, glProgramEnvParameter4dvARB); + CHECK_ADDRESS(PFNGLPROGRAMLOCALPARAMETER4FARBPROC, glProgramLocalParameter4fARB); + CHECK_ADDRESS(PFNGLPROGRAMLOCALPARAMETER4DARBPROC, glProgramLocalParameter4dARB); + CHECK_ADDRESS(PFNGLPROGRAMLOCALPARAMETER4FVARBPROC, glProgramLocalParameter4fvARB); + CHECK_ADDRESS(PFNGLPROGRAMLOCALPARAMETER4DVARBPROC, glProgramLocalParameter4dvARB); + CHECK_ADDRESS(PFNGLGETPROGRAMENVPARAMETERFVARBPROC, glGetProgramEnvParameterfvARB); + CHECK_ADDRESS(PFNGLGETPROGRAMENVPARAMETERDVARBPROC, glGetProgramEnvParameterdvARB); + CHECK_ADDRESS(PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC, glGetProgramLocalParameterfvARB); + CHECK_ADDRESS(PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC, glGetProgramLocalParameterdvARB); + CHECK_ADDRESS(PFNGLGETPROGRAMIVARBPROC, glGetProgramivARB); + CHECK_ADDRESS(PFNGLGETPROGRAMSTRINGARBPROC, glGetProgramStringARB); + CHECK_ADDRESS(PFNGLGETVERTEXATTRIBDVARBPROC, glGetVertexAttribdvARB); + CHECK_ADDRESS(PFNGLGETVERTEXATTRIBFVARBPROC, glGetVertexAttribfvARB); + CHECK_ADDRESS(PFNGLGETVERTEXATTRIBIVARBPROC, glGetVertexAttribivARB); + CHECK_ADDRESS(PFNGLGETVERTEXATTRIBPOINTERVARBPROC, glGetVertexAttribPointervARB); + CHECK_ADDRESS(PFNGLISPROGRAMARBPROC, glIsProgramARB); +#endif + + return true; +} + +// *************************************************************************** +static bool setupNVOcclusionQuery(const char *glext) +{ + H_AUTO_OGL(setupNVOcclusionQuery); + CHECK_EXT("GL_NV_occlusion_query"); + +#ifndef USE_OPENGLES + CHECK_ADDRESS(NEL_PFNGLGENOCCLUSIONQUERIESNVPROC, glGenOcclusionQueriesNV); + CHECK_ADDRESS(NEL_PFNGLDELETEOCCLUSIONQUERIESNVPROC, glDeleteOcclusionQueriesNV); + CHECK_ADDRESS(NEL_PFNGLISOCCLUSIONQUERYNVPROC, glIsOcclusionQueryNV); + CHECK_ADDRESS(NEL_PFNGLBEGINOCCLUSIONQUERYNVPROC, glBeginOcclusionQueryNV); + CHECK_ADDRESS(NEL_PFNGLENDOCCLUSIONQUERYNVPROC, glEndOcclusionQueryNV); + CHECK_ADDRESS(NEL_PFNGLGETOCCLUSIONQUERYIVNVPROC, glGetOcclusionQueryivNV); + CHECK_ADDRESS(NEL_PFNGLGETOCCLUSIONQUERYUIVNVPROC, glGetOcclusionQueryuivNV); +#endif + + return true; +} + + +// *************************************************************************** +static bool setupNVTextureRectangle(const char *glext) +{ + H_AUTO_OGL(setupNVTextureRectangle); + CHECK_EXT("GL_NV_texture_rectangle"); + return true; +} + +// *************************************************************************** +static bool setupEXTTextureRectangle(const char *glext) +{ + H_AUTO_OGL(setupEXTTextureRectangle); + CHECK_EXT("GL_EXT_texture_rectangle"); + return true; +} + +// *************************************************************************** +static bool setupARBTextureRectangle(const char *glext) +{ + H_AUTO_OGL(setupARBTextureRectangle); + +#ifndef USE_OPENGLES + CHECK_EXT("GL_ARB_texture_rectangle"); +#endif + + return true; +} + +// *************************************************************************** +static bool setupEXTTextureFilterAnisotropic(const char *glext) +{ + H_AUTO_OGL(setupEXTTextureFilterAnisotropic); + CHECK_EXT("GL_EXT_texture_filter_anisotropic"); + return true; +} + +// *************************************************************************** +static bool setupFrameBufferObject(const char *glext) +{ + H_AUTO_OGL(setupFrameBufferObject); + +#ifdef USE_OPENGLES + CHECK_EXT("GL_OES_framebuffer_object"); + + CHECK_ADDRESS(NEL_PFNGLISRENDERBUFFEROESPROC, glIsRenderbufferOES); + CHECK_ADDRESS(NEL_PFNGLBINDRENDERBUFFEROESPROC, glBindRenderbufferOES); + CHECK_ADDRESS(NEL_PFNGLDELETERENDERBUFFERSOESPROC, glDeleteRenderbuffersOES); + CHECK_ADDRESS(NEL_PFNGLGENRENDERBUFFERSOESPROC, glGenRenderbuffersOES); + CHECK_ADDRESS(NEL_PFNGLRENDERBUFFERSTORAGEOESPROC, glRenderbufferStorageOES); + CHECK_ADDRESS(NEL_PFNGLGETRENDERBUFFERPARAMETERIVOESPROC, glGetRenderbufferParameterivOES); + CHECK_ADDRESS(NEL_PFNGLISFRAMEBUFFEROESPROC, glIsFramebufferOES); + CHECK_ADDRESS(NEL_PFNGLBINDFRAMEBUFFEROESPROC, glBindFramebufferOES); + CHECK_ADDRESS(NEL_PFNGLDELETEFRAMEBUFFERSOESPROC, glDeleteFramebuffersOES); + CHECK_ADDRESS(NEL_PFNGLGENFRAMEBUFFERSOESPROC, glGenFramebuffersOES); + CHECK_ADDRESS(NEL_PFNGLCHECKFRAMEBUFFERSTATUSOESPROC, glCheckFramebufferStatusOES); + CHECK_ADDRESS(NEL_PFNGLFRAMEBUFFERRENDERBUFFEROESPROC, glFramebufferRenderbufferOES); + CHECK_ADDRESS(NEL_PFNGLFRAMEBUFFERTEXTURE2DOESPROC, glFramebufferTexture2DOES); + CHECK_ADDRESS(NEL_PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC, glGetFramebufferAttachmentParameterivOES); + CHECK_ADDRESS(NEL_PFNGLGENERATEMIPMAPOESPROC, glGenerateMipmapOES); +#else + CHECK_EXT("GL_EXT_framebuffer_object"); + + CHECK_ADDRESS(NEL_PFNGLISRENDERBUFFEREXTPROC, glIsRenderbufferEXT); + CHECK_ADDRESS(NEL_PFNGLISFRAMEBUFFEREXTPROC, glIsFramebufferEXT); + CHECK_ADDRESS(NEL_PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC, glCheckFramebufferStatusEXT); + CHECK_ADDRESS(NEL_PFNGLGENFRAMEBUFFERSEXTPROC, glGenFramebuffersEXT); + CHECK_ADDRESS(NEL_PFNGLBINDFRAMEBUFFEREXTPROC, glBindFramebufferEXT); + CHECK_ADDRESS(NEL_PFNGLFRAMEBUFFERTEXTURE2DEXTPROC, glFramebufferTexture2DEXT); + CHECK_ADDRESS(NEL_PFNGLGENRENDERBUFFERSEXTPROC, glGenRenderbuffersEXT); + CHECK_ADDRESS(NEL_PFNGLBINDRENDERBUFFEREXTPROC, glBindRenderbufferEXT); + CHECK_ADDRESS(NEL_PFNGLRENDERBUFFERSTORAGEEXTPROC, glRenderbufferStorageEXT); + CHECK_ADDRESS(NEL_PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC, glFramebufferRenderbufferEXT); + CHECK_ADDRESS(NEL_PFNGLDELETERENDERBUFFERSEXTPROC, glDeleteRenderbuffersEXT); + CHECK_ADDRESS(NEL_PFNGLDELETEFRAMEBUFFERSEXTPROC, glDeleteFramebuffersEXT); + CHECK_ADDRESS(NEL_PFNGETRENDERBUFFERPARAMETERIVEXTPROC, glGetRenderbufferParameterivEXT); + CHECK_ADDRESS(NEL_PFNGENERATEMIPMAPEXTPROC, glGenerateMipmapEXT); +#endif + + return true; +} + +// *************************************************************************** +static bool setupFrameBufferBlit(const char *glext) +{ + H_AUTO_OGL(setupFrameBufferBlit); + CHECK_EXT("GL_EXT_framebuffer_blit"); + +#ifndef USE_OPENGLES + CHECK_ADDRESS(NEL_PFNGLBLITFRAMEBUFFEREXTPROC, glBlitFramebufferEXT); +#endif + + return true; +} + +// *************************************************************************** +static bool setupFrameBufferMultisample(const char *glext) +{ + H_AUTO_OGL(setupFrameBufferMultisample); + CHECK_EXT("GL_EXT_framebuffer_multisample"); + +#ifndef USE_OPENGLES + CHECK_ADDRESS(NEL_PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC, glRenderbufferStorageMultisampleEXT); +#endif + + return true; +} + +// *************************************************************************** +static bool setupPackedDepthStencil(const char *glext) +{ + H_AUTO_OGL(setupPackedDepthStencil); + +#ifdef USE_OPENGLES + CHECK_EXT("GL_OES_packed_depth_stencil"); +#else + CHECK_EXT("GL_EXT_packed_depth_stencil"); +#endif + + return true; +} + +// *************************************************************************** +// Extension Check. +void registerGlExtensions(CGlExtensions &ext) +{ + H_AUTO_OGL(registerGlExtensions); + // OpenGL 1.2 ?? + const char *nglVersion= (const char *)glGetString (GL_VERSION); + sint a=0, b=0; + // 1.2*** ??? + sscanf(nglVersion, "%d.%d", &a, &b); + ext.Version1_2= (a==1 && b>=2) || (a>=2); + + // Extensions. + const char *glext= (const char*)glGetString(GL_EXTENSIONS); + GLint ntext; + + nldebug("3D: Available OpenGL Extensions:"); + + if (DebugLog) + { + vector exts; + explode(string(glext), string(" "), exts); + for(uint i = 0; i < exts.size(); i++) + { + if(i%5==0) DebugLog->displayRaw("3D: "); + DebugLog->displayRaw(string(exts[i]+" ").c_str()); + if(i%5==4) DebugLog->displayRaw("\n"); + } + DebugLog->displayRaw("\n"); + } + + // Check ARBMultiTexture + ext.ARBMultiTexture= setupARBMultiTexture(glext); + if(ext.ARBMultiTexture) + { + glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &ntext); + // We could have more than IDRV_MAT_MAXTEXTURES but the interface only + // support IDRV_MAT_MAXTEXTURES texture stages so take min + ext.NbTextureStages= (ntext<((GLint)IDRV_MAT_MAXTEXTURES)?ntext:IDRV_MAT_MAXTEXTURES); + } + + // Check EXTTextureEnvCombine + ext.EXTTextureEnvCombine= setupEXTTextureEnvCombine(glext); + + // Check ARBTextureCompression + ext.ARBTextureCompression= setupARBTextureCompression(glext); + + // Check ARBTextureNonPowerOfTwo + ext.ARBTextureNonPowerOfTwo= setupARBTextureNonPowerOfTwo(glext); + + // Check ARBMultisample + ext.ARBMultisample = setupARBMultisample(glext); + + // Check NVVertexArrayRange + // Disable feature ??? + if(!ext.DisableHardwareVertexArrayAGP) + ext.NVVertexArrayRange= setupNVVertexArrayRange(glext); + + if(ext.NVVertexArrayRange) + { + GLint nverts = 10; +#ifndef USE_OPENGLES + glGetIntegerv((GLenum)GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV, &nverts); +#endif + ext.NVVertexArrayRangeMaxVertex= nverts; + } + + // Compression S3TC OK iff ARBTextureCompression. + ext.EXTTextureCompressionS3TC= (ext.ARBTextureCompression && setupEXTTextureCompressionS3TC(glext)); + + // Check if NVidia GL_EXT_vertex_weighting is available. + ext.EXTVertexWeighting= setupEXTVertexWeighting(glext); + + // Check EXTSeparateSpecularColor. + ext.EXTSeparateSpecularColor= setupEXTSeparateSpecularColor(glext); + + // Check NVTextureEnvCombine4. + ext.NVTextureEnvCombine4= setupNVTextureEnvCombine4(glext); + + // Check for cube mapping + ext.ARBTextureCubeMap = setupARBTextureCubeMap(glext); + + // Check vertex program + // Disable feature ??? + if(!ext.DisableHardwareVertexProgram) + { + ext.NVVertexProgram = setupNVVertexProgram(glext); + ext.EXTVertexShader = setupEXTVertexShader(glext); + ext.ARBVertexProgram= setupARBVertexProgram(glext); + } + else + { + ext.NVVertexProgram = false; + ext.EXTVertexShader = false; + ext.ARBVertexProgram = false; + } + + ext.OESDrawTexture = setupOESDrawTexture(glext); + ext.OESMapBuffer = setupOESMapBuffer(glext); + + // Check texture shaders + // Disable feature ??? + if(!ext.DisableHardwareTextureShader) + { + ext.NVTextureShader = setupNVTextureShader(glext); + ext.ATIEnvMapBumpMap = setupATIEnvMapBumpMap(glext); + ext.ATIFragmentShader = setupATIFragmentShader(glext); + ext.ARBFragmentProgram = setupARBFragmentProgram(glext); + } + else + { + ext.ATIEnvMapBumpMap = false; + ext.NVTextureShader = false; + ext.ATIFragmentShader = false; + ext.ARBFragmentProgram = false; + } + + // For now, the only way to know if emulation, is to test some extension which exist only on GeForce3. + // if GL_NV_texture_shader is not here, then we are not on GeForce3. + ext.NVVertexProgramEmulated= ext.NVVertexProgram && (strstr(glext, "GL_NV_texture_shader")==NULL); + + // Check EXTSecondaryColor + ext.EXTSecondaryColor= setupEXTSecondaryColor(glext); + + // Check EXTBlendColor + ext.EXTBlendColor= setupEXTBlendColor(glext); + + // Check NVVertexArrayRange2 + ext.NVVertexArrayRange2= setupNVVertexArrayRange2(glext); + +#ifdef GL_NV_vertex_array_range2 + // if supported + if(ext.NVVertexArrayRange2) + // VBHard swap without flush of the VAR. + ext.NVStateVARWithoutFlush= GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV; + else + // VBHard with useless flush of the VAR. + ext.NVStateVARWithoutFlush= GL_VERTEX_ARRAY_RANGE_NV; +#endif + + // Check NV_occlusion_query + ext.NVOcclusionQuery = setupNVOcclusionQuery(glext); + + // Check GL_NV_texture_rectangle + ext.NVTextureRectangle = setupNVTextureRectangle(glext); + + // Check GL_EXT_texture_rectangle + ext.EXTTextureRectangle = setupEXTTextureRectangle(glext); + + // Check GL_ARB_texture_rectangle + ext.ARBTextureRectangle = setupARBTextureRectangle(glext); + + // Check GL_EXT_texture_filter_anisotropic + ext.EXTTextureFilterAnisotropic = setupEXTTextureFilterAnisotropic(glext); + + if (ext.EXTTextureFilterAnisotropic) + { + // get the maximum value + glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &ext.EXTTextureFilterAnisotropicMaximum); + } + + // Check GL_EXT_framebuffer_object + ext.FrameBufferObject = setupFrameBufferObject(glext); + + // Check GL_EXT_framebuffer_blit + ext.FrameBufferBlit = setupFrameBufferBlit(glext); + + // Check GL_EXT_framebuffer_multisample + ext.FrameBufferMultisample = setupFrameBufferMultisample(glext); + + // Check GL_EXT_packed_depth_stencil + ext.PackedDepthStencil = setupPackedDepthStencil(glext); + + // ATI extensions + // ------------- + + // Check ATIVertexArrayObject + // Disable feature ??? + if(!ext.DisableHardwareVertexArrayAGP) + { + ext.ATIVertexArrayObject= setupATIVertexArrayObject(glext); + ext.ATIMapObjectBuffer= setupATIMapObjectBuffer(glext); + ext.ATIVertexAttribArrayObject = setupATIVertexAttribArrayObject(glext); + } + // Check ATIXTextureEnvCombine3. + ext.ATITextureEnvCombine3= setupATITextureEnvCombine3(glext); + // Check ATIXTextureEnvRoute + ext.ATIXTextureEnvRoute= setupATIXTextureEnvRoute(glext); + + // ARB extensions + // ------------- + if(!ext.DisableHardwareVertexArrayAGP) + { + ext.ARBVertexBufferObject = setupARBVertexBufferObject(glext); + } + + // fix for radeon 7200 -> disable agp + if (ext.NbTextureStages == 3 && (ext.ATIVertexArrayObject || ext.ARBVertexBufferObject)) + { + ext.ATIVertexArrayObject = false; + ext.ARBVertexBufferObject = false; + ext.ATIMapObjectBuffer = false; + ext.ATIVertexAttribArrayObject = false; + } +} + + +// ********************************* +static bool setupWGLEXTSwapControl(const char *glext) +{ + H_AUTO_OGL(setupWGLEXTSwapControl); + CHECK_EXT("WGL_EXT_swap_control"); + +#ifndef USE_OPENGLES +#ifdef NL_OS_WINDOWS + CHECK_ADDRESS(PFNWGLSWAPINTERVALEXTPROC, wglSwapIntervalEXT); + CHECK_ADDRESS(PFNWGLGETSWAPINTERVALEXTPROC, wglGetSwapIntervalEXT); +#endif +#endif + + return true; +} + +// ********************************* +static bool setupGLXEXTSwapControl(const char *glext) +{ + H_AUTO_OGL(setupGLXEXTSwapControl); + CHECK_EXT("GLX_EXT_swap_control"); + +#if defined(NL_OS_UNIX) && !defined(NL_OS_MAC) + CHECK_ADDRESS(NEL_PFNGLXSWAPINTERVALEXTPROC, glXSwapIntervalEXT); +#endif + + return true; +} + +// ********************************* +static bool setupGLXSGISwapControl(const char *glext) +{ + H_AUTO_OGL(setupGLXSGISwapControl); + CHECK_EXT("GLX_SGI_swap_control"); + +#if defined(NL_OS_UNIX) && !defined(NL_OS_MAC) + CHECK_ADDRESS(PFNGLXSWAPINTERVALSGIPROC, glXSwapIntervalSGI); +#endif + + return true; +} + +// ********************************* +static bool setupGLXMESASwapControl(const char *glext) +{ + H_AUTO_OGL(setupGLXMESASwapControl); + CHECK_EXT("GLX_MESA_swap_control"); + +#if defined(NL_OS_UNIX) && !defined(NL_OS_MAC) + CHECK_ADDRESS(NEL_PFNGLXSWAPINTERVALMESAPROC, glXSwapIntervalMESA); + CHECK_ADDRESS(NEL_PFNGLXGETSWAPINTERVALMESAPROC, glXGetSwapIntervalMESA); +#endif + + return true; +} + +#ifdef USE_OPENGLES +// *************************************************************************** +bool registerEGlExtensions(CGlExtensions &ext, EGLDisplay dpy) +{ + H_AUTO_OGL(registerEGlExtensions); + + // Get extension string + const char *glext = eglQueryString(dpy, EGL_EXTENSIONS); + if (glext == NULL) + { + nlwarning ("neglGetExtensionsStringARB failed"); + return false; + } + + nldebug("3D: Available EGL Extensions:"); + + if (DebugLog) + { + vector exts; + explode(string(glext), string(" "), exts); + for(uint i = 0; i < exts.size(); i++) + { + if(i%5==0) DebugLog->displayRaw("3D: "); + DebugLog->displayRaw(string(exts[i]+" ").c_str()); + if(i%5==4) DebugLog->displayRaw("\n"); + } + DebugLog->displayRaw("\n"); + } + + return true; +} +#elif defined(NL_OS_WINDOWS) +// *************************************************************************** +bool registerWGlExtensions(CGlExtensions &ext, HDC hDC) +{ + H_AUTO_OGL(registerWGlExtensions); + + // Get proc address + CHECK_ADDRESS(PFNWGLGETEXTENSIONSSTRINGARBPROC, wglGetExtensionsStringARB); + + // Get extension string + const char *glext = nwglGetExtensionsStringARB (hDC); + if (glext == NULL) + { + nlwarning ("nwglGetExtensionsStringARB failed"); + return false; + } + + nldebug("3D: Available WGL Extensions:"); + + if (DebugLog) + { + vector exts; + explode(string(glext), string(" "), exts); + for(uint i = 0; i < exts.size(); i++) + { + if(i%5==0) DebugLog->displayRaw("3D: "); + DebugLog->displayRaw(string(exts[i]+" ").c_str()); + if(i%5==4) DebugLog->displayRaw("\n"); + } + DebugLog->displayRaw("\n"); + } + + // Check for pbuffer + ext.WGLARBPBuffer= setupWGLARBPBuffer(glext); + + // Check for pixel format + ext.WGLARBPixelFormat= setupWGLARBPixelFormat(glext); + + // Check for swap control + ext.WGLEXTSwapControl= setupWGLEXTSwapControl(glext); + + return true; +} +#elif defined(NL_OS_MAC) +#elif defined(NL_OS_UNIX) +// *************************************************************************** +bool registerGlXExtensions(CGlExtensions &ext, Display *dpy, sint screen) +{ + H_AUTO_OGL(registerGlXExtensions); + + // Get extension string + const char *glext = glXQueryExtensionsString(dpy, screen); + if (glext == NULL) + { + nlwarning ("glXQueryExtensionsString failed"); + return false; + } + + nldebug("3D: Available GLX Extensions:"); + + if (DebugLog) + { + vector exts; + explode(string(glext), string(" "), exts); + for(uint i = 0; i < exts.size(); i++) + { + if(i%5==0) DebugLog->displayRaw("3D: "); + DebugLog->displayRaw(string(exts[i]+" ").c_str()); + if(i%5==4) DebugLog->displayRaw("\n"); + } + DebugLog->displayRaw("\n"); + } + + // Check for pbuffer +// ext.WGLARBPBuffer= setupWGLARBPBuffer(glext); + + // Check for pixel format +// ext.WGLARBPixelFormat= setupWGLARBPixelFormat(glext); + + // Check for swap control + ext.GLXEXTSwapControl= setupGLXEXTSwapControl(glext); + ext.GLXSGISwapControl= setupGLXSGISwapControl(glext); + ext.GLXMESASwapControl= setupGLXMESASwapControl(glext); + + return true; +} +#endif // USE_OPENGLES + +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} // NL3D diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.h b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.h new file mode 100644 index 000000000..9d28a15ab --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.h @@ -0,0 +1,784 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef NL_OPENGL_EXTENSION_H +#define NL_OPENGL_EXTENSION_H + + +#include "nel/misc/types_nl.h" +#include "nel/misc/string_common.h" + +#include "driver_opengl_extension_def.h" + +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + +// *************************************************************************** +/// The extensions used by NL3D. +struct CGlExtensions +{ + // Is this driver a correct OpenGL 1.2 driver? + bool Version1_2; + + // Required Extensions. + bool ARBMultiTexture; + uint NbTextureStages; + bool EXTTextureEnvCombine; + + // Optional Extensions. + // NB: Fence extension is not here, because NVVertexArrayRange is false if GL_NV_fence is not here. + bool NVVertexArrayRange; + uint NVVertexArrayRangeMaxVertex; + bool EXTTextureCompressionS3TC; + bool EXTVertexWeighting; + bool EXTSeparateSpecularColor; + bool NVTextureEnvCombine4; + bool ARBTextureCubeMap; + bool NVVertexProgram; + bool EXTVertexShader; + bool NVTextureShader; + bool NVOcclusionQuery; + bool NVTextureRectangle; + bool EXTTextureRectangle; + bool ARBTextureRectangle; + bool FrameBufferObject; + bool FrameBufferBlit; + bool FrameBufferMultisample; + bool PackedDepthStencil; + bool EXTTextureFilterAnisotropic; + float EXTTextureFilterAnisotropicMaximum; + + // true if NVVertexProgram and if we know that VP is emulated + bool NVVertexProgramEmulated; + bool EXTSecondaryColor; + bool EXTBlendColor; + // NVVertexArrayRange2. + bool NVVertexArrayRange2; + // equal to GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV if possible, or GL_VERTEX_ARRAY_RANGE_NV + uint NVStateVARWithoutFlush; + + // WGL ARB extensions, true if supported + bool WGLARBPBuffer; + bool WGLARBPixelFormat; + bool WGLEXTSwapControl; + + // GLX extensions, true if supported + bool GLXEXTSwapControl; + bool GLXSGISwapControl; + bool GLXMESASwapControl; + + // ATI Extensions. + bool ATIVertexArrayObject; + bool ATIMapObjectBuffer; + bool ATITextureEnvCombine3; + bool ATIEnvMapBumpMap; + bool ATIFragmentShader; + bool ATIXTextureEnvRoute; + bool ATIVertexAttribArrayObject; + // ARB Extensions + bool ARBTextureCompression; + bool ARBFragmentProgram; + bool ARBVertexBufferObject; + bool ARBVertexProgram; + bool ARBTextureNonPowerOfTwo; + bool ARBMultisample; + + bool OESDrawTexture; + bool OESMapBuffer; + +public: + + /// \name Disable Hardware feature. False by default. setuped by IDriver + // @{ + bool DisableHardwareVertexProgram; + bool DisableHardwareVertexArrayAGP; + bool DisableHardwareTextureShader; + // @} + +public: + CGlExtensions() + { + // Fill all false by default. + Version1_2= false; + ARBMultiTexture= false; + NbTextureStages= 1; + EXTTextureEnvCombine= false; + ARBTextureCompression= false; + NVVertexArrayRange= false; + NVVertexArrayRangeMaxVertex= 0; + EXTTextureCompressionS3TC= false; + EXTVertexWeighting= false; + EXTSeparateSpecularColor= false; + NVTextureEnvCombine4= false; + ATITextureEnvCombine3= false; + ATIXTextureEnvRoute= false; + ARBTextureCubeMap= false; + NVTextureShader= false; + NVVertexProgram= false; + NVVertexProgramEmulated= false; + EXTSecondaryColor= false; + WGLARBPBuffer= false; + WGLARBPixelFormat= false; + WGLEXTSwapControl= false; + GLXEXTSwapControl= false; + GLXSGISwapControl= false; + GLXMESASwapControl= false; + EXTBlendColor= false; + ATIVertexArrayObject= false; + ATIEnvMapBumpMap = false; + ATIFragmentShader = false; + ATIVertexArrayObject = false; + ATIMapObjectBuffer = false; + ATIVertexAttribArrayObject = false; + EXTVertexShader= false; + ARBFragmentProgram = false; + ARBVertexBufferObject = false; + ARBVertexProgram = false; + NVTextureRectangle = false; + EXTTextureRectangle = false; + EXTTextureFilterAnisotropic = false; + EXTTextureFilterAnisotropicMaximum = 0.f; + ARBTextureRectangle = false; + ARBTextureNonPowerOfTwo = false; + ARBMultisample = false; + NVOcclusionQuery = false; + FrameBufferObject = false; + FrameBufferBlit = false; + FrameBufferMultisample = false; + PackedDepthStencil = false; + NVVertexArrayRange2 = false; + NVStateVARWithoutFlush = 0; + + OESDrawTexture = false; + OESMapBuffer = false; + + /// \name Disable Hardware feature. False by default. setuped by IDriver + DisableHardwareVertexProgram= false; + DisableHardwareVertexArrayAGP= false; + DisableHardwareTextureShader= false; + } + + std::string toString() + { + std::string result = "OpenGL version "; + result += Version1_2 ? "1.2 or above(*)" : "1.1 or below"; + result += "; Available extensions:"; + + result += "\n Texturing: "; + result += ARBMultiTexture ? "ARBMultiTexture " : ""; + result += EXTTextureEnvCombine ? "EXTTextureEnvCombine(*) " : ""; + result += ARBTextureCompression ? "ARBTextureCompression " : ""; + result += EXTTextureCompressionS3TC ? "EXTTextureCompressionS3TC " : ""; + result += NVTextureEnvCombine4 ? "NVTextureEnvCombine4 " : ""; + result += ATITextureEnvCombine3 ? "ATITextureEnvCombine3 " : ""; + result += ATIXTextureEnvRoute ? "ATITextureEnvRoute " : ""; + result += ARBTextureCubeMap ? "ARBTextureCubeMap " : ""; + result += ATIEnvMapBumpMap ? "ATIEnvMapBumpMap " : ""; + result += NVTextureRectangle ? "NVTextureRectangle " : ""; + result += EXTTextureRectangle ? "EXTTextureRectangle " : ""; + result += ARBTextureRectangle ? "ARBTextureRectangle " : ""; + result += EXTTextureFilterAnisotropic ? "EXTTextureFilterAnisotropic (Maximum = " + NLMISC::toString(EXTTextureFilterAnisotropicMaximum) + ") " : ""; + result += ARBTextureNonPowerOfTwo ? "ARBTextureNonPowerOfTwo " : ""; + result += "texture stages(*) = "; + result += NLMISC::toString(NbTextureStages); + + result += "\n Programs: "; + result += NVTextureShader ? "NVTextureShader " : ""; + result += ATIFragmentShader ? "ATIFragmentShader " : ""; + result += ARBFragmentProgram ? "ARBFragmentProgram " : ""; + result += ARBVertexProgram ? "ARBVertexProgram " : ""; + result += NVVertexProgram ? "NVVertexProgram " : ""; + result += EXTVertexShader ? "EXTVertexShader " : ""; + result += NVVertexProgramEmulated ? "NVVertexProgramEmulated " : ""; + + result += "\n Misc: "; + result += EXTVertexWeighting ? "EXTVertexWeighting " : ""; + result += EXTSeparateSpecularColor ? "EXTSeparateSpecularColor " : ""; + result += EXTSecondaryColor ? "EXTSecondaryColor " : ""; + result += EXTBlendColor ? "EXTBlendColor " : ""; + result += NVOcclusionQuery ? "NVOcclusionQuery " : ""; + result += NVStateVARWithoutFlush ? "NVStateVARWithoutFlush " : ""; + result += ARBMultisample ? "ARBMultisample " : ""; + +#ifdef NL_OS_WINDOWS + result += "\n WindowsGL: "; + result += WGLARBPBuffer ? "WGLARBPBuffer " : ""; + result += WGLARBPixelFormat ? "WGLARBPixelFormat " : ""; + result += WGLEXTSwapControl ? "WGLEXTSwapControl " : ""; +#elif defined(NL_OS_MAC) +#elif defined(NL_OS_UNIX) + result += "\n GLX: "; + result += GLXEXTSwapControl ? "GLXEXTSwapControl " : ""; + result += GLXSGISwapControl ? "GLXSGISwapControl " : ""; + result += GLXMESASwapControl ? "GLXMESASwapControl " : ""; +#endif + + result += "\n Array/VBO: "; + result += NVVertexArrayRange ? ("NVVertexArrayRange (MaxVertex = " + NLMISC::toString(NVVertexArrayRangeMaxVertex) + ") ") : ""; + result += NVVertexArrayRange2 ? "NVVertexArrayRange2 " : ""; + result += ATIVertexArrayObject ? "ATIVertexArrayObject " : ""; + result += ATIVertexAttribArrayObject ? "ATIVertexAttribArrayObject " : ""; + result += ARBVertexBufferObject ? "ARBVertexBufferObject " : ""; + result += ATIMapObjectBuffer ? "ATIMapObjectBuffer " : ""; + + result += "\n FBO: "; + result += FrameBufferObject ? "FramebufferObject " : ""; + result += FrameBufferBlit ? "FrameBufferBlit " : ""; + result += FrameBufferMultisample ? "FrameBufferMultisample " : ""; + result += PackedDepthStencil ? "PackedDepthStencil " : ""; + + return result; + } + +}; + +// *************************************************************************** + +#ifdef USE_OPENGLES +/// This function will test and register EGL functions before than the gl context is created +bool registerEGlExtensions(CGlExtensions &ext, EGLDisplay dpy); +#elif defined(NL_OS_WINDOWS) +/// This function will test and register WGL functions before than the gl context is created +bool registerWGlExtensions(CGlExtensions &ext, HDC hDC); +#elif defined(NL_OS_MAC) +#elif defined(NL_OS_UNIX) +/// This function will test and register GLX functions before than the gl context is created +bool registerGlXExtensions(CGlExtensions &ext, Display *dpy, sint screen); +#endif // NL_OS_WINDOWS + +/// This function test and register the extensions for the current GL context. +void registerGlExtensions(CGlExtensions &ext); + +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} // NL3D + +// *************************************************************************** +// The exported function names +/* NB: We named all like nglActiveTextureARB (n for NEL :) + to avoid compilation conflict with future version of gl.h + eg: gl.h Version 1.2 define glActiveTextureARB so we can't use it. + + NB: we do it for all (EXT, NV, ARB extension) even it should be useful only for ARB ones. +*/ + +#ifdef USE_OPENGLES + +// OES_mapbuffer. +//=============== +extern NEL_PFNGLMAPBUFFEROESPROC nglMapBufferOES; +extern NEL_PFNGLUNMAPBUFFEROESPROC nglUnmapBufferOES; +extern NEL_PFNGLGETBUFFERPOINTERVOESPROC nglGetBufferPointervOES; + +extern NEL_PFNGLBUFFERSUBDATAPROC nglBufferSubData; + +extern PFNGLDRAWTEXFOESPROC nglDrawTexfOES; + +// GL_OES_framebuffer_object +extern NEL_PFNGLISRENDERBUFFEROESPROC nglIsRenderbufferOES; +extern NEL_PFNGLBINDRENDERBUFFEROESPROC nglBindRenderbufferOES; +extern NEL_PFNGLDELETERENDERBUFFERSOESPROC nglDeleteRenderbuffersOES; +extern NEL_PFNGLGENRENDERBUFFERSOESPROC nglGenRenderbuffersOES; +extern NEL_PFNGLRENDERBUFFERSTORAGEOESPROC nglRenderbufferStorageOES; +extern NEL_PFNGLGETRENDERBUFFERPARAMETERIVOESPROC nglGetRenderbufferParameterivOES; +extern NEL_PFNGLISFRAMEBUFFEROESPROC nglIsFramebufferOES; +extern NEL_PFNGLBINDFRAMEBUFFEROESPROC nglBindFramebufferOES; +extern NEL_PFNGLDELETEFRAMEBUFFERSOESPROC nglDeleteFramebuffersOES; +extern NEL_PFNGLGENFRAMEBUFFERSOESPROC nglGenFramebuffersOES; +extern NEL_PFNGLCHECKFRAMEBUFFERSTATUSOESPROC nglCheckFramebufferStatusOES; +extern NEL_PFNGLFRAMEBUFFERRENDERBUFFEROESPROC nglFramebufferRenderbufferOES; +extern NEL_PFNGLFRAMEBUFFERTEXTURE2DOESPROC nglFramebufferTexture2DOES; +extern NEL_PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC nglGetFramebufferAttachmentParameterivOES; +extern NEL_PFNGLGENERATEMIPMAPOESPROC nglGenerateMipmapOES; + +// GL_OES_texture_cube_map +extern NEL_PFNGLTEXGENFOESPROC nglTexGenfOES; +extern NEL_PFNGLTEXGENFVOESPROC nglTexGenfvOES; +extern NEL_PFNGLTEXGENIOESPROC nglTexGeniOES; +extern NEL_PFNGLTEXGENIVOESPROC nglTexGenivOES; +extern NEL_PFNGLTEXGENXOESPROC nglTexGenxOES; +extern NEL_PFNGLTEXGENXVOESPROC nglTexGenxvOES; +extern NEL_PFNGLGETTEXGENFVOESPROC nglGetTexGenfvOES; +extern NEL_PFNGLGETTEXGENIVOESPROC nglGetTexGenivOES; +extern NEL_PFNGLGETTEXGENXVOESPROC nglGetTexGenxvOES; + +#else + +// ARB_multitexture +//================= +extern NEL_PFNGLACTIVETEXTUREARBPROC nglActiveTextureARB; +extern NEL_PFNGLCLIENTACTIVETEXTUREARBPROC nglClientActiveTextureARB; + +extern NEL_PFNGLMULTITEXCOORD1SARBPROC nglMultiTexCoord1sARB; +extern NEL_PFNGLMULTITEXCOORD1IARBPROC nglMultiTexCoord1iARB; +extern NEL_PFNGLMULTITEXCOORD1FARBPROC nglMultiTexCoord1fARB; +extern NEL_PFNGLMULTITEXCOORD1FARBPROC nglMultiTexCoord1fARB; +extern NEL_PFNGLMULTITEXCOORD1DARBPROC nglMultiTexCoord1dARB; +extern NEL_PFNGLMULTITEXCOORD2SARBPROC nglMultiTexCoord2sARB; +extern NEL_PFNGLMULTITEXCOORD2IARBPROC nglMultiTexCoord2iARB; +extern NEL_PFNGLMULTITEXCOORD2FARBPROC nglMultiTexCoord2fARB; +extern NEL_PFNGLMULTITEXCOORD2DARBPROC nglMultiTexCoord2dARB; +extern NEL_PFNGLMULTITEXCOORD3SARBPROC nglMultiTexCoord3sARB; +extern NEL_PFNGLMULTITEXCOORD3IARBPROC nglMultiTexCoord3iARB; +extern NEL_PFNGLMULTITEXCOORD3FARBPROC nglMultiTexCoord3fARB; +extern NEL_PFNGLMULTITEXCOORD3DARBPROC nglMultiTexCoord3dARB; +extern NEL_PFNGLMULTITEXCOORD4SARBPROC nglMultiTexCoord4sARB; +extern NEL_PFNGLMULTITEXCOORD4IARBPROC nglMultiTexCoord4iARB; +extern NEL_PFNGLMULTITEXCOORD4FARBPROC nglMultiTexCoord4fARB; +extern NEL_PFNGLMULTITEXCOORD4DARBPROC nglMultiTexCoord4dARB; + +extern NEL_PFNGLMULTITEXCOORD1SVARBPROC nglMultiTexCoord1svARB; +extern NEL_PFNGLMULTITEXCOORD1IVARBPROC nglMultiTexCoord1ivARB; +extern NEL_PFNGLMULTITEXCOORD1FVARBPROC nglMultiTexCoord1fvARB; +extern NEL_PFNGLMULTITEXCOORD1DVARBPROC nglMultiTexCoord1dvARB; +extern NEL_PFNGLMULTITEXCOORD2SVARBPROC nglMultiTexCoord2svARB; +extern NEL_PFNGLMULTITEXCOORD2IVARBPROC nglMultiTexCoord2ivARB; +extern NEL_PFNGLMULTITEXCOORD2FVARBPROC nglMultiTexCoord2fvARB; +extern NEL_PFNGLMULTITEXCOORD2DVARBPROC nglMultiTexCoord2dvARB; +extern NEL_PFNGLMULTITEXCOORD3SVARBPROC nglMultiTexCoord3svARB; +extern NEL_PFNGLMULTITEXCOORD3IVARBPROC nglMultiTexCoord3ivARB; +extern NEL_PFNGLMULTITEXCOORD3FVARBPROC nglMultiTexCoord3fvARB; +extern NEL_PFNGLMULTITEXCOORD3DVARBPROC nglMultiTexCoord3dvARB; +extern NEL_PFNGLMULTITEXCOORD4SVARBPROC nglMultiTexCoord4svARB; +extern NEL_PFNGLMULTITEXCOORD4IVARBPROC nglMultiTexCoord4ivARB; +extern NEL_PFNGLMULTITEXCOORD4FVARBPROC nglMultiTexCoord4fvARB; +extern NEL_PFNGLMULTITEXCOORD4DVARBPROC nglMultiTexCoord4dvARB; + + +// ARB_TextureCompression. +//======================== +extern NEL_PFNGLCOMPRESSEDTEXIMAGE3DARBPROC nglCompressedTexImage3DARB; +extern NEL_PFNGLCOMPRESSEDTEXIMAGE2DARBPROC nglCompressedTexImage2DARB; +extern NEL_PFNGLCOMPRESSEDTEXIMAGE1DARBPROC nglCompressedTexImage1DARB; +extern NEL_PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC nglCompressedTexSubImage3DARB; +extern NEL_PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC nglCompressedTexSubImage2DARB; +extern NEL_PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC nglCompressedTexSubImage1DARB; +extern NEL_PFNGLGETCOMPRESSEDTEXIMAGEARBPROC nglGetCompressedTexImageARB; + + +// VertexArrayRangeNV. +//==================== +extern NEL_PFNGLFLUSHVERTEXARRAYRANGENVPROC nglFlushVertexArrayRangeNV; +extern NEL_PFNGLVERTEXARRAYRANGENVPROC nglVertexArrayRangeNV; + +#ifdef NL_OS_WINDOWS +extern PFNWGLALLOCATEMEMORYNVPROC nwglAllocateMemoryNV; +extern PFNWGLFREEMEMORYNVPROC nwglFreeMemoryNV; +#elif defined(NL_OS_UNIX) && !defined(NL_OS_MAC) +extern NEL_PFNGLXALLOCATEMEMORYNVPROC nglXAllocateMemoryNV; +extern NEL_PFNGLXFREEMEMORYNVPROC nglXFreeMemoryNV; +#endif + + +// FenceNV. +//==================== +extern NEL_PFNGLDELETEFENCESNVPROC nglDeleteFencesNV; +extern NEL_PFNGLGENFENCESNVPROC nglGenFencesNV; +extern NEL_PFNGLISFENCENVPROC nglIsFenceNV; +extern NEL_PFNGLTESTFENCENVPROC nglTestFenceNV; +extern NEL_PFNGLGETFENCEIVNVPROC nglGetFenceivNV; +extern NEL_PFNGLFINISHFENCENVPROC nglFinishFenceNV; +extern NEL_PFNGLSETFENCENVPROC nglSetFenceNV; + + +// VertexWeighting. +//================== +extern NEL_PFNGLVERTEXWEIGHTFEXTPROC nglVertexWeightfEXT; +extern NEL_PFNGLVERTEXWEIGHTFVEXTPROC nglVertexWeightfvEXT; +extern NEL_PFNGLVERTEXWEIGHTPOINTEREXTPROC nglVertexWeightPointerEXT; + + +// VertexProgramExtension. +//======================== +extern NEL_PFNGLAREPROGRAMSRESIDENTNVPROC nglAreProgramsResidentNV; +extern NEL_PFNGLBINDPROGRAMNVPROC nglBindProgramNV; +extern NEL_PFNGLDELETEPROGRAMSNVPROC nglDeleteProgramsNV; +extern NEL_PFNGLEXECUTEPROGRAMNVPROC nglExecuteProgramNV; +extern NEL_PFNGLGENPROGRAMSNVPROC nglGenProgramsNV; +extern NEL_PFNGLGETPROGRAMPARAMETERDVNVPROC nglGetProgramParameterdvNV; +extern NEL_PFNGLGETPROGRAMPARAMETERFVNVPROC nglGetProgramParameterfvNV; +extern NEL_PFNGLGETPROGRAMIVNVPROC nglGetProgramivNV; +extern NEL_PFNGLGETPROGRAMSTRINGNVPROC nglGetProgramStringNV; +extern NEL_PFNGLGETTRACKMATRIXIVNVPROC nglGetTrackMatrixivNV; +extern NEL_PFNGLGETVERTEXATTRIBDVNVPROC nglGetVertexAttribdvNV; +extern NEL_PFNGLGETVERTEXATTRIBFVNVPROC nglGetVertexAttribfvNV; +extern NEL_PFNGLGETVERTEXATTRIBIVNVPROC nglGetVertexAttribivNV; +extern NEL_PFNGLGETVERTEXATTRIBPOINTERVNVPROC nglGetVertexAttribPointervNV; +extern NEL_PFNGLISPROGRAMNVPROC nglIsProgramNV; +extern NEL_PFNGLLOADPROGRAMNVPROC nglLoadProgramNV; +extern NEL_PFNGLPROGRAMPARAMETER4DNVPROC nglProgramParameter4dNV; +extern NEL_PFNGLPROGRAMPARAMETER4DVNVPROC nglProgramParameter4dvNV; +extern NEL_PFNGLPROGRAMPARAMETER4FNVPROC nglProgramParameter4fNV; +extern NEL_PFNGLPROGRAMPARAMETER4FVNVPROC nglProgramParameter4fvNV; +extern NEL_PFNGLPROGRAMPARAMETERS4DVNVPROC nglProgramParameters4dvNV; +extern NEL_PFNGLPROGRAMPARAMETERS4FVNVPROC nglProgramParameters4fvNV; +extern NEL_PFNGLREQUESTRESIDENTPROGRAMSNVPROC nglRequestResidentProgramsNV; +extern NEL_PFNGLTRACKMATRIXNVPROC nglTrackMatrixNV; +extern NEL_PFNGLVERTEXATTRIBPOINTERNVPROC nglVertexAttribPointerNV; +extern NEL_PFNGLVERTEXATTRIB1DNVPROC nglVertexAttrib1dNV; +extern NEL_PFNGLVERTEXATTRIB1DVNVPROC nglVertexAttrib1dvNV; +extern NEL_PFNGLVERTEXATTRIB1FNVPROC nglVertexAttrib1fNV; +extern NEL_PFNGLVERTEXATTRIB1FVNVPROC nglVertexAttrib1fvNV; +extern NEL_PFNGLVERTEXATTRIB1SNVPROC nglVertexAttrib1sNV; +extern NEL_PFNGLVERTEXATTRIB1SVNVPROC nglVertexAttrib1svNV; +extern NEL_PFNGLVERTEXATTRIB2DNVPROC nglVertexAttrib2dNV; +extern NEL_PFNGLVERTEXATTRIB2DVNVPROC nglVertexAttrib2dvNV; +extern NEL_PFNGLVERTEXATTRIB2FNVPROC nglVertexAttrib2fNV; +extern NEL_PFNGLVERTEXATTRIB2FVNVPROC nglVertexAttrib2fvNV; +extern NEL_PFNGLVERTEXATTRIB2SNVPROC nglVertexAttrib2sNV; +extern NEL_PFNGLVERTEXATTRIB2SVNVPROC nglVertexAttrib2svNV; +extern NEL_PFNGLVERTEXATTRIB3DNVPROC nglVertexAttrib3dNV; +extern NEL_PFNGLVERTEXATTRIB3DVNVPROC nglVertexAttrib3dvNV; +extern NEL_PFNGLVERTEXATTRIB3FNVPROC nglVertexAttrib3fNV; +extern NEL_PFNGLVERTEXATTRIB3FVNVPROC nglVertexAttrib3fvNV; +extern NEL_PFNGLVERTEXATTRIB3SNVPROC nglVertexAttrib3sNV; +extern NEL_PFNGLVERTEXATTRIB3SVNVPROC nglVertexAttrib3svNV; +extern NEL_PFNGLVERTEXATTRIB4DNVPROC nglVertexAttrib4dNV; +extern NEL_PFNGLVERTEXATTRIB4DVNVPROC nglVertexAttrib4dvNV; +extern NEL_PFNGLVERTEXATTRIB4FNVPROC nglVertexAttrib4fNV; +extern NEL_PFNGLVERTEXATTRIB4FVNVPROC nglVertexAttrib4fvNV; +extern NEL_PFNGLVERTEXATTRIB4SNVPROC nglVertexAttrib4sNV; +extern NEL_PFNGLVERTEXATTRIB4SVNVPROC nglVertexAttrib4svNV; +extern NEL_PFNGLVERTEXATTRIB4UBVNVPROC nglVertexAttrib4ubvNV; +extern NEL_PFNGLVERTEXATTRIBS1DVNVPROC nglVertexAttribs1dvNV; +extern NEL_PFNGLVERTEXATTRIBS1FVNVPROC nglVertexAttribs1fvNV; +extern NEL_PFNGLVERTEXATTRIBS1SVNVPROC nglVertexAttribs1svNV; +extern NEL_PFNGLVERTEXATTRIBS2DVNVPROC nglVertexAttribs2dvNV; +extern NEL_PFNGLVERTEXATTRIBS2FVNVPROC nglVertexAttribs2fvNV; +extern NEL_PFNGLVERTEXATTRIBS2SVNVPROC nglVertexAttribs2svNV; +extern NEL_PFNGLVERTEXATTRIBS3DVNVPROC nglVertexAttribs3dvNV; +extern NEL_PFNGLVERTEXATTRIBS3FVNVPROC nglVertexAttribs3fvNV; +extern NEL_PFNGLVERTEXATTRIBS3SVNVPROC nglVertexAttribs3svNV; +extern NEL_PFNGLVERTEXATTRIBS4DVNVPROC nglVertexAttribs4dvNV; +extern NEL_PFNGLVERTEXATTRIBS4FVNVPROC nglVertexAttribs4fvNV; +extern NEL_PFNGLVERTEXATTRIBS4SVNVPROC nglVertexAttribs4svNV; +extern NEL_PFNGLVERTEXATTRIBS4UBVNVPROC nglVertexAttribs4ubvNV; + +// VertexShaderExtension. +//======================== +extern NEL_PFNGLBEGINVERTEXSHADEREXTPROC nglBeginVertexShaderEXT; +extern NEL_PFNGLENDVERTEXSHADEREXTPROC nglEndVertexShaderEXT; +extern NEL_PFNGLBINDVERTEXSHADEREXTPROC nglBindVertexShaderEXT; +extern NEL_PFNGLGENVERTEXSHADERSEXTPROC nglGenVertexShadersEXT; +extern NEL_PFNGLDELETEVERTEXSHADEREXTPROC nglDeleteVertexShaderEXT; +extern NEL_PFNGLSHADEROP1EXTPROC nglShaderOp1EXT; +extern NEL_PFNGLSHADEROP2EXTPROC nglShaderOp2EXT; +extern NEL_PFNGLSHADEROP3EXTPROC nglShaderOp3EXT; +extern NEL_PFNGLSWIZZLEEXTPROC nglSwizzleEXT; +extern NEL_PFNGLWRITEMASKEXTPROC nglWriteMaskEXT; +extern NEL_PFNGLINSERTCOMPONENTEXTPROC nglInsertComponentEXT; +extern NEL_PFNGLEXTRACTCOMPONENTEXTPROC nglExtractComponentEXT; +extern NEL_PFNGLGENSYMBOLSEXTPROC nglGenSymbolsEXT; +extern NEL_PFNGLSETINVARIANTEXTPROC nglSetInvariantEXT; +extern NEL_PFNGLSETLOCALCONSTANTEXTPROC nglSetLocalConstantEXT; +extern NEL_PFNGLVARIANTPOINTEREXTPROC nglVariantPointerEXT; +extern NEL_PFNGLENABLEVARIANTCLIENTSTATEEXTPROC nglEnableVariantClientStateEXT; +extern NEL_PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC nglDisableVariantClientStateEXT; +extern NEL_PFNGLBINDLIGHTPARAMETEREXTPROC nglBindLightParameterEXT; +extern NEL_PFNGLBINDMATERIALPARAMETEREXTPROC nglBindMaterialParameterEXT; +extern NEL_PFNGLBINDTEXGENPARAMETEREXTPROC nglBindTexGenParameterEXT; +extern NEL_PFNGLBINDTEXTUREUNITPARAMETEREXTPROC nglBindTextureUnitParameterEXT; +extern NEL_PFNGLBINDPARAMETEREXTPROC nglBindParameterEXT; +extern NEL_PFNGLISVARIANTENABLEDEXTPROC nglIsVariantEnabledEXT; +extern NEL_PFNGLGETVARIANTBOOLEANVEXTPROC nglGetVariantBooleanvEXT; +extern NEL_PFNGLGETVARIANTINTEGERVEXTPROC nglGetVariantIntegervEXT; +extern NEL_PFNGLGETVARIANTFLOATVEXTPROC nglGetVariantFloatvEXT; +extern NEL_PFNGLGETVARIANTPOINTERVEXTPROC nglGetVariantPointervEXT; +extern NEL_PFNGLGETINVARIANTBOOLEANVEXTPROC nglGetInvariantBooleanvEXT; +extern NEL_PFNGLGETINVARIANTINTEGERVEXTPROC nglGetInvariantIntegervEXT; +extern NEL_PFNGLGETINVARIANTFLOATVEXTPROC nglGetInvariantFloatvEXT; +extern NEL_PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC nglGetLocalConstantBooleanvEXT; +extern NEL_PFNGLGETLOCALCONSTANTINTEGERVEXTPROC nglGetLocalConstantIntegervEXT; +extern NEL_PFNGLGETLOCALCONSTANTFLOATVEXTPROC nglGetLocalConstantFloatvEXT; + + +// ATI_envmap_bumpmap extension + +extern PFNGLTEXBUMPPARAMETERIVATIPROC nglTexBumpParameterivATI; +extern PFNGLTEXBUMPPARAMETERFVATIPROC nglTexBumpParameterfvATI; +extern PFNGLGETTEXBUMPPARAMETERIVATIPROC nglGetTexBumpParameterivATI; +extern PFNGLGETTEXBUMPPARAMETERFVATIPROC nglGetTexBumpParameterfvATI; + + +// SecondaryColor extension +//======================== +extern NEL_PFNGLSECONDARYCOLOR3BEXTPROC nglSecondaryColor3bEXT; +extern NEL_PFNGLSECONDARYCOLOR3BVEXTPROC nglSecondaryColor3bvEXT; +extern NEL_PFNGLSECONDARYCOLOR3DEXTPROC nglSecondaryColor3dEXT; +extern NEL_PFNGLSECONDARYCOLOR3DVEXTPROC nglSecondaryColor3dvEXT; +extern NEL_PFNGLSECONDARYCOLOR3FEXTPROC nglSecondaryColor3fEXT; +extern NEL_PFNGLSECONDARYCOLOR3FVEXTPROC nglSecondaryColor3fvEXT; +extern NEL_PFNGLSECONDARYCOLOR3IEXTPROC nglSecondaryColor3iEXT; +extern NEL_PFNGLSECONDARYCOLOR3IVEXTPROC nglSecondaryColor3ivEXT; +extern NEL_PFNGLSECONDARYCOLOR3SEXTPROC nglSecondaryColor3sEXT; +extern NEL_PFNGLSECONDARYCOLOR3SVEXTPROC nglSecondaryColor3svEXT; +extern NEL_PFNGLSECONDARYCOLOR3UBEXTPROC nglSecondaryColor3ubEXT; +extern NEL_PFNGLSECONDARYCOLOR3UBVEXTPROC nglSecondaryColor3ubvEXT; +extern NEL_PFNGLSECONDARYCOLOR3UIEXTPROC nglSecondaryColor3uiEXT; +extern NEL_PFNGLSECONDARYCOLOR3UIVEXTPROC nglSecondaryColor3uivEXT; +extern NEL_PFNGLSECONDARYCOLOR3USEXTPROC nglSecondaryColor3usEXT; +extern NEL_PFNGLSECONDARYCOLOR3USVEXTPROC nglSecondaryColor3usvEXT; +extern NEL_PFNGLSECONDARYCOLORPOINTEREXTPROC nglSecondaryColorPointerEXT; + + +// BlendColor extension +//======================== +extern NEL_PFNGLBLENDCOLOREXTPROC nglBlendColorEXT; + + +// GL_ATI_vertex_array_object extension +//======================== +extern NEL_PFNGLNEWOBJECTBUFFERATIPROC nglNewObjectBufferATI; +extern NEL_PFNGLISOBJECTBUFFERATIPROC nglIsObjectBufferATI; +extern NEL_PFNGLUPDATEOBJECTBUFFERATIPROC nglUpdateObjectBufferATI; +extern NEL_PFNGLGETOBJECTBUFFERFVATIPROC nglGetObjectBufferfvATI; +extern NEL_PFNGLGETOBJECTBUFFERIVATIPROC nglGetObjectBufferivATI; +extern NEL_PFNGLDELETEOBJECTBUFFERATIPROC nglDeleteObjectBufferATI; +extern NEL_PFNGLARRAYOBJECTATIPROC nglArrayObjectATI; +extern NEL_PFNGLGETARRAYOBJECTFVATIPROC nglGetArrayObjectfvATI; +extern NEL_PFNGLGETARRAYOBJECTIVATIPROC nglGetArrayObjectivATI; +extern NEL_PFNGLVARIANTARRAYOBJECTATIPROC nglVariantArrayObjectATI; +extern NEL_PFNGLGETVARIANTARRAYOBJECTFVATIPROC nglGetVariantArrayObjectfvATI; +extern NEL_PFNGLGETVARIANTARRAYOBJECTIVATIPROC nglGetVariantArrayObjectivATI; + +// GL_ATI_map_object_buffer +//=================================== + +extern NEL_PFNGLMAPOBJECTBUFFERATIPROC nglMapObjectBufferATI; +extern NEL_PFNGLUNMAPOBJECTBUFFERATIPROC nglUnmapObjectBufferATI; + + +// GL_ATI_fragment_shader extension +//=================================== + +extern NEL_PFNGLGENFRAGMENTSHADERSATIPROC nglGenFragmentShadersATI; +extern NEL_PFNGLBINDFRAGMENTSHADERATIPROC nglBindFragmentShaderATI; +extern NEL_PFNGLDELETEFRAGMENTSHADERATIPROC nglDeleteFragmentShaderATI; +extern NEL_PFNGLBEGINFRAGMENTSHADERATIPROC nglBeginFragmentShaderATI; +extern NEL_PFNGLENDFRAGMENTSHADERATIPROC nglEndFragmentShaderATI; +extern NEL_PFNGLPASSTEXCOORDATIPROC nglPassTexCoordATI; +extern NEL_PFNGLSAMPLEMAPATIPROC nglSampleMapATI; +extern NEL_PFNGLCOLORFRAGMENTOP1ATIPROC nglColorFragmentOp1ATI; +extern NEL_PFNGLCOLORFRAGMENTOP2ATIPROC nglColorFragmentOp2ATI; +extern NEL_PFNGLCOLORFRAGMENTOP3ATIPROC nglColorFragmentOp3ATI; +extern NEL_PFNGLALPHAFRAGMENTOP1ATIPROC nglAlphaFragmentOp1ATI; +extern NEL_PFNGLALPHAFRAGMENTOP2ATIPROC nglAlphaFragmentOp2ATI; +extern NEL_PFNGLALPHAFRAGMENTOP3ATIPROC nglAlphaFragmentOp3ATI; +extern NEL_PFNGLSETFRAGMENTSHADERCONSTANTATIPROC nglSetFragmentShaderConstantATI; + +// GL_ATI_vertex_attrib_array_object +//================================== +extern NEL_PFNGLVERTEXATTRIBARRAYOBJECTATIPROC nglVertexAttribArrayObjectATI; +extern NEL_PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC nglGetVertexAttribArrayObjectfvATI; +extern NEL_PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC nglGetVertexAttribArrayObjectivATI; + + + + +// GL_ARB_fragment_shader_extension +//================================== +extern NEL_PFNGLPROGRAMSTRINGARBPROC nglProgramStringARB; +extern NEL_PFNGLBINDPROGRAMARBPROC nglBindProgramARB; +extern NEL_PFNGLDELETEPROGRAMSARBPROC nglDeleteProgramsARB; +extern NEL_PFNGLGENPROGRAMSARBPROC nglGenProgramsARB; +extern NEL_PFNGLPROGRAMENVPARAMETER4DARBPROC nglProgramEnvParameter4dARB; +extern NEL_PFNGLPROGRAMENVPARAMETER4DVARBPROC nglProgramEnvParameter4dvARB; +extern NEL_PFNGLPROGRAMENVPARAMETER4FARBPROC nglProgramEnvParameter4fARB; +extern NEL_PFNGLPROGRAMENVPARAMETER4FVARBPROC nglProgramEnvParameter4fvARB; +extern NEL_PFNGLPROGRAMLOCALPARAMETER4DARBPROC nglGetProgramLocalParameter4dARB; +extern NEL_PFNGLPROGRAMLOCALPARAMETER4DVARBPROC nglGetProgramLocalParameter4dvARB; +extern NEL_PFNGLPROGRAMLOCALPARAMETER4FARBPROC nglGetProgramLocalParameter4fARB; +extern NEL_PFNGLPROGRAMLOCALPARAMETER4FVARBPROC nglGetProgramLocalParameter4fvARB; +extern NEL_PFNGLGETPROGRAMENVPARAMETERDVARBPROC nglGetProgramEnvParameterdvARB; +extern NEL_PFNGLGETPROGRAMENVPARAMETERFVARBPROC nglGetProgramEnvParameterfvARB; +extern NEL_PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC nglGetProgramLocalParameterdvARB; +extern NEL_PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC nglGetProgramLocalParameterfvARB; +extern NEL_PFNGLGETPROGRAMIVARBPROC nglGetProgramivARB; +extern NEL_PFNGLGETPROGRAMSTRINGARBPROC nglGetProgramStringARB; +extern NEL_PFNGLISPROGRAMARBPROC nglIsProgramARB; + +// GL_ARB_vertex_buffer_object +//================================== +extern PFNGLBINDBUFFERARBPROC nglBindBufferARB; +extern PFNGLDELETEBUFFERSARBPROC nglDeleteBuffersARB; +extern PFNGLGENBUFFERSARBPROC nglGenBuffersARB; +extern PFNGLISBUFFERARBPROC nglIsBufferARB; +extern PFNGLBUFFERDATAARBPROC nglBufferDataARB; +extern PFNGLBUFFERSUBDATAARBPROC nglBufferSubDataARB; +extern PFNGLGETBUFFERSUBDATAARBPROC nglGetBufferSubDataARB; +extern PFNGLMAPBUFFERARBPROC nglMapBufferARB; +extern PFNGLUNMAPBUFFERARBPROC nglUnmapBufferARB; +extern PFNGLGETBUFFERPARAMETERIVARBPROC nglGetBufferParameterivARB; +extern PFNGLGETBUFFERPOINTERVARBPROC nglGetBufferPointervARB; + + + +// GL_ARB_vertex_program +//================================== +extern PFNGLVERTEXATTRIB1SARBPROC nglVertexAttrib1sARB; +extern PFNGLVERTEXATTRIB1FARBPROC nglVertexAttrib1fARB; +extern PFNGLVERTEXATTRIB1DARBPROC nglVertexAttrib1dARB; +extern PFNGLVERTEXATTRIB2SARBPROC nglVertexAttrib2sARB; +extern PFNGLVERTEXATTRIB2FARBPROC nglVertexAttrib2fARB; +extern PFNGLVERTEXATTRIB2DARBPROC nglVertexAttrib2dARB; +extern PFNGLVERTEXATTRIB3SARBPROC nglVertexAttrib3sARB; +extern PFNGLVERTEXATTRIB3FARBPROC nglVertexAttrib3fARB; +extern PFNGLVERTEXATTRIB3DARBPROC nglVertexAttrib3dARB; +extern PFNGLVERTEXATTRIB4SARBPROC nglVertexAttrib4sARB; +extern PFNGLVERTEXATTRIB4FARBPROC nglVertexAttrib4fARB; +extern PFNGLVERTEXATTRIB4DARBPROC nglVertexAttrib4dARB; +extern PFNGLVERTEXATTRIB4NUBARBPROC nglVertexAttrib4NubARB; +extern PFNGLVERTEXATTRIB1SVARBPROC nglVertexAttrib1svARB; +extern PFNGLVERTEXATTRIB1FVARBPROC nglVertexAttrib1fvARB; +extern PFNGLVERTEXATTRIB1DVARBPROC nglVertexAttrib1dvARB; +extern PFNGLVERTEXATTRIB2SVARBPROC nglVertexAttrib2svARB; +extern PFNGLVERTEXATTRIB2FVARBPROC nglVertexAttrib2fvARB; +extern PFNGLVERTEXATTRIB2DVARBPROC nglVertexAttrib2dvARB; +extern PFNGLVERTEXATTRIB3SVARBPROC nglVertexAttrib3svARB; +extern PFNGLVERTEXATTRIB3FVARBPROC nglVertexAttrib3fvARB; +extern PFNGLVERTEXATTRIB3DVARBPROC nglVertexAttrib3dvARB; +extern PFNGLVERTEXATTRIB4BVARBPROC nglVertexAttrib4bvARB; +extern PFNGLVERTEXATTRIB4SVARBPROC nglVertexAttrib4svARB; +extern PFNGLVERTEXATTRIB4IVARBPROC nglVertexAttrib4ivARB; +extern PFNGLVERTEXATTRIB4UBVARBPROC nglVertexAttrib4ubvARB; +extern PFNGLVERTEXATTRIB4USVARBPROC nglVertexAttrib4usvARB; +extern PFNGLVERTEXATTRIB4UIVARBPROC nglVertexAttrib4uivARB; +extern PFNGLVERTEXATTRIB4FVARBPROC nglVertexAttrib4fvARB; +extern PFNGLVERTEXATTRIB4DVARBPROC nglVertexAttrib4dvARB; +extern PFNGLVERTEXATTRIB4NBVARBPROC nglVertexAttrib4NbvARB; +extern PFNGLVERTEXATTRIB4NSVARBPROC nglVertexAttrib4NsvARB; +extern PFNGLVERTEXATTRIB4NIVARBPROC nglVertexAttrib4NivARB; +extern PFNGLVERTEXATTRIB4NUBVARBPROC nglVertexAttrib4NubvARB; +extern PFNGLVERTEXATTRIB4NUSVARBPROC nglVertexAttrib4NusvARB; +extern PFNGLVERTEXATTRIB4NUIVARBPROC nglVertexAttrib4NuivARB; +extern PFNGLVERTEXATTRIBPOINTERARBPROC nglVertexAttribPointerARB; +extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC nglEnableVertexAttribArrayARB; +extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC nglDisableVertexAttribArrayARB; +extern PFNGLPROGRAMSTRINGARBPROC nglProgramStringARB; +extern PFNGLBINDPROGRAMARBPROC nglBindProgramARB; +extern PFNGLDELETEPROGRAMSARBPROC nglDeleteProgramsARB; +extern PFNGLGENPROGRAMSARBPROC nglGenProgramsARB; +extern PFNGLPROGRAMENVPARAMETER4FARBPROC nglProgramEnvParameter4fARB; +extern PFNGLPROGRAMENVPARAMETER4DARBPROC nglProgramEnvParameter4dARB; +extern PFNGLPROGRAMENVPARAMETER4FVARBPROC nglProgramEnvParameter4fvARB; +extern PFNGLPROGRAMENVPARAMETER4DVARBPROC nglProgramEnvParameter4dvARB; +extern PFNGLPROGRAMLOCALPARAMETER4FARBPROC nglProgramLocalParameter4fARB; +extern PFNGLPROGRAMLOCALPARAMETER4DARBPROC nglProgramLocalParameter4dARB; +extern PFNGLPROGRAMLOCALPARAMETER4FVARBPROC nglProgramLocalParameter4fvARB; +extern PFNGLPROGRAMLOCALPARAMETER4DVARBPROC nglProgramLocalParameter4dvARB; +extern PFNGLGETPROGRAMENVPARAMETERFVARBPROC nglGetProgramEnvParameterfvARB; +extern PFNGLGETPROGRAMENVPARAMETERDVARBPROC nglGetProgramEnvParameterdvARB; +extern PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC nglGetProgramLocalParameterfvARB; +extern PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC nglGetProgramLocalParameterdvARB; +extern PFNGLGETPROGRAMIVARBPROC nglGetProgramivARB; +extern PFNGLGETPROGRAMSTRINGARBPROC nglGetProgramStringARB; +extern PFNGLGETVERTEXATTRIBDVARBPROC nglGetVertexAttribdvARB; +extern PFNGLGETVERTEXATTRIBFVARBPROC nglGetVertexAttribfvARB; +extern PFNGLGETVERTEXATTRIBIVARBPROC nglGetVertexAttribivARB; +extern PFNGLGETVERTEXATTRIBPOINTERVARBPROC nglGetVertexAttribPointervARB; +extern PFNGLISPROGRAMARBPROC nglIsProgramARB; + +// GL_NV_occlusion_query +//================================== +extern NEL_PFNGLGENOCCLUSIONQUERIESNVPROC nglGenOcclusionQueriesNV; +extern NEL_PFNGLDELETEOCCLUSIONQUERIESNVPROC nglDeleteOcclusionQueriesNV; +extern NEL_PFNGLISOCCLUSIONQUERYNVPROC nglIsOcclusionQueryNV; +extern NEL_PFNGLBEGINOCCLUSIONQUERYNVPROC nglBeginOcclusionQueryNV; +extern NEL_PFNGLENDOCCLUSIONQUERYNVPROC nglEndOcclusionQueryNV; +extern NEL_PFNGLGETOCCLUSIONQUERYIVNVPROC nglGetOcclusionQueryivNV; +extern NEL_PFNGLGETOCCLUSIONQUERYUIVNVPROC nglGetOcclusionQueryuivNV; + + + +#ifdef NL_OS_WINDOWS + +// Pbuffer extension +//================== +extern PFNWGLCREATEPBUFFERARBPROC nwglCreatePbufferARB; +extern PFNWGLGETPBUFFERDCARBPROC nwglGetPbufferDCARB; +extern PFNWGLRELEASEPBUFFERDCARBPROC nwglReleasePbufferDCARB; +extern PFNWGLDESTROYPBUFFERARBPROC nwglDestroyPbufferARB; +extern PFNWGLQUERYPBUFFERARBPROC nwglQueryPbufferARB; + + +// Get Pixel format extension +//=========================== +extern PFNWGLGETPIXELFORMATATTRIBIVARBPROC nwglGetPixelFormatAttribivARB; +extern PFNWGLGETPIXELFORMATATTRIBFVARBPROC nwglGetPixelFormatAttribfvARB; +extern PFNWGLCHOOSEPIXELFORMATARBPROC nwglChoosePixelFormatARB; + + +// Swap control extension +//=========================== +extern PFNWGLSWAPINTERVALEXTPROC nwglSwapIntervalEXT; +extern PFNWGLGETSWAPINTERVALEXTPROC nwglGetSwapIntervalEXT; + + +// WGL_ARB_extensions_string +extern PFNWGLGETEXTENSIONSSTRINGARBPROC nwglGetExtensionsStringARB; + +#elif defined(NL_OS_MAC) +#elif defined(NL_OS_UNIX) + +// Swap control extensions +//=========================== +extern NEL_PFNGLXSWAPINTERVALEXTPROC nglXSwapIntervalEXT; + +extern PFNGLXSWAPINTERVALSGIPROC nglXSwapIntervalSGI; + +extern NEL_PFNGLXSWAPINTERVALMESAPROC nglXSwapIntervalMESA; +extern NEL_PFNGLXGETSWAPINTERVALMESAPROC nglXGetSwapIntervalMESA; + +#endif + +// GL_EXT_framebuffer_object +extern NEL_PFNGLISRENDERBUFFEREXTPROC nglIsRenderbufferEXT; +extern NEL_PFNGLISFRAMEBUFFEREXTPROC nglIsFramebufferEXT; +extern NEL_PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC nglCheckFramebufferStatusEXT; +extern NEL_PFNGLGENFRAMEBUFFERSEXTPROC nglGenFramebuffersEXT; +extern NEL_PFNGLBINDFRAMEBUFFEREXTPROC nglBindFramebufferEXT; +extern NEL_PFNGLFRAMEBUFFERTEXTURE2DEXTPROC nglFramebufferTexture2DEXT; +extern NEL_PFNGLGENRENDERBUFFERSEXTPROC nglGenRenderbuffersEXT; +extern NEL_PFNGLBINDRENDERBUFFEREXTPROC nglBindRenderbufferEXT; +extern NEL_PFNGLRENDERBUFFERSTORAGEEXTPROC nglRenderbufferStorageEXT; +extern NEL_PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC nglFramebufferRenderbufferEXT; +extern NEL_PFNGLDELETERENDERBUFFERSEXTPROC nglDeleteRenderbuffersEXT; +extern NEL_PFNGLDELETEFRAMEBUFFERSEXTPROC nglDeleteFramebuffersEXT; +extern NEL_PFNGETRENDERBUFFERPARAMETERIVEXTPROC nglGetRenderbufferParameterivEXT; +extern NEL_PFNGENERATEMIPMAPEXTPROC nglGenerateMipmapEXT; + +// GL_EXT_framebuffer_blit +extern NEL_PFNGLBLITFRAMEBUFFEREXTPROC nglBlitFramebufferEXT; + +// GL_EXT_framebuffer_multisample +extern NEL_PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC nglRenderbufferStorageMultisampleEXT; + +// GL_ARB_multisample +extern NEL_PFNGLSAMPLECOVERAGEARBPROC nglSampleCoverageARB; + +#endif // USE_OPENGLES + +#endif // NL_OPENGL_EXTENSION_H + diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension_def.h b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension_def.h new file mode 100644 index 000000000..a11d0cd1c --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension_def.h @@ -0,0 +1,471 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef NL_OPENGL_EXTENSION_DEF_H +#define NL_OPENGL_EXTENSION_DEF_H + + +#include "nel/misc/types_nl.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef USE_OPENGLES +// OES_mapbuffer +//============== +typedef void* (APIENTRY * NEL_PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRY * NEL_PFNGLUNMAPBUFFEROESPROC) (GLenum target); +typedef void (APIENTRY * NEL_PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void** params); + +typedef void (APIENTRY * NEL_PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); + +// GL_OES_framebuffer_object +//================================== +typedef GLboolean (APIENTRY * NEL_PFNGLISRENDERBUFFEROESPROC) (GLuint renderbuffer); +typedef void (APIENTRY * NEL_PFNGLBINDRENDERBUFFEROESPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRY * NEL_PFNGLDELETERENDERBUFFERSOESPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (APIENTRY * NEL_PFNGLGENRENDERBUFFERSOESPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (APIENTRY * NEL_PFNGLRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRY * NEL_PFNGLGETRENDERBUFFERPARAMETERIVOESPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (APIENTRY * NEL_PFNGLISFRAMEBUFFEROESPROC) (GLuint framebuffer); +typedef void (APIENTRY * NEL_PFNGLBINDFRAMEBUFFEROESPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRY * NEL_PFNGLDELETEFRAMEBUFFERSOESPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (APIENTRY * NEL_PFNGLGENFRAMEBUFFERSOESPROC) (GLsizei n, GLuint* framebuffers); +typedef GLenum (APIENTRY * NEL_PFNGLCHECKFRAMEBUFFERSTATUSOESPROC) (GLenum target); +typedef void (APIENTRY * NEL_PFNGLFRAMEBUFFERRENDERBUFFEROESPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRY * NEL_PFNGLFRAMEBUFFERTEXTURE2DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRY * NEL_PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (APIENTRY * NEL_PFNGLGENERATEMIPMAPOESPROC) (GLenum target); + +// GL_OES_texture_cube_map +//================================== +typedef void (APIENTRY * NEL_PFNGLTEXGENFOESPROC) (GLenum coord, GLenum pname, GLfloat param); +typedef void (APIENTRY * NEL_PFNGLTEXGENFVOESPROC) (GLenum coord, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * NEL_PFNGLTEXGENIOESPROC) (GLenum coord, GLenum pname, GLint param); +typedef void (APIENTRY * NEL_PFNGLTEXGENIVOESPROC) (GLenum coord, GLenum pname, const GLint *params); +typedef void (APIENTRY * NEL_PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param); +typedef void (APIENTRY * NEL_PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params); +typedef void (APIENTRY * NEL_PFNGLGETTEXGENFVOESPROC) (GLenum coord, GLenum pname, GLfloat *params); +typedef void (APIENTRY * NEL_PFNGLGETTEXGENIVOESPROC) (GLenum coord, GLenum pname, GLint *params); +typedef void (APIENTRY * NEL_PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params); + +#define GL_MULTISAMPLE_ARB GL_MULTISAMPLE +#define GL_TEXTURE_CUBE_MAP_ARB GL_TEXTURE_CUBE_MAP_OES +#define GL_NONE 0 +#define GL_MAX_TEXTURE_UNITS_ARB GL_MAX_TEXTURE_UNITS +#define GL_REFLECTION_MAP_ARB GL_REFLECTION_MAP_OES +#define GL_RGB_SCALE_EXT GL_RGB_SCALE +#define GL_REFLECTION_MAP_ARB GL_REFLECTION_MAP_OES +#define GL_PREVIOUS_EXT GL_PREVIOUS +#define GL_PRIMARY_COLOR_EXT GL_PRIMARY_COLOR +#define GL_CONSTANT_EXT GL_CONSTANT +#define GL_ADD_SIGNED_EXT GL_ADD_SIGNED +#define GL_INTERPOLATE_EXT GL_INTERPOLATE +#define GL_BUMP_ENVMAP_ATI GL_INTERPOLATE + +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES + +#else + +// *************************************************************************** +// *************************************************************************** +// The NEL Functions Typedefs. +// Must do it for compatibilities with futures version of gl.h +// eg: version 1.2 does not define PFNGLACTIVETEXTUREARBPROC. Hence, do it now, with our special name +// *************************************************************************** +// *************************************************************************** + +#define WGL_COVERAGE_SAMPLES_NV 0x2042 +#define WGL_COLOR_SAMPLES_NV 0x20B9 + +// ARB_multitexture +//================= +typedef void (APIENTRY * NEL_PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRY * NEL_PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRY * NEL_PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); + + +// ARB_TextureCompression. +//======================== +typedef void (APIENTRY * NEL_PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * NEL_PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * NEL_PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * NEL_PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * NEL_PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * NEL_PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * NEL_PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img); + + +// VertexArrayRangeNV. +//==================== +typedef void (APIENTRY * NEL_PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRY * NEL_PFNGLVERTEXARRAYRANGENVPROC) (GLsizei size, const GLvoid *pointer); + + +// FenceNV. +//==================== +typedef void (APIENTRY * NEL_PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRY * NEL_PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (APIENTRY * NEL_PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (APIENTRY * NEL_PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (APIENTRY * NEL_PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (APIENTRY * NEL_PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (APIENTRY * NEL_PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); + + +// VertexWeighting. +//================== +typedef void (APIENTRY * NEL_PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRY * NEL_PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRY * NEL_PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); + + +// VertexProgramExtension. +//======================== +typedef GLboolean (APIENTRY * NEL_PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); +typedef void (APIENTRY * NEL_PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRY * NEL_PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRY * NEL_PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); +typedef void (APIENTRY * NEL_PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRY * NEL_PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRY * NEL_PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRY * NEL_PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRY * NEL_PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); +typedef void (APIENTRY * NEL_PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); +typedef void (APIENTRY * NEL_PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRY * NEL_PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRY * NEL_PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRY * NEL_PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRY * NEL_PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (APIENTRY * NEL_PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +typedef void (APIENTRY * NEL_PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * NEL_PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); +typedef void (APIENTRY * NEL_PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * NEL_PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); +typedef void (APIENTRY * NEL_PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRY * NEL_PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRY * NEL_PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRY * NEL_PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); + +// VertexShaderExtension (EXT) +//============================ +typedef void (APIENTRY * NEL_PFNGLBEGINVERTEXSHADEREXTPROC) ( void ); +typedef void (APIENTRY * NEL_PFNGLENDVERTEXSHADEREXTPROC) ( void ); +typedef void (APIENTRY * NEL_PFNGLBINDVERTEXSHADEREXTPROC) ( GLuint id ); +typedef GLuint (APIENTRY * NEL_PFNGLGENVERTEXSHADERSEXTPROC) ( GLuint range ); +typedef void (APIENTRY * NEL_PFNGLDELETEVERTEXSHADEREXTPROC) ( GLuint id ); +typedef void (APIENTRY * NEL_PFNGLSHADEROP1EXTPROC) ( GLenum op, GLuint res, GLuint arg1 ); +typedef void (APIENTRY * NEL_PFNGLSHADEROP2EXTPROC) ( GLenum op, GLuint res, GLuint arg1, GLuint arg2 ); +typedef void (APIENTRY * NEL_PFNGLSHADEROP3EXTPROC) ( GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3 ); +typedef void (APIENTRY * NEL_PFNGLSWIZZLEEXTPROC) ( GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW ); +typedef void (APIENTRY * NEL_PFNGLWRITEMASKEXTPROC) ( GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW ); +typedef void (APIENTRY * NEL_PFNGLINSERTCOMPONENTEXTPROC) ( GLuint res, GLuint src, GLuint num ); +typedef void (APIENTRY * NEL_PFNGLEXTRACTCOMPONENTEXTPROC) ( GLuint res, GLuint src, GLuint num ); +typedef GLuint (APIENTRY * NEL_PFNGLGENSYMBOLSEXTPROC) ( GLenum datatype, GLenum storagetype, GLenum range, GLuint components ) ; +typedef void (APIENTRY * NEL_PFNGLSETINVARIANTEXTPROC) ( GLuint id, GLenum type, void *addr ); +typedef void (APIENTRY * NEL_PFNGLSETLOCALCONSTANTEXTPROC) ( GLuint id, GLenum type, void *addr ); +typedef void (APIENTRY * NEL_PFNGLVARIANTPOINTEREXTPROC) ( GLuint id, GLenum type, GLuint stride, void *addr ); +typedef void (APIENTRY * NEL_PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) ( GLuint id); +typedef void (APIENTRY * NEL_PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) ( GLuint id); +typedef GLuint (APIENTRY * NEL_PFNGLBINDLIGHTPARAMETEREXTPROC) ( GLenum light, GLenum value); +typedef GLuint (APIENTRY * NEL_PFNGLBINDMATERIALPARAMETEREXTPROC) ( GLenum face, GLenum value); +typedef GLuint (APIENTRY * NEL_PFNGLBINDTEXGENPARAMETEREXTPROC) ( GLenum unit, GLenum coord, GLenum value); +typedef GLuint (APIENTRY * NEL_PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) ( GLenum unit, GLenum value); +typedef GLuint (APIENTRY * NEL_PFNGLBINDPARAMETEREXTPROC) ( GLenum value); +typedef GLboolean (APIENTRY * NEL_PFNGLISVARIANTENABLEDEXTPROC) ( GLuint id, GLenum cap); +typedef void (APIENTRY * NEL_PFNGLGETVARIANTBOOLEANVEXTPROC) ( GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRY * NEL_PFNGLGETVARIANTINTEGERVEXTPROC) ( GLuint id, GLenum value, GLint *data); +typedef void (APIENTRY * NEL_PFNGLGETVARIANTFLOATVEXTPROC) ( GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRY * NEL_PFNGLGETVARIANTPOINTERVEXTPROC) ( GLuint id, GLenum value, void **data); +typedef void (APIENTRY * NEL_PFNGLGETINVARIANTBOOLEANVEXTPROC) ( GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRY * NEL_PFNGLGETINVARIANTINTEGERVEXTPROC) ( GLuint id, GLenum value, GLint *data); +typedef void (APIENTRY * NEL_PFNGLGETINVARIANTFLOATVEXTPROC) ( GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRY * NEL_PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) ( GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRY * NEL_PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) ( GLuint id, GLenum value, GLint *data); +typedef void (APIENTRY * NEL_PFNGLGETLOCALCONSTANTFLOATVEXTPROC) ( GLuint id, GLenum value, GLfloat *data); + + +// SecondaryColor extension +//======================== +typedef void (APIENTRY * NEL_PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRY * NEL_PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRY * NEL_PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRY * NEL_PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRY * NEL_PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRY * NEL_PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRY * NEL_PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRY * NEL_PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (APIENTRY * NEL_PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRY * NEL_PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRY * NEL_PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRY * NEL_PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (APIENTRY * NEL_PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRY * NEL_PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (APIENTRY * NEL_PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRY * NEL_PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (APIENTRY * NEL_PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); + + +// BlendColor extension +//======================== +typedef void (APIENTRY * NEL_PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); + + +// GL_ATI_vertex_array_object extension +//======================== +typedef GLuint (APIENTRY * NEL_PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); +typedef GLboolean (APIENTRY * NEL_PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRY * NEL_PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +typedef void (APIENTRY * NEL_PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); +typedef void (APIENTRY * NEL_PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRY * NEL_PFNGLDELETEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRY * NEL_PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRY * NEL_PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); +typedef void (APIENTRY * NEL_PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); +typedef void (APIENTRY * NEL_PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRY * NEL_PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); +typedef void (APIENTRY * NEL_PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); + + +// GL_ATI_fragment_shader extension +//================================== +typedef GLuint (APIENTRY *NEL_PFNGLGENFRAGMENTSHADERSATIPROC)(GLuint range); +typedef GLvoid (APIENTRY *NEL_PFNGLBINDFRAGMENTSHADERATIPROC)(GLuint id); +typedef GLvoid (APIENTRY *NEL_PFNGLDELETEFRAGMENTSHADERATIPROC)(GLuint id); +typedef GLvoid (APIENTRY *NEL_PFNGLBEGINFRAGMENTSHADERATIPROC)(); +typedef GLvoid (APIENTRY *NEL_PFNGLENDFRAGMENTSHADERATIPROC)(); +typedef GLvoid (APIENTRY *NEL_PFNGLPASSTEXCOORDATIPROC)(GLuint dst, GLuint coord, GLenum swizzle); +typedef GLvoid (APIENTRY *NEL_PFNGLSAMPLEMAPATIPROC)(GLuint dst, GLuint interp, GLenum swizzle); +typedef GLvoid (APIENTRY *NEL_PFNGLCOLORFRAGMENTOP1ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, + GLuint dstMod, GLuint arg1, GLuint arg1Rep, + GLuint arg1Mod); +typedef GLvoid (APIENTRY *NEL_PFNGLCOLORFRAGMENTOP2ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, + GLuint dstMod, GLuint arg1, GLuint arg1Rep, + GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, + GLuint arg2Mod); +typedef GLvoid (APIENTRY *NEL_PFNGLCOLORFRAGMENTOP3ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, + GLuint dstMod, GLuint arg1, GLuint arg1Rep, + GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, + GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, + GLuint arg3Mod); +typedef GLvoid (APIENTRY *NEL_PFNGLALPHAFRAGMENTOP1ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, + GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef GLvoid (APIENTRY *NEL_PFNGLALPHAFRAGMENTOP2ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, + GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, + GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef GLvoid (APIENTRY *NEL_PFNGLALPHAFRAGMENTOP3ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, + GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, + GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, + GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef GLvoid (APIENTRY *NEL_PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)(GLuint dst, const GLfloat *value); + + + +// GL_ATI_map_object_buffer +//================================== +typedef void *(APIENTRY * NEL_PFNGLMAPOBJECTBUFFERATIPROC)(GLuint buffer); +typedef void (APIENTRY * NEL_PFNGLUNMAPOBJECTBUFFERATIPROC)(GLuint buffer); + + +// GL_ATI_vertex_attrib_array_object +//================================== + +typedef GLvoid (APIENTRY * NEL_PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +typedef GLvoid (APIENTRY * NEL_PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)(GLuint index, GLenum pname, GLfloat *params); +typedef GLvoid (APIENTRY * NEL_PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)(GLuint index, GLenum pname, GLint *params); + + + + +// GL_ARB_fragment_program +//================================== +typedef GLvoid (APIENTRY *NEL_PFNGLPROGRAMSTRINGARBPROC)(GLenum target, GLenum format, GLsizei len,const GLvoid *string); +typedef GLvoid (APIENTRY *NEL_PFNGLBINDPROGRAMARBPROC)(GLenum target, GLuint program); +typedef GLvoid (APIENTRY *NEL_PFNGLDELETEPROGRAMSARBPROC)(GLsizei n, const GLuint *programs); +typedef GLvoid (APIENTRY *NEL_PFNGLGENPROGRAMSARBPROC)(GLsizei n, GLuint *programs); +typedef GLvoid (APIENTRY *NEL_PFNGLPROGRAMENVPARAMETER4DARBPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef GLvoid (APIENTRY *NEL_PFNGLPROGRAMENVPARAMETER4DVARBPROC)(GLenum target, GLuint index, const GLdouble *params); +typedef GLvoid (APIENTRY *NEL_PFNGLPROGRAMENVPARAMETER4FARBPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef GLvoid (APIENTRY *NEL_PFNGLPROGRAMENVPARAMETER4FVARBPROC)(GLenum target, GLuint index, const GLfloat *params); +typedef GLvoid (APIENTRY *NEL_PFNGLPROGRAMLOCALPARAMETER4DARBPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef GLvoid (APIENTRY *NEL_PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)(GLenum target, GLuint index, const GLdouble *params); +typedef GLvoid (APIENTRY *NEL_PFNGLPROGRAMLOCALPARAMETER4FARBPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef GLvoid (APIENTRY *NEL_PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)(GLenum target, GLuint index, const GLfloat *params); +typedef GLvoid (APIENTRY *NEL_PFNGLGETPROGRAMENVPARAMETERDVARBPROC)(GLenum target, GLuint index, GLdouble *params); +typedef GLvoid (APIENTRY *NEL_PFNGLGETPROGRAMENVPARAMETERFVARBPROC)(GLenum target, GLuint index, GLfloat *params); +typedef GLvoid (APIENTRY *NEL_PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)(GLenum target, GLuint index, GLdouble *params); +typedef GLvoid (APIENTRY *NEL_PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)(GLenum target, GLuint index, GLfloat *params); +typedef GLvoid (APIENTRY *NEL_PFNGLGETPROGRAMIVARBPROC)(GLenum target, GLenum pname, int *params); +typedef GLvoid (APIENTRY *NEL_PFNGLGETPROGRAMSTRINGARBPROC)(GLenum target, GLenum pname, GLvoid *string); +typedef GLboolean (APIENTRY *NEL_PFNGLISPROGRAMARBPROC)(GLuint program); + + +typedef GLboolean (APIENTRY * NEL_PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef GLboolean (APIENTRY * NEL_PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef GLenum (APIENTRY * NEL_PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum pname); +typedef GLvoid (APIENTRY * NEL_PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); +typedef GLvoid (APIENTRY * NEL_PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef GLvoid (APIENTRY * NEL_PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef GLvoid (APIENTRY * NEL_PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); +typedef GLvoid (APIENTRY * NEL_PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef GLvoid (APIENTRY * NEL_PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef GLvoid (APIENTRY * NEL_PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef GLvoid (APIENTRY * NEL_PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); +typedef GLvoid (APIENTRY * NEL_PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); +typedef GLvoid (APIENTRY * NEL_PFNGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLvoid (APIENTRY * NEL_PFNGENERATEMIPMAPEXTPROC) (GLenum target); + +typedef GLvoid (APIENTRY * NEL_PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +typedef GLvoid (APIENTRY * NEL_PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#ifndef NL_GL_NV_occlusion_query +#define NL_GL_NV_occlusion_query 1 + +typedef GLvoid (APIENTRY * NEL_PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); +typedef GLvoid (APIENTRY * NEL_PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRY * NEL_PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); +typedef GLvoid (APIENTRY * NEL_PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef GLvoid (APIENTRY * NEL_PFNGLENDOCCLUSIONQUERYNVPROC) (); +typedef GLvoid (APIENTRY * NEL_PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef GLvoid (APIENTRY * NEL_PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); + +#endif /* GL_NV_occlusion_query */ + +#ifndef NL_GL_ARB_multisample +#define NL_GL_ARB_multisample 1 +typedef GLvoid (APIENTRY * NEL_PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); +#endif + +#if defined(NL_OS_MAC) + +// Mac GL extensions + +#elif defined(NL_OS_UNIX) + +// GLX extensions +#ifndef NL_GLX_EXT_swap_control +#define NL_GLX_EXT_swap_control 1 + +#ifndef GLX_EXT_swap_control +#define GLX_SWAP_INTERVAL_EXT 0x20F1 +#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 +#endif + +typedef GLint (APIENTRY * NEL_PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable, GLint interval); + +#endif // NL_GLX_EXT_swap_control + +#ifndef NL_GLX_MESA_swap_control +#define NL_GLX_MESA_swap_control 1 + +typedef GLint (APIENTRY * NEL_PFNGLXSWAPINTERVALMESAPROC) (GLuint interval); +typedef GLint (APIENTRY * NEL_PFNGLXGETSWAPINTERVALMESAPROC) (); + +#endif // NL_GLX_MESA_swap_control + +#ifndef NL_GLX_NV_vertex_array_range +#define NL_GLX_NV_vertex_array_range 1 +typedef void* (APIENTRY * NEL_PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +typedef void (APIENTRY * NEL_PFNGLXFREEMEMORYNVPROC) (void *pointer); +#endif // NL_GLX_NV_vertex_array_range + +#endif // NL_OS_MAC + +#endif // USE_OPENGLES + +#ifdef __cplusplus +} +#endif + +#endif // NL_OPENGL_EXTENSION_DEF_H + diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_inputs.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_inputs.cpp new file mode 100644 index 000000000..4064c8819 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_inputs.cpp @@ -0,0 +1,1020 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "stdopengl.h" +#include "driver_opengl.h" + +#if defined(NL_OS_UNIX) && !defined(NL_OS_MAC) +# include +# ifdef HAVE_XRENDER +# include +# endif // HAVE_XRENDER +# ifdef HAVE_XCURSOR +# include +# endif // HAVE_XCURSOR +#endif // defined(NL_OS_UNIX) && !defined(NL_OS_MAC) + +#include "nel/misc/mouse_device.h" +#include "nel/misc/di_event_emitter.h" +#include "nel/3d/u_driver.h" +#include "nel/misc/file.h" + +using namespace std; +using namespace NLMISC; + +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + +// ************************************************************************************* +CDriverGL::CCursor::CCursor() : ColorDepth(CDriverGL::ColorDepth32), + OrigHeight(32), + HotspotScale(1.f), + HotspotOffsetX(0), + HotspotOffsetY(0), + HotSpotX(0), + HotSpotY(0), + Cursor(EmptyCursor), + Col(CRGBA::White), + Rot(0) +{ +#if defined(NL_OS_UNIX) && !defined(NL_OS_MAC) + Dpy = NULL; +#endif +} + +// ************************************************************************************* +CDriverGL::CCursor::~CCursor() +{ + reset(); +} + +// ************************************************************************************* +void CDriverGL::CCursor::reset() +{ + if (Cursor != EmptyCursor) + { +#ifdef NL_OS_WINDOWS + DestroyIcon(Cursor); +#elif defined(NL_OS_MAC) +#elif defined(NL_OS_UNIX) + XFreeCursor(Dpy, Cursor); + XSync(Dpy, False); +#endif + } +} + +// ************************************************************************************* +CDriverGL::CCursor& CDriverGL::CCursor::operator= (const CDriverGL::CCursor& from) +{ + if (&from == this) + return *this; + Src = from.Src; // requires more than a surface copy + OrigHeight = from.OrigHeight; + HotspotScale = from.HotspotScale; + HotspotOffsetX = from.HotspotOffsetX; + HotspotOffsetY = from.HotspotOffsetY; + HotSpotX = from.HotSpotX; + HotSpotY = from.HotSpotY; + Cursor = from.Cursor; + Col = from.Col; + Rot = from.Rot; +#if defined(NL_OS_UNIX) && !defined(NL_OS_MAC) + Dpy = from.Dpy; +#endif + return *this; +} + +// ************************************************************************************* +bool CDriverGL::isAlphaBlendedCursorSupported() +{ + if (!_AlphaBlendedCursorSupportRetrieved) + { +#ifdef NL_OS_WINDOWS + // Support starts with windows 2000 (not only from XP as seen in most docs) + // NB : Additionnaly, could query D3D caps to know if + // color hardware cursor is supported, not only emulated, + // but can't be sure that using the win32 api 'SetCursor' uses the same resources + // So far, seems to be supported on any modern card used by the game anyway ... + OSVERSIONINFO osvi; + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + if (GetVersionEx(&osvi)) + { + _AlphaBlendedCursorSupported = (osvi.dwMajorVersion >= 5); + } +#elif defined(NL_OS_MAC) +#elif defined(NL_OS_UNIX) + + _AlphaBlendedCursorSupported = false; + +#ifdef HAVE_XCURSOR + if (!_AlphaBlendedCursorSupported && XcursorSupportsARGB(_dpy)) + _AlphaBlendedCursorSupported = true; +#endif // HAVE_XCURSOR + + if (!_AlphaBlendedCursorSupported && _xrender_version > 0) + _AlphaBlendedCursorSupported = true; + +#endif + + _AlphaBlendedCursorSupportRetrieved = true; + } + + return _AlphaBlendedCursorSupported; +} + +// ************************************************************************************* +void CDriverGL::addCursor(const std::string &name, const NLMISC::CBitmap &cursorBitmap) +{ + if (!isAlphaBlendedCursorSupported()) return; + + nlassert(cursorBitmap.getWidth() != 0); + nlassert(cursorBitmap.getHeight() != 0); + + // find used part base on alpha, to avoid too much shrinking + const CRGBA *pixels = (const CRGBA *) &cursorBitmap.getPixels()[0]; + uint minX, maxX, minY, maxY; + uint width = cursorBitmap.getWidth(); + uint height = cursorBitmap.getHeight(); + // + minX = 0; + for (uint x = 0; x < width; ++x) + { + bool stop = false; + minX = x; + for (uint y = 0; y < height; ++y) + { + if(pixels[x + y * width].A != 0) + { + stop = true; + break; + } + } + if (stop) break; + } + // + maxX = width - 1; + for (sint x = width - 1; x >= 0; --x) + { + bool stop = false; + maxX = (uint) x; + for (uint y = 0; y < height; ++y) + { + if(pixels[x + y * width].A != 0) + { + stop = true; + break; + } + } + if (stop) break; + } + // + minY = 0; + for (uint y = 0; y < height; ++y) + { + bool stop = false; + minY = y; + for (uint x = 0; x < width; ++x) + { + if(pixels[x + y * width].A != 0) + { + stop = true; + break; + } + } + if (stop) break; + } + // + maxY = height - 1; + for (sint y = height - 1; y >= 0; --y) + { + bool stop = false; + maxY = (uint) y; + for (uint x = 0; x < width; ++x) + { + if(pixels[x + y * width].A != 0) + { + stop = true; + break; + } + } + if (stop) break; + } + // + CCursor &curs = _Cursors[name]; + curs = CCursor(); // erase possible previous cursor + + uint destWidth = 32, destHeight = 32; + getBestCursorSize(width, height, destWidth, destHeight); + + // build a square bitmap + uint tmpSize = std::max(maxX - minX + 1, maxY - minY + 1); + curs.Src.resize(tmpSize, tmpSize); + // blit at top left corner + curs.Src.blit(cursorBitmap, minX, minY, maxX - minX + 1, maxY - minY + 1, 0, 0); + + curs.OrigHeight = cursorBitmap.getHeight(); + curs.HotspotOffsetX = minX; + curs.HotspotOffsetY = minY; + // + curs.HotspotScale = _CursorScale; + clamp(curs.HotspotScale, 0.f, 1.f); + // first resampling, same for all cursors + tmpSize = (uint) (tmpSize * curs.HotspotScale); + if (tmpSize == 0) tmpSize = 1; + + if (curs.HotspotScale < 1.f) + { + curs.Src.resample(tmpSize, tmpSize); + } + + // shrink if necessary + if (tmpSize > destWidth || tmpSize > destHeight) // need to shrink ? + { + // constraint proportions + curs.HotspotScale *= std::min(float(destWidth) / tmpSize, float(destHeight) / tmpSize); + curs.Src.resample(destWidth, destHeight); + } + else + { + CBitmap final; + final.resize(destWidth, destHeight); + final.blit(&curs.Src, 0, 0); + curs.Src.swap(final); + } + + if (name == _CurrName) + { + updateCursor(); + } +} + +// ************************************************************************************* +void CDriverGL::createCursors() +{ +#ifdef NL_OS_WINDOWS + _DefaultCursor = LoadCursor(NULL, IDC_ARROW); + _BlankCursor = NULL; +#elif defined(NL_OS_MAC) +#elif defined(NL_OS_UNIX) + _DefaultCursor = None; + + if (_dpy && _win && _BlankCursor == EmptyCursor) + { + // create blank cursor + char bm_no_data[] = { 0,0,0,0,0,0,0,0 }; + Pixmap pixmap_no_data = XCreateBitmapFromData (_dpy, _win, bm_no_data, 8, 8); + XColor black; + memset(&black, 0, sizeof (XColor)); + black.flags = DoRed | DoGreen | DoBlue; + _BlankCursor = XCreatePixmapCursor (_dpy, pixmap_no_data, pixmap_no_data, &black, &black, 0, 0); + XFreePixmap(_dpy, pixmap_no_data); + } +#endif +} + +// ************************************************************************************* +void CDriverGL::releaseCursors() +{ +#ifdef NL_OS_WINDOWS + SetClassLongPtr(_win, GCLP_HCURSOR, 0); +#elif defined(NL_OS_MAC) +#elif defined(NL_OS_UNIX) + XUndefineCursor(_dpy, _win); + XFreeCursor(_dpy, _BlankCursor); +#endif + + _Cursors.clear(); +} + +// ************************************************************************************* +void CDriverGL::updateCursor(bool forceRebuild) +{ + setCursor(_CurrName, _CurrCol, _CurrRot, _CurrHotSpotX, _CurrHotSpotY, forceRebuild); +} + +// ************************************************************************************* +void CDriverGL::setCursor(const std::string &name, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY, bool forceRebuild) +{ + // don't update cursor if it's hidden or if custom cursors are not suppported + if (!isAlphaBlendedCursorSupported() || _CurrName == "none") return; + + _CurrName = name; + _CurrCol = col; + _CurrRot = rot; + _CurrHotSpotX = hotSpotX; + _CurrHotSpotY = hotSpotY; + + // cursor has to be changed next time + if (_CurrName.empty()) return; + + if (rot > 3) rot = 3; // same than 'CViewRenderer::drawRotFlipBitmapTiled + + TCursorMap::iterator it = _Cursors.find(name); + + nlCursor cursorHandle = _DefaultCursor; + + if (it != _Cursors.end()) + { + // Update cursor if modified or not already built + CCursor &curs = it->second; + hotSpotX = (sint) (curs.HotspotScale * (hotSpotX - curs.HotspotOffsetX)); + hotSpotY = (sint) (curs.HotspotScale * ((curs.OrigHeight - hotSpotY) - curs.HotspotOffsetY)); + if (curs.Cursor == EmptyCursor || + curs.HotSpotX != hotSpotX || + curs.HotSpotY != hotSpotY || + curs.Col != col || + curs.Rot != rot || + curs.ColorDepth != _ColorDepth || + forceRebuild + ) + { + curs.reset(); + curs.Cursor = buildCursor(curs.Src, col, rot, hotSpotX, hotSpotY); + curs.Col = col; + curs.Rot = rot; + curs.HotSpotX = hotSpotX; + curs.HotSpotY = hotSpotY; + curs.ColorDepth = _ColorDepth; +#if defined(NL_OS_UNIX) && !defined(NL_OS_MAC) + curs.Dpy = _dpy; +#endif + } + cursorHandle = curs.Cursor ? curs.Cursor : _DefaultCursor; + } + + if (isSystemCursorInClientArea() || isSystemCursorCaptured() || forceRebuild) + { +// if (CInputHandlerManager::getInstance()->hasFocus()) +#ifdef NL_OS_WINDOWS + { + ::SetCursor(cursorHandle); + SetClassLongPtr(_win, GCLP_HCURSOR, (LONG_PTR) cursorHandle); // set default mouse icon to the last one + } +#elif defined(NL_OS_MAC) +#elif defined(NL_OS_UNIX) + if (cursorHandle == _DefaultCursor) + { + XUndefineCursor(_dpy, _win); + } + else + { + XDefineCursor(_dpy, _win, cursorHandle); + } +#endif + } + +} + +// ************************************************************************************* +void CDriverGL::setCursorScale(float scale) +{ + _CursorScale = scale; +} + +// ************************************************************************************* +nlCursor CDriverGL::buildCursor(const CBitmap &src, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY) +{ + nlassert(isAlphaBlendedCursorSupported()); + + uint mouseW = 32, mouseH = 32; + getBestCursorSize(src.getWidth(), src.getHeight(), mouseW, mouseH); + + CBitmap rotSrc = src; + if (rot > 3) rot = 3; // mimic behavior of 'CViewRenderer::drawRotFlipBitmapTiled' (why not rot & 3 ??? ...) + switch(rot) + { + case 0: break; + case 1: rotSrc.rot90CW(); break; + case 2: rotSrc.rot90CW(); rotSrc.rot90CW(); break; + case 3: rotSrc.rot90CCW(); break; + } + + // create a cursor from bitmap + nlCursor result = EmptyCursor; + convertBitmapToCursor(rotSrc, result, mouseW, mouseH, _ColorDepth == ColorDepth16 ? 16:32, col, hotSpotX, hotSpotY); + return result; +} + + +// ************************************************************************************* +void CDriverGL::setSystemArrow() +{ + H_AUTO_OGL(CDriverGL_setSystemArrow); + +#ifdef NL_OS_WINDOWS + if (isSystemCursorInClientArea() || isSystemCursorCaptured()) + { + SetCursor(_DefaultCursor); + } + + // set default mouse icon to the default one + SetClassLongPtr(_win, GCLP_HCURSOR, (LONG_PTR) _DefaultCursor); +#elif defined(NL_OS_MAC) +#elif defined(NL_OS_UNIX) + XUndefineCursor(_dpy, _win); +#endif +} + +// *************************************************************************** +void CDriverGL::showCursor(bool b) +{ + H_AUTO_OGL(CDriverGL_showCursor); + + if (_win == EmptyWindow) + return; + +#ifdef NL_OS_WINDOWS + + if (b) + { + // update current hardware icon to avoid to have the plain arrow + updateCursor(true); + + while (ShowCursor(b) < 0) + ; + } + else + { + while (ShowCursor(b) >= 0) + ; + } + +#elif defined(NL_OS_MAC) + + // Mac OS manages a show/hide counter for the cursor, so hiding the cursor + // twice requires two calls to "show" to make the cursor visible again. + // Since other platforms seem to not do this, the functionality is masked here + // by only calling hide if the cursor is visible and only calling show if + // the cursor was hidden. + + CGDisplayErr error = kCGErrorSuccess; + static bool visible = true; + + if(b && !visible) + { + error = CGDisplayShowCursor(kCGDirectMainDisplay); + visible = true; + } + else if(!b && visible) + { + error = CGDisplayHideCursor(kCGDirectMainDisplay); + visible = false; + } + + if(error != kCGErrorSuccess) + nlerror("cannot show / hide cursor"); + +#elif defined (NL_OS_UNIX) + + if (!b) + { + XDefineCursor(_dpy, _win, _BlankCursor); + _CurrName = "none"; + } + else + { + _CurrName = ""; + } + + // update current hardware icon to avoid to have the plain arrow + updateCursor(true); + +#endif // NL_OS_UNIX +} + +// *************************************************************************** +void CDriverGL::setMousePos(float x, float y) +{ + H_AUTO_OGL(CDriverGL_setMousePos) + + if (_win == EmptyWindow) + return; + + sint x1 = (sint)((float)_CurrentMode.Width*x); + sint y1 = (sint)((float)_CurrentMode.Height*(1.0f-y)); + +#ifdef NL_OS_WINDOWS + + // NeL window coordinate to MSWindows coordinates + POINT pt; + pt.x = x1; + pt.y = y1; + ClientToScreen (_win, &pt); + SetCursorPos(pt.x, pt.y); + +#elif defined(NL_OS_MAC) + + // CG wants absolute coordinates related to first screen's top left + + // get the first screen's (conaints menubar) rect (this is not mainScreen) + NSRect firstScreenRect = [[[NSScreen screens] objectAtIndex:0] frame]; + + // get the rect (position, size) of the window + NSRect windowRect; + if([containerView() isInFullScreenMode]) + windowRect = [[[containerView() window] screen] frame]; + else + windowRect = [[containerView() window] frame]; + + // get the view's rect for height and width + NSRect viewRect = [containerView() frame]; + + // set the cursor position + CGDisplayErr error = CGDisplayMoveCursorToPoint( + kCGDirectMainDisplay, CGPointMake( + windowRect.origin.x + (viewRect.size.width * x), + firstScreenRect.size.height - windowRect.origin.y - + viewRect.size.height + ((1.0 - y) * viewRect.size.height))); + + if(error != kCGErrorSuccess) + nlerror("cannot set mouse position"); + +#elif defined (NL_OS_UNIX) + + XWarpPointer (_dpy, None, _win, None, None, None, None, x1, y1); + +#endif // NL_OS_UNIX +} + +// *************************************************************************** +void CDriverGL::setCapture (bool b) +{ + H_AUTO_OGL(CDriverGL_setCapture); + +#ifdef NL_OS_WINDOWS + + if (b && isSystemCursorInClientArea() && !isSystemCursorCaptured()) + { + SetCapture(_win); + } + else if (!b && isSystemCursorCaptured()) + { + // if hardware mouse and not in client area, then force to update its aspect by updating its pos + if (!isSystemCursorInClientArea()) + { + // force update + showCursor(true); + } + + ReleaseCapture(); + } + +#elif defined(NL_OS_MAC) + + // no need to capture + _MouseCaptured = b; + +#elif defined (NL_OS_UNIX) + + if(b /* && isSystemCursorInClientArea() && !isSystemCursorCaptured()*/) // capture the cursor. + { + // capture the cursor + XGrabPointer(_dpy, _win, True, 0, GrabModeAsync, GrabModeAsync, _win, None, CurrentTime); + _MouseCaptured = true; + } + else if (!b/* && isSystemCursorCaptured()*/) + { + // release the cursor + XUngrabPointer(_dpy, CurrentTime); + _MouseCaptured = false; + } + +#endif // NL_OS_UNIX +} + +// *************************************************************************** +bool CDriverGL::isSystemCursorInClientArea() +{ + if (!_CurrentMode.Windowed) + { +#ifdef NL_OS_WINDOWS + return IsWindowVisible(_win) != FALSE; +#endif + } + else + { +#ifdef NL_OS_WINDOWS + POINT cursPos; + // the mouse should be in the client area of the window + if (!GetCursorPos(&cursPos)) + { + return false; + } + HWND wnd = WindowFromPoint(cursPos); + if (wnd != _win) + { + return false; // not the same window + } + // want that the mouse be in the client area + RECT clientRect; + if (!GetClientRect(_win, &clientRect)) + { + return false; + } + POINT tl, br; + tl.x = clientRect.left; + tl.y = clientRect.top; + br.x = clientRect.right; + br.y = clientRect.bottom; + if (!ClientToScreen(_win, &tl)) + { + return false; + } + if (!ClientToScreen(_win, &br)) + { + return false; + } + if ((cursPos.x < tl.x) || (cursPos.x >= br.x) || (cursPos.y < tl.y) || (cursPos.y >= br.y)) + { + return false; + } +#endif + } + + return true; +} + +// *************************************************************************** +bool CDriverGL::isSystemCursorCaptured() +{ + H_AUTO_OGL(CDriverGL_isSystemCursorCaptured); + +#ifdef NL_OS_WINDOWS + return GetCapture() == _win; +#else + return _MouseCaptured; +#endif +} + +// *************************************************************************** +NLMISC::IMouseDevice* CDriverGL::enableLowLevelMouse(bool enable, bool exclusive) +{ + H_AUTO_OGL(CDriverGL_enableLowLevelMouse); + + NLMISC::IMouseDevice *res = NULL; + +#ifdef NL_OS_WINDOWS + + NLMISC::CDIEventEmitter *diee = NULL; + + if (_EventEmitter.getNumEmitters() > 1) + diee = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); + + if (enable) + { + try + { + if (diee) + res = diee->getMouseDevice(exclusive); + } + catch (const EDirectInput &) + { + } + } + else + { + if (diee) + diee->releaseMouse(); + } + +#elif defined(NL_OS_MAC) +#elif defined (NL_OS_UNIX) +#endif + + return res; +} + +// *************************************************************************** +NLMISC::IKeyboardDevice* CDriverGL::enableLowLevelKeyboard(bool enable) +{ + H_AUTO_OGL(CDriverGL_enableLowLevelKeyboard); + + NLMISC::IKeyboardDevice *res = NULL; + +#ifdef NL_OS_WINDOWS + + NLMISC::CDIEventEmitter *diee = NULL; + + if (_EventEmitter.getNumEmitters() > 1) + diee = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); + + if (enable) + { + try + { + if (diee) + res = diee->getKeyboardDevice(); + } + catch (const EDirectInput &) + { + } + } + else + { + if (diee) + diee->releaseKeyboard(); + } + +#elif defined(NL_OS_MAC) +#elif defined (NL_OS_UNIX) +#endif + + return res; +} + +// *************************************************************************** +NLMISC::IInputDeviceManager* CDriverGL::getLowLevelInputDeviceManager() +{ + H_AUTO_OGL(CDriverGL_getLowLevelInputDeviceManager); + + NLMISC::IInputDeviceManager *res = NULL; + +#ifdef NL_OS_WINDOWS + + if (_EventEmitter.getNumEmitters() > 1) + res = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); + +#elif defined(NL_OS_MAC) +#elif defined (NL_OS_UNIX) +#endif + + return res; +} + +// *************************************************************************** +uint CDriverGL::getDoubleClickDelay(bool hardwareMouse) +{ + H_AUTO_OGL(CDriverGL_getDoubleClickDelay); + + uint res = 250; + +#ifdef NL_OS_WINDOWS + + NLMISC::IMouseDevice *md = NULL; + + if (_EventEmitter.getNumEmitters() >= 2) + { + NLMISC::CDIEventEmitter *diee = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); + if (diee->isMouseCreated()) + { + try + { + md = diee->getMouseDevice(hardwareMouse); + } + catch (const EDirectInput &) + { + // could not get device .. + } + } + } + + if (md) + { + res = md->getDoubleClickDelay(); + } + else + { + // try to read the good value from windows + res = ::GetDoubleClickTime(); + } + +#elif defined(NL_OS_MAC) +# warning "OpenGL Driver: Missing Mac Implementation for getDoubleClickDelay" + nlwarning("OpenGL Driver: Missing Mac Implementation for getDoubleClickDelay"); + +#elif defined (NL_OS_UNIX) + + // TODO for Linux + +#endif + + return res; +} + +bool CDriverGL::getBestCursorSize(uint srcWidth, uint srcHeight, uint &dstWidth, uint &dstHeight) +{ +#ifdef NL_OS_WINDOWS + + // Windows provides default size for cursors + dstWidth = (uint)GetSystemMetrics(SM_CXCURSOR); + dstHeight = (uint)GetSystemMetrics(SM_CYCURSOR); + +#elif defined(NL_OS_MAC) +#elif defined(NL_OS_UNIX) + + Status status = XQueryBestCursor(_dpy, _win, srcWidth, srcHeight, &dstWidth, &dstHeight); + + if (!status) + { + nlwarning("XQueryBestCursor failed"); + } + +#endif + + return true; +} + +bool CDriverGL::convertBitmapToCursor(const NLMISC::CBitmap &bitmap, nlCursor &cursor, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col, sint hotSpotX, sint hotSpotY) +{ +#if defined(NL_OS_WINDOWS) + + return convertBitmapToIcon(bitmap, cursor, iconWidth, iconHeight, iconDepth, col, hotSpotX, hotSpotY, true); + +#elif defined(NL_OS_UNIX) && !defined(NL_OS_MAC) + + CBitmap src = bitmap; + + // resample bitmap if necessary + if (src.getWidth() != iconWidth || src.getHeight() != iconHeight) + { + src.resample(iconWidth, iconHeight); + } + + CBitmap colorBm; + colorBm.resize(iconWidth, iconHeight, CBitmap::RGBA); + const CRGBA *srcColorPtr = (CRGBA *) &(src.getPixels()[0]); + const CRGBA *srcColorPtrLast = srcColorPtr + (iconWidth * iconHeight); + CRGBA *destColorPtr = (CRGBA *) &(colorBm.getPixels()[0]); + + do + { + // colorize icon + destColorPtr->modulateFromColor(*srcColorPtr, col); + + // X11 wants BGRA pixels : swap red and blue channels + std::swap(destColorPtr->R, destColorPtr->B); + + // premultiplied alpha + if (destColorPtr->A < 255) + { + destColorPtr->R = (destColorPtr->R * destColorPtr->A) / 255; + destColorPtr->G = (destColorPtr->G * destColorPtr->A) / 255; + destColorPtr->B = (destColorPtr->B * destColorPtr->A) / 255; + } + + ++ srcColorPtr; + ++ destColorPtr; + } + while (srcColorPtr != srcColorPtrLast); + +#ifdef HAVE_XCURSOR + + if (XcursorSupportsARGB(_dpy)) + { + XcursorImage *image = XcursorImageCreate(iconWidth, iconHeight); + + if (!image) + { + nlwarning("Failed to create a XcusorImage with size %ux%u", iconWidth, iconHeight); + } + else + { + image->xhot = (uint)hotSpotX; + image->yhot = (uint)hotSpotY; + + memcpy(image->pixels, &colorBm.getPixels(0)[0], colorBm.getSize()*4); + + cursor = XcursorImageLoadCursor(_dpy, image); + + XcursorImageDestroy(image); + } + } + +#endif // HAVE_XCURSOR + +#ifdef HAVE_XRENDER + + if (_xrender_version > 0) + { + // use malloc() because X will free() data itself + CRGBA *src32 = (CRGBA*)malloc(colorBm.getSize()*4); + memcpy(src32, &colorBm.getPixels(0)[0], colorBm.getSize()*4); + + uint size = iconWidth * iconHeight; + + sint screen = DefaultScreen(_dpy); + Visual *visual = DefaultVisual(_dpy, screen); + + if (!visual) + { + nlwarning("Failed to get a default visual for screen %d", screen); + return false; + } + + // Create the icon image + XImage* image = XCreateImage(_dpy, visual, 32, ZPixmap, 0, (char*)src32, iconWidth, iconHeight, 32, 0); + + if (!image) + { + nlwarning("Failed to set the window's icon"); + return false; + } + + // Create the icon pixmap + Pixmap pixmap = XCreatePixmap(_dpy, _win, iconWidth, iconHeight, 32 /* defDepth */); + + if (!pixmap) + { + nlwarning("Failed to create a pixmap %ux%ux%d", iconWidth, iconHeight, 32); + return false; + } + + // Create the icon graphic contest + GC gc = XCreateGC(_dpy, pixmap, 0, NULL); + + if (!gc) + { + nlwarning("Failed to create a GC"); + return false; + } + + sint res = XPutImage(_dpy, pixmap, gc, image, 0, 0, 0, 0, iconWidth, iconHeight); + + if (res) + { + nlwarning("XPutImage failed with code %d", res); + } + + if (!XFreeGC(_dpy, gc)) + { + nlwarning("XFreeGC failed"); + } + + if (image->data) + { + free(image->data); + image->data = NULL; + } + + XDestroyImage(image); + + XRenderPictFormat *format = XRenderFindStandardFormat(_dpy, PictStandardARGB32); + + if (!format) + { + nlwarning("Failed to find a standard format"); + return false; + } + + Picture picture = XRenderCreatePicture(_dpy, pixmap, format, 0, 0); + + if (!picture) + { + nlwarning("Failed to create picture"); + return false; + } + + cursor = XRenderCreateCursor(_dpy, picture, (uint)hotSpotX, (uint)hotSpotY); + + if (!cursor) + { + nlwarning("Failed to create cursor"); + return false; + } + + XRenderFreePicture(_dpy, picture); + + if (!XFreePixmap(_dpy, pixmap)) + { + nlwarning("XFreePixmap failed"); + } + + return true; + } + +#endif // HAVE_XRENDER + + return false; + +#else + + return false; + +#endif +} + +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} // NL3D diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_light.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_light.cpp new file mode 100644 index 000000000..7b52e3225 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_light.cpp @@ -0,0 +1,370 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "stdopengl.h" + +#include "driver_opengl.h" +#include "nel/3d/light.h" + +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + +// *************************************************************************** +uint CDriverGL::getMaxLight () const +{ + H_AUTO_OGL(CDriverGL_getMaxLight ) + // return min(maxLight supported by openGL, MaxLight=8). + return _MaxDriverLight; +} + + +// *************************************************************************** +void CDriverGL::setLight (uint8 num, const CLight& light) +{ + H_AUTO_OGL(CDriverGL_setLight ) + // bkup real light, for lightmap dynamic lighting purpose + if(num==0) + { + _UserLight0= light; + // because the GL setup change, must dirt lightmap rendering + _LightMapDynamicLightDirty= true; + } + + setLightInternal(num, light); +} + + +// *************************************************************************** +void CDriverGL::setLightInternal(uint8 num, const CLight& light) +{ + H_AUTO_OGL(CDriverGL_setLightInternal) + // Check light count is good +// nlassert (num<_MaxDriverLight); + + // Set the light + if (num<_MaxDriverLight) + { + // GL light number + GLenum lightNum=(GLenum)(GL_LIGHT0+num); + + // Get light mode + CLight::TLightMode mode=light.getMode (); + + // Copy the mode + _LightMode[num]=mode; + + // Set the ambiant color + GLfloat colorGL[4]; + CRGBA colorNeL=light.getAmbiant (); + colorGL[0]=(float)colorNeL.R/255.f; + colorGL[1]=(float)colorNeL.G/255.f; + colorGL[2]=(float)colorNeL.B/255.f; + colorGL[3]=1.f; + glLightfv (lightNum, GL_AMBIENT, colorGL); + + // Set the diffuse color + colorNeL=light.getDiffuse (); + colorGL[0]=(float)colorNeL.R/255.f; + colorGL[1]=(float)colorNeL.G/255.f; + colorGL[2]=(float)colorNeL.B/255.f; + colorGL[3]=1.f; + glLightfv (lightNum, GL_DIFFUSE, colorGL); + + // Set the specular color + colorNeL=light.getSpecular (); + // don't know why, but with ATI cards, specular of 0 causes incorrect rendering (random specular is added) + if (_Extensions.ATITextureEnvCombine3) + { + // special case for ATI (there will be some specular, but there's a bug otherwise) + colorGL[0]=std::max(1.f / 1024.f, (float)colorNeL.R/255.f); + colorGL[1]=std::max(1.f / 1024.f, (float)colorNeL.G/255.f); + colorGL[2]=std::max(1.f / 1024.f, (float)colorNeL.B/255.f); + colorGL[3]=1.f; + } + else + { + colorGL[0]=(float)colorNeL.R/255.f; + colorGL[1]=(float)colorNeL.G/255.f; + colorGL[2]=(float)colorNeL.B/255.f; + colorGL[3]=1.f; + } + glLightfv (lightNum, GL_SPECULAR, colorGL); + + // Set light attenuation + glLightf (lightNum, GL_CONSTANT_ATTENUATION, light.getConstantAttenuation()); + glLightf (lightNum, GL_LINEAR_ATTENUATION, light.getLinearAttenuation()); + glLightf (lightNum, GL_QUADRATIC_ATTENUATION, light.getQuadraticAttenuation()); + + // Set the position + if ((mode==CLight::DirectionalLight)||(mode==CLight::SpotLight)) + { + // Get the direction of the light + _WorldLightDirection[num]=light.getDirection (); + } + + if (mode!=CLight::DirectionalLight) + { + // Get the position of the light + _WorldLightPos[num]=light.getPosition (); + } + + if (mode==CLight::SpotLight) + { + // Get the exponent of the spot + float exponent=light.getExponent (); + + // Set it + glLightf (lightNum, GL_SPOT_EXPONENT, exponent); + + // Get the cutoff of the spot + float cutoff=180.f*(light.getCutoff ()/(float)NLMISC::Pi); + + // Set it + glLightf (lightNum, GL_SPOT_CUTOFF, cutoff); + } + else + { + // Disable spot properties +#ifdef USE_OPENGLES + glLightf (lightNum, GL_SPOT_CUTOFF, 180.f); + glLightf (lightNum, GL_SPOT_EXPONENT, 0.f); +#else + glLighti (lightNum, GL_SPOT_CUTOFF, 180); + glLighti (lightNum, GL_SPOT_EXPONENT, 0); +#endif + } + + // Flag this light as dirt. + _LightDirty[num]= true; + + // dirt the lightSetup and hence the render setup + _LightSetupDirty= true; + _RenderSetupDirty=true; + } +} + +// *************************************************************************** +void CDriverGL::enableLight (uint8 num, bool enable) +{ + H_AUTO_OGL(CDriverGL_enableLight ) + // User call => set the User flag + if(num<_MaxDriverLight) + { + _UserLightEnable[num]= enable; + } + + // enable the light in GL + enableLightInternal(num, enable); + + // because the GL setup has changed, must dirt lightmap rendering + _LightMapDynamicLightDirty= true; +} + + +// *************************************************************************** +void CDriverGL::enableLightInternal(uint8 num, bool enable) +{ + H_AUTO_OGL(CDriverGL_enableLightInternal) + // Check light count is good + // nlassert (num<_MaxDriverLight); + + // Enable glLight + if (num<_MaxDriverLight) + { + _DriverGLStates.enableLight(num, enable); + + // If this light is dirty, and reenabled, then it must be refresh at next render => set the global flag. + if (enable && _LightDirty[num]) + { + _LightSetupDirty= true; + _RenderSetupDirty= true; + } + } +} + + +// *************************************************************************** + +void CDriverGL::setAmbientColor (CRGBA color) +{ + H_AUTO_OGL(CDriverGL_setAmbientColor ) + // Gl array + GLfloat array[4]; + array[0]=(float)color.R/255.f; + array[1]=(float)color.G/255.f; + array[2]=(float)color.B/255.f; + array[3]=1.f; + + // Set the color + glLightModelfv (GL_LIGHT_MODEL_AMBIENT, array); +} + + +// *************************************************************************** +void CDriverGL::cleanLightSetup () +{ + H_AUTO_OGL(CDriverGL_cleanLightSetup ) + // Should be dirty + nlassert (_LightSetupDirty); + + // First light + bool first=true; + + // For each lights + for (uint i=0; i<_MaxDriverLight; i++) + { + // Is this light enabled and dirty? + if (_DriverGLStates.isLightEnabled(i) && _LightDirty[i]) + { + // If first light + if (first) + { + first=false; + + // Push the matrix + glPushMatrix (); + + // Load the view matrix + glLoadMatrixf (_ViewMtx.get()); + } + + // Light is directionnal ? + if (_LightMode[i]==(uint)CLight::DirectionalLight) + { + // GL vector + GLfloat vectorGL[4]; + + // Set the GL array + vectorGL[0]=-_WorldLightDirection[i].x; + vectorGL[1]=-_WorldLightDirection[i].y; + vectorGL[2]=-_WorldLightDirection[i].z; + vectorGL[3]=0.f; + + // Set it + glLightfv ((GLenum)(GL_LIGHT0+i), (GLenum)GL_POSITION, vectorGL); + } + + // Spotlight ? + if (_LightMode[i]==(uint)CLight::SpotLight) + { + // GL vector + GLfloat vectorGL[4]; + + // Set the GL array + vectorGL[0]=_WorldLightDirection[i].x; + vectorGL[1]=_WorldLightDirection[i].y; + vectorGL[2]=_WorldLightDirection[i].z; + + // Set it + glLightfv ((GLenum)(GL_LIGHT0+i), (GLenum)GL_SPOT_DIRECTION, vectorGL); + } + + // Position + if (_LightMode[i]!=(uint)CLight::DirectionalLight) + { + // GL vector + GLfloat vectorGL[4]; + + // Set the GL array + // Must Substract CameraPos, because ViewMtx may not be the exact view. + vectorGL[0]=_WorldLightPos[i].x - _PZBCameraPos.x; + vectorGL[1]=_WorldLightPos[i].y - _PZBCameraPos.y; + vectorGL[2]=_WorldLightPos[i].z - _PZBCameraPos.z; + vectorGL[3]=1.f; + + // Set it + glLightfv ((GLenum)(GL_LIGHT0+i), (GLenum)GL_POSITION, vectorGL); + } + + // Cleaned! + _LightDirty[i]= false; + } + } + + // Pop old matrix + if (!first) + glPopMatrix (); + + // Clean flag + _LightSetupDirty=false; +} + + +// *************************************************************************** +void CDriverGL::setLightMapDynamicLight (bool enable, const CLight& light) +{ + H_AUTO_OGL(CDriverGL_setLightMapDynamicLight ) + // just store, for future setup in lightmap material rendering + _LightMapDynamicLightEnabled= enable; + _LightMapDynamicLight= light; + _LightMapDynamicLightDirty= true; +} + + +// *************************************************************************** +void CDriverGL::setupLightMapDynamicLighting(bool enable) +{ + H_AUTO_OGL(CDriverGL_setupLightMapDynamicLighting) + // start lightmap dynamic lighting + if(enable) + { + // disable all lights but the 0th. + for(uint i=1;i<_MaxDriverLight;i++) + enableLightInternal(i, false); + + // if the dynamic light is really enabled + if(_LightMapDynamicLightEnabled) + { + // then setup and enable + setLightInternal(0, _LightMapDynamicLight); + enableLightInternal(0, true); + } + // else just disable also the light 0 + else + { + enableLightInternal(0, false); + } + + // ok it has been setup + _LightMapDynamicLightDirty= false; + } + // restore old lighting + else + { + // restore the light 0 + setLightInternal(0, _UserLight0); + + // restore all standard light enable states + for(uint i=0;i<_MaxDriverLight;i++) + enableLightInternal(i, _UserLightEnable[i]); + } + + // in all case, must refresh render setup, cause lighting may be modified + refreshRenderSetup(); +} + +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} // NL3D diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_material.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_material.cpp new file mode 100644 index 000000000..6d9dbb247 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_material.cpp @@ -0,0 +1,2468 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "stdopengl.h" +#include "driver_opengl.h" +#include "nel/3d/cube_map_builder.h" +#include "nel/3d/texture_mem.h" +#include "nel/3d/texture_bump.h" +#include "nel/3d/material.h" + +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + +static void convBlend(CMaterial::TBlend blend, GLenum& glenum) +{ + H_AUTO_OGL(convBlend) + switch(blend) + { + case CMaterial::one: glenum=GL_ONE; break; + case CMaterial::zero: glenum=GL_ZERO; break; + case CMaterial::srcalpha: glenum=GL_SRC_ALPHA; break; + case CMaterial::invsrcalpha:glenum=GL_ONE_MINUS_SRC_ALPHA; break; + case CMaterial::srccolor: glenum=GL_SRC_COLOR; break; + case CMaterial::invsrccolor:glenum=GL_ONE_MINUS_SRC_COLOR; break; + // Extended Blend modes. +#ifndef USE_OPENGLES + case CMaterial::blendConstantColor: glenum=GL_CONSTANT_COLOR_EXT; break; + case CMaterial::blendConstantInvColor: glenum=GL_ONE_MINUS_CONSTANT_COLOR_EXT; break; + case CMaterial::blendConstantAlpha: glenum=GL_CONSTANT_ALPHA_EXT; break; + case CMaterial::blendConstantInvAlpha: glenum=GL_ONE_MINUS_CONSTANT_ALPHA_EXT; break; +#endif + + default: nlstop; + } +} + +static void convZFunction(CMaterial::ZFunc zfunc, GLenum& glenum) +{ + H_AUTO_OGL(convZFunction) + switch(zfunc) + { + case CMaterial::lessequal: glenum=GL_LEQUAL; break; + case CMaterial::less: glenum=GL_LESS; break; + case CMaterial::always: glenum=GL_ALWAYS; break; + case CMaterial::never: glenum=GL_NEVER; break; + case CMaterial::equal: glenum=GL_EQUAL; break; + case CMaterial::notequal: glenum=GL_NOTEQUAL; break; + case CMaterial::greater: glenum=GL_GREATER; break; + case CMaterial::greaterequal: glenum=GL_GEQUAL; break; + default: nlstop; + } +} + +static void convColor(CRGBA col, GLfloat glcol[4]) +{ + H_AUTO_OGL(convColor) + static const float OO255= 1.0f/255; + glcol[0]= col.R*OO255; + glcol[1]= col.G*OO255; + glcol[2]= col.B*OO255; + glcol[3]= col.A*OO255; +} + +static inline void convTexAddr(ITexture *tex, CMaterial::TTexAddressingMode mode, GLenum &glenum) +{ + H_AUTO_OGL(convTexAddr) + nlassert(mode < CMaterial::TexAddrCount); + static const GLenum glTex2dAddrModesNV[] = + { + GL_NONE, GL_TEXTURE_2D, +#ifndef USE_OPENGLES + GL_PASS_THROUGH_NV, GL_CULL_FRAGMENT_NV, + GL_OFFSET_TEXTURE_2D_NV, GL_OFFSET_TEXTURE_2D_SCALE_NV, + GL_DEPENDENT_AR_TEXTURE_2D_NV, GL_DEPENDENT_GB_TEXTURE_2D_NV, + GL_DOT_PRODUCT_NV, GL_DOT_PRODUCT_TEXTURE_2D_NV, GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV, + GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV, GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV, + GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV, GL_DOT_PRODUCT_DEPTH_REPLACE_NV +#endif + }; + + static const GLenum glTexCubeAddrModesNV[] = + { + GL_NONE, GL_TEXTURE_CUBE_MAP_ARB, +#ifndef USE_OPENGLES + GL_PASS_THROUGH_NV, GL_CULL_FRAGMENT_NV, + GL_OFFSET_TEXTURE_2D_NV, GL_OFFSET_TEXTURE_2D_SCALE_NV, + GL_DEPENDENT_AR_TEXTURE_2D_NV, GL_DEPENDENT_GB_TEXTURE_2D_NV, + GL_DOT_PRODUCT_NV, GL_DOT_PRODUCT_TEXTURE_2D_NV, GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV, + GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV, GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV, + GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV, GL_DOT_PRODUCT_DEPTH_REPLACE_NV +#endif + }; + + if (!tex || !tex->isTextureCube()) + { + glenum = glTex2dAddrModesNV[(uint) mode]; + } + else + { + glenum = glTexCubeAddrModesNV[(uint) mode]; + } +} + +// -------------------------------------------------- +void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat) +{ + H_AUTO_OGL(CDriverGL_setTextureEnvFunction) + ITexture *text= mat.getTexture(uint8(stage)); + if(text) + { + CMaterial::CTexEnv &env= mat._TexEnvs[stage]; + + // Activate the env for this stage. + // NB: Thoses calls use caching. + activateTexEnvMode(stage, env); + activateTexEnvColor(stage, env); + + // Activate texture generation mapping + _DriverGLStates.activeTextureARB(stage); + if (mat.getTexCoordGen (stage)) + { + // set mode and enable. + CMaterial::TTexCoordGenMode mode= mat.getTexCoordGenMode(stage); + if(mode==CMaterial::TexCoordGenReflect) + { + // Cubic or normal ? + if (text->isTextureCube ()) + _DriverGLStates.setTexGenMode (stage, GL_REFLECTION_MAP_ARB); + else +#ifdef USE_OPENGLES + _DriverGLStates.setTexGenMode (stage, GL_TEXTURE_CUBE_MAP_OES); +#else + _DriverGLStates.setTexGenMode (stage, GL_SPHERE_MAP); +#endif + } + else if(mode==CMaterial::TexCoordGenObjectSpace) + { +#ifdef USE_OPENGLES + _DriverGLStates.setTexGenMode (stage, GL_NORMAL_MAP_OES); +#else + _DriverGLStates.setTexGenMode (stage, GL_OBJECT_LINEAR); +#endif + } + else if(mode==CMaterial::TexCoordGenEyeSpace) + { +#ifdef USE_OPENGLES + _DriverGLStates.setTexGenMode (stage, GL_NORMAL_MAP_OES); +#else + _DriverGLStates.setTexGenMode (stage, GL_EYE_LINEAR); +#endif + } + } + else + { + // Disable. + _DriverGLStates.setTexGenMode(stage, 0); + } + } +} + +//-------------------------------- +void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat) +{ + H_AUTO_OGL(CDriverGL_setupUserTextureMatrix) + if ( + (_UserTexMatEnabled != 0 && (mat.getFlags() & IDRV_MAT_USER_TEX_MAT_ALL) == 0) + || (mat.getFlags() & IDRV_MAT_USER_TEX_MAT_ALL) != 0 + ) + { + glMatrixMode(GL_TEXTURE); + + // for each stage, setup the texture matrix if needed + uint newMask = (mat.getFlags() & IDRV_MAT_USER_TEX_MAT_ALL) >> IDRV_MAT_USER_TEX_FIRST_BIT; + uint shiftMask = 1; + for (uint k = 0; k < numStages ; ++k) + { + if (newMask & shiftMask) // user matrix for this stage + { + _DriverGLStates.activeTextureARB(k); + glLoadMatrixf(mat.getUserTexMat(k).get()); + + _UserTexMatEnabled |= shiftMask; + } + else + { + /// check if matrix disabled + if ( + (newMask & shiftMask) != (_UserTexMatEnabled & shiftMask) + ) + { + _DriverGLStates.activeTextureARB(k); + glLoadIdentity(); + + _UserTexMatEnabled &= ~shiftMask; + } + } + shiftMask <<= 1; + } + glMatrixMode(GL_MODELVIEW); + } +} + +void CDriverGL::disableUserTextureMatrix() +{ + H_AUTO_OGL(CDriverGL_disableUserTextureMatrix) + if (_UserTexMatEnabled != 0) + { + glMatrixMode(GL_TEXTURE); + + uint k = 0; + do + { + if (_UserTexMatEnabled & (1 << k)) // user matrix for this stage + { + _DriverGLStates.activeTextureARB(k); + glLoadIdentity(); + + _UserTexMatEnabled &= ~ (1 << k); + } + ++k; + } + while (_UserTexMatEnabled != 0); + glMatrixMode(GL_MODELVIEW); + } +} + +// -------------------------------------------------- +CMaterial::TShader CDriverGL::getSupportedShader(CMaterial::TShader shader) +{ + H_AUTO_OGL(CDriverGL_CDriverGL) + switch (shader) + { + case CMaterial::PerPixelLighting: return _SupportPerPixelShader ? CMaterial::PerPixelLighting : CMaterial::Normal; + case CMaterial::PerPixelLightingNoSpec: return _SupportPerPixelShaderNoSpec ? CMaterial::PerPixelLightingNoSpec : CMaterial::Normal; + // Lightmap and Specular work only if at least 2 text stages. + case CMaterial::LightMap: return (inlGetNumTextStages()>=2) ? CMaterial::LightMap : CMaterial::Normal; + case CMaterial::Specular: return (inlGetNumTextStages()>=2) ? CMaterial::Specular : CMaterial::Normal; + default: return shader; + } +} + +// -------------------------------------------------- +void CDriverGL::setTextureShaders(const uint8 *addressingModes, const CSmartPtr *textures) +{ + H_AUTO_OGL(CDriverGL_setTextureShaders) + GLenum glAddrMode; + for (uint stage = 0; stage < IDRV_MAT_MAXTEXTURES; ++stage) + { + convTexAddr(textures[stage], (CMaterial::TTexAddressingMode) addressingModes[stage], glAddrMode); + + if (glAddrMode != _CurrentTexAddrMode[stage]) // addressing mode different from the one in the device? + { + _DriverGLStates.activeTextureARB(stage); +#ifndef USE_OPENGLES + glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, glAddrMode); +#endif + _CurrentTexAddrMode[stage] = glAddrMode; + } + } +} + +// -------------------------------------------------- +bool CDriverGL::setupMaterial(CMaterial& mat) +{ + H_AUTO_OGL(CDriverGL_setupMaterial) + CShaderGL* pShader; + GLenum glenum = GL_ZERO; + uint32 touched = mat.getTouched(); + uint stage; + + // profile. + _NbSetupMaterialCall++; + + + // 0. Retrieve/Create driver shader. + //================================== + if (!mat._MatDrvInfo) + { + // insert into driver list. (so it is deleted when driver is deleted). + ItMatDrvInfoPtrList it= _MatDrvInfos.insert(_MatDrvInfos.end(), (NL3D::IMaterialDrvInfos*)NULL); + // create and set iterator, for future deletion. + *it= mat._MatDrvInfo= new CShaderGL(this, it); + + // Must create all OpenGL shader states. + touched= IDRV_TOUCHED_ALL; + } + pShader=static_cast((IMaterialDrvInfos*)(mat._MatDrvInfo)); + + // 1. Setup modified fields of material. + //===================================== + if( touched ) + { + /* Exception: if only Textures are modified in the material, no need to "Bind OpenGL States", or even to test + for change, because textures are activated alone, see below. + No problem with delete/new problem (see below), because in this case, IDRV_TOUCHED_ALL is set (see above). + */ + // If any flag is set (but a flag of texture) + if( touched & (~_MaterialAllTextureTouchedFlag) ) + { + // Convert Material to driver shader. + if (touched & IDRV_TOUCHED_BLENDFUNC) + { + convBlend( mat.getSrcBlend(),glenum ); + pShader->SrcBlend=glenum; + convBlend( mat.getDstBlend(),glenum ); + pShader->DstBlend=glenum; + } + if (touched & IDRV_TOUCHED_ZFUNC) + { + convZFunction( mat.getZFunc(),glenum); + pShader->ZComp= glenum; + } + if (touched & IDRV_TOUCHED_LIGHTING) + { + convColor(mat.getEmissive(), pShader->Emissive); + convColor(mat.getAmbient(), pShader->Ambient); + convColor(mat.getDiffuse(), pShader->Diffuse); + convColor(mat.getSpecular(), pShader->Specular); + pShader->PackedEmissive= mat.getEmissive().getPacked(); + pShader->PackedAmbient= mat.getAmbient().getPacked(); + pShader->PackedDiffuse= mat.getDiffuse().getPacked(); + pShader->PackedSpecular= mat.getSpecular().getPacked(); + } + if (touched & IDRV_TOUCHED_SHADER) + { + // Get shader. Fallback to other shader if not supported. + pShader->SupportedShader= getSupportedShader(mat.getShader()); + } + + // Since modified, must rebind all openGL states. And do this also for the delete/new problem. + /* If an old material is deleted, _CurrentMaterial is invalid. But this is grave only if a new + material is created, with the same pointer (bad luck). Since an newly allocated material always + pass here before use, we are sure to avoid any problems. + */ + _CurrentMaterial= NULL; + } + + // Optimize: reset all flags at the end. + mat.clearTouched(0xFFFFFFFF); + } + + // Now we can get the supported shader from the cache. + CMaterial::TShader matShader = pShader->SupportedShader; + + // if the shader has changed since last time + if(matShader != _CurrentMaterialSupportedShader) + { + // if old was lightmap, restore standard lighting + if(_CurrentMaterialSupportedShader==CMaterial::LightMap) + setupLightMapDynamicLighting(false); + + // if new is lightmap, setup dynamic lighting + if(matShader==CMaterial::LightMap) + setupLightMapDynamicLighting(true); + } + + // setup the global + _CurrentMaterialSupportedShader= matShader; + + // 2. Setup / Bind Textures. + //========================== + // Must setup textures each frame. (need to test if touched). + // Must separate texture setup and texture activation in 2 "for"... + // because setupTexture() may disable all stage. + if (matShader != CMaterial::Water) + { + for(stage=0 ; stageSrcBlend, pShader->DstBlend); + + // Double Sided Part. + //=================== + // NB: inverse state: DoubleSided <=> !CullFace. + uint32 twoSided= mat.getFlags()&IDRV_MAT_DOUBLE_SIDED; + _DriverGLStates.enableCullFace( twoSided==0 ); + + + // Alpha Test Part. + //================= + uint32 alphaTest= mat.getFlags()&IDRV_MAT_ALPHA_TEST; + _DriverGLStates.enableAlphaTest(alphaTest); + if(alphaTest) + { + // setup alphaTest threshold. + _DriverGLStates.alphaFunc(mat.getAlphaTestThreshold()); + } + + // Bind ZBuffer Part. + //=================== + _DriverGLStates.enableZWrite(mat.getFlags()&IDRV_MAT_ZWRITE); + _DriverGLStates.depthFunc(pShader->ZComp); + _DriverGLStates.setZBias (mat.getZBias () * _OODeltaZ); + + // Bind Stencil Buffer Part. + //=================== + /* + _DriverGLStates.enableStencilTest(); + _DriverGLStates.stencilFunc(); + _DriverGLStates.stencilOp(); + */ + + // Color-Lighting Part. + //===================== + + // Light Part. + _DriverGLStates.enableLighting(mat.getFlags()&IDRV_MAT_LIGHTING); + if(mat.getFlags()&IDRV_MAT_LIGHTING) + { + _DriverGLStates.setEmissive(pShader->PackedEmissive, pShader->Emissive); + _DriverGLStates.setAmbient(pShader->PackedAmbient, pShader->Ambient); + _DriverGLStates.setDiffuse(pShader->PackedDiffuse, pShader->Diffuse); + _DriverGLStates.setSpecular(pShader->PackedSpecular, pShader->Specular); + _DriverGLStates.setShininess(mat.getShininess()); + _DriverGLStates.setVertexColorLighted(mat.isLightedVertexColor ()); + } + else + { + // Color unlit part. + CRGBA col= mat.getColor(); + glColor4ub(col.R, col.G, col.B, col.A); + + _DriverGLStates.setVertexColorLighted(false); + } + + // Fog Part. + //================= + + // Disable fog if dest blend is ONE + if (blend && (pShader->DstBlend == GL_ONE)) + { + _DriverGLStates.enableFog(false); + } + else + { + // Restaure fog state to its current value + _DriverGLStates.enableFog(_FogEnabled); + } + + // Texture shader part. + //===================== + + if (_Extensions.NVTextureShader) + { + if (matShader == CMaterial::Normal) + { + // Texture addressing modes (support only via NVTextureShader for now) + //=================================================================== + if ( mat.getFlags() & IDRV_MAT_TEX_ADDR ) + { + enableNVTextureShader(true); + setTextureShaders(&mat._TexAddrMode[0], &mat._Textures[0]); + } + else + { + enableNVTextureShader(false); + } + } + else + { + enableNVTextureShader(false); + } + } + + _CurrentMaterial=&mat; + } + + // 4. Misc + //===================================== + + // If !lightMap and prec material was lihgtmap => vertex setup is dirty! + if( matShader != CMaterial::LightMap && _LastVertexSetupIsLightMap ) + resetLightMapVertexSetup(); + + // Textures user matrix + if (matShader == CMaterial::Normal) + { + setupUserTextureMatrix(inlGetNumTextStages(), mat); + } + else // deactivate texture matrix + { + disableUserTextureMatrix(); + } + + return true; +} + +// *************************************************************************** +sint CDriverGL::beginMultiPass() +{ + H_AUTO_OGL(CDriverGL_beginMultiPass) + // Depending on material type and hardware, return number of pass required to draw this material. + switch(_CurrentMaterialSupportedShader) + { + case CMaterial::LightMap: + return beginLightMapMultiPass(); + case CMaterial::Specular: + return beginSpecularMultiPass(); + case CMaterial::Water: + return beginWaterMultiPass(); + case CMaterial::PerPixelLighting: + return beginPPLMultiPass(); + case CMaterial::PerPixelLightingNoSpec: + return beginPPLNoSpecMultiPass(); + /* case CMaterial::Caustics: + return beginCausticsMultiPass(); */ + case CMaterial::Cloud: + return beginCloudMultiPass(); + + // All others materials require just 1 pass. + default: return 1; + } +} + +// *************************************************************************** +void CDriverGL::setupPass(uint pass) +{ + H_AUTO_OGL(CDriverGL_setupPass) + switch(_CurrentMaterialSupportedShader) + { + case CMaterial::LightMap: + setupLightMapPass (pass); + break; + case CMaterial::Specular: + setupSpecularPass (pass); + break; + case CMaterial::Water: + setupWaterPass(pass); + break; + case CMaterial::PerPixelLighting: + setupPPLPass (pass); + break; + case CMaterial::PerPixelLightingNoSpec: + setupPPLNoSpecPass (pass); + break; + /* case CMaterial::Caustics: + case CMaterial::Caustics: + break; */ + case CMaterial::Cloud: + setupCloudPass (pass); + break; + + // All others materials do not require multi pass. + default: return; + } +} + +// *************************************************************************** +void CDriverGL::endMultiPass() +{ + H_AUTO_OGL(CDriverGL_endMultiPass) + switch(_CurrentMaterialSupportedShader) + { + case CMaterial::LightMap: + endLightMapMultiPass(); + break; + case CMaterial::Specular: + endSpecularMultiPass(); + break; + case CMaterial::Water: + endWaterMultiPass(); + return; + case CMaterial::PerPixelLighting: + endPPLMultiPass(); + break; + case CMaterial::PerPixelLightingNoSpec: + endPPLNoSpecMultiPass(); + break; + /* case CMaterial::Caustics: + endCausticsMultiPass(); + break; */ + case CMaterial::Cloud: + endCloudMultiPass(); + break; + // All others materials do not require multi pass. + default: return; + } +} + +// *************************************************************************** +void CDriverGL::computeLightMapInfos (const CMaterial &mat) +{ + H_AUTO_OGL(CDriverGL_computeLightMapInfos ) + static const uint32 RGBMaskPacked = CRGBA(255,255,255,0).getPacked(); + + // For optimisation consideration, suppose there is not too much lightmap. + nlassert(mat._LightMaps.size()<=NL3D_DRV_MAX_LIGHTMAP); + + // Compute number of lightmaps really used (ie factor not NULL), and build the LUT. + _NLightMaps = 0; + // For all lightmaps of the material. + for (uint i = 0; i < mat._LightMaps.size(); ++i) + { + // If the lightmap's factor is not null. + if (mat._LightMaps[i].Factor.getPacked() & RGBMaskPacked) + { + _LightMapLUT[_NLightMaps] = i; + ++_NLightMaps; + } + } + + // Compute how many pass, according to driver caps. + _NLightMapPerPass = inlGetNumTextStages()-1; + // Can do more than 2 texture stages only if NVTextureEnvCombine4 or ATITextureEnvCombine3 + if (!_Extensions.NVTextureEnvCombine4 && !_Extensions.ATITextureEnvCombine3) + { + _NLightMapPerPass = 1; + _LightMapNoMulAddFallBack= true; + } + else + { + _LightMapNoMulAddFallBack= false; + } + + // Number of pass. + _NLightMapPass = (_NLightMaps + _NLightMapPerPass-1)/(_NLightMapPerPass); + + // NB: _NLightMaps==0 means there is no lightmaps at all. +} + +// *************************************************************************** +sint CDriverGL::beginLightMapMultiPass () +{ + H_AUTO_OGL(CDriverGL_beginLightMapMultiPass ) + const CMaterial &mat= *_CurrentMaterial; + + // compute how many lightmap and pass we must process. + computeLightMapInfos (mat); + + // always enable lighting for lightmap (because of dynamic light) + _DriverGLStates.enableLighting(true); + + // if the dynamic lightmap light has changed since the last render (should not happen), resetup + // normal way is that setupLightMapDynamicLighting() is called in setupMaterial() if shader different from prec + if(_LightMapDynamicLightDirty) + setupLightMapDynamicLighting(true); + + // reset Ambient and specular lighting + static uint32 packedColorBlack= CRGBA(0,0,0,255).getPacked(); + static GLfloat glcolBlack[4]= {0,0,0,1}; + // lightmap get no specular/ambient. Emissive and Diffuse are setuped in setupLightMapPass() + _DriverGLStates.setAmbient(packedColorBlack, glcolBlack); + _DriverGLStates.setSpecular(packedColorBlack, glcolBlack); + + // reset VertexColor array if necessary. + if (_LastVB.VertexFormat & CVertexBuffer::PrimaryColorFlag) + _DriverGLStates.enableColorArray(false); + + // Manage too if no lightmaps. + return std::max (_NLightMapPass, (uint)1); +} + +// *************************************************************************** +void CDriverGL::setupLightMapPass(uint pass) +{ + H_AUTO_OGL(CDriverGL_setupLightMapPass) + const CMaterial &mat= *_CurrentMaterial; + + // common colors + static uint32 packedColorBlack= CRGBA(0,0,0,255).getPacked(); + static GLfloat glcolBlack[4]= {0.f,0.f,0.f,1.f}; + static uint32 packedColorWhite= CRGBA(255,255,255,255).getPacked(); + static GLfloat glcolWhite[4]= {1.f,1.f,1.f,1.f}; + static uint32 packedColorGrey= CRGBA(128,128,128,128).getPacked(); + static GLfloat glcolGrey[4]= {0.5f,0.5f,0.5f,1.f}; + + // No lightmap or all blacks??, just setup "black texture" for stage 0. + if(_NLightMaps==0) + { + ITexture *text= mat.getTexture(0); + activateTexture(0,text); + + // setup std modulate env + CMaterial::CTexEnv env; + activateTexEnvMode(0, env); + + // Since Lighting is disabled, as well as colorArray, must setup alpha. + // setup color to 0 => blackness. in emissive cause texture can still be lighted by dynamic light + _DriverGLStates.setEmissive(packedColorBlack, glcolBlack); + + // Setup gen tex off + _DriverGLStates.activeTextureARB(0); + _DriverGLStates.setTexGenMode(0, 0); + + // And disable other stages. + for(uint stage = 1; stage < inlGetNumTextStages(); stage++) + { + // disable texturing. + activateTexture(stage, NULL); + } + + return; + } + + nlassert(pass<_NLightMapPass); + + // setup Texture Pass. + //========================= + uint lmapId; + uint nstages; + lmapId= pass * _NLightMapPerPass; // Nb lightmaps already processed + // N lightmaps for this pass, plus the texture. + nstages= std::min(_NLightMapPerPass, _NLightMaps-lmapId) + 1; + + // For LMC (lightmap 8Bit compression) compute the total AmbientColor in vertex diffuse + // need only if standard MulADD version + if (!_LightMapNoMulAddFallBack) + { + uint32 r=0; + uint32 g=0; + uint32 b=0; + // sum only the ambient of lightmaps that will be drawn this pass + for(uint sa=0;sa>7))) >>8; + g+= ((uint32)ambFactor.G * ((uint32)lmcAmb.G+(lmcAmb.G>>7))) >>8; + b+= ((uint32)ambFactor.B * ((uint32)lmcAmb.B+(lmcAmb.B>>7))) >>8; + } + r= std::min(r, (uint32)255); + g= std::min(g, (uint32)255); + b= std::min(b, (uint32)255); + + // this color will be added to the first lightmap (with help of emissive) + CRGBA col((uint8)r,(uint8)g,(uint8)b,255); + GLfloat glcol[4]; + convColor(col, glcol); + _DriverGLStates.setEmissive(col.getPacked(), glcol); + } + + // setup all stages. + for(uint stage= 0; stage>7))) >>8); + lmapFactor.G = (uint8)(((uint32)lmapFactor.G * ((uint32)lmcDiff.G+(lmcDiff.G>>7))) >>8); + lmapFactor.B = (uint8)(((uint32)lmapFactor.B * ((uint32)lmcDiff.B+(lmcDiff.B>>7))) >>8); + lmapFactor.A = 255; + + activateTexture(stage,text); + + // If texture not NULL, Change texture env fonction. + //================================================== + if(text) + { + static CMaterial::CTexEnv stdEnv; + + // fallBack if extension MulAdd not found. just mul factor with (Ambient+Diffuse) + if(_LightMapNoMulAddFallBack) + { + // do not use constant color to blend lightmap, but incoming diffuse color, for stage0 only. + GLfloat glcol[4]; + convColor(lmapFactor, glcol); + _DriverGLStates.setEmissive(lmapFactor.getPacked(), glcol); + + // Leave stage as default env (Modulate with previous) + activateTexEnvMode(stage, stdEnv); + + // Setup gen tex off + _DriverGLStates.activeTextureARB(stage); + _DriverGLStates.setTexGenMode(stage, 0); + } + else + { + // Here, we are sure that texEnvCombine4 or texEnvCombine3 is OK. + nlassert(_Extensions.NVTextureEnvCombine4 || _Extensions.ATITextureEnvCombine3); + + // setup constant color with Lightmap factor. + stdEnv.ConstantColor=lmapFactor; + activateTexEnvColor(stage, stdEnv); + + // Setup env for texture stage. + _DriverGLStates.activeTextureARB(stage); + _DriverGLStates.setTexGenMode(stage, 0); + + // setup TexEnvCombine4 (ignore alpha part). + if(_CurrentTexEnvSpecial[stage] != TexEnvSpecialLightMap) + { + // TexEnv is special. + _CurrentTexEnvSpecial[stage] = TexEnvSpecialLightMap; + +#ifdef USE_OPENGLES + // What we want to setup is Texture*Constant + Previous. + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); + // Operator. + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_ADD); + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_ADD); + // Arg0. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_RGB, GL_TEXTURE); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR); + // Arg1. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC2_RGB, GL_CONSTANT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_SRC_COLOR); + // Arg2. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_RGB, GL_PREVIOUS); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR); +#else + if (_Extensions.NVTextureEnvCombine4) + { + // What we want to setup is Texture*Constant + Previous*1. + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE4_NV); + + // Operator. + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD ); + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_ADD ); + // Arg0. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_TEXTURE ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR); + // Arg1. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_CONSTANT_EXT ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR); + // Arg2. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_PREVIOUS_EXT ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_COLOR); + // Arg3. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_ONE_MINUS_SRC_COLOR); + } + else + { + // ATI EnvCombine3 + // What we want to setup is Texture*Constant + Previous. + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); + // Operator. + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE_ADD_ATI); + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_MODULATE_ADD_ATI); + // Arg0. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_TEXTURE ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR); + // Arg1. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_CONSTANT_EXT ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_COLOR); + // Arg2. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PREVIOUS_EXT ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR); + } +#endif + } + } + + // setup UV, with UV1. Only if needed (cached) + if( !_LastVertexSetupIsLightMap || _LightMapUVMap[stage]!=1 ) + { + setupUVPtr(stage, _LastVB, 1); + _LightMapUVMap[stage]= 1; + } + } + + // Next lightmap. + lmapId++; + } + else if(stage don't need to flag + // (important else crash if graphist error while exporting a Lightmap material, with a MeshVertexProgram (WindTree) ) + if(_NLightMaps!=0) + _LastVertexSetupIsLightMap= true; + + // If multi-pass, then must reset the fog color + if(_NLightMapPass>=2 && _FogEnabled) + { + glFogfv(GL_FOG_COLOR, _CurrentFogColor); + } + + // nothing to do with blending/lighting, since always setuped in activeMaterial(). + // If material is the same, then it is still a lightmap material (if changed => touched => different!) + // So no need to reset blending/lighting here. + + // Clean up all stage for Multiply x 2 + if (_CurrentMaterial->_LightMapsMulx2) + { + for (uint32 i = 0; i < (_NLightMapPerPass+1); ++i) + { + _DriverGLStates.activeTextureARB(i); + glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 1); + } + } +} + +// *************************************************************************** +void CDriverGL::resetLightMapVertexSetup() +{ + H_AUTO_OGL(CDriverGL_resetLightMapVertexSetup) + // special for all stage, std UV behavior. + for(uint i = 0; i < inlGetNumTextStages(); i++) + { + // normal behavior: each texture has its own UV. + setupUVPtr(i, _LastVB, i); + // reset cache + _LightMapUVMap[i]= -1; + } + + // pop VertexColor array if necessary. + if (_LastVB.VertexFormat & CVertexBuffer::PrimaryColorFlag) + _DriverGLStates.enableColorArray(true); + + // flag + _LastVertexSetupIsLightMap= false; +} + +// *************************************************************************** +void CDriverGL::startSpecularBatch() +{ + H_AUTO_OGL(CDriverGL_startSpecularBatch) + _SpecularBatchOn= true; + + setupSpecularBegin(); +} + +// *************************************************************************** +void CDriverGL::endSpecularBatch() +{ + H_AUTO_OGL(CDriverGL_endSpecularBatch) + _SpecularBatchOn= false; + + setupSpecularEnd(); +} + +// *************************************************************************** +void CDriverGL::setupSpecularBegin() +{ + H_AUTO_OGL(CDriverGL_setupSpecularBegin) + // ---- Reset any textures with id>=2 + uint stage = 2; + for(; stage < inlGetNumTextStages(); stage++) + { + // disable texturing + activateTexture(stage, NULL); + } + + // ---- Stage 0 Common Setup. + // Setup the env for stage 0 only. + // Result RGB : Texture*Diffuse, Alpha : Texture + CMaterial::CTexEnv env; + env.Env.OpAlpha= CMaterial::Replace; + activateTexEnvMode(0, env); + + // Disable texGen for stage 0 + _DriverGLStates.activeTextureARB(0); + _DriverGLStates.setTexGenMode(0, 0); + + // ---- Stage 1 Common Setup. + // NB don't setup the TexEnv here (stage1 setuped in setupSpecularPass() according to extensions) + // For all cases, setup the TexCoord gen for stage1 + _DriverGLStates.activeTextureARB(1); + + // todo hulud remove + // _DriverGLStates.setTextureMode(CDriverGLStates::TextureCubeMap); + _DriverGLStates.setTexGenMode (1, GL_REFLECTION_MAP_ARB); + + // setup the good matrix for stage 1. + glMatrixMode(GL_TEXTURE); + glLoadMatrixf( _SpecularTexMtx.get() ); + glMatrixMode(GL_MODELVIEW); +} + +// *************************************************************************** +void CDriverGL::setupSpecularEnd() +{ + H_AUTO_OGL(CDriverGL_setupSpecularEnd) + // Disable Texture coord generation. + _DriverGLStates.activeTextureARB(1); + _DriverGLStates.setTexGenMode(1, 0); + + // Happiness !!! we have already enabled the stage 1 + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); +} + +// *************************************************************************** +sint CDriverGL::beginSpecularMultiPass() +{ + H_AUTO_OGL(CDriverGL_beginSpecularMultiPass) + const CMaterial &mat= *_CurrentMaterial; + + // activate the 2 textures here + uint stage; + uint numStages= std::min((uint)2, inlGetNumTextStages()); + for(stage=0 ; stage= HighExponent ? SpecularMapSizeHighExponent + : SpecularMapSize, + scmf, + false, + name); + } + + static const CTextureCube::TFace numToFace[] = + { CTextureCube::positive_x, + CTextureCube::negative_x, + CTextureCube::positive_y, + CTextureCube::negative_y, + CTextureCube::positive_z, + CTextureCube::negative_z + }; + + if (exponent != 1.f) + { + // force 16 bit for specular part, 32 bit if exponent is 1 (diffuse part) + for (uint k = 0; k < 6; ++k) + { + nlassert(tc->getTexture(numToFace[k])); + tc->getTexture(numToFace[k])->setUploadFormat(ITexture::RGB565); + } + } + + _SpecularTextureCubes[cubeMapIndex] = tc; + return tc; + } +} + +// *************************************************************************** +sint CDriverGL::beginPPLMultiPass() +{ + H_AUTO_OGL(CDriverGL_beginPPLMultiPass) + #ifdef NL_DEBUG + nlassert(supportPerPixelLighting(true)); // make sure the hardware can do that + #endif + return 1; +} + +// *************************************************************************** +void CDriverGL::setupPPLPass(uint pass) +{ + H_AUTO_OGL(CDriverGL_setupPPLPass) + const CMaterial &mat= *_CurrentMaterial; + + nlassert(pass == 0); + +/* ITexture *tex0 = getSpecularCubeMap(1); + if (tex0) setupTexture(*tex0); + activateTexture(0, tex0); + + + static CMaterial::CTexEnv env; + env.Env.SrcArg0Alpha = CMaterial::Diffuse; + env.Env.SrcArg1Alpha = CMaterial::Constant; + env.Env.SrcArg0RGB = CMaterial::Diffuse; + env.Env.SrcArg1RGB = CMaterial::Constant; + env.Env.OpRGB = CMaterial::Replace; + env.Env.OpAlpha = CMaterial::Replace; + activateTexEnvMode(0, env); + + return;*/ + + ITexture *tex0 = getSpecularCubeMap(1); + if (tex0) setupTexture(*tex0); + ITexture *tex2 = getSpecularCubeMap((uint) mat.getShininess()); + if (tex2) setupTexture(*tex2); + if (mat.getTexture(0)) setupTexture(*mat.getTexture(0)); + + // tex coord 0 = texture coordinates + // tex coord 1 = normal in tangent space + // tex coord 2 = half angle vector in tangent space + + activateTexture(0, tex0); + activateTexture(1, mat.getTexture(0)); + activateTexture(2, tex2); + + for (uint k = 3; k < inlGetNumTextStages(); ++k) + { + activateTexture(k, NULL); + } + + // setup the tex envs + + // Stage 0 is rgb = DiffuseCubeMap * LightColor + DiffuseGouraud * 1 + if(_CurrentTexEnvSpecial[0] != TexEnvSpecialPPLStage0) + { + // TexEnv is special. + _CurrentTexEnvSpecial[0] = TexEnvSpecialPPLStage0; + _DriverGLStates.activeTextureARB(0); + +#ifdef USE_OPENGLES + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); + + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE); + // Arg0 = Diffuse read in cube map + glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_RGB, GL_TEXTURE); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR); + // Arg1 = Light color + glTexEnvi(GL_TEXTURE_ENV, GL_SRC2_RGB, GL_CONSTANT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_SRC_COLOR); + // Arg2 = Primary color (other light diffuse and + glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_RGB, GL_PRIMARY_COLOR); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR); +#else + if (_Extensions.NVTextureEnvCombine4) + { + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE4_NV); + + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD); + // Arg0 = Diffuse read in cube map + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_TEXTURE); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR); + // Arg1 = Light color + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_CONSTANT_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR); + // Arg2 = Primary color (other light diffuse and + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_PRIMARY_COLOR_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_COLOR); + // Arg3 = White (= ~ Black) + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_ONE_MINUS_SRC_COLOR); + } + else // use ATI extension + { + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); + + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE_ADD_ATI); + // Arg0 = Diffuse read in cube map + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_TEXTURE); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR); + // Arg1 = Light color + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_CONSTANT_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_COLOR); + // Arg2 = Primary color (other light diffuse and + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PRIMARY_COLOR_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR); + } +#endif + } + activateTexEnvColor(0, _PPLightDiffuseColor); + + // Stage 1 + static CMaterial::CTexEnv env; + env.Env.SrcArg1Alpha = CMaterial::Diffuse; + activateTexEnvMode(1, env); + + // Stage 2 is rgb = SpecularCubeMap * SpecularLightColor + Prec * 1 + // alpha = prec alpha + + if(_CurrentTexEnvSpecial[2] != TexEnvSpecialPPLStage2) + { + // TexEnv is special. + _CurrentTexEnvSpecial[2] = TexEnvSpecialPPLStage2; + _DriverGLStates.activeTextureARB(2); + +#ifdef USE_OPENGLES + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); + //== colors == + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE); + // Arg0 = Specular read in cube map + glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_RGB, GL_TEXTURE); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR); + // Arg2 = Light color + glTexEnvi(GL_TEXTURE_ENV, GL_SRC2_RGB, GL_CONSTANT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_SRC_COLOR); + // Arg1 = Primary color ( + other light diffuse) + glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_RGB, GL_PREVIOUS); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR); + + //== alpha == + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_MODULATE); + // Arg0 = PREVIOUS ALPHA + glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_ALPHA, GL_PREVIOUS); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_COLOR); + // Arg2 = 1 + glTexEnvi(GL_TEXTURE_ENV, GL_SRC2_ALPHA, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA, GL_ONE_MINUS_SRC_COLOR); + // Arg1 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_ALPHA, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_SRC_COLOR); +#else + if (_Extensions.NVTextureEnvCombine4) + { + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE4_NV); + //== colors == + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD); + // Arg0 = Specular read in cube map + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_TEXTURE); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR); + // Arg1 = Light color + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_CONSTANT_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR); + // Arg2 = Primary color ( + other light diffuse ) + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_PREVIOUS_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_COLOR); + // Arg3 = White (= ~ Black) + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_ONE_MINUS_SRC_COLOR); + + //== alpha == + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_ADD); + // Arg0 = PREVIOUS ALPHA + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, GL_PREVIOUS_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, GL_SRC_COLOR); + // Arg1 = 1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_ONE_MINUS_SRC_COLOR); + // Arg2 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_EXT, GL_SRC_COLOR); + // Arg3 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_NV, GL_SRC_COLOR); + } + else // ATI EnvCombine3 + { + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); + //== colors == + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE_ADD_ATI); + // Arg0 = Specular read in cube map + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_TEXTURE); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR); + // Arg2 = Light color + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_CONSTANT_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_COLOR); + // Arg1 = Primary color ( + other light diffuse) + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PREVIOUS_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR); + + //== alpha == + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_MODULATE_ADD_ATI); + // Arg0 = PREVIOUS ALPHA + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, GL_PREVIOUS_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, GL_SRC_COLOR); + // Arg2 = 1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_EXT, GL_ONE_MINUS_SRC_COLOR); + // Arg1 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_SRC_COLOR); + } +#endif + } + activateTexEnvColor(2, _PPLightSpecularColor); + +} + +// *************************************************************************** +void CDriverGL::endPPLMultiPass() +{ + H_AUTO_OGL(CDriverGL_endPPLMultiPass) + // nothing to do there ... +} + +// ******PER PIXEL LIGHTING, NO SPECULAR************************************** +sint CDriverGL::beginPPLNoSpecMultiPass() +{ + H_AUTO_OGL(CDriverGL_beginPPLNoSpecMultiPass) + #ifdef NL_DEBUG + nlassert(supportPerPixelLighting(false)); // make sure the hardware can do that + #endif + return 1; +} + +// ******PER PIXEL LIGHTING, NO SPECULAR************************************** +void CDriverGL::setupPPLNoSpecPass(uint pass) +{ + H_AUTO_OGL(CDriverGL_setupPPLNoSpecPass) + const CMaterial &mat= *_CurrentMaterial; + + nlassert(pass == 0); + + ITexture *tex0 = getSpecularCubeMap(1); + if (tex0) setupTexture(*tex0); + + if (mat.getTexture(0)) setupTexture(*mat.getTexture(0)); + + // tex coord 0 = texture coordinates + // tex coord 1 = normal in tangent space + + activateTexture(0, tex0); + activateTexture(1, mat.getTexture(0)); + + for (uint k = 2; k < inlGetNumTextStages(); ++k) + { + activateTexture(k, NULL); + } + + // setup the tex envs + + // Stage 0 is rgb = DiffuseCubeMap * LightColor + DiffuseGouraud * 1 (TODO : EnvCombine3) + if(_CurrentTexEnvSpecial[0] != TexEnvSpecialPPLStage0) + { + // TexEnv is special. + _CurrentTexEnvSpecial[0] = TexEnvSpecialPPLStage0; + _DriverGLStates.activeTextureARB(0); + +#ifdef USE_OPENGLES + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); + + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE); + // Arg0 = Diffuse read in cube map alpha + glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_RGB, GL_TEXTURE); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR); + // Arg2 = Light color + glTexEnvi(GL_TEXTURE_ENV, GL_SRC2_RGB, GL_CONSTANT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_SRC_COLOR); + // Arg1 = Primary color (other light diffuse and + glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_RGB, GL_PRIMARY_COLOR); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR); +#else + if (_Extensions.NVTextureEnvCombine4) + { + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE4_NV); + + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD); + // Arg0 = Diffuse read in cube map alpha + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_TEXTURE); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR); + // Arg1 = Light color + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_CONSTANT_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR); + // Arg2 = Primary color (other light diffuse and + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_PRIMARY_COLOR_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_COLOR); + // Arg3 = White (= ~ Black) + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_ONE_MINUS_SRC_COLOR); + } + else + { + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); + + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE_ADD_ATI); + // Arg0 = Diffuse read in cube map alpha + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_TEXTURE); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR); + // Arg2 = Light color + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_CONSTANT_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_COLOR); + // Arg1 = Primary color (other light diffuse and + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PRIMARY_COLOR_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR); + } +#endif + } + activateTexEnvColor(0, _PPLightDiffuseColor); + + // Stage 1 + static CMaterial::CTexEnv env; + env.Env.SrcArg1Alpha = CMaterial::Diffuse; + activateTexEnvMode(1, env); + +} + +// ******PER PIXEL LIGHTING, NO SPECULAR************************************** +void CDriverGL::endPPLNoSpecMultiPass() +{ + H_AUTO_OGL(CDriverGL_endPPLNoSpecMultiPass) + // nothing to do there ... +} + +// *************************************************************************** +/* sint CDriverGL::beginCausticsMultiPass(const CMaterial &mat) +{ + nlassert(mat.getShader() == CMaterial::Caustics); + if (!_Extensions.ARBTextureCubeMap) return 1; + switch (inlGetNumTextStages()) + { + case 1: return 3; + case 2: return 2; + default: + return 1; + } +}*/ + +// *************************************************************************** +/*inline void CDriverGL::setupCausticsFirstTex(const CMaterial &mat) +{ + /// setup texture 0 + activateTexture(0, mat.getTexture(0)); + + /// texture environment 0 + setTextureEnvFunction(0, mat); + + /// texture matrix 0 + setupUserTextureMatrix(0, mat); +} + +// *************************************************************************** +inline void CDriverGL::setupCausticsSecondTex(uint stage) +{ + activateTexture(stage, mat.getTexture(0)); + _CausticCubeMap +} + +// *************************************************************************** +void CDriverGL::setupCausticsPass(const CMaterial &mat, uint pass) +{ + nlassert(mat.getShader() == CMaterial::Caustics); + + if (inlGetNumTextStages() == 1 || !_Extensions.ARBTextureCubeMap) + { + setupCausticsFirstTex(mat); + } + else + if (inlGetNumTextStages() >= 3) /// do it in one pass + { + nlassert(pass == 0); + + setupCausticsFirstTex(mat); + } + else if (inlGetNumTextStages() == 2) /// do in in 2 pass + { + nlassert(pass < 2); + if (pass == 0) + { + setupCausticsFirstTex(mat); + } + else /// caustics setup + { + /// setup additif blending + _DriverGLStates.enableBlend(); + _DriverGLStates.blendFunc(pShader->SrcBlend, pShader->DstBlend); + } + } +} + +// *************************************************************************** +void CDriverGL::endCausticsMultiPass(const CMaterial &mat) +{ + nlassert(mat.getShader() == CMaterial::Caustics); + +} +*/ + +// *************************************************************************** +sint CDriverGL::beginCloudMultiPass () +{ + H_AUTO_OGL(CDriverGL_beginCloudMultiPass ) + nlassert(_CurrentMaterial->getShader() == CMaterial::Cloud); + return 1; +} + +// *************************************************************************** +void CDriverGL::setupCloudPass (uint /* pass */) +{ + H_AUTO_OGL(CDriverGL_setupCloudPass ) + nlassert(_CurrentMaterial->getShader() == CMaterial::Cloud); + + const CMaterial &mat= *_CurrentMaterial; + + activateTexture(0, mat.getTexture(0)); + activateTexture(1, mat.getTexture(0)); + + if (_CurrentTexEnvSpecial[0] != TexEnvSpecialCloudStage0) + { +#ifndef USE_OPENGLES + if (_Extensions.NVTextureEnvCombine4) + { + _CurrentTexEnvSpecial[0] = TexEnvSpecialCloudStage0; + _CurrentTexEnvSpecial[1] = TexEnvSpecialCloudStage1; + + // Setup 1st Stage + _DriverGLStates.activeTextureARB(0); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE4_NV); + //== colors == + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD); + // Arg0 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR); + // Arg1 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR); + // Arg2 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_COLOR); + // Arg3 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_SRC_COLOR); + + //== alpha == + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_ADD); + // Arg0 = AT0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, GL_TEXTURE0_ARB); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, GL_SRC_ALPHA); + // Arg1 = AWPOS + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_PRIMARY_COLOR_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_SRC_ALPHA); + // Arg2 = AT1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_EXT, GL_TEXTURE1_ARB); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_EXT, GL_SRC_ALPHA); + // Arg3 = 1-AWPOS + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_NV, GL_PRIMARY_COLOR_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_NV, GL_ONE_MINUS_SRC_ALPHA); + + // Setup 2nd Stage + _DriverGLStates.activeTextureARB(1); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE4_NV); + //== colors == + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD); + // Arg0 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR); + // Arg1 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR); + // Arg2 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_COLOR); + // Arg3 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_SRC_COLOR); + + //== alpha == + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_ADD); + // Arg0 = AT0*AWPOS+AT1*(1-AWPOS) + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, GL_PREVIOUS_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, GL_SRC_ALPHA); + // Arg1 = AINT + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_CONSTANT_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_SRC_ALPHA); + // Arg2 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_EXT, GL_SRC_ALPHA); + // Arg3 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_NV, GL_SRC_ALPHA); + activateTexEnvColor (1, mat.getColor()); + } + else + { + // TODO : for now the state is not cached in _CurrentTexEnvSpecial + nglBindFragmentShaderATI(ATICloudShaderHandle); + glEnable(GL_FRAGMENT_SHADER_ATI); + float cst[4] = { 0.f, 0.f, 0.f, mat.getColor().A / 255.f }; + nglSetFragmentShaderConstantATI(GL_CON_0_ATI, cst); + /* + _DriverGLStates.activeTextureARB(0); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); + // Operator. + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_INTERPOLATE_EXT); + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_INTERPOLATE_EXT); + // Arg0. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_ZERO ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR); + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, GL_TEXTURE0_ARB ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, GL_SRC_ALPHA); + // Arg1. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_ZERO ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR); + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_TEXTURE1_ARB ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_SRC_ALPHA); + // Arg2. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_ZERO ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_COLOR); + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_EXT, GL_PRIMARY_COLOR_EXT ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_EXT, GL_SRC_ALPHA); + _DriverGLStates.activeTextureARB(1); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); + // Operator. + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE); + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_MODULATE); + // Arg0. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_ZERO ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR); + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, GL_PREVIOUS_EXT ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, GL_SRC_ALPHA); + // Arg1. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_ZERO ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR); + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_CONSTANT_EXT ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_SRC_ALPHA); + */ + } +#endif + } + if (_Extensions.NVTextureEnvCombine4) + activateTexEnvColor (1, mat.getColor()); +} + +// *************************************************************************** +void CDriverGL::endCloudMultiPass() +{ + H_AUTO_OGL(CDriverGL_endCloudMultiPass) + nlassert(_CurrentMaterial->getShader() == CMaterial::Cloud); + if (ATICloudShaderHandle) + { +#ifndef USE_OPENGLES + glDisable(GL_FRAGMENT_SHADER_ATI); +#endif + } +} + +// *************************************************************************** +sint CDriverGL::beginWaterMultiPass() +{ + H_AUTO_OGL(CDriverGL_beginWaterMultiPass) + nlassert(_CurrentMaterial->getShader() == CMaterial::Water); + return 1; +} + + +// *************************************************************************** +/** water setup for ATI + */ +void CDriverGL::setupWaterPassR200(const CMaterial &mat) +{ + H_AUTO_OGL(CDriverGL_setupWaterPassR200); + +#ifndef USE_OPENGLES + uint k; + ITexture *tex = mat.getTexture(0); + if (tex) + { +// if (tex->isBumpMap()) +// { +// CTextureBump *tb = static_cast(tex); +// } + setupTexture(*tex); + activateTexture(0, tex); + } + tex = mat.getTexture(1); + if (tex) + { +// if (tex->isBumpMap()) +// { +// CTextureBump *tb = static_cast(tex); +// } + setupTexture(*tex); + activateTexture(1, tex); + } + tex = mat.getTexture(2); + if (tex) + { + setupTexture(*tex); + activateTexture(2, tex); + } + tex = mat.getTexture(3); + if (tex) + { + setupTexture(*tex); + activateTexture(3, tex); + } + for (k = 4; k < inlGetNumTextStages(); ++k) + { + activateTexture(k, NULL); + } + if (mat.getTexture(3) != NULL) // is there a diffuse map ? + { + nglBindFragmentShaderATI(ATIWaterShaderHandle); + } + else + { + nglBindFragmentShaderATI(ATIWaterShaderHandleNoDiffuseMap); + } + glEnable(GL_FRAGMENT_SHADER_ATI); + + // set constants + if (mat.getTexture(0) && mat.getTexture(0)->isBumpMap()) + { + float factor = NLMISC::safe_cast(mat.getTexture(0))->getNormalizationFactor(); + float cst[4] = { factor, factor, factor, 0.f }; + nglSetFragmentShaderConstantATI(GL_CON_0_ATI, cst); + } + else + { + float cst[4] = { 1.f, 1.f, 1.f, 0.f }; + nglSetFragmentShaderConstantATI(GL_CON_0_ATI, cst); + } + // + if (mat.getTexture(1) && mat.getTexture(1)->isBumpMap()) + { + float factor = NLMISC::safe_cast(mat.getTexture(1))->getNormalizationFactor(); + float cst[4] = { factor, factor, factor, 0.f }; + nglSetFragmentShaderConstantATI(GL_CON_1_ATI, cst); + } + else + { + float cst[4] = { 1.f, 1.f, 1.f, 0.f }; + nglSetFragmentShaderConstantATI(GL_CON_0_ATI, cst); + } +#endif +} + +// *************************************************************************** +/** water setup for ARB_fragment_program + */ +void CDriverGL::setupWaterPassARB(const CMaterial &mat) +{ + H_AUTO_OGL(CDriverGL_setupWaterPassARB); + +#ifndef USE_OPENGLES + uint k; + ITexture *tex = mat.getTexture(0); + if (tex) + { + tex->setUploadFormat(ITexture::RGBA8888); + setupTexture(*tex); + activateTexture(0, tex); + } + tex = mat.getTexture(1); + if (tex) + { + tex->setUploadFormat(ITexture::RGBA8888); + setupTexture(*tex); + activateTexture(1, tex); + } + tex = mat.getTexture(2); + if (tex) + { + setupTexture(*tex); + activateTexture(2, tex); + } + tex = mat.getTexture(3); + if (tex) + { + setupTexture(*tex); + activateTexture(3, tex); + } + for (k = 4; k < inlGetNumTextStages(); ++k) + { + activateTexture(k, NULL); + } + nglBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, ARBWaterShader[(_FogEnabled ? 1 : 0) | (mat.getTexture(3) != NULL ? 2 : 0)]); + glEnable(GL_FRAGMENT_PROGRAM_ARB); + + // setup the constant + if (mat.getTexture(0) && mat.getTexture(0)->isBumpMap()) + { + float factor = 0.25f * NLMISC::safe_cast(mat.getTexture(0))->getNormalizationFactor(); + nglProgramEnvParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0, 2.f * factor, -1.f * factor, 0.f, 0.f); // scale_bias from [0, 1] to [-1, 1] and factor applied + } + else + { + nglProgramEnvParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0, 2.f, -1.f, 0.f, 0.f); // scale_bias from [0, 1] to [-1, 1] and factor applied + } + + // setup the constant + if (mat.getTexture(1) && mat.getTexture(1)->isBumpMap()) + { + float factor = NLMISC::safe_cast(mat.getTexture(1))->getNormalizationFactor(); + nglProgramEnvParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 1, 2.f * factor, -1.f * factor, 0.f, 0.f); // scale_bias from [0, 1] to [-1, 1] and factor applied + } + else + { + nglProgramEnvParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 1, 2.f, -1.f, 0.f, 0.f); // scale_bias from [0, 1] to [-1, 1] and factor applied + } + + if (_FogEnabled) + { + if (_FogStart == _FogEnd) + { + nglProgramEnvParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 2, 0.f, 0.f, 0.f, 0.f); + } + else + { + /** Unfortunately, the EXT_vertex_shader extension has to output the fog values in the [0, 1] range to work with the standard pipeline. + * So we must add a special path for this case, where the fog coordinate is 'unscaled' again. + * NB : this is fixed in later drivers (from 6.14.10.6343), so check this + */ + if (_Extensions.EXTVertexShader && !_ATIFogRangeFixed) + { + nglProgramEnvParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 2, 1.f, 0.f, 0.f, 0.f); + } + else + { + nglProgramEnvParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 2, - 1.f/ (_FogEnd - _FogStart), _FogEnd / (_FogEnd - _FogStart), 0.f, 0.f); + } + } + } +#endif +} + +// *************************************************************************** +/** Presetupped texture shader for water shader on NV20 + */ +static const uint8 WaterNoDiffuseTexAddrMode[IDRV_MAT_MAXTEXTURES] = +{ + CMaterial::FetchTexture, + CMaterial::OffsetTexture, + CMaterial::OffsetTexture, + CMaterial::TextureOff +}; + +static const uint8 WaterTexAddrMode[IDRV_MAT_MAXTEXTURES] = +{ + CMaterial::FetchTexture, + CMaterial::OffsetTexture, + CMaterial::OffsetTexture, + CMaterial::FetchTexture +}; + +static const float IdentityTexMat[4] = { 1.f, 0.f, 0.f, 1.f }; + +// *************************************************************************** +void CDriverGL::setupWaterPassNV20(const CMaterial &mat) +{ + H_AUTO_OGL(CDriverGL_setupWaterPassNV20); + +#ifndef USE_OPENGLES + static bool setupDone = false; + static CMaterial::CTexEnv texEnvReplace; + static CMaterial::CTexEnv texEnvModulate; + + if (!setupDone) + { + texEnvReplace.Env.OpRGB = CMaterial::Replace; + texEnvReplace.Env.OpAlpha = CMaterial::Replace; + // use default setup for texenv modulate + setupDone = true; + } + + // activate the textures & set the matrixs + ITexture *tex = mat.getTexture(0); + if (tex) + { + setupTexture(*tex); + activateTexture(0, tex); + _DriverGLStates.activeTextureARB(1); + if (tex->isBumpMap()) + { + CTextureBump *tb = static_cast(tex); + // set the matrix for the texture shader + float factor = tb->getNormalizationFactor(); + float tsMatrix[4] = { 0.25f * factor, 0.f, 0.f, 0.25f * factor }; + glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, tsMatrix); + } + else + { + glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, IdentityTexMat); + } + } + tex = mat.getTexture(1); + if (tex) + { + setupTexture(*tex); + activateTexture(1, tex); + _DriverGLStates.activeTextureARB(2); + if (tex->isBumpMap()) + { + CTextureBump *tb = static_cast(tex); + // set the matrix for the texture shader + float factor = tb->getNormalizationFactor(); + float tsMatrix[4] = { factor, 0.f, 0.f, factor }; + glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, tsMatrix); + } + else + { + glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, IdentityTexMat); + } + } + tex = mat.getTexture(2); + if (tex) + { + setupTexture(*tex); + activateTexture(2, tex); + } + tex = mat.getTexture(3); + if (tex) + { + setupTexture(*tex); + activateTexture(3, tex); + } + for (uint k = 4; k < inlGetNumTextStages(); ++k) + { + activateTexture(k, NULL); + } + + // setup the texture shaders + enableNVTextureShader(true); + activateTexEnvMode(0, texEnvReplace); + activateTexEnvMode(1, texEnvReplace); + nlctassert(IDRV_MAT_MAXTEXTURES == 4); // if this value changes, may have to change the arrays WaterNoDiffuseTexAddrMode & WaterTexAddrMode + if (mat.getTexture(3) == NULL) + { + setTextureShaders(WaterNoDiffuseTexAddrMode, mat._Textures); + activateTexEnvMode(2, texEnvReplace); + } + else + { + setTextureShaders(WaterTexAddrMode, mat._Textures); + activateTexEnvMode(2, texEnvReplace); + activateTexEnvMode(3, texEnvModulate); + } +#endif +} + +// *************************************************************************** +void CDriverGL::setupWaterPass(uint /* pass */) +{ + H_AUTO_OGL(CDriverGL_setupWaterPass) + nlassert (_CurrentMaterial); + CMaterial &mat = *_CurrentMaterial; + nlassert(_CurrentMaterial->getShader() == CMaterial::Water); + + if (_Extensions.NVTextureShader) + { + setupWaterPassNV20(mat); + } + else if (ARBWaterShader[0]) + { + setupWaterPassARB(mat); + } + else if (ATIWaterShaderHandleNoDiffuseMap) + { + setupWaterPassR200(mat); + } +} + +// *************************************************************************** +void CDriverGL::endWaterMultiPass() +{ + H_AUTO_OGL(CDriverGL_endWaterMultiPass); + +#ifndef USE_OPENGLES + nlassert(_CurrentMaterial->getShader() == CMaterial::Water); + // NB : as fragment shaders / programs bypass the texture envs, no special env enum is added (c.f CTexEnvSpecial) + if (_Extensions.NVTextureShader) return; + if (ARBWaterShader[0]) + { + glDisable(GL_FRAGMENT_PROGRAM_ARB); + } + else if (ATIWaterShaderHandleNoDiffuseMap) + { + glDisable(GL_FRAGMENT_SHADER_ATI); + } +#endif +} + +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} // NL3D diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_matrix.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_matrix.cpp new file mode 100644 index 000000000..855c10c21 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_matrix.cpp @@ -0,0 +1,219 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "stdopengl.h" +#include "driver_opengl.h" + +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + +// *************************************************************************** +void CDriverGL::setFrustum(float left, float right, float bottom, float top, float znear, float zfar, bool perspective) +{ + H_AUTO_OGL(CDriverGL_setFrustum); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + if (perspective) + { +#ifdef USE_OPENGLES + glFrustumf(left,right,bottom,top,znear,zfar); +#else + glFrustum(left,right,bottom,top,znear,zfar); +#endif + } + else + { +#ifdef USE_OPENGLES + glOrthof(left,right,bottom,top,znear,zfar); +#else + glOrtho(left,right,bottom,top,znear,zfar); +#endif + } + + _ProjMatDirty = true; + + // Backup znear and zfar for zbias setup + _OODeltaZ = 1 / (zfar - znear); + + glMatrixMode(GL_MODELVIEW); +} + +// *************************************************************************** + +void CDriverGL::setFrustumMatrix(CMatrix &frustumMatrix) +{ + H_AUTO_OGL(CDriverGL_setFrustum) + glMatrixMode(GL_PROJECTION); + + glLoadMatrixf(((GLfloat*)frustumMatrix.get())); + + glMatrixMode(GL_MODELVIEW); +} + +// *************************************************************************** + +CMatrix CDriverGL::getFrustumMatrix() +{ + H_AUTO_OGL(CDriverGL_getFrustum) + + glMatrixMode(GL_PROJECTION); + + CMatrix frustumMatrix; + float frustum[16]; + glGetFloatv(GL_PROJECTION_MATRIX, ((GLfloat*)&frustum)); + frustumMatrix.set(frustum); + + glMatrixMode(GL_MODELVIEW); + + return frustumMatrix; +} + +// *************************************************************************** +void CDriverGL::setupViewMatrixEx(const CMatrix& mtx, const CVector &cameraPos) +{ + H_AUTO_OGL(CDriverGL_setupViewMatrixEx) + _UserViewMtx= mtx; + + // Setup the matrix to transform the CScene basis in openGL basis. + CMatrix changeBasis; + CVector I(1,0,0); + CVector J(0,0,-1); + CVector K(0,1,0); + + changeBasis.identity(); + changeBasis.setRot(I,J,K, true); + _ViewMtx=changeBasis*mtx; + // Reset the viewMtx position. + _ViewMtx.setPos(CVector::Null); + _PZBCameraPos= cameraPos; + + // Anything that depend on the view martix must be updated. + _LightSetupDirty= true; + _ModelViewMatrixDirty= true; + _RenderSetupDirty= true; + // All lights must be refresh. + for(uint i=0;i +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "stdopengl.h" + +#include "driver_opengl.h" + +// *************************************************************************** +// define it For Debug purpose only. Normal use is to hide this line +//#define NL3D_GLSTATE_DISABLE_CACHE + +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + +// *************************************************************************** +CDriverGLStates::CDriverGLStates() +{ + H_AUTO_OGL(CDriverGLStates_CDriverGLStates) + _TextureCubeMapSupported= false; + _CurrARBVertexBuffer = 0; + _DepthRangeNear = 0.f; + _DepthRangeFar = 1.f; + _ZBias = 0.f; + _MaxDriverLight= 0; + _CullMode = CCW; +} + + +// *************************************************************************** +void CDriverGLStates::init(bool supportTextureCubeMap, bool supportTextureRectangle, uint maxLight) +{ + H_AUTO_OGL(CDriverGLStates_init) + _TextureCubeMapSupported= supportTextureCubeMap; + _TextureRectangleSupported= supportTextureRectangle; + _MaxDriverLight= maxLight; + _MaxDriverLight= std::min(_MaxDriverLight, uint(MaxLight)); + + // By default all arrays are disabled. + _VertexArrayEnabled= false; + _NormalArrayEnabled= false; + _WeightArrayEnabled= false; + _ColorArrayEnabled= false; + _SecondaryColorArrayEnabled= false; + uint i; + for(i=0; i::max(); + _CurStencilOpFail = GL_KEEP; + _CurStencilOpZFail = GL_KEEP; + _CurStencilOpZPass = GL_KEEP; + _CurStencilWriteMask = std::numeric_limits::max(); + _CurAlphaTestThreshold= 0.5f; + + // setup GLStates. + glBlendFunc(_CurBlendSrc, _CurBlendDst); + glDepthFunc(_CurDepthFunc); + glStencilFunc(_CurStencilFunc, _CurStencilRef, _CurStencilMask); + glStencilOp(_CurStencilOpFail, _CurStencilOpZFail, _CurStencilOpZPass); + glStencilMask(_CurStencilWriteMask); + glAlphaFunc(GL_GREATER, _CurAlphaTestThreshold); + + + + // Materials. + uint32 packedOne= (CRGBA(255,255,255,255)).getPacked(); + uint32 packedZero= (CRGBA(0,0,0,255)).getPacked(); + _CurEmissive= packedZero; + _CurAmbient= packedOne; + _CurDiffuse= packedOne; + _CurSpecular= packedZero; + _CurShininess= 1; + + // Lighted vertex color + _VertexColorLighted=false; + glDisable(GL_COLOR_MATERIAL); + + // setup GLStates. + static const GLfloat one[4]= {1,1,1,1}; + static const GLfloat zero[4]= {0,0,0,1}; + glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, zero); + glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, one); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, one); + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, zero); + glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, _CurShininess); + + // TexModes + uint stage; + for(stage=0;stage=_MaxDriverLight) + return; + + // If different from current setup, update. + bool enabled= (enable!=0); +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if( enabled != _CurLight[num] ) +#endif + { + // new state. + _CurLight[num]= enabled; + // Setup GLState. + if(_CurLight[num]) + glEnable ((GLenum)(GL_LIGHT0+num)); + else + glDisable ((GLenum)(GL_LIGHT0+num)); + } +} + +// *************************************************************************** +bool CDriverGLStates::isLightEnabled(uint num) const +{ + H_AUTO_OGL(CDriverGLStates_isLightEnabled) + if(num>=_MaxDriverLight) + return false; + else + return _CurLight[num]; +} + + +// *************************************************************************** +void CDriverGLStates::enableZWrite(uint enable) +{ + H_AUTO_OGL(CDriverGLStates_enableZWrite) + // If different from current setup, update. + bool enabled= (enable!=0); +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if( enabled != _CurZWrite ) +#endif + { + // new state. + _CurZWrite= enabled; + // Setup GLState. + if(_CurZWrite) + glDepthMask(GL_TRUE); + else + glDepthMask(GL_FALSE); + } +} + + +// *************************************************************************** +void CDriverGLStates::enableStencilTest(bool enable) +{ + H_AUTO_OGL(CDriverGLStates_enableStencilTest); + + // If different from current setup, update. +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if( enable != _CurStencilTest ) +#endif + { + // new state. + _CurStencilTest= enable; + // Setup GLState. + if(_CurStencilTest) + glEnable(GL_STENCIL_TEST); + else + glDisable(GL_STENCIL_TEST); + } +} + +// *************************************************************************** +void CDriverGLStates::enableMultisample(bool enable) +{ + H_AUTO_OGL(CDriverGLStates_enableMultisample); + + // If different from current setup, update. +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if( enable != _CurMultisample ) +#endif + { + // new state. + _CurMultisample= enable; + + // Setup GLState. + if(_CurMultisample) + glEnable(GL_MULTISAMPLE_ARB); + else + glDisable(GL_MULTISAMPLE_ARB); + } +} + +// *************************************************************************** +void CDriverGLStates::blendFunc(GLenum src, GLenum dst) +{ + H_AUTO_OGL(CDriverGLStates_blendFunc) + // If different from current setup, update. +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if( src!= _CurBlendSrc || dst!=_CurBlendDst ) +#endif + { + // new state. + _CurBlendSrc= src; + _CurBlendDst= dst; + // Setup GLState. + glBlendFunc(_CurBlendSrc, _CurBlendDst); + } +} + +// *************************************************************************** +void CDriverGLStates::depthFunc(GLenum zcomp) +{ + H_AUTO_OGL(CDriverGLStates_depthFunc) + // If different from current setup, update. +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if( zcomp != _CurDepthFunc ) +#endif + { + // new state. + _CurDepthFunc= zcomp; + // Setup GLState. + glDepthFunc(_CurDepthFunc); + } +} + + +// *************************************************************************** +void CDriverGLStates::alphaFunc(float threshold) +{ + H_AUTO_OGL(CDriverGLStates_alphaFunc) +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if(threshold != _CurAlphaTestThreshold) +#endif + { + // new state + _CurAlphaTestThreshold= threshold; + // setup function. + glAlphaFunc(GL_GREATER, _CurAlphaTestThreshold); + } +} + + +// *************************************************************************** +void CDriverGLStates::stencilFunc(GLenum func, GLint ref, GLuint mask) +{ + H_AUTO_OGL(CDriverGLStates_stencilFunc) +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if((func!=_CurStencilFunc) || (ref!=_CurStencilRef) || (mask!=_CurStencilMask)) +#endif + { + // new state + _CurStencilFunc = func; + _CurStencilRef = ref; + _CurStencilMask = mask; + + // setup function. + glStencilFunc(_CurStencilFunc, _CurStencilRef, _CurStencilMask); + } +} + + +// *************************************************************************** +void CDriverGLStates::stencilOp(GLenum fail, GLenum zfail, GLenum zpass) +{ + H_AUTO_OGL(CDriverGLStates_stencilOp) +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if((fail!=_CurStencilOpFail) || (zfail!=_CurStencilOpZFail) || (zpass!=_CurStencilOpZPass)) +#endif + { + // new state + _CurStencilOpFail = fail; + _CurStencilOpZFail = zfail; + _CurStencilOpZPass = zpass; + + // setup function. + glStencilOp(_CurStencilOpFail, _CurStencilOpZFail, _CurStencilOpZPass); + } +} + +// *************************************************************************** +void CDriverGLStates::stencilMask(GLuint mask) +{ + H_AUTO_OGL(CDriverGLStates_stencilMask) +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if(mask!=_CurStencilWriteMask) +#endif + { + // new state + _CurStencilWriteMask = mask; + + // setup function. + glStencilMask(_CurStencilWriteMask); + } +} + + +// *************************************************************************** +void CDriverGLStates::setEmissive(uint32 packedColor, const GLfloat color[4]) +{ + H_AUTO_OGL(CDriverGLStates_setEmissive) +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if( packedColor!=_CurEmissive ) +#endif + { + _CurEmissive= packedColor; + glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, color); + } +} + +// *************************************************************************** +void CDriverGLStates::setAmbient(uint32 packedColor, const GLfloat color[4]) +{ + H_AUTO_OGL(CDriverGLStates_setAmbient) +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if( packedColor!=_CurAmbient ) +#endif + { + _CurAmbient= packedColor; + glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, color); + } +} + +// *************************************************************************** +void CDriverGLStates::setDiffuse(uint32 packedColor, const GLfloat color[4]) +{ + H_AUTO_OGL(CDriverGLStates_setDiffuse) +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if( packedColor!=_CurDiffuse ) +#endif + { + _CurDiffuse= packedColor; + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, color); + } +} + +// *************************************************************************** +void CDriverGLStates::setSpecular(uint32 packedColor, const GLfloat color[4]) +{ + H_AUTO_OGL(CDriverGLStates_setSpecular) +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if( packedColor!=_CurSpecular ) +#endif + { + _CurSpecular= packedColor; + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, color); + } +} + +// *************************************************************************** +void CDriverGLStates::setShininess(float shin) +{ + H_AUTO_OGL(CDriverGLStates_setShininess) +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if( shin != _CurShininess ) +#endif + { + _CurShininess= shin; + glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, shin); + } +} + + +// *************************************************************************** +static void convColor(CRGBA col, GLfloat glcol[4]) +{ + H_AUTO_OGL(convColor) + static const float OO255= 1.0f/255; + glcol[0]= col.R*OO255; + glcol[1]= col.G*OO255; + glcol[2]= col.B*OO255; + glcol[3]= col.A*OO255; +} + +// *************************************************************************** +void CDriverGLStates::setVertexColorLighted(bool enable) +{ + H_AUTO_OGL(CDriverGLStates_setVertexColorLighted) +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if( enable != _VertexColorLighted) +#endif + { + _VertexColorLighted= enable; + + if (_VertexColorLighted) + { + glEnable (GL_COLOR_MATERIAL); +#ifndef USE_OPENGLES + glColorMaterial (GL_FRONT_AND_BACK, GL_DIFFUSE); +#endif + } + else + { + glDisable (GL_COLOR_MATERIAL); + // Since we leave glColorMaterial mode, GL diffuse is now scracth. reset him to current value. + CRGBA diffCol; + diffCol.R= (uint8)((_CurDiffuse >> 24) & 255); + diffCol.G= (uint8)((_CurDiffuse >> 16) & 255); + diffCol.B= (uint8)((_CurDiffuse >> 8) & 255); + diffCol.A= (uint8)((_CurDiffuse ) & 255); + GLfloat glColor[4]; + convColor(diffCol, glColor); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, glColor); + } + } +} + + +// *************************************************************************** +void CDriverGLStates::updateDepthRange() +{ + H_AUTO_OGL(CDriverGLStates_updateDepthRange); + + float delta = _ZBias * (_DepthRangeFar - _DepthRangeNear); + +#ifdef USE_OPENGLES + glDepthRangef(delta + _DepthRangeNear, delta + _DepthRangeFar); +#else + glDepthRange(delta + _DepthRangeNear, delta + _DepthRangeFar); +#endif +} + +// *************************************************************************** +void CDriverGLStates::setZBias(float zbias) +{ + H_AUTO_OGL(CDriverGLStates_setZBias) +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if (zbias != _ZBias) +#endif + { + _ZBias = zbias; + updateDepthRange(); + } +} + + +// *************************************************************************** +void CDriverGLStates::setDepthRange(float znear, float zfar) +{ + H_AUTO_OGL(CDriverGLStates_setDepthRange) + nlassert(znear != zfar); +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if (znear != _DepthRangeNear || zfar != _DepthRangeFar) +#endif + { + _DepthRangeNear = znear; + _DepthRangeFar = zfar; + updateDepthRange(); + } +} + +// *************************************************************************** +void CDriverGLStates::setTexGenMode (uint stage, GLint mode) +{ + H_AUTO_OGL(CDriverGLStates_setTexGenMode); + +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if (mode != _TexGenMode[stage]) +#endif + { + _TexGenMode[stage] = mode; + + if (!_TextureCubeMapSupported) return; + + if(mode==0) + { +#ifdef USE_OPENGLES + glDisable(GL_TEXTURE_GEN_STR_OES); +#else + glDisable( GL_TEXTURE_GEN_S ); + glDisable( GL_TEXTURE_GEN_T ); + glDisable( GL_TEXTURE_GEN_R ); + glDisable( GL_TEXTURE_GEN_Q ); +#endif + } + else + { +#ifdef USE_OPENGLES + nglTexGeniOES(GL_TEXTURE_GEN_STR_OES, GL_TEXTURE_GEN_MODE_OES, mode); +#else + glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, mode); + glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, mode); + glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, mode); +#endif + + /* Object or Eye Space ? => enable W generation. VERY IMPORTANT because + was a bug with VegetableRender and ShadowRender: + - Vegetable use the TexCoord1.w in his VertexProgram + - Shadow Render don't use any TexCoord in VB (since projected) + => TexCoord1.w dirty!! + */ +#ifdef USE_OPENGLES +// if(mode==GL_OBJECT_LINEAR || mode==GL_EYE_LINEAR) +// { +// nglTexGeniOES(GL_TEXTURE_GEN_STR_OES, GL_TEXTURE_GEN_MODE_OES, mode); +// glEnable(GL_TEXTURE_GEN_STR_OES); +// } +// else +// { +// glDisable(GL_TEXTURE_GEN_STR_OES); +// } +#else + if(mode==GL_OBJECT_LINEAR || mode==GL_EYE_LINEAR) + { + glTexGeni( GL_Q, GL_TEXTURE_GEN_MODE, mode); + glEnable( GL_TEXTURE_GEN_Q ); + } + else + { + glDisable( GL_TEXTURE_GEN_Q ); + } +#endif + + // Enable All. +#ifdef USE_OPENGLES + glEnable(GL_TEXTURE_GEN_STR_OES); +#else + glEnable( GL_TEXTURE_GEN_S ); + glEnable( GL_TEXTURE_GEN_T ); + glEnable( GL_TEXTURE_GEN_R ); +#endif + } + } +} + +// *************************************************************************** +void CDriverGLStates::resetTextureMode() +{ + H_AUTO_OGL(CDriverGLStates_resetTextureMode); + + glDisable(GL_TEXTURE_2D); + + if (_TextureCubeMapSupported) + { + glDisable(GL_TEXTURE_CUBE_MAP_ARB); + } + +#ifndef USE_OPENGLES + if (_TextureRectangleSupported) + { + glDisable(GL_TEXTURE_RECTANGLE_NV); + } +#endif + + _TextureMode[_CurrentActiveTextureARB]= TextureDisabled; +} + + +// *************************************************************************** +void CDriverGLStates::setTextureMode(TTextureMode texMode) +{ + H_AUTO_OGL(CDriverGLStates_setTextureMode) + TTextureMode oldTexMode = _TextureMode[_CurrentActiveTextureARB]; + if(oldTexMode != texMode) + { + // Disable first old mode. + if (oldTexMode == Texture2D) + { + glDisable(GL_TEXTURE_2D); + } + else if(oldTexMode == TextureRect) + { +#ifndef USE_OPENGLES + if(_TextureRectangleSupported) + { + glDisable(GL_TEXTURE_RECTANGLE_NV); + } + else +#endif + { + glDisable(GL_TEXTURE_2D); + } + } + else if(oldTexMode == TextureCubeMap) + { + if(_TextureCubeMapSupported) + { + glDisable(GL_TEXTURE_CUBE_MAP_ARB); + } + else + { + glDisable(GL_TEXTURE_2D); + } + } + + // Enable new mode. + if(texMode == Texture2D) + { + glEnable(GL_TEXTURE_2D); + } + else if(texMode == TextureRect) + { +#ifndef USE_OPENGLES + if(_TextureRectangleSupported) + { + glEnable(GL_TEXTURE_RECTANGLE_NV); + } + else +#endif + { + glEnable(GL_TEXTURE_2D); + } + } + else if(texMode == TextureCubeMap) + { + if(_TextureCubeMapSupported) + { + glEnable(GL_TEXTURE_CUBE_MAP_ARB); + } + else + { + glEnable(GL_TEXTURE_2D); + } + } + + // new mode. + _TextureMode[_CurrentActiveTextureARB]= texMode; + } +} + + +// *************************************************************************** +void CDriverGLStates::activeTextureARB(uint stage) +{ + H_AUTO_OGL(CDriverGLStates_activeTextureARB); + + if( _CurrentActiveTextureARB != stage ) + { +#ifdef USE_OPENGLES + glActiveTexture(GL_TEXTURE0+stage); +#else + nglActiveTextureARB(GL_TEXTURE0_ARB+stage); +#endif + + _CurrentActiveTextureARB= stage; + } +} + +// *************************************************************************** +void CDriverGLStates::forceActiveTextureARB(uint stage) +{ + H_AUTO_OGL(CDriverGLStates_forceActiveTextureARB); + +#ifdef USE_OPENGLES + glActiveTexture(GL_TEXTURE0+stage); +#else + nglActiveTextureARB(GL_TEXTURE0_ARB+stage); +#endif + + _CurrentActiveTextureARB= stage; +} + +// *************************************************************************** +void CDriverGLStates::enableVertexArray(bool enable) +{ + H_AUTO_OGL(CDriverGLStates_enableVertexArray); + + if(_VertexArrayEnabled != enable) + { + if(enable) + glEnableClientState(GL_VERTEX_ARRAY); + else + glDisableClientState(GL_VERTEX_ARRAY); + + _VertexArrayEnabled= enable; + } +} +// *************************************************************************** +void CDriverGLStates::enableNormalArray(bool enable) +{ + H_AUTO_OGL(CDriverGLStates_enableNormalArray) + if(_NormalArrayEnabled != enable) + { + if(enable) + glEnableClientState(GL_NORMAL_ARRAY); + else + glDisableClientState(GL_NORMAL_ARRAY); + _NormalArrayEnabled= enable; + + + } +} +// *************************************************************************** +void CDriverGLStates::enableWeightArray(bool enable) +{ + H_AUTO_OGL(CDriverGLStates_enableWeightArray); + + if(_WeightArrayEnabled != enable) + { +#ifndef USE_OPENGLES + if(enable) + glEnableClientState(GL_VERTEX_WEIGHTING_EXT); + else + glDisableClientState(GL_VERTEX_WEIGHTING_EXT); +#endif + + _WeightArrayEnabled= enable; + } +} +// *************************************************************************** +void CDriverGLStates::enableColorArray(bool enable) +{ + H_AUTO_OGL(CDriverGLStates_enableColorArray); + + if(_ColorArrayEnabled != enable) + { + if(enable) + glEnableClientState(GL_COLOR_ARRAY); + else + glDisableClientState(GL_COLOR_ARRAY); + _ColorArrayEnabled= enable; + + + } +} + + +// *************************************************************************** +void CDriverGLStates::enableSecondaryColorArray(bool enable) +{ + H_AUTO_OGL(CDriverGLStates_enableSecondaryColorArray); + + if(_SecondaryColorArrayEnabled != enable) + { +#ifndef USE_OPENGLES + if(enable) + glEnableClientState(GL_SECONDARY_COLOR_ARRAY_EXT); + else + glDisableClientState(GL_SECONDARY_COLOR_ARRAY_EXT); +#endif + + _SecondaryColorArrayEnabled= enable; + +#ifndef USE_OPENGLES + // If disable + if(!enable) + { + // GeForceFx Bug: Must reset Secondary color to 0 (if comes from a VP), else bugs + nglSecondaryColor3ubEXT(0,0,0); + } +#endif + } +} + +// *************************************************************************** +void CDriverGLStates::clientActiveTextureARB(uint stage) +{ + H_AUTO_OGL(CDriverGLStates_clientActiveTextureARB); + + if( _CurrentClientActiveTextureARB != stage ) + { +#ifdef USE_OPENGLES + glClientActiveTexture(GL_TEXTURE0+stage); +#else + nglClientActiveTextureARB(GL_TEXTURE0_ARB+stage); +#endif + _CurrentClientActiveTextureARB= stage; + } +} + +// *************************************************************************** +void CDriverGLStates::enableTexCoordArray(bool enable) +{ + H_AUTO_OGL(CDriverGLStates_enableTexCoordArray); + + if(_TexCoordArrayEnabled[_CurrentClientActiveTextureARB] != enable) + { + if(enable) + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + else + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + + + _TexCoordArrayEnabled[_CurrentClientActiveTextureARB]= enable; + } +} + +// *************************************************************************** +void CDriverGLStates::enableVertexAttribArray(uint glIndex, bool enable) +{ + H_AUTO_OGL(CDriverGLStates_enableVertexAttribArray); + + if(_VertexAttribArrayEnabled[glIndex] != enable) + { +#ifndef USE_OPENGLES + if(enable) + glEnableClientState(glIndex+GL_VERTEX_ATTRIB_ARRAY0_NV); + else + glDisableClientState(glIndex+GL_VERTEX_ATTRIB_ARRAY0_NV); +#endif + + _VertexAttribArrayEnabled[glIndex]= enable; + } +} + +// *************************************************************************** +void CDriverGLStates::enableVertexAttribArrayARB(uint glIndex,bool enable) +{ + H_AUTO_OGL(CDriverGLStates_enableVertexAttribArrayARB); + + #ifndef NL3D_GLSTATE_DISABLE_CACHE + if(_VertexAttribArrayEnabled[glIndex] != enable) + #endif + { +#ifndef USE_OPENGLES + if(enable) + nglEnableVertexAttribArrayARB(glIndex); + else + nglDisableVertexAttribArrayARB(glIndex); +#endif + + _VertexAttribArrayEnabled[glIndex]= enable; + } +} + +// *************************************************************************** +void CDriverGLStates::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bool enable, uint *variants) +{ + H_AUTO_OGL(CDriverGLStates_enableVertexAttribArrayForEXTVertexShader); + + if(_VertexAttribArrayEnabled[glIndex] != enable) + { + switch(glIndex) + { + case 0: // position + enableVertexArray(enable); + break; + case 1: // skin weight +#ifndef USE_OPENGLES + if(enable) + nglEnableVariantClientStateEXT(variants[CDriverGL::EVSSkinWeightVariant]); + else + nglDisableVariantClientStateEXT(variants[CDriverGL::EVSSkinWeightVariant]); +#endif + break; + case 2: // normal + enableNormalArray(enable); + break; + case 3: // color + enableColorArray(enable); + break; + case 4: // secondary color +#ifndef USE_OPENGLES + if(enable) + nglEnableVariantClientStateEXT(variants[CDriverGL::EVSSecondaryColorVariant]); + else + nglDisableVariantClientStateEXT(variants[CDriverGL::EVSSecondaryColorVariant]); +#endif + break; + case 5: // fog coordinate +#ifndef USE_OPENGLES + if(enable) + nglEnableVariantClientStateEXT(variants[CDriverGL::EVSFogCoordsVariant]); + else + nglDisableVariantClientStateEXT(variants[CDriverGL::EVSFogCoordsVariant]); +#endif + break; + case 6: // palette skin +#ifndef USE_OPENGLES + if(enable) + nglEnableVariantClientStateEXT(variants[CDriverGL::EVSPaletteSkinVariant]); + else + nglDisableVariantClientStateEXT(variants[CDriverGL::EVSPaletteSkinVariant]); +#endif + break; + case 7: // empty + nlstop; + break; + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + clientActiveTextureARB(glIndex - 8); + enableTexCoordArray(enable); + break; + default: + nlstop; // invalid value + break; + } + _VertexAttribArrayEnabled[glIndex]= enable; + } +} + + + +// *************************************************************************** +void CDriverGLStates::enableFog(uint enable) +{ + H_AUTO_OGL(CDriverGLStates_enableFog) + // If different from current setup, update. + bool enabled= (enable!=0); +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if( enabled != _CurFog ) +#endif + { + // new state. + _CurFog= enabled; + // Setup GLState. + if(_CurFog) + glEnable(GL_FOG); + else + glDisable(GL_FOG); + } +} + +// *************************************************************************** +void CDriverGLStates::forceBindARBVertexBuffer(uint objectID) +{ + H_AUTO_OGL(CDriverGLStates_forceBindARBVertexBuffer) + +#ifdef USE_OPENGLES + glBindBuffer(GL_ARRAY_BUFFER, objectID); +#else + nglBindBufferARB(GL_ARRAY_BUFFER_ARB, objectID); +#endif + + _CurrARBVertexBuffer = objectID; +} + +// *************************************************************************** +void CDriverGLStates::bindARBVertexBuffer(uint objectID) +{ + H_AUTO_OGL(CDriverGLStates_bindARBVertexBuffer) +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if (objectID != _CurrARBVertexBuffer) +#endif + { + forceBindARBVertexBuffer(objectID); + } +} + +// *************************************************************************** +void CDriverGLStates::setCullMode(TCullMode cullMode) +{ + H_AUTO_OGL(CDriverGLStates_setCullMode) +#ifndef NL3D_GLSTATE_DISABLE_CACHE + if (cullMode != _CullMode) +#endif + { + glCullFace(cullMode == CCW ? GL_BACK : GL_FRONT); + _CullMode = cullMode; + } +} + +// *************************************************************************** +CDriverGLStates::TCullMode CDriverGLStates::getCullMode() const +{ + H_AUTO_OGL(CDriverGLStates_CDriverGLStates) + return _CullMode; +} + +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} // NL3D diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.h b/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.h new file mode 100644 index 000000000..be5c1918f --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.h @@ -0,0 +1,267 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef NL_DRIVER_OPENGL_STATES_H +#define NL_DRIVER_OPENGL_STATES_H + +#include "nel/misc/types_nl.h" +#include "nel/3d/vertex_buffer.h" + +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + +// *************************************************************************** +/** + * Class for optimizing calls to openGL states, by caching old ones. + * All following call with OpenGL must be done with only one instance of this class: + - glEnable() glDisable() with: + - GL_BLEND + - GL_CULL_FACE + - GL_ALPHA_TEST + - GL_LIGHTING + - GL_LIGHT0 + i ..... + - GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP_ARB/OES. + - GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R + - GL_COLOR_MATERIAL + - GL_FOG + - GL_MULTISAMPLE_ARB + - glActiveTextureARB() + - glClientActiveTextureARB() + - glEnableClientState() glDisableClientState() with: + - GL_VERTEX_ARRAY + - GL_NORMAL_ARRAY + - GL_VERTEX_WEIGHTING_EXT + - GL_COLOR_ARRAY + - GL_SECONDARY_COLOR_ARRAY_EXT + - GL_TEXTURE_COORD_ARRAY + - GL_VERTEX_ATTRIB_ARRAY0_NV + i. + - glDepthMask() + - glAlphaFunc() + - glBlendFunc() + - glDepthFunc() + - glMaterialf() and glMaterialfv() for: + - GL_EMISSION + - GL_AMBIENT + - GL_DIFFUSE + - GL_SPECULAR + - GL_SHININESS + - glDepthRange() + - glColorMaterial() + - glTexGeni() + * \author Lionel Berenguier + * \author Nevrax France + * \date 2001 + */ +class CDriverGLStates +{ +public: + /// Constructor. no-op. + CDriverGLStates(); + // init. Do it just after setDisplay() + void init(bool supportTextureCubeMap, bool supportTextureRectangle, uint maxLight); + + /// Reset all OpenGL states of interest to default, and update caching. This don't apply to light. + void forceDefaults(uint nbTextureStages); + + /// \name enable if !0 + // @{ + void enableBlend(uint enable); + void enableFog(uint enable); + void enableCullFace(uint enable); + /// enable and set good AlphaFunc. + void enableAlphaTest(uint enable); + void enableZWrite(uint enable); + // overall lighting enabled + void enableLighting(uint enable); + bool isLightingEnabled() const { return _CurLighting; } + /// enable/disable specific light. num must be < "maxLight" param set in init() + void enableLight(uint num, uint enable); + bool isLightEnabled(uint num) const; + /// enable/disable stencil test + void enableStencilTest(bool enable); + bool isStencilTestEnabled() const { return _CurStencilTest; } + /// enable/disable multisample + void enableMultisample(bool enable); + bool isMultisampleEnabled() const { return _CurMultisample; } + // @} + + /// glBlendFunc. + void blendFunc(GLenum src, GLenum dst); + /// glDepthFunc. + void depthFunc(GLenum zcomp); + /// glAlphaFunc + void alphaFunc(float threshold); + /// glStencilFunc + void stencilFunc(GLenum stencilFunc, GLint ref, GLuint mask); + /// glStencilOp + void stencilOp(GLenum fail, GLenum zfail, GLenum zpass); + /// glStencilMask + void stencilMask(uint mask); + + /// \name Material setting. + /// Each f() get an uint32 for fast comparison, and OpenGL colors. + // @{ + void setEmissive(uint32 packedColor, const GLfloat color[4]); + void setAmbient(uint32 packedColor, const GLfloat color[4]); + void setDiffuse(uint32 packedColor, const GLfloat color[4]); + void setSpecular(uint32 packedColor, const GLfloat color[4]); + void setShininess(float shin); + void setVertexColorLighted(bool enable); + void setDepthRange (float znear, float zfar); + void getDepthRange(float &znear, float &zfar) const { znear = _DepthRangeNear; zfar = _DepthRangeFar; } + /** Set z-bias + * NB : this is done in window coordinate, not in world coordinate as with CMaterial + */ + void setZBias(float zbias); + // NB: set 0 to reset TexGen. + void setTexGenMode (uint stage, GLint mode); + // @} + + + + /// \name Texture Mode setting. + // @{ + enum TTextureMode {TextureDisabled, Texture2D, TextureRect, TextureCubeMap, TextureModeCount}; + /// same as glActiveTextureARB(). useful for setTextureMode. + void activeTextureARB(uint stage); + /// same as active texture arb, but with no cache check + void forceActiveTextureARB(uint stage); + /// get active texture + uint getActiveTextureARB() const { return _CurrentActiveTextureARB; } + /** change if needed the texture mode of the current active Texture ARB. + * NB: if CubeMap extension not supported, TextureCubeMap <=> TextureDisabled. + */ + void setTextureMode(TTextureMode texMode); + TTextureMode getTextureMode() const { return _TextureMode[_CurrentActiveTextureARB]; } + // reset texture mode to the default (disabled) for the current stage. It forces the state (useful after texture shaders) + void resetTextureMode(); + // @} + + /// \name Vertex Array enabling. + /// equivalent to glEnableClientState() / glDisableClientState(). NB: Not modified by forceDefaults() + // @{ + void enableVertexArray(bool enable); + void enableNormalArray(bool enable); + void enableWeightArray(bool enable); + void enableColorArray(bool enable); + void enableSecondaryColorArray(bool enable); + /// same as glClientActiveTextureARB(). useful for enableTexCoordArray. + void clientActiveTextureARB(uint stage); + /// NB: caller must call correct clientActiveTextureARB() before. + void enableTexCoordArray(bool enable); + /** For vertexProgram. do not check if supported or not. + */ + void enableVertexAttribArray(uint glIndex, bool enable); + /** Same as enableVertexAttribArray, but for EXTVertexShader (need variant ID) + * \param firstVariantSymbol the first variant symbol + */ + void enableVertexAttribArrayForEXTVertexShader(uint glIndex, bool enable, uint *variants); + + // special version for ARB_vertex_program used with ARB_vertex_buffer or ATI_vertex_attrib_array_object + void enableVertexAttribArrayARB(uint glIndex, bool enable); + + + // @} + + + // ARB_vertex_buffer_object buffer binding + void bindARBVertexBuffer(uint objectID); + void forceBindARBVertexBuffer(uint objectID); + uint getCurrBoundARBVertexBuffer() const { return _CurrARBVertexBuffer; } + + enum TCullMode { CCW = 0, CW }; + void setCullMode(TCullMode cullMode); + TCullMode getCullMode() const; + +private: + bool _CurBlend; + bool _CurFog; + bool _CurCullFace; + bool _CurAlphaTest; + bool _CurLighting; + bool _CurZWrite; + bool _CurStencilTest; + bool _CurMultisample; + + GLenum _CurBlendSrc; + GLenum _CurBlendDst; + GLenum _CurDepthFunc; + GLenum _CurStencilFunc; + GLint _CurStencilRef; + GLuint _CurStencilMask; + GLenum _CurStencilOpFail; + GLenum _CurStencilOpZFail; + GLenum _CurStencilOpZPass; + GLuint _CurStencilWriteMask; + float _CurAlphaTestThreshold; + + uint32 _CurEmissive; + uint32 _CurAmbient; + uint32 _CurDiffuse; + uint32 _CurSpecular; + float _CurShininess; + bool _VertexColorLighted; + + bool _TextureCubeMapSupported; + bool _TextureRectangleSupported; + uint _CurrentActiveTextureARB; + TTextureMode _TextureMode[8]; + + bool _VertexArrayEnabled; + bool _NormalArrayEnabled; + bool _WeightArrayEnabled; + bool _ColorArrayEnabled; + bool _SecondaryColorArrayEnabled; + uint _CurrentClientActiveTextureARB; + bool _TexCoordArrayEnabled[8]; + bool _VertexAttribArrayEnabled[CVertexBuffer::NumValue]; + + GLint _TexGenMode[8]; + + uint _CurrARBVertexBuffer; + + float _DepthRangeNear; + float _DepthRangeFar; + float _ZBias; // NB : zbias is in window coordinates + + TCullMode _CullMode; + +private: + void updateDepthRange(); + + // Mirror of glEnable() and GL_LIGHT0+i + enum {MaxLight=8}; + uint _MaxDriverLight; + bool _CurLight[MaxLight]; +}; + +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} // NL3D + + +#endif // NL_DRIVER_OPENGL_STATES_H + +/* End of driver_opengl_states.h */ diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_texture.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_texture.cpp new file mode 100644 index 000000000..77954a8e3 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_texture.cpp @@ -0,0 +1,2409 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "stdopengl.h" + +#include "driver_opengl.h" +#include "nel/3d/texture_cube.h" +#include "nel/3d/texture_bloom.h" +#include "nel/misc/rect.h" +#include "nel/misc/file.h" // temp + +// Define this to force nearest filter (debug) +// #define NEL_FORCE_NEAREST + +using namespace NLMISC; +using namespace std; + + +//#define NEL_DUMP_UPLOAD_TIME + + +#ifdef NEL_DUMP_UPLOAD_TIME + #define NEL_MEASURE_UPLOAD_TIME_START NLMISC::TTicks startTick = CTime::getPerformanceTime(); + #define NEL_MEASURE_UPLOAD_TIME_END NLMISC::TTicks endTick = CTime::getPerformanceTime(); \ + nlinfo("3D: upload time = %.2f ms", (float) (1000 * (CTime::ticksToSecond(endTick) - CTime::ticksToSecond(startTick)))); +#else + #define NEL_MEASURE_UPLOAD_TIME_START + #define NEL_MEASURE_UPLOAD_TIME_END +#endif + +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + +// *************************************************************************** +CTextureDrvInfosGL::CTextureDrvInfosGL(IDriver *drv, ItTexDrvInfoPtrMap it, CDriverGL *drvGl, bool isRectangleTexture) : ITextureDrvInfos(drv, it) +{ + H_AUTO_OGL(CTextureDrvInfosGL_CTextureDrvInfosGL) + //nldebug("3D: CTextureDrvInfosGL::ctor()"); + // The id is auto created here. + glGenTextures(1,&ID); + + Compressed = false; + MipMap = false; + TextureMemory = 0; + + // Nb: at Driver dtor, all tex infos are deleted, so _Driver is always valid. + _Driver= drvGl; + +#ifdef USE_OPENGLES + TextureMode = GL_TEXTURE_2D; +#else + TextureMode = isRectangleTexture?GL_TEXTURE_RECTANGLE_NV:GL_TEXTURE_2D; +#endif + + FBOId = 0; + DepthFBOId = 0; + StencilFBOId = 0; + + InitFBO = false; + AttachDepthStencil = true; + UsePackedDepthStencil = drvGl->supportPackedDepthStencil(); +} +// *************************************************************************** +CTextureDrvInfosGL::~CTextureDrvInfosGL() +{ + H_AUTO_OGL(CTextureDrvInfosGL_CTextureDrvInfosGLDtor) + // The id is auto deleted here. + glDeleteTextures(1,&ID); + + // release profiling texture mem. + _Driver->_AllocatedTextureMemory-= TextureMemory; + + // release in TextureUsed. + _Driver->_TextureUsed.erase (this); + + if(InitFBO) + { +#ifdef USE_OPENGLES + nglDeleteFramebuffersOES(1, &FBOId); + if(AttachDepthStencil) + { + nglDeleteRenderbuffersOES(1, &DepthFBOId); + if(!UsePackedDepthStencil) + nglDeleteRenderbuffersOES(1, &StencilFBOId); + } +#else + nglDeleteFramebuffersEXT(1, &FBOId); + if(AttachDepthStencil) + { + nglDeleteRenderbuffersEXT(1, &DepthFBOId); + if(!UsePackedDepthStencil) + nglDeleteRenderbuffersEXT(1, &StencilFBOId); + } +#endif + } +} + +// *************************************************************************** +bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex) +{ + if(!InitFBO) + { + if(tex->isBloomTexture()) + { + AttachDepthStencil = !((CTextureBloom*)tex)->isMode2D(); + } + +#ifdef USE_OPENGLES + // generate IDs + nglGenFramebuffersOES(1, &FBOId); + if(AttachDepthStencil) + { + nglGenRenderbuffersOES(1, &DepthFBOId); + if(UsePackedDepthStencil) + StencilFBOId = DepthFBOId; + else + nglGenRenderbuffersOES(1, &StencilFBOId); + } + + //nldebug("3D: using depth %d and stencil %d", DepthFBOId, StencilFBOId); + + // initialize FBO + nglBindFramebufferOES(GL_FRAMEBUFFER_OES, FBOId); + nglFramebufferTexture2DOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, TextureMode, ID, 0); + + // attach depth/stencil render to FBO + // note: for some still unkown reason it's impossible to add + // a stencil buffer as shown in the respective docs (see + // opengl.org extension registry). Until a safe approach to add + // them is found, there will be no attached stencil for the time + // being, aside of using packed depth+stencil buffers. + if(AttachDepthStencil) + { + if(UsePackedDepthStencil) + { + //nldebug("3D: using packed depth stencil"); + nglBindRenderbufferOES(GL_RENDERBUFFER_OES, StencilFBOId); + nglRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_DEPTH24_STENCIL8_OES, tex->getWidth(), tex->getHeight()); + } + else + { + nglBindRenderbufferOES(GL_RENDERBUFFER_OES, DepthFBOId); + nglRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_DEPTH_COMPONENT24_OES, tex->getWidth(), tex->getHeight()); + /* + nglBindRenderbufferEXT(GL_RENDERBUFFER_OES, StencilFBOId); + nglRenderbufferStorageEXT(GL_RENDERBUFFER_OES, GL_STENCIL_INDEX8_EXT, tex->getWidth(), tex->getHeight()); + */ + } + nglFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, DepthFBOId); + nldebug("3D: glFramebufferRenderbufferExt(depth:24) = %X", nglCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES)); + nglFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_STENCIL_ATTACHMENT_OES, GL_RENDERBUFFER_OES, StencilFBOId); + nldebug("3D: glFramebufferRenderbufferExt(stencil:8) = %X", nglCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES)); + } +#else + // generate IDs + nglGenFramebuffersEXT(1, &FBOId); + if(AttachDepthStencil) + { + nglGenRenderbuffersEXT(1, &DepthFBOId); + if(UsePackedDepthStencil) + StencilFBOId = DepthFBOId; + else + nglGenRenderbuffersEXT(1, &StencilFBOId); + } + + //nldebug("3D: using depth %d and stencil %d", DepthFBOId, StencilFBOId); + + // initialize FBO + nglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBOId); + nglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, TextureMode, ID, 0); + + // attach depth/stencil render to FBO + // note: for some still unkown reason it's impossible to add + // a stencil buffer as shown in the respective docs (see + // opengl.org extension registry). Until a safe approach to add + // them is found, there will be no attached stencil for the time + // being, aside of using packed depth+stencil buffers. + if(AttachDepthStencil) + { + if(UsePackedDepthStencil) + { + //nldebug("3D: using packed depth stencil"); + nglBindRenderbufferEXT(GL_RENDERBUFFER_EXT, StencilFBOId); + nglRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH24_STENCIL8_EXT, tex->getWidth(), tex->getHeight()); + } + else + { + nglBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthFBOId); + nglRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, tex->getWidth(), tex->getHeight()); + /* + nglBindRenderbufferEXT(GL_RENDERBUFFER_EXT, StencilFBOId); + nglRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX8_EXT, tex->getWidth(), tex->getHeight()); + */ + } + nglFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, + GL_RENDERBUFFER_EXT, DepthFBOId); + nldebug("3D: glFramebufferRenderbufferExt(depth:24) = %X", nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)); + nglFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, + GL_RENDERBUFFER_EXT, StencilFBOId); + nldebug("3D: glFramebufferRenderbufferExt(stencil:8) = %X", nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)); + } +#endif + + // check status + GLenum status; +#ifdef USE_OPENGLES + status = (GLenum) nglCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES); +#else + status = (GLenum) nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); +#endif + switch(status) { +#ifdef GL_FRAMEBUFFER_COMPLETE_EXT + case GL_FRAMEBUFFER_COMPLETE_EXT: + InitFBO = true; + break; +#endif +#ifdef GL_FRAMEBUFFER_COMPLETE_OES + case GL_FRAMEBUFFER_COMPLETE_OES: + InitFBO = true; + break; +#endif +#ifdef GL_FRAMEBUFFER_UNSUPPORTED_EXT + case GL_FRAMEBUFFER_UNSUPPORTED_EXT: + nlwarning("Unsupported framebuffer format"); + break; +#endif +#ifdef GL_FRAMEBUFFER_UNSUPPORTED_OES + case GL_FRAMEBUFFER_UNSUPPORTED_OES: + nlwarning("Unsupported framebuffer format"); + break; +#endif +#ifdef GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT + case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT: + nlwarning("Framebuffer incomplete attachment"); + break; +#endif +#ifdef GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES + case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES: + nlwarning("Framebuffer incomplete attachment"); + break; +#endif +#ifdef GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT + case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT: + nlwarning("Framebuffer incomplete, missing attachment"); + break; +#endif +#ifdef GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES + case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES: + nlwarning("Framebuffer incomplete, missing attachment"); + break; +#endif +#ifdef GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT + case GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT: + nlwarning("Framebuffer incomplete, duplicate attachment"); + break; +#endif +#ifdef GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT + case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT: + nlwarning("Framebuffer incomplete, attached images must have same dimensions"); + break; +#endif +#ifdef GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES + case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES: + nlwarning("Framebuffer incomplete, attached images must have same dimensions"); + break; +#endif +#ifdef GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT + case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT: + nlwarning("Framebuffer incomplete, attached images must have same format"); + break; +#endif +#ifdef GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES + case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES: + nlwarning("Framebuffer incomplete, attached images must have same format"); + break; +#endif +#ifdef GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT + case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT: + nlwarning("Framebuffer incomplete, missing draw buffer"); + break; +#endif +#ifdef GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT + case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT: + nlwarning("Framebuffer incomplete, missing read buffer"); + break; +#endif +#ifdef GL_FRAMEBUFFER_BINDING_EXT + case GL_FRAMEBUFFER_BINDING_EXT: + nlwarning("Framebuffer BINDING_EXT"); + break; +#endif +#ifdef GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE + case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: + nlwarning("Framebuffer incomplete multisample"); + break; +#endif +#ifdef GL_FRAMEBUFFER_BINDING_OES + case GL_FRAMEBUFFER_BINDING_OES: + nlwarning("Framebuffer BINDING_EXT"); + break; +#endif + default: + nlwarning("Framebuffer incomplete status %d", (sint)status); + //nlassert(0); + } + + // clean up resources if allocation failed + if (!InitFBO) + { +#ifdef USE_OPENGLES + nglDeleteFramebuffersOES(1, &FBOId); +#else + nglDeleteFramebuffersEXT(1, &FBOId); +#endif + if (AttachDepthStencil) + { +#ifdef USE_OPENGLES + nglDeleteRenderbuffersOES(1, &DepthFBOId); +#else + nglDeleteRenderbuffersEXT(1, &DepthFBOId); +#endif + if(!UsePackedDepthStencil) +#ifdef USE_OPENGLES + nglDeleteRenderbuffersOES(1, &StencilFBOId); +#else + nglDeleteRenderbuffersEXT(1, &StencilFBOId); +#endif + } + } + + } + + return InitFBO; +} + +// *************************************************************************** +bool CTextureDrvInfosGL::activeFrameBufferObject(ITexture * tex) +{ + if(tex) + { + if(initFrameBufferObject(tex)) + { + glBindTexture(TextureMode, 0); +#ifdef USE_OPENGLES + nglBindFramebufferOES(GL_FRAMEBUFFER_OES, FBOId); +#else + nglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBOId); +#endif + } + else + return false; + } + else + { +#ifdef USE_OPENGLES + nglBindFramebufferOES(GL_FRAMEBUFFER_OES, 0); +#else + nglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); +#endif + } + + return true; +} + +// *************************************************************************** +// Get the glText mirror of an existing setuped texture. +static inline CTextureDrvInfosGL* getTextureGl(ITexture& tex) +{ + H_AUTO_OGL(getTextureGl) + CTextureDrvInfosGL* gltex; + gltex= (CTextureDrvInfosGL*)(ITextureDrvInfos*)(tex.TextureDrvShare->DrvTexture); + return gltex; +} + +// *************************************************************************** +// Translation of TexFmt mode. +GLint CDriverGL::getGlTextureFormat(ITexture& tex, bool &compressed) +{ + H_AUTO_OGL(CDriverGL_getGlTextureFormat) + ITexture::TUploadFormat texfmt= tex.getUploadFormat(); + + // If auto, retrieve the pixel format of the bitmap. + if(texfmt== ITexture::Auto) + { + switch(tex.getPixelFormat()) + { + case CBitmap::RGBA: + if(_ForceDXTCCompression && tex.allowDegradation() ) + texfmt= ITexture::DXTC5; + else + texfmt= ITexture::RGBA8888; + break; + case CBitmap::DXTC1: texfmt= ITexture::DXTC1; break; + case CBitmap::DXTC1Alpha: texfmt= ITexture::DXTC1Alpha; break; + case CBitmap::DXTC3: texfmt= ITexture::DXTC3; break; + case CBitmap::DXTC5: texfmt= ITexture::DXTC5; break; + case CBitmap::Luminance: texfmt= ITexture::Luminance; break; + case CBitmap::Alpha: texfmt= ITexture::Alpha; break; + case CBitmap::AlphaLuminance: texfmt= ITexture::AlphaLuminance; break; + case CBitmap::DsDt: texfmt= ITexture::DsDt; break; + default: texfmt= ITexture::RGBA8888; break; + } + } + + // Get gl tex format, try S3TC compressed ones. + if(_Extensions.EXTTextureCompressionS3TC) + { + compressed= true; + // Try Compressed ones. + switch(texfmt) + { +#ifdef GL_COMPRESSED_RGB_S3TC_DXT1_EXT + case ITexture::DXTC1: return GL_COMPRESSED_RGB_S3TC_DXT1_EXT; +#endif +#ifdef GL_COMPRESSED_RGBA_S3TC_DXT1_EXT + case ITexture::DXTC1Alpha: return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; +#endif +#ifdef GL_COMPRESSED_RGBA_S3TC_DXT3_EXT + case ITexture::DXTC3: return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; +#endif +#ifdef GL_COMPRESSED_RGBA_S3TC_DXT5_EXT + case ITexture::DXTC5: return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; +#endif + default: break; + } + } + + // Get standard gl tex format. + compressed= false; + switch(texfmt) + { +#ifdef USE_OPENGLES + case ITexture::RGBA8888: return GL_RGBA; +// case ITexture::RGBA4444: return GL_RGBA4_OES; +// case ITexture::RGBA5551: return GL_RGB5_A1_OES; + case ITexture::RGB888: return GL_RGB; +// case ITexture::RGB565: return GL_RGB5_OES; + case ITexture::Luminance: return GL_LUMINANCE; + case ITexture::Alpha: return GL_ALPHA; + case ITexture::AlphaLuminance: return GL_LUMINANCE_ALPHA; +#else + case ITexture::RGBA8888: return GL_RGBA8; + case ITexture::RGBA4444: return GL_RGBA4; + case ITexture::RGBA5551: return GL_RGB5_A1; + case ITexture::RGB888: return GL_RGB8; + case ITexture::RGB565: return GL_RGB5; + case ITexture::Luminance: return GL_LUMINANCE8; + case ITexture::Alpha: return GL_ALPHA8; + case ITexture::AlphaLuminance: return GL_LUMINANCE8_ALPHA8; + case ITexture::DsDt: + if (_Extensions.NVTextureShader) return GL_DSDT_NV; + else if (_Extensions.ATIEnvMapBumpMap || _Extensions.ATIFragmentShader) + { + return GL_DU8DV8_ATI; + } + else + { + nlassert(0); + return 0; + } + break; +#endif + default: + break; + } + +#ifdef USE_OPENGLES + return GL_RGBA; +#else + return GL_RGBA8; +#endif +} + +// *************************************************************************** +static GLint getGlSrcTextureFormat(ITexture &tex, GLint glfmt) +{ + H_AUTO_OGL(getGlSrcTextureFormat) + + // Is destination format is alpha or lumiance ? +#ifdef USE_OPENGLES + if ((glfmt==GL_ALPHA)||(glfmt==GL_LUMINANCE_ALPHA)||(glfmt==GL_LUMINANCE)) +#else + if ((glfmt==GL_ALPHA8)||(glfmt==GL_LUMINANCE8_ALPHA8)||(glfmt==GL_LUMINANCE8)) +#endif + { + switch(tex.getPixelFormat()) + { + case CBitmap::Alpha: return GL_ALPHA; + case CBitmap::AlphaLuminance: return GL_LUMINANCE_ALPHA; + case CBitmap::Luminance: return GL_LUMINANCE; + default: break; + } + } + +#ifndef USE_OPENGLES + if (glfmt == GL_DSDT_NV) + { + return GL_DSDT_NV; + } + + if (glfmt == GL_DU8DV8_ATI) + { + return GL_DUDV_ATI; + } +#endif + + // Else, not a Src format for upload, or RGBA. + return GL_RGBA; +} + +// *************************************************************************** +static GLenum getGlSrcTextureComponentType(GLint texSrcFormat) +{ + H_AUTO_OGL(getGlSrcTextureComponentType); + +#ifndef USE_OPENGLES + switch (texSrcFormat) + { + case GL_DSDT_NV: + case GL_DUDV_ATI: + return GL_BYTE; // these are signed format + break; + default: + break; + } +#endif + + return GL_UNSIGNED_BYTE; +} + +// *************************************************************************** +uint CDriverGL::computeMipMapMemoryUsage(uint w, uint h, GLint glfmt) const +{ + H_AUTO_OGL(CDriverGL_computeMipMapMemoryUsage) + switch(glfmt) + { +#ifdef GL_RGBA8 + case GL_RGBA8: return w*h* 4; +#endif +#ifdef GL_RGBA + case GL_RGBA: return w*h* 4; +#endif + // Well this is ugly, but simple :). GeForce 888 is stored as 32 bits. +#ifdef GL_RGB8 + case GL_RGB8: return w*h* 4; +#endif +#ifdef GL_RGB + case GL_RGB: return w*h* 4; +#endif +#ifdef GL_RGBA4 + case GL_RGBA4: return w*h* 2; +#endif +#ifdef GL_RGB5_A1 + case GL_RGB5_A1: return w*h* 2; +#endif +#ifdef GL_RGB5 + case GL_RGB5: return w*h* 2; +#endif +#ifdef GL_LUMINANCE8 + case GL_LUMINANCE8: return w*h* 1; +#endif +#ifdef GL_LUMINANCE + case GL_LUMINANCE: return w*h* 1; +#endif +#ifdef GL_ALPHA8 + case GL_ALPHA8: return w*h* 1; +#endif +#ifdef GL_ALPHA + case GL_ALPHA: return w*h* 1; +#endif +#ifdef GL_LUMINANCE8_ALPHA8 + case GL_LUMINANCE8_ALPHA8: return w*h* 2; +#endif +#ifdef GL_LUMINANCE_ALPHA + case GL_LUMINANCE_ALPHA: return w*h* 2; +#endif +#ifdef GL_COMPRESSED_RGB_S3TC_DXT1_EXT + case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: return w*h /2; +#endif +#ifdef GL_COMPRESSED_RGBA_S3TC_DXT1_EXT + case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: return w*h /2; +#endif +#ifdef GL_COMPRESSED_RGBA_S3TC_DXT3_EXT + case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: return w*h* 1; +#endif +#ifdef GL_COMPRESSED_RGBA_S3TC_DXT5_EXT + case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: return w*h* 1; +#endif +#ifdef GL_DU8DV8_ATI + case GL_DU8DV8_ATI: +#endif +#ifdef GL_DSDT_NV + case GL_DSDT_NV: return w*h* 2; +#endif + } + + // One format has not been coded. + nlstop; + + /// ??? + return w*h* 4; +} + +// *************************************************************************** +// Translation of Wrap mode. +static inline GLenum translateWrapToGl(ITexture::TWrapMode mode, const CGlExtensions &extensions) +{ + H_AUTO_OGL(translateWrapToGl) + if(mode== ITexture::Repeat) + return GL_REPEAT; + +#ifdef USE_OPENGLES + return GL_CLAMP_TO_EDGE; +#else + if(extensions.Version1_2) + return GL_CLAMP_TO_EDGE; + + return GL_CLAMP; +#endif +} + +// *************************************************************************** +static inline GLenum translateMagFilterToGl(CTextureDrvInfosGL *glText) +{ + H_AUTO_OGL(translateMagFilterToGl) +#ifdef NEL_FORCE_NEAREST + return GL_NEAREST; +#else // NEL_FORCE_NEAREST + switch(glText->MagFilter) + { + case ITexture::Linear: return GL_LINEAR; + case ITexture::Nearest: return GL_NEAREST; + default: break; + } + + nlstop; + return GL_LINEAR; +#endif // NEL_FORCE_NEAREST +} + + +// *************************************************************************** +static inline GLenum translateMinFilterToGl(CTextureDrvInfosGL *glText) +{ + H_AUTO_OGL(translateMinFilterToGl) +#ifdef NEL_FORCE_NEAREST + return GL_NEAREST; +#else // NEL_FORCE_NEAREST + + if(glText->MipMap) + { + switch(glText->MinFilter) + { + case ITexture::NearestMipMapOff: return GL_NEAREST; + case ITexture::NearestMipMapNearest: return GL_NEAREST_MIPMAP_NEAREST; + case ITexture::NearestMipMapLinear: return GL_NEAREST_MIPMAP_LINEAR; + case ITexture::LinearMipMapOff: return GL_LINEAR; + case ITexture::LinearMipMapNearest: return GL_LINEAR_MIPMAP_NEAREST; + case ITexture::LinearMipMapLinear: return GL_LINEAR_MIPMAP_LINEAR; + default: break; + } + } + else + { + switch(glText->MinFilter) + { + case ITexture::NearestMipMapOff: + case ITexture::NearestMipMapNearest: + case ITexture::NearestMipMapLinear: + return GL_NEAREST; + case ITexture::LinearMipMapOff: + case ITexture::LinearMipMapNearest: + case ITexture::LinearMipMapLinear: + return GL_LINEAR; + default: break; + } + } + + nlstop; + return GL_LINEAR; +#endif // NEL_FORCE_NEAREST +} + +// *************************************************************************** +static inline bool sameDXTCFormat(ITexture &tex, GLint glfmt) +{ + H_AUTO_OGL(sameDXTCFormat); + +#ifdef GL_COMPRESSED_RGB_S3TC_DXT1_EXT + if(glfmt==GL_COMPRESSED_RGB_S3TC_DXT1_EXT && tex.PixelFormat==CBitmap::DXTC1) + return true; +#endif + +#ifdef GL_COMPRESSED_RGBA_S3TC_DXT1_EXT + if(glfmt==GL_COMPRESSED_RGBA_S3TC_DXT1_EXT && tex.PixelFormat==CBitmap::DXTC1Alpha) + return true; +#endif + +#ifdef GL_COMPRESSED_RGBA_S3TC_DXT3_EXT + if(glfmt==GL_COMPRESSED_RGBA_S3TC_DXT3_EXT && tex.PixelFormat==CBitmap::DXTC3) + return true; +#endif + +#ifdef GL_COMPRESSED_RGBA_S3TC_DXT5_EXT + if(glfmt==GL_COMPRESSED_RGBA_S3TC_DXT5_EXT && tex.PixelFormat==CBitmap::DXTC5) + return true; +#endif + + return false; +} + +// *************************************************************************** +static inline bool isDXTCFormat(GLint glfmt) +{ + H_AUTO_OGL(isDXTCFormat); + +#ifdef GL_COMPRESSED_RGB_S3TC_DXT1_EXT + if(glfmt==GL_COMPRESSED_RGB_S3TC_DXT1_EXT) + return true; +#endif + +#ifdef GL_COMPRESSED_RGBA_S3TC_DXT1_EXT + if(glfmt==GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) + return true; +#endif + +#ifdef GL_COMPRESSED_RGBA_S3TC_DXT3_EXT + if(glfmt==GL_COMPRESSED_RGBA_S3TC_DXT3_EXT) + return true; +#endif + +#ifdef GL_COMPRESSED_RGBA_S3TC_DXT5_EXT + if(glfmt==GL_COMPRESSED_RGBA_S3TC_DXT5_EXT) + return true; +#endif + + return false; +} + +// *************************************************************************** +bool CDriverGL::setupTexture (ITexture& tex) +{ + H_AUTO_OGL(setupTexture) + bool nTmp; + return setupTextureEx (tex, true, nTmp); +} + +// *************************************************************************** +#ifndef NL_DEBUG + inline +#endif +void CDriverGL::bindTextureWithMode(ITexture &tex) +{ + CTextureDrvInfosGL* gltext; + gltext= getTextureGl(tex); + // system of "backup the previous binded texture" seems to not work with some drivers.... + _DriverGLStates.activeTextureARB(0); + if(tex.isTextureCube()) + { + if (_Extensions.ARBTextureCubeMap) + { + _DriverGLStates.setTextureMode(CDriverGLStates::TextureCubeMap); + // Bind this texture + glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID); + } + } + else + { + CDriverGLStates::TTextureMode textureMode= CDriverGLStates::Texture2D; +#ifndef USE_OPENGLES + if(gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV) + textureMode = CDriverGLStates::TextureRect; +#endif + + _DriverGLStates.setTextureMode(textureMode); + // Bind this texture + glBindTexture(gltext->TextureMode, gltext->ID); + } +} + +// *************************************************************************** +#ifndef NL_DEBUG + inline +#endif +void CDriverGL::setupTextureBasicParameters(ITexture &tex) +{ + CTextureDrvInfosGL* gltext; + gltext= getTextureGl(tex); + // TODO: possible cache here, but beware, this is called just after texture creation as well, so these fields + // haven't ever been filled. + gltext->WrapS= tex.getWrapS(); + gltext->WrapT= tex.getWrapT(); + gltext->MagFilter= tex.getMagFilter(); + gltext->MinFilter= tex.getMinFilter(); + if(tex.isTextureCube()) + { + if (_Extensions.ARBTextureCubeMap) + { + glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_WRAP_S, translateWrapToGl(ITexture::Clamp, _Extensions)); + glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_WRAP_T, translateWrapToGl(ITexture::Clamp, _Extensions)); +#ifndef USE_OPENGLES + glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_WRAP_R, translateWrapToGl(ITexture::Clamp, _Extensions)); +#endif + glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext)); + glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext)); + + if (_AnisotropicFilter > 1.f && gltext->MinFilter > ITexture::NearestMipMapLinear) + glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAX_ANISOTROPY_EXT, _AnisotropicFilter); + } + } + else + { + glTexParameteri(gltext->TextureMode,GL_TEXTURE_WRAP_S, translateWrapToGl(gltext->WrapS, _Extensions)); + glTexParameteri(gltext->TextureMode,GL_TEXTURE_WRAP_T, translateWrapToGl(gltext->WrapT, _Extensions)); + glTexParameteri(gltext->TextureMode,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext)); + glTexParameteri(gltext->TextureMode,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext)); + + if (_AnisotropicFilter > 1.f && gltext->MinFilter > ITexture::NearestMipMapLinear) + glTexParameteri(gltext->TextureMode, GL_TEXTURE_MAX_ANISOTROPY_EXT, _AnisotropicFilter); + } + // + tex.clearFilterOrWrapModeTouched(); +} + +// *************************************************************************** +bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, bool bMustRecreateSharedTexture) +{ + H_AUTO_OGL(setupTextureEx) + //nldebug("3D: CDriverGL::setupTextureEx(%016p, %d, %d, %d)", &tex, bUpload, bAllUploaded, bMustRecreateSharedTexture); + bAllUploaded = false; + + if(tex.isTextureCube() && (!_Extensions.ARBTextureCubeMap)) + return true; + + // 0. Create/Retrieve the driver texture. + //======================================= + bool mustCreate = false; + if ( !tex.TextureDrvShare ) + { + //nldebug("3D: creating CTextureDrvShare()"); + // insert into driver list. (so it is deleted when driver is deleted). + ItTexDrvSharePtrList it= _TexDrvShares.insert(_TexDrvShares.end(), (NL3D::CTextureDrvShare*)NULL); + // create and set iterator, for future deletion. + *it= tex.TextureDrvShare= new CTextureDrvShare(this, it, &tex); + + // Must (re)-create the texture. + mustCreate = true; + } + + // Does the texture has been touched ? + if ( (!tex.touched()) && (!mustCreate) ) + { + // if wrap mode or filter mode is touched, update it here + if (tex.filterOrWrapModeTouched()) + { + activateTexture(0, NULL); // unbind any previous texture + bindTextureWithMode(tex); + // + setupTextureBasicParameters(tex); // setup what has changed (will reset the touch flag) + + // Disable texture 0 + _CurrentTexture[0]= NULL; + _CurrentTextureInfoGL[0]= NULL; + _DriverGLStates.setTextureMode(CDriverGLStates::TextureDisabled); + // + } + // + return true; // Do not do anything + } + + // 1. If modified, may (re)load texture part or all of the texture. + //================================================================= + + bool mustLoadAll= false; + bool mustLoadPart= false; + + // To avoid any delete/new ptr problem, disable all texturing. + /* If an old texture is deleted, _CurrentTexture[*] and _CurrentTextureInfoGL[*] are invalid. + But this is grave only if a new texture is created, with the same pointer (bad luck). + Since an newly allocated texture always pass here before use, we are sure to avoid any problems. + */ + for(uint stage = 0; stage < inlGetNumTextStages(); stage++) + { + activateTexture(stage, NULL); + } + + // A. Share mgt. + //============== + if(tex.supportSharing()) + { + // Try to get the shared texture. + + // Create the shared Name. + std::string name; + getTextureShareName (tex, name); + + // insert or get the texture. + { + CSynchronized::CAccessor access(&_SyncTexDrvInfos); + TTexDrvInfoPtrMap &rTexDrvInfos = access.value(); + + ItTexDrvInfoPtrMap itTex; + itTex= rTexDrvInfos.find(name); + + // texture not found? + if( itTex==rTexDrvInfos.end() ) + { + // insert into driver map. (so it is deleted when driver is deleted). + itTex= (rTexDrvInfos.insert(make_pair(name, (ITextureDrvInfos*)NULL))).first; + // create and set iterator, for future deletion. + itTex->second= tex.TextureDrvShare->DrvTexture = new CTextureDrvInfosGL(this, itTex, this, isTextureRectangle(&tex)); + + // need to load ALL this texture. + mustLoadAll= true; + } + else + { + tex.TextureDrvShare->DrvTexture= itTex->second; + + if(bMustRecreateSharedTexture) + // reload this shared texture (user request) + mustLoadAll= true; + else + // Do not need to reload this texture, even if the format/mipmap has changed, since we found this + // couple in the map. + mustLoadAll= false; + } + } + // Do not test if part of texture may need to be computed, because Rect invalidation is incompatible + // with texture sharing. + } + else + { + // If texture not already created. + if(!tex.TextureDrvShare->DrvTexture) + { + // Must create it. Create auto a GL id (in constructor). + // Do not insert into the map. This un-shared texture will be deleted at deletion of the texture. + // Inform ITextureDrvInfos by passing NULL _Driver. + tex.TextureDrvShare->DrvTexture = new CTextureDrvInfosGL(NULL, ItTexDrvInfoPtrMap(), this, isTextureRectangle(&tex)); + + // need to load ALL this texture. + mustLoadAll= true; + } + else if(tex.isAllInvalidated()) + mustLoadAll= true; + else if(tex.touched()) + mustLoadPart= true; + } + + // B. Setup texture. + //================== + if(mustLoadAll || mustLoadPart) + { + // system of "backup the previous binded texture" seems to not work with some drivers.... + bindTextureWithMode(tex); + + CTextureDrvInfosGL* gltext; + gltext= getTextureGl(tex); + + glPixelStorei(GL_UNPACK_ALIGNMENT,1); + + // a. Load All the texture case. + //============================== + if (mustLoadAll) + { + // profiling. sub old textre memory usage, and reset. + _AllocatedTextureMemory-= gltext->TextureMemory; + gltext->TextureMemory= 0; + + + if(tex.isTextureCube()) + { + CTextureCube *pTC = NLMISC::safe_cast(&tex); + + // Regenerate all the texture. + tex.generate(); + + for(uint nText = 0; nText < 6; ++nText) + if(pTC->getTexture((CTextureCube::TFace)nText) != NULL) + { + ITexture *pTInTC = pTC->getTexture((CTextureCube::TFace)nText); + + // In open GL, we have to flip the faces of the cube map + if( ((CTextureCube::TFace)nText) == CTextureCube::positive_x ) + pTInTC->flipH(); + if( ((CTextureCube::TFace)nText) == CTextureCube::negative_x ) + pTInTC->flipH(); + if( ((CTextureCube::TFace)nText) == CTextureCube::positive_y ) + pTInTC->flipH(); + if( ((CTextureCube::TFace)nText) == CTextureCube::negative_y ) + pTInTC->flipH(); + if( ((CTextureCube::TFace)nText) == CTextureCube::positive_z ) + pTInTC->flipV(); + if( ((CTextureCube::TFace)nText) == CTextureCube::negative_z ) + pTInTC->flipV(); + + // Get the correct texture format from texture... + GLint glfmt= getGlTextureFormat(*pTInTC, gltext->Compressed); + GLint glSrcFmt= getGlSrcTextureFormat(*pTInTC, glfmt); + GLenum glSrcType= getGlSrcTextureComponentType(glSrcFmt); + + sint nMipMaps; + if(glSrcFmt==GL_RGBA && pTInTC->getPixelFormat()!=CBitmap::RGBA ) + pTInTC->convertToType(CBitmap::RGBA); + if(tex.mipMapOn()) + { + pTInTC->buildMipMaps(); + nMipMaps= pTInTC->getMipMapCount(); + } + else + nMipMaps= 1; + + // MipMap upload? + gltext->MipMap= nMipMaps>1; + + // Fill mipmaps. + for(sint i=0;igetPixels(i).getPtr(); + uint w= pTInTC->getWidth(i); + uint h= pTInTC->getHeight(i); + if (bUpload) + { + NEL_MEASURE_UPLOAD_TIME_START + glTexImage2D (NLCubeFaceToGLCubeFace[nText], i, glfmt, w, h, 0, glSrcFmt, glSrcType, ptr); + bAllUploaded = true; + NEL_MEASURE_UPLOAD_TIME_END + } + else + { + NEL_MEASURE_UPLOAD_TIME_START + glTexImage2D (NLCubeFaceToGLCubeFace[nText], i, glfmt, w, h, 0, glSrcFmt, glSrcType, NULL); + NEL_MEASURE_UPLOAD_TIME_END + } + // profiling: count TextureMemory usage. + gltext->TextureMemory+= computeMipMapMemoryUsage(w, h, glfmt); + } + } + } + else + { + // Regenerate all the texture. + tex.generate(); + + if(tex.getSize()>0) + { + // Get the correct texture format from texture... + GLint glfmt= getGlTextureFormat(tex, gltext->Compressed); + GLint glSrcFmt= getGlSrcTextureFormat(tex, glfmt); + GLenum glSrcType= getGlSrcTextureComponentType(glSrcFmt); + + // DXTC: if same format, and same mipmapOn/Off, use glTexCompressedImage*. + // We cannot build the mipmaps if they are not here. + if(_Extensions.EXTTextureCompressionS3TC && sameDXTCFormat(tex, glfmt)) + { + sint nMipMaps = 1; + + if(tex.mipMapOn()) + nMipMaps= tex.getMipMapCount(); + + // MipMap upload? + gltext->MipMap= nMipMaps>1; + + // Degradation in Size allowed only if DXTC texture are provided with mipmaps. + // Because use them to resize !!! + uint decalMipMapResize= 0; + if(_ForceTextureResizePower>0 && tex.allowDegradation() && nMipMaps>1) + { + decalMipMapResize= min(_ForceTextureResizePower, (uint)(nMipMaps-1)); + } + + // Fill mipmaps. + for(sint i=decalMipMapResize;iTextureMode, i-decalMipMapResize, glfmt, tex.getWidth(i), tex.getHeight(i), + 0, glSrcFmt, glSrcType, NULL); + NEL_MEASURE_UPLOAD_TIME_END + } + + // profiling: count TextureMemory usage. + gltext->TextureMemory+= tex.getPixels(i).size(); + } + } + else + { + sint nMipMaps; + if(glSrcFmt==GL_RGBA && tex.getPixelFormat()!=CBitmap::RGBA ) + { + bUpload = true; // Force all upload + tex.convertToType(CBitmap::RGBA); + } + + // Degradation in Size. + if(_ForceTextureResizePower>0 && tex.allowDegradation()) + { + uint w= tex.getWidth(0) >> _ForceTextureResizePower; + uint h= tex.getHeight(0) >> _ForceTextureResizePower; + w= max(1U, w); + h= max(1U, h); + tex.resample(w, h); + } + + if(tex.mipMapOn()) + { + tex.buildMipMaps(); + nMipMaps= tex.getMipMapCount(); + } + else + nMipMaps= 1; + + // MipMap upload? + gltext->MipMap= nMipMaps>1; + + // Fill mipmaps. + for(sint i=0;iTextureMode, i, glfmt, w, h, 0,glSrcFmt, glSrcType, ptr); + NEL_MEASURE_UPLOAD_TIME_END + bAllUploaded = true; + } + else + { + NEL_MEASURE_UPLOAD_TIME_START + glTexImage2D (gltext->TextureMode, i, glfmt, w, h, 0,glSrcFmt, glSrcType, NULL); + NEL_MEASURE_UPLOAD_TIME_END + } + // profiling: count TextureMemory usage. + gltext->TextureMemory += computeMipMapMemoryUsage (w, h, glfmt); + } + } + } + } + //printf("%d,%d,%d\n", tex.getMipMapCount(), tex.getWidth(0), tex.getHeight(0)); + + // profiling. add new TextureMemory usage. + _AllocatedTextureMemory+= gltext->TextureMemory; + } + // b. Load part of the texture case. + //================================== + // Replace parts of a compressed image. Maybe don't work with the actual system of invalidateRect()... + else if (mustLoadPart && !gltext->Compressed) + { + // Regenerate wanted part of the texture. + tex.generate(); + + if(tex.getSize()>0) + { + // Get the correct texture format from texture... + //=============================================== + bool dummy; + GLint glfmt= getGlTextureFormat(tex, dummy); + GLint glSrcFmt= getGlSrcTextureFormat(tex, glfmt); + GLenum glSrcType= getGlSrcTextureComponentType(glSrcFmt); + + sint nMipMaps; + if(glSrcFmt==GL_RGBA && tex.getPixelFormat()!=CBitmap::RGBA ) + tex.convertToType(CBitmap::RGBA); + if(tex.mipMapOn()) + { + bool hadMipMap= tex.getMipMapCount()>1; + tex.buildMipMaps(); + nMipMaps= tex.getMipMapCount(); + // If the texture had no mipmap before, release them. + if(!hadMipMap) + { + tex.releaseMipMaps(); + } + } + else + nMipMaps= 1; + + // For all rect, update the texture/mipmap. + //=============================================== + list::iterator itRect; + for(itRect=tex._ListInvalidRect.begin(); itRect!=tex._ListInvalidRect.end(); itRect++) + { + CRect &rect= *itRect; + sint x0= rect.X; + sint y0= rect.Y; + sint x1= rect.X+rect.Width; + sint y1= rect.Y+rect.Height; + + // Fill mipmaps. + for(sint i=0;iDrvTexture == NULL) + return false; // Texture not created + if (tex.isTextureCube()) + return false; + + nlassert(nNumMipMap<(uint8)tex.getMipMapCount()); + + // validate rect. + sint x0 = rect.X; + sint y0 = rect.Y; + sint x1 = rect.X+rect.Width; + sint y1 = rect.Y+rect.Height; + sint w = tex.getWidth (nNumMipMap); + sint h = tex.getHeight (nNumMipMap); + clamp (x0, 0, w); + clamp (y0, 0, h); + clamp (x1, x0, w); + clamp (y1, y0, h); + + // bind the texture to upload + CTextureDrvInfosGL* gltext; + gltext = getTextureGl (tex); + + // system of "backup the previous binded texture" seems to not work with some drivers.... + _DriverGLStates.activeTextureARB (0); + CDriverGLStates::TTextureMode textureMode= CDriverGLStates::Texture2D; + +#ifndef USE_OPENGLES + if(gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV) + textureMode = CDriverGLStates::TextureRect; +#endif + + _DriverGLStates.setTextureMode (textureMode); + // Bind this texture, for reload... + glBindTexture (gltext->TextureMode, gltext->ID); + + glPixelStorei (GL_UNPACK_ALIGNMENT, 1); + + bool dummy; + GLint glfmt = getGlTextureFormat (tex, dummy); + GLint glSrcFmt = getGlSrcTextureFormat (tex, glfmt); + GLenum glSrcType= getGlSrcTextureComponentType(glSrcFmt); + + // If DXTC format + if (_Extensions.EXTTextureCompressionS3TC && sameDXTCFormat(tex, glfmt)) + { + + sint nUploadMipMaps; + if (tex.mipMapOn()) + nUploadMipMaps = tex.getMipMapCount(); + else + nUploadMipMaps = 1; + + uint decalMipMapResize = 0; + if (_ForceTextureResizePower>0 && tex.allowDegradation() && nUploadMipMaps>1) + { + decalMipMapResize = min(_ForceTextureResizePower, (uint)(nUploadMipMaps-1)); + } + + // Compute src compressed size and location + sint imageSize = (x1-x0)*(y1-y0); + void *ptr = tex.getPixels(nNumMipMap).getPtr(); + + // If DXTC1 or DXTC1A, then 4 bits/texel else 8 bits/texel + if (glfmt == GL_COMPRESSED_RGB_S3TC_DXT1_EXT || glfmt == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) + { + imageSize /= 2; + ptr = (uint8*)ptr + y0*w/2 + x0/2; + } + else + { + ptr = (uint8*)ptr + y0*w + x0; + } + + // Upload + + if (decalMipMapResize > nNumMipMap) + { + _CurrentTexture[0]= NULL; + _CurrentTextureInfoGL[0]= NULL; + _DriverGLStates.setTextureMode (CDriverGLStates::TextureDisabled); + return false; + } + + nlassert (((x0&3) == 0) && ((y0&3) == 0)); + if ((w>=4) && (h>=4)) + { +#ifdef USE_OPENGLES + glCompressedTexSubImage2D ( +#else + nglCompressedTexSubImage2DARB ( +#endif + GL_TEXTURE_2D, nNumMipMap-decalMipMapResize, + x0, y0, (x1-x0), (y1-y0), glfmt, imageSize, ptr ); + } + else + { + // The CompressedTexSubImage2DARB function do not work properly if width or height + // of the mipmap is less than 4 pixel so we use the other form. (its not really time critical + // to upload 16 bytes so we can do it twice if texture is cut) + imageSize = tex.getPixels(nNumMipMap).size(); +#ifdef USE_OPENGLES + glCompressedTexImage2D ( +#else + nglCompressedTexImage2DARB ( +#endif + GL_TEXTURE_2D, nNumMipMap-decalMipMapResize, + glfmt, w, h, 0, imageSize, ptr); + } + } + else + { + // glSrcFmt and ITexture format must be identical + nlassert (glSrcFmt!=GL_RGBA || tex.getPixelFormat()==CBitmap::RGBA); + + void *ptr= tex.getPixels(nNumMipMap).getPtr(); + +#ifdef USE_OPENGLES + sint pixelSize = 4; + + if (glSrcFmt == GL_ALPHA) + pixelSize = 1; + + for(sint yy = 0; yy < (y1-y0); yy++) + { + char *row = (char*)ptr + ((yy + y0)*w + x0) * pixelSize; + glTexSubImage2D (GL_TEXTURE_2D, nNumMipMap, x0, y0+yy, x1-x0, 1, glSrcFmt, glSrcType, row ); + } + + // Reset the transfer mode... +// glPixelStorei (GL_UNPACK_ALIGNMENT, 0); +#else + glPixelStorei (GL_UNPACK_ROW_LENGTH, w); + glPixelStorei (GL_UNPACK_SKIP_ROWS, y0); + glPixelStorei (GL_UNPACK_SKIP_PIXELS, x0); + glTexSubImage2D (GL_TEXTURE_2D, nNumMipMap, x0, y0, x1-x0, y1-y0, glSrcFmt,glSrcType, ptr); + + // Reset the transfer mode... + glPixelStorei (GL_UNPACK_ROW_LENGTH, 0); + glPixelStorei (GL_UNPACK_SKIP_ROWS, 0); + glPixelStorei (GL_UNPACK_SKIP_PIXELS, 0); +#endif + } + + // Disable texture 0 + _CurrentTexture[0]= NULL; + _CurrentTextureInfoGL[0]= NULL; + _DriverGLStates.setTextureMode (CDriverGLStates::TextureDisabled); + + return true; +} + +// *************************************************************************** +bool CDriverGL::uploadTextureCube (ITexture& tex, CRect& /* rect */, uint8 /* nNumMipMap */, uint8 /* nNumFace */) +{ + H_AUTO_OGL(uploadTextureCube) + if (tex.TextureDrvShare == NULL) + return false; // Texture not created + if (!tex.isTextureCube()) + return false; + + return true; +} + +// *************************************************************************** +bool CDriverGL::activateTexture(uint stage, ITexture *tex) +{ + H_AUTO_OGL(activateTexture) + if (this->_CurrentTexture[stage]!=tex) + { + _DriverGLStates.activeTextureARB(stage); + if(tex && tex->TextureDrvShare) + { + // get the drv info. should be not NULL. + CTextureDrvInfosGL* gltext; + gltext= getTextureGl(*tex); + + // Profile, log the use of this texture + //========================================= + if (_SumTextureMemoryUsed) + { + // Insert the pointer of this texture + _TextureUsed.insert (gltext); + } + + if(tex->isTextureCube()) + { + // setup texture mode, after activeTextureARB() + _DriverGLStates.setTextureMode(CDriverGLStates::TextureCubeMap); + + if(_Extensions.ARBTextureCubeMap) + { + // Activate texturing... + //====================== + + // If the shared texture is the same than before, no op. + if(_CurrentTextureInfoGL[stage] != gltext) + { + // Cache setup. + _CurrentTextureInfoGL[stage]= gltext; + + // setup this texture + glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID); + + // Change parameters of texture, if necessary. + //============================================ + if(gltext->MagFilter!= tex->getMagFilter()) + { + gltext->MagFilter= tex->getMagFilter(); + glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext)); + } + if(gltext->MinFilter!= tex->getMinFilter()) + { + gltext->MinFilter= tex->getMinFilter(); + glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext)); + } + } + } + } + else + { + // setup texture mode, after activeTextureARB() + CDriverGLStates::TTextureMode textureMode= CDriverGLStates::Texture2D; +#ifndef USE_OPENGLES + if(gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV) + textureMode = CDriverGLStates::TextureRect; +#endif + _DriverGLStates.setTextureMode(/*CDriverGLStates::Texture2D*/textureMode); + + // Activate texture... + //====================== + + // If the shared texture is the same than before, no op. + if(_CurrentTextureInfoGL[stage] != gltext) + { + // Cache setup. + _CurrentTextureInfoGL[stage]= gltext; + + // setup this texture + glBindTexture(gltext->TextureMode, gltext->ID); + + + // Change parameters of texture, if necessary. + //============================================ + if(gltext->WrapS!= tex->getWrapS()) + { + gltext->WrapS= tex->getWrapS(); + glTexParameteri(gltext->TextureMode,GL_TEXTURE_WRAP_S, translateWrapToGl(gltext->WrapS, _Extensions)); + } + if(gltext->WrapT!= tex->getWrapT()) + { + gltext->WrapT= tex->getWrapT(); + glTexParameteri(gltext->TextureMode,GL_TEXTURE_WRAP_T, translateWrapToGl(gltext->WrapT, _Extensions)); + } + if(gltext->MagFilter!= tex->getMagFilter()) + { + gltext->MagFilter= tex->getMagFilter(); + glTexParameteri(gltext->TextureMode,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext)); + } + if(gltext->MinFilter!= tex->getMinFilter()) + { + gltext->MinFilter= tex->getMinFilter(); + glTexParameteri(gltext->TextureMode,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext)); + } + } + } + } + else + { + // Force no texturing for this stage. + _CurrentTextureInfoGL[stage]= NULL; + // setup texture mode, after activeTextureARB() + _DriverGLStates.setTextureMode(CDriverGLStates::TextureDisabled); + +#ifndef USE_OPENGLES + if (_Extensions.ATITextureEnvCombine3) + { + // very strange bug with ATI cards : when a texture is set to NULL at a stage, the stage is still active sometimes... + activateTexEnvMode(stage, _TexEnvReplace); // set the whole stage to replace fix the problem + } +#endif + } + + this->_CurrentTexture[stage]= tex; + } + + return true; +} + + +// This maps the CMaterial::TTexOperator +static const GLenum OperatorLUT[9]= { GL_REPLACE, GL_MODULATE, GL_ADD, GL_ADD_SIGNED_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_BUMP_ENVMAP_ATI }; + +// This maps the CMaterial::TTexSource +static const GLenum SourceLUT[4]= { GL_TEXTURE, GL_PREVIOUS_EXT, GL_PRIMARY_COLOR_EXT, GL_CONSTANT_EXT }; + +// This maps the CMaterial::TTexOperand +static const GLenum OperandLUT[4]= { GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA }; + +// This maps the CMaterial::TTexOperator, used for openGL Arg2 setup. +static const GLenum InterpolateSrcLUT[8]= { GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_PREVIOUS_EXT, GL_PRIMARY_COLOR_EXT, GL_CONSTANT_EXT }; + +#ifndef USE_OPENGLES + +// *************************************************************************** +// Set general tex env using ENV_COMBINE4 for the current setupped stage (used by forceActivateTexEnvMode) +static void forceActivateTexEnvModeEnvCombine4(const CMaterial::CTexEnv &env) +{ + H_AUTO_OGL(forceActivateTexEnvModeEnvCombine4); + + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE4_NV); + + //== RGB == + switch(env.Env.OpRGB) + { + case CMaterial::Replace: + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, SourceLUT[env.Env.SrcArg0RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, OperandLUT[env.Env.OpArg0RGB]); + // Arg1 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_ONE_MINUS_SRC_COLOR); + // Arg2 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_COLOR); + // Arg3 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_SRC_COLOR); + break; + case CMaterial::Add: + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, SourceLUT[env.Env.SrcArg0RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, OperandLUT[env.Env.OpArg0RGB]); + // Arg1 = 1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_ONE_MINUS_SRC_COLOR); + // Arg2 = env arg1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, SourceLUT[env.Env.SrcArg1RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, OperandLUT[env.Env.OpArg1RGB]); + // Arg3 = 1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_ONE_MINUS_SRC_COLOR); + break; + case CMaterial::AddSigned: + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD_SIGNED_EXT); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, SourceLUT[env.Env.SrcArg0RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, OperandLUT[env.Env.OpArg0RGB]); + // Arg1 = 1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_ONE_MINUS_SRC_COLOR); + // Arg2 = env arg1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, SourceLUT[env.Env.SrcArg1RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, OperandLUT[env.Env.OpArg1RGB]); + // Arg3 = 1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_ONE_MINUS_SRC_COLOR); + break; + case CMaterial::InterpolateTexture: + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, SourceLUT[env.Env.SrcArg0RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, OperandLUT[env.Env.OpArg0RGB]); + // Arg1 = (1 - texture) + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_TEXTURE); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_ONE_MINUS_SRC_ALPHA); + // Arg2 = env arg1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, SourceLUT[env.Env.SrcArg1RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, OperandLUT[env.Env.OpArg1RGB]); + // Arg3 = texture + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_TEXTURE); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_SRC_ALPHA); + break; + case CMaterial::InterpolatePrevious: + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, SourceLUT[env.Env.SrcArg0RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, OperandLUT[env.Env.OpArg0RGB]); + // Arg1 = (1 - previous) + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PREVIOUS_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_ONE_MINUS_SRC_ALPHA); + // Arg2 = env arg1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, SourceLUT[env.Env.SrcArg1RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, OperandLUT[env.Env.OpArg1RGB]); + // Arg3 = previous + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_PREVIOUS_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_SRC_ALPHA); + break; + case CMaterial::InterpolateDiffuse: + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, SourceLUT[env.Env.SrcArg0RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, OperandLUT[env.Env.OpArg0RGB]); + // Arg1 = (1 - diffuse) + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PRIMARY_COLOR_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_ONE_MINUS_SRC_ALPHA); + // Arg2 = env arg1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, SourceLUT[env.Env.SrcArg1RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, OperandLUT[env.Env.OpArg1RGB]); + // Arg3 = diffuse + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_PRIMARY_COLOR_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_SRC_ALPHA); + break; + case CMaterial::InterpolateConstant: + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, SourceLUT[env.Env.SrcArg0RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, OperandLUT[env.Env.OpArg0RGB]); + // Arg1 = (1 - constant) + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_CONSTANT_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_ONE_MINUS_SRC_ALPHA); + // Arg2 = env arg1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, SourceLUT[env.Env.SrcArg1RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, OperandLUT[env.Env.OpArg1RGB]); + // Arg3 = constant + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_CONSTANT_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_SRC_ALPHA); + break; + case CMaterial::Mad: + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, SourceLUT[env.Env.SrcArg0RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, OperandLUT[env.Env.OpArg0RGB]); + // Arg1 = env arg1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, SourceLUT[env.Env.SrcArg1RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, OperandLUT[env.Env.OpArg1RGB]); + // Arg2 = env arg2 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, SourceLUT[env.Env.SrcArg2RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, OperandLUT[env.Env.OpArg2RGB]); + // Arg3 = 1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_ONE_MINUS_SRC_COLOR); + break; + default: + // default is modulate + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, SourceLUT[env.Env.SrcArg0RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, OperandLUT[env.Env.OpArg0RGB]); + // Arg1 = env arg1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, SourceLUT[env.Env.SrcArg1RGB]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, OperandLUT[env.Env.OpArg1RGB]); + // Arg2 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_COLOR); + // Arg3 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_SRC_COLOR); + break; + } + //== Alpha part == + switch(env.Env.OpAlpha) + { + case CMaterial::Replace: + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_ADD); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, SourceLUT[env.Env.SrcArg0Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, OperandLUT[env.Env.OpArg0Alpha]); + // Arg1 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_ONE_MINUS_SRC_ALPHA); + // Arg2 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_EXT, GL_SRC_ALPHA); + // Arg3 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_NV, GL_SRC_ALPHA); + break; + case CMaterial::Add: + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_ADD); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, SourceLUT[env.Env.SrcArg0Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, OperandLUT[env.Env.OpArg0Alpha]); + // Arg1 = 1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_ONE_MINUS_SRC_ALPHA); + // Arg2 = env arg1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_EXT, SourceLUT[env.Env.SrcArg1Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_EXT, OperandLUT[env.Env.OpArg1Alpha]); + // Arg3 = 1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_NV, GL_ONE_MINUS_SRC_ALPHA); + break; + case CMaterial::AddSigned: + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_ADD_SIGNED_EXT); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, SourceLUT[env.Env.SrcArg0Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, OperandLUT[env.Env.OpArg0Alpha]); + // Arg1 = 1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_ONE_MINUS_SRC_ALPHA); + // Arg2 = env arg1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_EXT, SourceLUT[env.Env.SrcArg1Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_EXT, OperandLUT[env.Env.OpArg1Alpha]); + // Arg3 = 1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_NV, GL_ONE_MINUS_SRC_ALPHA); + break; + case CMaterial::InterpolateTexture: + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_ADD); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, SourceLUT[env.Env.SrcArg0Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, OperandLUT[env.Env.OpArg0Alpha]); + // Arg1 = (1 - texture) + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_TEXTURE); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_ONE_MINUS_SRC_ALPHA); + // Arg2 = env arg1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_EXT, SourceLUT[env.Env.SrcArg1Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_EXT, OperandLUT[env.Env.OpArg1Alpha]); + // Arg3 = texture + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_NV, GL_TEXTURE); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_NV, GL_SRC_ALPHA); + break; + case CMaterial::InterpolatePrevious: + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_ADD); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, SourceLUT[env.Env.SrcArg0Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, OperandLUT[env.Env.OpArg0Alpha]); + // Arg1 = (1 - previous) + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_PREVIOUS_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_ONE_MINUS_SRC_ALPHA); + // Arg2 = env arg1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_EXT, SourceLUT[env.Env.SrcArg1Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_EXT, OperandLUT[env.Env.OpArg1Alpha]); + // Arg3 = previous + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_NV, GL_PREVIOUS_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_NV, GL_SRC_ALPHA); + break; + case CMaterial::InterpolateDiffuse: + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_ADD); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, SourceLUT[env.Env.SrcArg0Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, OperandLUT[env.Env.OpArg0Alpha]); + // Arg1 = (1 - diffuse) + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_PRIMARY_COLOR_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_ONE_MINUS_SRC_ALPHA); + // Arg2 = env arg1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_EXT, SourceLUT[env.Env.SrcArg1Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_EXT, OperandLUT[env.Env.OpArg1Alpha]); + // Arg3 = diffuse + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_NV, GL_PRIMARY_COLOR_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_NV, GL_SRC_ALPHA); + break; + case CMaterial::InterpolateConstant: + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_ADD); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, SourceLUT[env.Env.SrcArg0Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, OperandLUT[env.Env.OpArg0Alpha]); + // Arg1 = (1 - constant) + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_CONSTANT_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_ONE_MINUS_SRC_ALPHA); + // Arg2 = env arg1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_EXT, SourceLUT[env.Env.SrcArg1Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_EXT, OperandLUT[env.Env.OpArg1Alpha]); + // Arg3 = constant + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_NV, GL_CONSTANT_EXT); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_NV, GL_SRC_ALPHA); + break; + case CMaterial::Mad: + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_ADD); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, SourceLUT[env.Env.SrcArg0Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, OperandLUT[env.Env.OpArg0Alpha]); + // Arg1 = env arg1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, SourceLUT[env.Env.SrcArg1Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, OperandLUT[env.Env.OpArg1Alpha]); + // Arg2 = env arg2 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_EXT, SourceLUT[env.Env.SrcArg2Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_EXT, OperandLUT[env.Env.OpArg2Alpha]); + // Arg3 = 1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_NV, GL_ONE_MINUS_SRC_ALPHA); + break; + default: + // default is modulate + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_ADD); + // Arg0 = env arg0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, SourceLUT[env.Env.SrcArg0Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, OperandLUT[env.Env.OpArg0Alpha]); + // Arg1 = env arg1 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, SourceLUT[env.Env.SrcArg1Alpha]); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, OperandLUT[env.Env.OpArg1Alpha]); + // Arg2 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_EXT, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_EXT, GL_SRC_ALPHA); + // Arg3 = 0 + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_NV, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_NV, GL_SRC_ALPHA); + break; + } +} + +#endif + +// *************************************************************************** +void CDriverGL::forceActivateTexEnvMode(uint stage, const CMaterial::CTexEnv &env) +{ + H_AUTO_OGL(forceActivateTexEnvMode) + // cache mgt. + _CurrentTexEnv[stage].EnvPacked= env.EnvPacked; + // Disable Special tex env f(). + _CurrentTexEnvSpecial[stage]= TexEnvSpecialDisabled; + + + // Setup the gl env mode. + _DriverGLStates.activeTextureARB(stage); + +#ifdef USE_OPENGLES + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); + + // RGB. + //===== + if (env.Env.OpRGB == CMaterial::Mad) + { + // + if (false) + { + // GL_MODULATE_ADD_ATI + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_DOT3_RGB); + // Arg0. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_RGB, SourceLUT[env.Env.SrcArg0RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, OperandLUT[env.Env.OpArg0RGB]); + // Arg1. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC2_RGB, SourceLUT[env.Env.SrcArg1RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, OperandLUT[env.Env.OpArg1RGB]); + // Arg2. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_RGB, SourceLUT[env.Env.SrcArg2RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, OperandLUT[env.Env.OpArg2RGB]); + } + else + { + // fallback to modulate .. + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE); + // + // Arg0. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_RGB, SourceLUT[env.Env.SrcArg0RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, OperandLUT[env.Env.OpArg0RGB]); + // Arg1. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_RGB, SourceLUT[env.Env.SrcArg1RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, OperandLUT[env.Env.OpArg1RGB]); + } + } + else + { + // Operator. + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, OperatorLUT[env.Env.OpRGB] ); + // Arg0. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_RGB, SourceLUT[env.Env.SrcArg0RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, OperandLUT[env.Env.OpArg0RGB]); + // Arg1. + if(env.Env.OpRGB > CMaterial::Replace) + { + glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_RGB, SourceLUT[env.Env.SrcArg1RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, OperandLUT[env.Env.OpArg1RGB]); + // Arg2. + if(env.Env.OpRGB >= CMaterial::InterpolateTexture ) + { + glTexEnvi(GL_TEXTURE_ENV, GL_SRC2_RGB, InterpolateSrcLUT[env.Env.OpRGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_SRC_ALPHA); + } + } + } + // Alpha. + //===== + if (env.Env.OpAlpha == CMaterial::Mad) + { + if (true) + { + // GL_MODULATE_ADD_ATI + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_DOT3_RGB); + // Arg0. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_ALPHA, SourceLUT[env.Env.SrcArg0Alpha] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, OperandLUT[env.Env.OpArg0Alpha]); + // Arg1. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC2_ALPHA, SourceLUT[env.Env.SrcArg1Alpha] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA, OperandLUT[env.Env.OpArg1Alpha]); + // Arg2. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_ALPHA, SourceLUT[env.Env.SrcArg2Alpha] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, OperandLUT[env.Env.OpArg2Alpha]); + } + else + { + // fallback to modulate .. + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_MODULATE); + // + // Arg0. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_ALPHA, SourceLUT[env.Env.SrcArg0RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, OperandLUT[env.Env.OpArg0RGB]); + // Arg1. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_ALPHA, SourceLUT[env.Env.SrcArg1RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, OperandLUT[env.Env.OpArg1RGB]); + } + } + else + { + // Operator. + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, OperatorLUT[env.Env.OpAlpha] ); + // Arg0. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_ALPHA, SourceLUT[env.Env.SrcArg0Alpha] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, OperandLUT[env.Env.OpArg0Alpha]); + // Arg1. + if(env.Env.OpAlpha > CMaterial::Replace) + { + glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_ALPHA, SourceLUT[env.Env.SrcArg1Alpha] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, OperandLUT[env.Env.OpArg1Alpha]); + // Arg2. + if(env.Env.OpAlpha >= CMaterial::InterpolateTexture ) + { + glTexEnvi(GL_TEXTURE_ENV, GL_SRC2_ALPHA, InterpolateSrcLUT[env.Env.OpAlpha] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA, GL_SRC_ALPHA); + } + } + } +#else + // if the Mad operator is used, then + // "Normal drivers", setup EnvCombine. + if(_Extensions.EXTTextureEnvCombine) + { + // if Mad operator is used, special setup + if ((env.Env.OpAlpha == CMaterial::Mad || env.Env.OpRGB == CMaterial::Mad) && _Extensions.NVTextureEnvCombine4) + { + forceActivateTexEnvModeEnvCombine4(env); + } + else + { + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); + // RGB. + //===== + if (env.Env.OpRGB == CMaterial::Mad) + { + // + if (_Extensions.ATITextureEnvCombine3) + { + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE_ADD_ATI); + // Arg0. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, SourceLUT[env.Env.SrcArg0RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, OperandLUT[env.Env.OpArg0RGB]); + // Arg1. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, SourceLUT[env.Env.SrcArg1RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, OperandLUT[env.Env.OpArg1RGB]); + // Arg2. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, SourceLUT[env.Env.SrcArg2RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, OperandLUT[env.Env.OpArg2RGB]); + } + else + { + // fallback to modulate .. + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE); + // + // Arg0. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, SourceLUT[env.Env.SrcArg0RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, OperandLUT[env.Env.OpArg0RGB]); + // Arg1. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, SourceLUT[env.Env.SrcArg1RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, OperandLUT[env.Env.OpArg1RGB]); + } + } + else + { + // Operator. + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, OperatorLUT[env.Env.OpRGB] ); + // Arg0. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, SourceLUT[env.Env.SrcArg0RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, OperandLUT[env.Env.OpArg0RGB]); + // Arg1. + if(env.Env.OpRGB > CMaterial::Replace) + { + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, SourceLUT[env.Env.SrcArg1RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, OperandLUT[env.Env.OpArg1RGB]); + // Arg2. + if(env.Env.OpRGB >= CMaterial::InterpolateTexture ) + { + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, InterpolateSrcLUT[env.Env.OpRGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_ALPHA); + } + } + } + // Alpha. + //===== + if (env.Env.OpAlpha == CMaterial::Mad) + { + if (_Extensions.ATITextureEnvCombine3) + { + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE_ADD_ATI); + // Arg0. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, SourceLUT[env.Env.SrcArg0Alpha] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, OperandLUT[env.Env.OpArg0Alpha]); + // Arg1. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_EXT, SourceLUT[env.Env.SrcArg1Alpha] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_EXT, OperandLUT[env.Env.OpArg1Alpha]); + // Arg2. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, SourceLUT[env.Env.SrcArg2Alpha] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, OperandLUT[env.Env.OpArg2Alpha]); + } + else + { + // fallback to modulate .. + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_MODULATE); + // + // Arg0. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, SourceLUT[env.Env.SrcArg0RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, OperandLUT[env.Env.OpArg0RGB]); + // Arg1. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, SourceLUT[env.Env.SrcArg1RGB] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, OperandLUT[env.Env.OpArg1RGB]); + } + } + else + { + // Operator. + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, OperatorLUT[env.Env.OpAlpha] ); + // Arg0. + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, SourceLUT[env.Env.SrcArg0Alpha] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_EXT, OperandLUT[env.Env.OpArg0Alpha]); + // Arg1. + if(env.Env.OpAlpha > CMaterial::Replace) + { + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, SourceLUT[env.Env.SrcArg1Alpha] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, OperandLUT[env.Env.OpArg1Alpha]); + // Arg2. + if(env.Env.OpAlpha >= CMaterial::InterpolateTexture ) + { + glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA_EXT, InterpolateSrcLUT[env.Env.OpAlpha] ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_EXT, GL_SRC_ALPHA); + } + } + } + } + } + // Very Bad drivers. + else + { + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + } +#endif +} + +// *************************************************************************** +void CDriverGL::activateTexEnvColor(uint stage, NLMISC::CRGBA col) +{ + H_AUTO_OGL(CDriverGL_activateTexEnvColor) + if (col != _CurrentTexEnv[stage].ConstantColor) + { + forceActivateTexEnvColor(stage, col); + } +} + +// *************************************************************************** +void CDriverGL::activateTexEnvMode(uint stage, const CMaterial::CTexEnv &env) +{ + H_AUTO_OGL(CDriverGL_activateTexEnvMode) + // If a special Texture environnement is setuped, or if not the same normal texture environnement, + // must setup a new normal Texture environnement. + if(_CurrentTexEnvSpecial[stage] != TexEnvSpecialDisabled || _CurrentTexEnv[stage].EnvPacked!= env.EnvPacked) + { + forceActivateTexEnvMode(stage, env); + } +} + + +// *************************************************************************** +void CDriverGL::activateTexEnvColor(uint stage, const CMaterial::CTexEnv &env) +{ + H_AUTO_OGL(CDriverGL_activateTexEnvColor) + if(_CurrentTexEnv[stage].ConstantColor!= env.ConstantColor) + { + forceActivateTexEnvColor(stage, env); + } +} + + +// *************************************************************************** +void CDriverGL::forceDXTCCompression(bool dxtcComp) +{ + H_AUTO_OGL(CDriverGL_forceDXTCCompression) + _ForceDXTCCompression= dxtcComp; +} + +// *************************************************************************** +void CDriverGL::setAnisotropicFilter(sint filtering) +{ + H_AUTO_OGL(CDriverGL_setAnisotropicFiltering); + + if (!_Extensions.EXTTextureFilterAnisotropic) return; + + if (filtering < 0 || filtering > _Extensions.EXTTextureFilterAnisotropicMaximum) + { + // set maximum value for anisotropic filter + _AnisotropicFilter = _Extensions.EXTTextureFilterAnisotropicMaximum; + } + else + { + // set specified value for anisotropic filter + _AnisotropicFilter = filtering; + } +} + +// *************************************************************************** +void CDriverGL::forceTextureResize(uint divisor) +{ + H_AUTO_OGL(CDriverGL_forceTextureResize) + clamp(divisor, 1U, 256U); + + // 16 -> 4. + _ForceTextureResizePower= getPowerOf2(divisor); +} + + +// *************************************************************************** +void CDriverGL::swapTextureHandle(ITexture &tex0, ITexture &tex1) +{ + H_AUTO_OGL(CDriverGL_swapTextureHandle) + // ensure creation of both texture + setupTexture(tex0); + setupTexture(tex1); + + // avoid any problem, disable all textures + for(uint stage = 0; stage < inlGetNumTextStages(); stage++) + { + activateTexture(stage, NULL); + } + + // get the handle. + CTextureDrvInfosGL *t0= getTextureGl(tex0); + CTextureDrvInfosGL *t1= getTextureGl(tex1); + + /* Swap contents. Can't swap directly the pointers cause would have to change all CTextureDrvShare which point on + Can't do swap(*t0, *t1), because must keep the correct _DriverIterator + */ + swap(t0->ID, t1->ID); + swap(t0->MipMap, t1->MipMap); + swap(t0->Compressed, t1->Compressed); + swap(t0->TextureMemory, t1->TextureMemory); + swap(t0->WrapS, t1->WrapS); + swap(t0->WrapT, t1->WrapT); + swap(t0->MagFilter, t1->MagFilter); + swap(t0->MinFilter, t1->MinFilter); + swap(t0->TextureMode, t1->TextureMode); + swap(t0->FBOId, t1->FBOId); + swap(t0->DepthFBOId, t1->DepthFBOId); + swap(t0->StencilFBOId, t1->StencilFBOId); + swap(t0->InitFBO, t1->InitFBO); + swap(t0->AttachDepthStencil, t1->AttachDepthStencil); + swap(t0->UsePackedDepthStencil, t1->UsePackedDepthStencil); +} + + +// *************************************************************************** +uint CDriverGL::getTextureHandle(const ITexture &tex) +{ + H_AUTO_OGL(CDriverGL_getTextureHandle) + // If DrvShare not setuped + if(!tex.TextureDrvShare) + return 0; + + // If DrvInfo not setuped + const CTextureDrvInfosGL *t0= (const CTextureDrvInfosGL*)(const ITextureDrvInfos*)(tex.TextureDrvShare->DrvTexture); + if(!t0) + return 0; + + return t0->ID; +} + +// *************************************************************************** + +/* + Under opengl, "render to texture" uses the frame buffer. The scene is rendered into the current frame buffer and the result + is copied into the texture. + + setRenderTarget (tex) does nothing but backup the framebuffer area used and updates the viewport and scissor + setRenderTarget (NULL) copies the modified framebuffer area into "tex" and then, updates the viewport and scissor + */ + +bool CDriverGL::setRenderTarget (ITexture *tex, uint32 x, uint32 y, uint32 width, uint32 height, uint32 mipmapLevel, uint32 cubeFace) +{ + H_AUTO_OGL(CDriverGL_setRenderTarget ) + + // make backup of offscreen buffer to old texture if not using FBOs + if (!_RenderTargetFBO && _TextureTarget && _TextureTargetUpload && (_TextureTarget != tex || _TextureTargetCubeFace != cubeFace)) + { + // Flush it + copyFrameBufferToTexture (_TextureTarget, _TextureTargetLevel, _TextureTargetX, _TextureTargetY, 0, + 0, _TextureTargetWidth, _TextureTargetHeight, _TextureTargetCubeFace); + } + + // Set a new texture as render target ? + if (tex) + { + // Check the texture is a render target + nlassertex (tex->getRenderTarget(), ("The texture must be a render target. Call ITexture::setRenderTarget(true).")); + + if(tex->isBloomTexture() && supportBloomEffect()) + { + uint32 w, h; + getWindowSize(w, h); + + getViewport(_OldViewport); + + CViewport newVP; + newVP.init(0, 0, ((float)width/(float)w), ((float)height/(float)h)); + setupViewport(newVP); + + _RenderTargetFBO = true; + + return activeFrameBufferObject(tex); + } + + // Backup the parameters + _TextureTargetLevel = mipmapLevel; + _TextureTargetX = x; + _TextureTargetY = y; + _TextureTargetWidth = width; + _TextureTargetHeight = height; + _TextureTargetUpload = true; + _TextureTargetCubeFace = cubeFace; + } + else if (_RenderTargetFBO) + { + activeFrameBufferObject(NULL); + setupViewport(_OldViewport); + _OldViewport = _CurrViewport; + + _RenderTargetFBO = false; + return false; + } + + // Backup the texture + _TextureTarget = tex; + + // Update the viewport + setupViewport (_CurrViewport); + + // Update the scissor + setupScissor (_CurrScissor); + + _RenderTargetFBO = false; + _OldViewport = _CurrViewport; + + return true; +} + +// *************************************************************************** + +bool CDriverGL::copyTargetToTexture (ITexture *tex, + uint32 offsetx, + uint32 offsety, + uint32 x, + uint32 y, + uint32 width, + uint32 height, + uint32 mipmapLevel) +{ + H_AUTO_OGL(CDriverGL_copyTargetToTexture) + if (!_TextureTarget) + return false; + _TextureTargetUpload = false; + if ((width == 0) || (height == 0)) + { + uint32 _width; + uint32 _height; + getRenderTargetSize (_width, _height); + if (width == 0) + width = _width; + if (height == 0) + height = _height; + } + copyFrameBufferToTexture(tex, mipmapLevel, offsetx, offsety, x, y, width, height); + return true; +} + +// *************************************************************************** + +bool CDriverGL::getRenderTargetSize (uint32 &width, uint32 &height) +{ + H_AUTO_OGL(CDriverGL_getRenderTargetSize) + if (_TextureTarget) + { + width = _TextureTarget->getWidth(); + height = _TextureTarget->getHeight(); + } + else + { + getWindowSize(width, height); + } + + return false; +} + +// *************************************************************************** + +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} // NL3D diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp new file mode 100644 index 000000000..14ed83adb --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp @@ -0,0 +1,1867 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "stdopengl.h" + +#include "driver_opengl.h" +#include "nel/3d/index_buffer.h" +#include "driver_opengl_vertex_buffer_hard.h" + + + + +using namespace std; +using namespace NLMISC; + + + + +// *************************************************************************** +// Flags for software vertex skinning. +#define NL3D_DRV_SOFTSKIN_VNEEDCOMPUTE 3 +#define NL3D_DRV_SOFTSKIN_VMUSTCOMPUTE 1 +#define NL3D_DRV_SOFTSKIN_VCOMPUTED 0 +// 3 means "vertex may need compute". +// 1 means "Primitive say vertex must be computed". +// 0 means "vertex is computed". + + +// 500K min. +#define NL3D_DRV_VERTEXARRAY_MINIMUM_SIZE (512*1024) + + + + + +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + +// *************************************************************************** + +CVBDrvInfosGL::CVBDrvInfosGL(CDriverGL *drv, ItVBDrvInfoPtrList it, CVertexBuffer *vb) : IVBDrvInfos(drv, it, vb) +{ + H_AUTO_OGL(CVBDrvInfosGL_CVBDrvInfosGL) + _DriverGL = drv; + _VBHard = NULL; + _SystemMemory = NULL; +} + +// *************************************************************************** + +CVBDrvInfosGL::~CVBDrvInfosGL() +{ + H_AUTO_OGL(CVBDrvInfosGL_CVBDrvInfosGLDtor) + // Restaure non resident memory + if (VertexBufferPtr) + { + VertexBufferPtr->setLocation(CVertexBuffer::NotResident); + VertexBufferPtr = NULL; + } + + if (_VBHard) + { + _VBHard->disable(); + _DriverGL->_VertexBufferHardSet.erase(_VBHard); + } + if (_SystemMemory) + { + delete [] _SystemMemory; + } + _SystemMemory = NULL; + _VBHard = NULL; +} + +// *************************************************************************** +uint8 *CVBDrvInfosGL::lock (uint /* first */, uint /* last */, bool /* readOnly */) +{ + H_AUTO_OGL(CVBDrvInfosGL_lock) + if (_VBHard) + { + return (uint8*)_VBHard->lock (); + } + else + { + // Should be a system memory + nlassert (_SystemMemory); + return _SystemMemory; + } +} + +// *************************************************************************** +void CVBDrvInfosGL::unlock (uint first, uint last) +{ + H_AUTO_OGL(CVBDrvInfosGL_unlock) + if (_VBHard) + { + _VBHard->unlock(first, last); + } + else + { + // Should be a system memory + nlassert (_SystemMemory); + } +} + +// *************************************************************************** +bool CDriverGL::setupVertexBuffer(CVertexBuffer& VB) +{ + H_AUTO_OGL(CDriverGL_setupVertexBuffer) + // 2. If necessary, do modifications. + //================================== + const bool touched = (VB.getTouchFlags() & (CVertexBuffer::TouchedReserve|CVertexBuffer::TouchedVertexFormat)) != 0; + if( touched || (VB.DrvInfos == NULL)) + { + // delete first + if(VB.DrvInfos) + delete VB.DrvInfos; + VB.DrvInfos = NULL; + + // create only if some vertices + if(VB.getNumVertices()) + { + // 1. Retrieve/Create driver shader. + //================================== + // insert into driver list. (so it is deleted when driver is deleted). + ItVBDrvInfoPtrList it= _VBDrvInfos.insert(_VBDrvInfos.end(), (NL3D::IVBDrvInfos*)NULL); + // create and set iterator, for future deletion. + CVBDrvInfosGL *info = new CVBDrvInfosGL(this, it, &VB); + *it= VB.DrvInfos = info; + + // Preferred memory + CVertexBuffer::TPreferredMemory preferred = VB.getPreferredMemory (); + if ((preferred == CVertexBuffer::RAMVolatile) || (preferred == CVertexBuffer::AGPVolatile)) + preferred = CVertexBuffer::RAMPreferred; + const uint size = VB.capacity()*VB.getVertexSize(); + uint preferredMemory = _Extensions.DisableHardwareVertexArrayAGP ? CVertexBuffer::RAMPreferred : preferred; + while (preferredMemory != CVertexBuffer::RAMPreferred) + { + // Vertex buffer hard + info->_VBHard = createVertexBufferHard(size, VB.capacity(), (CVertexBuffer::TPreferredMemory)preferredMemory, &VB); + if (info->_VBHard) + break; + preferredMemory--; + } + + // No memory found ? Use system memory + if (info->_VBHard == NULL) + { + nlassert (info->_SystemMemory == NULL); + info->_SystemMemory = new uint8[size]; + } + + // Upload the data + VB.setLocation ((CVertexBuffer::TLocation)preferredMemory); + } + } + + return true; +} + + +// *************************************************************************** +bool CDriverGL::activeVertexBuffer(CVertexBuffer& VB) +{ + H_AUTO_OGL(CDriverGL_activeVertexBuffer) + // NB: must duplicate changes in activeVertexBufferHard() + uint32 flags; + + // In any case, we'll erase any special vertex setup for Lightmap Material + _LastVertexSetupIsLightMap= false; + + // setup + if (!setupVertexBuffer(VB)) + return false; + + if (VB.getNumVertices()==0) + return true; + + // Fill the buffer if in local memory + VB.fillBuffer (); + + // Get VB flags, to setup matrixes and arrays. + flags=VB.getVertexFormat(); + + + // 2. Setup Arrays. + //=================== + // For MultiPass Material. + CVertexBufferInfo::TVBMode lastVBMode = _LastVB.VBMode; + CVBDrvInfosGL *info= safe_cast((IVBDrvInfos*)VB.DrvInfos); + if (!info->_VBHard || (info->_VBHard && !info->_VBHard->isInvalid())) + { + _LastVB.setupVertexBuffer(VB); + if (lastVBMode == CVertexBufferInfo::HwARB && _LastVB.VBMode != CVertexBufferInfo::HwARB) + { + _DriverGLStates.bindARBVertexBuffer(0); // unbind ARB vertex buffer + } + } + if (info->_VBHard == NULL) + { + // Fence mgt. + fenceOnCurVBHardIfNeeded(NULL); + + // Disable the current vertexBufferHard if setuped. + if(_CurrentVertexBufferHard) + _CurrentVertexBufferHard->disable(); + } + else + { + // 2. Setup Arrays. + //=================== + + // Fence mgt. + fenceOnCurVBHardIfNeeded(info->_VBHard); + + // Enable the vertexArrayRange of this array. + info->_VBHard->enable(); + } + if (!info->_VBHard || (info->_VBHard && !info->_VBHard->isInvalid())) + { + setupGlArrays(_LastVB); + } + return true; +} + +// *************************************************************************** +bool CDriverGL::activeIndexBuffer(CIndexBuffer& IB) +{ + H_AUTO_OGL(CDriverGL_activeIndexBuffer) + _LastIB.setupIndexBuffer(IB); + return true; +} + +// *************************************************************************** + +bool CDriverGL::renderLines(CMaterial& mat, uint32 firstIndex, uint32 nlines) +{ + H_AUTO_OGL(CDriverGL_renderLines) + // update matrix and Light in OpenGL if needed + refreshRenderSetup(); + + // setup material + if ( !setupMaterial(mat) || _LastIB._Values == NULL ) + return false; + + if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; + // render primitives. + //============================== + // start multipass. + uint nPass; + nPass= beginMultiPass(); + // draw all passes. + for(uint pass=0;passGPURenderingAfterFence= true; + + return true; +} + +// *************************************************************************** + +bool CDriverGL::renderTriangles(CMaterial& mat, uint32 firstIndex, uint32 ntris) +{ + H_AUTO_OGL(CDriverGL_renderTriangles); + + // update matrix and Light in OpenGL if needed + refreshRenderSetup(); + + // setup material + if ( !setupMaterial(mat) || _LastIB._Values == NULL ) + return false; + + if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; + + // render primitives. + //============================== + // start multipass. + uint nPass; + + nPass= beginMultiPass(); + + // draw all passes. + for(uint pass=0;passGPURenderingAfterFence= true; + return true; +} + +// *************************************************************************** + +bool CDriverGL::renderSimpleTriangles(uint32 firstTri, uint32 ntris) +{ + H_AUTO_OGL(CDriverGL_renderSimpleTriangles); + + nlassert(ntris>0); + + // update matrix and Light in OpenGL if needed + refreshRenderSetup(); + + if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; + // Don't setup any material here. + + // render primitives. + //============================== + // NO MULTIPASS HERE!! + // draw the primitives. (nb: ntris>0). + + if (_LastIB._Format == CIndexBuffer::Indices16) + { + glDrawElements(GL_TRIANGLES,3*ntris,GL_UNSIGNED_SHORT, ((uint16 *) _LastIB._Values)+firstTri); + } + else + { +#ifdef USE_OPENGLES + nlerror("not available in OpenGL ES 1.0, only use 16 bits indices"); +#else + nlassert(_LastIB._Format == CIndexBuffer::Indices32); + glDrawElements(GL_TRIANGLES,3*ntris,GL_UNSIGNED_INT, ((uint32 *) _LastIB._Values)+firstTri); +#endif + } + + // Profiling. + _PrimitiveProfileIn.NTriangles+= ntris; + _PrimitiveProfileOut.NTriangles+= ntris; + + // We have render some prims. inform the VBHard. + if(_CurrentVertexBufferHard) + _CurrentVertexBufferHard->GPURenderingAfterFence= true; + + return true; +} + +// *************************************************************************** + +bool CDriverGL::renderRawPoints(CMaterial& mat, uint32 startIndex, uint32 numPoints) +{ + H_AUTO_OGL(CDriverGL_renderRawPoints) + // update matrix and Light in OpenGL if needed + refreshRenderSetup(); + + // setup material + if ( !setupMaterial(mat) ) + return false; + + if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; + // render primitives. + //============================== + // start multipass. + uint nPass; + nPass= beginMultiPass(); + // draw all passes. + for(uint pass=0;passGPURenderingAfterFence= true; + return true; +} + +// *************************************************************************** + +bool CDriverGL::renderRawLines(CMaterial& mat, uint32 startIndex, uint32 numLines) +{ + H_AUTO_OGL(CDriverGL_renderRawLines) + // update matrix and Light in OpenGL if needed + refreshRenderSetup(); + + // setup material + if ( !setupMaterial(mat) ) + return false; + + if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; + // render primitives. + //============================== + // start multipass. + uint nPass; + nPass= beginMultiPass(); + // draw all passes. + for(uint pass=0;passGPURenderingAfterFence= true; + return true; +} + +// *************************************************************************** + +bool CDriverGL::renderRawTriangles(CMaterial& mat, uint32 startIndex, uint32 numTris) +{ + H_AUTO_OGL(CDriverGL_renderRawTriangles) + // update matrix and Light in OpenGL if needed + refreshRenderSetup(); + + // setup material + if ( !setupMaterial(mat) ) + return false; + + if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; + // render primitives. + //============================== + // start multipass. + uint nPass; + nPass= beginMultiPass(); + // draw all passes. + for(uint pass=0;passGPURenderingAfterFence= true; + return true; +} + +// *************************************************************************** + +bool CDriverGL::renderRawQuads(CMaterial& mat, uint32 startIndex, uint32 numQuads) +{ + H_AUTO_OGL(CDriverGL_renderRawQuads) + if (!numQuads) return true; + // update matrix and Light in OpenGL if needed + refreshRenderSetup(); + + // setup material + if ( !setupMaterial(mat) ) + return false; + + if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; + + const uint32 QUAD_BATCH_SIZE = 2048; + static GLshort defaultIndices[QUAD_BATCH_SIZE * 6]; + static bool init = false; + if (!init) + { + // setup the base index buffer + for(uint k = 0; k < QUAD_BATCH_SIZE; ++k) + { + // first tri + defaultIndices[k * 6] = (GLshort) (k * 4); + defaultIndices[k * 6 + 1] = (GLshort) (k * 4 + 1); + defaultIndices[k * 6 + 2] = (GLshort) (k * 4 + 2); + // second tri + defaultIndices[k * 6 + 3] = (GLshort) (k * 4); + defaultIndices[k * 6 + 4] = (GLshort) (k * 4 + 2); + defaultIndices[k * 6 + 5] = (GLshort) (k * 4 + 3); + + } + init = true; + } + + // render primitives. + //============================== + // start multipass. + uint nPass; + nPass= beginMultiPass(); + // draw all passes. + for(uint pass=0;passGPURenderingAfterFence= true; + return true; +} + +// *************************************************************************** + +void CDriverGL::setupUVPtr(uint stage, CVertexBufferInfo &VB, uint uvId) +{ + H_AUTO_OGL(CDriverGL_setupUVPtr) + // sould not be called with vertex program Array setuped. + nlassert(!_LastSetupGLArrayVertexProgram); + + _DriverGLStates.clientActiveTextureARB(stage); + if (VB.VertexFormat & (CVertexBuffer::TexCoord0Flag< _MaxVerticesByVBHard) + return NULL; + + // Create a CVertexBufferHardGL + IVertexBufferHardGL *vbHard = NULL; + // let the VAR create the vbhard. + vbHard= vertexArrayRange->createVBHardGL(size, vb); + // if fails + if(!vbHard) + { + return NULL; + } + else + { + // insert in list. + return _VertexBufferHardSet.insert(vbHard); + } + } +} + + +// *************************************************************************** +const uint CDriverGL::NumCoordinatesType[CVertexBuffer::NumType]= +{ + 1, // Double1 + 1, // Float1 + 1, // Short1 + 2, // Double2 + 2, // Float2 + 2, // Short2 + 3, // Double3 + 3, // Float3 + 3, // Short3 + 4, // Double4 + 4, // Float4 + 4, // Short4 + 4 // UChar4 +}; + + +// *************************************************************************** +const uint CDriverGL::GLType[CVertexBuffer::NumType]= +{ +#ifdef USE_OPENGLES + GL_FLOAT, // Double1 + GL_FLOAT, // Float1 + GL_SHORT, // Short1 + GL_FLOAT, // Double2 + GL_FLOAT, // Float2 + GL_SHORT, // Short2 + GL_FLOAT, // Double3 + GL_FLOAT, // Float3 + GL_SHORT, // Short3 + GL_FLOAT, // Double4 + GL_FLOAT, // Float4 + GL_SHORT, // Short4 + GL_UNSIGNED_BYTE // UChar4 +#else + GL_DOUBLE, // Double1 + GL_FLOAT, // Float1 + GL_SHORT, // Short1 + GL_DOUBLE, // Double2 + GL_FLOAT, // Float2 + GL_SHORT, // Short2 + GL_DOUBLE, // Double3 + GL_FLOAT, // Float3 + GL_SHORT, // Short3 + GL_DOUBLE, // Double4 + GL_FLOAT, // Float4 + GL_SHORT, // Short4 + GL_UNSIGNED_BYTE // UChar4 +#endif +}; + +// *************************************************************************** +const bool CDriverGL::GLTypeIsIntegral[CVertexBuffer::NumType] = +{ + false, // Double1 + false, // Float1 + true, // Short1 + false, // Double2 + false, // Float2 + true, // Short2 + false, // Double3 + false, // Float3 + true, // Short3 + false, // Double4 + false, // Float4 + true, // Short4 + true // UChar4 +}; + + + +// *************************************************************************** +const uint CDriverGL::GLVertexAttribIndex[CVertexBuffer::NumValue]= +{ + 0, // Position + 2, // Normal + 8, // TexCoord0 + 9, // TexCoord1 + 10, // TexCoord2 + 11, // TexCoord3 + 12, // TexCoord4 + 13, // TexCoord5 + 14, // TexCoord6 + 15, // TexCoord7 + 3, // PrimaryColor + 4, // SecondaryColor + 1, // Weight + 6, // Empty (PaletteSkin) + 5, // Fog + 7, // Empty +}; + + + +// *************************************************************************** +void CDriverGL::setupGlArraysStd(CVertexBufferInfo &vb) +{ + H_AUTO_OGL(CDriverGL_setupGlArraysStd) + uint32 flags= vb.VertexFormat; + + if (vb.VBMode == CVertexBufferInfo::HwARB) + { + _DriverGLStates.bindARBVertexBuffer(vb.VertexObjectId); + } + + switch(vb.VBMode) + { + case CVertexBufferInfo::SysMem: + case CVertexBufferInfo::HwNVIDIA: + case CVertexBufferInfo::HwARB: + { + // setup vertex ptr. + //----------- + uint numVertexCoord = CVertexBuffer::NumComponentsType[vb.Type[CVertexBuffer::Position]]; + nlassert (numVertexCoord >= 2); + _DriverGLStates.enableVertexArray(true); + glVertexPointer(numVertexCoord, GL_FLOAT, vb.VertexSize, vb.ValuePtr[CVertexBuffer::Position]); + + // setup normal ptr. + //----------- + // Check for normal param in vertex buffer + if (flags & CVertexBuffer::NormalFlag) + { + // Check type + nlassert (vb.Type[CVertexBuffer::Normal]==CVertexBuffer::Float3); + + _DriverGLStates.enableNormalArray(true); + glNormalPointer(GL_FLOAT, vb.VertexSize, vb.ValuePtr[CVertexBuffer::Normal]); + } + else + { + _DriverGLStates.enableNormalArray(false); + } + + // Setup Color + //----------- + // Check for color param in vertex buffer + if (flags & CVertexBuffer::PrimaryColorFlag) + { + // Check type + nlassert (vb.Type[CVertexBuffer::PrimaryColor]==CVertexBuffer::UChar4); + _DriverGLStates.enableColorArray(true); + // Setup ATI VBHard or std ptr. + glColorPointer(4,GL_UNSIGNED_BYTE, vb.VertexSize, vb.ValuePtr[CVertexBuffer::PrimaryColor]); + } + else + { + _DriverGLStates.enableColorArray(false); + } + } + break; +#ifndef USE_OPENGLES + case CVertexBufferInfo::HwATI: + { + // setup vertex ptr. + //----------- + uint numVertexCoord = CVertexBuffer::NumComponentsType[vb.Type[CVertexBuffer::Position]]; + nlassert (numVertexCoord >= 2); + + _DriverGLStates.enableVertexArray(true); + nglArrayObjectATI(GL_VERTEX_ARRAY, numVertexCoord, GL_FLOAT, vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Position]); + // setup normal ptr. + //----------- + // Check for normal param in vertex buffer + if (flags & CVertexBuffer::NormalFlag) + { + // Check type + nlassert (vb.Type[CVertexBuffer::Normal]==CVertexBuffer::Float3); + _DriverGLStates.enableNormalArray(true); + nglArrayObjectATI(GL_NORMAL_ARRAY, 3, GL_FLOAT, vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Normal]); + } + else + { + _DriverGLStates.enableNormalArray(false); + } + + + // Setup Color + //----------- + // Check for color param in vertex buffer + if (flags & CVertexBuffer::PrimaryColorFlag) + { + // Check type + nlassert (vb.Type[CVertexBuffer::PrimaryColor]==CVertexBuffer::UChar4); + + _DriverGLStates.enableColorArray(true); + nglArrayObjectATI(GL_COLOR_ARRAY, 4, GL_UNSIGNED_BYTE, vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::PrimaryColor]); + } + else + { + _DriverGLStates.enableColorArray(false); + } + } + break; +#endif + default: + nlassert(0); + break; + } + + // Setup Uvs + //----------- + // Get the routing + for(uint i=0; i((IVertexProgramDrvInfos *) vp->_DrvInfo); + if (drvInfo) + { + // Disable all VertexAttribs. + for (uint value=0; valueVariants); + } + } + } + // no more a vertex program setup. + _LastSetupGLArrayVertexProgram= false; + } + + // If last was a standard GL array setup, and now it is a VertexProgram setup. + if( !_LastSetupGLArrayVertexProgram && isVertexProgramEnabled () ) + { + // Disable all standards ptrs. + _DriverGLStates.enableVertexArray(false); + _DriverGLStates.enableNormalArray(false); + _DriverGLStates.enableColorArray(false); + _DriverGLStates.enableSecondaryColorArray(false); + for(uint i=0; i((IVertexProgramDrvInfos *) vp->_DrvInfo); + if (!drvInfo) return; + + uint32 flags= vb.VertexFormat; + + + if (vb.VBMode == CVertexBufferInfo::HwARB) + { + _DriverGLStates.bindARBVertexBuffer(vb.VertexObjectId); + } + + // For each value + for (uint value=0; valueUsedVertexComponents) + { + _DriverGLStates.enableVertexAttribArrayForEXTVertexShader(glIndex, true, drvInfo->Variants); +#ifndef USE_OPENGLES + // use variant or open gl standard array + if (vb.VBMode == CVertexBufferInfo::HwATI) + { + switch(value) + { + case CVertexBuffer::Position: // position + { + nlassert(NumCoordinatesType[type] >= 2); + nglArrayObjectATI(GL_VERTEX_ARRAY, NumCoordinatesType[type], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Position]); + } + break; + case CVertexBuffer::Weight: // skin weight + { + nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported + nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL::EVSSkinWeightVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Weight]); + } + break; + case CVertexBuffer::Normal: // normal + { + nlassert(NumCoordinatesType[type] == 3); // must have 3 components for normals + nglArrayObjectATI(GL_NORMAL_ARRAY, 3, GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[value]); + } + break; + case CVertexBuffer::PrimaryColor: // color + { + nlassert(NumCoordinatesType[type] >= 3); // must have 3 or 4 components for primary color + nglArrayObjectATI(GL_COLOR_ARRAY, NumCoordinatesType[type], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::PrimaryColor]); + } + break; + case CVertexBuffer::SecondaryColor: // secondary color + { + // implemented using a variant, as not available with EXTVertexShader + nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported + nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL::EVSSecondaryColorVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::SecondaryColor]); + } + break; + case CVertexBuffer::Fog: // fog coordinate + { + // implemented using a variant + nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported + nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL::EVSFogCoordsVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Fog]); + } + break; + case CVertexBuffer::PaletteSkin: // palette skin + { + // implemented using a variant + nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported + nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL::EVSPaletteSkinVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::PaletteSkin]); + } + break; + case CVertexBuffer::Empty: // empty + nlstop; + break; + case CVertexBuffer::TexCoord0: + case CVertexBuffer::TexCoord1: + case CVertexBuffer::TexCoord2: + case CVertexBuffer::TexCoord3: + case CVertexBuffer::TexCoord4: + case CVertexBuffer::TexCoord5: + case CVertexBuffer::TexCoord6: + case CVertexBuffer::TexCoord7: + { + _DriverGLStates.clientActiveTextureARB(value - CVertexBuffer::TexCoord0); + nglArrayObjectATI(GL_TEXTURE_COORD_ARRAY, NumCoordinatesType[type], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[value]); + } + break; + default: + nlstop; // invalid value + break; + } + } + else +#endif + { + switch(value) + { + case CVertexBuffer::Position: // position + { + nlassert(NumCoordinatesType[type] >= 2); + glVertexPointer(NumCoordinatesType[type], GLType[type], vb.VertexSize, vb.ValuePtr[value]); + } + break; + case CVertexBuffer::Weight: // skin weight + { + nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported +#ifndef USE_OPENGLES + nglVariantPointerEXT(drvInfo->Variants[CDriverGL::EVSSkinWeightVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]); +#endif + } + break; + case CVertexBuffer::Normal: // normal + { + nlassert(NumCoordinatesType[type] == 3); // must have 3 components for normals + glNormalPointer(GLType[type], vb.VertexSize, vb.ValuePtr[CVertexBuffer::Normal]); + } + break; + case CVertexBuffer::PrimaryColor: // color + { + nlassert(NumCoordinatesType[type] >= 3); // must have 3 or 4 components for primary color + glColorPointer(NumCoordinatesType[type], GLType[type], vb.VertexSize, vb.ValuePtr[value]); + } + break; + case CVertexBuffer::SecondaryColor: // secondary color + { + // implemented using a variant, as not available with EXTVertexShader + nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported +#ifndef USE_OPENGLES + nglVariantPointerEXT(drvInfo->Variants[CDriverGL::EVSSecondaryColorVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]); +#endif + } + break; + case CVertexBuffer::Fog: // fog coordinate + { + // implemented using a variant + nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported +#ifndef USE_OPENGLES + nglVariantPointerEXT(drvInfo->Variants[CDriverGL::EVSFogCoordsVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]); +#endif + } + break; + case CVertexBuffer::PaletteSkin: // palette skin + { + // implemented using a variant + nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported +#ifndef USE_OPENGLES + nglVariantPointerEXT(drvInfo->Variants[CDriverGL::EVSPaletteSkinVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]); +#endif + } + break; + case CVertexBuffer::Empty: // empty + nlstop; + break; + case CVertexBuffer::TexCoord0: + case CVertexBuffer::TexCoord1: + case CVertexBuffer::TexCoord2: + case CVertexBuffer::TexCoord3: + case CVertexBuffer::TexCoord4: + case CVertexBuffer::TexCoord5: + case CVertexBuffer::TexCoord6: + case CVertexBuffer::TexCoord7: + { + _DriverGLStates.clientActiveTextureARB(value - CVertexBuffer::TexCoord0); + glTexCoordPointer(NumCoordinatesType[type], GLType[type], vb.VertexSize, vb.ValuePtr[value]); + } + break; + default: + nlstop; // invalid value + break; + } + } + } + else + { + _DriverGLStates.enableVertexAttribArrayForEXTVertexShader(glIndex, false, drvInfo->Variants); + } + } +} + + + +// *************************************************************************** +void CDriverGL::setupGlArrays(CVertexBufferInfo &vb) +{ + H_AUTO_OGL(CDriverGL_setupGlArrays) + + // Standard case (NVVertexProgram or no vertex program case) + if (_Extensions.NVVertexProgram) + { + toggleGlArraysForNVVertexProgram(); + // Use a vertex program ? + if (!isVertexProgramEnabled ()) + { + setupGlArraysStd(vb); + } + else + { + setupGlArraysForNVVertexProgram(vb); + } + } + else if (_Extensions.ARBVertexProgram) + { + toggleGlArraysForARBVertexProgram(); + // Use a vertex program ? + if (!isVertexProgramEnabled ()) + { + setupGlArraysStd(vb); + } + else + { + setupGlArraysForARBVertexProgram(vb); + } + } + else if (_Extensions.EXTVertexShader) + { + toggleGlArraysForEXTVertexShader(); + // Use a vertex program ? + if (!isVertexProgramEnabled ()) + { + setupGlArraysStd(vb); + } + else + { + setupGlArraysForEXTVertexShader(vb); + } + } + else + { + // no vertex programs + setupGlArraysStd(vb); + } +} + + +// *************************************************************************** +void CVertexBufferInfo::setupVertexBuffer(CVertexBuffer &vb) +{ + H_AUTO_OGL(CDriverGL_setupVertexBuffer) + sint i; + VertexFormat= vb.getVertexFormat(); + VertexSize= vb.getVertexSize(); + NumVertices= vb.getNumVertices(); + + // Lock the buffer + CVertexBufferReadWrite access; + uint8 *ptr; + CVBDrvInfosGL *info= safe_cast((IVBDrvInfos*)vb.DrvInfos); + nlassert (info); + if (info->_VBHard) + { + ptr = (uint8*)info->_VBHard->getPointer(); + info->_VBHard->setupVBInfos(*this); + } + else + { + nlassert (info->_SystemMemory); + ptr = info->_SystemMemory; + VBMode = SysMem; + } + + // Get value pointer + for (i=0; ilock(); + _CurrentVertexBufferHard->unlock(); + // disable it + _CurrentVertexBufferHard->disable(); + } + // Clear any VertexBufferHard created. + _VertexBufferHardSet.clear(); + + // After, Clear the 2 vertexArrayRange, if any. + if(_AGPVertexArrayRange) + _AGPVertexArrayRange->free(); + if(_VRAMVertexArrayRange) + _VRAMVertexArrayRange->free(); +} + + +// *************************************************************************** +bool CDriverGL::initVertexBufferHard(uint agpMem, uint vramMem) +{ + H_AUTO_OGL(CDriverGL_initVertexBufferHard) + if(!supportVertexBufferHard()) + return false; + + // must be supported + if(!_AGPVertexArrayRange || !_VRAMVertexArrayRange) + return false; + + // First, reset any VBHard created. + resetVertexArrayRange(); + bool ok= true; + + // Try to allocate AGPMemory. + if(agpMem>0) + { + agpMem&= ~15; // ensure 16-bytes aligned mem count (maybe useful :) ). + agpMem= max(agpMem, (uint)NL3D_DRV_VERTEXARRAY_MINIMUM_SIZE); + while(agpMem>= NL3D_DRV_VERTEXARRAY_MINIMUM_SIZE) + { + if(_AGPVertexArrayRange->allocate(agpMem, CVertexBuffer::AGPPreferred)) + { + nlinfo("3D: %.u vertices supported", _MaxVerticesByVBHard); + nlinfo("3D: Success to allocate %.1f Mo of AGP VAR Ram", agpMem / 1000000.f); + break; + } + else + { + agpMem/=2; + agpMem &=~15; + } + } + + if(agpMem< NL3D_DRV_VERTEXARRAY_MINIMUM_SIZE) + { + nlinfo("3D: %.u vertices supported", _MaxVerticesByVBHard); + nlinfo("3D: Failed to allocate %.1f Mo of AGP VAR Ram", NL3D_DRV_VERTEXARRAY_MINIMUM_SIZE / 1000000.f); + ok= false; + } + } + + + // Try to allocate VRAMMemory. + if(vramMem>0) + { + vramMem&= ~15; // ensure 16-bytes aligned mem count (maybe useful :) ). + vramMem= max(vramMem, (uint)NL3D_DRV_VERTEXARRAY_MINIMUM_SIZE); + while(vramMem>= NL3D_DRV_VERTEXARRAY_MINIMUM_SIZE) + { + if(_VRAMVertexArrayRange->allocate(vramMem, CVertexBuffer::StaticPreferred)) + break; + else + { + vramMem/=2; + vramMem &=~15; + } + } + + if(vramMem< NL3D_DRV_VERTEXARRAY_MINIMUM_SIZE) + { + ok= false; + } + } + + + return ok; +} + + +// *************************************************************************** +uint32 CDriverGL::getAvailableVertexAGPMemory () +{ + H_AUTO_OGL(CDriverGL_getAvailableVertexAGPMemory ) + if (_AGPVertexArrayRange) + return _AGPVertexArrayRange->sizeAllocated(); + else + return 0; +} + + +// *************************************************************************** +uint32 CDriverGL::getAvailableVertexVRAMMemory () +{ + H_AUTO_OGL(CDriverGL_getAvailableVertexVRAMMemory ) + if (_VRAMVertexArrayRange) + return _VRAMVertexArrayRange->sizeAllocated(); + else + return 0; +} + + +// *************************************************************************** +void CDriverGL::fenceOnCurVBHardIfNeeded(IVertexBufferHardGL *newVBHard) +{ + H_AUTO_OGL(CDriverGL_fenceOnCurVBHardIfNeeded); + +#ifndef USE_OPENGLES + // If old is not a VBHard, or if not a NVidia VBHard, no-op. + if( _CurrentVertexBufferHard==NULL || !_CurrentVertexBufferHard->VBType == IVertexBufferHardGL::NVidiaVB) + return; + + // if we do not activate the same (NB: newVBHard==NULL if not a VBHard). + if(_CurrentVertexBufferHard!=newVBHard) + { + // get NVidia interface + CVertexBufferHardGLNVidia *vbHardNV= static_cast(_CurrentVertexBufferHard); + + // If some render() have been done with this VB. + if( vbHardNV->GPURenderingAfterFence ) + { + /* + Since we won't work with this VB for a long time, we set a fence. + + NB: if the fence was previously set. NV_Fence Specification says that the new ONE replaces it. + This is EXACTLY what we wants, since the old one is no more interesting. + + NB: never insert a fence for said "Static Lock" VBHard. Those VBHard are said to be "static" + therefore, user should never modify them (else lock() is much slower...) + */ + if( !vbHardNV->getLockHintStatic() ) + vbHardNV->setFence(); + // Since we have set a new Fence, we won't need to do it at next vbHardNV->lock() + vbHardNV->GPURenderingAfterFence= false; + } + } +#endif +} + +// *************************************************************************** + +CIndexBufferInfo::CIndexBufferInfo() +{ + H_AUTO_OGL(CIndexBufferInfo_CIndexBufferInfo) + _Values = NULL; +} + +// *************************************************************************** + +void CIndexBufferInfo::setupIndexBuffer(CIndexBuffer &ib) +{ + H_AUTO_OGL(CIndexBufferInfo_setupIndexBuffer) + CIndexBufferReadWrite access; + ib.lock (access); + _Values = access.getPtr(); + _Format = access.getFormat(); +} + +// *************************************************************************** + +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} // NL3D diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.cpp new file mode 100644 index 000000000..60109cfb6 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.cpp @@ -0,0 +1,1674 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "stdopengl.h" + +#include "driver_opengl.h" +#include "driver_opengl_vertex_buffer_hard.h" + +#include "nel/3d/vertex_buffer.h" + +using namespace std; +using namespace NLMISC; + +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + +// *************************************************************************** +// *************************************************************************** +// *************************************************************************** +// +// VBHard interface for both NVidia / ATI extension. +// +// *************************************************************************** +// *************************************************************************** +// *************************************************************************** + + + +// *************************************************************************** +IVertexArrayRange::IVertexArrayRange(CDriverGL *drv) +{ + H_AUTO_OGL(IVertexArrayRange_IVertexArrayRange) + _Driver= drv; +} +// *************************************************************************** +IVertexArrayRange::~IVertexArrayRange() +{ + H_AUTO_OGL(IVertexArrayRange_IVertexArrayRangeDtor) +} + +// *************************************************************************** +IVertexBufferHardGL::IVertexBufferHardGL(CDriverGL *drv, CVertexBuffer *vb) : VB (vb) +{ + H_AUTO_OGL(IVertexBufferHardGL_IVertexBufferHardGL) + _Driver= drv; + GPURenderingAfterFence= false; + VBType = UnknownVB; + _Invalid = false; +} +// *************************************************************************** +IVertexBufferHardGL::~IVertexBufferHardGL() +{ + H_AUTO_OGL(IVertexBufferHardGL_IVertexBufferHardGLDtor) +} + +#ifndef USE_OPENGLES + +// *************************************************************************** +// *************************************************************************** +// *************************************************************************** +// +// NVidia implementation +// +// *************************************************************************** +// *************************************************************************** +// *************************************************************************** + + + +// *************************************************************************** +// CVertexArrayRangeNVidia +// *************************************************************************** + + +// *************************************************************************** +CVertexArrayRangeNVidia::CVertexArrayRangeNVidia(CDriverGL *drv) : IVertexArrayRange(drv) +{ + H_AUTO_OGL(CVertexArrayRangeNVidia_CVertexArrayRangeNVidia) + _VertexArrayPtr= NULL; + _VertexArraySize= 0; +} + + +// *************************************************************************** +bool CVertexArrayRangeNVidia::allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType) +{ + H_AUTO_OGL(CVertexArrayRangeNVidia_allocate) + nlassert(_VertexArrayPtr==NULL); + + // try to allocate AGP or VRAM data. + switch(vbType) + { +#ifdef NL_OS_WINDOWS + case CVertexBuffer::AGPPreferred: + _VertexArrayPtr= nwglAllocateMemoryNV(size, 0, 0, 0.5f); + break; + case CVertexBuffer::StaticPreferred: + if (_Driver->getStaticMemoryToVRAM()) + _VertexArrayPtr= nwglAllocateMemoryNV(size, 0, 0, 1.0f); + else + _VertexArrayPtr= nwglAllocateMemoryNV(size, 0, 0, 0.5f); + break; +#elif defined(NL_OS_MAC) + // TODO: implement for Mac OS X +#elif defined(NL_OS_UNIX) + case CVertexBuffer::AGPPreferred: + _VertexArrayPtr= nglXAllocateMemoryNV(size, 0, 0, 0.5f); + break; + case CVertexBuffer::StaticPreferred: + if (_Driver->getStaticMemoryToVRAM()) + _VertexArrayPtr= nglXAllocateMemoryNV(size, 0, 0, 1.0f); + else + _VertexArrayPtr= nglXAllocateMemoryNV(size, 0, 0, 0.5f); + break; +#endif // NL_OS_WINDOWS + default: + break; + } + + // init the allocator. + if(_VertexArrayPtr) + { + /* Init with an alignment of 8. Not sure it is useful, but GDC01_Performance.pdf papers talks about + "Data arrays must be 8-byte aligned". Don't know what "Data" is. + */ + _HeapMemory.initHeap(_VertexArrayPtr, size, 8); + + // set the size + _VertexArraySize= size; + } + + + return _VertexArrayPtr!=NULL; +} + + +// *************************************************************************** +uint CVertexArrayRangeNVidia::sizeAllocated() const +{ + H_AUTO_OGL(CVertexArrayRangeNVidia_sizeAllocated) + return _VertexArraySize; +} + + +// *************************************************************************** +void CVertexArrayRangeNVidia::free() +{ + H_AUTO_OGL(CVertexArrayRangeNVidia_free) + // release the ptr. + if(_VertexArrayPtr) + { + // reset the allocator. + _HeapMemory.reset(); + +#ifdef NL_OS_WINDOWS + // Free special memory. + nwglFreeMemoryNV(_VertexArrayPtr); +#elif defined(NL_OS_MAC) + // TODO: implement for Mac OS X +#elif defined(NL_OS_UNIX) + nglXFreeMemoryNV(_VertexArrayPtr); +#endif // NL_OS_WINDOWS + + _VertexArrayPtr= NULL; + _VertexArraySize= 0; + } +} + + +// *************************************************************************** +void CVertexArrayRangeNVidia::enable() +{ + H_AUTO_OGL(CVertexArrayRangeNVidia_enable) + // if not already enabled. + if(_Driver->_CurrentVertexArrayRange!=this) + { + // Setup the ptrs only if differnets from last time (may rarely happens) + if( _Driver->_NVCurrentVARSize != _VertexArraySize || _Driver->_NVCurrentVARPtr != _VertexArrayPtr) + { + // Yoyo: NVidia Bug ?? must do this strange thing, this ensure that it is correclty setuped. + glFinish(); + nglVertexArrayRangeNV(_VertexArraySize, _VertexArrayPtr); + glEnableClientState(GL_VERTEX_ARRAY_RANGE_NV); + glVertexPointer(3,GL_FLOAT, 0, _VertexArrayPtr); + // cache. + _Driver->_NVCurrentVARSize= _VertexArraySize; + _Driver->_NVCurrentVARPtr= _VertexArrayPtr; + } + // enable VAR. NB: flush is useless, so don't flush if extension is OK + glEnableClientState(_Driver->_Extensions.NVStateVARWithoutFlush); + _Driver->_CurrentVertexArrayRange= this; + } +} + + +// *************************************************************************** +void CVertexArrayRangeNVidia::disable() +{ + H_AUTO_OGL(CVertexArrayRangeNVidia_disable) + // if not already disabled. + if(_Driver->_CurrentVertexArrayRange!=NULL) + { + // just disable the state, don't change VAR ptr setup. + // NB: flush is useless, so don't flush if extension is OK + glDisableClientState(_Driver->_Extensions.NVStateVARWithoutFlush); + _Driver->_CurrentVertexArrayRange= NULL; + } +} + + +// *************************************************************************** +void *CVertexArrayRangeNVidia::allocateVB(uint32 size) +{ + H_AUTO_OGL(CVertexArrayRangeNVidia_allocateVB) + return _HeapMemory.allocate(size); +} + + +// *************************************************************************** +void CVertexArrayRangeNVidia::freeVB(void *ptr) +{ + H_AUTO_OGL(CVertexArrayRangeNVidia_freeVB) + _HeapMemory.free(ptr); +} + + +// *************************************************************************** +IVertexBufferHardGL *CVertexArrayRangeNVidia::createVBHardGL(uint size, CVertexBuffer *vb) +{ + H_AUTO_OGL(CVertexArrayRangeNVidia_createVBHardGL) + // create a NVidia VBHard + CVertexBufferHardGLNVidia *newVbHard= new CVertexBufferHardGLNVidia(_Driver, vb); + + // try to allocate + void *vertexPtr = 0; + if( allocated() ) + { + vertexPtr= allocateVB(size); + } + + // If allocation fails. + if( !vertexPtr ) + { + // just destroy this object (no free()). + delete newVbHard; + return NULL; + } + else + { + // Ok, setup, and allocate the fence. + newVbHard->initGL(this, vertexPtr); + return newVbHard; + } +} + + +// *************************************************************************** +// CVertexBufferHardGLNVidia +// *************************************************************************** + + +// *************************************************************************** +CVertexBufferHardGLNVidia::CVertexBufferHardGLNVidia(CDriverGL *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb) +{ + H_AUTO_OGL(CVertexBufferHardGLNVidia_CVertexBufferHardGLNVidia) + _VertexArrayRange= NULL; + _VertexPtr= NULL; + + GPURenderingAfterFence= false; + _FenceSet= false; + + // Flag our type + VBType = NVidiaVB; + + // default: dynamic Loick + _LockHintStatic= false; +} + + +// *************************************************************************** +CVertexBufferHardGLNVidia::~CVertexBufferHardGLNVidia() +{ + H_AUTO_OGL(CVertexBufferHardGLNVidia_CVertexBufferHardGLNVidiaDtor) + if(_VertexArrayRange) + { + // Destroy Fence. + // First wait for completion. + finishFence(); + // then delete. + nglDeleteFencesNV(1, &_Fence); + + // Then free the VAR. + _VertexArrayRange->freeVB(_VertexPtr); + _VertexPtr= NULL; + _VertexArrayRange= NULL; + } +} + + +// *************************************************************************** +void CVertexBufferHardGLNVidia::initGL(CVertexArrayRangeNVidia *var, void *vertexPtr) +{ + H_AUTO_OGL(CVertexBufferHardGLNVidia_initGL) + _VertexArrayRange= var; + _VertexPtr= vertexPtr; + nglGenFencesNV(1, &_Fence); +} + + +// *************************************************************************** +void *CVertexBufferHardGLNVidia::lock() +{ + H_AUTO_OGL(CVertexBufferHardGLNVidia_lock) + // sync the 3d card with the system. + + // If the user lock an activated VBHard, after rendering some primitives, we must stall the CPU + // Also always do this for Static Lock VBHard (because no setFence are inserted after rendering + if(GPURenderingAfterFence || _LockHintStatic) + { + // Set a new fence at the current position in the command stream, replacing the old one + setFence(); + // And so the GPU has rendered all our primitives. + GPURenderingAfterFence= false; + } + + // Lock Profile? + TTicks beforeLock = 0; + if(_Driver->_VBHardProfiling) + { + beforeLock= CTime::getPerformanceTime(); + } + + // Ensure the GPU has finished with the current VBHard. + finishFence(); + + // Lock Profile? + if(_Driver->_VBHardProfiling) + { + TTicks afterLock; + afterLock= CTime::getPerformanceTime(); + _Driver->appendVBHardLockProfile(afterLock-beforeLock, VB); + } + + return _VertexPtr; +} + + +// *************************************************************************** +void CVertexBufferHardGLNVidia::unlock() +{ + H_AUTO_OGL(CVertexBufferHardGLNVidia_unlock) + // no op. +} + +// *************************************************************************** +void CVertexBufferHardGLNVidia::unlock(uint /* start */, uint /* end */) +{ + H_AUTO_OGL(CVertexBufferHardGLNVidia_unlock_start_end) + // no op. + // NB: start-end only useful for ATI ext. +} + +// *************************************************************************** +void *CVertexBufferHardGLNVidia::getPointer() +{ + H_AUTO_OGL(CVertexBufferHardGLNVidia_getPointer) + return _VertexPtr; +} + +// *************************************************************************** +void CVertexBufferHardGLNVidia::enable() +{ + H_AUTO_OGL(CVertexBufferHardGLNVidia_enable) + if(_Driver->_CurrentVertexBufferHard != this) + { + nlassert(_VertexArrayRange); + _VertexArrayRange->enable(); + _Driver->_CurrentVertexBufferHard= this; + } +} + + +// *************************************************************************** +void CVertexBufferHardGLNVidia::disable() +{ + H_AUTO_OGL(CVertexBufferHardGLNVidia_disbale) + if(_Driver->_CurrentVertexBufferHard != NULL) + { + nlassert(_VertexArrayRange); + _VertexArrayRange->disable(); + _Driver->_CurrentVertexBufferHard= NULL; + } +} + +// *************************************************************************** +void CVertexBufferHardGLNVidia::lockHintStatic(bool staticLock) +{ + H_AUTO_OGL(CVertexBufferHardGLNVidia_lockHintStatic) + // Store the flag. + _LockHintStatic= staticLock; +} + +// *************************************************************************** + +void CVertexBufferHardGLNVidia::setupVBInfos(CVertexBufferInfo &vb) +{ + H_AUTO_OGL(CVertexBufferHardGLNVidia_setupVBInfos) + vb.VBMode = CVertexBufferInfo::HwNVIDIA; +} + +// *************************************************************************** +void CVertexBufferHardGLNVidia::setFence() +{ + H_AUTO_OGL(CVertexBufferHardGLNVidia_setFence) + // NB: if the Fence was set and not finished, then the new one will KICK the old. + nglSetFenceNV(_Fence, GL_ALL_COMPLETED_NV); + _FenceSet= true; +} + +// *************************************************************************** +void CVertexBufferHardGLNVidia::finishFence() +{ + H_AUTO_OGL(CVertexBufferHardGLNVidia_finishFence) + if(isFenceSet()) + { + // Stall CPU while the fence command is not reached in the GPU command stream. + nglFinishFenceNV(_Fence); + _FenceSet= false; + } +} + +// *************************************************************************** +void CVertexBufferHardGLNVidia::testFence() +{ + + H_AUTO_OGL(CVertexBufferHardGLNVidia_testFence) + if(isFenceSet()) + { + // Don't stall the CPU + GLboolean b= nglTestFenceNV(_Fence); + // if completed + if(b==GL_TRUE) + _FenceSet= false; + } +} + + + +// *************************************************************************** +// *************************************************************************** +// *************************************************************************** +// +// ATI implementation +// +// *************************************************************************** +// *************************************************************************** +// *************************************************************************** + + +// *************************************************************************** +// CVertexArrayRangeATI +// *************************************************************************** + + +// *************************************************************************** +CVertexArrayRangeATI::CVertexArrayRangeATI(CDriverGL *drv) : IVertexArrayRange(drv) +{ + H_AUTO_OGL(CVertexArrayRangeATI_CVertexArrayRangeATI) + _Allocated= false; + _VertexObjectId= 0; + _VertexArraySize= 0; +} +// *************************************************************************** +bool CVertexArrayRangeATI::allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType) +{ + H_AUTO_OGL(CVertexArrayRangeATI_allocate) + nlassert(!_Allocated); + + // try to allocate AGP (suppose mean ATI dynamic) or VRAM (suppose mean ATI static) data. + switch(vbType) + { + case CVertexBuffer::AGPPreferred: + _VertexObjectId= nglNewObjectBufferATI(size, NULL, GL_DYNAMIC_ATI); + break; + case CVertexBuffer::StaticPreferred: + if (_Driver->getStaticMemoryToVRAM()) + _VertexObjectId= nglNewObjectBufferATI(size, NULL, GL_STATIC_ATI); + else + _VertexObjectId= nglNewObjectBufferATI(size, NULL, GL_DYNAMIC_ATI); + break; + default: + break; + }; + + + // init the allocator, if success + if( nglIsObjectBufferATI(_VertexObjectId) ) + { + _Allocated= true; + /* Init with an alignment of 8. Not sure if it is useful. + Init With a FAKE memory starting at NL3D_DRV_ATI_FAKE_MEM_START + */ + _HeapMemory.initHeap((void*)NL3D_DRV_ATI_FAKE_MEM_START, size, 8); + + // set the size + _VertexArraySize= size; + + // Ok! + return true; + } + else + { + // failure. + return false; + } +} +// *************************************************************************** +uint CVertexArrayRangeATI::sizeAllocated() const +{ + H_AUTO_OGL(CVertexArrayRangeATI_sizeAllocated) + return _VertexArraySize; +} +// *************************************************************************** +void CVertexArrayRangeATI::free() +{ + H_AUTO_OGL(CVertexArrayRangeATI_free) + // release the ptr. + if(_Allocated) + { + // reset the allocator. + _HeapMemory.reset(); + + // Free special memory. + nglDeleteObjectBufferATI(_VertexObjectId); + + _Allocated= false; + _VertexArraySize= 0; + } +} +// *************************************************************************** +IVertexBufferHardGL *CVertexArrayRangeATI::createVBHardGL(uint size, CVertexBuffer *vb) +{ + H_AUTO_OGL(CVertexArrayRangeATI_createVBHardGL) + // create a ATI VBHard + CVertexBufferHardGLATI *newVbHard= new CVertexBufferHardGLATI(_Driver, vb); + + // try to allocate + void *vertexPtr =NULL; + if( _Allocated ) + { + vertexPtr= allocateVB(size); + } + + // If allocation fails. + if( !vertexPtr ) + { + // just destroy this object (no free()). + delete newVbHard; + return NULL; + } + else + { + // Then try to create a RAM mirror in the VB. + if( newVbHard->createRAMMirror(size) ) + { + // Ok, setup + newVbHard->initGL(this, vertexPtr); + return newVbHard; + } + else + { + // Discard the VB. + delete newVbHard; + return NULL; + } + } +} +// *************************************************************************** +void CVertexArrayRangeATI::enable() +{ + H_AUTO_OGL(CVertexArrayRangeATI_enable) + // No-op for ATI !!! + _Driver->_CurrentVertexArrayRange= this; +} +// *************************************************************************** +void CVertexArrayRangeATI::disable() +{ + H_AUTO_OGL(CVertexArrayRangeATI_disable) + // No-op for ATI !!! + _Driver->_CurrentVertexArrayRange= NULL; +} +// *************************************************************************** +void *CVertexArrayRangeATI::allocateVB(uint32 size) +{ + H_AUTO_OGL(CVertexArrayRangeATI_allocateVB) + return _HeapMemory.allocate(size); +} +// *************************************************************************** +void CVertexArrayRangeATI::freeVB(void *ptr) +{ + H_AUTO_OGL(CVertexArrayRangeATI_freeVB) + _HeapMemory.free(ptr); +} + + +// *************************************************************************** +// CVertexBufferHardGLATI +// *************************************************************************** + + +// *************************************************************************** +CVertexBufferHardGLATI::CVertexBufferHardGLATI(CDriverGL *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb) +{ + H_AUTO_OGL(CVertexBufferHardGLATI_CVertexBufferHardGLATI) + _VertexArrayRange= NULL; + _VertexPtr= NULL; + _RAMMirrorVertexPtr= NULL; + _RAMMirrorVertexSize= 0; + + // Flag our type + VBType = ATIVB; +} + + +// *************************************************************************** +CVertexBufferHardGLATI::~CVertexBufferHardGLATI() +{ + H_AUTO_OGL(CVertexBufferHardGLATI_CVertexBufferHardGLATIDtor) + if(_VertexArrayRange) + { + // free the VAR. + _VertexArrayRange->freeVB(_VertexPtr); + _VertexPtr= NULL; + _VertexArrayRange= NULL; + } + + if(_RAMMirrorVertexPtr) + { + delete [] ((uint8*)_RAMMirrorVertexPtr); + _RAMMirrorVertexPtr= NULL; + _RAMMirrorVertexSize= 0; + } +} + + +// *************************************************************************** +bool CVertexBufferHardGLATI::createRAMMirror(uint memSize) +{ + H_AUTO_OGL(CVertexBufferHardGLATI_createRAMMirror) + // delete old if any + if(_RAMMirrorVertexPtr) + { + free(_RAMMirrorVertexPtr); + _RAMMirrorVertexPtr= NULL; + _RAMMirrorVertexSize= 0; + } + // create + _RAMMirrorVertexPtr = (void*)new uint8[memSize]; + if(_RAMMirrorVertexPtr) + { + _RAMMirrorVertexSize= memSize; + return true; + } + else + return false; +} + + +// *************************************************************************** +void CVertexBufferHardGLATI::initGL(CVertexArrayRangeATI *var, void *vertexPtr) +{ + H_AUTO_OGL(CVertexBufferHardGLATI_initGL) + _VertexArrayRange= var; + _VertexPtr= vertexPtr; +} + + +// *************************************************************************** +void *CVertexBufferHardGLATI::lock() +{ + H_AUTO_OGL(CVertexBufferHardGLATI_lock) + // return directly the mirror one. => client will write into RAM. + return _RAMMirrorVertexPtr; +} + + +// *************************************************************************** +void CVertexBufferHardGLATI::unlock() +{ + H_AUTO_OGL(CVertexBufferHardGLATI_unlock) + // Copy All mirror into the ATI Vertex Object + nglUpdateObjectBufferATI(getATIVertexObjectId(), (ptrdiff_t)_VertexPtr - NL3D_DRV_ATI_FAKE_MEM_START, + _RAMMirrorVertexSize, _RAMMirrorVertexPtr, GL_PRESERVE_ATI); +} + + +// *************************************************************************** +void CVertexBufferHardGLATI::unlock(uint start, uint end) +{ + H_AUTO_OGL(CVertexBufferHardGLATI_unlosk_start_end) + unlock(); + // clamp end. + if(end>VB->getNumVertices()*VB->getVertexSize()) + end=VB->getNumVertices()*VB->getVertexSize(); + + // verify bound. + //if(start>=end) + // return; + if (start == 0 && end == 0) + { + end = VB->getVertexSize() * VB->getNumVertices(); + } + + // Copy a subset of the mirror into the ATI Vertex Object + uint size= end-start; + uint srcOffStart= start; + uint dstOffStart= ((ptrdiff_t)_VertexPtr - NL3D_DRV_ATI_FAKE_MEM_START) + srcOffStart; + // copy. + nglUpdateObjectBufferATI(getATIVertexObjectId(), dstOffStart, + size, (uint8*)_RAMMirrorVertexPtr + srcOffStart, GL_PRESERVE_ATI); +} + + +// *************************************************************************** +void *CVertexBufferHardGLATI::getPointer() +{ + H_AUTO_OGL(CVertexBufferHardGLATI_getPointer) + return (uint8 *) _VertexPtr - NL3D_DRV_ATI_FAKE_MEM_START; +} + +// *************************************************************************** +void CVertexBufferHardGLATI::enable() +{ + H_AUTO_OGL(CVertexBufferHardGLATI_enable) + if(_Driver->_CurrentVertexBufferHard != this) + { + nlassert(_VertexArrayRange); + _VertexArrayRange->enable(); + _Driver->_CurrentVertexBufferHard= this; + } +} + + +// *************************************************************************** +void CVertexBufferHardGLATI::disable() +{ + H_AUTO_OGL(CVertexBufferHardGLATI_disbale) + if(_Driver->_CurrentVertexBufferHard != NULL) + { + nlassert(_VertexArrayRange); + _VertexArrayRange->disable(); + _Driver->_CurrentVertexBufferHard= NULL; + } +} + +// *************************************************************************** +void CVertexBufferHardGLATI::lockHintStatic(bool /* staticLock */) +{ + H_AUTO_OGL(CVertexBufferHardGLATI_lockHintStatic) + // no op. +} + +// *************************************************************************** + +void CVertexBufferHardGLATI::setupVBInfos(CVertexBufferInfo &vb) +{ + H_AUTO_OGL(CVertexBufferHardGLATI_setupVBInfos) + vb.VBMode = CVertexBufferInfo::HwATI; + vb.VertexObjectId = getATIVertexObjectId(); +} + +// *************************************************************************** + +// *************************************************************************** +// *************************************************************************** +// *************************************************************************** +// +// ATI implementation, version 2 using the map object buffer extension +// +// *************************************************************************** +// *************************************************************************** +// *************************************************************************** + + +// *************************************************************************** +// CVertexArrayRangeMapObjectATI +// *************************************************************************** + + +// *************************************************************************** +CVertexArrayRangeMapObjectATI::CVertexArrayRangeMapObjectATI(CDriverGL *drv) : IVertexArrayRange(drv), + _VBType(CVertexBuffer::AGPPreferred), + _SizeAllocated(0) +{ + H_AUTO_OGL(CVertexArrayRangeMapObjectATI_CVertexArrayRangeMapObjectATI) +} + +// *************************************************************************** +bool CVertexArrayRangeMapObjectATI::allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType) +{ + H_AUTO_OGL(CVertexArrayRangeMapObjectATI_allocate) + // We don't manage memory ourselves, but test if there's enough room anyway + GLuint vertexObjectId; + switch(vbType) + { + case CVertexBuffer::AGPPreferred: + vertexObjectId = nglNewObjectBufferATI(size, NULL, GL_DYNAMIC_ATI); + break; + case CVertexBuffer::StaticPreferred: + if (_Driver->getStaticMemoryToVRAM()) + vertexObjectId = nglNewObjectBufferATI(size, NULL, GL_STATIC_ATI); + else + vertexObjectId = nglNewObjectBufferATI(size, NULL, GL_DYNAMIC_ATI); + break; + default: + vertexObjectId = 0; + break; + } + if (vertexObjectId) + { + // free the object + nglDeleteObjectBufferATI(vertexObjectId); + // + _SizeAllocated = size; + _VBType = vbType; + return true; + } + return false; +} + +// *************************************************************************** +void CVertexArrayRangeMapObjectATI::free() +{ + H_AUTO_OGL(CVertexArrayRangeMapObjectATI_free) + _SizeAllocated = 0; +} + +// *************************************************************************** +IVertexBufferHardGL *CVertexArrayRangeMapObjectATI::createVBHardGL(uint size, CVertexBuffer *vb) +{ + H_AUTO_OGL(CVertexArrayRangeMapObjectATI_createVBHardGL) + // create a ATI VBHard + CVertexBufferHardGLMapObjectATI *newVbHard= new CVertexBufferHardGLMapObjectATI(_Driver, vb); + uint vertexObjectId; + // just allocate a new buffer.. + switch(_VBType) + { + case CVertexBuffer::AGPPreferred: + vertexObjectId = nglNewObjectBufferATI(size, NULL, GL_DYNAMIC_ATI); + break; + case CVertexBuffer::StaticPreferred: + if (_Driver->getStaticMemoryToVRAM()) + vertexObjectId = nglNewObjectBufferATI(size, NULL, GL_STATIC_ATI); + else + vertexObjectId = nglNewObjectBufferATI(size, NULL, GL_DYNAMIC_ATI); + break; + default: + vertexObjectId = 0; + break; + }; + // init the allocator, if success + if( nglIsObjectBufferATI(vertexObjectId) ) + { + newVbHard->initGL(this, vertexObjectId); + return newVbHard; + } + else + { + delete newVbHard; + return NULL; + } +} + +// *************************************************************************** +void CVertexArrayRangeMapObjectATI::enable() +{ + H_AUTO_OGL(CVertexArrayRangeMapObjectATI_enable) +} + +// *************************************************************************** +void CVertexArrayRangeMapObjectATI::disable() +{ + H_AUTO_OGL(CVertexArrayRangeMapObjectATI_disbale) +} + + + +// *************************************************************************** +// CVertexBufferHardGLMapObjectATI +// *************************************************************************** + +// *************************************************************************** +CVertexBufferHardGLMapObjectATI::CVertexBufferHardGLMapObjectATI(CDriverGL *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb), + _VertexPtr(NULL), + _VertexArrayRange(NULL), + _VertexObjectId(0) +{ + H_AUTO_OGL(CVertexBufferHardGLMapObjectATI_CVertexBufferHardGLMapObjectATI) + // Flag our type + VBType = ATIMapObjectVB; +} + +// *************************************************************************** +CVertexBufferHardGLMapObjectATI::~CVertexBufferHardGLMapObjectATI() +{ + H_AUTO_OGL(CVertexBufferHardGLMapObjectATI_CVertexBufferHardGLMapObjectATIDtor) + if (_VertexObjectId) nglDeleteObjectBufferATI(_VertexObjectId); + #ifdef NL_DEBUG + if (_VertexPtr) + { + _VertexArrayRange->_MappedVBList.erase(_IteratorInMappedVBList); + } + #endif + if (_VertexArrayRange) + { + if (_Invalid) + { + if (VB->getLocation() != CVertexBuffer::NotResident) + { + // when the vb is put in tthe NotResident state, it is removed from that list + _VertexArrayRange->_LostVBList.erase(_IteratorInLostVBList); + } + } + } +} + +// *************************************************************************** +void *CVertexBufferHardGLMapObjectATI::lock() +{ + H_AUTO_OGL(CVertexBufferHardGLMapObjectATI_lock) + if (_VertexPtr) return _VertexPtr; // already locked + if (_Invalid) + { + if (VB->getLocation() != CVertexBuffer::NotResident) + { + nlassert(!_DummyVB.empty()); + return &_DummyVB[0]; + } + // recreate a vb + const uint size = VB->getNumVertices() * VB->getVertexSize(); + nlassert(!_VertexObjectId); + switch(_VertexArrayRange->getVBType()) + { + case CVertexBuffer::AGPPreferred: + _VertexObjectId = nglNewObjectBufferATI(size, NULL, GL_DYNAMIC_ATI); + break; + case CVertexBuffer::StaticPreferred: + if (_Driver->getStaticMemoryToVRAM()) + _VertexObjectId = nglNewObjectBufferATI(size, NULL, GL_STATIC_ATI); + else + _VertexObjectId = nglNewObjectBufferATI(size, NULL, GL_DYNAMIC_ATI); + break; + default: + break; + }; + if (!_VertexObjectId) + { + _Driver->incrementResetCounter(); + nlassert(!_DummyVB.empty()); + return &_DummyVB[0]; + } + NLMISC::contReset(_DummyVB); // free vector memory for real + nlassert(_VertexObjectId); + _Invalid = false; + _VertexArrayRange->_LostVBList.erase(_IteratorInLostVBList); + // continue to standard mapping code below .. + } + if (!_VertexObjectId) return NULL; + _VertexPtr = nglMapObjectBufferATI(_VertexObjectId); + if (!_VertexPtr) + { + nglUnmapObjectBufferATI(_VertexObjectId); + nlassert(nglIsObjectBufferATI(_VertexObjectId)); + invalidate(); + return &_DummyVB[0]; + } + #ifdef NL_DEBUG + _VertexArrayRange->_MappedVBList.push_front(this); + _IteratorInMappedVBList = _VertexArrayRange->_MappedVBList.begin(); + #endif + return _VertexPtr; + + +} + +// *************************************************************************** +void CVertexBufferHardGLMapObjectATI::invalidate() +{ + H_AUTO_OGL(CVertexBufferHardGLMapObjectATI_invalidate) + nlassert(!_Invalid); + // Buffer is lost (maybe there was a alt-tab or fullscrren / windowed change) + // Buffer is deleted at end of frame only + _Invalid = true; + _Driver->incrementResetCounter(); + _DummyVB.resize(VB->getNumVertices() * VB->getVertexSize(), 0); + // insert in lost vb list + _VertexArrayRange->_LostVBList.push_front(this); + _IteratorInLostVBList = _VertexArrayRange->_LostVBList.begin(); +} + +// *************************************************************************** +void CVertexBufferHardGLMapObjectATI::unlock() +{ + H_AUTO_OGL(CVertexBufferHardGLMapObjectATI_unlock) + #ifdef NL_DEBUG + if (_VertexPtr) + { + _VertexArrayRange->_MappedVBList.erase(_IteratorInMappedVBList); + } + #endif + _VertexPtr = NULL; + if (_Invalid) return; + if (!_VertexObjectId) return; + #ifdef NL_DEBUG + _Unmapping = true; + #endif + nglUnmapObjectBufferATI(_VertexObjectId); + #ifdef NL_DEBUG + _Unmapping = false; + #endif +} + +// *************************************************************************** +void *CVertexBufferHardGLMapObjectATI::getPointer() +{ + H_AUTO_OGL(CVertexBufferHardGLMapObjectATI_getPointer) + return _VertexPtr; +} + +// *************************************************************************** +void CVertexBufferHardGLMapObjectATI::unlock(uint /* start */,uint /* endVert */) +{ + H_AUTO_OGL(CVertexBufferHardGLMapObjectATI_unlock) + unlock(); // can't do a lock on a range of the vb.. +} + +// *************************************************************************** +void CVertexBufferHardGLMapObjectATI::enable() +{ + H_AUTO_OGL(CVertexBufferHardGLMapObjectATI_enable) + if(_Driver->_CurrentVertexBufferHard != this) + { + /* nlassert(_VertexArrayRange); + _VertexArrayRange->enable(); */ + _Driver->_CurrentVertexBufferHard= this; + } +} + +// *************************************************************************** +void CVertexBufferHardGLMapObjectATI::disable() +{ + H_AUTO_OGL(CVertexBufferHardGLMapObjectATI_disable) + if(_Driver->_CurrentVertexBufferHard != NULL) + { + /* nlassert(_VertexArrayRange); + _VertexArrayRange->disable(); */ + _Driver->_CurrentVertexBufferHard= NULL; + } +} + +// *************************************************************************** +void CVertexBufferHardGLMapObjectATI::initGL(CVertexArrayRangeMapObjectATI *var, uint vertexObjectID) +{ + H_AUTO_OGL(CVertexBufferHardGLMapObjectATI_initGL) + _VertexArrayRange = var; + _VertexObjectId = vertexObjectID; +} + +// *************************************************************************** +void CVertexBufferHardGLMapObjectATI::lockHintStatic(bool /* staticLock */) +{ + H_AUTO_OGL(CVertexBufferHardGLMapObjectATI_lockHintStatix) + // no op. +} + +// *************************************************************************** +void CVertexBufferHardGLMapObjectATI::setupVBInfos(CVertexBufferInfo &vb) +{ + H_AUTO_OGL(CVertexBufferHardGLMapObjectATI_setupVBInfos) + vb.VBMode = CVertexBufferInfo::HwATI; + vb.VertexObjectId = getATIVertexObjectId(); +} + +// *************************************************************************** +void CVertexArrayRangeMapObjectATI::updateLostBuffers() +{ + H_AUTO_OGL(CVertexArrayRangeMapObjectATI_updateLostBuffers) + // Put all vb that have been lost in the NotResident state so that they will be recomputed + // We do this only if the app is active, because if vb were lost, it is likely that there are no resources available. + nlassert(_Driver); + if (_Driver->isWndActive()) + { + for(std::list::iterator it = _LostVBList.begin(); it != _LostVBList.end(); ++it) + { + nlassert((*it)->_VertexObjectId); + nlassert(nglIsObjectBufferATI((*it)->_VertexObjectId)); + nglDeleteObjectBufferATI((*it)->_VertexObjectId); + (*it)->_VertexObjectId = 0; + (*it)->VB->setLocation(CVertexBuffer::NotResident); + } + _LostVBList.clear(); + } +} +// *************************************************************************** +#ifdef NL_DEBUG + void CVertexArrayRangeMapObjectATI::dumpMappedBuffers() + { + nlwarning("*****************************************************"); + nlwarning("Mapped buffers :"); + for(std::list::iterator it = _MappedVBList.begin(); it != _MappedVBList.end(); ++it) + { + CVertexBufferHardGLMapObjectATI &vbati = **it; + nlwarning("Buffer id = %u, size = %u, address = %p", vbati._VertexObjectId, vbati.VB->getVertexSize() * vbati.VB->getNumVertices(), vbati.getPointer()); + } + } +#endif + +#endif // USE_OPENGLES + + +// *************************************************************************** +// *************************************************************************** +// *************************************************************************** +// ARB implementation +// *************************************************************************** +// *************************************************************************** +// *************************************************************************** + + +// *************************************************************************** +// CVertexArrayRangeARB +// *************************************************************************** + + +// *************************************************************************** +CVertexArrayRangeARB::CVertexArrayRangeARB(CDriverGL *drv) : IVertexArrayRange(drv), + _VBType(CVertexBuffer::AGPPreferred), + _SizeAllocated(0) +{ + H_AUTO_OGL(CVertexArrayRangeARB_CVertexArrayRangeARB) +} + +// *************************************************************************** +bool CVertexArrayRangeARB::allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType) +{ + H_AUTO_OGL(CVertexArrayRangeARB_allocate) + nlassert(_SizeAllocated == 0); + /* + // We don't manage memory ourselves, but test if there's enough room anyway + GLuint vertexBufferID; + glGetError(); + glGenBuffersARB(1, &vertexBufferID); + if (glGetError() != GL_NO_ERROR) return false; + + switch(vbType) + { + case CVertexBuffer::AGPPreferred: + glBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); + break; + case CVertexBuffer::VRAMPreferred: + glBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_STATIC_DRAW_ARB); + break; + default: + nlassert(0); + break; + } + + if (glGetError() != GL_NO_ERROR) + { + glDeleteBuffersARB(1, &vertexBufferID); + return false; + } + glDeleteBuffersARB(1, &vertexBufferID); + */ + _SizeAllocated = size; + _VBType = vbType; + return true; +} + +// *************************************************************************** +void CVertexArrayRangeARB::free() +{ + H_AUTO_OGL(CVertexArrayRangeARB_free) + _SizeAllocated = 0; +} + +// *************************************************************************** +IVertexBufferHardGL *CVertexArrayRangeARB::createVBHardGL(uint size, CVertexBuffer *vb) +{ + H_AUTO_OGL(CVertexArrayRangeARB_createVBHardGL) + if (!_SizeAllocated) return NULL; + // create a ARB VBHard + GLuint vertexBufferID; + glGetError(); + +#ifdef USE_OPENGLES + glGenBuffers(1, &vertexBufferID); +#else + nglGenBuffersARB(1, &vertexBufferID); +#endif + + if (glGetError() != GL_NO_ERROR) return NULL; + _Driver->_DriverGLStates.forceBindARBVertexBuffer(vertexBufferID); + switch(_VBType) + { + case CVertexBuffer::AGPPreferred: +#ifdef USE_OPENGLES + glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_DYNAMIC_DRAW); +#else + nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); +#endif + break; + case CVertexBuffer::StaticPreferred: + if (_Driver->getStaticMemoryToVRAM()) +#ifdef USE_OPENGLES + glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_STATIC_DRAW); +#else + nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_STATIC_DRAW_ARB); +#endif + else +#ifdef USE_OPENGLES + glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_DYNAMIC_DRAW); +#else + nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); +#endif + break; + default: + nlassert(0); + break; + } + if (glGetError() != GL_NO_ERROR) + { +#ifdef USE_OPENGLES + glDeleteBuffers(1, &vertexBufferID); +#else + nglDeleteBuffersARB(1, &vertexBufferID); +#endif + + return NULL; + } + CVertexBufferHardARB *newVbHard= new CVertexBufferHardARB(_Driver, vb); + newVbHard->initGL(vertexBufferID, this, _VBType); + _Driver->_DriverGLStates.forceBindARBVertexBuffer(0); + return newVbHard; +} + +// *************************************************************************** +void CVertexArrayRangeARB::enable() +{ + H_AUTO_OGL(CVertexArrayRangeARB_enable) + if(_Driver->_CurrentVertexArrayRange != this) + { + _Driver->_CurrentVertexArrayRange= this; + } +} + +// *************************************************************************** +void CVertexArrayRangeARB::disable() +{ + H_AUTO_OGL(CVertexArrayRangeARB_disbale) + if(_Driver->_CurrentVertexBufferHard != NULL) + { + _Driver->_CurrentVertexBufferHard= NULL; + } +} + +// *************************************************************************** +void CVertexArrayRangeARB::updateLostBuffers() +{ + H_AUTO_OGL(CVertexArrayRangeARB_updateLostBuffers) + // Put all vb that have been lost in the NotResident state so that they will be recomputed + // We do this only if the app is active, because if vb were lost, it is likely that there are no resources available. + nlassert(_Driver); + if (_Driver->isWndActive()) + { + for(std::list::iterator it = _LostVBList.begin(); it != _LostVBList.end(); ++it) + { + nlassert((*it)->_VertexObjectId); + GLuint id = (GLuint) (*it)->_VertexObjectId; +#ifdef USE_OPENGLES + nlassert(glIsBuffer(id)); + glDeleteBuffers(1, &id); +#else + nlassert(nglIsBufferARB(id)); + nglDeleteBuffersARB(1, &id); +#endif + (*it)->_VertexObjectId = 0; + (*it)->VB->setLocation(CVertexBuffer::NotResident); + } + _LostVBList.clear(); + } +} + + +// *************************************************************************** +// CVertexBufferHardARB +// *************************************************************************** + + +// *************************************************************************** +CVertexBufferHardARB::CVertexBufferHardARB(CDriverGL *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb), + _VertexPtr(NULL), + _VertexObjectId(0) + +{ + H_AUTO_OGL(CVertexBufferHardARB_CVertexBufferHardARB) + // Flag our type + VBType = ARBVB; + _VertexArrayRange = NULL; + #ifdef NL_DEBUG + _Unmapping = false; + #endif + +#ifdef USE_OPENGLES + _Buffer = NULL; + _BufferSize = 0; + _LastBufferSize = 0; +#endif +} + +// *************************************************************************** +CVertexBufferHardARB::~CVertexBufferHardARB() +{ + H_AUTO_OGL(CVertexBufferHardARB_CVertexBufferHardARBDtor) + if (_Driver && _VertexObjectId) + { + if (_Driver->_DriverGLStates.getCurrBoundARBVertexBuffer() == _VertexObjectId) + { + _Driver->_DriverGLStates.forceBindARBVertexBuffer(0); + } + } + if (_VertexObjectId) + { + GLuint id = (GLuint) _VertexObjectId; +#ifdef USE_OPENGLES + nlassert(glIsBuffer(id)); + glDeleteBuffers(1, &id); +#else + nlassert(nglIsBufferARB(id)); + nglDeleteBuffersARB(1, &id); +#endif + } + if (_VertexArrayRange) + { + if (_Invalid) + { + if (VB->getLocation() != CVertexBuffer::NotResident) + { + // when the vb is put in tthe NotResident state, it is removed from that list + _VertexArrayRange->_LostVBList.erase(_IteratorInLostVBList); + } + } + } + #ifdef NL_DEBUG + if (_VertexPtr) + { + _VertexArrayRange->_MappedVBList.erase(_IteratorInMappedVBList); + } + #endif + +#ifdef USE_OPENGLES + if (_Buffer) + { + delete [] _Buffer; + _Buffer = NULL; + } +#endif +} + +// *************************************************************************** +void *CVertexBufferHardARB::lock() +{ + H_AUTO_OGL(CVertexBufferHardARB_lock); + + if (_VertexPtr) return _VertexPtr; // already locked + if (_Invalid) + { + if (VB->getLocation() != CVertexBuffer::NotResident) + { + nlassert(!_DummyVB.empty()); + return &_DummyVB[0]; + } + // recreate a vb + GLuint vertexBufferID; + +#ifdef USE_OPENGLES + glGenBuffers(1, &vertexBufferID); +#else + nglGenBuffersARB(1, &vertexBufferID); +#endif + + if (glGetError() != GL_NO_ERROR) + { + _Driver->incrementResetCounter(); + return &_DummyVB[0]; + } + const uint size = VB->getNumVertices() * VB->getVertexSize(); + _Driver->_DriverGLStates.forceBindARBVertexBuffer(vertexBufferID); + switch(_MemType) + { + case CVertexBuffer::AGPPreferred: +#ifdef USE_OPENGLES + glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_DYNAMIC_DRAW); +#else + nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); +#endif + break; + case CVertexBuffer::StaticPreferred: + if (_Driver->getStaticMemoryToVRAM()) +#ifdef USE_OPENGLES + glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_STATIC_DRAW); +#else + nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_STATIC_DRAW_ARB); +#endif + else +#ifdef USE_OPENGLES + glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_DYNAMIC_DRAW); +#else + nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); +#endif + break; + default: + nlassert(0); + break; + } + if (glGetError() != GL_NO_ERROR) + { + _Driver->incrementResetCounter(); +#ifdef USE_OPENGLES + glDeleteBuffers(1, &vertexBufferID); +#else + nglDeleteBuffersARB(1, &vertexBufferID); +#endif + return &_DummyVB[0];; + } + _VertexObjectId = vertexBufferID; + NLMISC::contReset(_DummyVB); // free vector memory for real + nlassert(_VertexObjectId); + _Invalid = false; + _VertexArrayRange->_LostVBList.erase(_IteratorInLostVBList); + // continue to standard mapping code below .. + } + TTicks beforeLock = 0; + if(_Driver->_VBHardProfiling) + { + beforeLock= CTime::getPerformanceTime(); + } + _Driver->_DriverGLStates.bindARBVertexBuffer(_VertexObjectId); + +#ifdef USE_OPENGLES + if (_Driver->_Extensions.OESMapBuffer) + { + _VertexPtr = nglMapBufferOES(GL_ARRAY_BUFFER, GL_WRITE_ONLY_OES); + if (!_VertexPtr) + { + nglUnmapBufferOES(GL_ARRAY_BUFFER); + nlassert(glIsBuffer(_VertexObjectId)); + invalidate(); + return &_DummyVB[0]; + } + } + else + { + const uint size = VB->getNumVertices() * VB->getVertexSize(); + + if (size > _BufferSize) + { + if (_Buffer) delete [] _Buffer; + + _Buffer = new uint8[size+3]; + _BufferSize = size; + } + + uint8 offset = (size_t)_Buffer % 4; + + if (offset > 0) offset = 4 - offset; + + _VertexPtr = _Buffer + offset; + _LastBufferSize = size; + } +#else + _VertexPtr = nglMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + if (!_VertexPtr) + { + nglUnmapBufferARB(GL_ARRAY_BUFFER_ARB); + nlassert(nglIsBufferARB((GLuint) _VertexObjectId)); + invalidate(); + return &_DummyVB[0]; + } +#endif + + #ifdef NL_DEBUG + _VertexArrayRange->_MappedVBList.push_front(this); + _IteratorInMappedVBList = _VertexArrayRange->_MappedVBList.begin(); + #endif + _Driver->_DriverGLStates.forceBindARBVertexBuffer(0); + // Lock Profile? + if(_Driver->_VBHardProfiling) + { + TTicks afterLock; + afterLock= CTime::getPerformanceTime(); + _Driver->appendVBHardLockProfile(afterLock-beforeLock, VB); + } + return _VertexPtr; +} + +// *************************************************************************** +void CVertexBufferHardARB::unlock() +{ + H_AUTO_OGL(CVertexBufferHardARB_unlock); + + _VertexPtr = NULL; + if (_Invalid) return; + if (!_VertexObjectId) return; + TTicks beforeLock = 0; + if(_Driver->_VBHardProfiling) + { + beforeLock= CTime::getPerformanceTime(); + } + _Driver->_DriverGLStates.bindARBVertexBuffer(_VertexObjectId); + // double start = CTime::ticksToSecond(CTime::getPerformanceTime()); + #ifdef NL_DEBUG + _Unmapping = true; + #endif + GLboolean unmapOk = GL_FALSE; + +#ifdef USE_OPENGLES + if (_Driver->_Extensions.OESMapBuffer) + { + unmapOk = nglUnmapBufferOES(GL_ARRAY_BUFFER); + } +#else + unmapOk = nglUnmapBufferARB(GL_ARRAY_BUFFER_ARB); +#endif + + #ifdef NL_DEBUG + _Unmapping = false; + #endif + // Lock Profile? + if(_Driver->_VBHardProfiling) + { + TTicks afterLock; + afterLock= CTime::getPerformanceTime(); + _Driver->appendVBHardLockProfile(afterLock-beforeLock, VB); + } + #ifdef NL_DEBUG + _VertexArrayRange->_MappedVBList.erase(_IteratorInMappedVBList); + #endif + _Driver->_DriverGLStates.forceBindARBVertexBuffer(0); + if (!unmapOk) + { + invalidate(); + } + /* double end = CTime::ticksToSecond(CTime::getPerformanceTime()); + nlinfo("3D: Unlock = %f ms", (float) ((end - start) * 1000)); */ +} + +// *************************************************************************** +void *CVertexBufferHardARB::getPointer() +{ + H_AUTO_OGL(CVertexBufferHardARB_getPointer) + return _VertexPtr; +} + +// *************************************************************************** +void CVertexBufferHardARB::unlock(uint /* startVert */,uint /* endVert */) +{ + H_AUTO_OGL(CVertexBufferHardARB_unlock) + unlock(); // can't do a lock on a range of the vb.. +} + +// *************************************************************************** +void CVertexBufferHardARB::enable() +{ + H_AUTO_OGL(CVertexBufferHardARB_enable) + if(_Driver->_CurrentVertexBufferHard != this) + { + /* nlassert(_VertexArrayRange); + _VertexArrayRange->enable(); */ + _Driver->_CurrentVertexBufferHard= this; + } +} + +// *************************************************************************** +void CVertexBufferHardARB::disable() +{ + H_AUTO_OGL(CVertexBufferHardARB_disable) + if(_Driver->_CurrentVertexBufferHard != NULL) + { + /* nlassert(_VertexArrayRange); + _VertexArrayRange->disable(); */ + _Driver->_CurrentVertexBufferHard= NULL; + } +} + +// *************************************************************************** +void CVertexBufferHardARB::initGL(uint vertexObjectID, CVertexArrayRangeARB *var, CVertexBuffer::TPreferredMemory memType) +{ + H_AUTO_OGL(CVertexBufferHardARB_initGL) + _VertexObjectId = vertexObjectID; + _MemType = memType; + _VertexArrayRange = var; +} + +// *************************************************************************** +void CVertexBufferHardARB::lockHintStatic(bool /* staticLock */) +{ + H_AUTO_OGL(CVertexBufferHardARB_lockHintStatic) + // no op. +} + +// *************************************************************************** +void CVertexBufferHardARB::setupVBInfos(CVertexBufferInfo &vb) +{ + H_AUTO_OGL(CVertexBufferHardARB_setupVBInfos) + vb.VBMode = CVertexBufferInfo::HwARB; + vb.VertexObjectId = _VertexObjectId; +} + +// *************************************************************************** +void CVertexBufferHardARB::invalidate() +{ + H_AUTO_OGL(CVertexBufferHardARB_invalidate) + nlassert(!_Invalid); + // Buffer is lost (maybe there was a alt-tab or fullscrren / windowed change) + // Buffer is deleted at end of frame only + _Invalid = true; + _Driver->incrementResetCounter(); + _DummyVB.resize(VB->getNumVertices() * VB->getVertexSize(), 0); + // insert in lost vb list + _VertexArrayRange->_LostVBList.push_front(this); + _IteratorInLostVBList = _VertexArrayRange->_LostVBList.begin(); +} + +// *************************************************************************** +#ifdef NL_DEBUG + void CVertexArrayRangeARB::dumpMappedBuffers() + { + nlwarning("*****************************************************"); + nlwarning("Mapped buffers :"); + for(std::list::iterator it = _MappedVBList.begin(); it != _MappedVBList.end(); ++it) + { + CVertexBufferHardARB &vbarb = **it; + nlwarning("Buffer id = %u, size = %u, address = %p", vbarb._VertexObjectId, vbarb.VB->getVertexSize() * vbarb.VB->getNumVertices(), vbarb.getPointer()); + } + } +#endif + +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} // NL3D + diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.h b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.h new file mode 100644 index 000000000..1ec64ccf2 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.h @@ -0,0 +1,589 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef NL_DRIVER_OPENGL_VERTEX_BUFFER_HARD_H +#define NL_DRIVER_OPENGL_VERTEX_BUFFER_HARD_H + +#include "nel/misc/types_nl.h" + + +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + +class CDriverGL; +class IVertexBufferHardGL; +class CVertexBufferInfo; +class CVertexBufferHardGLMapObjectATI; +class CVertexBufferHardARB; + +// *************************************************************************** +// *************************************************************************** +// VBHard interface for both NVidia / ATI extension. +// *************************************************************************** +// *************************************************************************** + + + + +// *************************************************************************** +/** Interface to a Big block of AGP memory either throurgh NVVertexArrayRange or ATIVertexObject + */ +class IVertexArrayRange +{ +public: + IVertexArrayRange(CDriverGL *drv); + virtual ~IVertexArrayRange(); + + /// allocate a vertex array space. false if error. client must free before re-allocate. + virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType)= 0; + /// free this space. + virtual void free()= 0; + /// create a IVertexBufferHardGL + virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb) =0; + /// return the size allocated. 0 if not allocated or failure + virtual uint sizeAllocated() const =0; + // Check & invalidate lost buffers. Default assume they can't be lost + virtual void updateLostBuffers() {} + // Get driver + CDriverGL *getDriver() const { return _Driver; } + // tmp, for debug + #ifdef NL_DEBUG + virtual void dumpMappedBuffers() {} + #endif +protected: + CDriverGL *_Driver; +}; + + + +// *************************************************************************** +/** Common interface for both NVidia and ATI extenstion + * + */ +class IVertexBufferHardGL +{ +public: + + IVertexBufferHardGL(CDriverGL *drv, CVertexBuffer *vb); + virtual ~IVertexBufferHardGL(); + + + // ATI and NVidia have their own methods. + virtual void *lock() = 0; + virtual void unlock() = 0; + virtual void unlock(uint start, uint end) = 0; + virtual void *getPointer() = 0; + + virtual void enable() =0; + virtual void disable() =0; + + virtual void setupVBInfos(CVertexBufferInfo &vb) = 0; + + enum TVBType { NVidiaVB, ATIVB, ATIMapObjectVB, ARBVB, UnknownVB }; + // true if NVidia vertex buffer hard. + TVBType VBType; + // For Fence access. Ignored for ATI. + bool GPURenderingAfterFence; + + // test if buffer content is invalid. If so, no rendering should occurs (rendering should silently fail) + bool isInvalid() { return _Invalid; } + +public: + + CVertexBuffer *VB; + +protected: + CDriverGL *_Driver; + bool _Invalid; +}; + +#ifndef USE_OPENGLES + +// *************************************************************************** +// *************************************************************************** +// NVidia implementation +// *************************************************************************** +// *************************************************************************** + + +// *************************************************************************** +/** Work only if ARRAY_RANGE_NV is enabled. else, only call to ctor/dtor/free() is valid. + * any call to allocateVB() will return NULL. + */ +class CVertexArrayRangeNVidia : public IVertexArrayRange +{ +public: + CVertexArrayRangeNVidia(CDriverGL *drv); + + + /// \name Implementation + // @{ + /// allocate a vertex array sapce. false if error. must free before re-allocate. + virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType); + /// free this space. + virtual void free(); + /// create a IVertexBufferHardGL + virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb); + /// return the size allocated. 0 if not allocated or failure + virtual uint sizeAllocated() const; + // @} + + + // Those methods read/write in _Driver->_CurrentVertexArrayRange. + /// active this VertexArrayRange as the current vertex array range used. no-op if already setup. + void enable(); + /// disable this VertexArrayRange. _Driver->_CurrentVertexArrayRange= NULL; + void disable(); + + /// free a VB allocated with allocateVB. No-op if NULL. + void freeVB(void *ptr); + + +// ************************* +private: + void *_VertexArrayPtr; + uint32 _VertexArraySize; + + // Allocator. + NLMISC::CHeapMemory _HeapMemory; + + /// true if allocated. + bool allocated() const {return _VertexArrayPtr!=NULL;} + /// Allocate a small subset of the memory. NULL if not enough mem. + void *allocateVB(uint32 size); + +}; + + + +// *************************************************************************** +/// Work only if ARRAY_RANGE_NV is enabled. +class CVertexBufferHardGLNVidia : public IVertexBufferHardGL +{ +public: + + CVertexBufferHardGLNVidia(CDriverGL *drv, CVertexBuffer *vb); + virtual ~CVertexBufferHardGLNVidia(); + + + /// \name Implementation + // @{ + virtual void *lock(); + virtual void unlock(); + virtual void unlock(uint start, uint end); + virtual void *getPointer(); + virtual void enable(); + virtual void disable(); + virtual void lockHintStatic(bool staticLock); + virtual void setupVBInfos(CVertexBufferInfo &vb); + // @} + + + // setup ptrs allocated by createVBHard(), and init Fence. + void initGL(CVertexArrayRangeNVidia *var, void *vertexPtr); + + + // true if a setFence() has been done, without a finishFence(). NB: not the same thing as nglTestFenceNV()!! + bool isFenceSet() const {return _FenceSet;} + // set or re-set the fence, whatever isFenceSet(). + void setFence(); + // if(isFenceSet()), finish the fence, else no-op + void finishFence(); + // if fence is not set, no-op, else test nglTestFenceNV(), and update local _FenceSet flag. + void testFence(); + + bool getLockHintStatic() const {return _LockHintStatic;} + +// ************************* +private: + CVertexArrayRangeNVidia *_VertexArrayRange; + void *_VertexPtr; + + // The fence inserted in command stream + GLuint _Fence; + // True if a setFence() has been done, without a finishFence(). + bool _FenceSet; + + bool _LockHintStatic; + +}; + + + +// *************************************************************************** +// *************************************************************************** +// ATI implementation +// *************************************************************************** +// *************************************************************************** + + +// *************************************************************************** +// This is a fake value to simulate allocation on CHeapMemory for ATI mgt. +// NB: can set 0, since won't work for multiple reasons.... +#define NL3D_DRV_ATI_FAKE_MEM_START 0x10000 + + +// *************************************************************************** +/** Work only if ATIVertexArrayObject is enabled. else, only call to ctor/dtor/free() is valid. + * any call to allocateVB() will return NULL. + */ +class CVertexArrayRangeATI : public IVertexArrayRange +{ +public: + CVertexArrayRangeATI(CDriverGL *drv); + + + /// \name Implementation + // @{ + /// allocate a vertex array sapce. false if error. must free before re-allocate. + virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType); + /// free this space. + virtual void free(); + /// create a IVertexBufferHardGL + virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb); + /// return the size allocated. 0 if not allocated or failure + virtual uint sizeAllocated() const; + // @} + + + // Those methods read/write in _Driver->_CurrentVertexArrayRange. + /** active this VertexArrayRange as the current vertex array range used. no-op if already setup. + * NB: no-op for ATI, but ensure correct _Driver->_CurrentVertexArrayRange value. + */ + void enable(); + /** disable this VertexArrayRange. _Driver->_CurrentVertexArrayRange= NULL; + * NB: no-op for ATI, but ensure correct _Driver->_CurrentVertexArrayRange value. + */ + void disable(); + + /// free a VB allocated with allocateVB. No-op if NULL. + void freeVB(void *ptr); + + + /// get Handle of the ATI buffer. + uint getATIVertexObjectId() const {return _VertexObjectId;} + +// ************************* +private: + uint _VertexObjectId; + bool _Allocated; + uint32 _VertexArraySize; + + // Allocator. NB: We don't have any Mem Ptr For ATI extension, so use a Fake Ptr: NL3D_DRV_ATI_FAKE_MEM_START + NLMISC::CHeapMemory _HeapMemory; + + /// Allocate a small subset of the memory. NULL if not enough mem. + void *allocateVB(uint32 size); + +}; + + + + +// *************************************************************************** +/// Work only if ARRAY_RANGE_NV is enabled. +class CVertexBufferHardGLATI : public IVertexBufferHardGL +{ +public: + + CVertexBufferHardGLATI(CDriverGL *drv, CVertexBuffer *vb); + virtual ~CVertexBufferHardGLATI(); + + + /// \name Implementation + // @{ + virtual void *lock(); + virtual void unlock(); + virtual void unlock(uint start, uint end); + virtual void *getPointer(); + virtual void enable(); + virtual void disable(); + virtual void lockHintStatic(bool staticLock); + virtual void setupVBInfos(CVertexBufferInfo &vb); + // @} + + + /// try to create a RAM mirror that 'll contain a copy of the VB. + bool createRAMMirror(uint memSize); + + /** setup ptrs allocated by createVBHard() + */ + void initGL(CVertexArrayRangeATI *var, void *vertexPtr); + + +public: + + /// get Handle of the ATI buffer. + uint getATIVertexObjectId() const {return _VertexArrayRange->getATIVertexObjectId();} + + +// ************************* +private: + CVertexArrayRangeATI *_VertexArrayRange; + void *_VertexPtr; + void *_RAMMirrorVertexPtr; + uint _RAMMirrorVertexSize; + +}; + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** TEMP nico : test if better with ATI_map_object_buffer + * We don't manage a heap there, we just allocate separate objects (can't get a pointer on a portion of the buffer only ..) + * todo : test if such maneer is still efficient (because of vb switching) + * NB : this is available only it GL_ATI_map_object_buffer is available + */ +class CVertexArrayRangeMapObjectATI : public IVertexArrayRange +{ +public: + CVertexArrayRangeMapObjectATI(CDriverGL *drv); + + + /// \name Implementation + // @{ + /** Allocate a vertex array space. false if error. must free before re-allocate. + * Will always succeed, because vb are not managed in a heap, but are rather kept as separate objects + */ + virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType); + /// free this space. + virtual void free(); + /// create a IVertexBufferHardGL + virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb); + /// return the size allocated. 0 if not allocated or failure + virtual uint sizeAllocated() const { return _SizeAllocated; } + // @} + + + // Those methods read/write in _Driver->_CurrentVertexArrayRange. + /** active this VertexArrayRange as the current vertex array range used. no-op if already setup. + * NB: no-op for ATI, but ensure correct _Driver->_CurrentVertexArrayRange value. + */ + void enable(); + /** disable this VertexArrayRange. _Driver->_CurrentVertexArrayRange= NULL; + * NB: no-op for ATI, but ensure correct _Driver->_CurrentVertexArrayRange value. + */ + void disable(); + + CVertexBuffer::TPreferredMemory getVBType() const { return _VBType; } + + // check & invalidate lost buffers + void updateLostBuffers(); + + // tmp for debug + #ifdef NL_DEBUG + void dumpMappedBuffers(); + #endif + +// ************************* +private: + CVertexBuffer::TPreferredMemory _VBType; + uint32 _SizeAllocated; +public: + // for use by CVertexBufferHardGLMapObjectATI + std::list _LostVBList; + #ifdef NL_DEBUG + std::list _MappedVBList; + #endif +}; + + +/** vb hard using the ATI_map_object_buffer extension. Buffer are kept separate rather than managed in a heap + */ +class CVertexBufferHardGLMapObjectATI : public IVertexBufferHardGL +{ +public: + + CVertexBufferHardGLMapObjectATI(CDriverGL *drv, CVertexBuffer *vb); + virtual ~CVertexBufferHardGLMapObjectATI(); + + + /// \name Implementation + // @{ + virtual void *lock(); + virtual void unlock(); + virtual void unlock(uint start, uint end); + virtual void *getPointer(); + virtual void enable(); + virtual void disable(); + virtual void lockHintStatic(bool staticLock); + virtual void setupVBInfos(CVertexBufferInfo &vb); + // @} + + /** setup ptrs allocated by createVBHard() + */ + void initGL(CVertexArrayRangeMapObjectATI *var, uint vertexObjectID); + + +public: + + /// get Handle of the ATI buffer. + uint getATIVertexObjectId() const { return _VertexObjectId;} + + +// ************************* +private: + void *_VertexPtr; // pointer on current datas. Null if not locked + CVertexArrayRangeMapObjectATI *_VertexArrayRange; + // if buffer has been invalidated, returns a dummy memory block and silently fails rendering + std::vector _DummyVB; + // Invalidate the buffer (when it is lost, or when a lock fails) + void invalidate(); +public: + // for use by CVertexArrayRangeMapObjectATI + std::list::iterator _IteratorInLostVBList; + uint _VertexObjectId; + // tmp for debug + #ifdef NL_DEBUG + bool _Unmapping; + std::list::iterator _IteratorInMappedVBList; + #endif +}; + +#endif + +// *************************************************************************** +// *************************************************************************** +// ARB_vertex_buffer_object implementation +// *************************************************************************** +// *************************************************************************** +class CVertexArrayRangeARB : public IVertexArrayRange +{ +public: + CVertexArrayRangeARB(CDriverGL *drv); + + + /// \name Implementation + // @{ + /** Allocate a vertex array space. false if error. must free before re-allocate. + * Will always succeed, because vb are not managed in a heap, but are rather kept as separate objects + */ + virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType); + /// free this space. + virtual void free(); + /// create a IVertexBufferHardGL + virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb); + /// return the size allocated. 0 if not allocated or failure + virtual uint sizeAllocated() const { return _SizeAllocated; } + // @} + + + // Those methods read/write in _Driver->_CurrentVertexArrayRange. + /** active this VertexArrayRange as the current vertex array range used. no-op if already setup. + * NB: no-op for ARB, but ensure correct _Driver->_CurrentVertexArrayRange value. + */ + void enable(); + /** disable this VertexArrayRange. _Driver->_CurrentVertexArrayRange= NULL; + * NB: no-op for ARB, but ensure correct _Driver->_CurrentVertexArrayRange value. + */ + void disable(); + // check & invalidate lost buffers + void updateLostBuffers(); + // + #ifdef NL_DEBUG + virtual void dumpMappedBuffers(); + #endif +// ************************* +private: + CVertexBuffer::TPreferredMemory _VBType; + uint32 _SizeAllocated; + // for use by CVertexBufferHardARB +public: + std::list _LostVBList; + #ifdef NL_DEBUG + std::list _MappedVBList; + #endif +}; + + +/** vb hard using the ARB_vertex_buffer_object extension. Buffer are kept separate rather than managed in a heap + */ +class CVertexBufferHardARB : public IVertexBufferHardGL +{ +public: + + CVertexBufferHardARB(CDriverGL *drv, CVertexBuffer *vb); + virtual ~CVertexBufferHardARB(); + + + /// \name Implementation + // @{ + virtual void *lock(); + virtual void unlock(); + virtual void unlock(uint startVert, uint endVert); + virtual void *getPointer(); + virtual void enable(); + virtual void disable(); + virtual void lockHintStatic(bool staticLock); + virtual void setupVBInfos(CVertexBufferInfo &vb); + // @} + + /** setup ptrs allocated by createVBHard() + */ + void initGL(uint vertexObjectID, CVertexArrayRangeARB *var, CVertexBuffer::TPreferredMemory memType); + + +public: + + /// get Handle of the ARB buffer. + uint getARBVertexObjectId() const { return _VertexObjectId;} + + // Invalidate the buffer (when it is lost, or when a lock fails) + void invalidate(); + + // tmp + void checkMappedVBList(); + +// ************************* +private: + CVertexArrayRangeARB *_VertexArrayRange; + CVertexBuffer::TPreferredMemory _MemType; + void *_VertexPtr; // pointer on current datas. Null if not locked +#ifdef USE_OPENGLES + uint8 *_Buffer; + uint32 _BufferSize; + uint32 _LastBufferSize; +#endif + // if buffer has been invalidated, returns a dummy memory block and silently fails rendering + std::vector _DummyVB; + // for use by CVertexArrayRangeARB + std::list::iterator _IteratorInLostVBList; +public: + uint _VertexObjectId; + // tmp for debug + #ifdef NL_DEBUG + bool _Unmapping; + std::list::iterator _IteratorInMappedVBList; + #endif +}; + +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} // NL3D + + +#endif // NL_DRIVER_OPENGL_VERTEX_BUFFER_HARD_H + +/* End of driver_opengl_vertex_buffer_hard.h */ diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_program.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_program.cpp new file mode 100644 index 000000000..5392bcbdd --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_program.cpp @@ -0,0 +1,1986 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "stdopengl.h" + +#include "driver_opengl.h" +#include "nel/3d/index_buffer.h" +#include "nel/3d/vertex_program.h" +#include "nel/3d/vertex_program_parse.h" +#include + +// tmp +#include "nel/misc/file.h" + +using namespace std; +using namespace NLMISC; + +//#define DEBUG_SETUP_EXT_VERTEX_SHADER + +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + +// *************************************************************************** +CVertexProgamDrvInfosGL::CVertexProgamDrvInfosGL (CDriverGL *drv, ItVtxPrgDrvInfoPtrList it) : IVertexProgramDrvInfos (drv, it) +{ + H_AUTO_OGL(CVertexProgamDrvInfosGL_CVertexProgamDrvInfosGL); + + // Extension must exist + nlassert (drv->_Extensions.NVVertexProgram + || drv->_Extensions.EXTVertexShader + || drv->_Extensions.ARBVertexProgram + ); + +#ifndef USE_OPENGLES + if (drv->_Extensions.NVVertexProgram) // NVIDIA implemntation + { + // Generate a program + nglGenProgramsNV (1, &ID); + } + else if (drv->_Extensions.ARBVertexProgram) // ARB implementation + { + nglGenProgramsARB(1, &ID); + } + else + { + ID = nglGenVertexShadersEXT(1); // ATI implementation + } +#endif +} + + +// *************************************************************************** +bool CDriverGL::isVertexProgramSupported () const +{ + H_AUTO_OGL(CVertexProgamDrvInfosGL_isVertexProgramSupported) + return _Extensions.NVVertexProgram || _Extensions.EXTVertexShader || _Extensions.ARBVertexProgram; +} + +// *************************************************************************** +bool CDriverGL::isVertexProgramEmulated () const +{ + H_AUTO_OGL(CVertexProgamDrvInfosGL_isVertexProgramEmulated) + return _Extensions.NVVertexProgramEmulated; +} + + + +// *************************************************************************** +bool CDriverGL::activeNVVertexProgram (CVertexProgram *program) +{ + H_AUTO_OGL(CVertexProgamDrvInfosGL_activeNVVertexProgram); + +#ifndef USE_OPENGLES + // Setup or unsetup ? + if (program) + { + // Enable vertex program + glEnable (GL_VERTEX_PROGRAM_NV); + _VertexProgramEnabled= true; + + + // Driver info + CVertexProgamDrvInfosGL *drvInfo; + + // Program setuped ? + if (program->_DrvInfo==NULL) + { + /** Check with our parser if the program will works with other implemented extensions, too. (EXT_vertex_shader ..). + * There are some incompatibilities. + */ + CVPParser parser; + CVPParser::TProgram parsedProgram; + std::string errorOutput; + bool result = parser.parse(program->getProgram().c_str(), parsedProgram, errorOutput); + if (!result) + { + nlwarning("Unable to parse a vertex program :"); + nlwarning(errorOutput.c_str()); + #ifdef NL_DEBUG + nlassert(0); + #endif + return false; + } + + // Insert into driver list. (so it is deleted when driver is deleted). + ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL); + + // Create a driver info + *it = drvInfo = new CVertexProgamDrvInfosGL (this, it); + + // Set the pointer + program->_DrvInfo=drvInfo; + + // Compile the program + nglLoadProgramNV (GL_VERTEX_PROGRAM_NV, drvInfo->ID, (GLsizei)program->getProgram().length(), (const GLubyte*)program->getProgram().c_str()); + + // Get loading error code + GLint errorOff; + glGetIntegerv (GL_PROGRAM_ERROR_POSITION_NV, &errorOff); + + // Compilation error ? + if (errorOff>=0) + { + // String length + uint length = (uint)program->getProgram ().length(); + const char* sString= program->getProgram ().c_str(); + + // Line count and char count + uint line=1; + uint charC=1; + + // Find the line + uint offset=0; + while ((offset((IVertexProgramDrvInfos*)program->_DrvInfo); + } + + // Setup this program + nglBindProgramNV (GL_VERTEX_PROGRAM_NV, drvInfo->ID); + _LastSetuppedVP = program; + + // Ok + return true; + } + else // Unsetup + { + // Disable vertex program + glDisable (GL_VERTEX_PROGRAM_NV); + _VertexProgramEnabled= false; + // Ok + return true; + } +#endif + + return false; +} + +// *************************************************************************** +#ifndef USE_OPENGLES +static +inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate) +{ + H_AUTO_OGL(convSwizzleToGLFormat); + + if (!negate) + { + switch(comp) + { + case CVPSwizzle::X: return GL_X_EXT; + case CVPSwizzle::Y: return GL_Y_EXT; + case CVPSwizzle::Z: return GL_Z_EXT; + case CVPSwizzle::W: return GL_W_EXT; + + default: + nlstop; + return 0; + break; + } + } + else + { + switch(comp) + { + case CVPSwizzle::X: return GL_NEGATIVE_X_EXT; + case CVPSwizzle::Y: return GL_NEGATIVE_Y_EXT; + case CVPSwizzle::Z: return GL_NEGATIVE_Z_EXT; + case CVPSwizzle::W: return GL_NEGATIVE_W_EXT; + + default: + nlstop; + return 0; + break; + } + } +} +#endif + +// *************************************************************************** +/** Convert an output register to a EXTVertexShader register + */ +static GLuint convOutputRegisterToEXTVertexShader(CVPOperand::EOutputRegister r) +{ + H_AUTO_OGL(convOutputRegisterToEXTVertexShader); + +#ifndef USE_OPENGLES + switch (r) + { + case CVPOperand::OHPosition: return GL_OUTPUT_VERTEX_EXT; + case CVPOperand::OPrimaryColor: return GL_OUTPUT_COLOR0_EXT; + case CVPOperand::OSecondaryColor: return GL_OUTPUT_COLOR1_EXT; + case CVPOperand::OBackFacePrimaryColor: + nlwarning("Backface color used in a vertex program is not supported by device, defaulting to front color"); + return GL_OUTPUT_COLOR0_EXT; + break; + case CVPOperand::OBackFaceSecondaryColor: + nlwarning("Backface color used in a vertex program is not supported by device, defaulting to front color"); + return GL_OUTPUT_COLOR1_EXT; + break; + case CVPOperand::OFogCoord: return GL_OUTPUT_FOG_EXT; + case CVPOperand::OPointSize: nlstop; return 0; // sorry, not supported + case CVPOperand::OTex0: return GL_OUTPUT_TEXTURE_COORD0_EXT; + case CVPOperand::OTex1: return GL_OUTPUT_TEXTURE_COORD1_EXT; + case CVPOperand::OTex2: return GL_OUTPUT_TEXTURE_COORD2_EXT; + case CVPOperand::OTex3: return GL_OUTPUT_TEXTURE_COORD3_EXT; + case CVPOperand::OTex4: return GL_OUTPUT_TEXTURE_COORD4_EXT; + case CVPOperand::OTex5: return GL_OUTPUT_TEXTURE_COORD5_EXT; + case CVPOperand::OTex6: return GL_OUTPUT_TEXTURE_COORD6_EXT; + case CVPOperand::OTex7: return GL_OUTPUT_TEXTURE_COORD7_EXT; + default: + nlstop; + break; + } +#endif + + return 0; +} + +// *************************************************************************** +/** Convert an input register to a vertex buffer flag + */ +static uint convInputRegisterToVBFlag(uint index) +{ + H_AUTO_OGL(convInputRegisterToVBFlag) + switch (index) + { + case CVPOperand::IPosition: return CVertexBuffer::PositionFlag; + case CVPOperand::IWeight: return CVertexBuffer::WeightFlag; + case CVPOperand::INormal: return CVertexBuffer::NormalFlag; + case CVPOperand::IPrimaryColor: return CVertexBuffer::PrimaryColorFlag; + case CVPOperand::ISecondaryColor: return CVertexBuffer::SecondaryColorFlag; + case CVPOperand::IFogCoord: return CVertexBuffer::FogFlag; + case CVPOperand::IPaletteSkin: return CVertexBuffer::PaletteSkinFlag; + case CVPOperand::IEmpty: nlassert(0); break; + case CVPOperand::ITex0: + case CVPOperand::ITex1: + case CVPOperand::ITex2: + case CVPOperand::ITex3: + case CVPOperand::ITex4: + case CVPOperand::ITex5: + case CVPOperand::ITex6: + case CVPOperand::ITex7: + return CVertexBuffer::TexCoord0Flag << (index - CVPOperand::ITex0); + default: + nlassert(0); + break; + } + return 0; +} + + + +// A macro to debug the generated instruction +//#define DEBUG_SETUP_EXT_VERTEX_SHADER + +#ifdef DEBUG_SETUP_EXT_VERTEX_SHADER + #define EVS_INFO(what) nlinfo(what) +#else + #define EVS_INFO(what) +#endif + + +// For debugging with swizzling +static void doSwizzle(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW) +{ + H_AUTO_OGL(doSwizzle); + +#ifndef USE_OPENGLES + nglSwizzleEXT(res, in, outX, outY, outZ, outW); +#ifdef DEBUG_SETUP_EXT_VERTEX_SHADER + std::string swzStr = "Swizzle : "; + GLenum swz[] = { outX, outY, outZ, outW }; + for(uint k = 0; k < 4; ++k) + { + switch(swz[k]) + { + case GL_X_EXT: + swzStr +=" X"; + break; + case GL_NEGATIVE_X_EXT: + swzStr +=" -X"; + break; + case GL_Y_EXT: + swzStr +=" Y"; + break; + case GL_NEGATIVE_Y_EXT: + swzStr +=" -Y"; + break; + break; + case GL_Z_EXT: + swzStr +=" Z"; + break; + case GL_NEGATIVE_Z_EXT: + swzStr +=" -Z"; + break; + case GL_W_EXT: + swzStr +=" W"; + break; + case GL_NEGATIVE_W_EXT: + swzStr +=" -W"; + break; + case GL_ZERO_EXT: + swzStr +="0"; + break; + case GL_ONE_EXT: + swzStr +="1"; + break; + } + } + EVS_INFO(swzStr.c_str()); +#endif +#endif +} + +// Perform write mask and output de bug information +static void doWriteMask(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW) +{ + H_AUTO_OGL(doWriteMask); + +#ifndef USE_OPENGLES + nglWriteMaskEXT(res, in, outX, outY, outZ, outW); + #ifdef DEBUG_SETUP_EXT_VERTEX_SHADER + nlinfo("3D: Write Mask : %c%c%c%c", + outX ? 'x' : '-', + outY ? 'y' : '-', + outZ ? 'z' : '-', + outW ? 'w' : '-' + ); + #endif +#endif +} + +// *************************************************************************** +/** Setup a vertex shader from its parsed program + */ +bool CDriverGL::setupEXTVertexShader(const CVPParser::TProgram &program, GLuint id, uint variants[EVSNumVariants], uint16 &usedInputRegisters) +{ + H_AUTO_OGL(CDriverGL_setupEXTVertexShader); + +#ifndef USE_OPENGLES + // counter to see what is generated + uint numOp = 0; + uint numOpIndex = 0; + uint numSwizzle = 0; + uint numEC = 0; // extract component + uint numIC = 0; // insert component + uint numWM = 0; // write maks + + +#ifdef DEBUG_SETUP_EXT_VERTEX_SHADER + nlinfo("3D: **********************************************************"); +#endif + + // clear last error + GLenum glError = glGetError(); + + //variants[EVSSecondaryColorVariant] = nglGenSymbolsEXT(GL_VECTOR_EXT, GL_VARIANT_EXT, GL_NORMALIZED_RANGE_EXT, 1); + //variants[EVSSecondaryColorVariant] = nglGenSymbolsEXT(GL_VECTOR_EXT, GL_VARIANT_EXT, GL_NORMALIZED_RANGE_EXT, 1); + + // allocate the symbols + nglBindVertexShaderEXT(id); + nglBeginVertexShaderEXT(); + { + + // Allocate register and variant + + // allocate registers + GLuint firstRegister = nglGenSymbolsEXT(GL_VECTOR_EXT, GL_LOCAL_EXT, GL_FULL_RANGE_EXT, 12); // 12 register + GLuint firstTempRegister = nglGenSymbolsEXT(GL_VECTOR_EXT, GL_LOCAL_EXT, GL_FULL_RANGE_EXT, 4); // 4 temp register used for swizzle & indexing + GLuint firstTempScalar = nglGenSymbolsEXT(GL_SCALAR_EXT, GL_LOCAL_EXT, GL_FULL_RANGE_EXT, 3); // 3 temp scalars used for EXPP & LOGG emulation + GLuint firstAddressRegister = nglGenSymbolsEXT(GL_SCALAR_EXT, GL_LOCAL_EXT, GL_FULL_RANGE_EXT, 1); + + // allocate needed variants + if (CVPParser::isInputUsed(program, CVPOperand::ISecondaryColor)) + { + variants[EVSSecondaryColorVariant] = nglGenSymbolsEXT(GL_VECTOR_EXT, GL_VARIANT_EXT, GL_NORMALIZED_RANGE_EXT, 1); + + if (!variants[EVSSecondaryColorVariant]) + { + nlwarning("EXT_vertex_shader : can't allocate variant for secondary color"); + return false; + } + } + else + { + variants[EVSSecondaryColorVariant] = 0; + } + + if (CVPParser::isInputUsed(program, CVPOperand::IFogCoord)) + { + variants[EVSFogCoordsVariant] = nglGenSymbolsEXT(GL_VECTOR_EXT, GL_VARIANT_EXT, GL_FULL_RANGE_EXT, 1); + + if (!variants[EVSFogCoordsVariant]) + { + nlwarning("EXT_vertex_shader : can't allocate variant for fog coords"); + return false; + } + } + else + { + variants[EVSFogCoordsVariant] = 0; + } + + if (CVPParser::isInputUsed(program, CVPOperand::IWeight)) + { + variants[EVSSkinWeightVariant] = nglGenSymbolsEXT(GL_VECTOR_EXT, GL_VARIANT_EXT, GL_FULL_RANGE_EXT, 1); + + if (!variants[EVSSkinWeightVariant]) + { + nlwarning("EXT_vertex_shader : can't allocate variant for skin weight"); + return false; + } + } + else + { + variants[EVSSkinWeightVariant] = 0; + } + + if (CVPParser::isInputUsed(program, CVPOperand::IPaletteSkin)) + { + variants[EVSPaletteSkinVariant] = nglGenSymbolsEXT(GL_VECTOR_EXT, GL_VARIANT_EXT, GL_FULL_RANGE_EXT, 1); + + if (!variants[EVSPaletteSkinVariant]) + { + nlwarning("EXT_vertex_shader : can't allocate variant for palette skin"); + return false; + } + } + else + { + variants[EVSPaletteSkinVariant] = 0; + } + + // allocate one temporary register for fog before conversion + GLuint fogTemp = 0; + if (!_ATIFogRangeFixed) + { + fogTemp = nglGenSymbolsEXT(GL_VECTOR_EXT, GL_LOCAL_EXT, GL_FULL_RANGE_EXT, 1); + } + + + // local constant : 0 and 1 + GLuint cteOne = nglGenSymbolsEXT(GL_SCALAR_EXT, GL_LOCAL_CONSTANT_EXT, GL_FULL_RANGE_EXT, 1); + GLuint cteZero = nglGenSymbolsEXT(GL_SCALAR_EXT, GL_LOCAL_CONSTANT_EXT, GL_FULL_RANGE_EXT, 1); + + + float oneValue = 1.f; + float zeroValue = 0.f; + + nglSetLocalConstantEXT( cteOne, GL_FLOAT, &oneValue); + nglSetLocalConstantEXT( cteZero, GL_FLOAT, &zeroValue); + + + + if (firstRegister == 0) + { + nlwarning("Unable to allocate local registers for EXT_vertex_shader"); + return false; + } + if (firstTempRegister == 0) + { + nlwarning("Unable to allocate local temp registers for EXT_vertex_shader"); + return false; + } + if (firstTempScalar == 0) + { + nlwarning("Unable to allocate temp scalar registers for EXT_vertex_shader"); + return false; + } + if (firstAddressRegister == 0) + { + nlwarning("Unable to allocate address register for EXT_vertex_shader"); + return false; + } + + // Mask of output component that are being written + uint componentWritten[16]; + std::fill(componentWritten, componentWritten + 16, 0); + + // + GLuint srcValue[3]; + // + GLuint destValue; + GLuint maskedDestValue = 0; + + + uint l; + // convert each instruction of the vertex program + for(uint k = 0; k < program.size(); ++k) + { + // get src values, eventually applying swizzle, negate, and index on them + uint numSrc = program[k].getNumUsedSrc(); + for(l = 0; l < numSrc; ++l) + { + EVS_INFO(("Build source " + toString(l)).c_str()); + const CVPOperand &operand = program[k].getSrc(l); + switch (operand.Type) + { + case CVPOperand::InputRegister: + { + switch(operand.Value.InputRegisterValue) + { + case 0: srcValue[l] = _EVSPositionHandle; EVS_INFO("Src = position"); break; + case 1: srcValue[l] = variants[EVSSkinWeightVariant]; EVS_INFO("Src = skin weight"); break; + case 2: srcValue[l] = _EVSNormalHandle; EVS_INFO("Src = normal"); break; + case 3: srcValue[l] = _EVSColorHandle; EVS_INFO("Src = color 0"); break; + case 4: srcValue[l] = variants[EVSSecondaryColorVariant]; EVS_INFO("Src = color 1"); break; + case 5: srcValue[l] = variants[EVSFogCoordsVariant]; EVS_INFO("Src = fog coord"); break; + case 6: srcValue[l] = variants[EVSPaletteSkinVariant]; EVS_INFO("Src = palette skin"); break; + case 7: nlstop; // not supported + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + { + EVS_INFO(("Src = Tex" + toString(operand.Value.InputRegisterValue - 8)).c_str()); + srcValue[l] = _EVSTexHandle[operand.Value.InputRegisterValue - 8]; + if (srcValue[l] == 0) + { + nlwarning("Trying to read an unaccessible texture coords for the device when using EXT_vertex_shader, shader loading failed."); + return false; + } + } + break; + default: + nlstop; // invalid value + break; + } + } + break; + case CVPOperand::Constant: + nlassert(uint(operand.Value.ConstantValue) < _EVSNumConstant); // constant index too high + srcValue[l] = _EVSConstantHandle + operand.Value.ConstantValue; + EVS_INFO(("Src = constant" + toString(operand.Value.ConstantValue)).c_str()); + break; + case CVPOperand::Variable: + srcValue[l] = firstRegister + operand.Value.VariableValue; + EVS_INFO(("Src = variable register" + toString(operand.Value.VariableValue)).c_str()); + break; + default: + nlassert(0); + break; + } + // test if indexed access is used (can be used on one register only) + if (operand.Type == CVPOperand::Constant && operand.Indexed) + { + nglShaderOp2EXT(GL_OP_INDEX_EXT, firstTempRegister + 3, firstAddressRegister, srcValue[l]); + EVS_INFO("GL_OP_INDEX_EXT"); + ++ numOpIndex; + srcValue[l] = firstTempRegister + 3; + glError = glGetError(); + nlassert(glError == GL_NO_ERROR); + } + + // test if swizzle or negate is used + if (!operand.Swizzle.isIdentity() || operand.Negate) + { + // if the instruction reads a scalar, no need for swizzle (except if negate is used) + if (! + ( + (program[k].Opcode == CVPInstruction::RSQ + || program[k].Opcode == CVPInstruction::RCP + || program[k].Opcode == CVPInstruction::LOG + || program[k].Opcode == CVPInstruction::EXPP + ) + && + !operand.Negate + ) + ) + { + // need a temp register for swizzle and/or negate + doSwizzle(firstTempRegister + l, srcValue[l], + convSwizzleToGLFormat(operand.Swizzle.Comp[0], operand.Negate), + convSwizzleToGLFormat(operand.Swizzle.Comp[1], operand.Negate), + convSwizzleToGLFormat(operand.Swizzle.Comp[2], operand.Negate), + convSwizzleToGLFormat(operand.Swizzle.Comp[3], operand.Negate)); + ++numSwizzle; + srcValue[l] = firstTempRegister + l; + glError = glGetError(); + nlassert(glError == GL_NO_ERROR); + } + } + } + + // get dest value + const CVPOperand &destOperand = program[k].Dest; + switch(destOperand.Type) + { + case CVPOperand::Variable: + destValue = firstRegister + destOperand.Value.VariableValue; + break; + case CVPOperand::OutputRegister: + if (_ATIFogRangeFixed || destOperand.Value.OutputRegisterValue != CVPOperand::OFogCoord) + { + destValue = convOutputRegisterToEXTVertexShader(destOperand.Value.OutputRegisterValue); + } + else + { + destValue = fogTemp; + } + break; + case CVPOperand::AddressRegister: + destValue = firstAddressRegister; + break; + default: + nlassert(0); + break; + } + + uint writeMask = program[k].Dest.WriteMask; + CVPInstruction::EOpcode opcode = program[k].Opcode; + uint outputRegisterIndex = 0; + if (destOperand.Type != CVPOperand::AddressRegister) + { + outputRegisterIndex = destOperand.Value.OutputRegisterValue; + nlassert(outputRegisterIndex < 16); + } + + // Tells whether the output has already been written before the final write mask. This happens with instructions LOG, EXPP, LIT, RSQ and RCP, + // because they write their output component by components + bool outputWritten = false; + + // test for write mask + if (writeMask != 0x0f) + { + /** Don't know why, but on some implementation of EXT_vertex_shader, can't write a single components to the fog coordinate.. + * So we force the mask to 0xf (only the x coordinate is used anyway). + */ + if (!(destOperand.Type == CVPOperand::OutputRegister && destOperand.Value.OutputRegisterValue == CVPOperand::OFogCoord)) + { + // For instructions that write their output components by components, we don't need an intermediary register + if (opcode == CVPInstruction::LOG + || opcode == CVPInstruction::EXPP + || opcode == CVPInstruction::LIT + || opcode == CVPInstruction::RSQ + || opcode == CVPInstruction::RCP + ) + { + outputWritten = true; + } + else + { + maskedDestValue = destValue; + // use a temp register before masking + destValue = firstTempRegister; + } + } + else + { + componentWritten[outputRegisterIndex] = 0xf; + } + } + else + { + if (destOperand.Type == CVPOperand::OutputRegister) + { + componentWritten[outputRegisterIndex] = 0xf; // say all components have been written for that output + } + } + + // generate opcode + switch (opcode) + { + case CVPInstruction::ARL: + { + nlassert(program[k].Src1.Swizzle.isScalar()); + GLuint index = program[k].Src1.Swizzle.Comp[0]; + nglExtractComponentEXT(firstAddressRegister, srcValue[0], index); + EVS_INFO("Extract component"); + ++numEC; + } + break; + case CVPInstruction::MOV: + { + nglShaderOp1EXT(GL_OP_MOV_EXT, destValue, srcValue[0]); + EVS_INFO("GL_OP_MOV_EXT"); + ++numOp; + } + break; + case CVPInstruction::MUL: + nglShaderOp2EXT(GL_OP_MUL_EXT, destValue, srcValue[0], srcValue[1]); + EVS_INFO("GL_OP_MUL_EXT"); + ++numOp; + break; + case CVPInstruction::ADD: + nglShaderOp2EXT(GL_OP_ADD_EXT, destValue, srcValue[0], srcValue[1]); + EVS_INFO("GL_OP_ADD_EXT"); + ++numOp; + break; + case CVPInstruction::MAD: + nglShaderOp3EXT(GL_OP_MADD_EXT, destValue, srcValue[0], srcValue[1], srcValue[2]); + EVS_INFO("GL_OP_MADD_EXT"); + ++numOp; + break; + case CVPInstruction::RSQ: + { + nlassert(program[k].Src1.Swizzle.isScalar()); + // extract the component we need + GLuint index = program[k].Src1.Swizzle.Comp[0]; + nglExtractComponentEXT(firstTempScalar, srcValue[0], index); + EVS_INFO("Extract component"); + ++numEC; + nglShaderOp1EXT(GL_OP_RECIP_SQRT_EXT, firstTempScalar + 1, firstTempScalar); + EVS_INFO("GL_OP_RECIP_SQRT_EXT"); + ++numOp; + // duplicate result in destination + for(uint l = 0; l < 4; ++l) + { + if (writeMask & (1 << l)) + { + nglInsertComponentEXT(destValue, firstTempScalar + 1, l); + EVS_INFO("Insert component"); + nlassert(glGetError() == GL_NO_ERROR); + } + } + } + break; + case CVPInstruction::DP3: + nglShaderOp2EXT(GL_OP_DOT3_EXT, destValue, srcValue[0], srcValue[1]); + EVS_INFO("GL_OP_DOT3_EXT"); + ++numOp; + break; + case CVPInstruction::DP4: + nglShaderOp2EXT(GL_OP_DOT4_EXT, destValue, srcValue[0], srcValue[1]); + EVS_INFO("GL_OP_DOT4_EXT"); + ++numOp; + break; + case CVPInstruction::DST: + doSwizzle(firstTempRegister, srcValue[0], GL_ONE_EXT, GL_Y_EXT, GL_Z_EXT, GL_ONE_EXT); + EVS_INFO("GL_OP_DOT4_EXT"); + ++numOp; + doSwizzle(firstTempRegister + 1, srcValue[1], GL_ONE_EXT, GL_Y_EXT, GL_ONE_EXT, GL_W_EXT); + ++numSwizzle; + nglShaderOp2EXT(GL_OP_MUL_EXT, destValue, firstTempRegister, firstTempRegister + 1); + EVS_INFO("GL_OP_MUL_EXT"); + ++numOp; + break; + case CVPInstruction::LIT: + { + uint writeMask = program[k].Dest.WriteMask; + nglExtractComponentEXT(firstTempScalar, srcValue[0], 0); // extract X from the source + if (writeMask & 4) + { + nglExtractComponentEXT(firstTempScalar + 1, srcValue[0], 1); // extract Y from the source + EVS_INFO("Extract component"); + ++numEC; + nglExtractComponentEXT(firstTempScalar + 2, srcValue[0], 3); // extract W from the source + EVS_INFO("Extract component"); + ++numEC; + // result = X > 0 ? Y^W : 0 + nglShaderOp2EXT(GL_OP_POWER_EXT, firstTempScalar + 2, firstTempScalar + 1, firstTempScalar + 2); + EVS_INFO("GL_OP_POWER_EXT"); + ++numOp; + nglShaderOp2EXT(GL_OP_SET_GE_EXT, firstTempScalar + 1, firstTempScalar, cteZero); + EVS_INFO("GL_OP_SET_GE_EXT"); + ++numOp; + nglShaderOp2EXT(GL_OP_MUL_EXT, firstTempScalar + 2, firstTempScalar + 2, firstTempScalar + 1); + EVS_INFO("GL_OP_MUL_EXT"); + ++numOp; + // store result + nglInsertComponentEXT(destValue, firstTempScalar + 2, 2); + EVS_INFO("Insert component"); + ++numIC; + } + if (writeMask & 2) + { + // clamp N.L to [0, 1] + nglShaderOp3EXT(GL_OP_CLAMP_EXT, firstTempScalar, firstTempScalar, cteZero, cteOne); + EVS_INFO("GL_OP_CLAMP_EXT"); + ++numOp; + nglInsertComponentEXT(destValue, firstTempScalar, 1); + EVS_INFO("Insert component"); + ++numIC; + } + // set x and w to 1 if they are not masked + if (writeMask & (1 + 8)) + { + doSwizzle(destValue, destValue, + (writeMask & 1) ? GL_ONE_EXT : GL_X_EXT, + GL_Y_EXT, + GL_Z_EXT, + (writeMask & 8) ? GL_ONE_EXT : GL_W_EXT); + ++numSwizzle; + } + + } + break; + case CVPInstruction::MIN: + nglShaderOp2EXT(GL_OP_MIN_EXT, destValue, srcValue[0], srcValue[1]); + EVS_INFO("GL_OP_MIN_EXT"); + ++numOp; + break; + case CVPInstruction::MAX: + nglShaderOp2EXT(GL_OP_MAX_EXT, destValue, srcValue[0], srcValue[1]); + EVS_INFO("GL_OP_MAX_EXT"); + ++numOp; + break; + case CVPInstruction::SLT: + nglShaderOp2EXT(GL_OP_SET_LT_EXT, destValue, srcValue[0], srcValue[1]); + EVS_INFO("GL_OP_SET_LT_EXT"); + ++numOp; + break; + case CVPInstruction::SGE: + nglShaderOp2EXT(GL_OP_SET_GE_EXT, destValue, srcValue[0], srcValue[1]); + EVS_INFO("GL_OP_SET_GE_EXT"); + ++numOp; + break; + case CVPInstruction::EXPP: + { + uint writeMask = program[k].Dest.WriteMask; + nlassert(program[k].Src1.Swizzle.isScalar()); + GLuint compIndex = program[k].Src1.Swizzle.Comp[0]; + nglExtractComponentEXT(firstTempScalar + 2, srcValue[0], compIndex); // extract W from the source + EVS_INFO("Extract component"); + ++numEC; + if (writeMask & 1) + { + nglShaderOp1EXT(GL_OP_FLOOR_EXT, firstTempScalar, firstTempScalar + 2); // (int) W + EVS_INFO("GL_OP_FLOOR_EXT"); + ++numOp; + nglShaderOp1EXT(GL_OP_EXP_BASE_2_EXT, firstTempScalar, firstTempScalar); // 2 ^ (int) W + EVS_INFO("GL_OP_EXP_BASE_2_EXT"); + ++numOp; + } + if (writeMask & 2) + { + nglShaderOp1EXT(GL_OP_FRAC_EXT, firstTempScalar + 1, firstTempScalar + 2); // frac(W) + EVS_INFO("GL_OP_FRAC_EXT"); + ++numOp; + } + if (writeMask & 4) nglShaderOp1EXT(GL_OP_EXP_BASE_2_EXT, firstTempScalar + 2, firstTempScalar + 2); // 2 ^W + // store the results + if (writeMask & 1) { nglInsertComponentEXT(destValue, firstTempScalar, 0); EVS_INFO("Insert component"); ++numIC; } + if (writeMask & 2) { nglInsertComponentEXT(destValue, firstTempScalar + 1, 1); EVS_INFO("Insert component"); ++numIC; } + if (writeMask & 4) { nglInsertComponentEXT(destValue, firstTempScalar + 2, 2); EVS_INFO("Insert component"); ++numIC; } + // set W to 1 and leave other values unchanged + if (writeMask & 8) { doSwizzle(destValue, destValue, GL_X_EXT, GL_Y_EXT, GL_Z_EXT, GL_ONE_EXT); ++numSwizzle; } + } + break; + case CVPInstruction::LOG: + { + uint writeMask = program[k].Dest.WriteMask; + nlassert(program[k].Src1.Swizzle.isScalar()); + // extract the component we need + nglExtractComponentEXT(firstTempScalar, srcValue[0], (GLuint) program[k].Src1.Swizzle.Comp[0]); + EVS_INFO("Extract component"); + ++numEC; + // get abs(src) : abs(src) = max(src, -src) + nglShaderOp1EXT(GL_OP_NEGATE_EXT, firstTempScalar + 1, firstTempScalar); + EVS_INFO("GL_OP_NEGATE_EXT"); + ++numOp; + nglShaderOp2EXT(GL_OP_MAX_EXT, firstTempScalar, firstTempScalar, firstTempScalar + 1); + EVS_INFO("GL_OP_MAX_EXT"); + ++numOp; + nglShaderOp1EXT(GL_OP_LOG_BASE_2_EXT, firstTempScalar, firstTempScalar); // (int) W + EVS_INFO("GL_OP_LOG_BASE_2_EXT"); + ++numOp; + // store the results + for(uint l = 0; l < 4; ++l) + { + if (writeMask & (1 << l)) + { + nglInsertComponentEXT(destValue, firstTempScalar, l); + EVS_INFO("Insert component"); + nlassert(glGetError() == GL_NO_ERROR); + } + } + } + break; + case CVPInstruction::RCP: + { + uint writeMask = program[k].Dest.WriteMask; + nlassert(program[k].Src1.Swizzle.isScalar()); + // extract the component we need + nglExtractComponentEXT(firstTempScalar, srcValue[0], (GLuint) program[k].Src1.Swizzle.Comp[0]); + EVS_INFO("Extract component"); + ++numEC; + nglShaderOp1EXT(GL_OP_RECIP_EXT, firstTempScalar + 1, firstTempScalar); + EVS_INFO("GL_OP_RECIP_EXT"); + ++numOp; + // duplicate result in destination + for(uint l = 0; l < 4; ++l) + { + if (writeMask & (1 << l)) + { + nglInsertComponentEXT(destValue, firstTempScalar + 1, l); + EVS_INFO("insert component"); + ++numIC; + } + } + } + break; + default: + break; + } + + glError = glGetError(); + nlassert(glError == GL_NO_ERROR); + + + // apply write mask if any + if (writeMask != 0x0f) + { + if ((destOperand.Type == CVPOperand::OutputRegister && destOperand.Value.OutputRegisterValue != CVPOperand::OFogCoord)) + { + uint &outputMask = componentWritten[outputRegisterIndex]; + // is a texture coordinate or a color being written ? + if ((maskedDestValue >= GL_OUTPUT_TEXTURE_COORD0_EXT && maskedDestValue <= GL_OUTPUT_TEXTURE_COORD7_EXT) + || maskedDestValue == GL_OUTPUT_COLOR0_EXT + || maskedDestValue == GL_OUTPUT_COLOR1_EXT + ) + { + // test if this is the last time this output will be written + bool found = false; + // if this was the last write for this output, must set unfilled component + // NB : this loop could be optimized, but vertex program are rather short for now .. + for(uint m = k + 1; m < program.size(); ++m) + { + if (program[m].Dest.Type == CVPOperand::OutputRegister) // another output to this texture ? + { + if (program[m].Dest.Value.OutputRegisterValue == program[k].Dest.Value.OutputRegisterValue) + { + found = true; + break; + } + } + } + + if (found) + { + if (!outputWritten) + { + // write values + doWriteMask(maskedDestValue, destValue, + writeMask & 1 ? GL_TRUE : GL_FALSE, + writeMask & 2 ? GL_TRUE : GL_FALSE, + writeMask & 4 ? GL_TRUE : GL_FALSE, + writeMask & 8 ? GL_TRUE : GL_FALSE); + ++numWM; + } + } + else // this is the last write, check if the mask is complete + { + if ((outputMask | writeMask) == 0xf) + { + if (!outputWritten) + { + // ok, after this call everything has been written + // write values + doWriteMask(maskedDestValue, destValue, + writeMask & 1 ? GL_TRUE : GL_FALSE, + writeMask & 2 ? GL_TRUE : GL_FALSE, + writeMask & 4 ? GL_TRUE : GL_FALSE, + writeMask & 8 ? GL_TRUE : GL_FALSE); + ++numWM; + } + } + else + { + uint prevMask = outputMask; + uint newMask = writeMask | outputMask; + + // complete unused entries + + // if primary color is output, then the default color is white + if (maskedDestValue == GL_OUTPUT_COLOR0_EXT) + { + doSwizzle(firstTempRegister, destValue, + newMask & 1 ? GL_X_EXT : GL_ONE_EXT, + newMask & 2 ? GL_Y_EXT : GL_ONE_EXT, + newMask & 4 ? GL_Z_EXT : GL_ONE_EXT, + newMask & 8 ? GL_W_EXT : GL_ONE_EXT); + } + else + { + doSwizzle(firstTempRegister, destValue, + newMask & 1 ? GL_X_EXT : GL_ZERO_EXT, + newMask & 2 ? GL_Y_EXT : GL_ZERO_EXT, + newMask & 4 ? GL_Z_EXT : GL_ZERO_EXT, + newMask & 8 ? GL_W_EXT : GL_ONE_EXT); + } + if (!outputWritten) + { + ++numWM; + doWriteMask(maskedDestValue, firstTempRegister, + prevMask & 1 ? GL_FALSE : GL_TRUE, + prevMask & 2 ? GL_FALSE : GL_TRUE, + prevMask & 4 ? GL_FALSE : GL_TRUE, + prevMask & 8 ? GL_FALSE : GL_TRUE + ); + ++numWM; + } + outputMask = 0xf; + } + } + } + else + { + if (!outputWritten) + { + doWriteMask(maskedDestValue, destValue, + writeMask & 1 ? GL_TRUE : GL_FALSE, + writeMask & 2 ? GL_TRUE : GL_FALSE, + writeMask & 4 ? GL_TRUE : GL_FALSE, + writeMask & 8 ? GL_TRUE : GL_FALSE); + ++numWM; + } + } + // complete the mask + outputMask |= writeMask; + } + else if (destOperand.Type != CVPOperand::OutputRegister) + { + if (!outputWritten) + { + doWriteMask(maskedDestValue, destValue, + writeMask & 1 ? GL_TRUE : GL_FALSE, + writeMask & 2 ? GL_TRUE : GL_FALSE, + writeMask & 4 ? GL_TRUE : GL_FALSE, + writeMask & 8 ? GL_TRUE : GL_FALSE); + ++numWM; + } + } + } + + glError = glGetError(); + nlassert(glError == GL_NO_ERROR); + } + + + + // if color have not been written, write with default values + if (componentWritten[CVPOperand::OPrimaryColor] == 0) + { + // we specify vertex coord has input for swizzle, but we don't read any component.. + doSwizzle(GL_OUTPUT_COLOR0_EXT, _EVSPositionHandle, GL_ZERO_EXT, GL_ZERO_EXT, GL_ZERO_EXT, GL_ONE_EXT); + EVS_INFO("Swizzle (Complete primary color)"); + ++numSwizzle; + } + else + { + nlassert(componentWritten[CVPOperand::OPrimaryColor] == 0xf); + } + if (componentWritten[CVPOperand::OSecondaryColor] == 0) + { + // we specify vertex coord has input for swizzle, but we don't read any component.. + doSwizzle(GL_OUTPUT_COLOR1_EXT, _EVSPositionHandle, GL_ZERO_EXT, GL_ZERO_EXT, GL_ZERO_EXT, GL_ONE_EXT); + EVS_INFO("Swizzle (Complete secondary color)"); + ++numSwizzle; + } + else + { + nlassert(componentWritten[CVPOperand::OSecondaryColor] == 0xf); + } + nlassert(componentWritten[CVPOperand::OHPosition] == 0xf); // should have written all component of position + + glError = glGetError(); + nlassert(glError == GL_NO_ERROR); + + // if fog has been written, perform conversion (if there's no ATI driver fix) + if (!_ATIFogRangeFixed && componentWritten[CVPOperand::OFogCoord] == 0xf) + { + // Well this could be avoided, but we should make 2 cases for each vertex program.. :( + doSwizzle(firstTempRegister, _EVSConstantHandle + _EVSNumConstant, GL_X_EXT, GL_X_EXT, GL_X_EXT, GL_X_EXT); + doSwizzle(firstTempRegister + 1, _EVSConstantHandle + _EVSNumConstant, GL_Y_EXT, GL_Y_EXT, GL_Y_EXT, GL_Y_EXT); + nglShaderOp3EXT(GL_OP_MADD_EXT, firstTempRegister + 2, fogTemp, firstTempRegister, firstTempRegister + 1); + EVS_INFO("Use MAD for fog conversion"); + nglExtractComponentEXT(GL_OUTPUT_FOG_EXT, firstTempRegister + 2, 0); + EVS_INFO("Extract component to fog"); + } + + glError = glGetError(); + nlassert(glError == GL_NO_ERROR); + } + nglEndVertexShaderEXT(); + + /*glError = glGetError(); + nlassert(glError == GL_NO_ERROR);*/ + + GLboolean optimizedShader; + glGetBooleanv(GL_VERTEX_SHADER_OPTIMIZED_EXT, &optimizedShader); + if (!optimizedShader) + { + nlwarning("Failed to optimize a vertex program with the EXT_vertex_shader extension, this shader will be disabled"); + return false; + } + + // see which input registers are used + usedInputRegisters = 0; + + uint k, l; + // convert each instruction of the vertex program + for(k = 0; k < program.size(); ++k) + { + uint numSrc = program[k].getNumUsedSrc(); + for(l = 0; l < numSrc; ++l) + { + const CVPOperand &op = program[k].getSrc(l); + if (op.Type == CVPOperand::InputRegister) + { + usedInputRegisters |= convInputRegisterToVBFlag(op.Value.InputRegisterValue); + } + } + } + +#ifdef DEBUG_SETUP_EXT_VERTEX_SHADER + nlinfo("3D: ========================"); + nlinfo("3D: num Opcode = %d", numOp); + nlinfo("3D: num Indexing = %d", numOpIndex); + nlinfo("3D: num Swizzle = %d", numSwizzle); + nlinfo("3D: num extract component = %d", numEC); + nlinfo("3D: num insert component = %d", numIC); + nlinfo("3D: num write mask = %d", numWM); +#endif + + return true; +#else + return false; +#endif +} + +//================================================================================================= +static const char *ARBVertexProgramInstrToName[] = +{ + "MOV ", + "ARL ", + "MUL ", + "ADD ", + "MAD ", + "RSQ ", + "DP3 ", + "DP4 ", + "DST ", + "LIT ", + "MIN ", + "MAX ", + "SLT ", + "SGE ", + "EXP ", + "LOG ", + "RCP " +}; + +//================================================================================================= +static const char *ARBVertexProgramOutputRegisterToName[] = +{ + "position", + "color.primary", + "color.secondary", + "color.back.primary", + "color.back.secondary", + "fogcoord", + "pointsize", + "texcoord[0]", + "texcoord[1]", + "texcoord[2]", + "texcoord[3]", + "texcoord[4]", + "texcoord[5]", + "texcoord[6]", + "texcoord[7]" +}; + + +//================================================================================================= +static void ARBVertexProgramDumpWriteMask(uint mask, std::string &out) +{ + H_AUTO_OGL(ARBVertexProgramDumpWriteMask) + if (mask == 0xf) + { + out = ""; + return; + } + out = "."; + if (mask & 1) out +="x"; + if (mask & 2) out +="y"; + if (mask & 4) out +="z"; + if (mask & 8) out +="w"; +} + +//================================================================================================= +static void ARBVertexProgramDumpSwizzle(const CVPSwizzle &swz, std::string &out) +{ + H_AUTO_OGL(ARBVertexProgramDumpSwizzle) + if (swz.isIdentity()) + { + out = ""; + return; + } + out = "."; + for(uint k = 0; k < 4; ++k) + { + switch(swz.Comp[k]) + { + case CVPSwizzle::X: out += "x"; break; + case CVPSwizzle::Y: out += "y"; break; + case CVPSwizzle::Z: out += "z"; break; + case CVPSwizzle::W: out += "w"; break; + default: + nlassert(0); + break; + } + if (swz.isScalar() && k == 0) break; + } + +} + +//================================================================================================= +static void ARBVertexProgramDumpOperand(const CVPOperand &op, bool destOperand, std::string &out) +{ + H_AUTO_OGL(ARBVertexProgramDumpOperand) + out = op.Negate ? " -" : " "; + switch(op.Type) + { + case CVPOperand::Variable: out += "R" + NLMISC::toString(op.Value.VariableValue); break; + case CVPOperand::Constant: + out += "c["; + if (op.Indexed) + { + out += "A0.x + "; + } + out += NLMISC::toString(op.Value.ConstantValue) + "]"; + break; + case CVPOperand::InputRegister: out += "vertex.attrib[" + NLMISC::toString((uint) op.Value.InputRegisterValue) + "]"; break; + case CVPOperand::OutputRegister: + nlassert(op.Value.OutputRegisterValue < CVPOperand::OutputRegisterCount); + out += "result." + std::string(ARBVertexProgramOutputRegisterToName[op.Value.OutputRegisterValue]); + break; + case CVPOperand::AddressRegister: + out += "A0.x"; + break; + default: + break; + } + std::string suffix; + if (destOperand) + { + ARBVertexProgramDumpWriteMask(op.WriteMask, suffix); + } + else + { + ARBVertexProgramDumpSwizzle(op.Swizzle, suffix); + } + out += suffix; +} + +//================================================================================================= +/** Dump an instruction in a string + */ +static void ARBVertexProgramDumpInstr(const CVPInstruction &instr, std::string &out) +{ + H_AUTO_OGL(ARBVertexProgramDumpInstr) + nlassert(instr.Opcode < CVPInstruction::OpcodeCount); + // Special case for EXP with a scalar output argument (y component) -> translate to FRC + out = ARBVertexProgramInstrToName[instr.Opcode]; + uint nbOp = instr.getNumUsedSrc(); + std::string destOperand; + ARBVertexProgramDumpOperand(instr.Dest, true, destOperand); + out += destOperand; + for(uint k = 0; k < nbOp; ++k) + { + out += ", "; + std::string srcOperand; + ARBVertexProgramDumpOperand(instr.getSrc(k), false, srcOperand); + out += srcOperand; + } + out +="; \n"; + +} + +// *************************************************************************** +bool CDriverGL::setupARBVertexProgram (const CVPParser::TProgram &inParsedProgram, GLuint id, bool &specularWritten) +{ + H_AUTO_OGL(CDriverGL_setupARBVertexProgram); + +#ifndef USE_OPENGLES + // tmp + CVPParser::TProgram parsedProgram = inParsedProgram; + // + std::string code; + code = "!!ARBvp1.0\n"; + // declare temporary registers + code += "TEMP "; + const uint NUM_TEMPORARIES = 12; + for(uint k = 0; k < NUM_TEMPORARIES; ++k) + { + code += toString("R%d", (int) k); + if (k != (NUM_TEMPORARIES - 1)) + { + code +=", "; + } + } + code += "; \n"; + // declare address register + code += "ADDRESS A0;\n"; + // declare constant register + code += "PARAM c[96] = {program.env[0..95]}; \n"; + uint writtenSpecularComponents = 0; + for(uint k = 0; k < parsedProgram.size(); ++k) + { + if (parsedProgram[k].Dest.Type == CVPOperand::OutputRegister && parsedProgram[k].Dest.Value.OutputRegisterValue == CVPOperand::OSecondaryColor) + { + writtenSpecularComponents |= parsedProgram[k].Dest.WriteMask; + } + } + // tmp fix : write unwritten components of specular (seems that glDisable(GL_COLOR_SUM_ARB) does not work in a rare case for me ...) + if (writtenSpecularComponents != 0xf) + { + // add a new instruction to write 0 in unwritten components + CVPSwizzle sw; + sw.Comp[0] = CVPSwizzle::X; + sw.Comp[1] = CVPSwizzle::Y; + sw.Comp[2] = CVPSwizzle::Z; + sw.Comp[3] = CVPSwizzle::W; + + CVPInstruction vpi; + vpi.Opcode = CVPInstruction::ADD; + vpi.Dest.WriteMask = 0xf ^ writtenSpecularComponents; + vpi.Dest.Type = CVPOperand::OutputRegister; + vpi.Dest.Value.OutputRegisterValue = CVPOperand::OSecondaryColor; + vpi.Dest.Indexed = false; + vpi.Dest.Negate = false; + vpi.Dest.Swizzle = sw; + vpi.Src1.Type = CVPOperand::InputRegister; + vpi.Src1.Value.InputRegisterValue = CVPOperand::IPosition; // tmp -> check that position is present + vpi.Src1.Indexed = false; + vpi.Src1.Negate = false; + vpi.Src1.Swizzle = sw; + vpi.Src2.Type = CVPOperand::InputRegister; + vpi.Src2.Value.InputRegisterValue = CVPOperand::IPosition; // tmp -> chec + vpi.Src2.Indexed = false; + vpi.Src2.Negate = true; + vpi.Src2.Swizzle = sw; + // + parsedProgram.push_back(vpi); + } + specularWritten = (writtenSpecularComponents != 0); + + for(uint k = 0; k < parsedProgram.size(); ++k) + { + std::string instr; + ARBVertexProgramDumpInstr(parsedProgram[k], instr); + code += instr + "\r\n"; + } + code += "END\n"; + // + /* + static COFile output; + static bool opened = false; + if (!opened) + { + output.open("vp.txt", false, true); + opened = true; + } + std::string header = "====================================================================================="; + output.serial(header); + output.serial(code); + */ + // + nglBindProgramARB( GL_VERTEX_PROGRAM_ARB, id); + glGetError(); + nglProgramStringARB( GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, (GLsizei)code.size(), code.c_str() ); + GLenum err = glGetError(); + if (err != GL_NO_ERROR) + { + if (err == GL_INVALID_OPERATION) + { + GLint position; + glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &position); + nlassert(position != -1); // there was an error.. + nlassert(position < (GLint) code.size()); + uint line = 0; + const char *lineStart = code.c_str(); + for(uint k = 0; k < (uint) position; ++k) + { + if (code[k] == '\n') + { + lineStart = code.c_str() + k; + ++line; + } + } + nlwarning("ARB vertex program parse error at line %d.", (int) line); + // search end of line + const char *lineEnd = code.c_str() + code.size(); + for(uint k = position; k < code.size(); ++k) + { + if (code[k] == '\n') + { + lineEnd = code.c_str() + k; + break; + } + } + nlwarning(std::string(lineStart, lineEnd).c_str()); + // display the gl error msg + const GLubyte *errorMsg = glGetString(GL_PROGRAM_ERROR_STRING_ARB); + nlassert((const char *) errorMsg); + nlwarning((const char *) errorMsg); + } + nlassert(0); + return false; + } + +#ifdef NL_OS_MAC + // Wait for GPU to finish program upload, else draw comands might crash. + // Happened to CVegetableBlendLayerModel (glDrawElements()). + // For more information, see http://dev.ryzom.com/issues/1006 + glFinish(); +#endif + + return true; +#else + return false; +#endif +} + + + +// *************************************************************************** +bool CDriverGL::activeARBVertexProgram (CVertexProgram *program) +{ + H_AUTO_OGL(CDriverGL_activeARBVertexProgram); + +#ifndef USE_OPENGLES + // Setup or unsetup ? + if (program) + { + // Driver info + CVertexProgamDrvInfosGL *drvInfo; + + // Program setuped ? + if (program->_DrvInfo==NULL) + { + // try to parse the program + CVPParser parser; + CVPParser::TProgram parsedProgram; + std::string errorOutput; + bool result = parser.parse(program->getProgram().c_str(), parsedProgram, errorOutput); + if (!result) + { + nlwarning("Unable to parse a vertex program."); + #ifdef NL_DEBUG + nlerror(errorOutput.c_str()); + #endif + return false; + } + // Insert into driver list. (so it is deleted when driver is deleted). + ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL); + + // Create a driver info + *it = drvInfo = new CVertexProgamDrvInfosGL (this, it); + // Set the pointer + program->_DrvInfo=drvInfo; + + if (!setupARBVertexProgram(parsedProgram, drvInfo->ID, drvInfo->SpecularWritten)) + { + delete drvInfo; + program->_DrvInfo = NULL; + _VtxPrgDrvInfos.erase(it); + return false; + } + } + else + { + // Cast the driver info pointer + drvInfo=safe_cast((IVertexProgramDrvInfos*)program->_DrvInfo); + } + glEnable( GL_VERTEX_PROGRAM_ARB ); + _VertexProgramEnabled = true; + nglBindProgramARB( GL_VERTEX_PROGRAM_ARB, drvInfo->ID ); + if (drvInfo->SpecularWritten) + { + glEnable( GL_COLOR_SUM_ARB ); + } + else + { + glDisable( GL_COLOR_SUM_ARB ); // no specular written + } + _LastSetuppedVP = program; + } + else + { + glDisable( GL_VERTEX_PROGRAM_ARB ); + glDisable( GL_COLOR_SUM_ARB ); + _VertexProgramEnabled = false; + } + return true; +#else + return false; +#endif +} + +// *************************************************************************** +bool CDriverGL::activeEXTVertexShader (CVertexProgram *program) +{ + H_AUTO_OGL(CDriverGL_activeEXTVertexShader); + +#ifndef USE_OPENGLES + // Setup or unsetup ? + if (program) + { + // Driver info + CVertexProgamDrvInfosGL *drvInfo; + + // Program setuped ? + if (program->_DrvInfo==NULL) + { + // try to parse the program + CVPParser parser; + CVPParser::TProgram parsedProgram; + std::string errorOutput; + bool result = parser.parse(program->getProgram().c_str(), parsedProgram, errorOutput); + if (!result) + { + nlwarning("Unable to parse a vertex program."); + #ifdef NL_DEBUG + nlerror(errorOutput.c_str()); + #endif + return false; + } + + /* + FILE *f = fopen(getLogDirectory() + "test.txt", "wb"); + if (f) + { + std::string vpText; + CVPParser::dump(parsedProgram, vpText); + fwrite(vpText.c_str(), vpText.size(), 1, f); + fclose(f); + } + */ + + // Insert into driver list. (so it is deleted when driver is deleted). + ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL); + + // Create a driver info + *it = drvInfo = new CVertexProgamDrvInfosGL (this, it); + // Set the pointer + program->_DrvInfo=drvInfo; + + if (!setupEXTVertexShader(parsedProgram, drvInfo->ID, drvInfo->Variants, drvInfo->UsedVertexComponents)) + { + delete drvInfo; + program->_DrvInfo = NULL; + _VtxPrgDrvInfos.erase(it); + return false; + } + } + else + { + // Cast the driver info pointer + drvInfo=safe_cast((IVertexProgramDrvInfos*)program->_DrvInfo); + } + + glEnable( GL_VERTEX_SHADER_EXT); + _VertexProgramEnabled = true; + nglBindVertexShaderEXT( drvInfo->ID ); + _LastSetuppedVP = program; + } + else + { + glDisable( GL_VERTEX_SHADER_EXT ); + _VertexProgramEnabled = false; + } + return true; +#else + return false; +#endif +} + +// *************************************************************************** +bool CDriverGL::activeVertexProgram (CVertexProgram *program) +{ + H_AUTO_OGL(CDriverGL_activeVertexProgram) + // Extension here ? + if (_Extensions.NVVertexProgram) + { + return activeNVVertexProgram(program); + } + else if (_Extensions.ARBVertexProgram) + { + return activeARBVertexProgram(program); + } + else if (_Extensions.EXTVertexShader) + { + return activeEXTVertexShader(program); + } + + // Can't do anything + return false; +} + + +// *************************************************************************** + +void CDriverGL::setConstant (uint index, float f0, float f1, float f2, float f3) +{ + H_AUTO_OGL(CDriverGL_setConstant); + +#ifndef USE_OPENGLES + // Vertex program exist ? + if (_Extensions.NVVertexProgram) + { + // Setup constant + nglProgramParameter4fNV (GL_VERTEX_PROGRAM_NV, index, f0, f1, f2, f3); + } + else if (_Extensions.ARBVertexProgram) + { + nglProgramEnvParameter4fARB(GL_VERTEX_PROGRAM_ARB, index, f0, f1, f2, f3); + } + else if (_Extensions.EXTVertexShader) + { + float datas[] = { f0, f1, f2, f3 }; + nglSetInvariantEXT(_EVSConstantHandle + index, GL_FLOAT, datas); + } +#endif +} + + +// *************************************************************************** + +void CDriverGL::setConstant (uint index, double d0, double d1, double d2, double d3) +{ + H_AUTO_OGL(CDriverGL_setConstant); + +#ifndef USE_OPENGLES + // Vertex program exist ? + if (_Extensions.NVVertexProgram) + { + // Setup constant + nglProgramParameter4dNV (GL_VERTEX_PROGRAM_NV, index, d0, d1, d2, d3); + } + else if (_Extensions.ARBVertexProgram) + { + nglProgramEnvParameter4dARB(GL_VERTEX_PROGRAM_ARB, index, d0, d1, d2, d3); + } + else if (_Extensions.EXTVertexShader) + { + double datas[] = { d0, d1, d2, d3 }; + nglSetInvariantEXT(_EVSConstantHandle + index, GL_DOUBLE, datas); + } +#endif +} + + +// *************************************************************************** + +void CDriverGL::setConstant (uint index, const NLMISC::CVector& value) +{ + H_AUTO_OGL(CDriverGL_setConstant); + +#ifndef USE_OPENGLES + // Vertex program exist ? + if (_Extensions.NVVertexProgram) + { + // Setup constant + nglProgramParameter4fNV (GL_VERTEX_PROGRAM_NV, index, value.x, value.y, value.z, 0); + } + else if (_Extensions.ARBVertexProgram) + { + nglProgramEnvParameter4fARB(GL_VERTEX_PROGRAM_ARB, index, value.x, value.y, value.z, 0); + } + else if (_Extensions.EXTVertexShader) + { + float datas[] = { value.x, value.y, value.z, 0 }; + nglSetInvariantEXT(_EVSConstantHandle + index, GL_FLOAT, datas); + } +#endif +} + + +// *************************************************************************** + +void CDriverGL::setConstant (uint index, const NLMISC::CVectorD& value) +{ + H_AUTO_OGL(CDriverGL_setConstant); + +#ifndef USE_OPENGLES + // Vertex program exist ? + if (_Extensions.NVVertexProgram) + { + // Setup constant + nglProgramParameter4dNV (GL_VERTEX_PROGRAM_NV, index, value.x, value.y, value.z, 0); + } + else if (_Extensions.ARBVertexProgram) + { + nglProgramEnvParameter4dARB(GL_VERTEX_PROGRAM_ARB, index, value.x, value.y, value.z, 0); + } + else if (_Extensions.EXTVertexShader) + { + double datas[] = { value.x, value.y, value.z, 0 }; + nglSetInvariantEXT(_EVSConstantHandle + index, GL_DOUBLE, datas); + } +#endif +} + + +// *************************************************************************** +void CDriverGL::setConstant (uint index, uint num, const float *src) +{ + H_AUTO_OGL(CDriverGL_setConstant); + +#ifndef USE_OPENGLES + // Vertex program exist ? + if (_Extensions.NVVertexProgram) + { + nglProgramParameters4fvNV(GL_VERTEX_PROGRAM_NV, index, num, src); + } + else if (_Extensions.ARBVertexProgram) + { + for(uint k = 0; k < num; ++k) + { + nglProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, index + k, src + 4 * k); + } + } + else if (_Extensions.EXTVertexShader) + { + for(uint k = 0; k < num; ++k) + { + nglSetInvariantEXT(_EVSConstantHandle + index + k, GL_FLOAT, (void *) (src + 4 * k)); + } + } +#endif +} + +// *************************************************************************** +void CDriverGL::setConstant (uint index, uint num, const double *src) +{ + H_AUTO_OGL(CDriverGL_setConstant); + +#ifndef USE_OPENGLES + // Vertex program exist ? + if (_Extensions.NVVertexProgram) + { + nglProgramParameters4dvNV(GL_VERTEX_PROGRAM_NV, index, num, src); + } + else if (_Extensions.ARBVertexProgram) + { + for(uint k = 0; k < num; ++k) + { + nglProgramEnvParameter4dvARB(GL_VERTEX_PROGRAM_ARB, index + k, src + 4 * k); + } + } + else if (_Extensions.EXTVertexShader) + { + for(uint k = 0; k < num; ++k) + { + nglSetInvariantEXT(_EVSConstantHandle + index + k, GL_DOUBLE, (void *) (src + 4 * k)); + } + } +#endif +} + +// *************************************************************************** + +const uint CDriverGL::GLMatrix[IDriver::NumMatrix]= +{ + GL_MODELVIEW, + GL_PROJECTION, +#ifdef USE_OPENGLES + GL_MODELVIEW +#else + GL_MODELVIEW_PROJECTION_NV +#endif +}; + + +// *************************************************************************** + +const uint CDriverGL::GLTransform[IDriver::NumTransform]= +{ +#ifdef USE_OPENGLES + 0, + 0, + 0, + 0 +#else + GL_IDENTITY_NV, + GL_INVERSE_NV, + GL_TRANSPOSE_NV, + GL_INVERSE_TRANSPOSE_NV +#endif +}; + + +// *************************************************************************** + +void CDriverGL::setConstantMatrix (uint index, IDriver::TMatrix matrix, IDriver::TTransform transform) +{ + H_AUTO_OGL(CDriverGL_setConstantMatrix); + +#ifndef USE_OPENGLES + // Vertex program exist ? + if (_Extensions.NVVertexProgram) + { + // First, ensure that the render setup is correclty setuped. + refreshRenderSetup(); + + // Track the matrix + nglTrackMatrixNV (GL_VERTEX_PROGRAM_NV, index, GLMatrix[matrix], GLTransform[transform]); + // Release Track => matrix data is copied. + nglTrackMatrixNV (GL_VERTEX_PROGRAM_NV, index, GL_NONE, GL_IDENTITY_NV); + } + else + { + // First, ensure that the render setup is correctly setuped. + refreshRenderSetup(); + CMatrix mat; + switch (matrix) + { + case IDriver::ModelView: + mat = _ModelViewMatrix; + break; + case IDriver::Projection: + { + refreshProjMatrixFromGL(); + mat = _GLProjMat; + } + break; + case IDriver::ModelViewProjection: + refreshProjMatrixFromGL(); + mat = _GLProjMat * _ModelViewMatrix; + break; + default: + break; + } + + switch(transform) + { + case IDriver::Identity: break; + case IDriver::Inverse: + mat.invert(); + break; + case IDriver::Transpose: + mat.transpose(); + break; + case IDriver::InverseTranspose: + mat.invert(); + mat.transpose(); + break; + default: + break; + } + mat.transpose(); + float matDatas[16]; + mat.get(matDatas); + if (_Extensions.ARBVertexProgram) + { + nglProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, index, matDatas); + nglProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, index + 1, matDatas + 4); + nglProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, index + 2, matDatas + 8); + nglProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, index + 3, matDatas + 12); + } + else + { + nglSetInvariantEXT(_EVSConstantHandle + index, GL_FLOAT, matDatas); + nglSetInvariantEXT(_EVSConstantHandle + index + 1, GL_FLOAT, matDatas + 4); + nglSetInvariantEXT(_EVSConstantHandle + index + 2, GL_FLOAT, matDatas + 8); + nglSetInvariantEXT(_EVSConstantHandle + index + 3, GL_FLOAT, matDatas + 12); + } + } +#endif +} + +// *************************************************************************** + +void CDriverGL::setConstantFog (uint index) +{ + H_AUTO_OGL(CDriverGL_setConstantFog) + const float *values = _ModelViewMatrix.get(); + setConstant (index, -values[2], -values[6], -values[10], -values[14]); +} + +// *************************************************************************** + +void CDriverGL::enableVertexProgramDoubleSidedColor(bool doubleSided) +{ + H_AUTO_OGL(CDriverGL_enableVertexProgramDoubleSidedColor); + +#ifndef USE_OPENGLES + // Vertex program exist ? + if (_Extensions.NVVertexProgram) + { + // change mode (not cached because supposed to be rare) + if(doubleSided) + glEnable (GL_VERTEX_PROGRAM_TWO_SIDE_NV); + else + glDisable (GL_VERTEX_PROGRAM_TWO_SIDE_NV); + } + else if (_Extensions.ARBVertexProgram) + { + // change mode (not cached because supposed to be rare) + if(doubleSided) + glEnable (GL_VERTEX_PROGRAM_TWO_SIDE_ARB); + else + glDisable (GL_VERTEX_PROGRAM_TWO_SIDE_ARB); + } +#endif +} + + +// *************************************************************************** +bool CDriverGL::supportVertexProgramDoubleSidedColor() const +{ + H_AUTO_OGL(CDriverGL_supportVertexProgramDoubleSidedColor) + // currently only supported by NV_VERTEX_PROGRAM && ARB_VERTEX_PROGRAM + return _Extensions.NVVertexProgram || _Extensions.ARBVertexProgram; +} + +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} // NL3D diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_window.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_window.cpp new file mode 100644 index 000000000..be797a54e --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_window.cpp @@ -0,0 +1,3032 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "stdopengl.h" +#include "driver_opengl.h" +#include "driver_opengl_extension.h" +#include "driver_opengl_vertex_buffer_hard.h" + +// by default, we disable the windows menu keys (F10, ALT and ALT+SPACE key doesn't freeze or open the menu) +#define NL_DISABLE_MENU + +#ifdef NL_OS_MAC +# import "mac/cocoa_window_delegate.h" +# import "mac/cocoa_application_delegate.h" +# import +#elif defined (NL_OS_UNIX) +# ifdef HAVE_XRANDR +# include +# endif // HAVE_XRANDR +# ifdef HAVE_XRENDER +# include +# endif // HAVE_XRENDER +# include +# define _NET_WM_STATE_REMOVE 0 +# define _NET_WM_STATE_ADD 1 +#endif // NL_OS_UNIX + +#include "nel/misc/mouse_device.h" +#include "nel/misc/di_event_emitter.h" +#include "nel/3d/u_driver.h" +#include "nel/misc/file.h" + +using namespace std; +using namespace NLMISC; + +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + +#ifdef NL_OS_WINDOWS + +bool GlWndProc(CDriverGL *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + H_AUTO_OGL(GlWndProc) + + if (!driver) + return false; + + if(message == WM_SIZE) + { + if (driver->_CurrentMode.Windowed) + { + RECT rect; + GetClientRect (driver->_win, &rect); + + // Setup gl viewport + driver->_CurrentMode.Width = (uint16)(rect.right-rect.left); + driver->_CurrentMode.Height = (uint16)(rect.bottom-rect.top); + } + } + else if(message == WM_MOVE) + { + if (driver->_CurrentMode.Windowed) + { + RECT rect; + GetWindowRect (hWnd, &rect); + driver->_WindowX = rect.left; + driver->_WindowY = rect.top; + } + } + else if (message == WM_ACTIVATE) + { + WORD fActive = LOWORD(wParam); + if (fActive == WA_INACTIVE) + { + driver->_WndActive = false; + } + else + { + driver->_WndActive = true; + } + } + + bool trapMessage = false; + if (driver->_EventEmitter.getNumEmitters() > 0) + { + CWinEventEmitter *we = NLMISC::safe_cast(driver->_EventEmitter.getEmitter(0)); + // Process the message by the emitter + we->setHWnd(hWnd); + trapMessage = we->processMessage (hWnd, message, wParam, lParam); + } + return trapMessage; +} + +static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + H_AUTO_OGL(DriverGL_WndProc); + + // Get the driver pointer.. + CDriverGL *pDriver=(CDriverGL*)GetWindowLongPtr (hWnd, GWLP_USERDATA); + bool trapMessage = false; + if (pDriver != NULL) + { + trapMessage = GlWndProc (pDriver, hWnd, message, wParam, lParam); + } + + // we don't want Windows to erase background + if (message == WM_ERASEBKGND) + { + return TRUE; + } + + if (message == WM_SYSCOMMAND) + { + switch (wParam) + { +#ifdef NL_DISABLE_MENU + // disable menu (F10, ALT and ALT+SPACE key doesn't freeze or open the menu) + case SC_KEYMENU: +#endif // NL_DISABLE_MENU + + // Screensaver Trying To Start? + case SC_SCREENSAVE: + + // Monitor Trying To Enter Powersave? + case SC_MONITORPOWER: + + // Prevent From Happening + return 0; + + default: + break; + } + } + + // disable menu (default ALT-F4 behavior is disabled) + if (message == WM_CLOSE) + { + if(pDriver && pDriver->ExitFunc) + { + pDriver->ExitFunc(); + } + else + { +#ifndef NL_DISABLE_MENU + // if we don't disable menu, alt F4 make a direct exit else we discard the message + exit(0); +#endif // NL_DISABLE_MENU + } + return 0; + } + + return trapMessage ? 0 : DefWindowProcW(hWnd, message, wParam, lParam); +} + +#elif defined (NL_OS_MAC) + +bool GlWndProc(CDriverGL *driver, const void* e) +{ + H_AUTO_OGL(GlWndProc) + + if(!driver) + return false; + + NSEvent* event = [NSEvent eventWithEventRef:e]; + // NSLog(@"NSEvent in GlWndProc %@", event); + + return driver->_EventEmitter.processMessage(event); +} + +#elif defined (NL_OS_UNIX) + +static Atom XA_WM_STATE = 0; +static Atom XA_WM_STATE_FULLSCREEN = 0; +static Atom XA_WM_ICON = 0; +static Atom XA_WM_WINDOW_TYPE = 0; +static Atom XA_WM_WINDOW_TYPE_NORMAL = 0; +static Atom XA_FRAME_EXTENTS = 0; + +sint nelXErrorsHandler(Display *dpy, XErrorEvent *e) +{ + char buf[80]; + XGetErrorText(dpy, e->error_code, buf, sizeof(buf)); + nlwarning("3D: XError: %s", buf); + return 1; +} + +bool GlWndProc(CDriverGL *driver, XEvent &e) +{ + H_AUTO_OGL(GlWndProc) + + if (!driver) + return false; + + // nlinfo("3D: glop %d %d", e.type, e.xmap.window); + + // disable menu (default ALT-F4 behavior is disabled) + switch(e.type) + { + case DestroyNotify: + + if(driver && driver->ExitFunc) + { + driver->ExitFunc(); + } + else + { +#ifndef NL_DISABLE_MENU + // if we don't disable menu, alt F4 make a direct exit else we discard the message + exit(0); +#endif // NL_DISABLE_MENU + } + break; + + case MapNotify: + driver->_WndActive = true; + break; + + case UnmapNotify: + driver->_WndActive = false; + break; + + case Expose: +// nlwarning("Expose event"); + break; + + case ConfigureNotify: + + if (driver->_CurrentMode.Windowed && driver->_WndActive) + { + // first time setting decoration sizes + if ((driver->_DecorationWidth == -1) || (driver->_DecorationWidth == 0)) + { + Atom type_return = 0; + int format_return = 0; + unsigned long nitems_return = 0; + unsigned long bytes_after_return = 0; + long *data = NULL; + + int status = XGetWindowProperty(driver->_dpy, driver->_win, XA_FRAME_EXTENTS, 0, 4, False, XA_CARDINAL, &type_return, &format_return, &nitems_return, &bytes_after_return, (unsigned char**)&data); + + // succeeded to retrieve decoration size + if (status == Success && type_return == XA_CARDINAL && format_return == 32 && nitems_return == 4 && data) + { + driver->_DecorationWidth = data[0]; + driver->_DecorationHeight = data[2]; + } + else + { + // use difference between current position and previous one (set by application) + driver->_DecorationWidth = e.xconfigure.x - driver->_WindowX; + driver->_DecorationHeight = e.xconfigure.y - driver->_WindowY; + } + + // don't allow negative decoration sizes + if (driver->_DecorationWidth < 0) driver->_DecorationWidth = 0; + if (driver->_DecorationHeight < 0) driver->_DecorationHeight = 0; + } + + driver->_CurrentMode.Width = e.xconfigure.width; + driver->_CurrentMode.Height = e.xconfigure.height; + driver->_WindowX = e.xconfigure.x - driver->_DecorationWidth; + driver->_WindowY = e.xconfigure.y - driver->_DecorationHeight; + } + + break; + + default: + + // Process the message by the emitter + return driver->_EventEmitter.processMessage(e); + } + + return true; +} + +#endif // NL_OS_UNIX + +// *************************************************************************** +bool CDriverGL::init (uint windowIcon, emptyProc exitFunc) +{ + H_AUTO_OGL(CDriverGL_init) + + ExitFunc = exitFunc; + + createCursors(); + +#ifdef NL_OS_WINDOWS + WNDCLASSW wc; + + if (!_Registered) + { + memset(&wc,0,sizeof(wc)); + wc.style = CS_HREDRAW | CS_VREDRAW ;//| CS_DBLCLKS; + wc.lpfnWndProc = (WNDPROC)WndProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = GetModuleHandle(NULL); + wc.hIcon = (HICON)windowIcon; + wc.hCursor = _DefaultCursor; + wc.hbrBackground = WHITE_BRUSH; + wc.lpszClassName = L"NLClass"; + wc.lpszMenuName = NULL; + if ( !RegisterClassW(&wc) ) + { + return false; + } + _Registered=1; + } + + // Backup monitor color parameters + HDC dc = CreateDC ("DISPLAY", NULL, NULL, NULL); + if (dc) + { + _NeedToRestaureGammaRamp = GetDeviceGammaRamp (dc, _GammaRampBackuped) != FALSE; + + // Release the DC + ReleaseDC (NULL, dc); + } + else + { + nlwarning ("(CDriverGL::init): can't create DC"); + } + + // ati specific : try to retrieve driver version + retrieveATIDriverVersion(); +#elif defined(NL_OS_MAC) + + // nothing to do + nlunreferenced(windowIcon); + +#elif defined (NL_OS_UNIX) + + nlunreferenced(windowIcon); + + _dpy = XOpenDisplay(NULL); + + if (_dpy == NULL) + { + nlerror ("XOpenDisplay failed on '%s'", getenv("DISPLAY")); + } + else + { + nldebug("3D: XOpenDisplay on '%s' OK", getenv("DISPLAY")); + } + + _xrandr_version = 0; + +#ifdef HAVE_XRANDR + _OldSizeID = 0; + sint xrandr_major, xrandr_minor; + if (XRRQueryVersion(_dpy, &xrandr_major, &xrandr_minor)) + { + _xrandr_version = xrandr_major * 100 + xrandr_minor; + nlinfo("3D: XRandR %d.%d found", xrandr_major, xrandr_minor); + } +#endif // HAVE_XRANDR + + _xvidmode_version = 0; + +#ifdef XF86VIDMODE + sint event = 0, error = -1, vm_major = 0, vm_minor = 0; + if (XF86VidModeQueryExtension(_dpy, &event, &error) && XF86VidModeQueryVersion(_dpy, &vm_major, &vm_minor)) + { + _xvidmode_version = vm_major * 100 + vm_minor; + nlinfo("3D: XF86VidMode %d.%d found", vm_major, vm_minor); + } +#endif + + _xrender_version = 0; + +#ifdef HAVE_XRENDER + sint xrender_major, xrender_event, xrender_error; + if (XQueryExtension(_dpy, "RENDER", &xrender_major, &xrender_event, &xrender_error) && + XRenderQueryExtension(_dpy, &xrender_event, &xrender_error)) + { + sint xrender_minor = 0; + XRenderQueryVersion(_dpy, &xrender_major, &xrender_minor); + _xrender_version = xrender_major * 100 + xrender_minor; + nlinfo("3D: XRender %d.%d found", xrender_major, xrender_minor); + } +#endif // HAVE_XRENDER + + nldebug("3D: Available X Extensions:"); + + if (DebugLog) + { + // list all supported extensions + sint nextensions = 0; + char **extensions = XListExtensions(_dpy, &nextensions); + + for(sint i = 0; i < nextensions; ++i) + { + if(i%5==0) DebugLog->displayRaw("3D: "); + DebugLog->displayRaw(NLMISC::toString("%s ", extensions[i]).c_str()); + if(i%5==4) DebugLog->displayRaw("\n"); + } + + DebugLog->displayRaw("\n"); + + XFreeExtensionList(extensions); + } + + // set default X errors handler + XSetErrorHandler(nelXErrorsHandler); + + // define Atoms + XA_WM_STATE = XInternAtom(_dpy, "_NET_WM_STATE", False); + XA_WM_STATE_FULLSCREEN = XInternAtom(_dpy, "_NET_WM_STATE_FULLSCREEN", False); + XA_WM_ICON = XInternAtom(_dpy, "_NET_WM_ICON", False); + XA_WM_WINDOW_TYPE = XInternAtom(_dpy, "_NET_WM_WINDOW_TYPE", False); + XA_WM_WINDOW_TYPE_NORMAL = XInternAtom(_dpy, "_NET_WM_WINDOW_TYPE_NORMAL", False); + XA_FRAME_EXTENTS = XInternAtom(_dpy, "_NET_FRAME_EXTENTS", False); + +#endif + + return true; +} + +// *************************************************************************** +bool CDriverGL::unInit() +{ + H_AUTO_OGL(CDriverGL_unInit) + + if (!_CurrentMode.Windowed) + { + restoreScreenMode(); + showCursor(true); + + _CurrentMode.Windowed = true; + } + +#ifdef NL_OS_WINDOWS + +#ifndef USE_OPENGLES + // Off-screen rendering ? + if (_PBuffer) + { + nwglReleasePbufferDCARB(_PBuffer, _hDC); + nwglDestroyPbufferARB(_PBuffer); + _PBuffer = NULL; + } +#endif + + if (_Registered && !UnregisterClassW(L"NLClass", GetModuleHandle(NULL))) + { + nlwarning("Can't unregister NLClass"); + } + + // Restaure monitor color parameters + if (_NeedToRestaureGammaRamp) + { + HDC dc = CreateDC ("DISPLAY", NULL, NULL, NULL); + if (dc) + { + if (!SetDeviceGammaRamp (dc, _GammaRampBackuped)) + nlwarning ("(CDriverGL::release): SetDeviceGammaRamp failed"); + + // Release the DC + ReleaseDC (NULL, dc); + } + else + { + nlwarning ("(CDriverGL::release): can't create DC"); + } + } + +#elif defined(NL_OS_MAC) + + // nothing to do + +#elif defined (NL_OS_UNIX) + + // restore default X errors handler + XSetErrorHandler(NULL); + + XCloseDisplay(_dpy); + _dpy = NULL; + +#endif // NL_OS_UNIX + + return true; +} + +void CDriverGL::setWindowIcon(const std::vector &bitmaps) +{ + if (_win == EmptyWindow) + return; + +#if defined(NL_OS_WINDOWS) + + static HICON winIconBig = NULL; + static HICON winIconSmall = NULL; + + if (winIconBig) + { + DestroyIcon(winIconBig); + winIconBig = NULL; + } + + if (winIconSmall) + { + DestroyIcon(winIconSmall); + winIconSmall = NULL; + } + + sint smallIndex = -1; + uint smallWidth = GetSystemMetrics(SM_CXSMICON); + uint smallHeight = GetSystemMetrics(SM_CYSMICON); + + sint bigIndex = -1; + uint bigWidth = GetSystemMetrics(SM_CXICON); + uint bigHeight = GetSystemMetrics(SM_CYICON); + + // find icons with the exact size + for(uint i = 0; i < bitmaps.size(); ++i) + { + if (smallIndex == -1 && bitmaps[i].getWidth() == smallWidth && bitmaps[i].getHeight() == smallHeight) + smallIndex = i; + + if (bigIndex == -1 && bitmaps[i].getWidth() == bigWidth && bitmaps[i].getHeight() == bigHeight) + bigIndex = i; + } + + // find icons with taller size (we will resize them) + for(uint i = 0; i < bitmaps.size(); ++i) + { + if (smallIndex == -1 && bitmaps[i].getWidth() >= smallWidth && bitmaps[i].getHeight() >= smallHeight) + smallIndex = i; + + if (bigIndex == -1 && bitmaps[i].getWidth() >= bigWidth && bitmaps[i].getHeight() >= bigHeight) + bigIndex = i; + } + + if (smallIndex > -1) + convertBitmapToIcon(bitmaps[smallIndex], winIconSmall, smallWidth, smallHeight, 32); + + if (bigIndex > -1) + convertBitmapToIcon(bitmaps[bigIndex], winIconBig, bigWidth, bigHeight, 32); + + if (winIconBig) + { + SendMessage(_win, WM_SETICON, 0 /* ICON_SMALL */, (LPARAM)winIconSmall); + SendMessage(_win, WM_SETICON, 1 /* ICON_BIG */, (LPARAM)winIconBig); + } + else + { + SendMessage(_win, WM_SETICON, 0 /* ICON_SMALL */, (LPARAM)winIconSmall); + SendMessage(_win, WM_SETICON, 1 /* ICON_BIG */, (LPARAM)winIconSmall); + } + +#elif defined(NL_OS_MAC) + + // nothing to do, on Mac OS X, only windows representing a file have icons + +#elif defined(NL_OS_UNIX) + + std::vector icon_data; + + if (!bitmaps.empty()) + { + // process each bitmap + for(uint i = 0; i < bitmaps.size(); ++i) + { + convertBitmapToIcon(bitmaps[i], icon_data); + } + } + + if (!icon_data.empty()) + { + // change window icon + XChangeProperty(_dpy, _win, XA_WM_ICON, XA_CARDINAL, 32, PropModeReplace, (const unsigned char *) &icon_data[0], icon_data.size()); + } + else + { + // delete window icon if no bitmap is available + XDeleteProperty(_dpy, _win, XA_WM_ICON); + } + +#endif // NL_OS_WINDOWS +} + +// -------------------------------------------------- +bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool resizeable) throw(EBadDisplay) +{ + H_AUTO_OGL(CDriverGL_setDisplay) + + _win = EmptyWindow; + + _CurrentMode = mode; + + _WindowVisible = false; + _Resizable = resizeable; + _DestroyWindow = false; + +#ifdef NL_OS_WINDOWS + + // Init pointers +#ifndef USE_OPENGLES + _PBuffer = NULL; + _hRC = NULL; + _hDC = NULL; +#endif + + // Driver caps. + //============= + // Retrieve the WGL extensions before init the driver. + + // Offscreen mode ? + if (_CurrentMode.OffScreen) + { +#if 0 + if (!createWindow(mode)) + return false; + + // resize the window + RECT rc; + SetRect (&rc, 0, 0, width, height); + AdjustWindowRectEx (&rc, GetWindowStyle (_win), GetMenu (_win) != NULL, GetWindowExStyle (_win)); + SetWindowPos (_win, NULL, 0, 0, rc.right - rc.left, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE ); + + // Get the + HDC tempHDC = GetDC(tmpHWND); + + _CurrentMode.Depth = uint8(GetDeviceCaps(tempHDC,BITSPIXEL)); + + // --- + memset(&_pfd,0,sizeof(_pfd)); + _pfd.nSize = sizeof(_pfd); + _pfd.nVersion = 1; + _pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; + _pfd.iPixelType = PFD_TYPE_RGBA; + _pfd.cColorBits = _CurrentMode.Depth; + + // Choose best suited Depth Buffer. + if(_CurrentMode.Depth<=16) + { + _pfd.cDepthBits = 16; + } + else + { + _pfd.cDepthBits = 24; + _pfd.cAlphaBits = 8; + } + _pfd.iLayerType = PFD_MAIN_PLANE; + int pf=ChoosePixelFormat(tempHDC,&_pfd); + if (!pf) + { + nlwarning ("CDriverGL::setDisplay: ChoosePixelFormat failed"); + DestroyWindow (tmpHWND); + return false; + } + if ( !SetPixelFormat(tempHDC,pf,&_pfd) ) + { + nlwarning ("CDriverGL::setDisplay: SetPixelFormat failed"); + DestroyWindow (tmpHWND); + return false; + } + + // Create gl context + HGLRC tempGLRC = wglCreateContext(tempHDC); + if (tempGLRC == NULL) + { + DWORD error = GetLastError (); + nlwarning ("CDriverGL::setDisplay: wglCreateContext failed: 0x%x", error); + DestroyWindow (tmpHWND); + _PBuffer = NULL; + _win = EmptyWindow; + _hRC = NULL; + _hDC = NULL; + return false; + } + + // Make the context current + if (!wglMakeCurrent(tempHDC,tempGLRC)) + { + DWORD error = GetLastError (); + nlwarning ("CDriverGL::setDisplay: wglMakeCurrent failed: 0x%x", error); + wglDeleteContext (tempGLRC); + DestroyWindow (tmpHWND); + _PBuffer = NULL; + _win = EmptyWindow; + _hRC = NULL; + _hDC = NULL; + return false; + } + + // Register WGL functions +#ifdef USE_OPENGLES + registerEGlExtensions (_Extensions, tempHDC); +#else + registerWGlExtensions (_Extensions, tempHDC); +#endif + + HDC hdc = wglGetCurrentDC (); + + if (hdc == NULL) + { + DWORD error = GetLastError (); + nlwarning ("CDriverGL::setDisplay: wglGetCurrentDC failed: 0x%x", error); + DestroyWindow (tmpHWND); + _PBuffer = NULL; + _win = EmptyWindow; + _hRC = NULL; + _hDC = NULL; + return false; + } + + // Get ready to query for a suitable pixel format that meets our + // minimum requirements. + int iattributes[2*20]; + float fattributes[2*20]; + int niattribs = 0; + + // Attribute arrays must be "0" terminated - for simplicity, first + // just zero-out the array then fill from left to right. + for ( int a = 0; a < 2*20; a++ ) + { + iattributes[a] = 0; + fattributes[a] = 0; + } + + // Since we are trying to create a pbuffer, the pixel format we + // request (and subsequently use) must be "buffer capable". + iattributes[2*niattribs ] = WGL_DRAW_TO_PBUFFER_ARB; + iattributes[2*niattribs+1] = true; + niattribs++; + + // We require a minimum of 24-bit depth. + iattributes[2*niattribs ] = WGL_DEPTH_BITS_ARB; + iattributes[2*niattribs+1] = 24; + niattribs++; + + // We require a minimum of 8-bits for each R, G, B, and A. + iattributes[2*niattribs ] = WGL_RED_BITS_ARB; + iattributes[2*niattribs+1] = 8; + niattribs++; + iattributes[2*niattribs ] = WGL_GREEN_BITS_ARB; + iattributes[2*niattribs+1] = 8; + niattribs++; + iattributes[2*niattribs ] = WGL_BLUE_BITS_ARB; + iattributes[2*niattribs+1] = 8; + niattribs++; + iattributes[2*niattribs ] = WGL_ALPHA_BITS_ARB; + iattributes[2*niattribs+1] = 8; + niattribs++; + + // Now obtain a list of pixel formats that meet these minimum + // requirements. + int pformat[20]; + unsigned int nformats; + if ( !nwglChoosePixelFormatARB ( hdc, iattributes, fattributes, + 20, pformat, &nformats ) ) + { + nlwarning ( "pbuffer creation error: Couldn't find a suitable pixel format." ); + wglDeleteContext (tempGLRC); + DestroyWindow (tmpHWND); + return false; + } + + /* After determining a compatible pixel format, the next step is to create a pbuffer of the + chosen format. Fortunately this step is fairly easy, as you merely select one of the formats + returned in the list in step #2 and call the function: */ + int iattributes2[1] = {0}; + // int iattributes2[] = {WGL_PBUFFER_LARGEST_ARB, 1, 0}; + _PBuffer = nwglCreatePbufferARB( hdc, pformat[0], width, height, iattributes2 ); + if (_PBuffer == NULL) + { + DWORD error = GetLastError (); + nlwarning ("CDriverGL::setDisplay: wglCreatePbufferARB failed: 0x%x", error); + wglDeleteContext (tempGLRC); + + DestroyWindow (tmpHWND); + _PBuffer = NULL; + _win = EmptyWindow; + _hRC = NULL; + _hDC = NULL; + return false; + } + + /* After creating a pbuffer, you may use this functions to determine the dimensions of the pbuffer actually created. */ + if ( !nwglQueryPbufferARB( _PBuffer, WGL_PBUFFER_WIDTH_ARB, (int*)&width ) ) + { + DWORD error = GetLastError (); + nlwarning ("CDriverGL::setDisplay: wglQueryPbufferARB failed: 0x%x", error); + wglDeleteContext (tempGLRC); + DestroyWindow (tmpHWND); + _PBuffer = NULL; + _win = EmptyWindow; + _hRC = NULL; + _hDC = NULL; + return false; + } + + if ( !nwglQueryPbufferARB( _PBuffer, WGL_PBUFFER_HEIGHT_ARB, (int*)&height ) ) + { + DWORD error = GetLastError (); + nlwarning ("CDriverGL::setDisplay: wglQueryPbufferARB failed: 0x%x", error); + wglDeleteContext (tempGLRC); + DestroyWindow (tmpHWND); + _PBuffer = NULL; + _win = EmptyWindow; + _hRC = NULL; + _hDC = NULL; + return false; + } + + _CurrentMode.Width = width; + _CurrentMode.Height = height; + + /* The next step is to create a device context for the newly created pbuffer. To do this, + call to the function: */ + _hDC = nwglGetPbufferDCARB( _PBuffer ); + if (_hDC == NULL) + { + DWORD error = GetLastError (); + nlwarning ("CDriverGL::setDisplay: wglGetPbufferDCARB failed: 0x%x", error); + nwglDestroyPbufferARB( _PBuffer ); + + wglDeleteContext (tempGLRC); + + DestroyWindow (tmpHWND); + _PBuffer = NULL; + _win = EmptyWindow; + _hRC = NULL; + _hDC = NULL; + return false; + } + + /* The final step of pbuffer creation is to create an OpenGL rendering context and + associate it with the handle for the pbuffer's device context created in step #4. This is done as follows */ + _hRC = wglCreateContext( _hDC ); + if (_hRC == NULL) + { + DWORD error = GetLastError (); + nlwarning ("CDriverGL::setDisplay: wglCreateContext failed: 0x%x", error); + nwglReleasePbufferDCARB( _PBuffer, _hDC ); + nwglDestroyPbufferARB( _PBuffer ); + wglDeleteContext (tempGLRC); + DestroyWindow (tmpHWND); + _PBuffer = NULL; + _win = EmptyWindow; + _hRC = NULL; + _hDC = NULL; + return false; + } + + // Get the depth + _CurrentMode.Depth = uint8(GetDeviceCaps (_hDC, BITSPIXEL)); + + // Destroy the temp gl context +#ifdef USE_OPENGLES + if (!eglDestroyContext(_EglDisplay, _EglContext);) + { + DWORD error = GetLastError (); + nlwarning ("CDriverGL::setDisplay: wglDeleteContext failed: 0x%x", error); + } +#else + if (!wglDeleteContext (tempGLRC)) + { + DWORD error = GetLastError (); + nlwarning ("CDriverGL::setDisplay: wglDeleteContext failed: 0x%x", error); + } +#endif + + // Destroy the temp windows + if (!DestroyWindow (tmpHWND)) + nlwarning ("CDriverGL::setDisplay: DestroyWindow failed"); + + /* After a pbuffer has been successfully created you can use it for off-screen rendering. To do + so, you'll first need to bind the pbuffer, or more precisely, make its GL rendering context + the current context that will interpret all OpenGL commands and state changes. */ + if (!wglMakeCurrent(_hDC,_hRC)) + { + DWORD error = GetLastError (); + nlwarning ("CDriverGL::setDisplay: wglMakeCurrent failed: 0x%x", error); + +#ifdef USE_OPENGLES + eglDestroyContext(_EglDisplay, _EglContext); +#else + wglDeleteContext (_hRC); + nwglReleasePbufferDCARB( _PBuffer, _hDC ); + nwglDestroyPbufferARB( _PBuffer ); +#endif + + DestroyWindow (tmpHWND); + _PBuffer = NULL; + _win = EmptyWindow; + _hRC = NULL; + _hDC = NULL; + return false; + } +#endif + } + else + { + if (wnd == EmptyWindow) + { + if (!createWindow(mode)) + return false; + } + else + { + _win = wnd; + } + + // associate OpenGL driver to window + SetWindowLongPtr(_win, GWLP_USERDATA, (LONG_PTR)this); + + createContext(); + } + + /// release old emitter + while (_EventEmitter.getNumEmitters() != 0) + { + _EventEmitter.removeEmitter(_EventEmitter.getEmitter(_EventEmitter.getNumEmitters() - 1)); + } + + NLMISC::CWinEventEmitter *we = new NLMISC::CWinEventEmitter; + + // setup the event emitter, and try to retrieve a direct input interface + _EventEmitter.addEmitter(we, true /*must delete*/); // the main emitter + + /// try to get direct input + try + { + NLMISC::CDIEventEmitter *diee = NLMISC::CDIEventEmitter::create(GetModuleHandle(NULL), _win, we); + if (diee) + { + _EventEmitter.addEmitter(diee, true); + } + } + catch(const EDirectInput &e) + { + nlinfo(e.what()); + } + +#elif defined(NL_OS_MAC) + + if (wnd == EmptyWindow) + { + if (!createWindow(mode)) + return false; + } + else + { + _win = wnd; + + /* The NSView* extracted from a QWidget using winId() has bounds set to + * (QWidget::x(), QWidget::y(), QWidget::width(), QWidget::height()). + * This causes cocoa to draw at an offset of x(), y() leaving an unhandled + * border in the NSView. The code below fixes this by translating the + * coordinate system of the NSView back to 0,0. + * In my opinion this is an error in Qt since QWidget::x/y() are relative to + * parent and [NSView bounds.origin] is relative to it's own coordinate + * system. This are incompatible notations. Qt should handle the conversion. + * Fixes: #1013 Viewport size when embedding NeL Cocoa view in Qt + * (http://dev.ryzom.com/issues/1013) + */ + NSView* view = (NSView*)wnd; + if(view.frame.origin.x != 0 || view.frame.origin.y != 0) { + [view setBoundsOrigin:view.frame.origin]; + } + } + + // setup opengl settings + NSOpenGLPixelFormatAttribute att[] = + { + NSOpenGLPFADoubleBuffer, + NSOpenGLPFAColorSize, 24, + NSOpenGLPFADepthSize, 24, + NSOpenGLPFAAlphaSize, 8, + NSOpenGLPFAStencilSize, 8, + NSOpenGLPFANoRecovery, + NSOpenGLPFAAccelerated, + NSOpenGLPFABackingStore, + 0 + }; + + // put the settings into a format object + NSOpenGLPixelFormat* format = + [[NSOpenGLPixelFormat alloc] initWithAttributes:att]; + + if(!format) + nlerror("cannot create NSOpenGLPixelFormat"); + + // intially set height/width, further updates through CocoaOpenGLView + _CurrentMode.Height = mode.Height; + _CurrentMode.Width = mode.Width; + + // create a opengl view with the created format + _glView = [[CocoaOpenGLView alloc] + initWithFrame:NSMakeRect(0, 0, mode.Width, mode.Height) + pixelFormat:format]; + + if(!_glView) + nlerror("cannot create view"); + + // tell the view about the driver so the view is able to update "window" size + [_glView setDriver:this]; + + // make the view automatically fit the super view + [_glView setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable]; + + // put the open gl view into the dummy view contained in the window + [containerView() addSubview:_glView]; + + // adjust size + [_glView setFrame: [containerView() frame]]; + + // create a opengl context for the view + _ctx = [_glView openGLContext]; + + if(!_ctx) + nlerror("cannot create context"); + + // free the pixel format object + [format release]; + + // let the open gl view handle the input + [[containerView() window] makeFirstResponder:_glView]; + + // prevents scrambled content in the view before first swap + [_ctx flushBuffer]; + [_glView display]; + + _EventEmitter.init(this, _glView, _DestroyWindow); + +#elif defined(NL_OS_UNIX) + + static int sAttribList16bpp[] = + { + GLX_RGBA, + GLX_DOUBLEBUFFER, + GLX_DEPTH_SIZE, 16, + GLX_RED_SIZE, 4, + GLX_GREEN_SIZE, 4, + GLX_BLUE_SIZE, 4, + GLX_ALPHA_SIZE, 4, + GLX_STENCIL_SIZE, 8, + None + }; + + static int sAttribList24bpp[] = + { + GLX_RGBA, + GLX_DOUBLEBUFFER, + GLX_DEPTH_SIZE, 24, + GLX_RED_SIZE, 8, + GLX_GREEN_SIZE, 8, + GLX_BLUE_SIZE, 8, + GLX_ALPHA_SIZE, 8, + GLX_STENCIL_SIZE, 8, + None + }; + + // first try 24bpp and if that fails 16bpp + XVisualInfo *visual_info = glXChooseVisual (_dpy, DefaultScreen(_dpy), sAttribList24bpp); + if (visual_info == NULL) + visual_info = glXChooseVisual(_dpy, DefaultScreen(_dpy), sAttribList16bpp); + if(visual_info == NULL) + { + nlerror("glXChooseVisual() failed"); + } + + _visual_info = visual_info; + + _ctx = glXCreateContext (_dpy, visual_info, None, GL_TRUE); + if (_ctx == NULL) + { + nlerror("glXCreateContext() failed"); + } + + if (wnd == EmptyWindow) + { + if (!createWindow(mode)) + return false; + } + else + { + _win = wnd; + + XSetWindowAttributes attr; + attr.background_pixel = BlackPixel(_dpy, DefaultScreen(_dpy)); + attr.override_redirect = False; + + int attr_flags = CWOverrideRedirect | CWBackPixel; + + XChangeWindowAttributes(_dpy, _win, attr_flags, &attr); + } + + glXMakeCurrent (_dpy, _win, _ctx); +// XMapRaised (_dpy, _win); + +// XMapWindow(_dpy, _win); + + _EventEmitter.init (_dpy, _win, this); + +// XEvent event; +// XIfEvent(dpy, &event, WaitForNotify, (char *)this); + +#endif // NL_OS_UNIX + + // setup OpenGL structures + if (!setupDisplay()) + return false; + + // setup window size and screen mode + if (!setMode(mode)) + return false; + + if (show || !_CurrentMode.Windowed) + showWindow(true); + + return true; +} + +// -------------------------------------------------- +bool CDriverGL::saveScreenMode() +{ + H_AUTO_OGL(CDriverGL_saveScreenMode) + + bool res = true; + +#if defined(NL_OS_WINDOWS) + + // don't need to save it because Windows will use default desktop resolution + +#elif defined(NL_OS_MAC) + + // no need to store because the screen mode is never really changed + +#elif defined(NL_OS_UNIX) + + int screen = DefaultScreen(_dpy); + res = false; + +#ifdef HAVE_XRANDR + + if (!res && _xrandr_version > 0) + { + XRRScreenConfiguration *screen_config = XRRGetScreenInfo(_dpy, RootWindow(_dpy, screen)); + + if (screen_config) + { + Rotation saved_rotation; + _OldSizeID = XRRConfigCurrentConfiguration(screen_config, &saved_rotation); + nlinfo("3D: current XRandR mode %d", _OldSizeID); + XRRFreeScreenConfigInfo(screen_config); + + res = true; + } + else + { + nlwarning("3D: XRRGetScreenInfo failed"); + } + } + +#endif // HAVE_XRANDR + +#if defined(XF86VIDMODE) + + if (!res && _xvidmode_version > 0) + { + // Store old mode in order to restore it when leaving fullscreen + memset(&_OldScreenMode, 0, sizeof(XF86VidModeModeLine)); + XF86VidModeGetModeLine(_dpy, screen, &_OldDotClock, &_OldScreenMode); + res = XF86VidModeGetViewPort(_dpy, screen, &_OldX, &_OldY); + } + +#endif // XF86VIDMODE + +#endif // NL_OS_WINDOWS + + return res; +} + +// -------------------------------------------------- +bool CDriverGL::restoreScreenMode() +{ + H_AUTO_OGL(CDriverGL_restoreScreenMode) + + bool res = false; + +#if defined(NL_OS_WINDOWS) + + res = (ChangeDisplaySettings(NULL, 0) == DISP_CHANGE_SUCCESSFUL); + +#elif defined(NL_OS_MAC) + + // no need to restore because the screen mode was never really changed + res = true; + +#elif defined(NL_OS_UNIX) + + int screen = DefaultScreen(_dpy); + +#ifdef HAVE_XRANDR + + if (!res && _xrandr_version > 0) + { + Window root = RootWindow(_dpy, screen); + + XRRScreenConfiguration *screen_config = XRRGetScreenInfo(_dpy, root); + + if (screen_config) + { + Rotation saved_rotation; + SizeID size = XRRConfigCurrentConfiguration(screen_config, &saved_rotation); + if (XRRSetScreenConfig(_dpy, screen_config, root, _OldSizeID, saved_rotation, CurrentTime) == RRSetConfigSuccess) + { + nlinfo("3D: Switching back to XRandR mode %d", _OldSizeID); + res = true; + } + + XRRFreeScreenConfigInfo(screen_config); + } + else + { + nlwarning("3D: XRRGetScreenInfo failed"); + } + } + +#endif // HAVE_XRANDR + +#if defined(XF86VIDMODE) + + if (!res && _xvidmode_version > 0) + { + XF86VidModeModeInfo info; + nlinfo("3D: Switching back to original mode"); + + // This is UGLY + info.dotclock = _OldDotClock; + info.hdisplay = _OldScreenMode.hdisplay; + info.hsyncstart = _OldScreenMode.hsyncstart; + info.hsyncend = _OldScreenMode.hsyncend; + info.htotal = _OldScreenMode.htotal; + info.vdisplay = _OldScreenMode.vdisplay; + info.vsyncstart = _OldScreenMode.vsyncstart; + info.vsyncend = _OldScreenMode.vsyncend; + info.vtotal = _OldScreenMode.vtotal; + info.flags = _OldScreenMode.flags; + info.privsize = _OldScreenMode.privsize; + info.c_private = _OldScreenMode.c_private; + + nlinfo("3D: Switching back mode to %dx%d", info.hdisplay, info.vdisplay); + XF86VidModeSwitchToMode(_dpy, screen, &info); + nlinfo("3D: Switching back viewport to %d,%d",_OldX, _OldY); + res = XF86VidModeSetViewPort(_dpy, screen, _OldX, _OldY); + } + +#endif // XF86VIDMODE + +#endif // NL_OS_WINDOWS + + return res; +} + +// *************************************************************************** + +#ifdef XF86VIDMODE +static sint modeInfoToFrequency(XF86VidModeModeInfo *info) +{ + return (info->htotal && info->vtotal) ? (1000 * info->dotclock / (info->htotal * info->vtotal)) : 0; +} +#endif // XF86VIDMODE + +// *************************************************************************** + +bool CDriverGL::setScreenMode(const GfxMode &mode) +{ + H_AUTO_OGL(CDriverGL_setScreenMode) + + if (mode.Windowed) + { + // if fullscreen, switch back to desktop screen mode + if (!_CurrentMode.Windowed) + restoreScreenMode(); + + return true; + } + + // save previous screen mode only if switching from windowed to fullscreen + if (_CurrentMode.Windowed) + saveScreenMode(); + + // if switching exactly to the same screen mode, doesn't change it + GfxMode previousMode; + if (getCurrentScreenMode(previousMode) + && mode.Width == previousMode.Width + && mode.Height == previousMode.Height + && mode.Depth == previousMode.Depth + && mode.Frequency == previousMode.Frequency) + return true; + +#if defined(NL_OS_WINDOWS) + + DEVMODE devMode; + memset(&devMode, 0, sizeof(DEVMODE)); + devMode.dmSize = sizeof(DEVMODE); + devMode.dmDriverExtra = 0; + devMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT; + devMode.dmPelsWidth = mode.Width; + devMode.dmPelsHeight = mode.Height; + + if(mode.Depth > 0) + { + devMode.dmBitsPerPel = mode.Depth; + devMode.dmFields |= DM_BITSPERPEL; + } + + if(mode.Frequency > 0) + { + devMode.dmDisplayFrequency = mode.Frequency; + devMode.dmFields |= DM_DISPLAYFREQUENCY; + } + + if (ChangeDisplaySettings(&devMode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) + { + nlwarning("3D: Fullscreen mode switch failed"); + return false; + } + +#elif defined(NL_OS_MAC) + + // no need to do anything here, on mac os, the screen mode is never changed + +#elif defined(NL_OS_UNIX) + + bool found = false; + +#ifdef HAVE_XRANDR + + if (!found && _xrandr_version > 0) + { + int screen = DefaultScreen(_dpy); + Window root = RootWindow(_dpy, screen); + + XRRScreenConfiguration *screen_config = XRRGetScreenInfo(_dpy, root); + + if (screen_config) + { + Rotation saved_rotation; + SizeID cur_size = XRRConfigCurrentConfiguration(screen_config, &saved_rotation); + + sint nsizes; + XRRScreenSize *sizes = XRRConfigSizes(screen_config, &nsizes); + sint size = -1; + + for (sint i = 0; i < nsizes; ++i) + { + if (sizes[i].width == mode.Width && sizes[i].height == mode.Height) + { + size = i; + break; + } + } + + if (size > -1) + { + if (XRRSetScreenConfig(_dpy, screen_config, root, size, saved_rotation, CurrentTime) == RRSetConfigSuccess) + { + nlinfo("3D: Switching to XRandR mode %d: %dx%d", size, sizes[size].width, sizes[size].height); + found = true; + } + else + { + nlwarning("3D: XRRSetScreenConfig failed for mode %d: %dx%d", size, sizes[size].width, sizes[size].height); + } + } + else + { + nlwarning("3D: No corresponding screen mode"); + } + + XRRFreeScreenConfigInfo(screen_config); + } + else + { + nlwarning("3D: XRRGetScreenInfo failed"); + } + } + +#endif // HAVE_XRANDR + +#if defined(XF86VIDMODE) + + if (!found && _xvidmode_version > 0) + { + // Find the requested mode and use it + XF86VidModeModeInfo **modes; + int nmodes; + if (XF86VidModeGetAllModeLines(_dpy, DefaultScreen(_dpy), &nmodes, &modes)) + { + for (int i = 0; i < nmodes; i++) + { + const uint16 freq = modeInfoToFrequency(modes[i]); + + nldebug("3D: Available mode - %dx%d %d Hz", modes[i]->hdisplay, modes[i]->vdisplay, (int)freq); + if (modes[i]->hdisplay == mode.Width && modes[i]->vdisplay == mode.Height /* && freq == mode.Frequency */) + { + if (XF86VidModeSwitchToMode(_dpy, DefaultScreen(_dpy), modes[i])) + { + nlinfo("3D: XF86VidMode Switching to mode %dx%d", modes[i]->hdisplay, modes[i]->vdisplay); + XF86VidModeSetViewPort(_dpy, DefaultScreen(_dpy), 0, 0); + found = true; + } + break; + } + } + XFree(modes); + } + } + +#endif // XF86VIDMODE + + if (!found) + return false; + +#endif // NL_OS_WINDOWS + + return true; +} + +// *************************************************************************** +bool CDriverGL::createWindow(const GfxMode &mode) +{ + H_AUTO_OGL(CDriverGL_createWindow) + + nlWindow window = EmptyWindow; + +#ifdef NL_OS_WINDOWS + + // create the OpenGL window + window = CreateWindowW(L"NLClass", L"NeL Window", WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, + CW_USEDEFAULT, CW_USEDEFAULT, mode.Width, mode.Height, HWND_DESKTOP, NULL, GetModuleHandle(NULL), NULL); + + if (window == EmptyWindow) + { + DWORD res = GetLastError(); + nlwarning("CreateWindow failed: %u", res); + return false; + } + +#elif defined(NL_OS_MAC) + + // describe how the window should look like and behave + unsigned int styleMask = NSTitledWindowMask | NSClosableWindowMask | + NSMiniaturizableWindowMask | NSResizableWindowMask; + + // create a cocoa window with the size provided by the mode parameter + NSWindow* cocoa_window = [[NSWindow alloc] + initWithContentRect:NSMakeRect(0, 0, mode.Width, mode.Height) + styleMask:styleMask backing:NSBackingStoreBuffered defer:NO]; + + if(!cocoa_window) + { + nlerror("cannot create cocoa window"); + return false; + } + + // create an application delegate + CocoaApplicationDelegate* appDelegate = + [[CocoaApplicationDelegate alloc] initWithDriver:this]; + + // set the application delegate, this will handle window/app close events + [NSApp setDelegate:appDelegate]; + + // bind the close button of the window to applicationShouldTerminate + id closeButton = [cocoa_window standardWindowButton:NSWindowCloseButton]; + [closeButton setAction:@selector(applicationShouldTerminate:)]; + [closeButton setTarget:appDelegate]; + + // set the delegate which will handle window move events + [cocoa_window setDelegate:[[CocoaWindowDelegate alloc] initWithDriver:this]]; + + // set the window to non transparent + [cocoa_window setOpaque:YES]; + + // enable mouse move events, NeL wants them + [cocoa_window setAcceptsMouseMovedEvents:YES]; + + // there are no overlapping subviews, can use the magical optimization :) + [cocoa_window useOptimizedDrawing:YES]; + + // put the window to the front and make it the key window + [cocoa_window makeKeyAndOrderFront:nil]; + + // this is our main window + [cocoa_window makeMainWindow]; + + // create a dummy view which works like the window on other platforms + // the open gl view will be created as subview of this one. + window = [[NSView alloc] + initWithFrame:NSMakeRect(0, 0, mode.Width, mode.Height)]; + + [cocoa_window setContentView: (NSView*)window]; + + if(window == EmptyWindow) + { + nldebug("cannot create cocoa view for cocoa window"); + return false; + } + +#elif defined (NL_OS_UNIX) + + if (_visual_info == NULL) + return false; + + nlWindow root = RootWindow(_dpy, DefaultScreen(_dpy)); + + XSetWindowAttributes attr; + attr.background_pixel = BlackPixel(_dpy, DefaultScreen(_dpy)); + attr.colormap = XCreateColormap(_dpy, root, _visual_info->visual, AllocNone); + int attr_flags = CWBackPixel | CWColormap; + + window = XCreateWindow (_dpy, root, 0, 0, mode.Width, mode.Height, 0, _visual_info->depth, InputOutput, _visual_info->visual, attr_flags, &attr); + + if (window == EmptyWindow) + { + nlerror("3D: XCreateWindow() failed"); + return false; + } + + // normal window type + XChangeProperty(_dpy, window, XA_WM_WINDOW_TYPE, XA_ATOM, 32, PropModeReplace, (const unsigned char*)&XA_WM_WINDOW_TYPE_NORMAL, 1); + + // set WM hints + XWMHints *wm_hints = XAllocWMHints(); + + if (wm_hints) + { + wm_hints->flags = StateHint | InputHint; + wm_hints->initial_state = NormalState; + wm_hints->input = True; + + XSetWMHints(_dpy, window, wm_hints); + XFree(wm_hints); + } + else + { + nlwarning("3D: Couldn't allocate XWMHints"); + } + + // set class hints + XClassHint *class_hints = XAllocClassHint(); + + if (class_hints) + { + class_hints->res_name = (char*)"NeL"; + class_hints->res_class = (char*)"nel"; + + XSetClassHint(_dpy, window, class_hints); + XFree(class_hints); + } + else + { + nlwarning("3D: Couldn't allocate XClassHint"); + } + +#endif // NL_OS_UNIX + + _win = window; + + _CurrentMode.Width = mode.Width; + _CurrentMode.Height = mode.Height; + + // Must destroy this window + _DestroyWindow = true; + + setWindowTitle(ucstring("NeL window")); + + createCursors(); + + return true; +} + +// *************************************************************************** + +bool CDriverGL::destroyWindow() +{ + H_AUTO_OGL(CDriverGL_destroyWindow) + + releaseCursors(); + + // make sure window icons are deleted + std::vector bitmaps; + setWindowIcon(bitmaps); + +#ifdef USE_OPENGLES + + if (_EglDisplay && _EglContext) + { + eglMakeCurrent(_EglDisplay, _EglSurface, _EglSurface, _EglContext); + + if (_DestroyWindow) + { + eglDestroyContext(_EglDisplay, _EglContext); + } + } + +#elif defined(NL_OS_WINDOWS) + + // Then delete. + // wglMakeCurrent(NULL,NULL); + + if (_hDC) + wglMakeCurrent(_hDC, NULL); + + if (_DestroyWindow && _hRC) + { + wglDeleteContext(_hRC); + _hRC = NULL; + } + + if (_win && _hDC) + { + ReleaseDC(_win, _hDC); + _hDC = NULL; + } + +#elif defined(NL_OS_MAC) +#elif defined(NL_OS_UNIX) + + if (_DestroyWindow && _ctx) + glXDestroyContext(_dpy, _ctx); + + _ctx = NULL; + +#endif + +#ifdef NL_OS_WINDOWS + + // don't destroy window if it hasn't been created by our driver + if (_win && _DestroyWindow) + DestroyWindow(_win); + +#elif defined(NL_OS_MAC) + + if (_DestroyWindow) + { + [[containerView() window] release]; + [containerView() release]; + [_glView release]; + } + + _ctx = nil; + +#elif defined (NL_OS_UNIX) + + _EventEmitter.closeIM(); + + if (_DestroyWindow && _win) + XDestroyWindow(_dpy, _win); + + // Ungrab the keyboard (probably not necessary); +// XUnmapWindow(_dpy, _win); + XSync(_dpy, True); + XUngrabKeyboard(_dpy, CurrentTime); + +#endif + + _win = EmptyWindow; + + return true; +} + +// *************************************************************************** + +CDriverGL::EWindowStyle CDriverGL::getWindowStyle() const +{ + H_AUTO_OGL(CDriverGL_getWindowStyle) + + if (!_CurrentMode.Windowed) + return EWSFullscreen; + + return EWSWindowed; +} + +// *************************************************************************** + +bool CDriverGL::setWindowStyle(EWindowStyle windowStyle) +{ + H_AUTO_OGL(CDriverGL_setWindowStyle) + + // don't change window style, if we did not create the window + if (_win == EmptyWindow || !_DestroyWindow) + return true; + + if (getWindowStyle() == windowStyle) + return true; + +#if defined(NL_OS_WINDOWS) + + // get current style + LONG dwStyle = GetWindowLong(_win, GWL_STYLE); + + // prepare new style + LONG dwNewStyle = WS_CLIPCHILDREN|WS_CLIPSIBLINGS; + + // get window current state + WINDOWPLACEMENT wndpl; + wndpl.length = sizeof(WINDOWPLACEMENT); + + bool isMaximized = GetWindowPlacement(_win, &wndpl) && (wndpl.showCmd == SW_SHOWMAXIMIZED); + bool isVisible = false; + + if (windowStyle == EWSWindowed && !_CurrentMode.OffScreen) + { + dwNewStyle |= WS_OVERLAPPEDWINDOW; + + // if we can't resize window, remove maximize box and resize anchors + if (!_Resizable) dwNewStyle ^= WS_MAXIMIZEBOX|WS_THICKFRAME; + + isVisible = (dwStyle & WS_VISIBLE) != 0; + } + else if (windowStyle == EWSFullscreen) + { + dwNewStyle |= WS_POPUP; + isVisible = true; + } + + if (isVisible) + dwNewStyle |= WS_VISIBLE; + + if (dwStyle != dwNewStyle) + SetWindowLong(_win, GWL_STYLE, dwNewStyle); + +// if (windowStyle == EWSMaximized && isVisible && !isMaximized) +// ShowWindow(_hWnd, SW_SHOWMAXIMIZED); +// else if (isMaximized && isVisible) +// ShowWindow(_hWnd, SW_RESTORE); + +#elif defined(NL_OS_MAC) + + // leave fullscreen mode, enter windowed mode + if(windowStyle == EWSWindowed && [containerView() isInFullScreenMode]) + { + // disable manual setting of back buffer size, cocoa handles this + // automatically as soon as the view gets resized + CGLError error = CGLDisable((CGLContextObj)[_ctx CGLContextObj], + kCGLCESurfaceBackingSize); + + if(error != kCGLNoError) + nlerror("cannot disable kCGLCESurfaceBackingSize (%s)", + CGLErrorString(error)); + + // pull the view back from fullscreen restoring window options + [containerView() exitFullScreenModeWithOptions:nil]; + + // let the gl view receive key events + [[containerView() window] makeFirstResponder:_glView]; + + // bring the window containing the gl view to the front + [[containerView() window] makeKeyAndOrderFront:nil]; + } + + // enter fullscreen, leave windowed mode + else if(windowStyle == EWSFullscreen && ![containerView() isInFullScreenMode]) + { + // enable manual back buffer size for mode setting in fullscreen + CGLError error = CGLEnable((CGLContextObj)[_ctx CGLContextObj], + kCGLCESurfaceBackingSize); + + if(error != kCGLNoError) + nlerror("cannot enable kCGLCESurfaceBackingSize (%s)", + CGLErrorString(error)); + + // put the view in fullscreen mode, hiding the dock but enabling the menubar + // to pop up if the mouse hits the top screen border. + // NOTE: withOptions:nil disables + application switching! +#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + [containerView() enterFullScreenMode:[NSScreen mainScreen] withOptions: + [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithInt: + NSApplicationPresentationHideDock | + NSApplicationPresentationAutoHideMenuBar], + NSFullScreenModeApplicationPresentationOptions, nil]]; +#endif + /* + TODO check if simply using NSView enterFullScreenMode is a good idea. + the context can be set to full screen as well, performance differences? + */ + + // let the gl view receive key events + [[containerView() window] makeFirstResponder:_glView]; + } + +#elif defined(NL_OS_UNIX) + + XWindowAttributes attr; + XGetWindowAttributes(_dpy, _win, &attr); + + // if window is mapped use events else properties + if (attr.map_state != IsUnmapped) + { + // Toggle fullscreen + XEvent xev; + xev.xclient.type = ClientMessage; + xev.xclient.serial = 0; + xev.xclient.send_event = True; + xev.xclient.display = _dpy; + xev.xclient.window = _win; + xev.xclient.message_type = XA_WM_STATE; + xev.xclient.format = 32; + xev.xclient.data.l[0] = windowStyle == EWSFullscreen ? _NET_WM_STATE_ADD:_NET_WM_STATE_REMOVE; + xev.xclient.data.l[1] = XA_WM_STATE_FULLSCREEN; + xev.xclient.data.l[2] = 0; + xev.xclient.data.l[3] = 1; // 1 for Application, 2 for Page or Taskbar, 0 for old source + xev.xclient.data.l[4] = 0; + if (!XSendEvent(_dpy, XDefaultRootWindow(_dpy), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev)) + { + nlwarning("3D: Failed to toggle to fullscreen"); + return false; + } + } + else + { + if (windowStyle == EWSFullscreen) + { + // set state property to fullscreen + XChangeProperty(_dpy, _win, XA_WM_STATE, XA_ATOM, 32, PropModeReplace, (const unsigned char*)&XA_WM_STATE_FULLSCREEN, 1); + } + else + { + // delete state property + XDeleteProperty(_dpy, _win, XA_WM_STATE); + } + } + +#endif // NL_OS_WINDOWS + + _CurrentMode.Windowed = (windowStyle == EWSWindowed); + + return true; +} + +// -------------------------------------------------- +bool CDriverGL::setMode(const GfxMode& mode) +{ + H_AUTO_OGL(CDriverGL_setMode); + + // don't modify window or screen if managed by a 3rd party library + if (!_DestroyWindow) + return true; + + if (!setScreenMode(mode)) + return false; + + // when changing window style, it's possible system change window size too + setWindowStyle(mode.Windowed ? EWSWindowed : EWSFullscreen); + + if (!mode.Windowed) + _CurrentMode.Depth = mode.Depth; + + setWindowSize(mode.Width, mode.Height); + setWindowPos(_WindowX, _WindowY); + + switch (_CurrentMode.Depth) + { + case 16: _ColorDepth = ColorDepth16; break; + case 24: + case 32: _ColorDepth = ColorDepth32; break; + } + + // set color depth for custom cursor + updateCursor(true); + + return true; +} + +#if defined(NL_OS_MAC) && defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + + +/// helper to extract bits per pixel value from screen mode, only 16 or 32 bits +static int bppFromDisplayMode(CGDisplayModeRef mode) +{ + CFStringRef pixelEncoding = CGDisplayModeCopyPixelEncoding(mode); + + if(CFStringCompare(pixelEncoding, CFSTR(IO32BitDirectPixels), + kCFCompareCaseInsensitive) == kCFCompareEqualTo) + return 32; + + else if(CFStringCompare(pixelEncoding, CFSTR(IO16BitDirectPixels), + kCFCompareCaseInsensitive) == kCFCompareEqualTo) + return 16; + + return 0; +} + +#elif defined(NL_OS_MAC) + +long GetDictionaryLong(CFDictionaryRef theDict, const void* key) +{ + long value = 0; + CFNumberRef numRef; + numRef = (CFNumberRef)CFDictionaryGetValue(theDict, key); + if (numRef != NULL) + CFNumberGetValue(numRef, kCFNumberLongType, &value); + return value; +} + +// some macros to make code more readable. +#define GetModeWidth(mode) GetDictionaryLong((mode), kCGDisplayWidth) +#define GetModeHeight(mode) GetDictionaryLong((mode), kCGDisplayHeight) +#define GetModeBitsPerPixel(mode) GetDictionaryLong((mode), kCGDisplayBitsPerPixel) + +#endif // defined(NL_OS_MAC) + +// -------------------------------------------------- +bool CDriverGL::getModes(std::vector &modes) +{ + H_AUTO_OGL(CDriverGL_getModes) + +#ifdef NL_OS_WINDOWS + sint modeIndex = 0; + DEVMODE devMode; + while (EnumDisplaySettings (NULL, modeIndex, &devMode)) + { + // Keep only 16 and 32 bits + if ((devMode.dmBitsPerPel == 16 ) || (devMode.dmBitsPerPel == 32)) + { + // Add this mode + GfxMode mode; + mode.Width = (uint16)devMode.dmPelsWidth; + mode.Height = (uint16)devMode.dmPelsHeight; + mode.Depth = (uint8)devMode.dmBitsPerPel; + mode.Frequency = devMode.dmDisplayFrequency; + modes.push_back (mode); + } + + // Mode index + modeIndex++; + } + +#elif defined(NL_OS_MAC) + + static const CGDisplayCount kMaxDisplays = 16; + CGDirectDisplayID display[kMaxDisplays]; + CGDisplayCount numDisplays; + + CGDisplayErr err = CGGetActiveDisplayList(kMaxDisplays, display, &numDisplays); + if(err != CGDisplayNoErr) + { + nlwarning("Cannot get displays (%d)", err); + return false; + } + + // nldebug("3D: %d displays found", (int)numDisplays); + + for (CGDisplayCount i = 0; i < numDisplays; ++i) + { + CGDirectDisplayID dspy = display[i]; + +#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + CFArrayRef modeList = CGDisplayCopyAllDisplayModes(dspy, NULL); +#else + CFArrayRef modeList = CGDisplayAvailableModes(dspy); +#endif + + if (modeList == NULL) + { + nlwarning("Display is invalid"); + continue; + } + + for (CFIndex j = 0; j < CFArrayGetCount(modeList); ++j) + { +#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + CGDisplayModeRef mode = (CGDisplayModeRef)CFArrayGetValueAtIndex(modeList, j); + uint8 bpp = bppFromDisplayMode(mode); +#else + CFDictionaryRef mode = (CFDictionaryRef)CFArrayGetValueAtIndex(modeList, j); + uint8 bpp = (uint8)GetModeBitsPerPixel(mode); +#endif + + if (bpp >= 16) + { +#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + uint16 w = CGDisplayModeGetWidth(mode); + uint16 h = CGDisplayModeGetHeight(mode); +#else + uint16 w = (uint16)GetModeWidth(mode); + uint16 h = (uint16)GetModeHeight(mode); +#endif + + // Add this mode + GfxMode mode; + mode.Width = w; + mode.Height = h; + mode.Depth = bpp; + + // Frequency stays at 0 because on mac cocoa, display resolution + // is never really changed. if rendering res < display res, + // cocoa interpolates and keeps the display at it's original res. + mode.Frequency = 0; + modes.push_back (mode); + + // nldebug(" Display 0x%x: Mode %dx%d, %d BPP", dspy, w, h, bpp); + } + } + } + +#elif defined (NL_OS_UNIX) + + bool found = false; + int screen = DefaultScreen(_dpy); + +#if defined(HAVE_XRANDR) + if (!found && _xrandr_version >= 100) + { + XRRScreenConfiguration *screen_config = XRRGetScreenInfo(_dpy, RootWindow(_dpy, screen)); + + if (screen_config) + { + // retrieve the list of resolutions + int nsizes = 0; + XRRScreenSize *sizes = XRRConfigSizes(screen_config, &nsizes); + + if (nsizes > 0) + { +// nldebug("3D: %d available XRandR modes:", nsizes); + for (sint i = 0; i < nsizes; ++i) + { + // Add this mode + GfxMode mode; + mode.Width = sizes[i].width; + mode.Height = sizes[i].height; + mode.Frequency = 0; + modes.push_back(mode); +// nldebug("3D: Mode %d: %dx%d", i, mode.Width, mode.Height); + } + + found = true; + } + else + { + nlwarning("3D: No XRandR modes available"); + } + + XRRFreeScreenConfigInfo(screen_config); + } + else + { + nlwarning("3D: XRRGetScreenInfo failed"); + } + } +#endif + +#ifdef XF86VIDMODE + if (!found && _xvidmode_version > 0) + { + int nmodes; + XF86VidModeModeInfo **ms; + if (XF86VidModeGetAllModeLines(_dpy, screen, &nmodes, &ms)) + { +// nlinfo("3D: %d available XF86VidMode modes:", nmodes); + for (int j = 0; j < nmodes; j++) + { + // Add this mode + GfxMode mode; + mode.Width = (uint16)ms[j]->hdisplay; + mode.Height = (uint16)ms[j]->vdisplay; + mode.Frequency = modeInfoToFrequency(ms[j]); +// nlinfo("3D: Mode %d: %dx%d, %d Hz", j, mode.Width, mode.Height, mode.Frequency); + modes.push_back (mode); + } + XFree(ms); + } + else + { + nlwarning("3D: XF86VidModeGetAllModeLines failed"); + } + } +#endif // XF86VIDMODE + + if (!found) + { + // Add current screen mode + GfxMode mode; + mode.Width = DisplayWidth(_dpy, screen); + mode.Height = DisplayHeight(_dpy, screen); + mode.Frequency = 0; + modes.push_back(mode); + } + +#endif + return true; +} + +// -------------------------------------------------- +bool CDriverGL::getCurrentScreenMode(GfxMode &mode) +{ + H_AUTO_OGL(CDriverGL_getCurrentScreenMode) + +#ifdef NL_OS_WINDOWS + + DEVMODE devmode; + devmode.dmSize = sizeof(DEVMODE); + devmode.dmDriverExtra = 0; + EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devmode); + + mode.Windowed = _CurrentMode.Windowed; + mode.OffScreen = false; + mode.Depth = (uint8)devmode.dmBitsPerPel; + mode.Frequency = devmode.dmDisplayFrequency; + mode.Width = (uint16)devmode.dmPelsWidth; + mode.Height = (uint16)devmode.dmPelsHeight; + mode.AntiAlias = _CurrentMode.AntiAlias; + +#elif defined(NL_OS_MAC) + + // the sceen with the menu bar + NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; + + mode.OffScreen = false; + mode.Frequency = 0; + mode.Depth = NSBitsPerPixelFromDepth([screen depth]); + + // in fullscreen mode + if([containerView() isInFullScreenMode]) + { + // return the size of the back buffer (like having switched monitor mode) + mode.Windowed = false; + mode.Width = _backBufferWidth; + mode.Height = _backBufferHeight; + } + + // in windowed mode + else + { + // return the size of the screen with menu bar + mode.Windowed = true; + mode.Width = (uint16)[screen frame].size.width; + mode.Height = (uint16)[screen frame].size.height; + } + +#elif defined(NL_OS_UNIX) + + bool found = false; + int screen = DefaultScreen(_dpy); + +#ifdef HAVE_XRANDR + + if (!found && _xrandr_version > 0) + { + XRRScreenConfiguration *screen_config = XRRGetScreenInfo(_dpy, RootWindow(_dpy, screen)); + + if (screen_config) + { + int nsizes; + XRRScreenSize *sizes = XRRConfigSizes(screen_config, &nsizes); + if (nsizes > 0) + { + Rotation cur_rotation; + SizeID size = XRRConfigCurrentConfiguration(screen_config, &cur_rotation); + + mode.Windowed = _CurrentMode.Windowed; + mode.OffScreen = false; + mode.Depth = (uint) DefaultDepth(_dpy, screen); + mode.Frequency = 0; + mode.Width = sizes[size].width; + mode.Height = sizes[size].height; + + found = true; + + nlinfo("3D: Current XRandR mode %d: %dx%d, %dbit", size, mode.Width, mode.Height, mode.Depth); + } + else + { + nlwarning("3D: No XRandR modes available"); + } + + XRRFreeScreenConfigInfo(screen_config); + } + else + { + nlwarning("3D: XRRGetScreenInfo failed"); + } + } + +#endif // HAVE_XRANDR + +#ifdef XF86VIDMODE + + if (!found && _xvidmode_version > 0) + { + sint pixelClock; + XF86VidModeModeLine xmode; + + if (XF86VidModeGetModeLine(_dpy, screen, &pixelClock, &xmode)) + { + mode.Windowed = _CurrentMode.Windowed; + mode.OffScreen = false; + mode.Depth = (uint) DefaultDepth(_dpy, screen); + mode.Frequency = 1000 * pixelClock / (xmode.htotal * xmode.vtotal) ; + mode.Width = xmode.hdisplay; + mode.Height = xmode.vdisplay; + nlinfo("3D: Current XF86VidMode mode: %dx%d, %d Hz, %dbit", mode.Width, mode.Height, mode.Frequency, mode.Depth); + + found = true; + } + else + { + nlwarning("3D: XF86VidModeGetModeLine failed, cannot get current video mode"); + } + } + +#endif // XF86VidMode + + if (!found) + { + mode.Windowed = _CurrentMode.Windowed; + mode.OffScreen = _CurrentMode.OffScreen; + mode.Depth = (uint) DefaultDepth(_dpy, screen); + mode.Frequency = 0; + mode.Width = DisplayWidth(_dpy, screen); + mode.Height = DisplayHeight(_dpy, screen); + + found = true; + + nldebug("Current mode: %dx%d, %d Hz, %dbit", mode.Width, mode.Height, mode.Frequency, mode.Depth); + } + +#endif // NL_OS_UNIX + + return true; +} + +// -------------------------------------------------- +void CDriverGL::setWindowTitle(const ucstring &title) +{ + H_AUTO_OGL(CDriverGL_setWindowTitle) + + if (_win == EmptyWindow) + return; + +#ifdef NL_OS_WINDOWS + + SetWindowTextW(_win, (WCHAR*)title.c_str()); + +#elif defined(NL_OS_MAC) + + [[containerView() window] setTitle: + [NSString stringWithUTF8String:title.toUtf8().c_str()]]; + +#elif defined (NL_OS_UNIX) + +#ifdef X_HAVE_UTF8_STRING + // UTF8 properties + Xutf8SetWMProperties (_dpy, _win, (char*)title.toUtf8().c_str(), (char*)title.toUtf8().c_str(), NULL, 0, NULL, NULL, NULL); +#else + // standard properties + XTextProperty text_property; + if (XStringListToTextProperty((char**)&title.toUtf8().c_str(), 1, &text_property) != 0) + { + XSetWMProperties (_dpy, _win, &text_property, &text_property, NULL, 0, NULL, NULL, NULL); + } + else + { + nlwarning("3D: Can't convert title to TextProperty"); + } +#endif + +#endif // NL_OS_WINDOWS +} + +// *************************************************************************** +void CDriverGL::setWindowPos(sint32 x, sint32 y) +{ + H_AUTO_OGL(CDriverGL_setWindowPos) + + _WindowX = x; + _WindowY = y; + + if (_win == EmptyWindow || !_CurrentMode.Windowed) + return; + +#ifdef NL_OS_WINDOWS + + SetWindowPos(_win, NULL, x, y, 0, 0, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE); + +#elif defined(NL_OS_MAC) + // get the rect (position, size) of the screen with menu bar + NSRect screenRect = [[[NSScreen screens] objectAtIndex:0] frame]; + + // get the rect (position, size) of the window + NSRect windowRect = [[containerView() window] frame]; + + // convert y from NeL coordinates to cocoa coordinates + y = screenRect.size.height - y; + + // tell cocoa to move the window + [[containerView() window] setFrameTopLeftPoint:NSMakePoint(x, y)]; + +#elif defined (NL_OS_UNIX) + + if (_CurrentMode.Windowed) + { + // first time requesting decoration sizes + if (_WindowX && _WindowY && !_DecorationWidth && !_DecorationHeight && _WndActive) + { + _DecorationWidth = -1; + _DecorationHeight = -1; + } + + XMoveWindow(_dpy, _win, x, y); + } + +#endif // NL_OS_WINDOWS +} + +// *************************************************************************** +void CDriverGL::showWindow(bool show) +{ + H_AUTO_OGL(CDriverGL_showWindow) + + // don't change window visibility, if we didn't create the window + if (_win == EmptyWindow || !_DestroyWindow) + return; + + _WindowVisible = show; + +#ifdef NL_OS_WINDOWS + + ShowWindow (_win, show ? SW_SHOW:SW_HIDE); + +#elif defined(NL_OS_MAC) + +# warning "OpenGL Driver: Missing Mac Implementation for showWindow" + +#elif defined (NL_OS_UNIX) + + if (show) + { + XMapRaised(_dpy, _win); + + // fix window position if windows manager want to impose them + setWindowPos(_WindowX, _WindowY); + } + else + { + XUnmapWindow(_dpy, _win); + } + +#endif // NL_OS_WINDOWS +} + +// -------------------------------------------------- +emptyProc CDriverGL::getWindowProc() +{ + H_AUTO_OGL(CDriverGL_getWindowProc) + + return (emptyProc)GlWndProc; +} + +// -------------------------------------------------- +bool CDriverGL::createContext() +{ +#ifdef USE_OPENGLES + uint samples = 0; + + if (_CurrentMode.AntiAlias > -1) + { + if (_CurrentMode.AntiAlias == 0) + { + samples = 4; + } + else + { + samples = _CurrentMode.AntiAlias; + } + } + + EGLint attribList[] = + { + EGL_RED_SIZE, 8, + EGL_GREEN_SIZE, 8, + EGL_BLUE_SIZE, 8, + EGL_ALPHA_SIZE, 8, + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 8, +// EGL_SAMPLE_BUFFERS, _CurrentMode.AntiAlias > -1 ? 1:0, +// EGL_SAMPLES, samples, + EGL_RENDERABLE_TYPE, + EGL_OPENGL_ES_BIT, + EGL_NONE + }; + + // Get Display + _EglDisplay = EGL_NO_DISPLAY; // eglGetDisplay(_hDC); + + if (_EglDisplay == EGL_NO_DISPLAY) + { + _EglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); + + if (_EglDisplay == EGL_NO_DISPLAY) + { + nlwarning("3D: failed to get display 0x%x", eglGetError()); + return false; + } + } + + // Initialize EGL + EGLint majorVersion; + EGLint minorVersion; + + if (!eglInitialize(_EglDisplay, &majorVersion, &minorVersion)) + { + return EGL_FALSE; + } + + const char *extensions = eglQueryString(_EglDisplay, EGL_EXTENSIONS); + + + // Get configs + EGLint numConfigs; + + if (!eglGetConfigs(_EglDisplay, NULL, 0, &numConfigs)) + { + return false; + } + + // Choose config + EGLConfig config = NULL; + + if (!eglChooseConfig(_EglDisplay, attribList, &config, 1, &numConfigs)) + { + return false; + } + + // Create a surface + _EglSurface = eglCreateWindowSurface(_EglDisplay, config, (EGLNativeWindowType)_win, NULL); + + if (_EglSurface == EGL_NO_SURFACE) + { + return false; + } + + // Create a GL context + EGLint contextAttribs[] = + { + EGL_CONTEXT_CLIENT_VERSION, 1, + EGL_NONE + }; + + _EglContext = eglCreateContext(_EglDisplay, config, EGL_NO_CONTEXT, contextAttribs); + + if (_EglContext == EGL_NO_CONTEXT) + { + return false; + } + + // Make the context current + if (!eglMakeCurrent(_EglDisplay, _EglSurface, _EglSurface, _EglContext)) + { + return false; + } +#elif defined(NL_OS_WINDOWS) + _hDC = GetDC(_win); + _CurrentMode.Depth = uint8(GetDeviceCaps(_hDC,BITSPIXEL)); + + wglMakeCurrent(_hDC,NULL); + // --- + memset(&_pfd,0,sizeof(_pfd)); + _pfd.nSize = sizeof(_pfd); + _pfd.nVersion = 1; + _pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; + _pfd.iPixelType = PFD_TYPE_RGBA; + _pfd.cColorBits = _CurrentMode.Depth; + // Choose best suited Depth Buffer. + if(_CurrentMode.Depth <= 16) + { + _pfd.cDepthBits = 16; + } + else + { + _pfd.cDepthBits = 24; + _pfd.cAlphaBits = 8; + _pfd.cStencilBits = 8; + } + _pfd.iLayerType = PFD_MAIN_PLANE; + int pf=ChoosePixelFormat(_hDC,&_pfd); + if (!pf) + { + return false; + } + + if ( !SetPixelFormat(_hDC,pf,&_pfd) ) + { + return false; + } + _hRC=wglCreateContext(_hDC); + + wglMakeCurrent(_hDC,_hRC); +#endif + + return true; +} + +// -------------------------------------------------- +bool CDriverGL::activate() +{ + H_AUTO_OGL(CDriverGL_activate); + + if (_win == EmptyWindow) + return false; + +#ifdef USE_OPENGLES + + EGLContext ctx = eglGetCurrentContext(); + + if (ctx != _EglContext) + { + // Make the context current + if (!eglMakeCurrent(_EglDisplay, _EglSurface, _EglSurface, _EglContext)) + { + return false; + } + } + +#elif defined(NL_OS_WINDOWS) + + HGLRC hglrc = wglGetCurrentContext(); + + if (hglrc != _hRC) + wglMakeCurrent(_hDC, _hRC); + +#elif defined(NL_OS_MAC) + + if([NSOpenGLContext currentContext] != _ctx) + [_ctx makeCurrentContext]; + +#elif defined (NL_OS_UNIX) + + GLXContext nctx = glXGetCurrentContext(); + + if (nctx != NULL && nctx != _ctx) + glXMakeCurrent(_dpy, _win, _ctx); + +#endif // USE_OPENGLES + + return true; +} + +// -------------------------------------------------- +IDriver::TMessageBoxId CDriverGL::systemMessageBox (const char* message, const char* title, IDriver::TMessageBoxType type, TMessageBoxIcon icon) +{ + H_AUTO_OGL(CDriverGL_systemMessageBox) +#ifdef NL_OS_WINDOWS + switch (::MessageBox (NULL, message, title, ((type==retryCancelType)?MB_RETRYCANCEL: + (type==yesNoCancelType)?MB_YESNOCANCEL: + (type==okCancelType)?MB_OKCANCEL: + (type==abortRetryIgnoreType)?MB_ABORTRETRYIGNORE: + (type==yesNoType)?MB_YESNO|MB_ICONQUESTION:MB_OK)| + + ((icon==handIcon)?MB_ICONHAND: + (icon==questionIcon)?MB_ICONQUESTION: + (icon==exclamationIcon)?MB_ICONEXCLAMATION: + (icon==asteriskIcon)?MB_ICONASTERISK: + (icon==warningIcon)?MB_ICONWARNING: + (icon==errorIcon)?MB_ICONERROR: + (icon==informationIcon)?MB_ICONINFORMATION: + (icon==stopIcon)?MB_ICONSTOP:0))) + { + case IDOK: + return okId; + case IDCANCEL: + return cancelId; + case IDABORT: + return abortId; + case IDRETRY: + return retryId; + case IDIGNORE: + return ignoreId; + case IDYES: + return yesId; + case IDNO: + return noId; + } + nlstop; +#else // NL_OS_WINDOWS + // Call the console version! + IDriver::systemMessageBox (message, title, type, icon); +#endif // NL_OS_WINDOWS + return okId; +} + +void CDriverGL::getWindowSize(uint32 &width, uint32 &height) +{ + H_AUTO_OGL(CDriverGL_getWindowSize) + + if (_CurrentMode.OffScreen) + { +#ifdef NL_OS_WINDOWS + +#ifndef USE_OPENGLES + if (_PBuffer) + { + nwglQueryPbufferARB( _PBuffer, WGL_PBUFFER_WIDTH_ARB, (int*)&width ); + nwglQueryPbufferARB( _PBuffer, WGL_PBUFFER_HEIGHT_ARB, (int*)&height ); + } +#endif + +#endif + } + else + { +#ifdef NL_OS_MAC + if([containerView() isInFullScreenMode]) + { + width = _backBufferWidth; + height = _backBufferHeight; + return; + } +#endif + width = _CurrentMode.Width; + height = _CurrentMode.Height; + } +} + +void CDriverGL::setWindowSize(uint32 width, uint32 height) +{ + H_AUTO_OGL(CDriverGL_setWindowSize) + + if (_win == EmptyWindow) + return; + +#if defined(NL_OS_WINDOWS) + + // resize the window + RECT rc; + SetRect (&rc, 0, 0, width, height); + AdjustWindowRectEx(&rc, GetWindowStyle(_win), GetMenu(_win) != NULL, GetWindowExStyle(_win)); + UINT flags = SWP_NOZORDER | SWP_NOACTIVATE; + // set position to (0, 0) if fullscreen + if (_CurrentMode.Windowed) + flags |= SWP_NOMOVE; + SetWindowPos(_win, NULL, 0, 0, rc.right - rc.left, rc.bottom - rc.top, flags); + + // init window width and height + RECT clientRect; + GetClientRect(_win, &clientRect); + _CurrentMode.Width = uint16(clientRect.right-clientRect.left); + _CurrentMode.Height = uint16(clientRect.bottom-clientRect.top); + GetWindowRect(_win, &clientRect); + _WindowX = clientRect.left; + _WindowY = clientRect.top; + +#elif defined(NL_OS_MAC) + + // for fullscreen mode, adjust the back buffer size to desired resolution + if([containerView() isInFullScreenMode]) + { + // disable and re-enable fullscreen + // fixes #1062 (http://dev.ryzom.com/issues/1062) + setWindowStyle(EWSWindowed); + setWindowStyle(EWSFullscreen); + + // set the back buffer manually to match the desired rendering resolution + GLint dim[2] = { width, height }; + CGLError error = CGLSetParameter( + (CGLContextObj)[_ctx CGLContextObj], + kCGLCPSurfaceBackingSize, dim); + + if(error != kCGLNoError) + nlerror("cannot set kCGLCPSurfaceBackingSize parameter (%s)", + CGLErrorString(error)); + + _backBufferHeight = height; + _backBufferWidth = width; + } + else + { + // only change the window size if the driver created the window itself + if(_DestroyWindow) + { + // get the windows current frame + NSRect rect = [[containerView() window] frame]; + + // convert the desired content size to window size + rect = [[containerView() window] frameRectForContentRect: + NSMakeRect(rect.origin.x, rect.origin.y, width, height)]; + + // update window dimensions + [[containerView() window] setFrame:rect display:YES]; + } + } + +#elif defined(NL_OS_UNIX) + + if (!_Resizable) + { + // Update WM hints (disallow resizing) + XSizeHints *size_hints = XAllocSizeHints(); + + size_hints->flags = PMinSize | PMaxSize; + size_hints->min_width = width; + size_hints->min_height = height; + size_hints->max_width = width; + size_hints->max_height = height; + + XSetWMNormalHints(_dpy, _win, size_hints); + XFree(size_hints); + } + else + { +// XSetWMNormalHints(_dpy, _win, StdHints); + } + + if (width != _CurrentMode.Width || height != _CurrentMode.Height) + { + // resize the window + XResizeWindow(_dpy, _win, width, height); + + _CurrentMode.Width = width; + _CurrentMode.Height = height; + } + +#endif // NL_OS_WINDOWS +} + +void CDriverGL::getWindowPos(sint32 &x, sint32 &y) +{ + H_AUTO_OGL(CDriverGL_getWindowPos) + + // Off-screen rendering ? + if (_CurrentMode.OffScreen) + { + x = y = 0; + } + else + { + x = _WindowX; + y = _WindowY; + } +} + +// -------------------------------------------------- +bool CDriverGL::isActive() +{ + H_AUTO_OGL(CDriverGL_isActive) + + if (_win == EmptyWindow) + return false; + + bool res = true; + +#ifdef NL_OS_WINDOWS + + res = (IsWindow(_win) != FALSE); + +#elif defined(NL_OS_MAC) +# warning "OpenGL Driver: Missing Mac Implementation for isActive (always true if a window is set)" +#elif defined (NL_OS_UNIX) + + // check if our window is still active + XWindowAttributes attr; + Status status = XGetWindowAttributes(_dpy, _win, &attr); + + res = (status == 1); + +#endif // NL_OS_UNIX + + return res; +} + +// *************************************************************************** +bool CDriverGL::setMonitorColorProperties (const CMonitorColorProperties &properties) +{ + H_AUTO_OGL(CDriverGL_setMonitorColorProperties ) + +#ifdef NL_OS_WINDOWS + + // Get a DC + HDC dc = CreateDC ("DISPLAY", NULL, NULL, NULL); + if (dc) + { + // The ramp + WORD ramp[256*3]; + + // For each composant + uint c; + for( c=0; c<3; c++ ) + { + uint i; + for( i=0; i<256; i++ ) + { + // Floating value + float value = (float)i / 256; + + // Contrast + value = (float) max (0.0f, (value-0.5f) * (float) pow (3.f, properties.Contrast[c]) + 0.5f ); + + // Gamma + value = (float) pow (value, (properties.Gamma[c]>0) ? 1 - 3 * properties.Gamma[c] / 4 : 1 - properties.Gamma[c] ); + + // Luminosity + value = value + properties.Luminosity[c] / 2.f; + ramp[i+(c<<8)] = (WORD)min ((int)65535, max (0, (int)(value * 65535))); + } + } + + // Set the ramp + bool result = SetDeviceGammaRamp (dc, ramp) != FALSE; + + // Release the DC + ReleaseDC (NULL, dc); + + // Returns result + return result; + } + else + { + nlwarning ("(CDriverGL::setMonitorColorProperties): can't create DC"); + } + +#elif defined(NL_OS_MAC) + // TODO for Mac: implement CDriverGL::setMonitorColorProperties + nlwarning ("CDriverGL::setMonitorColorProperties not implemented"); + +#elif defined (NL_OS_UNIX) + // TODO for Linux: implement CDriverGL::setMonitorColorProperties + nlwarning ("CDriverGL::setMonitorColorProperties not implemented"); + +#endif + + return false; +} + +#ifdef NL_OS_MAC +void CDriverGL::setupApplicationMenu() +{ + NSMenu* menu; + NSMenuItem* menuItem; + NSString* title; + NSString* appName; + + // get the applications name from it's process info + appName = [[NSProcessInfo processInfo] processName]; + + // create an empty menu object + menu = [[NSMenu alloc] initWithTitle:@""]; + + // add the about menu item + title = [@"About " stringByAppendingString:appName]; + [menu addItemWithTitle:title + action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; + + // separator + [menu addItem:[NSMenuItem separatorItem]]; + + // add the hide application menu item + title = [@"Hide " stringByAppendingString:appName]; + [menu addItemWithTitle:title + action:@selector(hide:) keyEquivalent:@"h"]; + + // add the hide others menu item + menuItem = [menu addItemWithTitle:@"Hide Others" + action:@selector(hideOtherApplications:) keyEquivalent:@"h"]; + [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; + + // add the show all menu item + [menu addItemWithTitle:@"Show All" + action:@selector(unhideAllApplications:) keyEquivalent:@""]; + + // separator + [menu addItem:[NSMenuItem separatorItem]]; + + /* + TODO on quit send EventDestroyWindowId + */ + // add the quit menu item + title = [@"Quit " stringByAppendingString:appName]; + [menu addItemWithTitle:title + action:@selector(terminate:) keyEquivalent:@"q"]; + + // create an empty menu item and put the new menu into it as a subitem + menuItem = [[NSMenuItem alloc] initWithTitle:@"" + action:nil keyEquivalent:@""]; + [menuItem setSubmenu:menu]; + + // create a menu for the application + [NSApp setMainMenu:[[NSMenu alloc] initWithTitle:@""]]; + + // attach the new menu to the applications menu + [[NSApp mainMenu] addItem:menuItem]; +} +#endif + +bool CDriverGL::copyTextToClipboard(const ucstring &text) +{ + return _EventEmitter.copyTextToClipboard(text); +} + +bool CDriverGL::pasteTextFromClipboard(ucstring &text) +{ + return _EventEmitter.pasteTextFromClipboard(text); +} + +#ifdef NL_OS_WINDOWS + +bool CDriverGL::convertBitmapToIcon(const NLMISC::CBitmap &bitmap, HICON &icon, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col, sint hotSpotX, sint hotSpotY, bool cursor) +{ + CBitmap src = bitmap; + + // resample bitmap if necessary + if (src.getWidth() != iconWidth || src.getHeight() != iconHeight) + { + src.resample(iconWidth, iconHeight); + } + CBitmap colorBm; + colorBm.resize(iconWidth, iconHeight, CBitmap::RGBA); + const CRGBA *srcColorPtr = (CRGBA *) &(src.getPixels()[0]); + const CRGBA *srcColorPtrLast = srcColorPtr + (iconWidth * iconHeight); + CRGBA *destColorPtr = (CRGBA *) &(colorBm.getPixels()[0]); + static uint8 alphaThreshold = 127; + do + { + destColorPtr->modulateFromColor(*srcColorPtr, col); + std::swap(destColorPtr->R, destColorPtr->B); + ++ srcColorPtr; + ++ destColorPtr; + } + while (srcColorPtr != srcColorPtrLast); + // + HBITMAP colorHbm = NULL; + HBITMAP maskHbm = NULL; + // + if (iconDepth == 16) + { + std::vector colorBm16(iconWidth * iconHeight); + const CRGBA *src32 = (const CRGBA *) &colorBm.getPixels(0)[0]; + + for (uint k = 0; k < colorBm16.size(); ++k) + { + colorBm16[k] = ((uint16)(src32[k].R&0xf8)>>3) | ((uint16)(src32[k].G&0xfc)<<3) | ((uint16)(src32[k].B & 0xf8)<<8); + } + + colorHbm = CreateBitmap(iconWidth, iconHeight, 1, 16, &colorBm16[0]); + std::vector bitMask((iconWidth * iconHeight + 7) / 8, 0); + + for (uint k = 0;k < colorBm16.size(); ++k) + { + if (src32[k].A <= alphaThreshold) + { + bitMask[k / 8] |= (0x80 >> (k & 7)); + } + } + + maskHbm = CreateBitmap(iconWidth, iconHeight, 1, 1, &bitMask[0]); + } + else + { + colorHbm = CreateBitmap(iconWidth, iconHeight, 1, 32, &colorBm.getPixels(0)[0]); + maskHbm = CreateBitmap(iconWidth, iconHeight, 1, 32, &colorBm.getPixels(0)[0]); + } + + ICONINFO iconInfo; + iconInfo.fIcon = cursor ? FALSE:TRUE; + iconInfo.xHotspot = (DWORD) hotSpotX; + iconInfo.yHotspot = (DWORD) hotSpotY; + iconInfo.hbmMask = maskHbm; + iconInfo.hbmColor = colorHbm; + + if (colorHbm && maskHbm) + { + icon = CreateIconIndirect(&iconInfo); + } + + // + if (colorHbm) DeleteObject(colorHbm); + if (maskHbm) DeleteObject(maskHbm); + + return true; +} + +#elif defined(NL_OS_MAC) + +#elif defined(NL_OS_UNIX) + +bool CDriverGL::convertBitmapToIcon(const NLMISC::CBitmap &bitmap, std::vector &icon) +{ + // get bitmap width and height + uint width = bitmap.getWidth(); + uint height = bitmap.getHeight(); + + // icon position for bitmap + uint pos = (uint)icon.size(); + + // extend icon_data size for bitmap + icon.resize(pos + 2 + width*height); + + // set bitmap width and height + icon[pos++] = width; + icon[pos++] = height; + + // convert RGBA to ARGB + CObjectVector pixels = bitmap.getPixels(); + for(uint j = 0; j < pixels.size(); j+=4) + icon[pos++] = pixels[j] << 16 | pixels[j+1] << 8 | pixels[j+2] | pixels[j+3] << 24; + + return true; +} + +#endif + +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} // NL3D diff --git a/code/nel/src/3d/driver/OpenGL3/mac/cocoa_application_delegate.h b/code/nel/src/3d/driver/OpenGL3/mac/cocoa_application_delegate.h new file mode 100644 index 000000000..da033c7c1 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/mac/cocoa_application_delegate.h @@ -0,0 +1,40 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#import + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +using NL3D::NLDRIVERGLES::CDriverGL; +#else +using NL3D::NLDRIVERGL::CDriverGL; +#endif +#else +using NL3D::CDriverGL; +#endif + +@interface CocoaApplicationDelegate : NSObject +#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + +#endif +{ + CDriverGL* _driver; +} + +-(id)initWithDriver:(CDriverGL*)driver; +-(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender; + +@end diff --git a/code/nel/src/3d/driver/OpenGL3/mac/cocoa_application_delegate.mm b/code/nel/src/3d/driver/OpenGL3/mac/cocoa_application_delegate.mm new file mode 100644 index 000000000..8fe0045b6 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/mac/cocoa_application_delegate.mm @@ -0,0 +1,60 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "../stdopengl.h" +#include "../driver_opengl.h" + +#include "cocoa_application_delegate.h" +#include "cocoa_event_emitter.h" + +static NSApplicationTerminateReply applicationShouldTerminate(CDriverGL* driver) +{ + // cancel if there is a driver and a custom exit handler set up + if(driver && driver->ExitFunc) + { + driver->ExitFunc(); + return NSTerminateCancel; + } + + NLMISC::CCocoaEventEmitter* eventEmitter = + NLMISC::safe_cast(&(driver->_EventEmitter)); + + // cancel if there is a driver and cocoa event emitter handles the quit + if(driver && eventEmitter && eventEmitter->handleQuitRequest()) + return NSTerminateCancel; + + // just let the app terminate if no custom quit handling worked + return NSTerminateNow; +} + +@implementation CocoaApplicationDelegate + +-(id)initWithDriver:(CDriverGL*)driver +{ + if((self = [super init])) + { + _driver = driver; + return self; + } + return nil; +} + +-(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender +{ + return applicationShouldTerminate(_driver); +} + +@end diff --git a/code/nel/src/3d/driver/OpenGL3/mac/cocoa_event_emitter.cpp b/code/nel/src/3d/driver/OpenGL3/mac/cocoa_event_emitter.cpp new file mode 100644 index 000000000..d290e0cee --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/mac/cocoa_event_emitter.cpp @@ -0,0 +1,508 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "cocoa_event_emitter.h" + +namespace NLMISC +{ + +/// map from virtual key code to nel internal key code +static NLMISC::TKey virtualKeycodeToNelKey(unsigned short keycode) +{ + switch(keycode) + { + case kVK_ANSI_0: return NLMISC::Key0; + case kVK_ANSI_1: return NLMISC::Key1; + case kVK_ANSI_2: return NLMISC::Key2; + case kVK_ANSI_3: return NLMISC::Key3; + case kVK_ANSI_4: return NLMISC::Key4; + case kVK_ANSI_5: return NLMISC::Key5; + case kVK_ANSI_6: return NLMISC::Key6; + case kVK_ANSI_7: return NLMISC::Key7; + case kVK_ANSI_8: return NLMISC::Key8; + case kVK_ANSI_9: return NLMISC::Key9; + case kVK_ANSI_A: return NLMISC::KeyA; + case kVK_ANSI_B: return NLMISC::KeyB; + case kVK_ANSI_C: return NLMISC::KeyC; + case kVK_ANSI_D: return NLMISC::KeyD; + case kVK_ANSI_E: return NLMISC::KeyE; + case kVK_ANSI_F: return NLMISC::KeyF; + case kVK_ANSI_G: return NLMISC::KeyG; + case kVK_ANSI_H: return NLMISC::KeyH; + case kVK_ANSI_I: return NLMISC::KeyI; + case kVK_ANSI_J: return NLMISC::KeyJ; + case kVK_ANSI_K: return NLMISC::KeyK; + case kVK_ANSI_L: return NLMISC::KeyL; + case kVK_ANSI_M: return NLMISC::KeyM; + case kVK_ANSI_N: return NLMISC::KeyN; + case kVK_ANSI_O: return NLMISC::KeyO; + case kVK_ANSI_P: return NLMISC::KeyP; + case kVK_ANSI_Q: return NLMISC::KeyQ; + case kVK_ANSI_R: return NLMISC::KeyR; + case kVK_ANSI_S: return NLMISC::KeyS; + case kVK_ANSI_T: return NLMISC::KeyT; + case kVK_ANSI_U: return NLMISC::KeyU; + case kVK_ANSI_V: return NLMISC::KeyV; + case kVK_ANSI_W: return NLMISC::KeyW; + case kVK_ANSI_X: return NLMISC::KeyX; + case kVK_ANSI_Y: return NLMISC::KeyY; + case kVK_ANSI_Z: return NLMISC::KeyZ; + case kVK_ANSI_Equal: return NLMISC::KeyEQUALS; + case kVK_ANSI_Minus: return NLMISC::KeySUBTRACT; + case kVK_ANSI_RightBracket: return NLMISC::KeyRBRACKET; + case kVK_ANSI_LeftBracket: return NLMISC::KeyLBRACKET; + case kVK_ANSI_Quote: return NLMISC::KeyAPOSTROPHE; + case kVK_ANSI_Grave: return NLMISC::KeyPARAGRAPH; + case kVK_ANSI_Slash: return NLMISC::KeySLASH; + case kVK_ANSI_Backslash: return NLMISC::KeyBACKSLASH; + case kVK_ANSI_Comma: return NLMISC::KeyCOMMA; + case kVK_ANSI_Period: return NLMISC::KeyPERIOD; + case kVK_ANSI_Semicolon: return NLMISC::KeySEMICOLON; + case kVK_ANSI_KeypadDecimal: return NLMISC::KeyDECIMAL; + case kVK_ANSI_KeypadMultiply: return NLMISC::KeyMULTIPLY; + case kVK_ANSI_KeypadPlus: return NLMISC::KeyADD; + case kVK_ANSI_KeypadClear: return NLMISC::KeyDELETE; + case kVK_ANSI_KeypadDivide: return NLMISC::KeyDIVIDE; + case kVK_ANSI_KeypadEnter: return NLMISC::KeyRETURN; + case kVK_ANSI_KeypadMinus: return NLMISC::KeySUBTRACT; + case kVK_ANSI_KeypadEquals: return NLMISC::KeySEPARATOR; + case kVK_ANSI_Keypad0: return NLMISC::KeyNUMPAD0; + case kVK_ANSI_Keypad1: return NLMISC::KeyNUMPAD1; + case kVK_ANSI_Keypad2: return NLMISC::KeyNUMPAD2; + case kVK_ANSI_Keypad3: return NLMISC::KeyNUMPAD3; + case kVK_ANSI_Keypad4: return NLMISC::KeyNUMPAD4; + case kVK_ANSI_Keypad5: return NLMISC::KeyNUMPAD5; + case kVK_ANSI_Keypad6: return NLMISC::KeyNUMPAD6; + case kVK_ANSI_Keypad7: return NLMISC::KeyNUMPAD7; + case kVK_ANSI_Keypad8: return NLMISC::KeyNUMPAD8; + case kVK_ANSI_Keypad9: return NLMISC::KeyNUMPAD9; + case kVK_Return: return NLMISC::KeyRETURN; + case kVK_Tab: return NLMISC::KeyTAB; + case kVK_Space: return NLMISC::KeySPACE; + case kVK_Delete: return NLMISC::KeyBACK; + case kVK_ForwardDelete: return NLMISC::KeyDELETE; + case kVK_Escape: return NLMISC::KeyESCAPE; + case kVK_Shift: return NLMISC::KeySHIFT; + case kVK_RightShift: return NLMISC::KeyRSHIFT; + case kVK_CapsLock: return NLMISC::KeyCAPITAL; + case kVK_Control: return NLMISC::KeyCONTROL; + case kVK_RightControl: return NLMISC::KeyRCONTROL; + case kVK_F1: return NLMISC::KeyF1; + case kVK_F2: return NLMISC::KeyF2; + case kVK_F3: return NLMISC::KeyF3; + case kVK_F4: return NLMISC::KeyF4; + case kVK_F5: return NLMISC::KeyF5; + case kVK_F6: return NLMISC::KeyF6; + case kVK_F7: return NLMISC::KeyF7; + case kVK_F8: return NLMISC::KeyF8; + case kVK_F9: return NLMISC::KeyF9; + case kVK_F11: return NLMISC::KeyF11; + case kVK_F13: return NLMISC::KeyF13; + case kVK_F16: return NLMISC::KeyF16; + case kVK_F14: return NLMISC::KeyF14; + case kVK_F10: return NLMISC::KeyF10; + case kVK_F12: return NLMISC::KeyF12; + case kVK_F15: return NLMISC::KeyF15; + case kVK_F17: return NLMISC::KeyF17; + case kVK_F18: return NLMISC::KeyF18; + case kVK_F19: return NLMISC::KeyF19; + case kVK_F20: return NLMISC::KeyF20; + case kVK_Home: return NLMISC::KeyHOME; + case kVK_End: return NLMISC::KeyEND; + case kVK_PageUp: return NLMISC::KeyPRIOR; + case kVK_PageDown: return NLMISC::KeyNEXT; + case kVK_LeftArrow: return NLMISC::KeyLEFT; + case kVK_RightArrow: return NLMISC::KeyRIGHT; + case kVK_DownArrow: return NLMISC::KeyDOWN; + case kVK_UpArrow: return NLMISC::KeyUP; + case kVK_Command:break; + case kVK_Option:break; + case kVK_RightOption:break; + case kVK_Function:break; + case kVK_VolumeUp:break; + case kVK_VolumeDown:break; + case kVK_Mute:break; + case kVK_Help:break; + case kVK_ISO_Section:break; + case kVK_JIS_Yen:break; + case kVK_JIS_Underscore:break; + case kVK_JIS_KeypadComma:break; + case kVK_JIS_Eisu:break; + case kVK_JIS_Kana:break; + default:break; + } + return NLMISC::KeyNOKEY; +} + +bool CCocoaEventEmitter::pasteTextFromClipboard(ucstring &text) +{ + NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; + NSArray *classArray = [NSArray arrayWithObject:[NSString class]]; + NSDictionary *options = [NSDictionary dictionary]; + + BOOL ok = [pasteboard canReadObjectForClasses:classArray options:options]; + if (ok) + { + NSArray *objectsToPaste = [pasteboard readObjectsForClasses:classArray options:options]; + NSString *nstext = [objectsToPaste objectAtIndex:0]; + text.fromUtf8([nstext UTF8String]); + return true; + } + return false; +} + +bool CCocoaEventEmitter::copyTextToClipboard(const ucstring &text) +{ + NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; + [pasteboard clearContents]; + NSArray *copiedObjects = [NSArray arrayWithObject:[NSString stringWithUTF8String:text.toUtf8().c_str()]]; + [pasteboard writeObjects:copiedObjects]; + return true; +} + +/// convert modifier key state to nel internal modifier key state +static NLMISC::TKeyButton modifierFlagsToNelKeyButton(unsigned int modifierFlags) +{ + unsigned int buttons = 0; + if (modifierFlags & NSControlKeyMask) buttons |= NLMISC::ctrlKeyButton; + if (modifierFlags & NSShiftKeyMask) buttons |= NLMISC::shiftKeyButton; + if (modifierFlags & NSAlternateKeyMask) buttons |= NLMISC::altKeyButton; + return (NLMISC::TKeyButton)buttons; +} + +/// check whether a given event represents input text +static bool isTextKeyEvent(NSEvent* event) +{ + // if there are no characters provided with this event, it is not a text event + if([[event characters] length] == 0) + return false; + + NLMISC::TKey nelKey = virtualKeycodeToNelKey([event keyCode]); + + // ryzom ui wants to have "escape key string" to leave text box + if(nelKey == NLMISC::KeyESCAPE) + return true; + + // ryzom ui wants to have "return key string" to submit text box (send chat) + if(nelKey == NLMISC::KeyRETURN) + return true; + + // get the character reported by cocoa + unsigned int character = [[event characters] characterAtIndex:0]; + + // printable ascii characters + if(isprint(character)) + return true; + + /* + TODO check why iswprint(character) does not solve it. + it always returns false, even for non-ASCII characters + */ + // characters > 127 but not printable + if( nelKey == NLMISC::KeyF1 || nelKey == NLMISC::KeyF2 || + nelKey == NLMISC::KeyF3 || nelKey == NLMISC::KeyF4 || + nelKey == NLMISC::KeyF5 || nelKey == NLMISC::KeyF6 || + nelKey == NLMISC::KeyF7 || nelKey == NLMISC::KeyF8 || + nelKey == NLMISC::KeyF9 || nelKey == NLMISC::KeyF10 || + nelKey == NLMISC::KeyF11 || nelKey == NLMISC::KeyF12 || + nelKey == NLMISC::KeyF13 || nelKey == NLMISC::KeyF14 || + nelKey == NLMISC::KeyF15 || nelKey == NLMISC::KeyF16 || + nelKey == NLMISC::KeyF17 || nelKey == NLMISC::KeyF18 || + nelKey == NLMISC::KeyF19 || nelKey == NLMISC::KeyF20 || + nelKey == NLMISC::KeyUP || nelKey == NLMISC::KeyDOWN || + nelKey == NLMISC::KeyLEFT || nelKey == NLMISC::KeyRIGHT || + nelKey == NLMISC::KeyHOME || nelKey == NLMISC::KeyEND || + nelKey == NLMISC::KeyPRIOR || nelKey == NLMISC::KeyNEXT || + nelKey == NLMISC::KeyDELETE) + return false; + + // all the fancy wide characters + if(character > 127) + return true; + + return false; +} + +void CCocoaEventEmitter::init( + NL3D::IDriver* driver, CocoaOpenGLView* glView, bool eventLoop) +{ + _driver = driver; + _glView = glView; + _eventLoop = eventLoop; +} + +bool CCocoaEventEmitter::processMessage(NSEvent* event, CEventServer* server) +{ + if(!server && !_server) + { + // nlerror("no server to post events to"); + nldebug("no server to post events to"); + return true; + } + + if(!server) + server = _server; + + NSRect viewRect = [_glView frame]; + NSPoint mousePos = [_glView convertPoint:event.locationInWindow fromView:nil]; + + mousePos.x /= (float)viewRect.size.width; + mousePos.y /= (float)viewRect.size.height; + + // if the mouse event was placed outside the view, don't tell NeL :) + if((mousePos.x < 0.0 || mousePos.x > 1.0 || + mousePos.y < 0.0 || mousePos.y > 1.0) && + event.type != NSKeyDown && event.type != NSKeyUp) + { + return false; + } + + // first event about mouse movement after setting to emulateRawMode + if(_setToEmulateRawMode && + (event.type == NSMouseMoved || + event.type == NSLeftMouseDragged || + event.type == NSRightMouseDragged)) + { + // do not report because it reflects wrapping pointer to 0.5/0.5 + _setToEmulateRawMode = false; + return false; + } + + // convert the modifiers for nel to pass them with the events + NLMISC::TKeyButton modifiers = + modifierFlagsToNelKeyButton([event modifierFlags]); + + switch(event.type) + { + case NSLeftMouseDown: + { + server->postEvent(new NLMISC::CEventMouseDown( + mousePos.x, mousePos.y, + (NLMISC::TMouseButton)(NLMISC::leftButton | modifiers), this)); + } + break; + case NSLeftMouseUp: + { + server->postEvent(new NLMISC::CEventMouseUp( + mousePos.x, mousePos.y, + (NLMISC::TMouseButton)(NLMISC::leftButton | modifiers), this)); + break; + } + case NSRightMouseDown: + { + server->postEvent(new NLMISC::CEventMouseDown( + mousePos.x, mousePos.y, + (NLMISC::TMouseButton)(NLMISC::rightButton | modifiers), this)); + break; + } + case NSRightMouseUp: + { + server->postEvent(new NLMISC::CEventMouseUp( + mousePos.x, mousePos.y, + (NLMISC::TMouseButton)(NLMISC::rightButton | modifiers), this)); + break; + } + case NSMouseMoved: + { + NLMISC::CEvent* nelEvent; + + // when emulating raw mode, send the delta in a CGDMouseMove event + if(_emulateRawMode) + nelEvent = new NLMISC::CGDMouseMove( + this, NULL /* no mouse device */, event.deltaX, -event.deltaY); + + // normally send position in a CEventMouseMove + else + nelEvent = new NLMISC::CEventMouseMove( + mousePos.x, mousePos.y, (NLMISC::TMouseButton)modifiers, this); + + server->postEvent(nelEvent); + break; + } + case NSLeftMouseDragged: + { + NLMISC::CEvent* nelEvent; + + // when emulating raw mode, send the delta in a CGDMouseMove event + if(_emulateRawMode) + nelEvent = new NLMISC::CGDMouseMove( + this, NULL /* no mouse device */, event.deltaX, -event.deltaY); + + // normally send position in a CEventMouseMove + else + nelEvent = new NLMISC::CEventMouseMove(mousePos.x, mousePos.y, + (NLMISC::TMouseButton)(NLMISC::leftButton | modifiers), this); + + server->postEvent(nelEvent); + break; + } + case NSRightMouseDragged: + { + NLMISC::CEvent* nelEvent; + + // when emulating raw mode, send the delta in a CGDMouseMove event + if(_emulateRawMode) + nelEvent = new NLMISC::CGDMouseMove( + this, NULL /* no mouse device */, event.deltaX, -event.deltaY); + + // normally send position in a CEventMouseMove + else + nelEvent = new NLMISC::CEventMouseMove(mousePos.x, mousePos.y, + (NLMISC::TMouseButton)(NLMISC::rightButton | modifiers), this); + + server->postEvent(nelEvent); + break; + } + case NSMouseEntered:break; + case NSMouseExited:break; + case NSKeyDown: + { + // push the key press event to the event server + server->postEvent(new NLMISC::CEventKeyDown( + virtualKeycodeToNelKey([event keyCode]), + modifiers, + [event isARepeat] == NO, this)); + + // if this was a text event + if(isTextKeyEvent(event)) + { + ucstring ucstr; + + // get the string associated with the key press event + ucstr.fromUtf8([[event characters] UTF8String]); + + // push the text event to event server as well + server->postEvent(new NLMISC::CEventChar( + ucstr[0], modifiers, this)); + } + break; + } + case NSKeyUp: + { + // push the key release event to the event server + server->postEvent(new NLMISC::CEventKeyUp( + virtualKeycodeToNelKey([event keyCode]), + modifiers, this)); + break; + } + case NSFlagsChanged:break; + case NSAppKitDefined:break; + case NSSystemDefined:break; + case NSApplicationDefined:break; + case NSPeriodic:break; + case NSCursorUpdate:break; + case NSScrollWheel: + { + if(fabs(event.deltaY) > 0.1) + server->postEvent(new NLMISC::CEventMouseWheel( + mousePos.x, mousePos.y, (NLMISC::TMouseButton)modifiers, + (event.deltaY > 0), this)); + + break; + } + case NSTabletPoint:break; + case NSTabletProximity:break; + case NSOtherMouseDown:break; + case NSOtherMouseUp:break; + case NSOtherMouseDragged:break; +#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + case NSEventTypeGesture:break; + case NSEventTypeMagnify:break; + case NSEventTypeSwipe:break; + case NSEventTypeRotate:break; + case NSEventTypeBeginGesture:break; + case NSEventTypeEndGesture:break; +#endif + default: + { + nlwarning("Unknown event type. dropping."); + NSLog(@"%@", event); + break; + } + } + + if(_emulateRawMode && _driver && (event.type == NSMouseMoved || + event.type == NSLeftMouseDragged || event.type == NSRightMouseDragged)) + { + _driver->setMousePos(0.5, 0.5); + } + + return true; +} + +bool CCocoaEventEmitter::handleQuitRequest() +{ + if(_server) + { + _server->postEvent(new CEventDestroyWindow(this)); + return true; + } + + return false; +} + +typedef bool (*cocoaProc)(NL3D::IDriver*, const void* e); + +void CCocoaEventEmitter::submitEvents(CEventServer& server, bool /* allWins */) +{ + // break if there was no event to handle + // if running embedded in e.g. qt, _eventLoop will be false + while(_eventLoop) + { + // get the next event to handle + NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask + untilDate:nil /*[NSDate distantFuture]*/ + inMode:NSDefaultRunLoopMode dequeue:YES]; + + // stop, if there was no event + if(!event) + break; + + // if there is a driver set up, forward event to it's windowProc + if(_driver) + { + cocoaProc proc = (cocoaProc)_driver->getWindowProc(); + + if(proc) + proc(_driver, [event eventRef]); + } + // without driver, just process the event + else + { + processMessage(event, &server); + } + + // forward the event to the cocoa application + [NSApp sendEvent:event]; + } + + _server = &server; +} + +void CCocoaEventEmitter::emulateMouseRawMode(bool enable) +{ + _emulateRawMode = enable; + + if(_emulateRawMode) + { + _setToEmulateRawMode = true; + + if(_driver) + _driver->setMousePos(0.5, 0.5); + } +} + +} diff --git a/code/nel/src/3d/driver/OpenGL3/mac/cocoa_event_emitter.h b/code/nel/src/3d/driver/OpenGL3/mac/cocoa_event_emitter.h new file mode 100644 index 000000000..7e46fc6de --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/mac/cocoa_event_emitter.h @@ -0,0 +1,64 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef NL_COCOA_EVENT_EMITTER_H +#define NL_COCOA_EVENT_EMITTER_H + +#include "nel/misc/event_emitter.h" +#include "nel/misc/event_server.h" +#include "nel/misc/events.h" +#include "nel/misc/game_device_events.h" +#include "nel/3d/driver.h" +#import "cocoa_opengl_view.h" + +#include +#import + +namespace NLMISC +{ + +class CCocoaEventEmitter : public IEventEmitter +{ + bool _emulateRawMode; + bool _setToEmulateRawMode; + bool _eventLoop; + NL3D::IDriver* _driver; + CocoaOpenGLView* _glView; + + // TODO like internal server in unix event emitter... review! + CEventServer* _server; + +public: + CCocoaEventEmitter() : + _emulateRawMode(false), + _setToEmulateRawMode(false), + _driver(NULL), + _glView(nil), + _server(NULL) { } + + void init(NL3D::IDriver*, CocoaOpenGLView*, bool eventLoop); + bool processMessage(NSEvent* event, CEventServer* server = NULL); + virtual void submitEvents(CEventServer& server, bool allWindows); + virtual void emulateMouseRawMode(bool enable); + bool handleQuitRequest(); + + virtual bool copyTextToClipboard(const ucstring &text); + virtual bool pasteTextFromClipboard(ucstring &text); +}; + +} + +#endif diff --git a/code/nel/src/3d/driver/OpenGL3/mac/cocoa_opengl_view.h b/code/nel/src/3d/driver/OpenGL3/mac/cocoa_opengl_view.h new file mode 100644 index 000000000..e8acae926 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/mac/cocoa_opengl_view.h @@ -0,0 +1,61 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#import + +namespace NL3D +{ + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + + class CDriverGL; + +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +using NL3D::NLDRIVERGLES::CDriverGL; +#else +using NL3D::NLDRIVERGL::CDriverGL; +#endif +#else +using NL3D::CDriverGL; +#endif + +@interface CocoaOpenGLView : NSOpenGLView +{ + NSMutableAttributedString* _characterStorage; + NSRange _markedRange; + CDriverGL* _driver; +} + +-(id)initWithFrame:(NSRect)frame; +-(void)dealloc; +-(void)keyDown:(NSEvent*)event; +-(void)setDriver:(CDriverGL*)driver; +-(void)resizeWithOldSuperviewSize:(NSSize)oldBoundsSize; + +@end diff --git a/code/nel/src/3d/driver/OpenGL3/mac/cocoa_opengl_view.m b/code/nel/src/3d/driver/OpenGL3/mac/cocoa_opengl_view.m new file mode 100644 index 000000000..17500389c --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/mac/cocoa_opengl_view.m @@ -0,0 +1,152 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "../stdopengl.h" +#include "../driver_opengl.h" + +#import "cocoa_opengl_view.h" + +static void viewDidResize(NSView* view, CDriverGL* driver) +{ + NSRect rect = [[view superview] frame]; + driver->_CurrentMode.Height = rect.size.height; + driver->_CurrentMode.Width = rect.size.width; +} + +@implementation CocoaOpenGLView + +-(id)initWithFrame:(NSRect)frame +{ + if((self = [super initWithFrame:frame])) + { + _characterStorage = [[NSMutableAttributedString alloc] initWithString:@""]; + _driver = nil; + return self; + } + return nil; +} + +-(void)dealloc +{ + [_characterStorage release]; + [super dealloc]; +} + +-(void)keyDown:(NSEvent*)event +{ +#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + [[self inputContext] handleEvent:event]; +#endif +} + +-(void)setDriver:(CDriverGL*)driver +{ + _driver = driver; +} + +-(void)resizeWithOldSuperviewSize:(NSSize)oldBoundsSize +{ + [super resizeWithOldSuperviewSize:oldBoundsSize]; + + if(!_driver) + return; + + viewDidResize(self, _driver); +} + +/******************************************************************************/ +/* NSTextInputClient Protocol */ + +-(BOOL)hasMarkedText +{ + return (_markedRange.location == NSNotFound ? NO : YES); +} + +-(NSRange)markedRange +{ + return _markedRange; +} + +-(NSRange)selectedRange +{ + return NSMakeRange(NSNotFound, 0); +} + +-(void)setMarkedText:(id)aString + selectedRange:(NSRange)newSelection + replacementRange:(NSRange)replacementRange +{ + if(replacementRange.location == NSNotFound) + replacementRange = _markedRange; + + if([aString length] == 0) + { + [_characterStorage deleteCharactersInRange:replacementRange]; + [self unmarkText]; + } + else + { + _markedRange = NSMakeRange(replacementRange.location, [aString length]); + [_characterStorage replaceCharactersInRange:replacementRange + withString:aString]; + } +} + +-(void)unmarkText +{ + _markedRange = NSMakeRange(NSNotFound, 0); + [[self inputContext] discardMarkedText]; +} + +-(NSArray*)validAttributesForMarkedText +{ + return [NSArray arrayWithObjects: + NSMarkedClauseSegmentAttributeName, NSGlyphInfoAttributeName, nil]; +} + +-(NSAttributedString*)attributedSubstringForProposedRange:(NSRange)aRange + actualRange:(NSRangePointer)actualRange +{ + return [_characterStorage attributedSubstringFromRange:aRange]; +} + +-(void)insertText:(id)aString + replacementRange:(NSRange)replacementRange +{ + if(replacementRange.location == NSNotFound) + replacementRange = _markedRange; + + [_characterStorage replaceCharactersInRange:replacementRange + withString:aString]; +} + +-(NSUInteger)characterIndexForPoint:(NSPoint)aPoint +{ + return 0; +} + +-(NSRect)firstRectForCharacterRange:(NSRange)aRange + actualRange:(NSRangePointer)actualRange +{ + return NSMakeRect(0, 0, 0, 0); +} + +-(void)doCommandBySelector:(SEL)aSelector +{ + [super doCommandBySelector:aSelector]; +} + +@end diff --git a/code/nel/src/3d/driver/OpenGL3/mac/cocoa_window_delegate.h b/code/nel/src/3d/driver/OpenGL3/mac/cocoa_window_delegate.h new file mode 100644 index 000000000..53078e95a --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/mac/cocoa_window_delegate.h @@ -0,0 +1,41 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#import +#include "AvailabilityMacros.h" + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +using NL3D::NLDRIVERGLES::CDriverGL; +#else +using NL3D::NLDRIVERGL::CDriverGL; +#endif +#else +using NL3D::CDriverGL; +#endif + +@interface CocoaWindowDelegate : NSObject +#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + +#endif +{ + CDriverGL* _driver; +} + +- (id)initWithDriver:(CDriverGL*)driver; +- (void)windowDidMove:(NSNotification*)notification; + +@end diff --git a/code/nel/src/3d/driver/OpenGL3/mac/cocoa_window_delegate.mm b/code/nel/src/3d/driver/OpenGL3/mac/cocoa_window_delegate.mm new file mode 100644 index 000000000..a2eb54a6b --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/mac/cocoa_window_delegate.mm @@ -0,0 +1,59 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "../stdopengl.h" +#include "../driver_opengl.h" + +#import "cocoa_window_delegate.h" + +static void windowDidMove(NSWindow* window, CDriverGL* driver) +{ + // get the rect (position, size) of the screen with menu bar + NSRect screenRect = [[[NSScreen screens] objectAtIndex:0] frame]; + + // get the rect (position, size) of the window + NSRect windowRect = [window frame]; + + // set x in driver + driver->_WindowX = windowRect.origin.x; + + // map y from cocoa to NeL coordinates before setting in driver + driver->_WindowY = + screenRect.size.height - windowRect.size.height - windowRect.origin.y; +} + +@implementation CocoaWindowDelegate + +-(id)initWithDriver:(CDriverGL*)driver +{ + if((self = [super init])) + { + _driver = driver; + return self; + } + + return nil; +} + +-(void)windowDidMove:(NSNotification *)notification +{ + if(!_driver) + return; + + windowDidMove([notification object], _driver); +} + +@end diff --git a/code/nel/src/3d/driver/OpenGL3/nel-driverogl.pc.in b/code/nel/src/3d/driver/OpenGL3/nel-driverogl.pc.in new file mode 100644 index 000000000..6f43c5f14 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/nel-driverogl.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: nel-driverogl +Version: @VERSION@ +Description: NeL @VERSION@ +Requires: +Libs: -L${libdir} +Libs.private: @LIBS@ @OPENGL_LIBS@ @XF86VIDMODE_LIBS@ -lXmu +Cflags: -I${includedir} @OPENGL_CFLAGS@ @XF86VIDMODE_CFLAGS@ diff --git a/code/nel/src/3d/driver/OpenGL3/stdopengl.cpp b/code/nel/src/3d/driver/OpenGL3/stdopengl.cpp new file mode 100644 index 000000000..52ca5c7f5 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/stdopengl.cpp @@ -0,0 +1,17 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "stdopengl.h" diff --git a/code/nel/src/3d/driver/OpenGL3/stdopengl.h b/code/nel/src/3d/driver/OpenGL3/stdopengl.h new file mode 100644 index 000000000..336f15f47 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/stdopengl.h @@ -0,0 +1,71 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "nel/misc/types_nl.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef NL_OS_WINDOWS +# define WIN32_LEAN_AND_MEAN +# define NOMINMAX +# include +# include +#endif + +#ifdef USE_OPENGLES +# include "GLES/gl.h" +# include "GLES/glext.h" +# include "EGL/egl.h" +# include "EGL/eglext.h" +#else +# ifdef NL_OS_WINDOWS +# include +# include "GL/wglext.h" +# elif defined(NL_OS_MAC) +# define GL_GLEXT_LEGACY +# include +# elif defined (NL_OS_UNIX) +# define GLX_GLXEXT_PROTOTYPES +# include +# include +# include "GL/glxext.h" +# endif +# include "GL/glext.h" +#endif + +#include "nel/misc/common.h" +#include "nel/misc/debug.h" + +#include "nel/misc/stream.h" +#include "nel/misc/mem_stream.h" +#include "nel/misc/time_nl.h" +#include "nel/misc/command.h" + +#include "nel/3d/driver.h" diff --git a/code/nel/src/3d/driver/OpenGL3/unix_event_emitter.cpp b/code/nel/src/3d/driver/OpenGL3/unix_event_emitter.cpp new file mode 100644 index 000000000..475b58d57 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/unix_event_emitter.cpp @@ -0,0 +1,869 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +//#include "stdopengl.h" +#include "unix_event_emitter.h" + +#if defined(NL_OS_UNIX) && !defined(NL_OS_MAC) + +#include +#include +#include +#include +#include "nel/misc/debug.h" + + +typedef bool (*x11Proc)(NL3D::IDriver *drv, XEvent *e); + +static Atom XA_CLIPBOARD = 0; +static Atom XA_UTF8_STRING = 0; +static Atom XA_TARGETS = 0; +static Atom XA_NEL_SEL = 0; +static Atom XA_WM_DELETE_WINDOW = 0; + +namespace NLMISC { + +CUnixEventEmitter::CUnixEventEmitter ():_dpy(NULL), _win(0), _emulateRawMode(false), _driver(NULL) +{ + _im = 0; + _ic = 0; + _SelectionOwned=false; +} + +CUnixEventEmitter::~CUnixEventEmitter() +{ + closeIM(); +} + +void CUnixEventEmitter::init(Display *dpy, Window win, NL3D::IDriver *driver) +{ + _dpy = dpy; + _win = win; + _driver = driver; + + XSelectInput (_dpy, _win, KeyPressMask|KeyReleaseMask|ButtonPressMask|ButtonReleaseMask|PointerMotionMask|StructureNotifyMask|ExposureMask|EnterWindowMask|LeaveWindowMask|FocusChangeMask); + + // define Atoms used by clipboard + XA_CLIPBOARD = XInternAtom(dpy, "CLIPBOARD", False); + XA_UTF8_STRING = XInternAtom(dpy, "UTF8_STRING", False); + XA_TARGETS = XInternAtom(dpy, "TARGETS", False); + XA_NEL_SEL = XInternAtom(dpy, "NeL_SEL", False); + + // define Atom used by delete window + XA_WM_DELETE_WINDOW = XInternAtom(dpy, "WM_DELETE_WINDOW", False); + XSetWMProtocols(dpy, win, &XA_WM_DELETE_WINDOW, 1); + +/* + TODO: implements all useful events processing + ButtonMotionMask|Button1MotionMask|Button2MotionMask| + Button3MotionMask|Button4MotionMask|Button5MotionMask|KeymapStateMask| + SubstructureNotifyMask|VisibilityChangeMask|PropertyChangeMask| + ColormapChangeMask|OwnerGrabButtonMask +*/ + + createIM(); +} + +void CUnixEventEmitter::createIM() +{ +#ifdef X_HAVE_UTF8_STRING + + XModifierKeymap *g_mod_map = XGetModifierMapping(_dpy); + + char *modifiers = XSetLocaleModifiers(getenv("XMODIFIERS")); + + _im = XOpenIM(_dpy, NULL, NULL, NULL); + + if (_im) + { + _ic = XCreateIC(_im, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, XNClientWindow, _win, XNFocusWindow, _win, NULL); +// XSetICFocus(_ic); + } + else + { + _ic = 0; + nlwarning("XCreateIM failed"); + } + + if (!_ic) + { + nlwarning("XCreateIC failed"); + } + +#endif +} + +void CUnixEventEmitter::closeIM() +{ +#ifdef X_HAVE_UTF8_STRING + if (_ic) + { + XDestroyIC(_ic); + _ic = 0; + } + + if (_im) + { + XCloseIM(_im); + _im = 0; + } +#endif +} + +void CUnixEventEmitter::submitEvents(CEventServer & server, bool allWindows) +{ + while (XPending(_dpy)) + { + XEvent Event; + XNextEvent(_dpy, &Event); + if (allWindows || Event.xany.window == _win) + { + // nlinfo("event: %d", Event.type); + if (_driver) + { + // forward X events to OpenGL driver + x11Proc proc = (x11Proc)_driver->getWindowProc(); + + if (proc) + proc(_driver, &Event); + } + else + { + processMessage (Event, &server); + } + } + } + + // Dispatch sent messages + _InternalServer.setServer (&server); + _InternalServer.pump (allWindows); +} + +static Bool isMouseMoveEvent(Display *display, XEvent *event, XPointer arg) +{ + return (event->type == MotionNotify); +} + +void CUnixEventEmitter::emulateMouseRawMode(bool enable) +{ + _emulateRawMode = enable; + + if(_emulateRawMode) + { + XWindowAttributes xwa; + XGetWindowAttributes(_dpy, _win, &xwa); + XWarpPointer(_dpy, None, _win, None, None, None, None, + (xwa.width / 2), (xwa.height / 2)); + + // remove all outstanding mouse move events, they happened before the mouse + // was pulled back to 0.5 / 0.5, so a wrong movement delta would be + // reported otherwise + XEvent event; + while(XCheckIfEvent(_dpy, &event, &isMouseMoveEvent, NULL)) { }; + } +} + +#ifndef AltMask +# ifdef NL_OS_MAC +# define AltMask (8192) +# else +# define AltMask (Mod1Mask) +# endif +#endif + +TMouseButton getMouseButton (uint32 state) +{ + uint32 button=noButton; + if (state&Button1Mask) button|=leftButton; + if (state&Button2Mask) button|=middleButton; + if (state&Button3Mask) button|=rightButton; + if (state&ControlMask) button|=ctrlButton; + if (state&ShiftMask) button|=shiftButton; + if (state&AltMask) button|=altButton; + + return (TMouseButton)button; +} + +TKeyButton getKeyButton (uint32 state) +{ + uint32 button=noKeyButton; + if (state&ControlMask) button|=ctrlKeyButton; + if (state&ShiftMask) button|=shiftKeyButton; + if (state&AltMask) button|=altKeyButton; + + return (TKeyButton)button; +} + +TKey getKeyFromKeycode (uint keycode) +{ + // keycodes are depending on system + switch (keycode) + { +#ifdef NL_OS_MAC + /* + TODO use key mapping from driver/opengl/mac/cocoa_adapter.mm + */ + case 0x12: return Key1; + case 0x13: return Key2; + case 0x14: return Key3; + case 0x15: return Key4; + case 0x16: return Key6; + case 0x17: return Key5; + case 0x18: return KeyEQUALS; + case 0x19: return Key9; + case 0x1a: return Key7; + case 0x1c: return Key8; + case 0x1d: return Key0; + case 0x1e: return KeyRBRACKET; + case 0x21: return KeyLBRACKET; + case 0x27: return KeyAPOSTROPHE; + case 0x29: return KeySEMICOLON; + case 0x2a: return KeyBACKSLASH; + case 0x2b: return KeyCOMMA; + case 0x2c: return KeySLASH; + case 0x2f: return KeyPERIOD; +// case 0x5e: return KeyOEM_102; +// case 0x30: return KeyTILDE; +// case 0x3d: return KeyPARAGRAPH; +#else + case 0x0a: return Key1; + case 0x0b: return Key2; + case 0x0c: return Key3; + case 0x0d: return Key4; + case 0x0e: return Key5; + case 0x0f: return Key6; + case 0x10: return Key7; + case 0x11: return Key8; + case 0x12: return Key9; + case 0x13: return Key0; + case 0x14: return KeyLBRACKET; + case 0x15: return KeyEQUALS; + case 0x22: return KeyRBRACKET; + case 0x23: return KeySEMICOLON; + case 0x2f: return KeyCOMMA; + case 0x30: return KeyTILDE; + case 0x31: return KeyAPOSTROPHE; + case 0x33: return KeyBACKSLASH; + case 0x5e: return KeyOEM_102; +// case 0x3a: return KeyCOMMA; + case 0x3b: return KeyPERIOD; + case 0x3c: return KeySLASH; + case 0x3d: return KeyPARAGRAPH; + // for non-standard keyboards, maps to QWERTY keys + case 0x18: return KeyQ; + case 0x19: return KeyW; + case 0x1a: return KeyE; + case 0x1b: return KeyR; + case 0x1c: return KeyT; + case 0x1d: return KeyY; + case 0x1e: return KeyU; + case 0x1f: return KeyI; + case 0x20: return KeyO; + case 0x21: return KeyP; + case 0x26: return KeyQ; + case 0x27: return KeyS; + case 0x28: return KeyD; + case 0x29: return KeyF; + case 0x2a: return KeyG; + case 0x2b: return KeyH; + case 0x2c: return KeyJ; + case 0x2d: return KeyK; + case 0x2e: return KeyL; + case 0x34: return KeyZ; + case 0x35: return KeyX; + case 0x36: return KeyC; + case 0x37: return KeyV; + case 0x38: return KeyB; + case 0x39: return KeyN; + case 0x3a: return KeyM; +#endif + default: +// nlwarning("missing keycode 0x%x %d '%c'", keycode, keycode, keycode); + break; + } + + return KeyNOKEY; +} + +TKey getKeyFromKeySym (KeySym keysym) +{ +// nlwarning("0x%x %d '%c'", keysym, keysym, keysym); + switch (keysym) + { + case XK_BackSpace: return KeyBACK; + case XK_Tab: return KeyTAB; + case XK_Return: return KeyRETURN; + case XK_Sys_Req: return KeySNAPSHOT; + case XK_Scroll_Lock: return KeySCROLL; + case XK_Pause: return KeyPAUSE; + case XK_Escape: return KeyESCAPE; + case XK_Delete: return KeyDELETE; + case XK_Home: return KeyHOME; + case XK_Left: return KeyLEFT; + case XK_Up: return KeyUP; + case XK_Right: return KeyRIGHT; + case XK_Down: return KeyDOWN; + case XK_Page_Up: return KeyPRIOR; + case XK_Page_Down: return KeyNEXT; + case XK_End: return KeyEND; + case XK_Print: return KeyPRINT; + case XK_Insert: return KeyINSERT; + case XK_Num_Lock: return KeyNUMLOCK; + case XK_KP_0: return KeyNUMPAD0; + case XK_KP_1: return KeyNUMPAD1; + case XK_KP_2: return KeyNUMPAD2; + case XK_KP_3: return KeyNUMPAD3; + case XK_KP_4: return KeyNUMPAD4; + case XK_KP_5: return KeyNUMPAD5; + case XK_KP_6: return KeyNUMPAD6; + case XK_KP_7: return KeyNUMPAD7; + case XK_KP_8: return KeyNUMPAD8; + case XK_KP_9: return KeyNUMPAD9; + case XK_KP_Enter: return KeyRETURN; + case XK_KP_Home: return KeyHOME; + case XK_KP_Left: return KeyLEFT; + case XK_KP_Up: return KeyUP; + case XK_KP_Right: return KeyRIGHT; + case XK_KP_Down: return KeyDOWN; + case XK_KP_Page_Up: return KeyPRIOR; + case XK_KP_Page_Down: return KeyNEXT; + case XK_KP_End: return KeyEND; + case XK_KP_Begin: return KeyCANCEL; + case XK_KP_Insert: return KeyINSERT; + case XK_KP_Delete: return KeyDELETE; + case XK_KP_Multiply: return KeyMULTIPLY; + case XK_KP_Add: return KeyADD; + case XK_KP_Subtract: return KeySUBTRACT; + case XK_KP_Decimal: return KeyDECIMAL; +// case XK_period: return KeyDECIMAL; + case XK_KP_Divide: return KeyDIVIDE; + case XK_F1: return KeyF1; + case XK_F2: return KeyF2; + case XK_F3: return KeyF3; + case XK_F4: return KeyF4; + case XK_F5: return KeyF5; + case XK_F6: return KeyF6; + case XK_F7: return KeyF7; + case XK_F8: return KeyF8; + case XK_F9: return KeyF9; + case XK_F10: return KeyF10; + case XK_F11: return KeyF11; + case XK_F12: return KeyF12; + case XK_Shift_L: return KeySHIFT; + case XK_Shift_R: return KeySHIFT; + case XK_Control_L: return KeyCONTROL; + case XK_Control_R: return KeyCONTROL; + case XK_Caps_Lock: return KeyCAPITAL; + case XK_Super_L: return KeyLWIN; + case XK_Super_R: return KeyRWIN; + case XK_Mode_switch: return KeyMENU; + case XK_ISO_Level3_Shift: return KeyMENU; + case XK_Menu: return KeyAPPS; + case XK_Alt_L: return KeyMENU; + case XK_Alt_R: return KeyMENU; + case XK_space: return KeySPACE; + case XK_A: + case XK_a: return KeyA; + case XK_B: + case XK_b: return KeyB; + case XK_C: + case XK_c: return KeyC; + case XK_D: + case XK_d: return KeyD; + case XK_E: + case XK_e: return KeyE; + case XK_F: + case XK_f: return KeyF; + case XK_G: + case XK_g: return KeyG; + case XK_H: + case XK_h: return KeyH; + case XK_I: + case XK_i: return KeyI; + case XK_J: + case XK_j: return KeyJ; + case XK_K: + case XK_k: return KeyK; + case XK_L: + case XK_l: return KeyL; + case XK_M: + case XK_m: return KeyM; + case XK_N: + case XK_n: return KeyN; + case XK_O: + case XK_o: return KeyO; + case XK_P: + case XK_p: return KeyP; + case XK_Q: + case XK_q: return KeyQ; + case XK_R: + case XK_r: return KeyR; + case XK_S: + case XK_s: return KeyS; + case XK_T: + case XK_t: return KeyT; + case XK_U: + case XK_u: return KeyU; + case XK_V: + case XK_v: return KeyV; + case XK_W: + case XK_w: return KeyW; + case XK_X: + case XK_x: return KeyX; + case XK_Y: + case XK_y: return KeyY; + case XK_Z: + case XK_z: return KeyZ; + default: + // other keys don't need to be processed here + break; + } + return KeyNOKEY; +} + +// check if the next pressed key is the same +static bool keyRepeat(Display *display, XEvent *event) +{ + XEvent peekevent; + + if (XPending(display)) + { + XPeekEvent(display, &peekevent); + + if ((peekevent.type == KeyPress) && + (peekevent.xkey.keycode == event->xkey.keycode) && + ((peekevent.xkey.time-event->xkey.time) < 2)) + return true; + } + + return false; +} + +bool CUnixEventEmitter::processMessage (XEvent &event, CEventServer *server) +{ + if (!server) + server=&_InternalServer; + + XWindowAttributes xwa; + XGetWindowAttributes (_dpy, _win, &xwa); + + switch (event.type) + { + case ButtonPress: + { + //nlinfo("%d %d %d", event.xbutton.button, event.xbutton.x, event.xbutton.y); + float fX = (float) event.xbutton.x / (float) xwa.width; + float fY = 1.0f - (float) event.xbutton.y / (float) xwa.height; + TMouseButton button=getMouseButton(event.xbutton.state); + switch(event.xbutton.button) + { + case Button1: + server->postEvent(new CEventMouseDown(fX, fY, (TMouseButton)(leftButton|(button&~(leftButton|middleButton|rightButton))), this)); + break; + case Button2: + server->postEvent(new CEventMouseDown(fX, fY, (TMouseButton)(middleButton|(button&~(leftButton|middleButton|rightButton))), this)); + break; + case Button3: + server->postEvent(new CEventMouseDown(fX, fY, (TMouseButton)(rightButton|(button&~(leftButton|middleButton|rightButton))), this)); + break; + case Button4: + server->postEvent(new CEventMouseWheel(fX, fY, button, true, this)); + break; + case Button5: + server->postEvent(new CEventMouseWheel(fX, fY, button, false, this)); + break; + } + break; + } + case ButtonRelease: + { + //nlinfo("%d %d %d", event.xbutton.button, event.xbutton.x, event.xbutton.y); + float fX = (float) event.xbutton.x / (float) xwa.width; + float fY = 1.0f - (float) event.xbutton.y / (float) xwa.height; + switch(event.xbutton.button) + { + case Button1: + server->postEvent(new CEventMouseUp(fX, fY, leftButton, this)); + break; + case Button2: + server->postEvent(new CEventMouseUp(fX, fY, middleButton, this)); + break; + case Button3: + server->postEvent(new CEventMouseUp(fX, fY, rightButton, this)); + break; + } + break; + } + case MotionNotify: + { + TMouseButton button=getMouseButton (event.xbutton.state); + + // if raw mode should be emulated + if(_emulateRawMode) + { + // when we just wrapped back the pointer to 0.5 / 0.5, ignore event + if(event.xbutton.x == xwa.width / 2 && event.xbutton.y == xwa.height / 2) + break; + + // post a CGDMouseMove with the movement delta to the event server + server->postEvent( + new CGDMouseMove(this, NULL /* no mouse device */, + event.xbutton.x - (xwa.width / 2), + (xwa.height / 2) - event.xbutton.y)); + + // move the pointer back to the center of the window + XWarpPointer(_dpy, None, _win, None, None, None, None, + (xwa.width / 2), (xwa.height / 2)); + } + // if in normal mouse mode + else + { + // get the relative mouse position + float fX = (float) event.xbutton.x / (float) xwa.width; + float fY = 1.0f - (float) event.xbutton.y / (float) xwa.height; + + // post a normal mouse move event to the event server + server->postEvent (new CEventMouseMove (fX, fY, button, this)); + } + break; + } + case KeyPress: + { + // save keycode because XFilterEvent could set it to 0 + uint keyCode = event.xkey.keycode; + KeySym k; + static char Text[256]; + int c = 0; + + // check if event is filtered + bool filtered = XFilterEvent(&event, _win); + + // if key event is filtered, we shouldn't use XLookupString to retrieve KeySym + if (!filtered) + { + Status status = XLookupNone; + +#ifdef X_HAVE_UTF8_STRING + if (_ic) + c = Xutf8LookupString(_ic, &event.xkey, Text, sizeof(Text), &k, &status); +#endif + + if (status == XLookupNone) + c = XLookupString(&event.xkey, Text, sizeof(Text), &k, NULL); + } + else + { + k = XKeycodeToKeysym(_dpy, keyCode, 0); + } + + // send CEventKeyDown event only if keyCode is defined + if (keyCode) + { + TKey key = getKeyFromKeySym(k); + if(key == KeyNOKEY) + key = getKeyFromKeycode(keyCode); + + // search for key in map + std::map::const_iterator it = _PressedKeys.find(key); + + // if key is not found or value is false, that's the first time + bool firstTime = (it == _PressedKeys.end()) || !it->second; + + server->postEvent (new CEventKeyDown (key, getKeyButton(event.xbutton.state), firstTime, this)); + _PressedKeys[key] = true; + + // don't send a control character when deleting + if (key == KeyDELETE) + c = 0; + } + + Text[c] = '\0'; + if(c>0) + { +#ifdef X_HAVE_UTF8_STRING + ucstring ucstr; + ucstr.fromUtf8(Text); + + CEventChar *charEvent = new CEventChar (ucstr[0], getKeyButton(event.xbutton.state), this); + + // raw if not processed by IME + charEvent->setRaw(keyCode != 0); + + server->postEvent (charEvent); +#else + for (int i = 0; i < c; i++) + { + CEventChar *charEvent = new CEventChar ((ucchar)(unsigned char)Text[i], getKeyButton(event.xbutton.state), this); + + // raw if not processed by IME + charEvent->setRaw(keyCode != 0); + + server->postEvent (charEvent); + } +#endif + } + break; + } + case KeyRelease: + { + if (!keyRepeat(_dpy, &event)) + { + KeySym k; + // only need to get correct KeySym + int c = XLookupString(&event.xkey, NULL, 0, &k, NULL); + + TKey key = getKeyFromKeySym(k); + if(key == KeyNOKEY) + key = getKeyFromKeycode(event.xkey.keycode); + + server->postEvent (new CEventKeyUp (key, getKeyButton(event.xbutton.state), this)); + _PressedKeys[key] = false; + } + break; + } + case SelectionRequest: + { + XEvent respond; + XSelectionRequestEvent req = event.xselectionrequest; + + respond.xselection.type= SelectionNotify; + respond.xselection.display= req.display; + respond.xselection.requestor= req.requestor; + respond.xselection.selection=req.selection; + respond.xselection.target= req.target; + respond.xselection.time = req.time; + respond.xselection.property = req.property; + + if (req.property == None) + { + respond.xselection.property = req.target; + } + if (req.target == XA_TARGETS) + { + Atom targets[] = + { + XA_TARGETS, + XA_STRING, + XA_UTF8_STRING + }; + + respond.xselection.property = req.property; + + XChangeProperty(req.display, req.requestor, req.property, XA_ATOM, 32, PropModeReplace, (unsigned char *)targets, 3 /* number of element */); + } + else if (req.target == XA_STRING) + { + respond.xselection.property = req.property; + std::string str = _CopiedString.toString(); + XChangeProperty(req.display, req.requestor, req.property, XA_STRING, 8, PropModeReplace, (const unsigned char*)str.c_str(), str.length()); + } + else if (req.target == XA_UTF8_STRING) + { + respond.xselection.property = req.property; + std::string str = _CopiedString.toUtf8(); + XChangeProperty(req.display, req.requestor, respond.xselection.property, XA_UTF8_STRING, 8, PropModeReplace, (const unsigned char*)str.c_str(), str.length()); + } + else + { + // Note: Calling XGetAtomName with arbitrary value crash the client, maybe req.target have been sanitized by X11 server + respond.xselection.property = None; + } + + XSendEvent (_dpy, req.requestor, 0, 0, &respond); + + break; + } + case SelectionClear: + _SelectionOwned = false; + _CopiedString = ""; + break; + case SelectionNotify: + { + Atom target = event.xselection.target; + + Atom actualType = 0; + int actualFormat = 0; + unsigned long nitems = 0, bytesLeft = 0; + + // some applications are sending ATOM and other TARGETS + if (target == XA_TARGETS || target == XA_ATOM) + { + Atom *supportedTargets = NULL; + + // list NeL selection properties + if (XGetWindowProperty(_dpy, _win, XA_NEL_SEL, 0, XMaxRequestSize(_dpy), False, AnyPropertyType, &actualType, &actualFormat, &nitems, &bytesLeft, (unsigned char**)&supportedTargets) != Success) + return false; + + if (bytesLeft > 0) + { + nlwarning("Paste: Supported TARGETS list too long."); + } + + Atom bestTarget = 0; + sint bestTargetElect = 0; + + // Elect best type + for (uint i=0; i < nitems; i++) + { + // nlwarning(" - Type=%s (%u)", XGetAtomName(_dpy, supportedTargets[i]), (uint)supportedTargets[i]); + if (supportedTargets[i] == XA_UTF8_STRING ) + { + if (bestTargetElect < 2) + { + bestTarget = XA_UTF8_STRING; + bestTargetElect = 2; + } + } + else if (supportedTargets[i] == XA_STRING ) + { + if (bestTargetElect < 1) + { + bestTarget = XA_STRING; + bestTargetElect = 1; + } + } + } + + XFree(supportedTargets); + + if (!bestTargetElect) + { + nlwarning("Paste buffer is not a text buffer."); + return false; + } + + // request string conversion + XConvertSelection(_dpy, XA_CLIPBOARD, bestTarget, XA_NEL_SEL, _win, CurrentTime); + } + else if (target == XA_UTF8_STRING || target == XA_STRING) + { + uint8 *data = NULL; + + // get selection + if (XGetWindowProperty(_dpy, _win, XA_NEL_SEL, 0, XMaxRequestSize(_dpy), False, AnyPropertyType, &actualType, &actualFormat, &nitems, &bytesLeft, (unsigned char**)&data) != Success) + return false; + + ucstring text; + std::string tmpData = (const char*)data; + XFree(data); + + // convert buffer to ucstring + if (target == XA_UTF8_STRING) + { + text = ucstring::makeFromUtf8(tmpData); + } + else if (target == XA_STRING) + { + text = tmpData; + } + else + { + nlwarning("Unknow format %u", (uint)target); + } + + // sent string event to event server + server->postEvent (new CEventString (text, this)); + } + else + { + nlwarning("Unknow target %u", (uint)target); + } + + break; + } + case FocusIn: + // keyboard focus +#ifdef X_HAVE_UTF8_STRING + if (_ic) XSetICFocus(_ic); +#endif + server->postEvent (new CEventSetFocus (true, this)); + // server->postEvent(new CEventActivate(true, this)); + break; + case FocusOut: + // keyboard focus +#ifdef X_HAVE_UTF8_STRING + if (_ic) XUnsetICFocus(_ic); +#endif + server->postEvent (new CEventSetFocus (false, this)); + // server->postEvent(new CEventActivate(false, this)); + break; + case KeymapNotify: + break; + case MappingNotify: + // update keymap + XRefreshKeyboardMapping((XMappingEvent *)&event); + break; + case DestroyNotify: + // XIM server has crashed + createIM(); + break; + case ClientMessage: + if ((event.xclient.format == 32) && ((Atom)event.xclient.data.l[0] == XA_WM_DELETE_WINDOW)) + { + server->postEvent(new CEventDestroyWindow(this)); + } + break; + default: + // nlinfo("UnknownEvent"); + // XtDispatchEvent(&event); + return false; + } + + return true; +} + +bool CUnixEventEmitter::copyTextToClipboard(const ucstring &text) +{ + _CopiedString = text; + + // NeL window is the owner of clipboard + XSetSelectionOwner(_dpy, XA_CLIPBOARD, _win, CurrentTime); + + // check we are owning the clipboard + if (XGetSelectionOwner(_dpy, XA_CLIPBOARD) != _win) + { + nlwarning("Can't aquire selection"); + return false; + } + + _SelectionOwned = true; + + return true; +} + +bool CUnixEventEmitter::pasteTextFromClipboard(ucstring &text) +{ + // check if we own the selection + if (_SelectionOwned) + { + text = _CopiedString; + return true; + } + + // check if there is a data in clipboard + if (XGetSelectionOwner(_dpy, XA_CLIPBOARD) == None) + return false; + + // request supported methods + XConvertSelection(_dpy, XA_CLIPBOARD, XA_TARGETS, XA_NEL_SEL, _win, CurrentTime); + + // don't return result now + return false; +} + +} // NLMISC + +#endif // defined(NL_OS_UNIX) && !defined(NL_OS_MAC) diff --git a/code/nel/src/3d/driver/OpenGL3/unix_event_emitter.h b/code/nel/src/3d/driver/OpenGL3/unix_event_emitter.h new file mode 100644 index 000000000..362ed2086 --- /dev/null +++ b/code/nel/src/3d/driver/OpenGL3/unix_event_emitter.h @@ -0,0 +1,123 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef NL_UNIX_EVENT_EMITTER_H +#define NL_UNIX_EVENT_EMITTER_H + +#include "nel/misc/types_nl.h" +#include "nel/misc/event_emitter.h" +#include "nel/misc/events.h" +#include "nel/misc/game_device_events.h" + +#include "nel/3d/driver.h" + +#if defined(NL_OS_UNIX) && !defined(NL_OS_MAC) + +#include + +namespace NLMISC { + + +/** + * CEventEmitter UNIX implementation + * \author Vianney Lecroart + * \author Nevrax France + * \date 2000 + */ +class CUnixEventEmitter : public IEventEmitter +{ +public: + + /// Constructor + CUnixEventEmitter(); + virtual ~CUnixEventEmitter(); + + /** + * initialize CUnixEventEmitter + */ + void init(Display *dpy, Window win, NL3D::IDriver *driver = NULL); + + /** + * sends all events to server + * (should call CEventServer method postEvent() ) + */ + virtual void submitEvents(CEventServer & server, bool allWindows); + + /** + * enable or disable mouse raw mode + */ + virtual void emulateMouseRawMode(bool emulate); + + /** + * process input-related events (mouse and keyboard) + */ + bool processMessage(XEvent &event, CEventServer *server = NULL); + + /** + * Copy a string to system clipboard. + */ + virtual bool copyTextToClipboard(const ucstring &text); + + /* + * Paste a string from system clipboard. + */ + virtual bool pasteTextFromClipboard(ucstring &text); + + void createIM(); + void closeIM(); + +private: + + // Private internal server message + class CUnixEventServer : CEventServer + { + friend class CUnixEventEmitter; + public: + void setServer (CEventServer *server) + { + _Server=server; + } + private: + virtual bool pumpEvent(CEvent* event) + { + CEventServer::pumpEvent(event); + _Server->postEvent (event); + return false; + } + private: + CEventServer *_Server; + }; + + Display* _dpy; + Window _win; + std::map _PressedKeys; + XIM _im; + XIC _ic; + bool _emulateRawMode; + NL3D::IDriver* _driver; + CUnixEventServer _InternalServer; + ucstring _CopiedString; + bool _SelectionOwned; +}; + + +} // NLMISC + +#endif // defined(NL_OS_UNIX) && !defined(NL_OS_MAC) + +#endif // NL_UNIX_EVENT_EMITTER_H + +/* End of unix_event_emitter.h */