diff --git a/code/CMakeModules/FindCppTest.cmake b/code/CMakeModules/FindCppTest.cmake index 59bd292c7..f5f823f69 100644 --- a/code/CMakeModules/FindCppTest.cmake +++ b/code/CMakeModules/FindCppTest.cmake @@ -21,7 +21,7 @@ FIND_PATH(CPPTEST_INCLUDE_DIR /opt/local/include /opt/csw/include /opt/include - PATH_SUFFIXES cppunit + PATH_SUFFIXES cppunit cpptest ) SET(LIBRARY_NAME_RELEASE cpptest) diff --git a/code/CMakeModules/FindMySQL.cmake b/code/CMakeModules/FindMySQL.cmake index a00e36992..1da6157fa 100644 --- a/code/CMakeModules/FindMySQL.cmake +++ b/code/CMakeModules/FindMySQL.cmake @@ -16,6 +16,7 @@ IF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) FIND_PATH(MYSQL_INCLUDE_DIR mysql.h + PATH_SUFFIXES mysql /usr/include/mysql /usr/local/include/mysql /opt/local/include/mysql5/mysql diff --git a/code/CMakeModules/FindOpenGLES.cmake b/code/CMakeModules/FindOpenGLES.cmake new file mode 100644 index 000000000..35157b95b --- /dev/null +++ b/code/CMakeModules/FindOpenGLES.cmake @@ -0,0 +1,49 @@ +# - Try to find OpenGL ES +# Once done this will define +# +# OPENGLES_FOUND - system has OpenGL ES +# OPENGLES_EGL_FOUND - system has EGL +# OPENGLES_LIBRARIES - Link these to use OpenGL ES and EGL +# +# If you want to use just GL ES you can use these values +# OPENGLES_GLES_LIBRARY - Path to OpenGL ES Library +# OPENGLES_EGL_LIBRARY - Path to EGL Library + +FIND_LIBRARY(OPENGLES_GLES_LIBRARY + NAMES GLESv1_CM libGLESv1_CM gles_cm libgles_cm + PATHS + /usr/local/lib + /usr/lib + /usr/local/X11R6/lib + /usr/X11R6/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + /usr/freeware/lib64 +) + +FIND_LIBRARY(OPENGLES_EGL_LIBRARY + NAMES EGL libEGL + PATHS + /usr/local/lib + /usr/lib + /usr/local/X11R6/lib + /usr/X11R6/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + /usr/freeware/lib64 +) + +IF(OPENGLES_GLES_LIBRARY) + SET(OPENGLES_FOUND "YES") + SET(OPENGLES_LIBRARIES ${OPENGLES_GLES_LIBRARY} ${OPENGLES_LIBRARIES}) + IF(OPENGLES_EGL_LIBRARY) + SET(OPENGLES_EGL_FOUND "YES") + SET(OPENGLES_LIBRARIES ${OPENGLES_EGL_LIBRARY} ${OPENGLES_LIBRARIES}) + ELSE(OPENGLES_EGL_LIBRARY) + SET(OPENGLES_EGL_FOUND "NO") + ENDIF(OPENGLES_EGL_LIBRARY) +ENDIF(OPENGLES_GLES_LIBRARY) diff --git a/code/CMakeModules/GetRevision.cmake b/code/CMakeModules/GetRevision.cmake index d38215aba..52f443d5f 100644 --- a/code/CMakeModules/GetRevision.cmake +++ b/code/CMakeModules/GetRevision.cmake @@ -48,13 +48,15 @@ IF(EXISTS "${ROOT_DIR}/.hg/") IF(MERCURIAL_FOUND) Mercurial_WC_INFO(${ROOT_DIR} ER) SET(REVISION ${ER_WC_REVISION}) + SET(CHANGESET ${ER_WC_CHANGESET}) + SET(BRANCH ${ER_WC_BRANCH}) ENDIF(MERCURIAL_FOUND) ENDIF(EXISTS "${ROOT_DIR}/.hg/") -IF(REVISION) +IF(DEFINED REVISION) IF(EXISTS ${SOURCE_DIR}/revision.h.in) NOW(BUILD_DATE) CONFIGURE_FILE(${SOURCE_DIR}/revision.h.in revision.h.txt) EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy revision.h.txt revision.h) # copy_if_different ENDIF(EXISTS ${SOURCE_DIR}/revision.h.in) -ENDIF(REVISION) +ENDIF(DEFINED REVISION) diff --git a/code/CMakeModules/PCHSupport.cmake b/code/CMakeModules/PCHSupport.cmake index ae5b30ee2..7cd4c6c7d 100644 --- a/code/CMakeModules/PCHSupport.cmake +++ b/code/CMakeModules/PCHSupport.cmake @@ -62,9 +62,8 @@ MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags) LIST(APPEND ${_out_compile_flags} ${_directory_definitions}) LIST(APPEND ${_out_compile_flags} ${CMAKE_CXX_FLAGS}) - # Format definitions and remove duplicates + # Format definitions SEPARATE_ARGUMENTS(${_out_compile_flags}) - LIST(REMOVE_DUPLICATES ${_out_compile_flags}) ENDMACRO(_PCH_GET_COMPILE_FLAGS) MACRO(_PCH_GET_PDB_FILENAME out_filename _target) @@ -98,9 +97,13 @@ MACRO(_PCH_GET_COMPILE_COMMAND out_command _input _inputcpp _output) IF(MSVC) _PCH_GET_PDB_FILENAME(PDB_FILE ${_PCH_current_target}) - SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp\"${_output}\" ${_inputcpp} /c /Fd\"${PDB_FILE}\") + SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp\"${_output}\" ${_inputcpp} /c /Fd\"${PDB_FILE}\") ELSE(MSVC) - SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} -c ${_input}) + SET(HEADER_FORMAT "c++-header") + IF(APPLE) + SET(HEADER_FORMAT "objective-${HEADER_FORMAT}") + ENDIF(APPLE) + SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x ${HEADER_FORMAT} -o ${_output} -c ${_input}) ENDIF(MSVC) ENDMACRO(_PCH_GET_COMPILE_COMMAND) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 1b3377511..84b817752 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -76,9 +76,10 @@ ENDMACRO(NL_TARGET_DRIVER) # Argument: ### MACRO(NL_DEFAULT_PROPS name label) - IF(NOT MSVC10) - SET_TARGET_PROPERTIES(${name} PROPERTIES PROJECT_LABEL ${label}) - ENDIF(NOT MSVC10) + # Note: This is just a workaround for a CMake bug generating VS10 files with a colon in the project name. + # CMake Bug ID: http://www.cmake.org/Bug/view.php?id=11819 + STRING(REGEX REPLACE "\\:" " -" proj_label ${label}) + SET_TARGET_PROPERTIES(${name} PROPERTIES PROJECT_LABEL ${proj_label}) GET_TARGET_PROPERTY(type ${name} TYPE) IF(${type} STREQUAL SHARED_LIBRARY) # Set versions only if target is a shared library @@ -354,7 +355,7 @@ MACRO(NL_SETUP_BUILD) ENDIF(CMAKE_BUILD_TYPE MATCHES "Release") ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug") - SET(HOST_CPU ${CMAKE_SYSTEM_PROCESSOR}) + SET(HOST_CPU ${CMAKE_HOST_SYSTEM_PROCESSOR}) IF(HOST_CPU MATCHES "amd64") SET(HOST_CPU "x86_64") @@ -381,6 +382,16 @@ MACRO(NL_SETUP_BUILD) # DEB_HOST_ARCH_ENDIAN is 'little' or 'big' # DEB_HOST_ARCH_BITS is '32' or '64' + IF(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") + SET(CLANG ON) + MESSAGE(STATUS "Using Clang compiler") + ENDIF(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") + + IF(CMAKE_GENERATOR MATCHES "Xcode") + SET(XCODE ON) + MESSAGE(STATUS "Generating Xcode project") + ENDIF(CMAKE_GENERATOR MATCHES "Xcode") + # If target and host CPU are the same IF("${HOST_CPU}" STREQUAL "${TARGET_CPU}") # x86-compatible CPU @@ -396,8 +407,13 @@ MACRO(NL_SETUP_BUILD) ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8) SET(TARGET_CPU "x86") ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8) + ELSEIF(HOST_CPU MATCHES "arm") + SET(TARGET_CPU "arm") + ELSE(HOST_CPU MATCHES "x86") + SET(TARGET_CPU "unknown") + MESSAGE(STATUS "Unknown architecture: ${HOST_CPU}") ENDIF(HOST_CPU MATCHES "x86") - # TODO: add checks for ARM and PPC + # TODO: add checks for PPC ELSE("${HOST_CPU}" STREQUAL "${TARGET_CPU}") MESSAGE(STATUS "Compiling on ${HOST_CPU} for ${TARGET_CPU}") ENDIF("${HOST_CPU}" STREQUAL "${TARGET_CPU}") @@ -408,6 +424,9 @@ MACRO(NL_SETUP_BUILD) ELSEIF(TARGET_CPU STREQUAL "x86") SET(TARGET_X86 1) SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DHAVE_X86") + ELSEIF(TARGET_CPU STREQUAL "arm") + SET(TARGET_ARM 1) + SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DHAVE_ARM") ENDIF(TARGET_CPU STREQUAL "x86_64") # Fix library paths suffixes for Debian MultiArch @@ -477,13 +496,27 @@ MACRO(NL_SETUP_BUILD) SET(NL_DEBUG_LINKFLAGS "/DEBUG /OPT:NOREF /OPT:NOICF /NODEFAULTLIB:msvcrt /INCREMENTAL:YES ${NL_DEBUG_LINKFLAGS}") SET(NL_RELEASE_LINKFLAGS "/OPT:REF /OPT:ICF /INCREMENTAL:NO ${NL_RELEASE_LINKFLAGS}") ELSE(MSVC) - IF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86") - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -m32 -march=i686") - ENDIF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86") + IF(WIN32) + SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DWIN32 -D_WIN32") + ENDIF(WIN32) - IF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64") - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -m64") - ENDIF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64") + IF(APPLE) + IF(TARGET_CPU STREQUAL "x86") + SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -arch i386") + ENDIF(TARGET_CPU STREQUAL "x86") + + IF(TARGET_CPU STREQUAL "x86_64") + SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -arch x86_64") + ENDIF(TARGET_CPU STREQUAL "x86_64") + ELSE(APPLE) + IF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86") + SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -m32 -march=i686") + ENDIF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86") + + IF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64") + SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -m64") + ENDIF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64") + ENDIF(APPLE) SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -D_REENTRANT -pipe -ftemplate-depth-48 -Wall -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused -fno-strict-aliasing") @@ -499,6 +532,41 @@ MACRO(NL_SETUP_BUILD) SET(PLATFORM_CFLAGS "-gdwarf-2 ${PLATFORM_CFLAGS}") ENDIF(APPLE) + IF(APPLE AND XCODE) + SET(CMAKE_OSX_SYSROOT "macosx" CACHE PATH "" FORCE) + ELSEIF(APPLE AND NOT XCODE) + IF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) + SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6") + ENDIF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) + + FOREACH(_SDK ${_CMAKE_OSX_SDKS}) + IF(${_SDK} MATCHES "MacOSX${CMAKE_OSX_DEPLOYMENT_TARGET}\\.sdk") + SET(CMAKE_OSX_SYSROOT ${_SDK} CACHE PATH "" FORCE) + ENDIF(${_SDK} MATCHES "MacOSX${CMAKE_OSX_DEPLOYMENT_TARGET}\\.sdk") + ENDFOREACH(_SDK) + + IF(CMAKE_OSX_SYSROOT) + SET(PLATFORM_CFLAGS "-isysroot ${CMAKE_OSX_SYSROOT} ${PLATFORM_CFLAGS}") + ELSE(CMAKE_OSX_SYSROOT) + MESSAGE(FATAL_ERROR "CMAKE_OSX_SYSROOT can't be determinated") + ENDIF(CMAKE_OSX_SYSROOT) + + IF(CMAKE_OSX_ARCHITECTURES) + FOREACH(_ARCH ${CMAKE_OSX_ARCHITECTURES}) + SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -arch ${_ARCH}") + ENDFOREACH(_ARCH) + ENDIF(CMAKE_OSX_ARCHITECTURES) + IF(CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG) + SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}") + ENDIF(CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG) + + SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-headerpad_max_install_names") + + IF(HAVE_FLAG_SEARCH_PATHS_FIRST) + SET(PLATFORM_LINKFLAGS "-Wl,-search_paths_first ${PLATFORM_LINKFLAGS}") + ENDIF(HAVE_FLAG_SEARCH_PATHS_FIRST) + ENDIF(APPLE AND XCODE) + # Fix "relocation R_X86_64_32 against.." error on x64 platforms IF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS) SET(PLATFORM_CFLAGS "-fPIC ${PLATFORM_CFLAGS}") @@ -513,12 +581,14 @@ MACRO(NL_SETUP_BUILD) IF(WITH_SYMBOLS) SET(NL_RELEASE_CFLAGS "${NL_RELEASE_CFLAGS} -g") ELSE(WITH_SYMBOLS) - IF(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") + IF(APPLE) + SET(NL_RELEASE_LINKFLAGS "-Wl,-dead_strip -Wl,-x ${NL_RELEASE_LINKFLAGS}") + ELSE(APPLE) SET(NL_RELEASE_LINKFLAGS "-Wl,-s ${NL_RELEASE_LINKFLAGS}") - ENDIF(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") + ENDIF(APPLE) ENDIF(WITH_SYMBOLS) - SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -D_DEBUG ${NL_DEBUG_CFLAGS}") + SET(NL_DEBUG_CFLAGS "-g -DNL_DEBUG -D_DEBUG ${NL_DEBUG_CFLAGS}") SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O3 ${NL_RELEASE_CFLAGS}") ENDIF(MSVC) ENDMACRO(NL_SETUP_BUILD) @@ -709,7 +779,7 @@ MACRO(SETUP_EXTERNAL) ELSE(WIN32) IF(APPLE) IF(WITH_STATIC_EXTERNAL) - SET(CMAKE_FIND_LIBRARY_SUFFIXES .a .dylib .so) + SET(CMAKE_FIND_LIBRARY_SUFFIXES .a) ELSE(WITH_STATIC_EXTERNAL) SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so .a) ENDIF(WITH_STATIC_EXTERNAL) diff --git a/code/README b/code/README index 4f1b1d51b..6a5d7ffad 100644 --- a/code/README +++ b/code/README @@ -19,7 +19,7 @@ environments. License ------- -Ryzom Core is a Free Software project under the GNU Affero General Public License, +Ryzom Core is a Free Software project under the GNU Affero General Public License v3, which means all its code is available for everyone to download, examine, use, modify, and distribute, subject to the usual restrictions attached to any GPL software. If you are not familiar with the AGPL, see the COPYING diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 57f7edd44..f71bb7826 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -18,19 +18,6 @@ ENDIF(WIN32) IF(WITH_3D) FIND_PACKAGE(FreeType) - IF(WITH_DRIVER_OPENGL) - FIND_PACKAGE(OpenGL) - 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) - ENDIF(WITH_DRIVER_OPENGL) - IF(WITH_NEL_CEGUI) FIND_PACKAGE(CEGUI) ENDIF(WITH_NEL_CEGUI) diff --git a/code/nel/include/nel/3d/cluster.h b/code/nel/include/nel/3d/cluster.h index 07ccc7d7e..e8364ccb0 100644 --- a/code/nel/include/nel/3d/cluster.h +++ b/code/nel/include/nel/3d/cluster.h @@ -21,6 +21,7 @@ #include "nel/misc/string_mapper.h" #include "nel/misc/plane.h" #include "nel/misc/aabbox.h" +#include "nel/misc/sheet_id.h" #include "nel/3d/transform.h" @@ -125,9 +126,9 @@ public: //\name Sound related. //@{ void setSoundGroup(const std::string &soundGroup); - void setSoundGroup(const NLMISC::TStringId &soundGroupId); + void setSoundGroup(const NLMISC::CSheetId &soundGroupId); const std::string &getSoundGroup(); - NLMISC::TStringId getSoundGroupId(); + NLMISC::CSheetId getSoundGroupId(); void setEnvironmentFx(const std::string &environmentFx); void setEnvironmentFx(const NLMISC::TStringId &environmentFxId); const std::string &getEnvironmentFx(); @@ -188,7 +189,7 @@ private: std::vector _Volume; /// Sound group name id - NLMISC::TStringId _SoundGroupId; + NLMISC::CSheetId _SoundGroupId; /// Environement Fx name Id (using CStringMapper) NLMISC::TStringId _EnvironmentFxId; diff --git a/code/nel/include/nel/3d/driver_user.h b/code/nel/include/nel/3d/driver_user.h index 81016186f..cc23ccf78 100644 --- a/code/nel/include/nel/3d/driver_user.h +++ b/code/nel/include/nel/3d/driver_user.h @@ -123,7 +123,7 @@ public: /// \name Object // @{ - CDriverUser (uint windowIcon = 0, bool direct3d = false, emptyProc exitFunc = 0); + CDriverUser (uint windowIcon, UDriver::TDriver driver, emptyProc exitFunc = 0); virtual ~CDriverUser(); // @} diff --git a/code/nel/include/nel/3d/dru.h b/code/nel/include/nel/3d/dru.h index d0012deaf..463d6b5db 100644 --- a/code/nel/include/nel/3d/dru.h +++ b/code/nel/include/nel/3d/dru.h @@ -27,9 +27,11 @@ #ifdef NL_OS_WINDOWS # define NL3D_GL_DLL_NAME "nel_drv_opengl_win" +# define NL3D_GLES_DLL_NAME "nel_drv_opengles_win" # define NL3D_D3D_DLL_NAME "nel_drv_direct3d_win" #elif defined (NL_OS_UNIX) # define NL3D_GL_DLL_NAME "nel_drv_opengl" +# define NL3D_GLES_DLL_NAME "nel_drv_opengles" #else # error "Unknown system" #endif @@ -43,6 +45,7 @@ struct EDru : public NLMISC::Exception EDru(const std::string &reason) : Exception(reason) {} }; +// OpenGL struct EDruOpenglDriverNotFound : public EDru { EDruOpenglDriverNotFound() : EDru( NL3D_GL_DLL_NAME " not found" ) {} @@ -68,7 +71,34 @@ struct EDruOpenglDriverCantCreateDriver : public EDru EDruOpenglDriverCantCreateDriver() : EDru( NL3D_GL_DLL_NAME " can't create driver" ) {} }; +// OpenGL ES +struct EDruOpenglEsDriverNotFound : public EDru +{ + EDruOpenglEsDriverNotFound() : EDru( NL3D_GLES_DLL_NAME " not found" ) {} +}; + +struct EDruOpenglEsDriverCorrupted : public EDru +{ + EDruOpenglEsDriverCorrupted() : EDru( "Can't get NL3D_createIDriverInstance from " NL3D_GLES_DLL_NAME " (Bad dll?)" ) {} +}; + +struct EDruOpenglEsDriverOldVersion : public EDru +{ + EDruOpenglEsDriverOldVersion() : EDru( NL3D_GLES_DLL_NAME " is a too old version. Ask for a more recent file" ) {} +}; + +struct EDruOpenglEsDriverUnknownVersion : public EDru +{ + EDruOpenglEsDriverUnknownVersion() : EDru( NL3D_GLES_DLL_NAME " is more recent than the application" ) {} +}; + +struct EDruOpenglEsDriverCantCreateDriver : public EDru +{ + EDruOpenglEsDriverCantCreateDriver() : EDru( NL3D_GLES_DLL_NAME " can't create driver" ) {} +}; + #ifdef NL_OS_WINDOWS +// Direct3D struct EDruDirect3dDriverNotFound : public EDru { EDruDirect3dDriverNotFound() : EDru( NL3D_D3D_DLL_NAME " not found" ) {} @@ -103,6 +133,9 @@ public: /// Portable Function which create a GL Driver (using gl dll...). static IDriver *createGlDriver() throw(EDru); + /// Portable Function which create a GL ES Driver (using gl dll...). + static IDriver *createGlEsDriver() throw(EDru); + #ifdef NL_OS_WINDOWS /// Windows Function which create a Direct3d Driver. static IDriver *createD3DDriver() throw(EDru); diff --git a/code/nel/include/nel/3d/ps_sound.h b/code/nel/include/nel/3d/ps_sound.h index fe15eb302..c1d6583b8 100644 --- a/code/nel/include/nel/3d/ps_sound.h +++ b/code/nel/include/nel/3d/ps_sound.h @@ -21,6 +21,7 @@ #include "nel/misc/string_mapper.h" #include "nel/3d/ps_located.h" #include "nel/3d/ps_attrib.h" +#include "nel/misc/sheet_id.h" @@ -63,13 +64,13 @@ public: virtual void step(TPSProcessPass pass); /// set the name of the sound - void setSoundName(const NLMISC::TStringId &soundName) + void setSoundName(const NLMISC::CSheetId &soundName) { _SoundName = soundName; } /// get the name of the sound - const NLMISC::TStringId &getSoundName(void) const + const NLMISC::CSheetId &getSoundName(void) const { return _SoundName; } @@ -161,7 +162,7 @@ protected: void removeAllSources(); CPSAttrib _Sounds; - NLMISC::TStringId _SoundName; + NLMISC::CSheetId _SoundName; float _Gain; CPSAttribMaker * _GainScheme; float _Pitch; diff --git a/code/nel/include/nel/3d/u_driver.h b/code/nel/include/nel/3d/u_driver.h index 3c120737d..025c134ed 100644 --- a/code/nel/include/nel/3d/u_driver.h +++ b/code/nel/include/nel/3d/u_driver.h @@ -139,6 +139,9 @@ public: enum TStencilOp { keep = 0, zero, replace, incr, decr, invert }; enum TStencilFunc { never = 0, less, lessequal, equal, notequal, greaterequal, greater, always}; + // Existing drivers + enum TDriver { Direct3d = 0, OpenGl, OpenGlEs }; + public: /// The EventServer of this driver. Init after setDisplay()!! NLMISC::CEventServer EventServer; @@ -844,6 +847,7 @@ public: * This is the static function which build a UDriver, the root for all 3D functions. */ static UDriver *createDriver(uint windowIcon = 0, bool direct3d = false, emptyProc exitFunc = 0); + static UDriver *createDriver(uint windowIcon, TDriver driver, emptyProc exitFunc = 0); /** * Purge static memory diff --git a/code/nel/include/nel/3d/u_ps_sound_impl.h b/code/nel/include/nel/3d/u_ps_sound_impl.h index 469bc913a..4e3a3571b 100644 --- a/code/nel/include/nel/3d/u_ps_sound_impl.h +++ b/code/nel/include/nel/3d/u_ps_sound_impl.h @@ -162,7 +162,7 @@ public: /// inherited from IPSSoundServer - UPSSoundInstance *createSound(const NLMISC::TStringId &soundName, bool spawned = true) + UPSSoundInstance *createSound(const NLMISC::CSheetId &soundName, bool spawned = true) { if (!_AudioMixer) return NULL; diff --git a/code/nel/include/nel/3d/u_ps_sound_interface.h b/code/nel/include/nel/3d/u_ps_sound_interface.h index 5c40d8727..693350f78 100644 --- a/code/nel/include/nel/3d/u_ps_sound_interface.h +++ b/code/nel/include/nel/3d/u_ps_sound_interface.h @@ -19,6 +19,7 @@ #include "nel/misc/types_nl.h" #include "nel/misc/string_mapper.h" +#include "nel/misc/sheet_id.h" #include namespace NLMISC @@ -50,7 +51,7 @@ struct UPSSoundServer * \param spawn true if the sound must be spawned e.g it continues after this interface is removed * \param cb useful only for spawned sound, it tells when a spawned sound has been removed */ - virtual UPSSoundInstance *createSound(const NLMISC::TStringId &soundName, bool spawn = false) = 0; + virtual UPSSoundInstance *createSound(const NLMISC::CSheetId &soundName, bool spawn = false) = 0; }; diff --git a/code/nel/include/nel/misc/bit_mem_stream.h b/code/nel/include/nel/misc/bit_mem_stream.h index 3bddc20f7..b294d5454 100644 --- a/code/nel/include/nel/misc/bit_mem_stream.h +++ b/code/nel/include/nel/misc/bit_mem_stream.h @@ -394,7 +394,7 @@ public: * If you are using the stream only in output mode, you can use this method as a faster version * of clear() *if you don't serialize pointers*. */ - void resetBufPos() + virtual void resetBufPos() { // This is ensured in CMemStream::CMemStream() and CMemStream::clear() //if ( (!isReading()) && _Buffer.empty() ) @@ -477,7 +477,7 @@ public: } /// See doc in CMemStream::bufferToFill() - uint8 *bufferToFill( uint32 msgsize ) + virtual uint8 *bufferToFill( uint32 msgsize ) { _FreeBits = 8; _DbgInfo.clear(); @@ -654,7 +654,7 @@ public: virtual void serial(ucstring &b); virtual void serial(CBitMemStream &b) { serialMemStream(b); } - virtual void serialMemStream(CBitMemStream &b); + virtual void serialMemStream(CMemStream &b); //@} diff --git a/code/nel/include/nel/misc/dynloadlib.h b/code/nel/include/nel/misc/dynloadlib.h index 6f74702b8..1cec2573a 100644 --- a/code/nel/include/nel/misc/dynloadlib.h +++ b/code/nel/include/nel/misc/dynloadlib.h @@ -22,8 +22,9 @@ #include #ifdef NL_OS_WINDOWS -# define NOMINMAX -# include +struct HINSTANCE__; +typedef struct HINSTANCE__ *HINSTANCE; +typedef HINSTANCE HMODULE; /* HMODULEs can be used in place of HINSTANCEs */ #else # include #endif diff --git a/code/nel/include/nel/misc/entity_id.h b/code/nel/include/nel/misc/entity_id.h index 4ca446941..96b8db223 100644 --- a/code/nel/include/nel/misc/entity_id.h +++ b/code/nel/include/nel/misc/entity_id.h @@ -470,12 +470,12 @@ public: /// return a string in form "(a:b:c:d)" where a,b,c,d are components of entity id. std::string toString() const { - std::string id; - id.reserve(25); - id+='('; - getDebugString (id); - id+=')'; - return id; + std::string ident; + ident.reserve(25); + ident+='('; + getDebugString (ident); + ident+=')'; + return ident; } /// Read from a debug string, use the same format as toString() (id:type:creator:dynamic) in hexadecimal diff --git a/code/nel/include/nel/misc/fast_floor.h b/code/nel/include/nel/misc/fast_floor.h index 421364ad1..203e8c9b0 100644 --- a/code/nel/include/nel/misc/fast_floor.h +++ b/code/nel/include/nel/misc/fast_floor.h @@ -29,7 +29,7 @@ extern int *OptFastFloorCWStackPtr; extern int *OptFastFloorCWStackEnd; // fastFloor function. -#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) +#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) && defined(NL_USE_FASTFLOOR) #include diff --git a/code/nel/include/nel/misc/fast_id_map.h b/code/nel/include/nel/misc/fast_id_map.h index dbd05bc76..bccec051b 100644 --- a/code/nel/include/nel/misc/fast_id_map.h +++ b/code/nel/include/nel/misc/fast_id_map.h @@ -94,7 +94,7 @@ public: // size of used elements must be equal to the vector size minus one, when everything is allocated nlassert((m_Ids.size() - 1) == m_Size); - idx = m_Ids.size(); + idx = (uint16)m_Ids.size(); uint16 verification = rand(); m_Ids.push_back(CIdInfo(verification, m_Next, value)); m_Next = idx; diff --git a/code/nel/include/nel/misc/mem_stream.h b/code/nel/include/nel/misc/mem_stream.h index 2102129dd..1da99a48d 100644 --- a/code/nel/include/nel/misc/mem_stream.h +++ b/code/nel/include/nel/misc/mem_stream.h @@ -301,7 +301,7 @@ public: * If you are using the stream only in output mode, you can use this method as a faster version * of clear() *if you don't serialize pointers*. */ - void resetBufPos() { _Buffer.Pos = 0; } + virtual void resetBufPos() { _Buffer.Pos = 0; } /** * Resize the message buffer and fill data at position 0. @@ -340,7 +340,7 @@ public: * fill it with raw data using any filling function (warning: don't fill more than 'msgsize' * bytes!), then you are ready to read, using serial(), the data you've just filled. */ - uint8 *bufferToFill( uint32 msgsize ) + virtual uint8 *bufferToFill( uint32 msgsize ) { #ifdef NL_DEBUG nlassert( isReading() ); diff --git a/code/nel/include/nel/net/service.h b/code/nel/include/nel/net/service.h index 316a9ce0f..6097a535f 100644 --- a/code/nel/include/nel/net/service.h +++ b/code/nel/include/nel/net/service.h @@ -42,6 +42,20 @@ namespace NLMISC class CWindowDisplayer; } +#if defined(NL_OS_WINDOWS) && defined(_WINDOWS) +#ifndef WINAPI +#define WINAPI __stdcall +#endif +#ifndef APIENTRY +#define APIENTRY WINAPI +#endif + +struct HINSTANCE__; +typedef struct HINSTANCE__ *HINSTANCE; + +typedef char CHAR; +typedef CHAR *LPSTR; +#endif namespace NLNET { diff --git a/code/nel/include/nel/sound/audio_mixer_user.h b/code/nel/include/nel/sound/audio_mixer_user.h index 1316fe34a..a68eae065 100644 --- a/code/nel/include/nel/sound/audio_mixer_user.h +++ b/code/nel/include/nel/sound/audio_mixer_user.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -180,7 +181,7 @@ public: // Load environment sounds ; treeRoot can be null if you don't want an access to the envsounds // virtual void loadEnvSounds( const char *filename, UEnvSound **treeRoot=NULL ); /// Get a TSoundId from a name (returns NULL if not found) - virtual TSoundId getSoundId( const NLMISC::TStringId &name ); + virtual TSoundId getSoundId( const NLMISC::CSheetId &name ); /// Gets the group controller for the given group tree path with separator '/', if it doesn't exist yet it will be created. /// Examples: "music", "effects", "dialog", "music/background", "music/loading", "music/player", etcetera @@ -192,7 +193,7 @@ public: * pass a callback function that will be called (if not NULL) just before deleting the spawned * source. */ - virtual USource *createSource( const NLMISC::TStringId &name, bool spawn=false, TSpawnEndCallback cb=NULL, void *cbUserParam = NULL, NL3D::CCluster *cluster = 0, CSoundContext *context = 0, UGroupController *groupController = NULL); + virtual USource *createSource( const NLMISC::CSheetId &name, bool spawn=false, TSpawnEndCallback cb=NULL, void *cbUserParam = NULL, NL3D::CCluster *cluster = 0, CSoundContext *context = 0, UGroupController *groupController = NULL); /// Add a logical sound source (by sound id). To remove a source, just delete it. See createSource(const char*) virtual USource *createSource( TSoundId id, bool spawn=false, TSpawnEndCallback cb=NULL, void *cbUserParam = NULL, NL3D::CCluster *cluster = 0, CSoundContext *context = 0, UGroupController *groupController = NULL); /// Add a source which was created by an EnvSound @@ -223,13 +224,15 @@ public: /// Return the names of the sounds (call this method after loadSounds()) - virtual void getSoundNames( std::vector &names ) const; + virtual void getSoundNames( std::vector &names ) const; /// Return the number of mixing tracks (voices) virtual uint getPolyphony() const { return (uint)_Tracks.size(); } /// Return the number of sources instance. virtual uint getSourcesInstanceCount() const { return (uint)_Sources.size(); } /// Return the number of playing sources (slow) virtual uint getPlayingSourcesCount() const; + uint countPlayingSimpleSources() const; // debug + uint countSimpleSources() const; // debug /// Return the number of available tracks virtual uint getAvailableTracksCount() const; /// Return the number of used tracks @@ -442,7 +445,7 @@ private: /// Witch parameter to control TControledParamId ParamId; /// The controled sounds names. - std::vector SoundNames; + std::vector SoundNames; /// Current parameter value float Value; /// All the sources controled by this variable diff --git a/code/nel/include/nel/sound/background_sound.h b/code/nel/include/nel/sound/background_sound.h index c8e4cc147..24b1c079b 100644 --- a/code/nel/include/nel/sound/background_sound.h +++ b/code/nel/include/nel/sound/background_sound.h @@ -64,7 +64,7 @@ public: /// Associtation clas for storage of sound / filter. struct TSoundInfo { - NLMISC::TStringId SoundName; + NLMISC::CSheetId SoundName; UAudioMixer::TBackgroundFlags Filter; void serial(NLMISC::IStream &s) @@ -73,11 +73,11 @@ public: if (s.isReading()) { s.serial(soundName); - SoundName = NLMISC::CStringMapper::map(soundName); + SoundName = NLMISC::CSheetId(soundName);/*NLMISC::CStringMapper::map(soundName)*/; } else { - soundName = NLMISC::CStringMapper::unmap(SoundName); + soundName = SoundName.toString();/* NLMISC::CStringMapper::unmap(SoundName)*/; s.serial(soundName); } s.serial(Filter); diff --git a/code/nel/include/nel/sound/background_sound_manager.h b/code/nel/include/nel/sound/background_sound_manager.h index 5281e980b..b1405634c 100644 --- a/code/nel/include/nel/sound/background_sound_manager.h +++ b/code/nel/include/nel/sound/background_sound_manager.h @@ -229,7 +229,7 @@ private: struct TSoundData { /// The name of the sound. - NLMISC::TStringId SoundName; + NLMISC::CSheetId SoundName; /// The reference to the sound. CSound *Sound; /// A source instance of the sound (may be NULL). diff --git a/code/nel/include/nel/sound/clustered_sound.h b/code/nel/include/nel/sound/clustered_sound.h index 6a750a724..4e488dcc6 100644 --- a/code/nel/include/nel/sound/clustered_sound.h +++ b/code/nel/include/nel/sound/clustered_sound.h @@ -249,11 +249,12 @@ private: /// The segment of all the audio path. std::vector > _AudioPath; - typedef CHashMap TClusterSoundCont; + typedef CHashMap TClusterSoundCont; /// The current cluster playing source indexed with sound group id TClusterSoundCont _Sources; - typedef CHashMap TStringStringMap; + typedef CHashMap TStringStringMap; + //typedef CHashMap TStringStringMap; /// The sound_group to sound assoc TStringStringMap _SoundGroupToSound; }; diff --git a/code/nel/include/nel/sound/complex_sound.h b/code/nel/include/nel/sound/complex_sound.h index 6b15b7200..55552259a 100644 --- a/code/nel/include/nel/sound/complex_sound.h +++ b/code/nel/include/nel/sound/complex_sound.h @@ -52,8 +52,8 @@ public: const std::vector &getSoundSeq() const { return _SoundSeq;} const std::vector &getDelaySeq() const { return _DelaySeq;} - NLMISC::TStringId getSound(uint index) const { return !_Sounds.empty() ? _Sounds[index%_Sounds.size()]:0;} - const std::vector &getSounds() const { return _Sounds;} + NLMISC::CSheetId getSound(uint index) const { return !_Sounds.empty() ? _Sounds[index%_Sounds.size()]:NLMISC::CSheetId::Unknown;} + const std::vector &getSounds() const { return _Sounds;} uint32 getFadeLength() const { return _XFadeLength;} @@ -87,7 +87,7 @@ private: virtual float getMaxDistance() const; TPATTERN_MODE _PatternMode; - std::vector _Sounds; + std::vector _Sounds; float _TicksPerSeconds; std::vector _SoundSeq; /// Sequence of delay in millisec. diff --git a/code/nel/include/nel/sound/context_sound.h b/code/nel/include/nel/sound/context_sound.h index 09932ca66..aed2fd2f5 100644 --- a/code/nel/include/nel/sound/context_sound.h +++ b/code/nel/include/nel/sound/context_sound.h @@ -133,7 +133,7 @@ class CContextSoundContainer : public IContextSoundContainer virtual void addSound(CSound *sound, const std::string &baseName) { - const std::string &patternName = NLMISC::CStringMapper::unmap(sound->getName()); + const std::string &patternName = sound->getName().toString(); /*NLMISC::CStringMapper::unmap(sound->getName())*/; nlassert(patternName.size() >= baseName.size()); std::string arg; @@ -172,7 +172,7 @@ class CContextSoundContainer : public IContextSoundContainer if (i != NbJoker) return; - nlassertex(i==NbJoker, ("Error while adding sound '%s' into context sound container", NLMISC::CStringMapper::unmap(sound->getName()).c_str())); + nlassertex(i==NbJoker, ("Error while adding sound '%s' into context sound container", sound->getName().toString().c_str()/*NLMISC::CStringMapper::unmap(sound->getName()).c_str()*/)); sint randomValue = 0; if (UseRandom) @@ -187,7 +187,7 @@ class CContextSoundContainer : public IContextSoundContainer } else if (!arg.empty()) { - nlassertex (!ok, ("Error while adding sound '%s' into context sound container", NLMISC::CStringMapper::unmap(sound->getName()).c_str())); + nlassertex (!ok, ("Error while adding sound '%s' into context sound container", sound->getName().toString().c_str()/*NLMISC::CStringMapper::unmap(sound->getName()).c_str()*/)); // end of the argument. NLMISC::fromString(arg, randomValue); arg.clear(); @@ -199,13 +199,13 @@ class CContextSoundContainer : public IContextSoundContainer // read the potential last arg. if (!arg.empty()) { - nlassertex (!ok, ("Error while adding sound '%s' into context sound container", NLMISC::CStringMapper::unmap(sound->getName()).c_str())); + nlassertex (!ok, ("Error while adding sound '%s' into context sound container", sound->getName().toString().c_str()/*NLMISC::CStringMapper::unmap(sound->getName()).c_str()*/)); // end of the argument. NLMISC::fromString(arg, randomValue); arg.clear(); ok = true; } - nlassertex (ok, ("Error while adding sound '%s' into context sound container", NLMISC::CStringMapper::unmap(sound->getName()).c_str())); + nlassertex (ok, ("Error while adding sound '%s' into context sound container", sound->getName().toString().c_str()/*NLMISC::CStringMapper::unmap(sound->getName()).c_str()*/)); } else @@ -221,9 +221,9 @@ class CContextSoundContainer : public IContextSoundContainer if (!ret.second) { typename THashContextSound::iterator it = _ContextSounds.find(cm); - nlassertex(it != _ContextSounds.end(), ("Error wile adding soudn '%s' into context sound container", NLMISC::CStringMapper::unmap(sound->getName()).c_str())); + nlassertex(it != _ContextSounds.end(), ("Error wile adding soudn '%s' into context sound container", sound->getName().toString().c_str()/*NLMISC::CStringMapper::unmap(sound->getName()).c_str()*/)); - nlwarning("Sound %s has the same context matcher as the sound %s", NLMISC::CStringMapper::unmap(sound->getName()).c_str(), NLMISC::CStringMapper::unmap(it->second->getName()).c_str()); + nlwarning("Sound %s has the same context matcher as the sound %s", sound->getName().toString().c_str()/*NLMISC::CStringMapper::unmap(sound->getName()).c_str()*/, it->second->getName().toString().c_str() /*NLMISC::CStringMapper::unmap(it->second->getName()).c_str()*/); } } @@ -249,7 +249,7 @@ class CContextSoundContainer : public IContextSoundContainer typename THashContextSound::const_iterator first(_ContextSounds.begin()), last(_ContextSounds.end()); for (; first != last; ++first) { - subsounds.push_back(std::make_pair(NLMISC::CStringMapper::unmap(first->second->getName()), first->second)); + subsounds.push_back(std::make_pair(first->second->getName().toString()/*NLMISC::CStringMapper::unmap(first->second->getName())*/, first->second)); } } diff --git a/code/nel/include/nel/sound/group_controller.h b/code/nel/include/nel/sound/group_controller.h index 08d474129..25b7034b6 100644 --- a/code/nel/include/nel/sound/group_controller.h +++ b/code/nel/include/nel/sound/group_controller.h @@ -57,9 +57,11 @@ public: private: CGroupController *m_Parent; std::map m_Children; - - float m_DevGain; - float m_UserGain; + + /// Gain as set by the interface + float m_Gain; + + /// Gain including parent gain float m_FinalGain; int m_NbSourcesInclChild; @@ -70,27 +72,22 @@ public: /// \name UGroupController //@{ - virtual void setDevGain(float gain) { NLMISC::clamp(gain, 0.0f, 1.0f); m_DevGain = gain; updateSourceGain(); } - virtual float getDevGain() { return m_DevGain; } - - virtual void setUserGain(float gain) { NLMISC::clamp(gain, 0.0f, 1.0f); m_UserGain = gain; updateSourceGain(); } - virtual float getUserGain() { return m_UserGain; } - - virtual void setGain(float devGain, float userGain) { NLMISC::clamp(devGain, 0.0f, 1.0f); NLMISC::clamp(userGain, 0.0f, 1.0f); m_DevGain = devGain; m_UserGain = userGain; updateSourceGain(); } + virtual void setGain(float gain) { NLMISC::clamp(gain, 0.0f, 1.0f); if (m_Gain != gain) { m_Gain = gain; updateSourceGain(); } } + virtual float getGain() { return m_Gain; } //@} - + inline float getFinalGain() const { return m_FinalGain; } - + void addSource(CSourceCommon *source); void removeSource(CSourceCommon *source); - + virtual std::string getPath(); - + protected: virtual ~CGroupController(); // subnodes can only be deleted by the root private: - inline float calculateTotalGain() { return m_DevGain * m_UserGain; } + inline float calculateTotalGain() { return m_Gain; } virtual void calculateFinalGain(); virtual void increaseSources(); virtual void decreaseSources(); diff --git a/code/nel/include/nel/sound/group_controller_root.h b/code/nel/include/nel/sound/group_controller_root.h index 2cc86f5b3..2081fa28a 100644 --- a/code/nel/include/nel/sound/group_controller_root.h +++ b/code/nel/include/nel/sound/group_controller_root.h @@ -59,6 +59,7 @@ protected: virtual void calculateFinalGain(); virtual void increaseSources(); virtual void decreaseSources(); + static bool isReservedName(const std::string &nodeName); }; /* class CGroupControllerRoot */ diff --git a/code/nel/include/nel/sound/sound.h b/code/nel/include/nel/sound/sound.h index e9d4f755c..d50266e3f 100644 --- a/code/nel/include/nel/sound/sound.h +++ b/code/nel/include/nel/sound/sound.h @@ -22,6 +22,7 @@ #include "nel/misc/string_mapper.h" #include "nel/sound/u_source.h" #include "nel/georges/u_form_elm.h" +#include "nel/misc/sheet_id.h" #include namespace NLSOUND { @@ -35,7 +36,7 @@ class CGroupController; /// Sound names hash map //typedef std::hash_map TSoundMap; -typedef CHashMap TSoundMap; +typedef CHashMap TSoundMap; /// Sound names set (for ambiant sounds) typedef std::set TSoundSet; @@ -99,7 +100,7 @@ public: /// Return the length of the sound in ms virtual uint32 getDuration() = 0; /// Return the name (must be unique) - const NLMISC::TStringId& getName() const { return _Name; } + const NLMISC::CSheetId& getName() const { return _Name; } /// Return the min distance (if detailed()) (default 1.0f if not implemented by sound type) virtual float getMinDistance() const { return _MinDist; } @@ -121,7 +122,8 @@ public: bool operator<( const CSound& otherSound ) const { - return NLMISC::CStringMapper::unmap(_Name) < NLMISC::CStringMapper::unmap(otherSound._Name); + //return NLMISC::CStringMapper::unmap(_Name) < NLMISC::CStringMapper::unmap(otherSound._Name); + return _Name.toString() < otherSound._Name.toString(); } protected: @@ -142,7 +144,7 @@ protected: float _MaxDist; // Sound name. - NLMISC::TStringId _Name; + NLMISC::CSheetId _Name; /// An optional user var controler. NLMISC::TStringId _UserVarControler; diff --git a/code/nel/include/nel/sound/sound_anim_marker.h b/code/nel/include/nel/sound/sound_anim_marker.h index 53ebd3fa0..12c841df0 100644 --- a/code/nel/include/nel/sound/sound_anim_marker.h +++ b/code/nel/include/nel/sound/sound_anim_marker.h @@ -20,6 +20,7 @@ #include "nel/misc/string_mapper.h" #include "nel/3d/cluster.h" #include "nel/sound/u_source.h" +#include "nel/misc/sheet_id.h" namespace NLMISC @@ -31,7 +32,7 @@ namespace NLMISC namespace NLSOUND { -typedef std::set TMarkerSoundSet; +typedef std::set TMarkerSoundSet; class UAudioMixer; @@ -50,13 +51,13 @@ public: virtual float getTime() const { return _Time; } /** Add a new sound in the set of to-be-played sounds for this marker */ - virtual void addSound(const NLMISC::TStringId &soundName); + virtual void addSound(const NLMISC::CSheetId &soundName); /** Remove a sound */ - virtual void removeSound(const NLMISC::TStringId &soundName); + virtual void removeSound(const NLMISC::CSheetId &soundName); /** Return the set of sounds of this marker */ - virtual void getSounds(std::vector &sounds); + virtual void getSounds(std::vector &sounds); /** Play all the sounds of this marker */ virtual void play(UAudioMixer* mixer, NL3D::CCluster *cluster, CSoundContext &context); diff --git a/code/nel/include/nel/sound/sound_bank.h b/code/nel/include/nel/sound/sound_bank.h index 9e28d3adc..d7cdf90d0 100644 --- a/code/nel/include/nel/sound/sound_bank.h +++ b/code/nel/include/nel/sound/sound_bank.h @@ -20,6 +20,7 @@ #include "nel/misc/types_nl.h" #include "nel/misc/string_mapper.h" #include "nel/sound/audio_mixer_user.h" +#include "nel/misc/sheet_id.h" #include namespace NLSOUND { @@ -67,16 +68,16 @@ public: bool isLoaded(); /// Return a sound corresponding to a name. - CSound *getSound(const NLMISC::TStringId &name); + CSound *getSound(const NLMISC::CSheetId &name); /// Return the names of the sounds - void getNames( std::vector &names ); + void getNames( std::vector &names ); /// Return the number of sounds in this bank. uint countSounds(); void addSound(CSound *sound); - void removeSound(const NLMISC::TStringId &name); + void removeSound(const NLMISC::CSheetId &name); private: @@ -88,7 +89,7 @@ private: typedef CHashMap TBufferAssocContainer; /// Sound names hash map // typedef std::hash_map TSoundTable; - typedef CHashMap TSoundTable; + typedef CHashMap TSoundTable; /// Assoc from buffer to sound. Used for sound unloading. TBufferAssocContainer _BufferAssoc; diff --git a/code/nel/include/nel/sound/source_common.h b/code/nel/include/nel/sound/source_common.h index 1180fd68e..4cc633957 100644 --- a/code/nel/include/nel/sound/source_common.h +++ b/code/nel/include/nel/sound/source_common.h @@ -23,6 +23,7 @@ #include "nel/3d/cluster.h" #include "nel/sound/sound.h" #include "nel/sound/group_controller.h" +#include "nel/misc/sheet_id.h" namespace NLSOUND { diff --git a/code/nel/include/nel/sound/u_audio_mixer.h b/code/nel/include/nel/sound/u_audio_mixer.h index c4702c3f8..142ce7475 100644 --- a/code/nel/include/nel/sound/u_audio_mixer.h +++ b/code/nel/include/nel/sound/u_audio_mixer.h @@ -19,6 +19,7 @@ #include "nel/misc/types_nl.h" #include "nel/misc/string_mapper.h" +#include "nel/misc/sheet_id.h" #include "nel/sound/u_source.h" #include "nel/sound/u_group_controller.h" #include "nel/ligo/primitive.h" @@ -284,7 +285,7 @@ public: //@} /// Get a TSoundId from a name (returns NULL if not found) - virtual TSoundId getSoundId( const NLMISC::TStringId &name ) = 0; + virtual TSoundId getSoundId( const NLMISC::CSheetId &name ) = 0; /// Gets the group controller for the given group tree path with separator '/', if it doesn't exist yet it will be created. /// Examples: "music", "effects", "dialog", "music/background", "music/loading", "music/player", etcetera @@ -296,7 +297,7 @@ public: * pass a callback function that will be called (if not NULL) just before deleting the spawned * source. */ - virtual USource *createSource(const NLMISC::TStringId &name, bool spawn=false, TSpawnEndCallback cb=NULL, void *callbackUserParam = NULL, NL3D::CCluster *cluster = 0, CSoundContext *context = 0, UGroupController *groupController = NULL) = 0; + virtual USource *createSource(const NLMISC::CSheetId &name, bool spawn=false, TSpawnEndCallback cb=NULL, void *callbackUserParam = NULL, NL3D::CCluster *cluster = 0, CSoundContext *context = 0, UGroupController *groupController = NULL) = 0; /// Add a logical sound source (by sound id). To remove a source, just delete it. See createSource(const char*) virtual USource *createSource(TSoundId id, bool spawn=false, TSpawnEndCallback cb=NULL, void *callbackUserParam = NULL, NL3D::CCluster *cluster = 0, CSoundContext *context = 0, UGroupController *groupController = NULL) = 0; @@ -320,7 +321,7 @@ public: //@{ //@name Statistic and utility methods /// Fill a vector with the names of all loaded sounds. - virtual void getSoundNames( std::vector &names ) const = 0; + virtual void getSoundNames( std::vector &names ) const = 0; /// Return the number of mixing tracks (voices) virtual uint getPolyphony() const = 0; /// Return the number of sources diff --git a/code/nel/include/nel/sound/u_group_controller.h b/code/nel/include/nel/sound/u_group_controller.h index 54a28b835..5aadeb25c 100644 --- a/code/nel/include/nel/sound/u_group_controller.h +++ b/code/nel/include/nel/sound/u_group_controller.h @@ -35,9 +35,9 @@ // Project includes -#define NLSOUND_SHEET_V1_DEFAULT_SOUND_GROUP_CONTROLLER "effects" -#define NLSOUND_SHEET_V1_DEFAULT_SOUND_MUSIC_GROUP_CONTROLLER "music" -#define NLSOUND_SHEET_V1_DEFAULT_SOUND_STREAM_GROUP_CONTROLLER "dialog" +#define NLSOUND_SHEET_V1_DEFAULT_SOUND_GROUP_CONTROLLER "sound:effects:game" +#define NLSOUND_SHEET_V1_DEFAULT_SOUND_MUSIC_GROUP_CONTROLLER "sound:music:game" +#define NLSOUND_SHEET_V1_DEFAULT_SOUND_STREAM_GROUP_CONTROLLER "sound:dialog:game" namespace NLSOUND { @@ -50,13 +50,8 @@ namespace NLSOUND { class UGroupController { public: - virtual void setDevGain(float gain) = 0; - virtual float getDevGain() = 0; - - virtual void setUserGain(float gain) = 0; - virtual float getUserGain() = 0; - - virtual void setGain(float devGain, float userGain) = 0; + virtual void setGain(float gain) = 0; + virtual float getGain() = 0; protected: virtual ~UGroupController() { } diff --git a/code/nel/samples/sound/sound_sources/main.cpp b/code/nel/samples/sound/sound_sources/main.cpp index fb6753f63..7dc8ecc9b 100644 --- a/code/nel/samples/sound/sound_sources/main.cpp +++ b/code/nel/samples/sound/sound_sources/main.cpp @@ -100,7 +100,7 @@ USource *OnAddSource( const char *name, float x, float y, float z ) /* * Create a source with sound 'name', and set some of its initial properties, if successful */ - USource *source = AudioMixer->createSource( CStringMapper::map(name) ); + USource *source = AudioMixer->createSource( /*CStringMapper::map(name)*/ CSheetId(name) ); if ( source != NULL ) { source->setPos( CVector(x,y,z) ); diff --git a/code/nel/samples/sound/stream_file/stream_file.cpp b/code/nel/samples/sound/stream_file/stream_file.cpp index 2ace9dc6b..ed052e8b8 100644 --- a/code/nel/samples/sound/stream_file/stream_file.cpp +++ b/code/nel/samples/sound/stream_file/stream_file.cpp @@ -20,8 +20,6 @@ #include #ifdef NL_OS_WINDOWS # include -#else -# include #endif // NeL includes @@ -99,14 +97,14 @@ static void initSample() //NLMISC::CHTimer::startBench(); - s_Source = s_AudioMixer->createSource(CStringMapper::map("stream_file")); + s_Source = s_AudioMixer->createSource(/*CStringMapper::map("stream_file")*/ CSheetId("stream_file")); nlassert(s_Source); s_StreamFileSource = dynamic_cast(s_Source); nlassert(s_StreamFileSource); // s_Source->setSourceRelativeMode(true); // s_Source->setPitch(2.0f); - s_GroupController = s_AudioMixer->getGroupController("dialog"); + s_GroupController = s_AudioMixer->getGroupController("sound:dialog"); } static void runSample() @@ -129,10 +127,10 @@ static void runSample() #endif { case '+': - s_GroupController->setUserGain(s_GroupController->getUserGain() + 0.1f); + s_GroupController->setGain(s_GroupController->getGain() + 0.1f); break; case '-': - s_GroupController->setUserGain(s_GroupController->getUserGain() - 0.1f); + s_GroupController->setGain(s_GroupController->getGain() - 0.1f); break; case 'x': s_Source->stop(); diff --git a/code/nel/samples/sound/stream_ogg_vorbis/stream_ogg_vorbis.cpp b/code/nel/samples/sound/stream_ogg_vorbis/stream_ogg_vorbis.cpp index b3645913c..fabb93c08 100644 --- a/code/nel/samples/sound/stream_ogg_vorbis/stream_ogg_vorbis.cpp +++ b/code/nel/samples/sound/stream_ogg_vorbis/stream_ogg_vorbis.cpp @@ -20,8 +20,6 @@ #include #ifdef NL_OS_WINDOWS # include -#else -# include #endif // NeL includes @@ -89,7 +87,7 @@ static void initSample() //NLMISC::CHTimer::startBench(); - USource *source = s_AudioMixer->createSource(CStringMapper::map("default_stream")); + USource *source = s_AudioMixer->createSource(CSheetId("default_stream")/*CStringMapper::map("default_stream")*/); nlassert(source); s_StreamSource = dynamic_cast(source); nlassert(s_StreamSource); @@ -100,7 +98,7 @@ static void initSample() s_StreamSource->setFormat(s_AudioDecoder->getChannels(), s_AudioDecoder->getBitsPerSample(), (uint32)s_AudioDecoder->getSamplesPerSec()); //s_StreamSource->setPitch(2.0f); - s_GroupController = s_AudioMixer->getGroupController("dialog"); + s_GroupController = s_AudioMixer->getGroupController("sound:dialog"); } //CMutex *s_Mutex = NULL; @@ -154,10 +152,10 @@ static void runSample() #endif { case '+': - s_GroupController->setUserGain(s_GroupController->getUserGain() + 0.1f); + s_GroupController->setGain(s_GroupController->getGain() + 0.1f); break; case '-': - s_GroupController->setUserGain(s_GroupController->getUserGain() - 0.1f); + s_GroupController->setGain(s_GroupController->getGain() - 0.1f); break; default: return; diff --git a/code/nel/src/3d/cluster.cpp b/code/nel/src/3d/cluster.cpp index 823b592ac..1b7ab08d7 100644 --- a/code/nel/src/3d/cluster.cpp +++ b/code/nel/src/3d/cluster.cpp @@ -51,7 +51,9 @@ CCluster::CCluster () // map a no fx string _EnvironmentFxId = CStringMapper::map("no fx"); // map a no soundgroup string - _SoundGroupId = CStringMapper::map(""); + _SoundGroupId = NLMISC::CSheetId::Unknown; /*CStringMapper::map("")*/; + nldebug("SOUNDSHEET: %s", _SoundGroupId.toString().c_str()); + // I am a transform cluster CTransform::setIsCluster(true); @@ -76,18 +78,21 @@ CCluster::~CCluster() void CCluster::setSoundGroup(const std::string &soundGroup) { - _SoundGroupId = CStringMapper::map(soundGroup); + _SoundGroupId = NLMISC::CSheetId(soundGroup);/*CStringMapper::map(soundGroup);*/ + nldebug("SOUNDSHEET: %s", _SoundGroupId.toString().c_str()); + } -void CCluster::setSoundGroup(const NLMISC::TStringId &soundGroupId) +void CCluster::setSoundGroup(const NLMISC::CSheetId &soundGroupId) { _SoundGroupId = soundGroupId; + nldebug("SOUNDSHEET: %s", _SoundGroupId.toString().c_str()); } const std::string &CCluster::getSoundGroup() { - return CStringMapper::unmap(_SoundGroupId); + return _SoundGroupId.toString();/*CStringMapper::unmap(_SoundGroupId)*/; } -NLMISC::TStringId CCluster::getSoundGroupId() +NLMISC::CSheetId CCluster::getSoundGroupId() { return _SoundGroupId; } @@ -304,7 +309,8 @@ void CCluster::serial (NLMISC::IStream&f) std::string envFxName; f.serial(soundGroup); - _SoundGroupId = CStringMapper::map(soundGroup); + _SoundGroupId = NLMISC::CSheetId(soundGroup); /*CStringMapper::map(soundGroup)*/; + nldebug("SOUNDSHEET: %s", _SoundGroupId.toString().c_str()); f.serial(envFxName); if (envFxName == "") @@ -314,7 +320,7 @@ void CCluster::serial (NLMISC::IStream&f) else { // write the sound group - std::string soundGroup = CStringMapper::unmap(_SoundGroupId); + std::string soundGroup = _SoundGroupId.toString();/*CStringMapper::unmap(_SoundGroupId)*/; f.serial(soundGroup); // write the env fx name std::string envFxName = CStringMapper::unmap(_EnvironmentFxId); diff --git a/code/nel/src/3d/driver/CMakeLists.txt b/code/nel/src/3d/driver/CMakeLists.txt index 19920b11d..3ec69bf44 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_OPENGLES) + ADD_SUBDIRECTORY(opengles) +ENDIF(WITH_DRIVER_OPENGLES) + IF(WIN32) IF(WITH_DRIVER_DIRECT3D) ADD_SUBDIRECTORY(direct3d) diff --git a/code/nel/src/3d/driver/opengl/CMakeLists.txt b/code/nel/src/3d/driver/opengl/CMakeLists.txt index d90c7e0b3..2d1f092b5 100644 --- a/code/nel/src/3d/driver/opengl/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengl/CMakeLists.txt @@ -1,3 +1,15 @@ +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) @@ -57,9 +69,9 @@ IF(UNIX AND NOT APPLE) ENDIF(X11_Xcursor_FOUND) ENDIF(UNIX AND NOT APPLE) -IF(NOT APPLE AND WITH_PCH) +IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(${NLDRV_OGL_LIB} ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.h ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.cpp) -ENDIF(NOT APPLE AND WITH_PCH) +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 lib RUNTIME DESTINATION bin COMPONENT drivers3d) diff --git a/code/nel/src/3d/driver/opengl/EGL/egl.h b/code/nel/src/3d/driver/opengl/EGL/egl.h new file mode 100644 index 000000000..99ea342a4 --- /dev/null +++ b/code/nel/src/3d/driver/opengl/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/opengl/EGL/eglext.h b/code/nel/src/3d/driver/opengl/EGL/eglext.h new file mode 100644 index 000000000..0d318b258 --- /dev/null +++ b/code/nel/src/3d/driver/opengl/EGL/eglext.h @@ -0,0 +1,428 @@ +#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: 17614 $ on $Date: 2012-04-26 06:56:02 -0700 (Thu, 26 Apr 2012) $ */ +#define EGL_EGLEXT_VERSION 12 + +#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_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 eglQueryStream64KHR(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 PFNEGLQUERYSTREAM64KHRPROC)(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 + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/nel/src/3d/driver/opengl/EGL/eglplatform.h b/code/nel/src/3d/driver/opengl/EGL/eglplatform.h new file mode 100644 index 000000000..6d34ab55d --- /dev/null +++ b/code/nel/src/3d/driver/opengl/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/opengl/mac/glext.h b/code/nel/src/3d/driver/opengl/GL/glext.h similarity index 84% rename from code/nel/src/3d/driver/opengl/mac/glext.h rename to code/nel/src/3d/driver/opengl/GL/glext.h index 6bcd8c238..bd7b9b863 100644 --- a/code/nel/src/3d/driver/opengl/mac/glext.h +++ b/code/nel/src/3d/driver/opengl/GL/glext.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2007-2010 The Khronos Group Inc. +** 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 @@ -29,9 +29,9 @@ extern "C" { */ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated $Date: 2010-05-17 09:47:20 -0700 (Mon, 17 May 2010) $ */ +/* glext.h last updated $Date: 2012-04-26 00:59:42 -0700 (Thu, 26 Apr 2012) $ */ /* Current version at http://www.opengl.org/registry/ */ -#define GL_GLEXT_VERSION 62 +#define GL_GLEXT_VERSION 81 /* Function declaration macros - to move into glplatform.h */ #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) @@ -516,8 +516,6 @@ extern "C" { #define GL_MINOR_VERSION 0x821C #define GL_NUM_EXTENSIONS 0x821D #define GL_CONTEXT_FLAGS 0x821E -#define GL_DEPTH_BUFFER 0x8223 -#define GL_STENCIL_BUFFER 0x8224 #define GL_COMPRESSED_RED 0x8225 #define GL_COMPRESSED_RG 0x8226 #define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 @@ -774,7 +772,7 @@ extern "C" { /* Reuse tokens from ARB_copy_buffer */ /* reuse GL_COPY_READ_BUFFER */ /* reuse GL_COPY_WRITE_BUFFER */ -/* Would reuse tokens from ARB_draw_instanced, but it has none */ +/* Reuse tokens from ARB_draw_instanced (none) */ /* Reuse tokens from ARB_uniform_buffer_object */ /* reuse GL_UNIFORM_BUFFER */ /* reuse GL_UNIFORM_BUFFER_BINDING */ @@ -835,8 +833,8 @@ extern "C" { /* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ /* Reuse tokens from ARB_depth_clamp */ /* reuse GL_DEPTH_CLAMP */ -/* Would reuse tokens from ARB_draw_elements_base_vertex, but it has none */ -/* Would reuse tokens from ARB_fragment_coord_conventions, but it has none */ +/* 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 */ @@ -887,17 +885,18 @@ extern "C" { #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 */ -/* Would reuse tokens from ARB_explicit_attrib_location, but it has none */ +/* 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 */ -/* Would reuse tokens from ARB_shader_bit_encoding, but it has none */ +/* 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 */ @@ -914,6 +913,19 @@ extern "C" { #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 */ @@ -980,7 +992,7 @@ extern "C" { /* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER */ /* reuse GL_TESS_EVALUATION_SHADER */ /* reuse GL_TESS_CONTROL_SHADER */ -/* Would reuse tokens from ARB_texture_buffer_object_rgb32, but it has none */ +/* 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 */ @@ -991,6 +1003,167 @@ extern "C" { /* 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_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_ARB_multitexture #define GL_TEXTURE0_ARB 0x84C0 #define GL_TEXTURE1_ARB 0x84C1 @@ -1710,8 +1883,10 @@ extern "C" { #endif #ifndef GL_ARB_copy_buffer -#define GL_COPY_READ_BUFFER 0x8F36 -#define GL_COPY_WRITE_BUFFER 0x8F37 +#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 @@ -1788,18 +1963,18 @@ extern "C" { #endif #ifndef GL_ARB_sample_shading -#define GL_SAMPLE_SHADING 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#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 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 +#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 @@ -1959,8 +2134,10 @@ extern "C" { #ifndef GL_ARB_transform_feedback2 #define GL_TRANSFORM_FEEDBACK 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 +#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 @@ -1969,6 +2146,259 @@ extern "C" { #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_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_EXT_abgr #define GL_ABGR_EXT 0x8000 #endif @@ -4314,6 +4744,12 @@ extern "C" { #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 @@ -4651,6 +5087,9 @@ extern "C" { #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 @@ -4660,7 +5099,7 @@ extern "C" { #endif #ifndef GL_AMD_seamless_cubemap_per_texture -/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB */ +/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */ #endif #ifndef GL_AMD_conservative_depth @@ -4745,6 +5184,10 @@ extern "C" { #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 @@ -4827,6 +5270,214 @@ extern "C" { #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 + /*************************************************************/ @@ -4851,9 +5502,9 @@ typedef ptrdiff_t GLsizeiptrARB; #ifndef GL_ARB_shader_objects /* GL types for program/shader text and shader object handles */ typedef char GLcharARB; -#if !defined(MAC_OS_X_VERSION_10_7) +//#if !defined(MAC_OS_X_VERSION_10_7) typedef unsigned int GLhandleARB; -#endif +//#endif #endif /* GL type for "half" precision (s10e5) float data in host memory */ @@ -4908,23 +5559,41 @@ typedef int64_t GLint64EXT; typedef uint64_t GLuint64EXT; #endif -#ifndef ARB_sync +#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_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 (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +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); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +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); @@ -5006,7 +5675,7 @@ typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); #define GL_VERSION_1_3 1 #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glActiveTexture (GLenum texture); -GLAPI void APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); +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); @@ -5016,7 +5685,7 @@ GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +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); @@ -5110,16 +5779,16 @@ typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); #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, GLint *first, GLsizei *count, GLsizei primcount); -GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount); 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); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount); 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); @@ -5258,7 +5927,7 @@ typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname 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 frontfunc, GLenum backfunc, GLint ref, GLuint mask); +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); @@ -5289,7 +5958,7 @@ GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoi 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* *string, const GLint *length); +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); @@ -5352,7 +6021,7 @@ GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type 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 frontfunc, GLenum backfunc, GLint ref, GLuint mask); +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); @@ -5383,7 +6052,7 @@ typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum 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* *string, const GLint *length); +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); @@ -5479,7 +6148,7 @@ 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* *varyings, GLenum bufferMode); +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); @@ -5538,7 +6207,7 @@ 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* *varyings, GLenum bufferMode); +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); @@ -5615,12 +6284,10 @@ typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index); #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 glProgramParameteri (GLuint program, GLenum pname, GLint value); 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 PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); #endif @@ -5636,18 +6303,65 @@ typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum atta /* 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_ARB_multitexture @@ -5741,9 +6455,9 @@ typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); #ifndef GL_ARB_multisample #define GL_ARB_multisample 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleCoverageARB (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glSampleCoverageARB (GLfloat value, GLboolean invert); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLfloat value, GLboolean invert); #endif #ifndef GL_ARB_texture_env_add @@ -6362,7 +7076,7 @@ typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); #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* *uniformNames, GLuint *uniformIndices); +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); @@ -6370,7 +7084,7 @@ GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlo 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* *uniformNames, GLuint *uniformIndices); +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); @@ -6405,12 +7119,12 @@ typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum w 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 primcount, GLint basevertex); -GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, const GLint *basevertex); +GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, 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 primcount, GLint basevertex); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, const GLint *basevertex); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, const GLint *basevertex); #endif #ifndef GL_ARB_fragment_coord_conventions @@ -6470,23 +7184,23 @@ typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); #ifndef GL_ARB_draw_buffers_blend #define GL_ARB_draw_buffers_blend 1 #ifdef GL_GLEXT_PROTOTYPES -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); +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 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); +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 glMinSampleShading (GLclampf value); +GLAPI void APIENTRY glMinSampleShadingARB (GLfloat value); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLclampf value); +typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLfloat value); #endif #ifndef GL_ARB_texture_cube_map_array @@ -6519,6 +7233,10 @@ typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar 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 @@ -6529,13 +7247,21 @@ typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, G 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 (GLenum unit, 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); @@ -6545,12 +7271,12 @@ GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const 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 glGetSamplerParameterIfv (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) (GLenum unit, 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); @@ -6560,7 +7286,19 @@ typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum p 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 PFNGLGETSAMPLERPARAMETERIFVPROC) (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 @@ -6667,6 +7405,10 @@ typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid 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 @@ -6688,23 +7430,6 @@ GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboole 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); -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 PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); @@ -6724,23 +7449,6 @@ typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei co 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); -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_ARB_shader_subroutine @@ -6775,6 +7483,10 @@ 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 @@ -6809,6 +7521,370 @@ 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 primcount, GLuint baseinstance); +GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance); +GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, 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 primcount); +GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); +#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_EXT_abgr #define GL_EXT_abgr 1 #endif @@ -6816,9 +7892,9 @@ typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index #ifndef GL_EXT_blend_color #define GL_EXT_blend_color 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColorEXT (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GLAPI void APIENTRY glBlendColorEXT (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); #endif #ifndef GL_EXT_polygon_offset @@ -7620,10 +8696,10 @@ typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); #ifndef GL_EXT_multi_draw_arrays #define GL_EXT_multi_draw_arrays 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +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, GLint *first, GLsizei *count, GLsizei primcount); +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 @@ -8256,8 +9332,8 @@ GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdoubl 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, GLuint count, const GLdouble *v); -GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLuint count, 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); @@ -8321,8 +9397,8 @@ typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint in 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, GLuint count, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, 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); @@ -9446,11 +10522,12 @@ GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *att 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 GLchar* *varyings, GLenum bufferMode); +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); @@ -9458,11 +10535,12 @@ typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, cons 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 GLchar* *varyings, GLenum bufferMode); +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 @@ -9714,6 +10792,9 @@ GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const 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); @@ -9740,6 +10821,23 @@ GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenu 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); @@ -9901,6 +10999,9 @@ typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr 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); @@ -9927,6 +11028,23 @@ typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint frameb 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 @@ -9980,7 +11098,7 @@ GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsS 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, void *data); +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); @@ -9992,7 +11110,7 @@ typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLs 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, void *data); +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); @@ -10239,18 +11357,122 @@ typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void); #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 @@ -10263,6 +11485,46 @@ typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void); #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 @@ -10271,6 +11533,278 @@ typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void); #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 (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) (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 diff --git a/code/nel/src/3d/driver/opengl/GL/glxext.h b/code/nel/src/3d/driver/opengl/GL/glxext.h new file mode 100644 index 000000000..e640ff7e3 --- /dev/null +++ b/code/nel/src/3d/driver/opengl/GL/glxext.h @@ -0,0 +1,1001 @@ +#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_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 + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/nel/src/3d/driver/opengl/GL/wglext.h b/code/nel/src/3d/driver/opengl/GL/wglext.h new file mode 100644 index 000000000..b5dc7bf7f --- /dev/null +++ b/code/nel/src/3d/driver/opengl/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/opengl/GLES/egl.h b/code/nel/src/3d/driver/opengl/GLES/egl.h new file mode 100644 index 000000000..5778e0050 --- /dev/null +++ b/code/nel/src/3d/driver/opengl/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/opengl/GLES/gl.h b/code/nel/src/3d/driver/opengl/GLES/gl.h new file mode 100644 index 000000000..5b8d85a92 --- /dev/null +++ b/code/nel/src/3d/driver/opengl/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/opengl/GLES/glext.h b/code/nel/src/3d/driver/opengl/GLES/glext.h new file mode 100644 index 000000000..d591832bf --- /dev/null +++ b/code/nel/src/3d/driver/opengl/GLES/glext.h @@ -0,0 +1,1183 @@ +#ifndef __glext_h_ +#define __glext_h_ + +/* $Revision: 16481 $ on $Date:: 2012-01-04 10:43:56 -0800 #$ */ + +#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_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_texture_2D_limited_npot */ +/* 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_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_multisampled_render_to_texture */ +#ifndef GL_EXT_multisampled_render_to_texture +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C +#define GL_RENDERBUFFER_SAMPLES_EXT 0x9133 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x9134 +#define GL_MAX_SAMPLES_EXT 0x9135 +#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_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_texture_2D_limited_npot */ +#ifndef GL_APPLE_texture_2D_limited_npot +#define GL_APPLE_texture_2D_limited_npot 1 +#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_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_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 PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG) (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/opengl/GLES/glplatform.h b/code/nel/src/3d/driver/opengl/GLES/glplatform.h new file mode 100644 index 000000000..2db6ee2ca --- /dev/null +++ b/code/nel/src/3d/driver/opengl/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/opengl/KHR/khrplatform.h b/code/nel/src/3d/driver/opengl/KHR/khrplatform.h new file mode 100644 index 000000000..ee2ab4fd7 --- /dev/null +++ b/code/nel/src/3d/driver/opengl/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/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index f222dc5a7..a4c9e012d 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -21,21 +21,6 @@ // 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_WINDOWS -# define WIN32_LEAN_AND_MEAN -# define NOMINMAX -# include -# include -# include -# include -#elif defined(NL_OS_MAC) -#elif defined (NL_OS_UNIX) -# include -# include -#endif // NL_OS_UNIX - -#include - #include "nel/3d/viewport.h" #include "nel/3d/scissor.h" #include "nel/3d/u_driver.h" @@ -80,46 +65,50 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) #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 -{ - -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; - -#ifdef NL_OS_WINDOWS +namespace NL3D { #ifdef NL_STATIC -# pragma comment(lib, "opengl32") -# pragma comment(lib, "dinput8") -# pragma comment(lib, "dxguid") +#ifdef USE_OPENGLES -IDriver* createGlDriverInstance () +IDriver* createGlEsDriverInstance () { - return new CDriverGL; + 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; @@ -130,19 +119,8 @@ __declspec(dllexport) uint32 NL3D_interfaceVersion () return IDriver::InterfaceVersion; } -#endif - #elif defined (NL_OS_UNIX) -#ifdef NL_STATIC - -IDriver* createGlDriverInstance () -{ - return new CDriverGL; -} - -#else - extern "C" { IDriver* NL3D_createIDriverInstance () @@ -156,18 +134,48 @@ extern "C" } } +#endif // NL_OS_WINDOWS + +#endif // NL_STATIC + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif #endif -#endif // NL_OS_UNIX +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] = { +#ifdef USE_OPENGLES + GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES, + GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES, + GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES, + GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES +#else 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 +#endif }; // *************************************************************************** @@ -175,7 +183,13 @@ CDriverGL::CDriverGL() { H_AUTO_OGL(CDriverGL_CDriverGL) -#ifdef NL_OS_WINDOWS +#ifdef USE_OPENGLES + + _EglDisplay = 0; + _EglContext = 0; + _EglSurface = 0; + +#elif defined(NL_OS_WINDOWS) _PBuffer = NULL; _hRC = NULL; @@ -296,7 +310,11 @@ CDriverGL::CDriverGL() for(i=0; i < IDRV_MAT_MAXTEXTURES; i++) { _MaterialAllTextureTouchedFlag|= IDRV_TOUCHED_TEX[i]; +#ifdef GL_NONE _CurrentTexAddrMode[i] = GL_NONE; +#else + _CurrentTexAddrMode[i] = 0; +#endif } _UserTexMatEnabled = 0; @@ -381,7 +399,9 @@ bool CDriverGL::setupDisplay() for(uint i = 0; i < lines.size(); i++) nlinfo("3D: %s", lines[i].c_str()); -#ifdef NL_OS_WINDOWS +#ifdef USE_OPENGLES + registerEGlExtensions(_Extensions, _EglDisplay); +#elif defined(NL_OS_WINDOWS) registerWGlExtensions(_Extensions, _hDC); #elif defined(NL_OS_MAC) #elif defined(NL_OS_UNIX) @@ -421,18 +441,30 @@ bool CDriverGL::setupDisplay() glViewport(0,0,_CurrentMode.Width,_CurrentMode.Height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); +#ifdef USE_OPENGLES + glOrthof(0.f,_CurrentMode.Width,_CurrentMode.Height,0.f,-1.0f,1.0f); +#else glOrtho(0,_CurrentMode.Width,_CurrentMode.Height,0,-1.0f,1.0f); +#endif glMatrixMode(GL_MODELVIEW); glLoadIdentity(); +#ifndef USE_OPENGLES glDisable(GL_AUTO_NORMAL); +#endif glDisable(GL_COLOR_MATERIAL); +#ifndef USE_OPENGLES glEnable(GL_DITHER); +#endif glDisable(GL_FOG); glDisable(GL_LINE_SMOOTH); +#ifndef USE_OPENGLES glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); +#endif glEnable(GL_DEPTH_TEST); glDisable(GL_NORMALIZE); +#ifndef USE_OPENGLES glDisable(GL_COLOR_SUM_EXT); +#endif _CurrViewport.init(0.f, 0.f, 1.f, 1.f); _CurrScissor.initFullScreen(); @@ -451,7 +483,9 @@ bool CDriverGL::setupDisplay() // Be always in EXTSeparateSpecularColor. if(_Extensions.EXTSeparateSpecularColor) { +#ifndef USE_OPENGLES glLightModeli((GLenum)GL_LIGHT_MODEL_COLOR_CONTROL_EXT, GL_SEPARATE_SPECULAR_COLOR_EXT); +#endif } _VertexProgramEnabled= false; @@ -470,6 +504,7 @@ bool CDriverGL::setupDisplay() _SupportVBHard= true; _MaxVerticesByVBHard = std::numeric_limits::max(); // cant' know the value.. } +#ifndef USE_OPENGLES // Next with NVidia ext else if(_Extensions.NVVertexArrayRange) { @@ -500,6 +535,7 @@ bool CDriverGL::setupDisplay() // tmp fix for ati _MaxVerticesByVBHard= 16777216; } +#endif // Reset VertexArrayRange. _CurrentVertexArrayRange= NULL; @@ -559,6 +595,7 @@ bool CDriverGL::setupDisplay() // set All TexGen by default to identity matrix (prefer use the textureMatrix scheme) _DriverGLStates.activeTextureARB(stage); +#ifndef USE_OPENGLES GLfloat params[4]; params[0]=1; params[1]=0; params[2]=0; params[3]=0; glTexGenfv(GL_S, GL_OBJECT_PLANE, params); @@ -572,6 +609,7 @@ bool CDriverGL::setupDisplay() params[0]=0; params[1]=0; params[2]=0; params[3]=1; glTexGenfv(GL_Q, GL_OBJECT_PLANE, params); glTexGenfv(GL_Q, GL_EYE_PLANE, params); +#endif } resetTextureShaders(); @@ -603,42 +641,44 @@ bool CDriverGL::setupDisplay() // check whether per pixel lighting shader is supported checkForPerPixelLightingSupport(); +#ifndef USE_OPENGLES // if EXTVertexShader is used, bind the standard GL arrays, and allocate constant if (!_Extensions.NVVertexProgram && !_Extensions.ARBVertexProgram && _Extensions.EXTVertexShader) { - _EVSPositionHandle = nglBindParameterEXT(GL_CURRENT_VERTEX_EXT); - _EVSNormalHandle = nglBindParameterEXT(GL_CURRENT_NORMAL); - _EVSColorHandle = nglBindParameterEXT(GL_CURRENT_COLOR); + _EVSPositionHandle = nglBindParameterEXT(GL_CURRENT_VERTEX_EXT); + _EVSNormalHandle = nglBindParameterEXT(GL_CURRENT_NORMAL); + _EVSColorHandle = nglBindParameterEXT(GL_CURRENT_COLOR); - if (!_EVSPositionHandle || !_EVSNormalHandle || !_EVSColorHandle) + if (!_EVSPositionHandle || !_EVSNormalHandle || !_EVSColorHandle) + { + nlwarning("Unable to bind input parameters for use with EXT_vertex_shader, vertex program support is disabled"); + _Extensions.EXTVertexShader = false; + } + else + { + // bind texture units + for(uint k = 0; k < 8; ++k) { - nlwarning("Unable to bind input parameters for use with EXT_vertex_shader, vertex program support is disabled"); + _EVSTexHandle[k] = nglBindTextureUnitParameterEXT(GL_TEXTURE0_ARB + k, GL_CURRENT_TEXTURE_COORDS); + } + // Other attributes are managed using variant pointers : + // Secondary color + // Fog Coords + // Skin Weight + // Skin palette + // This mean that they must have 4 components + + // Allocate invariants. One assitionnal variant is needed for fog coordinate if fog bug is not fixed in driver version + _EVSConstantHandle = nglGenSymbolsEXT(GL_VECTOR_EXT, GL_INVARIANT_EXT, GL_FULL_RANGE_EXT, _EVSNumConstant + (_ATIFogRangeFixed ? 0 : 1)); + + if (_EVSConstantHandle == 0) + { + nlwarning("Unable to allocate constants for EXT_vertex_shader, vertex program support is disabled"); _Extensions.EXTVertexShader = false; } - else - { - // bind texture units - for(uint k = 0; k < 8; ++k) - { - _EVSTexHandle[k] = nglBindTextureUnitParameterEXT(GL_TEXTURE0_ARB + k, GL_CURRENT_TEXTURE_COORDS); - } - // Other attributes are managed using variant pointers : - // Secondary color - // Fog Coords - // Skin Weight - // Skin palette - // This mean that they must have 4 components - - // Allocate invariants. One assitionnal variant is needed for fog coordinate if fog bug is not fixed in driver version - _EVSConstantHandle = nglGenSymbolsEXT(GL_VECTOR_EXT, GL_INVARIANT_EXT, GL_FULL_RANGE_EXT, _EVSNumConstant + (_ATIFogRangeFixed ? 0 : 1)); - - if (_EVSConstantHandle == 0) - { - nlwarning("Unable to allocate constants for EXT_vertex_shader, vertex program support is disabled"); - _Extensions.EXTVertexShader = false; - } - } + } } +#endif // Reset the vbl interval setSwapVBLInterval(_Interval); @@ -685,7 +725,11 @@ bool CDriverGL::activeFrameBufferObject(ITexture * tex) } else { +#ifdef USE_OPENGLES + nglBindFramebufferOES(GL_FRAMEBUFFER_OES, 0); +#else nglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); +#endif return true; } } @@ -717,7 +761,9 @@ void CDriverGL::disableHardwareTextureShader() // -------------------------------------------------- void CDriverGL::resetTextureShaders() { - H_AUTO_OGL(CDriverGL_resetTextureShaders) + H_AUTO_OGL(CDriverGL_resetTextureShaders); + +#ifndef USE_OPENGLES if (_Extensions.NVTextureShader) { glEnable(GL_TEXTURE_SHADER_NV); @@ -739,6 +785,7 @@ void CDriverGL::resetTextureShaders() _NVTextureShaderEnabled = false; } +#endif } // -------------------------------------------------- @@ -773,8 +820,13 @@ bool CDriverGL::clear2D(CRGBA rgba) // -------------------------------------------------- bool CDriverGL::clearZBuffer(float zval) { - H_AUTO_OGL(CDriverGL_clearZBuffer) + H_AUTO_OGL(CDriverGL_clearZBuffer); + +#ifdef USE_OPENGLES + glClearDepthf(zval); +#else glClearDepth(zval); +#endif _DriverGLStates.enableZWrite(true); glClear(GL_DEPTH_BUFFER_BIT); @@ -810,6 +862,7 @@ bool CDriverGL::swapBuffers() //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. */ @@ -872,6 +925,7 @@ bool CDriverGL::swapBuffers() itVBHard++; } } +#endif #ifdef NL_OS_WINDOWS if (_EventEmitter.getNumEmitters() > 1) // is direct input running ? @@ -887,7 +941,11 @@ bool CDriverGL::swapBuffers() if (_VRAMVertexArrayRange) _VRAMVertexArrayRange->updateLostBuffers(); } -#ifdef NL_OS_WINDOWS +#ifdef USE_OPENGLES + + eglSwapBuffers (_EglDisplay, _EglSurface); + +#elif defined(NL_OS_WINDOWS) SwapBuffers(_hDC); @@ -908,6 +966,7 @@ bool CDriverGL::swapBuffers() #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. @@ -935,6 +994,8 @@ bool CDriverGL::swapBuffers() glDisable(GL_TEXTURE_SHADER_NV); _NVTextureShaderEnabled = false; } +#endif + _CurrentMaterial= NULL; // Reset the profiling counter. @@ -1184,9 +1245,14 @@ void CDriverGL::getZBufferPart (std::vector &zbuffer, NLMISC::CRect &rec 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 } } @@ -1215,8 +1281,23 @@ bool CDriverGL::fillBuffer (CBitmap &bitmap) 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; } @@ -1245,15 +1326,22 @@ void CDriverGL::copyFrameBufferToTexture(ITexture *tex, _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) { +#ifdef USE_OPENGLES + glBindTexture(GL_TEXTURE_CUBE_MAP_OES, gltext->ID); +#else glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID); +#endif glCopyTexSubImage2D(NLCubeFaceToGLCubeFace[cubeFace], level, offsetx, offsety, x, y, width, height); } } @@ -1276,6 +1364,7 @@ void CDriverGL::setPolygonMode (TPolygonMode mode) H_AUTO_OGL(CDriverGL_setPolygonMode ) IDriver::setPolygonMode (mode); +#ifndef USE_OPENGLES // Set the polygon mode switch (_PolygonMode) { @@ -1289,6 +1378,7 @@ void CDriverGL::setPolygonMode (TPolygonMode mode) glPolygonMode (GL_FRONT_AND_BACK, GL_POINT); break; } +#endif } // *************************************************************************** @@ -1488,7 +1578,10 @@ void CDriverGL::setMatrix2DForTextureOffsetAddrMode(const uint stage, const floa //nlassert(supportTextureShaders()); nlassert(stage < inlGetNumTextStages() ); _DriverGLStates.activeTextureARB(stage); + +#ifndef USE_OPENGLES glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, mat); +#endif } @@ -1499,7 +1592,7 @@ void CDriverGL::enableNVTextureShader(bool enabled) if (enabled != _NVTextureShaderEnabled) { - +#ifndef USE_OPENGLES if (enabled) { glEnable(GL_TEXTURE_SHADER_NV); @@ -1508,6 +1601,7 @@ void CDriverGL::enableNVTextureShader(bool enabled) { glDisable(GL_TEXTURE_SHADER_NV); } +#endif _NVTextureShaderEnabled = enabled; } } @@ -1568,8 +1662,11 @@ void CDriverGL::setBlendConstantColor(NLMISC::CRGBA 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 } // *************************************************************************** @@ -1623,6 +1720,7 @@ 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); // @@ -1631,13 +1729,15 @@ void CDriverGL::setEMBMMatrix(const uint stage,const float mat[4]) _DriverGLStates.activeTextureARB(stage); nglTexBumpParameterfvATI(GL_BUMP_ROT_MATRIX_ATI, const_cast(mat)); } +#endif } // *************************************************************************** void CDriverGL::initEMBM() { - H_AUTO_OGL(CDriverGL_initEMBM) + H_AUTO_OGL(CDriverGL_initEMBM); +#ifndef USE_OPENGLES if (supportEMBM()) { std::fill(_StageSupportEMBM, _StageSupportEMBM + IDRV_MAT_MAXTEXTURES, false); @@ -1687,6 +1787,7 @@ void CDriverGL::initEMBM() _DriverGLStates.activeTextureARB(0); } } +#endif } // *************************************************************************** @@ -1832,6 +1933,8 @@ uint loadARBFragmentProgramStringNative(const char *prog, bool forceNativeProgra nlwarning("The param 'prog' is null, cannot load"); return 0; } + +#ifndef USE_OPENGLES GLuint progID; nglGenProgramsARB(1, &progID); if (!progID) @@ -1859,6 +1962,8 @@ uint loadARBFragmentProgramStringNative(const char *prog, bool forceNativeProgra { nlwarning("init fragment program failed: errorPos: %d isNative: %d: %s", errorPos, isNative, (const char*)glGetString(GL_PROGRAM_ERROR_STRING_ARB)); } +#endif + return 0; } @@ -1869,11 +1974,12 @@ uint loadARBFragmentProgramStringNative(const char *prog, bool forceNativeProgra */ static void fetchPerturbedEnvMapR200() { - H_AUTO_OGL(CDriverGL_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 @@ -1885,6 +1991,7 @@ static void fetchPerturbedEnvMapR200() // PASS 2 // //////////// nglSampleMapATI(GL_REG_2_ATI, GL_REG_2_ATI, GL_SWIZZLE_STR_ATI); // fetch envmap at perturbed texcoords +#endif } // *************************************************************************** @@ -1896,8 +2003,9 @@ void CDriverGL::forceNativeFragmentPrograms(bool nativeOnly) // *************************************************************************** void CDriverGL::initFragmentShaders() { - H_AUTO_OGL(CDriverGL_initFragmentShaders) + H_AUTO_OGL(CDriverGL_initFragmentShaders); +#ifndef USE_OPENGLES /////////////////// // WATER SHADERS // /////////////////// @@ -2006,13 +2114,15 @@ void CDriverGL::initFragmentShaders() } // 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) + H_AUTO_OGL(CDriverGL_deleteARBFragmentPrograms); +#ifndef USE_OPENGLES for(uint k = 0; k < 4; ++k) { if (ARBWaterShader[k]) @@ -2022,6 +2132,7 @@ void CDriverGL::deleteARBFragmentPrograms() ARBWaterShader[k] = 0; } } +#endif } // *************************************************************************** @@ -2029,6 +2140,7 @@ void CDriverGL::deleteFragmentShaders() { H_AUTO_OGL(CDriverGL_deleteFragmentShaders) +#ifndef USE_OPENGLES deleteARBFragmentPrograms(); if (ATIWaterShaderHandleNoDiffuseMap) @@ -2046,6 +2158,7 @@ void CDriverGL::deleteFragmentShaders() nglDeleteFragmentShaderATI((GLuint) ATICloudShaderHandle); ATICloudShaderHandle = 0; } +#endif } // *************************************************************************** @@ -2072,7 +2185,9 @@ void CDriverGL::setSwapVBLInterval(uint interval) bool res = true; -#ifdef NL_OS_WINDOWS +#ifdef USE_OPENGLES + res = eglSwapInterval(_EglDisplay, _Interval) == EGL_TRUE; +#elif defined(NL_OS_WINDOWS) if(_Extensions.WGLEXTSwapControl) { res = nwglSwapIntervalEXT(_Interval) == TRUE; @@ -2108,7 +2223,8 @@ uint CDriverGL::getSwapVBLInterval() { H_AUTO_OGL(CDriverGL_getSwapVBLInterval) -#ifdef NL_OS_WINDOWS +#ifdef USE_OPENGLES +#elif defined(NL_OS_WINDOWS) if(_Extensions.WGLEXTSwapControl) { return nwglGetSwapIntervalEXT(); @@ -2135,12 +2251,14 @@ uint CDriverGL::getSwapVBLInterval() // *************************************************************************** void CDriverGL::enablePolygonSmoothing(bool smooth) { - H_AUTO_OGL(CDriverGL_enablePolygonSmoothing) + H_AUTO_OGL(CDriverGL_enablePolygonSmoothing); +#ifndef USE_OPENGLES if(smooth) glEnable(GL_POLYGON_SMOOTH); else glDisable(GL_POLYGON_SMOOTH); +#endif _PolygonSmooth= smooth; } @@ -2576,6 +2694,8 @@ IOcclusionQuery *CDriverGL::createOcclusionQuery() { H_AUTO_OGL(CDriverGL_createOcclusionQuery) nlassert(_Extensions.NVOcclusionQuery); + +#ifndef USE_OPENGLES GLuint id; nglGenOcclusionQueriesNV(1, &id); if (id == 0) return NULL; @@ -2587,12 +2707,17 @@ IOcclusionQuery *CDriverGL::createOcclusionQuery() oqgl->Iterator = _OcclusionQueryList.begin(); oqgl->VisibleCount = 0; return oqgl; +#else + return NULL; +#endif } // *************************************************************************** void CDriverGL::deleteOcclusionQuery(IOcclusionQuery *oq) { - H_AUTO_OGL(CDriverGL_deleteOcclusionQuery) + 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 @@ -2606,12 +2731,15 @@ void CDriverGL::deleteOcclusionQuery(IOcclusionQuery *oq) _CurrentOcclusionQuery = NULL; } delete oqgl; +#endif } // *************************************************************************** void COcclusionQueryGL::begin() { - H_AUTO_OGL(COcclusionQueryGL_begin) + H_AUTO_OGL(COcclusionQueryGL_begin); + +#ifndef USE_OPENGLES nlassert(Driver); nlassert(Driver->_CurrentOcclusionQuery == NULL); // only one query at a time nlassert(ID); @@ -2619,23 +2747,29 @@ void COcclusionQueryGL::begin() Driver->_CurrentOcclusionQuery = this; OcclusionType = NotAvailable; VisibleCount = 0; +#endif } // *************************************************************************** void COcclusionQueryGL::end() { - H_AUTO_OGL(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) + 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! @@ -2652,6 +2786,7 @@ IOcclusionQuery::TOcclusionType COcclusionQueryGL::getOcclusionType() // 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; } @@ -2799,8 +2934,6 @@ void CDriverGL::endDialogMode() { } -} // NL3D - // *************************************************************************** void displayGLError(GLenum error) { @@ -2818,3 +2951,9 @@ void displayGLError(GLenum error) break; } } + +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} // NL3D diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.h b/code/nel/src/3d/driver/opengl/driver_opengl.h index cbe651e0b..660955083 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl.h @@ -26,21 +26,10 @@ # define H_AUTO_OGL(label) #endif -#ifdef NL_OS_WINDOWS -# define WIN32_LEAN_AND_MEAN -# define NOMINMAX -# include -# include -#elif defined(NL_OS_MAC) -# define GL_GLEXT_LEGACY +#ifdef NL_OS_MAC # import -# include -# include "mac/glext.h" # import "mac/cocoa_opengl_view.h" #elif defined (NL_OS_UNIX) -# define GLX_GLXEXT_PROTOTYPES -# include -# include # ifdef XF86VIDMODE # include # endif //XF86VIDMODE @@ -87,8 +76,6 @@ #define NL3D_DRV_MAX_LIGHTMAP 256 -void displayGLError(GLenum error); - /* #define CHECK_GL_ERROR { \ GLenum error = glGetError(); \ @@ -102,17 +89,26 @@ void displayGLError(GLenum error); #define UNSUPPORTED_INDEX_OFFSET_MSG "Unsupported by driver, check IDriver::supportIndexOffset." -namespace NL3D { - 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); @@ -683,26 +679,28 @@ public: 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; - sint32 _WindowX; - sint32 _WindowY; bool _WindowVisible; bool _DestroyWindow; bool _Maximized; - GfxMode _CurrentMode; uint _Interval; bool _Resizable; @@ -764,31 +762,37 @@ private: 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); - HDC _hDC; - PIXELFORMATDESCRIPTOR _pfd; - HGLRC _hRC; static uint _Registered; DEVMODE _OldScreenMode; NLMISC::CEventEmitterMulti _EventEmitter; // this can contains a win emitter and eventually a direct input emitter - // Off-screen rendering in Dib section - HPBUFFERARB _PBuffer; - #elif defined(NL_OS_MAC) friend bool GlWndProc(CDriverGL*, const void*); - friend void windowDidMove(NSWindow*, CDriverGL*); - friend void viewDidResize(NSView*, CDriverGL*); - friend NSApplicationTerminateReply applicationShouldTerminate(CDriverGL*); - NLMISC::CCocoaEventEmitter _EventEmitter; - NSOpenGLContext* _ctx; CocoaOpenGLView* _glView; NSAutoreleasePool* _autoreleasePool; uint16 _backBufferHeight; @@ -804,7 +808,6 @@ private: friend bool GlWndProc(CDriverGL *driver, XEvent &e); Display* _dpy; - GLXContext _ctx; NLMISC::CUnixEventEmitter _EventEmitter; XVisualInfo* _visual_info; uint32 _xrandr_version; @@ -963,6 +966,7 @@ private: bool _CurrentGlNormalize; private: + bool createContext(); bool setupDisplay(); bool unInit(); @@ -1511,6 +1515,10 @@ public: 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/opengl/driver_opengl_extension.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp index a56f3670b..75f249b4c 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp @@ -16,18 +16,20 @@ #include "stdopengl.h" +#include "driver_opengl.h" +#include "driver_opengl_extension.h" #include "nel/misc/common.h" -#include "driver_opengl.h" -#include "driver_opengl_extension.h" #include "nel/3d/material.h" using namespace std; using namespace NLMISC; // *************************************************************************** -#ifdef NL_OS_WINDOWS +#ifdef USE_OPENGLES +#define nglGetProcAddress eglGetProcAddress +#elif defined(NL_OS_WINDOWS) #define nglGetProcAddress wglGetProcAddress #elif defined(NL_OS_MAC) // #include @@ -63,6 +65,47 @@ void (*nglGetProcAddress(const char *procName))() // *************************************************************************** // 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; @@ -468,14 +511,23 @@ NEL_PFNGLXGETSWAPINTERVALMESAPROC nglXGetSwapIntervalMESA; #endif +#endif // USE_OPENGLES + // *************************************************************************** // *************************************************************************** // *************************************************************************** // *************************************************************************** -namespace NL3D -{ +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); } @@ -493,6 +545,8 @@ namespace NL3D static bool setupARBMultiTexture(const char *glext) { H_AUTO_OGL(setupARBMultiTexture); + +#ifndef USE_OPENGLES CHECK_EXT("GL_ARB_multitexture"); CHECK_ADDRESS(NEL_PFNGLACTIVETEXTUREARBPROC, glActiveTextureARB); @@ -531,16 +585,21 @@ static bool setupARBMultiTexture(const char *glext) 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 } @@ -548,6 +607,8 @@ static bool setupEXTTextureEnvCombine(const char *glext) static bool setupARBTextureCompression(const char *glext) { H_AUTO_OGL(setupARBTextureCompression); + +#ifndef USE_OPENGLES CHECK_EXT("GL_ARB_texture_compression"); CHECK_ADDRESS(NEL_PFNGLCOMPRESSEDTEXIMAGE3DARBPROC, glCompressedTexImage3DARB); @@ -557,20 +618,52 @@ static bool setupARBTextureCompression(const char *glext) 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_OPENGL_ES 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) @@ -583,6 +676,7 @@ static bool setupNVVertexArrayRange(const char *glext) // Tess Fence too. CHECK_EXT("GL_NV_fence"); +#ifndef USE_OPENGLES // Get VAR address. CHECK_ADDRESS(NEL_PFNGLFLUSHVERTEXARRAYRANGENVPROC, glFlushVertexArrayRangeNV); CHECK_ADDRESS(NEL_PFNGLVERTEXARRAYRANGENVPROC, glVertexArrayRangeNV); @@ -603,29 +697,38 @@ static bool setupNVVertexArrayRange(const char *glext) 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; } @@ -679,6 +782,9 @@ 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); @@ -686,8 +792,8 @@ static bool setupATIEnvMapBumpMap(const char *glext) // Check for broken ATI drivers and disable EMBM if we caught one. // Reminder: This code crashes with Catalyst 7.11 fglrx drivers! - GLint num = -1; nglGetTexBumpParameterivATI(GL_BUMP_NUM_TEX_UNITS_ATI, &num); +#endif return num > 0; } @@ -696,7 +802,23 @@ static bool setupATIEnvMapBumpMap(const char *glext) static bool setupARBTextureCubeMap(const char *glext) { H_AUTO_OGL(setupARBTextureCubeMap); + +#ifdef USE_OPENGLES + CHECK_EXT("OES_texture_cube_map"); +#else CHECK_EXT("GL_ARB_texture_cube_map"); +#endif + +// 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); + return true; } @@ -714,6 +836,8 @@ static bool setupNVVertexProgram(const char *glext) // #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); @@ -777,6 +901,7 @@ static bool setupNVVertexProgram(const char *glext) CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS4FVNVPROC, glVertexAttribs4fvNV); CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS4SVNVPROC, glVertexAttribs4svNV); CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS4UBVNVPROC, glVertexAttribs4ubvNV); +#endif return true; } @@ -787,6 +912,7 @@ 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); @@ -849,6 +975,7 @@ static bool setupEXTVertexShader(const char *glext) GLint numVSVariants; glGetIntegerv(GL_MAX_VERTEX_SHADER_VARIANTS_EXT, &numVSVariants); if (numVSInvariants < 4) return false; +#endif return true; @@ -861,6 +988,7 @@ 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); @@ -878,6 +1006,7 @@ static bool setupEXTSecondaryColor(const char *glext) CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3USEXTPROC, glSecondaryColor3usEXT); CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLOR3USVEXTPROC, glSecondaryColor3usvEXT); CHECK_ADDRESS(NEL_PFNGLSECONDARYCOLORPOINTEREXTPROC, glSecondaryColorPointerEXT); +#endif return true; } @@ -888,12 +1017,14 @@ 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; @@ -905,7 +1036,9 @@ 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; } @@ -917,9 +1050,11 @@ 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; } @@ -947,7 +1082,11 @@ 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; } @@ -966,6 +1105,7 @@ 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); @@ -992,6 +1132,8 @@ static bool setupATIVertexArrayObject(const char *glext) CHECK_ADDRESS(NEL_PFNGLGETVARIANTARRAYOBJECTFVATIPROC, glGetVariantArrayObjectfvATI); CHECK_ADDRESS(NEL_PFNGLGETVARIANTARRAYOBJECTIVATIPROC, glGetVariantArrayObjectivATI); } +#endif + return true; } @@ -1000,8 +1142,12 @@ 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; } @@ -1013,6 +1159,7 @@ 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); @@ -1027,6 +1174,7 @@ static bool setupATIFragmentShader(const char *glext) CHECK_ADDRESS(NEL_PFNGLALPHAFRAGMENTOP2ATIPROC, glAlphaFragmentOp2ATI); CHECK_ADDRESS(NEL_PFNGLALPHAFRAGMENTOP3ATIPROC, glAlphaFragmentOp3ATI); CHECK_ADDRESS(NEL_PFNGLSETFRAGMENTSHADERCONSTANTATIPROC, glSetFragmentShaderConstantATI); +#endif return true; } @@ -1037,9 +1185,11 @@ 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; } @@ -1050,6 +1200,7 @@ 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); @@ -1069,6 +1220,7 @@ static bool setupARBFragmentProgram(const char *glext) CHECK_ADDRESS(NEL_PFNGLGETPROGRAMIVARBPROC, glGetProgramivARB); CHECK_ADDRESS(NEL_PFNGLGETPROGRAMSTRINGARBPROC, glGetProgramStringARB); CHECK_ADDRESS(NEL_PFNGLISPROGRAMARBPROC, glIsProgramARB); +#endif return true; } @@ -1077,6 +1229,8 @@ static bool setupARBFragmentProgram(const char *glext) static bool setupARBVertexBufferObject(const char *glext) { H_AUTO_OGL(setupARBVertexBufferObject); + +#ifndef USE_OPENGLES CHECK_EXT("GL_ARB_vertex_buffer_object"); CHECK_ADDRESS(PFNGLBINDBUFFERARBPROC, glBindBufferARB); @@ -1090,6 +1244,7 @@ static bool setupARBVertexBufferObject(const char *glext) CHECK_ADDRESS(PFNGLUNMAPBUFFERARBPROC, glUnmapBufferARB); CHECK_ADDRESS(PFNGLGETBUFFERPARAMETERIVARBPROC, glGetBufferParameterivARB); CHECK_ADDRESS(PFNGLGETBUFFERPOINTERVARBPROC, glGetBufferPointervARB); +#endif return true; } @@ -1100,6 +1255,7 @@ 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); @@ -1162,6 +1318,7 @@ static bool setupARBVertexProgram(const char *glext) CHECK_ADDRESS(PFNGLGETVERTEXATTRIBIVARBPROC, glGetVertexAttribivARB); CHECK_ADDRESS(PFNGLGETVERTEXATTRIBPOINTERVARBPROC, glGetVertexAttribPointervARB); CHECK_ADDRESS(PFNGLISPROGRAMARBPROC, glIsProgramARB); +#endif return true; } @@ -1172,6 +1329,7 @@ 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); @@ -1179,6 +1337,7 @@ static bool setupNVOcclusionQuery(const char *glext) CHECK_ADDRESS(NEL_PFNGLENDOCCLUSIONQUERYNVPROC, glEndOcclusionQueryNV); CHECK_ADDRESS(NEL_PFNGLGETOCCLUSIONQUERYIVNVPROC, glGetOcclusionQueryivNV); CHECK_ADDRESS(NEL_PFNGLGETOCCLUSIONQUERYUIVNVPROC, glGetOcclusionQueryuivNV); +#endif return true; } @@ -1204,7 +1363,11 @@ static bool setupEXTTextureRectangle(const char *glext) static bool setupARBTextureRectangle(const char *glext) { H_AUTO_OGL(setupARBTextureRectangle); + +#ifndef USE_OPENGLES CHECK_EXT("GL_ARB_texture_rectangle"); +#endif + return true; } @@ -1220,6 +1383,26 @@ static bool setupEXTTextureFilterAnisotropic(const char *glext) 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); @@ -1236,6 +1419,7 @@ static bool setupFrameBufferObject(const char *glext) CHECK_ADDRESS(NEL_PFNGLDELETEFRAMEBUFFERSEXTPROC, glDeleteFramebuffersEXT); CHECK_ADDRESS(NEL_PFNGETRENDERBUFFERPARAMETERIVEXTPROC, glGetRenderbufferParameterivEXT); CHECK_ADDRESS(NEL_PFNGENERATEMIPMAPEXTPROC, glGenerateMipmapEXT); +#endif return true; } @@ -1246,7 +1430,9 @@ 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; } @@ -1257,7 +1443,9 @@ 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; } @@ -1266,7 +1454,13 @@ static bool setupFrameBufferMultisample(const char *glext) 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; } @@ -1305,7 +1499,11 @@ void registerGlExtensions(CGlExtensions &ext) ext.ARBMultiTexture= setupARBMultiTexture(glext); if(ext.ARBMultiTexture) { +#ifdef USE_OPENGLES + glGetIntegerv(GL_MAX_TEXTURE_UNITS, &ntext); +#else glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &ntext); +#endif // 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); @@ -1330,8 +1528,10 @@ void registerGlExtensions(CGlExtensions &ext) if(ext.NVVertexArrayRange) { - GLint nverts; + GLint nverts = 10; +#ifndef USE_OPENGLES glGetIntegerv((GLenum)GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV, &nverts); +#endif ext.NVVertexArrayRangeMaxVertex= nverts; } @@ -1365,6 +1565,9 @@ void registerGlExtensions(CGlExtensions &ext) ext.ARBVertexProgram = false; } + ext.OESDrawTexture = setupOESDrawTexture(glext); + ext.OESMapBuffer = setupOESMapBuffer(glext); + // Check texture shaders // Disable feature ??? if(!ext.DisableHardwareTextureShader) @@ -1395,6 +1598,7 @@ void registerGlExtensions(CGlExtensions &ext) // Check NVVertexArrayRange2 ext.NVVertexArrayRange2= setupNVVertexArrayRange2(glext); +#ifdef GL_NV_vertex_array_range2 // if supported if(ext.NVVertexArrayRange2) // VBHard swap without flush of the VAR. @@ -1402,6 +1606,7 @@ void registerGlExtensions(CGlExtensions &ext) else // VBHard with useless flush of the VAR. ext.NVStateVARWithoutFlush= GL_VERTEX_ARRAY_RANGE_NV; +#endif // Check NV_occlusion_query ext.NVOcclusionQuery = setupNVOcclusionQuery(glext); @@ -1476,9 +1681,11 @@ 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; @@ -1524,11 +1731,43 @@ static bool setupGLXMESASwapControl(const char *glext) return true; } -#ifdef NL_OS_WINDOWS +#ifdef USE_OPENGLES // *************************************************************************** -bool registerWGlExtensions(CGlExtensions &ext, HDC hDC) +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); @@ -1569,7 +1808,7 @@ bool registerWGlExtensions(CGlExtensions &ext, HDC hDC) #elif defined(NL_OS_MAC) #elif defined(NL_OS_UNIX) // *************************************************************************** -bool registerGlXExtensions(CGlExtensions &ext, Display *dpy, sint screen) +bool registerGlXExtensions(CGlExtensions &ext, Display *dpy, sint screen) { H_AUTO_OGL(registerGlXExtensions); @@ -1609,6 +1848,10 @@ bool registerGlXExtensions(CGlExtensions &ext, Display *dpy, sint screen) return true; } -#endif // NL_OS_WINDOWS +#endif // USE_OPENGLES -} +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + +} // NL3D diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_extension.h b/code/nel/src/3d/driver/opengl/driver_opengl_extension.h index 465f6febd..253f702a6 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_extension.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl_extension.h @@ -21,35 +21,17 @@ #include "nel/misc/types_nl.h" #include "nel/misc/string_common.h" -#ifdef NL_OS_WINDOWS -# define WIN32_LEAN_AND_MEAN -# define NOMINMAX -# include -# include -# include // Please download it from http://www.opengl.org/registry/ -#elif defined(NL_OS_MAC) -# define GL_GLEXT_LEGACY -# include -# include "mac/glext.h" -#elif defined (NL_OS_UNIX) -# include -# include // Please download it from http://www.opengl.org/registry/ -# include -# include -#endif // NL_OS_UNIX - -#ifndef GL_GLEXT_VERSION -# error "I need a newer . Please download it from http://www.opengl.org/registry/" -#endif // GL_nGLEXT_VERSION - -#if GL_GLEXT_VERSION < 7 -# error "I need a newer . Please download it from http://www.opengl.org/registry/" -#endif // GL_nGLEXT_VERSION < 7 - #include "driver_opengl_extension_def.h" -namespace NL3D -{ +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif // *************************************************************************** /// The extensions used by NL3D. @@ -121,6 +103,9 @@ struct CGlExtensions bool ARBTextureNonPowerOfTwo; bool ARBMultisample; + bool OESDrawTexture; + bool OESMapBuffer; + public: /// \name Disable Hardware feature. False by default. setuped by IDriver @@ -184,6 +169,9 @@ public: NVVertexArrayRange2 = false; NVStateVARWithoutFlush = 0; + OESDrawTexture = false; + OESMapBuffer = false; + /// \name Disable Hardware feature. False by default. setuped by IDriver DisableHardwareVertexProgram= false; DisableHardwareVertexArrayAGP= false; @@ -266,7 +254,10 @@ public: // *************************************************************************** -#ifdef NL_OS_WINDOWS +#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) @@ -278,7 +269,11 @@ bool registerGlXExtensions(CGlExtensions &ext, Display *dpy, sint screen); /// 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 @@ -289,6 +284,48 @@ void registerGlExtensions(CGlExtensions &ext); 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; @@ -741,4 +778,6 @@ extern NEL_PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC nglRenderbufferStorageMul // GL_ARB_multisample extern NEL_PFNGLSAMPLECOVERAGEARBPROC nglSampleCoverageARB; +#endif // USE_OPENGLES + #endif // NL_OPENGL_EXTENSION_H diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_extension_def.h b/code/nel/src/3d/driver/opengl/driver_opengl_extension_def.h index c1ecfe8c0..dfdc5da46 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_extension_def.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl_extension_def.h @@ -20,23 +20,6 @@ #include "nel/misc/types_nl.h" -#ifdef USE_OPENGLES -# include -# include -#else -# ifdef NL_OS_MAC -# define GL_GLEXT_LEGACY -# include -# include "mac/glext.h" -# else -# include -# include -# if defined(NL_OS_WINDOWS) -# include -# endif -# endif -#endif - #ifdef __cplusplus extern "C" { #endif @@ -79,7 +62,8 @@ typedef void (APIENTRY * NEL_PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, 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); -#endif + +#else // *************************************************************************** // *************************************************************************** @@ -456,6 +440,8 @@ typedef void (APIENTRY * NEL_PFNGLXFREEMEMORYNVPROC) (void *pointer); #endif // NL_OS_MAC +#endif // USE_OPENGLES + #ifdef __cplusplus } #endif diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp index acfdac253..e3921d5d4 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp @@ -17,11 +17,7 @@ #include "stdopengl.h" #include "driver_opengl.h" -#ifdef NL_OS_WINDOWS -# include -#elif defined(NL_OS_MAC) -#elif defined (NL_OS_UNIX) -# include +#ifdef NL_OS_UNIX # include # ifdef HAVE_XRENDER # include @@ -39,8 +35,15 @@ using namespace std; using namespace NLMISC; -namespace NL3D -{ +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif // ************************************************************************************* CDriverGL::CCursor::CCursor() : ColorDepth(CDriverGL::ColorDepth32), @@ -1010,4 +1013,8 @@ bool CDriverGL::convertBitmapToCursor(const NLMISC::CBitmap &bitmap, nlCursor &c #endif } +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + } // NL3D diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_light.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_light.cpp index 2fc25f94a..3d3a6b273 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_light.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_light.cpp @@ -19,9 +19,15 @@ #include "driver_opengl.h" #include "nel/3d/light.h" -namespace NL3D -{ +namespace NL3D { +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif // *************************************************************************** uint CDriverGL::getMaxLight () const @@ -357,5 +363,8 @@ void CDriverGL::setupLightMapDynamicLighting(bool enable) refreshRenderSetup(); } +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif } // NL3D diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp index 4fe6e8c71..6e3780444 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp @@ -23,6 +23,14 @@ 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) @@ -35,12 +43,7 @@ static void convBlend(CMaterial::TBlend blend, GLenum& glenum) case CMaterial::srccolor: glenum=GL_SRC_COLOR; break; case CMaterial::invsrccolor:glenum=GL_ONE_MINUS_SRC_COLOR; break; // Extended Blend modes. -#ifdef USE_OPENGLES - case CMaterial::blendConstantColor: glenum=GL_CONSTANT_COLOR; break; - case CMaterial::blendConstantInvColor: glenum=GL_ONE_MINUS_CONSTANT_COLOR; break; - case CMaterial::blendConstantAlpha: glenum=GL_CONSTANT_ALPHA; break; - case CMaterial::blendConstantInvAlpha: glenum=GL_ONE_MINUS_CONSTANT_ALPHA; break; -#else +#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; @@ -84,22 +87,30 @@ static inline void convTexAddr(ITexture *tex, CMaterial::TTexAddressingMode mode nlassert(mode < CMaterial::TexAddrCount); static const GLenum glTex2dAddrModesNV[] = { +#ifdef USE_OPENGLES + 0, GL_TEXTURE_2D +#else GL_NONE, GL_TEXTURE_2D, 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[] = { +#ifdef USE_OPENGLES + 0, GL_TEXTURE_CUBE_MAP_OES +#else GL_NONE, GL_TEXTURE_CUBE_MAP_ARB, 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()) @@ -136,17 +147,33 @@ void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat) { // Cubic or normal ? if (text->isTextureCube ()) +#ifdef USE_OPENGLES + _DriverGLStates.setTexGenMode (stage, GL_REFLECTION_MAP_OES); +#else _DriverGLStates.setTexGenMode (stage, GL_REFLECTION_MAP_ARB); +#endif 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 @@ -850,6 +877,22 @@ void CDriverGL::setupLightMapPass(uint pass) // 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. @@ -889,6 +932,7 @@ void CDriverGL::setupLightMapPass(uint pass) glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PREVIOUS_EXT ); glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR); } +#endif } } @@ -1196,6 +1240,58 @@ void CDriverGL::setupSpecularPass(uint pass) return; } +#ifdef USE_OPENGLES +#if 0 + // Ok we can do it in a single pass + + // Set Stage 1 + // Special: not the same special env if there is or not texture in stage 0. + CTexEnvSpecial newEnvStage1; + if( mat.getTexture(0) == NULL ) + newEnvStage1= TexEnvSpecialSpecularStage1NoText; + else + newEnvStage1= TexEnvSpecialSpecularStage1; + // Test if same env as prec. + if(_CurrentTexEnvSpecial[1] != newEnvStage1) + { + // TexEnv is special. + _CurrentTexEnvSpecial[1] = newEnvStage1; + + _DriverGLStates.activeTextureARB(1); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); + // Operator Add (Arg0*Arg2+Arg1) + 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); + // Arg2. + if( newEnvStage1 == TexEnvSpecialSpecularStage1NoText) + { + glTexEnvi(GL_TEXTURE_ENV, GL_SRC2_RGB, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_ONE_MINUS_SRC_COLOR); + } + else + { + glTexEnvi(GL_TEXTURE_ENV, GL_SRC2_RGB, GL_PREVIOUS); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_SRC_ALPHA); + } + // Arg1. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_RGB, GL_PREVIOUS); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR); + // Result : Texture*Previous.Alpha+Previous + // Setup Alpha Diffuse Copy + glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_ALPHA, GL_PRIMARY_COLOR); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA); + // Arg2. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC2_ALPHA, GL_ZERO); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + // Arg1. + glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_ALPHA, GL_ZERO ); + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_SRC_ALPHA); + } +#endif +#else /// Support NVidia combine 4 extension to do specular map in a single pass if( _Extensions.NVTextureEnvCombine4 ) { // Ok we can do it in a single pass @@ -1258,7 +1354,7 @@ void CDriverGL::setupSpecularPass(uint pass) // Ok we can do it in a single pass // Set Stage 1 - // Special: not the same sepcial env if there is or not texture in stage 0. + // Special: not the same special env if there is or not texture in stage 0. CTexEnvSpecial newEnvStage1; if( mat.getTexture(0) == NULL ) newEnvStage1= TexEnvSpecialSpecularStage1NoText; @@ -1305,11 +1401,13 @@ void CDriverGL::setupSpecularPass(uint pass) } } else +#endif { // We have to do it in 2 passes // For Both Pass, setup correct Env. if( pass == 0 ) - { // Just display the texture + { + // Just display the texture _DriverGLStates.enableBlend(false); _DriverGLStates.activeTextureARB(1); _DriverGLStates.setTextureMode(CDriverGLStates::TextureDisabled); @@ -1542,6 +1640,20 @@ void CDriverGL::setupPPLPass(uint pass) _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); @@ -1575,6 +1687,7 @@ void CDriverGL::setupPPLPass(uint pass) 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); @@ -1592,6 +1705,32 @@ void CDriverGL::setupPPLPass(uint pass) _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); @@ -1652,6 +1791,7 @@ void CDriverGL::setupPPLPass(uint pass) 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); @@ -1707,6 +1847,20 @@ void CDriverGL::setupPPLNoSpecPass(uint pass) _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); @@ -1740,6 +1894,7 @@ void CDriverGL::setupPPLNoSpecPass(uint pass) 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); @@ -1852,6 +2007,7 @@ void CDriverGL::setupCloudPass (uint /* pass */) if (_CurrentTexEnvSpecial[0] != TexEnvSpecialCloudStage0) { +#ifndef USE_OPENGLES if (_Extensions.NVTextureEnvCombine4) { _CurrentTexEnvSpecial[0] = TexEnvSpecialCloudStage0; @@ -1969,6 +2125,7 @@ void CDriverGL::setupCloudPass (uint /* pass */) glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_SRC_ALPHA); */ } +#endif } if (_Extensions.NVTextureEnvCombine4) activateTexEnvColor (1, mat.getColor()); @@ -2323,4 +2480,8 @@ void CDriverGL::endWaterMultiPass() #endif } +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + } // NL3D diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_matrix.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_matrix.cpp index 4106c38f2..7136e615e 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_matrix.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_matrix.cpp @@ -19,6 +19,14 @@ 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) { @@ -204,5 +212,8 @@ void CDriverGL::doRefreshRenderSetup() _RenderSetupDirty= false; } +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif } // NL3D diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp index cf30758dc..d8c9ae106 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp @@ -22,8 +22,15 @@ // define it For Debug purpose only. Normal use is to hide this line //#define NL3D_GLSTATE_DISABLE_CACHE -namespace NL3D -{ +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif // *************************************************************************** CDriverGLStates::CDriverGLStates() @@ -642,6 +649,8 @@ void CDriverGLStates::setTexGenMode (uint stage, GLint mode) { _TexGenMode[stage] = mode; + if (!_TextureCubeMapSupported) return; + if(mode==0) { #ifdef USE_OPENGLES @@ -655,15 +664,31 @@ void CDriverGLStates::setTexGenMode (uint stage, GLint mode) } 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); @@ -673,6 +698,7 @@ void CDriverGLStates::setTexGenMode (uint stage, GLint mode) { glDisable( GL_TEXTURE_GEN_Q ); } +#endif // Enable All. #ifdef USE_OPENGLES @@ -686,8 +712,6 @@ void CDriverGLStates::setTexGenMode (uint stage, GLint mode) } } - - // *************************************************************************** void CDriverGLStates::resetTextureMode() { @@ -994,6 +1018,7 @@ void CDriverGLStates::enableVertexAttribArrayARB(uint glIndex,bool enable) void CDriverGLStates::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bool enable, uint *variants) { H_AUTO_OGL(CDriverGLStates_enableVertexAttribArrayForEXTVertexShader) + if(_VertexAttribArrayEnabled[glIndex] != enable) { switch(glIndex) @@ -1002,10 +1027,12 @@ void CDriverGLStates::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bo 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); @@ -1014,22 +1041,28 @@ void CDriverGLStates::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bo 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; @@ -1051,8 +1084,6 @@ void CDriverGLStates::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bo } _VertexAttribArrayEnabled[glIndex]= enable; } - - } @@ -1123,6 +1154,8 @@ CDriverGLStates::TCullMode CDriverGLStates::getCullMode() const return _CullMode; } - +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif } // NL3D diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_states.h b/code/nel/src/3d/driver/opengl/driver_opengl_states.h index e3820c4a8..6d92a8080 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_states.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl_states.h @@ -20,20 +20,15 @@ #include "nel/misc/types_nl.h" #include "nel/3d/vertex_buffer.h" +namespace NL3D { + +#ifdef NL_STATIC #ifdef USE_OPENGLES -# include +namespace NLDRIVERGLES { #else -# ifdef NL_OS_MAC -# define GL_GLEXT_LEGACY -# include -# else -# include -# endif +namespace NLDRIVERGL { +#endif #endif - - -namespace NL3D -{ // *************************************************************************** /** @@ -255,6 +250,9 @@ private: bool _CurLight[MaxLight]; }; +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif } // NL3D diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp index 315c9ee2a..bb89f5ee0 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp @@ -41,9 +41,15 @@ using namespace std; #define NEL_MEASURE_UPLOAD_TIME_END #endif -namespace NL3D -{ +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) @@ -60,7 +66,11 @@ CTextureDrvInfosGL::CTextureDrvInfosGL(IDriver *drv, ItTexDrvInfoPtrMap it, CDri // 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; @@ -85,6 +95,15 @@ CTextureDrvInfosGL::~CTextureDrvInfosGL() if(InitFBO) { +#ifdef USE_OPENGLES + nglDeleteFramebuffersOES(1, &FBOId); + if(AttachDepthStencil) + { + nglDeleteRenderbuffersOES(1, &DepthFBOId); + if(!UsePackedDepthStencil) + nglDeleteRenderbuffersOES(1, &StencilFBOId); + } +#else nglDeleteFramebuffersEXT(1, &FBOId); if(AttachDepthStencil) { @@ -92,6 +111,7 @@ CTextureDrvInfosGL::~CTextureDrvInfosGL() if(!UsePackedDepthStencil) nglDeleteRenderbuffersEXT(1, &StencilFBOId); } +#endif } } @@ -104,6 +124,54 @@ bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex) { 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) @@ -119,8 +187,7 @@ bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex) // initialize FBO nglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBOId); - nglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, - TextureMode, ID, 0); + 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 @@ -152,6 +219,7 @@ bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex) GL_RENDERBUFFER_EXT, StencilFBOId); nldebug("3D: glFramebufferRenderbufferExt(stencil:8) = %X", nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)); } +#endif // check status GLenum status; @@ -161,44 +229,95 @@ bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex) 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); @@ -265,7 +384,7 @@ bool CTextureDrvInfosGL::activeFrameBufferObject(ITexture * tex) // *************************************************************************** // Get the glText mirror of an existing setuped texture. -static inline CTextureDrvInfosGL* getTextureGl(ITexture& tex) +static inline CTextureDrvInfosGL* getTextureGl(ITexture& tex) { H_AUTO_OGL(getTextureGl) CTextureDrvInfosGL* gltex; @@ -310,10 +429,18 @@ GLint CDriverGL::getGlTextureFormat(ITexture& tex, bool &compressed) // 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; } } @@ -322,6 +449,16 @@ GLint CDriverGL::getGlTextureFormat(ITexture& tex, bool &compressed) 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; @@ -342,8 +479,16 @@ GLint CDriverGL::getGlTextureFormat(ITexture& tex, bool &compressed) return 0; } break; - default: return GL_RGBA8; +#endif + default: + break; } + +#ifdef USE_OPENGLES + return GL_RGBA; +#else + return GL_RGBA8; +#endif } // *************************************************************************** @@ -352,7 +497,11 @@ 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()) { @@ -363,6 +512,7 @@ static GLint getGlSrcTextureFormat(ITexture &tex, GLint glfmt) } } +#ifndef USE_OPENGLES if (glfmt == GL_DSDT_NV) { return GL_DSDT_NV; @@ -372,6 +522,7 @@ static GLint getGlSrcTextureFormat(ITexture &tex, GLint glfmt) { return GL_DUDV_ATI; } +#endif // Else, not a Src format for upload, or RGBA. return GL_RGBA; @@ -380,7 +531,9 @@ static GLint getGlSrcTextureFormat(ITexture &tex, GLint glfmt) // *************************************************************************** static GLenum getGlSrcTextureComponentType(GLint texSrcFormat) { - H_AUTO_OGL(getGlSrcTextureComponentType) + H_AUTO_OGL(getGlSrcTextureComponentType); + +#ifndef USE_OPENGLES switch (texSrcFormat) { case GL_DSDT_NV: @@ -388,10 +541,11 @@ static GLenum getGlSrcTextureComponentType(GLint texSrcFormat) return GL_BYTE; // these are signed format break; default: - return GL_UNSIGNED_BYTE; break; - } +#endif + + return GL_UNSIGNED_BYTE; } // *************************************************************************** @@ -400,22 +554,65 @@ 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; @@ -431,13 +628,15 @@ static inline GLenum translateWrapToGl(ITexture::TWrapMode mode, const CGlExtens H_AUTO_OGL(translateWrapToGl) if(mode== ITexture::Repeat) return GL_REPEAT; - else - { - if(extensions.Version1_2) - return GL_CLAMP_TO_EDGE; - else - return GL_CLAMP; - } + +#ifdef USE_OPENGLES + return GL_CLAMP_TO_EDGE; +#else + if(extensions.Version1_2) + return GL_CLAMP_TO_EDGE; + + return GL_CLAMP; +#endif } // *************************************************************************** @@ -506,14 +705,26 @@ static inline GLenum translateMinFilterToGl(CTextureDrvInfosGL *glText) 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; } @@ -522,14 +733,26 @@ static inline bool sameDXTCFormat(ITexture &tex, GLint glfmt) 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; } @@ -558,14 +781,20 @@ void CDriverGL::bindTextureWithMode(ITexture &tex) { _DriverGLStates.setTextureMode(CDriverGLStates::TextureCubeMap); // Bind this texture +#ifdef USE_OPENGLES + glBindTexture(GL_TEXTURE_CUBE_MAP_OES, gltext->ID); +#else glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID); +#endif } } 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 @@ -591,11 +820,19 @@ void CDriverGL::setupTextureBasicParameters(ITexture &tex) { if (_Extensions.ARBTextureCubeMap) { +#ifdef USE_OPENGLES + glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_WRAP_S, translateWrapToGl(ITexture::Clamp, _Extensions)); + glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_WRAP_T, translateWrapToGl(ITexture::Clamp, _Extensions)); +// glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_WRAP_R, translateWrapToGl(ITexture::Clamp, _Extensions)); + glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext)); + glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext)); +#else 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)); glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_WRAP_R, translateWrapToGl(ITexture::Clamp, _Extensions)); glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext)); glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext)); +#endif } } else @@ -1005,6 +1242,23 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, clamp(x1, x0, w); clamp(y1, y0, h); +#ifdef USE_OPENGLES + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + + if (!bUpload) + ptr = NULL; + + 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, i, x0, y0+yy, x1-x0, 1, glSrcFmt, glSrcType, row ); + } +#else glPixelStorei(GL_UNPACK_ROW_LENGTH, w); glPixelStorei(GL_UNPACK_SKIP_ROWS, y0); glPixelStorei(GL_UNPACK_SKIP_PIXELS, x0); @@ -1012,6 +1266,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, glTexSubImage2D (GL_TEXTURE_2D, i, x0, y0, x1-x0, y1-y0, glSrcFmt,glSrcType, ptr); else glTexSubImage2D (GL_TEXTURE_2D, i, x0, y0, x1-x0, y1-y0, glSrcFmt,glSrcType, NULL); +#endif // Next mipmap!! // floor . @@ -1024,9 +1279,13 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, } // Reset the transfer mode... +#ifdef USE_OPENGLES + glPixelStorei(GL_UNPACK_ALIGNMENT, 4); +#else glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); +#endif } } @@ -1081,8 +1340,11 @@ bool CDriverGL::uploadTexture (ITexture& tex, CRect& rect, uint8 nNumMipMap) // 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... @@ -1139,8 +1401,13 @@ bool CDriverGL::uploadTexture (ITexture& tex, CRect& rect, uint8 nNumMipMap) nlassert (((x0&3) == 0) && ((y0&3) == 0)); if ((w>=4) && (h>=4)) { - nglCompressedTexSubImage2DARB ( GL_TEXTURE_2D, nNumMipMap-decalMipMapResize, - x0, y0, (x1-x0), (y1-y0), glfmt, imageSize, ptr ); +#ifdef USE_OPENGLES + glCompressedTexSubImage2D ( +#else + nglCompressedTexSubImage2DARB ( +#endif + GL_TEXTURE_2D, nNumMipMap-decalMipMapResize, + x0, y0, (x1-x0), (y1-y0), glfmt, imageSize, ptr ); } else { @@ -1148,7 +1415,12 @@ bool CDriverGL::uploadTexture (ITexture& tex, CRect& rect, uint8 nNumMipMap) // 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(); - nglCompressedTexImage2DARB (GL_TEXTURE_2D, nNumMipMap-decalMipMapResize, +#ifdef USE_OPENGLES + glCompressedTexImage2D ( +#else + nglCompressedTexImage2DARB ( +#endif + GL_TEXTURE_2D, nNumMipMap-decalMipMapResize, glfmt, w, h, 0, imageSize, ptr); } } @@ -1158,6 +1430,22 @@ bool CDriverGL::uploadTexture (ITexture& tex, CRect& rect, uint8 nNumMipMap) 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); @@ -1167,6 +1455,7 @@ bool CDriverGL::uploadTexture (ITexture& tex, CRect& rect, uint8 nNumMipMap) glPixelStorei (GL_UNPACK_ROW_LENGTH, 0); glPixelStorei (GL_UNPACK_SKIP_ROWS, 0); glPixelStorei (GL_UNPACK_SKIP_PIXELS, 0); +#endif } // Disable texture 0 @@ -1227,19 +1516,31 @@ bool CDriverGL::activateTexture(uint stage, ITexture *tex) _CurrentTextureInfoGL[stage]= gltext; // setup this texture +#ifdef USE_OPENGLES + glBindTexture(GL_TEXTURE_CUBE_MAP_OES, gltext->ID); +#else glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID); +#endif // Change parameters of texture, if necessary. //============================================ if(gltext->MagFilter!= tex->getMagFilter()) { gltext->MagFilter= tex->getMagFilter(); +#ifdef USE_OPENGLES + glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext)); +#else glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext)); +#endif } if(gltext->MinFilter!= tex->getMinFilter()) { gltext->MinFilter= tex->getMinFilter(); +#ifdef USE_OPENGLES + glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext)); +#else glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext)); +#endif } } } @@ -1248,8 +1549,10 @@ bool CDriverGL::activateTexture(uint stage, ITexture *tex) { // 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... @@ -1296,11 +1599,14 @@ bool CDriverGL::activateTexture(uint stage, ITexture *tex) _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; @@ -1311,24 +1617,43 @@ bool CDriverGL::activateTexture(uint stage, ITexture *tex) // 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 }; +static const GLenum OperatorLUT[9]= { GL_REPLACE, GL_MODULATE, GL_ADD, +#ifdef USE_OPENGLES + GL_ADD_SIGNED, GL_INTERPOLATE, GL_INTERPOLATE, GL_INTERPOLATE, GL_INTERPOLATE, GL_INTERPOLATE +#else + GL_ADD_SIGNED_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_BUMP_ENVMAP_ATI +#endif +}; // This maps the CMaterial::TTexSource -static const GLenum SourceLUT[4]= { GL_TEXTURE, GL_PREVIOUS_EXT, GL_PRIMARY_COLOR_EXT, GL_CONSTANT_EXT }; +static const GLenum SourceLUT[4]= { GL_TEXTURE, +#ifdef USE_OPENGLES + GL_PREVIOUS, GL_PRIMARY_COLOR, GL_CONSTANT +#else + GL_PREVIOUS_EXT, GL_PRIMARY_COLOR_EXT, GL_CONSTANT_EXT +#endif +}; // 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 }; +static const GLenum InterpolateSrcLUT[8]= { GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, +#ifdef USE_OPENGLES + GL_PREVIOUS, GL_PRIMARY_COLOR, GL_CONSTANT +#else + GL_PREVIOUS_EXT, GL_PRIMARY_COLOR_EXT, GL_CONSTANT_EXT +#endif +}; + +#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) + H_AUTO_OGL(forceActivateTexEnvModeEnvCombine4); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE4_NV); //== RGB == @@ -1613,6 +1938,7 @@ static void forceActivateTexEnvModeEnvCombine4(const CMaterial::CTexEnv &env) } } +#endif // *************************************************************************** void CDriverGL::forceActivateTexEnvMode(uint stage, const CMaterial::CTexEnv &env) @@ -1626,6 +1952,114 @@ void CDriverGL::forceActivateTexEnvMode(uint stage, const CMaterial::CTexEnv & // 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) @@ -1746,6 +2180,7 @@ void CDriverGL::forceActivateTexEnvMode(uint stage, const CMaterial::CTexEnv & { glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); } +#endif } // *************************************************************************** @@ -1982,4 +2417,8 @@ bool CDriverGL::getRenderTargetSize (uint32 &width, uint32 &height) // *************************************************************************** +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + } // NL3D diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp index 7241d499b..06cfdf71f 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp @@ -46,13 +46,15 @@ using namespace NLMISC; -namespace NL3D -{ - - - - +namespace NL3D { +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif // *************************************************************************** @@ -1313,6 +1315,7 @@ void CDriverGL::setupGlArraysForARBVertexProgram(CVertexBufferInfo &vb) _DriverGLStates.bindARBVertexBuffer(vb.VertexObjectId); } +#ifndef USE_OPENGLES // special case if the buffer is an ATI_vertex_array_object if (vb.VBMode == CVertexBufferInfo::HwATI) { @@ -1346,6 +1349,7 @@ void CDriverGL::setupGlArraysForARBVertexProgram(CVertexBufferInfo &vb) } } else +#endif { // 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) { @@ -1487,6 +1496,7 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb) } } else +#endif { switch(value) { @@ -1499,7 +1509,9 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb) 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 @@ -1518,21 +1530,27 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb) { // 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 @@ -1789,6 +1807,7 @@ 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; @@ -1817,6 +1836,7 @@ void CDriverGL::fenceOnCurVBHardIfNeeded(IVertexBufferHardGL *newVBHard) vbHardNV->GPURenderingAfterFence= false; } } +#endif } // *************************************************************************** @@ -1840,4 +1860,8 @@ void CIndexBufferInfo::setupIndexBuffer(CIndexBuffer &ib) // *************************************************************************** +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif + } // NL3D diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp index ba471b8dd..706b0f0eb 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.cpp @@ -24,11 +24,15 @@ using namespace std; using namespace NLMISC; -namespace NL3D -{ - - +namespace NL3D { +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif // *************************************************************************** // *************************************************************************** @@ -103,10 +107,10 @@ bool CVertexArrayRangeNVidia::allocate(uint32 size, CVertexBuffer::TPreferredM H_AUTO_OGL(CVertexArrayRangeNVidia_allocate) nlassert(_VertexArrayPtr==NULL); -#ifdef NL_OS_WINDOWS // try to allocate AGP or VRAM data. switch(vbType) { +#ifdef NL_OS_WINDOWS case CVertexBuffer::AGPPreferred: _VertexArrayPtr= nwglAllocateMemoryNV(size, 0, 0, 0.5f); break; @@ -116,12 +120,9 @@ bool CVertexArrayRangeNVidia::allocate(uint32 size, CVertexBuffer::TPreferredM else _VertexArrayPtr= nwglAllocateMemoryNV(size, 0, 0, 0.5f); break; - default: - break; - } -#elif defined(NL_OS_UNIX) && !defined(NL_OS_MAC) - switch(vbType) - { +#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; @@ -131,11 +132,10 @@ bool CVertexArrayRangeNVidia::allocate(uint32 size, CVertexBuffer::TPreferredM else _VertexArrayPtr= nglXAllocateMemoryNV(size, 0, 0, 0.5f); break; +#endif // NL_OS_WINDOWS default: break; } -#endif // NL_OS_WINDOWS - // init the allocator. if(_VertexArrayPtr) @@ -175,7 +175,9 @@ void CVertexArrayRangeNVidia::free() #ifdef NL_OS_WINDOWS // Free special memory. nwglFreeMemoryNV(_VertexArrayPtr); -#elif defined(NL_OS_UNIX) && !defined(NL_OS_MAC) +#elif defined(NL_OS_MAC) + // TODO: implement for Mac OS X +#elif defined(NL_OS_UNIX) nglXFreeMemoryNV(_VertexArrayPtr); #endif // NL_OS_WINDOWS @@ -1217,7 +1219,7 @@ IVertexBufferHardGL *CVertexArrayRangeARB::createVBHardGL(uint size, CVertexBuff nglGenBuffersARB(1, &vertexBufferID); #endif - if (glGetError() != GL_NO_ERROR) return false; + if (glGetError() != GL_NO_ERROR) return NULL; _Driver->_DriverGLStates.forceBindARBVertexBuffer(vertexBufferID); switch(_VBType) { @@ -1254,7 +1256,7 @@ IVertexBufferHardGL *CVertexArrayRangeARB::createVBHardGL(uint size, CVertexBuff nglDeleteBuffersARB(1, &vertexBufferID); #endif - return false; + return NULL; } CVertexBufferHardARB *newVbHard= new CVertexBufferHardARB(_Driver, vb); newVbHard->initGL(vertexBufferID, this, _VBType); @@ -1664,6 +1666,8 @@ void CVertexBufferHardARB::invalidate() } #endif +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif -} - +} // NL3D diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.h b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.h index da454c558..6821392b5 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.h @@ -20,9 +20,15 @@ #include "nel/misc/types_nl.h" -namespace NL3D -{ +namespace NL3D { +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif class CDriverGL; class IVertexBufferHardGL; @@ -30,8 +36,6 @@ class CVertexBufferInfo; class CVertexBufferHardGLMapObjectATI; class CVertexBufferHardARB; - - // *************************************************************************** // *************************************************************************** // VBHard interface for both NVidia / ATI extension. @@ -573,6 +577,9 @@ public: #endif }; +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif } // NL3D @@ -580,24 +587,3 @@ public: #endif // NL_DRIVER_OPENGL_VERTEX_BUFFER_HARD_H /* End of driver_opengl_vertex_buffer_hard.h */ - - - - - - - - - - - - - - - - - - - - - diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp index 4915ed1d4..dbeede7e5 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp @@ -30,8 +30,15 @@ using namespace NLMISC; //#define DEBUG_SETUP_EXT_VERTEX_SHADER -namespace NL3D -{ +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif // *************************************************************************** CVertexProgamDrvInfosGL::CVertexProgamDrvInfosGL (CDriverGL *drv, ItVtxPrgDrvInfoPtrList it) : IVertexProgramDrvInfos (drv, it) @@ -43,6 +50,7 @@ CVertexProgamDrvInfosGL::CVertexProgamDrvInfosGL (CDriverGL *drv, ItVtxPrgDrvInf || drv->_Extensions.ARBVertexProgram ); +#ifndef USE_OPENGLES if (drv->_Extensions.NVVertexProgram) // NVIDIA implemntation { // Generate a program @@ -56,6 +64,7 @@ CVertexProgamDrvInfosGL::CVertexProgamDrvInfosGL (CDriverGL *drv, ItVtxPrgDrvInf { ID = nglGenVertexShadersEXT(1); // ATI implementation } +#endif } @@ -79,6 +88,8 @@ bool CDriverGL::isVertexProgramEmulated () const bool CDriverGL::activeNVVertexProgram (CVertexProgram *program) { H_AUTO_OGL(CVertexProgamDrvInfosGL_activeNVVertexProgram) + +#ifndef USE_OPENGLES // Setup or unsetup ? if (program) { @@ -188,6 +199,9 @@ bool CDriverGL::activeNVVertexProgram (CVertexProgram *program) // Ok return true; } +#endif + + return false; } @@ -200,10 +214,16 @@ inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate) { switch(comp) { +#ifdef USE_OPENGLES + case CVPSwizzle::X: return GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES; + case CVPSwizzle::Y: return GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES; + case CVPSwizzle::Z: return GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES; +#else 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; +#endif default: nlstop; return 0; @@ -214,10 +234,16 @@ inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate) { switch(comp) { +#ifdef USE_OPENGLES + case CVPSwizzle::X: return GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES; + case CVPSwizzle::Y: return GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES; + case CVPSwizzle::Z: return GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES; +#else 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; +#endif default: nlstop; return 0; @@ -231,7 +257,9 @@ inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate) */ static GLuint convOutputRegisterToEXTVertexShader(CVPOperand::EOutputRegister r) { - H_AUTO_OGL(convOutputRegisterToEXTVertexShader) + H_AUTO_OGL(convOutputRegisterToEXTVertexShader); + +#ifndef USE_OPENGLES switch (r) { case CVPOperand::OHPosition: return GL_OUTPUT_VERTEX_EXT; @@ -259,6 +287,8 @@ static GLuint convOutputRegisterToEXTVertexShader(CVPOperand::EOutputRegister r) nlstop; break; } +#endif + return 0; } @@ -310,6 +340,8 @@ static uint convInputRegisterToVBFlag(uint index) 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 : "; @@ -353,13 +385,15 @@ static void doSwizzle(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum ou } 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", @@ -369,6 +403,7 @@ static void doWriteMask(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outW ? 'w' : '-' ); #endif +#endif } // *************************************************************************** @@ -377,6 +412,8 @@ static void doWriteMask(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum 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; @@ -1157,7 +1194,9 @@ bool CDriverGL::setupEXTVertexShader(const CVPParser::TProgram &program, GLuint #endif return true; - +#else + return false; +#endif } //================================================================================================= @@ -1315,6 +1354,8 @@ static void ARBVertexProgramDumpInstr(const CVPInstruction &instr, std::string & bool CDriverGL::setupARBVertexProgram (const CVPParser::TProgram &inParsedProgram, GLuint id, bool &specularWritten) { H_AUTO_OGL(CDriverGL_setupARBVertexProgram) + +#ifndef USE_OPENGLES // tmp CVPParser::TProgram parsedProgram = inParsedProgram; // @@ -1449,6 +1490,9 @@ bool CDriverGL::setupARBVertexProgram (const CVPParser::TProgram &inParsedProgra #endif return true; +#else + return false; +#endif } @@ -1456,7 +1500,9 @@ bool CDriverGL::setupARBVertexProgram (const CVPParser::TProgram &inParsedProgra // *************************************************************************** bool CDriverGL::activeARBVertexProgram (CVertexProgram *program) { - H_AUTO_OGL(CDriverGL_activeARBVertexProgram) + H_AUTO_OGL(CDriverGL_activeARBVertexProgram); + +#ifndef USE_OPENGLES // Setup or unsetup ? if (program) { @@ -1520,13 +1566,18 @@ bool CDriverGL::activeARBVertexProgram (CVertexProgram *program) _VertexProgramEnabled = false; } return true; +#else + return false; +#endif } // *************************************************************************** bool CDriverGL::activeEXTVertexShader (CVertexProgram *program) { - H_AUTO_OGL(CDriverGL_activeEXTVertexShader) + H_AUTO_OGL(CDriverGL_activeEXTVertexShader); + +#ifndef USE_OPENGLES // Setup or unsetup ? if (program) { @@ -1594,6 +1645,9 @@ bool CDriverGL::activeEXTVertexShader (CVertexProgram *program) _VertexProgramEnabled = false; } return true; +#else + return false; +#endif } // *************************************************************************** @@ -1623,7 +1677,9 @@ bool CDriverGL::activeVertexProgram (CVertexProgram *program) void CDriverGL::setConstant (uint index, float f0, float f1, float f2, float f3) { - H_AUTO_OGL(CDriverGL_setConstant) + H_AUTO_OGL(CDriverGL_setConstant); + +#ifndef USE_OPENGLES // Vertex program exist ? if (_Extensions.NVVertexProgram) { @@ -1639,6 +1695,7 @@ void CDriverGL::setConstant (uint index, float f0, float f1, float f2, float f3) float datas[] = { f0, f1, f2, f3 }; nglSetInvariantEXT(_EVSConstantHandle + index, GL_FLOAT, datas); } +#endif } @@ -1646,7 +1703,9 @@ void CDriverGL::setConstant (uint index, float f0, float f1, float f2, float f3) void CDriverGL::setConstant (uint index, double d0, double d1, double d2, double d3) { - H_AUTO_OGL(CDriverGL_setConstant) + H_AUTO_OGL(CDriverGL_setConstant); + +#ifndef USE_OPENGLES // Vertex program exist ? if (_Extensions.NVVertexProgram) { @@ -1662,6 +1721,7 @@ void CDriverGL::setConstant (uint index, double d0, double d1, double d2, double double datas[] = { d0, d1, d2, d3 }; nglSetInvariantEXT(_EVSConstantHandle + index, GL_DOUBLE, datas); } +#endif } @@ -1669,7 +1729,9 @@ void CDriverGL::setConstant (uint index, double d0, double d1, double d2, double void CDriverGL::setConstant (uint index, const NLMISC::CVector& value) { - H_AUTO_OGL(CDriverGL_setConstant) + H_AUTO_OGL(CDriverGL_setConstant); + +#ifndef USE_OPENGLES // Vertex program exist ? if (_Extensions.NVVertexProgram) { @@ -1685,6 +1747,7 @@ void CDriverGL::setConstant (uint index, const NLMISC::CVector& value) float datas[] = { value.x, value.y, value.z, 0 }; nglSetInvariantEXT(_EVSConstantHandle + index, GL_FLOAT, datas); } +#endif } @@ -1692,7 +1755,9 @@ void CDriverGL::setConstant (uint index, const NLMISC::CVector& value) void CDriverGL::setConstant (uint index, const NLMISC::CVectorD& value) { - H_AUTO_OGL(CDriverGL_setConstant) + H_AUTO_OGL(CDriverGL_setConstant); + +#ifndef USE_OPENGLES // Vertex program exist ? if (_Extensions.NVVertexProgram) { @@ -1708,13 +1773,16 @@ void CDriverGL::setConstant (uint index, const NLMISC::CVectorD& value) 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) + H_AUTO_OGL(CDriverGL_setConstant); + +#ifndef USE_OPENGLES // Vertex program exist ? if (_Extensions.NVVertexProgram) { @@ -1734,12 +1802,15 @@ void CDriverGL::setConstant (uint index, uint num, const float *src) 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) + H_AUTO_OGL(CDriverGL_setConstant); + +#ifndef USE_OPENGLES // Vertex program exist ? if (_Extensions.NVVertexProgram) { @@ -1759,6 +1830,7 @@ void CDriverGL::setConstant (uint index, uint num, const double *src) nglSetInvariantEXT(_EVSConstantHandle + index + k, GL_DOUBLE, (void *) (src + 4 * k)); } } +#endif } // *************************************************************************** @@ -1767,7 +1839,11 @@ const uint CDriverGL::GLMatrix[IDriver::NumMatrix]= { GL_MODELVIEW, GL_PROJECTION, +#ifdef USE_OPENGLES + GL_MODELVIEW +#else GL_MODELVIEW_PROJECTION_NV +#endif }; @@ -1775,10 +1851,17 @@ const uint CDriverGL::GLMatrix[IDriver::NumMatrix]= 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 }; @@ -1786,7 +1869,9 @@ const uint CDriverGL::GLTransform[IDriver::NumTransform]= void CDriverGL::setConstantMatrix (uint index, IDriver::TMatrix matrix, IDriver::TTransform transform) { - H_AUTO_OGL(CDriverGL_setConstantMatrix) + H_AUTO_OGL(CDriverGL_setConstantMatrix); + +#ifndef USE_OPENGLES // Vertex program exist ? if (_Extensions.NVVertexProgram) { @@ -1856,6 +1941,7 @@ void CDriverGL::setConstantMatrix (uint index, IDriver::TMatrix matrix, IDriver: nglSetInvariantEXT(_EVSConstantHandle + index + 3, GL_FLOAT, matDatas + 12); } } +#endif } // *************************************************************************** @@ -1871,7 +1957,9 @@ void CDriverGL::setConstantFog (uint index) void CDriverGL::enableVertexProgramDoubleSidedColor(bool doubleSided) { - H_AUTO_OGL(CDriverGL_enableVertexProgramDoubleSidedColor) + H_AUTO_OGL(CDriverGL_enableVertexProgramDoubleSidedColor); + +#ifndef USE_OPENGLES // Vertex program exist ? if (_Extensions.NVVertexProgram) { @@ -1889,6 +1977,7 @@ void CDriverGL::enableVertexProgramDoubleSidedColor(bool doubleSided) else glDisable (GL_VERTEX_PROGRAM_TWO_SIDE_ARB); } +#endif } @@ -1900,5 +1989,8 @@ bool CDriverGL::supportVertexProgramDoubleSidedColor() const return _Extensions.NVVertexProgram || _Extensions.ARBVertexProgram; } +#ifdef NL_STATIC +} // NLDRIVERGL/ES +#endif } // NL3D diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index 6ebcff4c7..213959f61 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -22,24 +22,20 @@ // 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_WINDOWS -# include -#elif defined(NL_OS_MAC) +#ifdef NL_OS_MAC # import "mac/cocoa_window_delegate.h" # import "mac/cocoa_application_delegate.h" # import #elif defined (NL_OS_UNIX) -# include -# include -# 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 +# 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" @@ -50,8 +46,15 @@ using namespace std; using namespace NLMISC; -namespace NL3D -{ +namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif #ifdef NL_OS_WINDOWS @@ -110,7 +113,8 @@ bool GlWndProc(CDriverGL *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { - H_AUTO_OGL(DriverGL_WndProc) + H_AUTO_OGL(DriverGL_WndProc); + // Get the driver pointer.. CDriverGL *pDriver=(CDriverGL*)GetWindowLongPtr (hWnd, GWLP_USERDATA); bool trapMessage = false; @@ -342,9 +346,12 @@ bool CDriverGL::init (uint windowIcon, emptyProc exitFunc) #elif defined(NL_OS_MAC) // nothing to do + nlunreferenced(windowIcon); #elif defined (NL_OS_UNIX) + nlunreferenced(windowIcon); + _dpy = XOpenDisplay(NULL); if (_dpy == NULL) @@ -444,6 +451,7 @@ bool CDriverGL::unInit() #ifdef NL_OS_WINDOWS +#ifndef USE_OPENGLES // Off-screen rendering ? if (_PBuffer) { @@ -451,6 +459,7 @@ bool CDriverGL::unInit() nwglDestroyPbufferARB(_PBuffer); _PBuffer = NULL; } +#endif if (_Registered && !UnregisterClassW(L"NLClass", GetModuleHandle(NULL))) { @@ -606,14 +615,15 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re #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. - int pf; // Offscreen mode ? if (_CurrentMode.OffScreen) @@ -652,7 +662,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re _pfd.cAlphaBits = 8; } _pfd.iLayerType = PFD_MAIN_PLANE; - pf=ChoosePixelFormat(tempHDC,&_pfd); + int pf=ChoosePixelFormat(tempHDC,&_pfd); if (!pf) { nlwarning ("CDriverGL::setDisplay: ChoosePixelFormat failed"); @@ -695,7 +705,11 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re } // Register WGL functions +#ifdef USE_OPENGLES + registerEGlExtensions (_Extensions, tempHDC); +#else registerWGlExtensions (_Extensions, tempHDC); +#endif HDC hdc = wglGetCurrentDC (); @@ -854,11 +868,19 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re _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)) @@ -871,9 +893,15 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re { 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; @@ -898,43 +926,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re // associate OpenGL driver to window SetWindowLongPtr(_win, GWLP_USERDATA, (LONG_PTR)this); - - _hDC=GetDC(_win); - wglMakeCurrent(_hDC,NULL); - - _CurrentMode.Depth = uint8(GetDeviceCaps(_hDC,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.cStencilBits = 8; - } - _pfd.iLayerType = PFD_MAIN_PLANE; - pf=ChoosePixelFormat(_hDC,&_pfd); - if (!pf) - { - return false; - } - - if ( !SetPixelFormat(_hDC,pf,&_pfd) ) - { - return false; - } - _hRC=wglCreateContext(_hDC); - - wglMakeCurrent(_hDC,_hRC); + createContext(); } /// release old emitter @@ -1585,7 +1577,7 @@ bool CDriverGL::createWindow(const GfxMode &mode) { nlwarning("3D: Couldn't allocate XClassHint"); } - + #endif // NL_OS_UNIX _win = window; @@ -1615,7 +1607,19 @@ bool CDriverGL::destroyWindow() std::vector bitmaps; setWindowIcon(bitmaps); -#ifdef NL_OS_WINDOWS +#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); @@ -1633,12 +1637,24 @@ bool CDriverGL::destroyWindow() { ReleaseDC(_win, _hDC); _hDC = NULL; - - // don't destroy window if it hasn't been created by our driver - if (_DestroyWindow) - DestroyWindow(_win); } +#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) @@ -1654,16 +1670,8 @@ bool CDriverGL::destroyWindow() _EventEmitter.closeIM(); - if (_DestroyWindow) - { - if (_ctx) - glXDestroyContext(_dpy, _ctx); - - if (_win) - XDestroyWindow(_dpy, _win); - } - - _ctx = NULL; + if (_DestroyWindow && _win) + XDestroyWindow(_dpy, _win); // Ungrab the keyboard (probably not necessary); // XUnmapWindow(_dpy, _win); @@ -2366,6 +2374,150 @@ emptyProc 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() { @@ -2374,7 +2526,20 @@ bool CDriverGL::activate() if (_win == EmptyWindow) return false; -#ifdef NL_OS_WINDOWS +#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(); @@ -2393,7 +2558,7 @@ bool CDriverGL::activate() if (nctx != NULL && nctx != _ctx) glXMakeCurrent(_dpy, _win, _ctx); -#endif // NL_OS_WINDOWS +#endif // USE_OPENGLES return true; } @@ -2860,4 +3025,8 @@ bool CDriverGL::convertBitmapToIcon(const NLMISC::CBitmap &bitmap, std::vector -namespace NL3D -{ - class CDriverGL; - NSApplicationTerminateReply applicationShouldTerminate(CDriverGL*); -} +#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 { - NL3D::CDriverGL* _driver; + CDriverGL* _driver; } --(id)initWithDriver:(NL3D::CDriverGL*)driver; +-(id)initWithDriver:(CDriverGL*)driver; -(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender; @end diff --git a/code/nel/src/3d/driver/opengl/mac/cocoa_application_delegate.mm b/code/nel/src/3d/driver/opengl/mac/cocoa_application_delegate.mm index 2a667d13b..8fe0045b6 100644 --- a/code/nel/src/3d/driver/opengl/mac/cocoa_application_delegate.mm +++ b/code/nel/src/3d/driver/opengl/mac/cocoa_application_delegate.mm @@ -14,37 +14,35 @@ // 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" -namespace NL3D +static NSApplicationTerminateReply applicationShouldTerminate(CDriverGL* driver) { - NSApplicationTerminateReply applicationShouldTerminate(CDriverGL* driver) + // cancel if there is a driver and a custom exit handler set up + if(driver && driver->ExitFunc) { - // 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; + 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:(NL3D::CDriverGL*)driver +-(id)initWithDriver:(CDriverGL*)driver { if((self = [super init])) { @@ -56,7 +54,7 @@ namespace NL3D -(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender { - return NL3D::applicationShouldTerminate(_driver); + return applicationShouldTerminate(_driver); } @end diff --git a/code/nel/src/3d/driver/opengl/mac/cocoa_opengl_view.h b/code/nel/src/3d/driver/opengl/mac/cocoa_opengl_view.h index 8017433ec..e8acae926 100644 --- a/code/nel/src/3d/driver/opengl/mac/cocoa_opengl_view.h +++ b/code/nel/src/3d/driver/opengl/mac/cocoa_opengl_view.h @@ -18,21 +18,44 @@ namespace NL3D { + +#ifdef NL_STATIC +#ifdef USE_OPENGLES +namespace NLDRIVERGLES { +#else +namespace NLDRIVERGL { +#endif +#endif + class CDriverGL; - void viewDidResize(NSView*, 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; - NL3D::CDriverGL* _driver; + CDriverGL* _driver; } -(id)initWithFrame:(NSRect)frame; -(void)dealloc; -(void)keyDown:(NSEvent*)event; --(void)setDriver:(NL3D::CDriverGL*)driver; +-(void)setDriver:(CDriverGL*)driver; -(void)resizeWithOldSuperviewSize:(NSSize)oldBoundsSize; @end diff --git a/code/nel/src/3d/driver/opengl/mac/cocoa_opengl_view.m b/code/nel/src/3d/driver/opengl/mac/cocoa_opengl_view.m index 8ad1f91d4..17500389c 100644 --- a/code/nel/src/3d/driver/opengl/mac/cocoa_opengl_view.m +++ b/code/nel/src/3d/driver/opengl/mac/cocoa_opengl_view.m @@ -14,21 +14,18 @@ // 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" -namespace NL3D +static void viewDidResize(NSView* view, CDriverGL* driver) { - void viewDidResize(NSView* view, CDriverGL* driver) - { - NSRect rect = [[view superview] frame]; - driver->_CurrentMode.Height = rect.size.height; - driver->_CurrentMode.Width = rect.size.width; - } + NSRect rect = [[view superview] frame]; + driver->_CurrentMode.Height = rect.size.height; + driver->_CurrentMode.Width = rect.size.width; } - @implementation CocoaOpenGLView -(id)initWithFrame:(NSRect)frame @@ -55,7 +52,7 @@ namespace NL3D #endif } --(void)setDriver:(NL3D::CDriverGL*)driver +-(void)setDriver:(CDriverGL*)driver { _driver = driver; } @@ -67,7 +64,7 @@ namespace NL3D if(!_driver) return; - NL3D::viewDidResize(self, _driver); + viewDidResize(self, _driver); } /******************************************************************************/ diff --git a/code/nel/src/3d/driver/opengl/mac/cocoa_window_delegate.h b/code/nel/src/3d/driver/opengl/mac/cocoa_window_delegate.h index 4d3710b34..53078e95a 100644 --- a/code/nel/src/3d/driver/opengl/mac/cocoa_window_delegate.h +++ b/code/nel/src/3d/driver/opengl/mac/cocoa_window_delegate.h @@ -17,21 +17,25 @@ #import #include "AvailabilityMacros.h" -namespace NL3D -{ - class CDriverGL; - void windowDidMove(NSWindow*, NL3D::CDriverGL*); -} +#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 { - NL3D::CDriverGL* _driver; + CDriverGL* _driver; } -- (id)initWithDriver:(NL3D::CDriverGL*)driver; +- (id)initWithDriver:(CDriverGL*)driver; - (void)windowDidMove:(NSNotification*)notification; @end diff --git a/code/nel/src/3d/driver/opengl/mac/cocoa_window_delegate.mm b/code/nel/src/3d/driver/opengl/mac/cocoa_window_delegate.mm index c90c4f25d..a2eb54a6b 100644 --- a/code/nel/src/3d/driver/opengl/mac/cocoa_window_delegate.mm +++ b/code/nel/src/3d/driver/opengl/mac/cocoa_window_delegate.mm @@ -14,32 +14,30 @@ // 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" -namespace NL3D +static void windowDidMove(NSWindow* window, CDriverGL* driver) { - void windowDidMove(NSWindow* window, NL3D::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 screen with menu bar + NSRect screenRect = [[[NSScreen screens] objectAtIndex:0] frame]; - // get the rect (position, size) of the window - NSRect windowRect = [window frame]; + // get the rect (position, size) of the window + NSRect windowRect = [window frame]; - // set x in driver - driver->_WindowX = windowRect.origin.x; + // 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; - } + // 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:(NL3D::CDriverGL*)driver +-(id)initWithDriver:(CDriverGL*)driver { if((self = [super init])) { @@ -55,7 +53,7 @@ namespace NL3D if(!_driver) return; - NL3D::windowDidMove([notification object], _driver); + windowDidMove([notification object], _driver); } @end diff --git a/code/nel/src/3d/driver/opengl/stdopengl.h b/code/nel/src/3d/driver/opengl/stdopengl.h index f336b77c4..9e8be1104 100644 --- a/code/nel/src/3d/driver/opengl/stdopengl.h +++ b/code/nel/src/3d/driver/opengl/stdopengl.h @@ -32,6 +32,34 @@ #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" diff --git a/code/nel/src/3d/driver/opengles/CMakeLists.txt b/code/nel/src/3d/driver/opengles/CMakeLists.txt new file mode 100644 index 000000000..949d91a32 --- /dev/null +++ b/code/nel/src/3d/driver/opengles/CMakeLists.txt @@ -0,0 +1,84 @@ +FIND_PACKAGE(OpenGLES 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) + +SET(SOURCE_DIR ${CMAKE_SOURCE_DIR}/nel/src/3d/driver/opengl) + +FILE(GLOB SRC ${SOURCE_DIR}/*.cpp ${SOURCE_DIR}/*.h ${SOURCE_DIR}/*.def) + +IF(APPLE) + FILE(GLOB MAC_SRC ${SOURCE_DIR}/mac/*.h ${SOURCE_DIR}/mac/*.m ${SOURCE_DIR}/mac/*.mm ${SOURCE_DIR}/mac/*.cpp) + SET(SRC ${SRC} ${MAC_SRC}) + SET_SOURCE_FILES_PROPERTIES(${SRC} PROPERTIES COMPILE_FLAGS "-x objective-c++") +ENDIF(APPLE) + +INCLUDE_DIRECTORIES(${SOURCE_DIR} ${OPENGLES_INCLUDE_DIR}) + +ADD_DEFINITIONS(-DUSE_OPENGLES) + +IF(WIN32) + SET(NLDRV_OGLES_LIB "nel_drv_opengles_win") +ELSE(WIN32) + SET(NLDRV_OGLES_LIB "nel_drv_opengles") +ENDIF(WIN32) + +NL_TARGET_DRIVER(${NLDRV_OGLES_LIB} ${SRC}) + +TARGET_LINK_LIBRARIES(${NLDRV_OGLES_LIB} nel3d nelmisc ${OPENGLES_LIBRARIES}) +NL_DEFAULT_PROPS(${NLDRV_OGLES_LIB} "NeL, Driver, Video: OpenGL ES") +NL_ADD_LIB_SUFFIX(${NLDRV_OGLES_LIB}) +NL_ADD_RUNTIME_FLAGS(${NLDRV_OGLES_LIB}) + +IF(WIN32) + INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(${NLDRV_OGLES_LIB} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) + ADD_DEFINITIONS(/DDRIVER_OPENGLES_EXPORTS) +ENDIF(WIN32) + +IF(APPLE) + TARGET_LINK_LIBRARIES(${NLDRV_OGLES_LIB} ${CARBON}) + TARGET_LINK_LIBRARIES(${NLDRV_OGLES_LIB} ${COCOA}) +ENDIF(APPLE) + +IF(UNIX AND NOT APPLE) + TARGET_LINK_LIBRARIES(${NLDRV_OGLES_LIB} ${X11_X11_LIB}) + IF(XF86VidMode_FOUND) + INCLUDE_DIRECTORIES(${XF86VidMode_INCLUDE_DIR}) + ADD_DEFINITIONS(${XF86VidMode_DEFINITIONS}) + TARGET_LINK_LIBRARIES(${NLDRV_OGLES_LIB} ${XF86VidMode_LIBRARY}) + ENDIF(XF86VidMode_FOUND) + IF(X11_Xrandr_FOUND) + INCLUDE_DIRECTORIES(${X11_Xrandr_INCLUDE_PATH}) + ADD_DEFINITIONS(-DHAVE_XRANDR) + TARGET_LINK_LIBRARIES(${NLDRV_OGLES_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_OGLES_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_OGLES_LIB} ${X11_Xcursor_LIB}) + ENDIF(X11_Xcursor_FOUND) +ENDIF(UNIX AND NOT APPLE) + +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(${NLDRV_OGLES_LIB} ${SOURCE_DIR}/stdopengl.h ${SOURCE_DIR}/stdopengl.cpp) +ENDIF(WITH_PCH) + +IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS) + INSTALL(TARGETS ${NLDRV_OGLES_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) + IF(WITH_MAXPLUGIN) + INSTALL(TARGETS ${NLDRV_OGLES_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_user.cpp b/code/nel/src/3d/driver_user.cpp index 118e02141..102065bb1 100644 --- a/code/nel/src/3d/driver_user.cpp +++ b/code/nel/src/3d/driver_user.cpp @@ -69,25 +69,29 @@ UDriver::~UDriver() purgeMemory(); } - // *************************************************************************** void UDriver::setMatrixMode2D11() { setMatrixMode2D(CFrustum(0.0f,1.0f,0.0f,1.0f,-1.0f,1.0f,false)); } + // *************************************************************************** void UDriver::setMatrixMode2D43() { setMatrixMode2D(CFrustum(0.0f,4.0f/3.0f,0.0f,1.0f,-1.0f,1.0f,false)); } - // *************************************************************************** UDriver *UDriver::createDriver(uint windowIcon, bool direct3d, emptyProc exitFunc) { - return new CDriverUser (windowIcon, direct3d, exitFunc); + return new CDriverUser (windowIcon, direct3d ? CDriverUser::Direct3d:CDriverUser::OpenGl, exitFunc); } +// *************************************************************************** +UDriver *UDriver::createDriver(uint windowIcon, TDriver driver, emptyProc exitFunc) +{ + return new CDriverUser (windowIcon, (CDriverUser::TDriver)driver, exitFunc); +} // *************************************************************************** void UDriver::purgeMemory() @@ -110,9 +114,8 @@ bool CDriverUser::_StaticInit= false; // *************************************************************************** -CDriverUser::CDriverUser (uint windowIcon, bool direct3d, emptyProc exitFunc) +CDriverUser::CDriverUser (uint windowIcon, TDriver driver, emptyProc exitFunc) { - // The enum of IDriver and UDriver MUST be the same!!! nlassert((uint)IDriver::idCount == (uint)UDriver::idCount); nlassert((uint)IDriver::typeCount == (uint)UDriver::typeCount); @@ -134,13 +137,16 @@ CDriverUser::CDriverUser (uint windowIcon, bool direct3d, emptyProc exitFunc) // Create/Init Driver. #if defined(NL_OS_WINDOWS) - if (direct3d) + if (driver == Direct3d) _Driver= CDRU::createD3DDriver(); #endif - if (!_Driver) + if (!_Driver && driver == OpenGl) _Driver= CDRU::createGlDriver(); + if (!_Driver && driver == OpenGlEs) + _Driver= CDRU::createGlEsDriver(); + nlassert(_Driver); _Driver->init (windowIcon, exitFunc); diff --git a/code/nel/src/3d/dru.cpp b/code/nel/src/3d/dru.cpp index 6300dd698..4fd61d75d 100644 --- a/code/nel/src/3d/dru.cpp +++ b/code/nel/src/3d/dru.cpp @@ -64,6 +64,10 @@ extern IDriver* createGlDriverInstance (); extern IDriver* createD3DDriverInstance (); #endif +#ifdef NL_OPENGLES_AVAILABLE +extern IDriver* createGlEsDriverInstance (); +#endif + #endif // *************************************************************************** @@ -82,36 +86,25 @@ IDriver *CDRU::createGlDriver() throw (EDru) IDRV_CREATE_PROC createDriver = NULL; IDRV_VERSION_PROC versionDriver = NULL; -//#ifdef NL_OS_WINDOWS - - // WINDOWS code. -// HINSTANCE hInst; - -// hInst=LoadLibrary(NL3D_GL_DLL_NAME); CLibrary driverLib; #if defined(NL_OS_UNIX) && defined(NL_DRIVER_PREFIX) driverLib.addLibPath(NL_DRIVER_PREFIX); #endif -// if (!hInst) if (!driverLib.loadLibrary(NL3D_GL_DLL_NAME, true, true, false)) { throw EDruOpenglDriverNotFound(); } -// char buffer[1024], *ptr; -// SearchPath (NULL, NL3D_GL_DLL_NAME, NULL, 1023, buffer, &ptr); nlinfo ("Using the library '"NL3D_GL_DLL_NAME"' that is in the directory: '%s'", driverLib.getLibFileName().c_str()); -// createDriver = (IDRV_CREATE_PROC) GetProcAddress (hInst, IDRV_CREATE_PROC_NAME); createDriver = (IDRV_CREATE_PROC) driverLib.getSymbolAddress(IDRV_CREATE_PROC_NAME); if (createDriver == NULL) { throw EDruOpenglDriverCorrupted(); } -// versionDriver = (IDRV_VERSION_PROC) GetProcAddress (hInst, IDRV_VERSION_PROC_NAME); versionDriver = (IDRV_VERSION_PROC) driverLib.getSymbolAddress(IDRV_VERSION_PROC_NAME); if (versionDriver != NULL) { @@ -121,44 +114,67 @@ IDriver *CDRU::createGlDriver() throw (EDru) throw EDruOpenglDriverUnknownVersion(); } -//#elif defined (NL_OS_UNIX) -// -// void *handle = dlopen(NL3D_GL_DLL_NAME, RTLD_NOW); -// -// if (handle == NULL) -// { -// nlwarning ("when loading dynamic library '%s': %s", NL3D_GL_DLL_NAME, dlerror()); -// throw EDruOpenglDriverNotFound(); -// } -// -// /* Not ANSI. Might produce a warning */ -// createDriver = (IDRV_CREATE_PROC) dlsym (handle, IDRV_CREATE_PROC_NAME); -// if (createDriver == NULL) -// { -// nlwarning ("when getting function in dynamic library '%s': %s", NL3D_GL_DLL_NAME, dlerror()); -// throw EDruOpenglDriverCorrupted(); -// } -// -// versionDriver = (IDRV_VERSION_PROC) dlsym (handle, IDRV_VERSION_PROC_NAME); -// if (versionDriver != NULL) -// { -// if (versionDriver()IDriver::InterfaceVersion) -// throw EDruOpenglDriverUnknownVersion(); -// } -// -//#else // NL_OS_UNIX -//#error "Dynamic DLL loading not implemented!" -//#endif // NL_OS_UNIX - IDriver *ret= createDriver(); if (ret == NULL) { throw EDruOpenglDriverCantCreateDriver(); } - return ret; + return ret; +#endif +} + +// *************************************************************************** +IDriver *CDRU::createGlEsDriver() throw (EDru) +{ +#ifdef NL_STATIC + +#ifdef NL_OPENGLES_AVAILABLE + return createGlEsDriverInstance (); +#else + return NULL; +#endif // NL_OPENGLES_AVAILABLE + +#else + + IDRV_CREATE_PROC createDriver = NULL; + IDRV_VERSION_PROC versionDriver = NULL; + + CLibrary driverLib; + +#if defined(NL_OS_UNIX) && defined(NL_DRIVER_PREFIX) + driverLib.addLibPath(NL_DRIVER_PREFIX); +#endif + + if (!driverLib.loadLibrary(NL3D_GLES_DLL_NAME, true, true, false)) + { + throw EDruOpenglEsDriverNotFound(); + } + + nlinfo ("Using the library '"NL3D_GLES_DLL_NAME"' that is in the directory: '%s'", driverLib.getLibFileName().c_str()); + + createDriver = (IDRV_CREATE_PROC) driverLib.getSymbolAddress(IDRV_CREATE_PROC_NAME); + if (createDriver == NULL) + { + throw EDruOpenglDriverCorrupted(); + } + + versionDriver = (IDRV_VERSION_PROC) driverLib.getSymbolAddress(IDRV_VERSION_PROC_NAME); + if (versionDriver != NULL) + { + if (versionDriver()IDriver::InterfaceVersion) + throw EDruOpenglDriverUnknownVersion(); + } + + IDriver *ret= createDriver(); + if (ret == NULL) + { + throw EDruOpenglEsDriverCantCreateDriver(); + } + + return ret; #endif } @@ -181,31 +197,21 @@ IDriver *CDRU::createD3DDriver() throw (EDru) IDRV_CREATE_PROC createDriver = NULL; IDRV_VERSION_PROC versionDriver = NULL; - // WINDOWS code. -// HINSTANCE hInst; - -// hInst=LoadLibrary(NL3D_D3D_DLL_NAME); - CLibrary driverLib; -// if (!hInst) if (!driverLib.loadLibrary(NL3D_D3D_DLL_NAME, true, true, false)) { throw EDruDirect3dDriverNotFound(); } -// char buffer[1024], *ptr; -// SearchPath (NULL, NL3D_D3D_DLL_NAME, NULL, 1023, buffer, &ptr); nlinfo ("Using the library '"NL3D_D3D_DLL_NAME"' that is in the directory: '%s'", driverLib.getLibFileName().c_str()); -// createDriver = (IDRV_CREATE_PROC) GetProcAddress (hInst, IDRV_CREATE_PROC_NAME); createDriver = (IDRV_CREATE_PROC) driverLib.getSymbolAddress(IDRV_CREATE_PROC_NAME); if (createDriver == NULL) { throw EDruDirect3dDriverCorrupted(); } -// versionDriver = (IDRV_VERSION_PROC) GetProcAddress (hInst, IDRV_VERSION_PROC_NAME); versionDriver = (IDRV_VERSION_PROC) driverLib.getSymbolAddress(IDRV_VERSION_PROC_NAME); if (versionDriver != NULL) { @@ -220,8 +226,8 @@ IDriver *CDRU::createD3DDriver() throw (EDru) { throw EDruDirect3dDriverCantCreateDriver(); } - return ret; + return ret; #endif } #endif // NL_OS_WINDOWS diff --git a/code/nel/src/3d/patch_lightmap.cpp b/code/nel/src/3d/patch_lightmap.cpp index bd3886a71..8b91632d4 100644 --- a/code/nel/src/3d/patch_lightmap.cpp +++ b/code/nel/src/3d/patch_lightmap.cpp @@ -618,7 +618,7 @@ void CPatch::computeTileLightmapPixelAutomatic(uint ts, uint tt, uint s, uint t c= max(c, 0.f); sint ic; -#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) +#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) && defined(NL_USE_FASTFLOOR) // FastFloor using fistp. Don't care convention. float fc= c*256; _asm diff --git a/code/nel/src/3d/patch_noise.cpp b/code/nel/src/3d/patch_noise.cpp index 386fe98bd..6772c27b5 100644 --- a/code/nel/src/3d/patch_noise.cpp +++ b/code/nel/src/3d/patch_noise.cpp @@ -37,14 +37,14 @@ namespace NL3D // *************************************************************************** -#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) +#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) && defined(NL_USE_FASTFLOOR) /* This floor works only for floor with noise, because floor/ceil are only made on decimal coordinates: sTile =1.25 .... NB: because of difference of mapping (rare case), we may have sometimes values with precision < 1/4 (eg 1.125). Just use f*256 to compute the floor. NB: using a fastFloor() (fistp changing the controlfp() is not very a good idea here, because - computeNoise() are not "packed", so change on controlFp() would bee to frequent... + computeNoise() are not "packed", so change on controlFp() would bee too frequent... And also because we need either floor() or ceil() here. */ inline sint noiseFloor(float f) diff --git a/code/nel/src/3d/ps_sound.cpp b/code/nel/src/3d/ps_sound.cpp index e2366708a..d53e1d59f 100644 --- a/code/nel/src/3d/ps_sound.cpp +++ b/code/nel/src/3d/ps_sound.cpp @@ -43,7 +43,7 @@ CPSSound::CPSSound() : _Gain(1.f), { NL_PS_FUNC(CPSSound_CPSSound) if (CParticleSystem::getSerializeIdentifierFlag()) _Name = std::string("sound"); - _SoundName = NLMISC::CStringMapper::emptyId(); + _SoundName = NLMISC::CSheetId::Unknown /*NLMISC::CStringMapper::emptyId()*/; } // *************************************************************************************************** @@ -265,11 +265,11 @@ void CPSSound::serial(NLMISC::IStream &f) throw(NLMISC::EStream) { std::string soundName; f.serial(soundName); - _SoundName = NLMISC::CStringMapper::map(soundName); + _SoundName = NLMISC::CSheetId(soundName)/*NLMISC::CStringMapper::map(soundName)*/; } else { - std::string soundName = NLMISC::CStringMapper::unmap(_SoundName); + std::string soundName = _SoundName.toString()/*NLMISC::CStringMapper::unmap(_SoundName)*/; f.serial(soundName); } diff --git a/code/nel/src/misc/bit_mem_stream.cpp b/code/nel/src/misc/bit_mem_stream.cpp index c050d9c61..007b95cbc 100644 --- a/code/nel/src/misc/bit_mem_stream.cpp +++ b/code/nel/src/misc/bit_mem_stream.cpp @@ -599,7 +599,7 @@ void CBitMemStream::append( const CBitMemStream& newBits ) /* * Serial bitmemstream */ -void CBitMemStream::serialMemStream(CBitMemStream &b) +void CBitMemStream::serialMemStream(CMemStream &b) { #ifdef LOG_ALL_TRAFFIC sint32 bitpos = getPosInBit(); diff --git a/code/nel/src/misc/bitmap.cpp b/code/nel/src/misc/bitmap.cpp index 90afc460c..46076d413 100644 --- a/code/nel/src/misc/bitmap.cpp +++ b/code/nel/src/misc/bitmap.cpp @@ -3731,7 +3731,7 @@ void CBitmap::blend(CBitmap &Bm0, CBitmap &Bm1, uint16 factor, bool inputBitmapI { // On a P4 2GHz, with a 256x256 texture, I got the following results : // without mmx : 5.2 ms - // with mmx : 1.7 ms + // with mmx : 1.7 ms // I'm sure this can be further optimized.. uint numPixLeft = numPix & 1; // process 2 pixels at once, so special case for odd number diff --git a/code/nel/src/misc/bitmap_jpeg.cpp b/code/nel/src/misc/bitmap_jpeg.cpp index 835110d86..a4eaaa0b9 100644 --- a/code/nel/src/misc/bitmap_jpeg.cpp +++ b/code/nel/src/misc/bitmap_jpeg.cpp @@ -109,7 +109,7 @@ static void jpgDecompressSkip(j_decompress_ptr cinfo, long num_bytes) } } -static void jpgDecompressTerm(j_decompress_ptr cinfo) +static void jpgDecompressTerm(j_decompress_ptr /* cinfo */) { } diff --git a/code/nel/src/misc/co_task.cpp b/code/nel/src/misc/co_task.cpp index 1880be06c..c66941a40 100644 --- a/code/nel/src/misc/co_task.cpp +++ b/code/nel/src/misc/co_task.cpp @@ -237,12 +237,15 @@ namespace NLMISC _PImpl = new TCoTaskData(this); // _PImpl->_TaskThreadId = 0; // _PImpl->_ParentThreadId = 0; + nlunreferenced(stackSize); #else //NL_USE_THREAD_COTASK // allocate platform specific data storage _PImpl = new TCoTaskData; + nlunreferenced(stackSize); #if defined (NL_OS_WINDOWS) _PImpl->_Fiber = NULL; _PImpl->_ParentFiber = NULL; + nlunreferenced(stackSize); #elif defined(NL_OS_UNIX) // allocate the stack _PImpl->_Stack = new uint8[stackSize]; diff --git a/code/nel/src/misc/command.cpp b/code/nel/src/misc/command.cpp index 80d074386..f2b422d69 100644 --- a/code/nel/src/misc/command.cpp +++ b/code/nel/src/misc/command.cpp @@ -650,6 +650,9 @@ ICommand *CCommandRegistry::getCommand(const std::string &commandName) NLMISC_CATEGORISED_COMMAND(nel,help,"display help on a specific variable/commands or on all variables and commands", "[|]") { + nlunreferenced(rawCommandString); + nlunreferenced(quiet); + nlunreferenced(human); // nlassert (_Commands != NULL); // make sure we have a valid number of parameters diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 6d37c19ab..d89708c4e 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -373,6 +373,10 @@ uint32 humanReadableToBytes (const string &str) NLMISC_CATEGORISED_COMMAND(nel,btohr, "Convert a bytes number into an human readable number", "") { + nlunreferenced(rawCommandString); + nlunreferenced(quiet); + nlunreferenced(human); + if (args.size() != 1) return false; @@ -384,6 +388,10 @@ NLMISC_CATEGORISED_COMMAND(nel,btohr, "Convert a bytes number into an human read NLMISC_CATEGORISED_COMMAND(nel,hrtob, "Convert a human readable number into a bytes number", "
") { + nlunreferenced(rawCommandString); + nlunreferenced(quiet); + nlunreferenced(human); + if (args.size() != 1) return false; @@ -446,6 +454,10 @@ uint32 fromHumanReadable (const std::string &str) NLMISC_CATEGORISED_COMMAND(nel,stohr, "Convert a second number into an human readable time", "") { + nlunreferenced(rawCommandString); + nlunreferenced(quiet); + nlunreferenced(human); + if (args.size() != 1) return false; @@ -829,6 +841,7 @@ int nlfseek64( FILE *stream, sint64 offset, int origin ) return fsetpos (stream, &pos64); #else // NL_OS_WINDOWS + // TODO: to fix for Linux and Mac OS X // This code doesn't work under windows : fseek() implementation uses a signed 32 bits offset. What ever we do, it can't seek more than 2 Go. // For the moment, i don't know if it works under linux for seek of more than 2 Go. @@ -871,6 +884,9 @@ sint64 nlftell64(FILE *stream) } else return -1; #else + nlunreferenced(stream); + + // TODO: implement for Linux and Mac OS X nlerror("Not implemented"); return -1; #endif @@ -885,9 +901,14 @@ sint64 nlftell64(FILE *stream) NLMISC_CATEGORISED_COMMAND(nel, sleep, "Freeze the service for N seconds (for debug purpose)", "") { + nlunreferenced(rawCommandString); + nlunreferenced(quiet); + nlunreferenced(human); + if(args.size() != 1) return false; - sint32 n = atoi (args[0].c_str()); + sint32 n; + fromString(args[0], n); log.displayNL ("Sleeping during %d seconds", n); @@ -897,6 +918,10 @@ NLMISC_CATEGORISED_COMMAND(nel, sleep, "Freeze the service for N seconds (for de NLMISC_CATEGORISED_COMMAND(nel, system, "Execute the command line using system() function call (wait until the end of the command)", "") { + nlunreferenced(rawCommandString); + nlunreferenced(quiet); + nlunreferenced(human); + if(args.size() != 1) return false; string cmd = args[0]; @@ -915,6 +940,10 @@ NLMISC_CATEGORISED_COMMAND(nel, system, "Execute the command line using system() NLMISC_CATEGORISED_COMMAND(nel, launchProgram, "Execute the command line using launcProgram() function call (launch in background task without waiting the end of the execution)", " ") { + nlunreferenced(rawCommandString); + nlunreferenced(quiet); + nlunreferenced(human); + if(args.size() != 2) return false; string cmd = args[0]; @@ -927,6 +956,10 @@ NLMISC_CATEGORISED_COMMAND(nel, launchProgram, "Execute the command line using l NLMISC_CATEGORISED_COMMAND(nel, killProgram, "kill a program given the pid", "") { + nlunreferenced(rawCommandString); + nlunreferenced(quiet); + nlunreferenced(human); + if(args.size() != 1) return false; uint32 pid; fromString(args[0], pid); @@ -1030,6 +1063,9 @@ bool openDoc (const char *document) } else return true; +#else + // TODO: implement for Linux and Mac OS X + nlunreferenced(document); #endif // NL_OS_WINDOWS return false; } diff --git a/code/nel/src/misc/fast_floor.cpp b/code/nel/src/misc/fast_floor.cpp index 0c0aa9e02..fbbb1adac 100644 --- a/code/nel/src/misc/fast_floor.cpp +++ b/code/nel/src/misc/fast_floor.cpp @@ -24,7 +24,7 @@ int OptFastFloorCWStack[OptFastFloorCWStackSize]; int *OptFastFloorCWStackEnd = OptFastFloorCWStack + OptFastFloorCWStackSize; int *OptFastFloorCWStackPtr = OptFastFloorCWStack; -#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) +#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) && defined(NL_USE_FASTFLOOR) double OptFastFloorMagicConst = pow(2.0,52) + pow(2.0,51); float OptFastFloorMagicConst24 = (float)pow(2.0,23); diff --git a/code/nel/src/misc/log.cpp b/code/nel/src/misc/log.cpp index 6f4fa2464..24fded0cb 100644 --- a/code/nel/src/misc/log.cpp +++ b/code/nel/src/misc/log.cpp @@ -90,7 +90,7 @@ void CLog::setPosition (sint line, const char *fileName, const char *funcName) _Mutex.enter(); _PosSet++; _FileName = fileName; - _Line = line; + _Line = line; _FuncName = funcName; } } diff --git a/code/nel/src/misc/noise_value.cpp b/code/nel/src/misc/noise_value.cpp index 4b7cade1f..89b9a8ad4 100644 --- a/code/nel/src/misc/noise_value.cpp +++ b/code/nel/src/misc/noise_value.cpp @@ -18,7 +18,7 @@ #include "nel/misc/noise_value.h" #include "nel/misc/fast_floor.h" -#include "nel/misc/random.h" + namespace NLMISC @@ -45,8 +45,7 @@ public: CRandomGrid3D() { //seed - CRandom Random; - Random.srand(0); + srand(0); // init the grid for(uint z=0; z> 5; + uint v= rand() >> 5; _Texture3d[id]= v&255; } } @@ -81,9 +80,9 @@ public: // init LevelPhases. for(i=0; i #include #endif diff --git a/code/nel/src/sound/audio_mixer_user.cpp b/code/nel/src/sound/audio_mixer_user.cpp index 8bec4442c..b1f10cbe6 100644 --- a/code/nel/src/sound/audio_mixer_user.cpp +++ b/code/nel/src/sound/audio_mixer_user.cpp @@ -23,6 +23,7 @@ #include "nel/misc/command.h" #include "nel/misc/file.h" #include "nel/misc/path.h" +#include "nel/misc/sheet_id.h" #include "nel/georges/u_form_loader.h" #include "nel/georges/u_form_elm.h" @@ -221,6 +222,7 @@ void CAudioMixerUser::writeProfile(std::string& out) */ out += "Sound mixer: \n"; out += "\tPlaying sources: " + toString (getPlayingSourcesCount()) + " \n"; + out += "\tPlaying simple sources: " + toString(countPlayingSimpleSources()) + " / " + toString(countSimpleSources()) + " \n"; out += "\tAvailable tracks: " + toString (getAvailableTracksCount()) + " \n"; out += "\tUsed tracks: " + toString (getUsedTracksCount()) + " \n"; // out << "\tMuted sources: " << nb << " \n"; @@ -270,7 +272,8 @@ void CAudioMixerUser::reset() _SourceWaitingForPlay.clear(); - _MusicChannelFaders->reset(); + for (uint i = 0; i < _NbMusicChannelFaders; ++i) + _MusicChannelFaders[i].reset(); // Stop tracks uint i; @@ -1049,7 +1052,7 @@ public: items->getArrayValue(soundName, i); soundName = soundName.substr(0, soundName.find(".sound")); - cs.SoundNames.push_back(CStringMapper::map(soundName)); + cs.SoundNames.push_back(CSheetId(soundName)/*CStringMapper::map(soundName)*/); } if (!cs.SoundNames.empty()) @@ -1099,7 +1102,7 @@ void CAudioMixerUser::initUserVar() TUserVarControlsContainer::iterator first(_UserVarControls.begin()), last(_UserVarControls.end()); for(; first != last; ++first) { - std::vector::iterator first2(first->second.SoundNames.begin()), last2(first->second.SoundNames.end()); + std::vector::iterator first2(first->second.SoundNames.begin()), last2(first->second.SoundNames.end()); for (; first2 != last2; ++first2) { CSound *sound = getSoundId(*first2); @@ -1130,7 +1133,7 @@ void CAudioMixerUser::CControledSources::serial(NLMISC::IStream &s) for (uint i=0; igetSound(name); } @@ -1892,7 +1895,7 @@ retrySound: if (invalid) { - nlwarning("The sound %s contain an infinite recursion !", CStringMapper::unmap(id->getName()).c_str()); + nlwarning("The sound %s contain an infinite recursion !", id->getName().toString().c_str()/*CStringMapper::unmap(id->getName()).c_str()*/); return NULL; } @@ -2033,7 +2036,7 @@ retrySound: // ****************************************************************** -USource *CAudioMixerUser::createSource( const NLMISC::TStringId &name, bool spawn, TSpawnEndCallback cb, void *userParam, NL3D::CCluster *cluster, CSoundContext *context, UGroupController *groupController) +USource *CAudioMixerUser::createSource( const NLMISC::CSheetId &name, bool spawn, TSpawnEndCallback cb, void *userParam, NL3D::CCluster *cluster, CSoundContext *context, UGroupController *groupController) { return createSource( getSoundId( name ), spawn, cb, userParam, cluster, context, groupController); } @@ -2160,7 +2163,7 @@ bool CAudioMixerUser::unloadSampleBank(const std::string &name) // ****************************************************************** -void CAudioMixerUser::getSoundNames( std::vector &names ) const +void CAudioMixerUser::getSoundNames( std::vector &names ) const { _SoundBank->getNames(names); } @@ -2173,6 +2176,32 @@ uint CAudioMixerUser::getPlayingSourcesCount() const return _PlayingSources; } + +// ****************************************************************** + +uint CAudioMixerUser::countPlayingSimpleSources() const +{ + uint count = 0; + for (TSourceContainer::const_iterator it(_Sources.begin()), end(_Sources.end()); it != end; ++it) + { + if ((*it)->getType() == CSourceCommon::SOURCE_SIMPLE && (*it)->isPlaying()) + ++count; + } + return count; +} + +uint CAudioMixerUser::countSimpleSources() const +{ + uint count = 0; + for (TSourceContainer::const_iterator it(_Sources.begin()), end(_Sources.end()); it != end; ++it) + { + if ((*it)->getType() == CSourceCommon::SOURCE_SIMPLE) + ++count; + } + return count; +} + + // ****************************************************************** uint CAudioMixerUser::getAvailableTracksCount() const diff --git a/code/nel/src/sound/background_sound.cpp b/code/nel/src/sound/background_sound.cpp index 294a18c3f..24f94759f 100644 --- a/code/nel/src/sound/background_sound.cpp +++ b/code/nel/src/sound/background_sound.cpp @@ -84,7 +84,7 @@ void CBackgroundSound::importForm(const std::string& filename, NLGEORGES::UFormE // Read the sound name. std::string soundName; psoundItem->getValueByName(soundName, "Sound"); - sound.SoundName = CStringMapper::map(CFile::getFilenameWithoutExtension(soundName)); + sound.SoundName = NLMISC::CSheetId(CFile::getFilenameWithoutExtension(soundName));/*CStringMapper::map(CFile::getFilenameWithoutExtension(soundName))*/; // Read the environnement flag. @@ -133,7 +133,7 @@ void CBackgroundSound::getSubSoundList(std::vectorgetSoundId(first->SoundName); - subsounds.push_back(make_pair(CStringMapper::unmap(first->SoundName), sound)); + subsounds.push_back(make_pair(first->SoundName.toString()/*CStringMapper::unmap(first->SoundName)*/, sound)); } } diff --git a/code/nel/src/sound/background_sound_manager.cpp b/code/nel/src/sound/background_sound_manager.cpp index b40fff40b..ab05ab548 100644 --- a/code/nel/src/sound/background_sound_manager.cpp +++ b/code/nel/src/sound/background_sound_manager.cpp @@ -86,7 +86,7 @@ void CBackgroundSoundManager::addSound(const std::string &soundName, uint layerI CAudioMixerUser *mixer = CAudioMixerUser::instance(); TSoundData sd; - sd.SoundName = CStringMapper::map(soundName); + sd.SoundName = /*CStringMapper::map(soundName)*/ NLMISC::CSheetId(soundName); sd.Sound = mixer->getSoundId(sd.SoundName); sd.Source = 0; @@ -133,7 +133,7 @@ void CBackgroundSoundManager::addSound(const std::string &soundName, uint layerI } else { - nlwarning ("The sound '%s' can't be loaded", CStringMapper::unmap(sd.SoundName).c_str()); + nlwarning ("The sound '%s' can't be loaded", sd.SoundName.toString().c_str()/*CStringMapper::unmap(sd.SoundName).c_str()*/); } } @@ -1437,14 +1437,14 @@ void CBackgroundSoundManager::TSoundData::serial(NLMISC::IStream &s) { CAudioMixerUser *mixer = CAudioMixerUser::instance(); s.serial(str); - SoundName = NLMISC::CStringMapper::map(str); + SoundName = /*NLMISC::CStringMapper::map(str)*/ NLMISC::CSheetId(str); Sound = mixer->getSoundId(SoundName); Source = NULL; Selected = false; } else { - s.serial(const_cast(NLMISC::CStringMapper::unmap(SoundName))); + s.serial(const_cast(SoundName.toString()/*NLMISC::CStringMapper::unmap(SoundName)*/)); } s.serial(MinBox); s.serial(MaxBox); diff --git a/code/nel/src/sound/clustered_sound.cpp b/code/nel/src/sound/clustered_sound.cpp index 3a75ee4f4..d860e53d4 100644 --- a/code/nel/src/sound/clustered_sound.cpp +++ b/code/nel/src/sound/clustered_sound.cpp @@ -70,7 +70,7 @@ float EAX_MATERIAL_PARAM[] = class CSoundGroupSerializer { public: - std::vector > _SoundGroupAssoc; + std::vector > _SoundGroupAssoc; // load the values using the george sheet (called by GEORGE::loadForm) void readGeorges (const NLMISC::CSmartPtr &form, const std::string &/* name */) @@ -103,7 +103,7 @@ public: sound = sound.substr(0, n); } - _SoundGroupAssoc.push_back(make_pair(CStringMapper::map(soundGroup), CStringMapper::map(sound))); + _SoundGroupAssoc.push_back(make_pair(CSheetId(soundGroup), CSheetId(sound) /*CStringMapper::map(soundGroup), CStringMapper::map(sound)*/)); } } catch(...) @@ -131,15 +131,15 @@ public: s.serial(soundGroup); s.serial(sound); - _SoundGroupAssoc.push_back(make_pair(CStringMapper::map(soundGroup), CStringMapper::map(sound))); + _SoundGroupAssoc.push_back(make_pair(CSheetId(soundGroup), CSheetId(sound) /*CStringMapper::map(soundGroup), CStringMapper::map(sound)*/)); } else { std::string soundGroup; std::string sound; - soundGroup = CStringMapper::unmap(_SoundGroupAssoc[i].first); - sound = CStringMapper::unmap(_SoundGroupAssoc[i].second); + soundGroup = _SoundGroupAssoc[i].first.toString();// CStringMapper::unmap(_SoundGroupAssoc[i].first); + sound = _SoundGroupAssoc[i].second.toString(); //CStringMapper::unmap(_SoundGroupAssoc[i].second); s.serial(soundGroup); s.serial(sound); @@ -254,10 +254,10 @@ void CClusteredSound::update(const CVector &listenerPos, const CVector &/* view TClusterStatusMap::const_iterator first(_AudibleClusters.begin()), last(_AudibleClusters.end()); for (; first != last; ++first ) { - static NLMISC::TStringId NO_SOUND_GROUP = CStringMapper::emptyId(); + static NLMISC::CSheetId NO_SOUND_GROUP = /*CStringMapper::emptyId()*/NLMISC::CSheetId::Unknown; const CClusterSoundStatus &css = first->second; CCluster *cluster = first->first; - NLMISC::TStringId soundGroup; + NLMISC::CSheetId soundGroup; soundGroup = cluster->getSoundGroupId(); @@ -292,7 +292,7 @@ void CClusteredSound::update(const CVector &listenerPos, const CVector &/* view TStringStringMap::iterator it2(_SoundGroupToSound.find(soundGroup)); if (it2 != _SoundGroupToSound.end()) { - NLMISC::TStringId soundName = it2->second; + NLMISC::CSheetId soundName = it2->second; CClusterSound cs; // nldebug("Found the sound [%s] for sound group [%s]", CStringMapper::unmap(soundName).c_str(), CStringMapper::unmap(soundGroup).c_str()); diff --git a/code/nel/src/sound/complex_sound.cpp b/code/nel/src/sound/complex_sound.cpp index fbecbbcf2..292b36f25 100644 --- a/code/nel/src/sound/complex_sound.cpp +++ b/code/nel/src/sound/complex_sound.cpp @@ -19,6 +19,7 @@ #include "nel/misc/path.h" #include "nel/misc/common.h" #include "nel/sound/audio_mixer_user.h" +#include "nel/misc/sheet_id.h" using namespace std; using namespace NLMISC; @@ -63,11 +64,11 @@ void CComplexSound::parseSequence(const std::string &str, std::vector &s void CComplexSound::getSubSoundList(std::vector > &subsounds) const { CAudioMixerUser *mixer = CAudioMixerUser::instance(); - std::vector::const_iterator first(_Sounds.begin()), last(_Sounds.end()); + std::vector::const_iterator first(_Sounds.begin()), last(_Sounds.end()); for (; first != last; ++first) { CSound *sound = mixer->getSoundId(*first); - subsounds.push_back(make_pair(CStringMapper::unmap(*first), sound)); + subsounds.push_back(make_pair((*first).toString()/*CStringMapper::unmap(*first)*/, sound)); } } @@ -83,7 +84,7 @@ uint32 CComplexSound::getDuration() CAudioMixerUser *mixer = CAudioMixerUser::instance(); vector durations; - std::vector::iterator first(_Sounds.begin()), last(_Sounds.end()); + std::vector::iterator first(_Sounds.begin()), last(_Sounds.end()); for (; first != last; ++first) { CSound *sound = mixer->getSoundId(*first); @@ -204,7 +205,7 @@ float CComplexSound::getMaxDistance() const CComplexSound *This = const_cast(this); This->_MaxDist = 0.0f; - std::vector::const_iterator first(_Sounds.begin()), last(_Sounds.end()); + std::vector::const_iterator first(_Sounds.begin()), last(_Sounds.end()); for (; first != last; ++first) { @@ -236,7 +237,7 @@ void CComplexSound::serial(NLMISC::IStream &s) { std::string name; s.serial(name); - _Sounds.push_back(CStringMapper::map(name)); + _Sounds.push_back(/*CStringMapper::map(name)*/NLMISC::CSheetId(name)); } } else @@ -245,7 +246,7 @@ void CComplexSound::serial(NLMISC::IStream &s) s.serial(nb); for (uint i=0; igetArrayValue(soundname, i)) { soundname = CFile::getFilenameWithoutExtension(soundname); - _Sounds.push_back(CStringMapper::map(soundname)); + _Sounds.push_back(NLMISC::CSheetId(soundname)/*CStringMapper::map(soundname)*/); } } } diff --git a/code/nel/src/sound/complex_source.cpp b/code/nel/src/sound/complex_source.cpp index 8fad61a53..acaf30f8a 100644 --- a/code/nel/src/sound/complex_source.cpp +++ b/code/nel/src/sound/complex_source.cpp @@ -190,9 +190,9 @@ void CComplexSource::playStuf() case CComplexSound::MODE_ALL_IN_ONE: { // just spanw all the listed source. - const std::vector &sounds = _PatternSound->getSounds(); + const std::vector &sounds = _PatternSound->getSounds(); - std::vector::const_iterator first(sounds.begin()), last(sounds.end()); + std::vector::const_iterator first(sounds.begin()), last(sounds.end()); if (_AllSources.empty()) { @@ -524,7 +524,7 @@ void CComplexSource::onUpdate() else { // no sound after, just set an event at end of current sound to stop the complex sound. - nldebug("Setting last event for sound %s in %u millisec.", CStringMapper::unmap(_Source1->getSound()->getName()).c_str(), _Source1->getSound()->getDuration()); + nldebug("Setting last event for sound %s in %u millisec.", _Source1->getSound()->getName().toString().c_str()/*CStringMapper::unmap(_Source1->getSound()->getName()).c_str()*/, _Source1->getSound()->getDuration()); if (_PatternSound->doFadeOut()) { // set the event to begin fade out. diff --git a/code/nel/src/sound/context_sound.cpp b/code/nel/src/sound/context_sound.cpp index f18ecbed7..a7772276a 100644 --- a/code/nel/src/sound/context_sound.cpp +++ b/code/nel/src/sound/context_sound.cpp @@ -187,7 +187,7 @@ void CContextSound::init() } else { - nlassertex(nbJoker < SoundContextNbArgs, ("Error will trying to play ContextSound '%s'", CStringMapper::unmap(_Name).c_str())); + nlassertex(nbJoker < SoundContextNbArgs, ("Error will trying to play ContextSound '%s'", _Name.toString().c_str()/*CStringMapper::unmap(_Name).c_str()*/)); fromString(index, contextArgIndex[nbJoker++]); parseArg = false; index = ""; @@ -195,13 +195,13 @@ void CContextSound::init() } else if (*first == 'r') { - nlassertex(useRandom == false, ("Error will trying to play ContextSound '%s'", CStringMapper::unmap(_Name).c_str())); + nlassertex(useRandom == false, ("Error will trying to play ContextSound '%s'", _Name.toString().c_str()/*CStringMapper::unmap(_Name).c_str()*/)); useRandom = true; } } else if (*first == '%') { - nlassertex(useRandom == false, ("Error will trying to play ContextSound '%s'", CStringMapper::unmap(_Name).c_str())); + nlassertex(useRandom == false, ("Error will trying to play ContextSound '%s'", _Name.toString().c_str()/*CStringMapper::unmap(_Name).c_str()*/)); parseArg = true; } } @@ -215,7 +215,7 @@ void CContextSound::init() } else { - nlassertex(nbJoker < SoundContextNbArgs, ("Error will trying to play ContextSound '%s'", CStringMapper::unmap(_Name).c_str())); + nlassertex(nbJoker < SoundContextNbArgs, ("Error will trying to play ContextSound '%s'", _Name.toString().c_str()/*CStringMapper::unmap(_Name).c_str()*/)); fromString(index, contextArgIndex[nbJoker++]); parseArg = false; } @@ -247,7 +247,7 @@ void CContextSound::init() LM_CASE_CONTAINER_CREATOR(9) LM_CASE_CONTAINER_CREATOR(10) default: - nlwarning("Unsuported number of context argument in context sound '%s'!", CStringMapper::unmap(_Name).c_str()); + nlwarning("Unsuported number of context argument in context sound '%s'!", _Name.toString().c_str()/*CStringMapper::unmap(_Name).c_str()*/); return; } // cleanup macro @@ -257,14 +257,14 @@ void CContextSound::init() // ok, we have the container, now fill it with the sound { - std::vector allSounds; + std::vector allSounds; // CSoundBank::getSoundNames(allSounds); CAudioMixerUser::instance()->getSoundNames(allSounds); - std::vector::iterator first(allSounds.begin()), last(allSounds.end()); + std::vector::iterator first(allSounds.begin()), last(allSounds.end()); for (; first != last; ++first) { - const std::string &soundName = CStringMapper::unmap(*first); + const std::string &soundName = first->toString()/*CStringMapper::unmap(*first)*/; if (soundName.size() > _BaseName.size()) { uint i; diff --git a/code/nel/src/sound/driver/fmod/sound_driver_fmod.cpp b/code/nel/src/sound/driver/fmod/sound_driver_fmod.cpp index caad324be..617ed3473 100644 --- a/code/nel/src/sound/driver/fmod/sound_driver_fmod.cpp +++ b/code/nel/src/sound/driver/fmod/sound_driver_fmod.cpp @@ -22,6 +22,10 @@ #include "source_fmod.h" #include "buffer_fmod.h" +#ifdef NL_OS_WINDOWS +#include +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/group_controller.cpp b/code/nel/src/sound/group_controller.cpp index fef67a01b..d01e29252 100644 --- a/code/nel/src/sound/group_controller.cpp +++ b/code/nel/src/sound/group_controller.cpp @@ -42,7 +42,7 @@ using namespace std; namespace NLSOUND { CGroupController::CGroupController(CGroupController *parent) : - m_Parent(parent), m_DevGain(1.0f), m_UserGain(1.0f), m_NbSourcesInclChild(0) + m_Parent(parent), m_Gain(1.0f), m_NbSourcesInclChild(0) { } @@ -81,9 +81,7 @@ std::string CGroupController::getPath() // overridden by root if (it->second == this) { const std::string &name = it->first; - std::string returnPath = m_Parent->getPath() + "/" + name; - if (returnPath[0] == '/') - returnPath = returnPath.substr(1); + std::string returnPath = m_Parent->getPath() + ":" + name; return returnPath; } } diff --git a/code/nel/src/sound/group_controller_root.cpp b/code/nel/src/sound/group_controller_root.cpp index f49a40fff..0f1c58e63 100644 --- a/code/nel/src/sound/group_controller_root.cpp +++ b/code/nel/src/sound/group_controller_root.cpp @@ -39,6 +39,8 @@ using namespace std; // using namespace NLMISC; +#define NLSOUND_GROUP_CONTROLLER_ROOT_PATH "sound" + namespace NLSOUND { CGroupControllerRoot::CGroupControllerRoot() : CGroupController(NULL) @@ -53,7 +55,8 @@ CGroupControllerRoot::~CGroupControllerRoot() std::string CGroupControllerRoot::getPath() { - return ""; + // The root node is always called sound + return NLSOUND_GROUP_CONTROLLER_ROOT_PATH; } void CGroupControllerRoot::calculateFinalGain() @@ -75,15 +78,35 @@ void CGroupControllerRoot::decreaseSources() --m_NbSourcesInclChild; } +bool CGroupControllerRoot::isReservedName(const std::string &nodeName) +{ + // These node names are reserved, in case these category controllers can be integrated with CDB. + // I do not forsee any functionality for changing environment effect settings for entire categories. + // The nodeName parameter is already lowercase, see CGroupControllerRoot::getGroupController. + if (nodeName == NLSOUND_GROUP_CONTROLLER_ROOT_PATH) return true; // Root node name can only used by root. + if (nodeName == "gain") return true; + if (nodeName == "pitch") return true; + if (nodeName == "enable" || nodeName == "enabled") return true; + return false; +} + CGroupController *CGroupControllerRoot::getGroupController(const std::string &path) { std::vector pathNodes; - NLMISC::splitString(NLMISC::toLower(path), "/", pathNodes); + NLMISC::splitString(NLMISC::toLower(path), ":", pathNodes); CGroupController *active = this; - for (std::vector::iterator it(pathNodes.begin()), end(pathNodes.end()); it != end; ++it) + if (pathNodes[0] != NLSOUND_GROUP_CONTROLLER_ROOT_PATH) + { + nlerror("Root node for group controller must always be 'sound', invalid group '%s' requested", path.c_str()); + } + for (std::vector::iterator it(pathNodes.begin() + 1), end(pathNodes.end()); it != end; ++it) { if (!(*it).empty()) { + if (isReservedName(*it)) + { + nlerror("Attempt to use reserved node name '%s' in group controller path '%s'", (*it).c_str(), path.c_str()); + } std::map::iterator found = active->m_Children.find(*it); if (found == active->m_Children.end()) { diff --git a/code/nel/src/sound/simple_source.cpp b/code/nel/src/sound/simple_source.cpp index 7c76533e3..cce62cffd 100644 --- a/code/nel/src/sound/simple_source.cpp +++ b/code/nel/src/sound/simple_source.cpp @@ -134,6 +134,7 @@ void CSimpleSource::play() || (_RelativeMode ? getPos().sqrnorm() : (mixer->getListenPosVector() - getPos()).sqrnorm()) > _SimpleSound->getMaxDistance() * _SimpleSound->getMaxDistance()) { // The sample buffer is not available, don't play (we don't know the length) + _WaitingForPlay = false; if (_Spawn) { if (_SpawnEndCb != 0) @@ -175,7 +176,14 @@ void CSimpleSource::play() // and play the sound bool play = pSource->play(); + +#ifdef NL_DEBUG nlassert(play); +#else + if (!play) + nlwarning("Failed to play physical sound source. This is a serious error"); +#endif + // nldebug("CSimpleSource %p : REAL play done", (CAudioMixerUser::IMixerEvent*)this); } else diff --git a/code/nel/src/sound/sound.cpp b/code/nel/src/sound/sound.cpp index b1b644ed2..18425bb63 100644 --- a/code/nel/src/sound/sound.cpp +++ b/code/nel/src/sound/sound.cpp @@ -137,11 +137,11 @@ void CSound::serial(NLMISC::IStream &s) { std::string name; s.serial(name); - _Name = CStringMapper::map(name); + _Name = NLMISC::CSheetId(name);//CStringMapper::map(name); } else { - std::string name = CStringMapper::unmap(_Name); + std::string name = _Name.toString();//CStringMapper::unmap(_Name); s.serial(name); } @@ -170,7 +170,7 @@ void CSound::serial(NLMISC::IStream &s) void CSound::importForm(const std::string& filename, NLGEORGES::UFormElm& root) { // Name - _Name = CStringMapper::map(CFile::getFilenameWithoutExtension(filename)); + _Name = NLMISC::CSheetId(CFile::getFilenameWithoutExtension(filename));//CStringMapper::map(CFile::getFilenameWithoutExtension(filename)); // InternalConeAngle uint32 inner; diff --git a/code/nel/src/sound/sound_anim_marker.cpp b/code/nel/src/sound/sound_anim_marker.cpp index 76d08a1db..e4e2cac1f 100644 --- a/code/nel/src/sound/sound_anim_marker.cpp +++ b/code/nel/src/sound/sound_anim_marker.cpp @@ -41,7 +41,7 @@ void CSoundAnimMarker::play(UAudioMixer* mixer, NL3D::CCluster *cluster, CSoundC for (; first != last; ++first) { - USource* source = mixer->createSource((*first), true, NULL, NULL, cluster, &context); + USource* source = mixer->createSource(NLMISC::CSheetId(*first), true, NULL, NULL, cluster, &context); if (source != NULL) { source->setRelativeGain(context.RelativeGain); @@ -53,19 +53,19 @@ void CSoundAnimMarker::play(UAudioMixer* mixer, NL3D::CCluster *cluster, CSoundC // ******************************************************** -void CSoundAnimMarker::addSound(const NLMISC::TStringId& soundName) +void CSoundAnimMarker::addSound(const NLMISC::CSheetId& soundName) { pair inserted; inserted = _Sounds.insert(soundName); if (inserted.second == false) { - nlwarning("Duplicate sound (%s)", CStringMapper::unmap(soundName).c_str()); + nlwarning("Duplicate sound (%s)",/* CStringMapper::unmap(soundName).c_str()*/soundName.toString().c_str()); } } // ******************************************************** -void CSoundAnimMarker::removeSound(const NLMISC::TStringId &soundName) +void CSoundAnimMarker::removeSound(const NLMISC::CSheetId &soundName) { TMarkerSoundSet::iterator iter = _Sounds.find(soundName); if (iter != _Sounds.end()) @@ -74,13 +74,13 @@ void CSoundAnimMarker::removeSound(const NLMISC::TStringId &soundName) } else { - nlwarning("No sound was removed (%s)", CStringMapper::unmap(soundName).c_str()); + nlwarning("No sound was removed (%s)", soundName.toString().c_str()/*CStringMapper::unmap(soundName).c_str()*/); } } // ******************************************************** -void CSoundAnimMarker::getSounds(vector &sounds) +void CSoundAnimMarker::getSounds(vector &sounds) { sounds.insert(sounds.end(), _Sounds.begin(), _Sounds.end()); diff --git a/code/nel/src/sound/sound_animation.cpp b/code/nel/src/sound/sound_animation.cpp index 90ba1c123..ac3c1982d 100644 --- a/code/nel/src/sound/sound_animation.cpp +++ b/code/nel/src/sound/sound_animation.cpp @@ -73,7 +73,7 @@ void CSoundAnimation::save() { // File stream COFile file; - vector sounds; + vector sounds; // Open the file if (!file.open(_Filename.c_str())) @@ -108,11 +108,11 @@ void CSoundAnimation::save() marker->getSounds(sounds); - vector::iterator iter2; + vector::iterator iter2; for (iter2 = sounds.begin(); iter2 != sounds.end(); iter2++) { xmlNodePtr soundNode = xmlNewChild ( markerNode, NULL, (const xmlChar*)"SOUND", NULL ); - xmlSetProp (soundNode, (const xmlChar*)"name", (const xmlChar*) CStringMapper::unmap(*iter2).c_str()); + xmlSetProp (soundNode, (const xmlChar*)"name", (const xmlChar*)iter2->toString().c_str() /*CStringMapper::unmap(*iter2).c_str()*/); } sounds.clear(); @@ -190,7 +190,7 @@ void CSoundAnimation::load() throw NLMISC::Exception("Invalid sound animation marker"); } - marker->addSound(CStringMapper::map(string(name))); + marker->addSound(NLMISC::CSheetId(string(name))/*CStringMapper::map(string(name))*/); xmlFree ((void*)name); diff --git a/code/nel/src/sound/sound_bank.cpp b/code/nel/src/sound/sound_bank.cpp index dd2076a72..859ee9df3 100644 --- a/code/nel/src/sound/sound_bank.cpp +++ b/code/nel/src/sound/sound_bank.cpp @@ -128,7 +128,7 @@ void CSoundBank::addSound(CSound *sound) nlassert(ret.second); } -void CSoundBank::removeSound(const NLMISC::TStringId &name) +void CSoundBank::removeSound(const NLMISC::CSheetId &name) { _Sounds.erase(name); } @@ -152,10 +152,10 @@ public: {} // load the values using the george sheet (called by GEORGE::loadForm) - void readGeorges (const NLMISC::CSmartPtr &form, const std::string &name) + void readGeorges (const NLMISC::CSmartPtr &form, const NLMISC::CSheetId &name) { // just call the sound creation method with the xml form. - Sound = CSound::createSound(name, form->getRootNode()); + Sound = CSound::createSound(name.toString(), form->getRootNode()); // success ? // if (_Sound != 0) @@ -258,14 +258,16 @@ public: void CSoundBank::load(const std::string &packedSheetDir, bool packedSheetUpdate) { // this structure is fill by the loadForm() function and will contain all you need - std::map Container; + //std::map Container; + std::map Container; nlassert(!_Loaded); // Just call the GEORGE::loadFrom method to read all available sounds ::loadForm("sound", packedSheetDir + "sounds.packed_sheets", Container, packedSheetUpdate, false); _Loaded = true; // add all the loaded sound in the sound banks - std::map::iterator first(Container.begin()), last(Container.end()); + //std::map::iterator first(Container.begin()), last(Container.end()); + std::map::iterator first(Container.begin()), last(Container.end()); for (; first != last; ++first) { if (first->second.Sound != 0) @@ -328,7 +330,7 @@ bool CSoundBank::isLoaded() /* * Return a sound sample corresponding to a name. */ -CSound* CSoundBank::getSound(const NLMISC::TStringId &name) +CSound* CSoundBank::getSound(const NLMISC::CSheetId &name) { // Find sound TSoundTable::iterator iter = _Sounds.find(name); @@ -345,7 +347,7 @@ CSound* CSoundBank::getSound(const NLMISC::TStringId &name) /** * Return the names of the sounds */ -void CSoundBank::getNames( std::vector &names ) +void CSoundBank::getNames( std::vector &names ) { TSoundTable::const_iterator iter; for (iter = _Sounds.begin(); iter != _Sounds.end(); ++iter) diff --git a/code/nel/src/sound/source_music_channel.cpp b/code/nel/src/sound/source_music_channel.cpp index bd8f152e0..34735f113 100644 --- a/code/nel/src/sound/source_music_channel.cpp +++ b/code/nel/src/sound/source_music_channel.cpp @@ -48,12 +48,15 @@ CSourceMusicChannel::CSourceMusicChannel() : m_Source(NULL), m_Gain(1.0f) CSourceMusicChannel::~CSourceMusicChannel() { + nlassert(!m_Source); delete m_Source; m_Source = NULL; } bool CSourceMusicChannel::play(const std::string &filepath, bool async, bool loop) { + // delete previous source if any + // note that this waits for the source's thread to finish if the source was still playing if (m_Source) delete m_Source; @@ -71,12 +74,14 @@ bool CSourceMusicChannel::play(const std::string &filepath, bool async, bool loo void CSourceMusicChannel::stop() { + // stop but don't delete the source, deleting source may cause waiting for thread if (m_Source) m_Source->stop(); } void CSourceMusicChannel::reset() { + // forces the source to be deleted, happens when audio mixer is reset delete m_Source; m_Source = NULL; } @@ -96,7 +101,16 @@ void CSourceMusicChannel::resume() bool CSourceMusicChannel::isEnded() { if (m_Source) - return m_Source->isEnded(); + { + if (m_Source->isEnded()) + { + // we can delete the source now without worrying about thread wait + delete m_Source; + m_Source = NULL; + return true; + } + return false; + } return true; } diff --git a/code/nel/src/sound/stream_file_sound.cpp b/code/nel/src/sound/stream_file_sound.cpp index 4fc17b51c..34b121072 100644 --- a/code/nel/src/sound/stream_file_sound.cpp +++ b/code/nel/src/sound/stream_file_sound.cpp @@ -73,6 +73,13 @@ void CStreamFileSound::serial(NLMISC::IStream &s) void CStreamFileSound::setMusicFilePath(const std::string &filePath, bool async, bool loop) { +#if !FINAL_VERSION + //_Name = NLMISC::CStringMapper::map(std::string(""); + _Name = NLMISC::CSheetId(std::string(""); +#else + //_Name = NLMISC::CStringMapper::map(""); + _Name = NLMISC::CSheetId(""); +#endif _ConeInnerAngle = NLMISC::Pi * 2; _ConeOuterAngle = NLMISC::Pi * 2; _Looping = loop; diff --git a/code/nel/src/sound/stream_source.cpp b/code/nel/src/sound/stream_source.cpp index 1397e87ac..221b0529e 100644 --- a/code/nel/src/sound/stream_source.cpp +++ b/code/nel/src/sound/stream_source.cpp @@ -156,6 +156,7 @@ void CStreamSource::play() if ((_RelativeMode ? getPos().sqrnorm() : (mixer->getListenPosVector() - getPos()).sqrnorm()) > m_StreamSound->getMaxDistance() * m_StreamSound->getMaxDistance()) { // Source is too far to play + m_WaitingForPlay = false; if (_Spawn) { if (_SpawnEndCb != NULL) @@ -165,7 +166,6 @@ void CStreamSource::play() #ifdef NLSOUND_DEBUG_STREAM nldebug("CStreamSource %p : play FAILED, source is too far away !", (CAudioMixerUser::IMixerEvent*)this); #endif - // m_WaitingForPlay = false; // not necessary, delete ensures waiting for thread stop return; } @@ -221,13 +221,13 @@ void CStreamSource::play() else { // No source available, kill. + m_WaitingForPlay = false; if (_Spawn) { if (_SpawnEndCb != NULL) _SpawnEndCb(this, _CbUserParam); delete this; } - m_WaitingForPlay = false; return; } } @@ -269,6 +269,9 @@ void CStreamSource::play() #ifdef NL_DEBUG nlassert(play); +#else + if (!play) + nlwarning("Failed to play physical sound source. This is a serious error"); #endif } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/expandable_headerview.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/expandable_headerview.cpp index 7ae482824..2967be435 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/expandable_headerview.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/expandable_headerview.cpp @@ -22,7 +22,7 @@ #include #include -namespace Plugin +namespace GeorgesQt { ExpandableHeaderView::ExpandableHeaderView(Qt::Orientation orientation, QWidget * parent) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/expandable_headerview.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/expandable_headerview.h index 596bf5ba1..f7f26eafc 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/expandable_headerview.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/expandable_headerview.h @@ -20,7 +20,7 @@ // Qt includes #include -namespace Plugin +namespace GeorgesQt { class ExpandableHeaderView : public QHeaderView { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.cpp index 4d04bc6b5..be358d065 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.cpp @@ -37,7 +37,7 @@ #include "georgesform_proxy_model.h" #include "formitem.h" -namespace Plugin +namespace GeorgesQt { FormDelegate::FormDelegate(QObject *parent) @@ -275,4 +275,4 @@ namespace Plugin QRect r = option.rect; editor->setGeometry(r); } -} /* namespace Plugin */ +} /* namespace GeorgesQt */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.h index a309da1fc..486308536 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.h @@ -19,7 +19,7 @@ #include -namespace Plugin +namespace GeorgesQt { class FormDelegate : public QStyledItemDelegate diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.cpp index 205e18a52..68f29064d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.cpp @@ -23,7 +23,7 @@ #include #include -namespace Plugin +namespace GeorgesQt { CFormItem::CFormItem(NLGEORGES::UFormElm* elm, const QList &data, CFormItem *parent, diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.h index b85b12275..80efce5d5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.h @@ -24,7 +24,7 @@ #include #include -namespace Plugin +namespace GeorgesQt { class CFormItem diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges.cpp index b93f93ec4..50e007d90 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges.cpp @@ -28,7 +28,7 @@ using namespace NLGEORGES; -namespace Plugin +namespace GeorgesQt { CGeorges::CGeorges(): FormLoader(0) @@ -61,4 +61,4 @@ namespace Plugin return type; } -} /* namespace Plugin */ +} /* namespace GeorgesQt */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges.h index eb9a6b7da..6d7455d3b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges.h @@ -38,7 +38,7 @@ namespace NLGEORGES using namespace NLGEORGES; -namespace Plugin +namespace GeorgesQt { /** @@ -64,6 +64,6 @@ namespace Plugin };/* class CGeorges */ -} /* namespace Plugin */ +} /* namespace GeorgesQt */ #endif // GEORGES_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.cpp index de7a105ab..163ec7877 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.cpp @@ -23,7 +23,7 @@ // NeL includes -namespace Plugin +namespace GeorgesQt { CGeorgesDirTreeDialog::CGeorgesDirTreeDialog(QString ldPath, QWidget *parent) @@ -109,4 +109,4 @@ void CGeorgesDirTreeDialog::ldPathChanged(QString path) } } -} /* namespace NLQT */ \ No newline at end of file +} /* namespace GeorgesQt */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.h index fa783bca0..dc717617e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.h @@ -28,7 +28,7 @@ #include "ui_georges_dirtree_form.h" #include "georges_filesystem_model.h" -namespace Plugin +namespace GeorgesQt { class CGeorgesDirTreeDialog: public QDockWidget @@ -57,6 +57,6 @@ private Q_SLOTS: }; /* CGEorgesDirTreeDialog */ -} /* namespace NLQT */ +} /* namespace GeorgesQt */ #endif // GEORGES_DIRTREE_DIALOG_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_form.ui index 4a429af1f..e14857e89 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_form.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_form.ui @@ -44,6 +44,9 @@ 0 + + true + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_constants.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_constants.h index bb9fe3306..cccede9fc 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_constants.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_constants.h @@ -17,7 +17,7 @@ #ifndef GEORGES_EDITOR_CONSTANTS_H #define GEORGES_EDITOR_CONSTANTS_H -namespace Plugin +namespace GeorgesQt { namespace Constants { @@ -26,6 +26,6 @@ const char * const GEORGES_EDITOR_SECTION = "GeorgesEditor"; } // namespace Constants -} // namespace Plugin +} // namespace GeorgesQt #endif // GEORGES_EDITOR_CONSTANTS_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp index 252d7fd7e..c54c41638 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp @@ -33,7 +33,7 @@ #include #include -namespace Plugin +namespace GeorgesQt { GeorgesEditorForm::GeorgesEditorForm(QWidget *parent) @@ -63,7 +63,7 @@ namespace Plugin m_undoStack = new QUndoStack(this); - Core::MenuManager *menuManager = Core::ICore::instance()->menuManager(); + Core::MenuManager *menuManager = Core::ICore::instance()->menuManager(); m_openAction = menuManager->action(Core::Constants::OPEN); m_newAction = new QAction(tr("&New..."), this); @@ -92,6 +92,13 @@ namespace Plugin addDockWidget(Qt::LeftDockWidgetArea, m_georgesDirTreeDialog); restoreDockWidget(m_georgesDirTreeDialog); + // Set the default sheet dir dir to the level design path. + m_lastSheetDir = "."; + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + m_lastSheetDir = settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString(); + settings->endGroup(); + connect(Core::ICore::instance(), SIGNAL(changeSettings()), this, SLOT(settingsChanged())); connect(m_georgesDirTreeDialog, SIGNAL(selectedForm(const QString)), @@ -112,33 +119,30 @@ namespace Plugin void GeorgesEditorForm::open() { - /*qDebug() << "GeorgesEditorForm::open()"; - if (!m_dockedWidgets.size()) - { - m_dockedWidgets.append(new CGeorgesTreeViewDialog(m_mainDock)); - m_mainDock->addDockWidget(Qt::RightDockWidgetArea, m_dockedWidgets.last()); - } - else - { - m_dockedWidgets.append(new CGeorgesTreeViewDialog(m_mainDock)); - Q_ASSERT(m_dockedWidgets.size() > 1); - m_mainDock->tabifyDockWidget(m_dockedWidgets.at(m_dockedWidgets.size() - 2), m_dockedWidgets.last()); - }*/ - - // TODO: FileDialog & loadFile(); - //m_mainDock->addDockWidget(Qt::TopDockWidgetArea, new CGeorgesTreeViewDialog(m_mainDock, true)); - //m_mainDock->addDockWidget(Qt::LeftDockWidgetArea, new CGeorgesTreeViewDialog(m_mainDock, true)); - //QString fileName = QFileDialog::getOpenFileName(); - //loadFile(fileName); + QString fileName = QFileDialog::getOpenFileName(this, tr("Open Form")); + if(!fileName.isNull()) + loadFile(fileName); } - void GeorgesEditorForm::newFile() + void GeorgesEditorForm::newFile() { + // Assume it is a form, for now. We'll have to retrieve the DFN we'll be using as a base. + QString fileName = QFileDialog::getOpenFileName(this, tr("Select Base Form Definition"), m_lastSheetDir, "Form Definition (*.dfn)"); + if(!fileName.isNull()) + { + // Use the file loader to create the new form. + loadFile(fileName, true); + // Save the folder we just opened for future dialogs. + QFileInfo pathInfo( fileName ); + m_lastSheetDir = pathInfo.absolutePath(); + } } void GeorgesEditorForm::save() { + m_lastActiveDock->write(); + m_saveAction->setEnabled(false); } @@ -184,25 +188,18 @@ namespace Plugin } } - void GeorgesEditorForm::loadFile(const QString fileName) + void GeorgesEditorForm::loadFile(const QString fileName) + { + loadFile(fileName, false); + } + + void GeorgesEditorForm::loadFile(const QString fileName, bool loadFromDfn) { QFileInfo info(fileName); - if (!m_dockedWidgets.size()) + // Check to see if the form is already loaded, if it is just raise it. + if (m_dockedWidgets.size()) { - CGeorgesTreeViewDialog *dock = new CGeorgesTreeViewDialog(m_mainDock); - m_lastActiveDock = dock; - m_dockedWidgets.append(dock); - - m_mainDock->addDockWidget(Qt::RightDockWidgetArea, m_dockedWidgets.last()); - connect(m_dockedWidgets.last(), SIGNAL(closing()), - this, SLOT(closingTreeView())); - connect(m_dockedWidgets.last(), SIGNAL(visibilityChanged(bool)), - m_dockedWidgets.last(), SLOT(checkVisibility(bool))); - } - else - { - Q_FOREACH(CGeorgesTreeViewDialog *wgt, m_dockedWidgets) { if (info.fileName() == wgt->loadedForm) @@ -211,17 +208,38 @@ namespace Plugin return; } } - CGeorgesTreeViewDialog *dock = new CGeorgesTreeViewDialog(m_mainDock); - m_dockedWidgets.append(dock); + } - connect(m_dockedWidgets.last(), SIGNAL(closing()), - this, SLOT(closingTreeView())); - connect(m_dockedWidgets.last(), SIGNAL(visibilityChanged(bool)), - m_dockedWidgets.last(), SLOT(checkVisibility(bool))); - Q_ASSERT(m_dockedWidgets.size() > 1); + CGeorgesTreeViewDialog *dock = new CGeorgesTreeViewDialog(m_mainDock); + dock->setUndoStack(m_undoStack); + m_lastActiveDock = dock; + m_dockedWidgets.append(dock); + + connect(m_dockedWidgets.last(), SIGNAL(closing()), this, SLOT(closingTreeView())); + connect(m_dockedWidgets.last(), SIGNAL(visibilityChanged(bool)), m_dockedWidgets.last(), SLOT(checkVisibility(bool))); + + // If there is more than one form open - tabify the new form. If this is the first form open add it to the dock. + if(m_dockedWidgets.size() > 1) + { m_mainDock->tabifyDockWidget(m_dockedWidgets.at(m_dockedWidgets.size() - 2), m_dockedWidgets.last()); } - CForm *form = m_dockedWidgets.last()->getFormByName(info.fileName()); + else + { + m_mainDock->addDockWidget(Qt::RightDockWidgetArea, m_dockedWidgets.last()); + } + + // Retrieve the form and load the form. + NLGEORGES::CForm *form; + if(loadFromDfn) + { + // Get the form by DFN name. + form = m_dockedWidgets.last()->getFormByDfnName(info.fileName()); + } + else + { + form = m_dockedWidgets.last()->getFormByName(info.fileName()); + } + if (form) { m_dockedWidgets.last()->setForm(form); @@ -235,6 +253,7 @@ namespace Plugin } else { + nlwarning("Failed to load form: %s", info.fileName().toStdString().c_str()); m_dockedWidgets.last()->close(); } } @@ -284,4 +303,4 @@ namespace Plugin } } } -} /* namespace Plugin */ +} /* namespace GeorgesQt */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.h index 6b270ca3d..77fdd1ec8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.h @@ -23,7 +23,7 @@ // Qt includes #include -namespace Plugin +namespace GeorgesQt { class CGeorgesDirTreeDialog; @@ -41,6 +41,7 @@ public: public Q_SLOTS: void open(); void loadFile(const QString fileName); + void loadFile(const QString fileName, bool loadFromDfn); void newFile(); void save(); void settingsChanged(); @@ -66,10 +67,17 @@ private: QMainWindow *m_mainDock; + /// Contains a list of all of the open forms. QList m_dockedWidgets; + + /// Contains a pointer to the last known focal change for active documents. CGeorgesTreeViewDialog *m_lastActiveDock; + + /// Contains a record of the last directory a sheet file dialog was opened for. + QString m_lastSheetDir; + }; /* class GeorgesEditorForm */ -} /* namespace Plugin */ +} /* namespace GeorgesQt */ #endif // GEORGES_EDITOR_FORM_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp index 199bc20ca..7dd0be5cd 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp @@ -27,7 +27,7 @@ // Qt includes #include -namespace Plugin +namespace GeorgesQt { GeorgesEditorPlugin::~GeorgesEditorPlugin() @@ -97,4 +97,4 @@ QWidget *GeorgesEditorContext::widget() } -Q_EXPORT_PLUGIN(Plugin::GeorgesEditorPlugin) \ No newline at end of file +Q_EXPORT_PLUGIN(GeorgesQt::GeorgesEditorPlugin) \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.h index fabdd600c..e21d8c57a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.h @@ -38,7 +38,7 @@ namespace ExtensionSystem class IPluginSpec; } -namespace Plugin +namespace GeorgesQt { class GeorgesEditorForm; class GeorgesEditorPlugin : public QObject, public ExtensionSystem::IPlugin @@ -93,6 +93,6 @@ public: GeorgesEditorForm *m_georgesEditorForm; }; -} // namespace Plugin +} // namespace GeorgesQt #endif // LANDSCAPE_EDITOR_PLUGIN_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.cpp index 4e021f681..7f405fb75 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.cpp @@ -19,7 +19,7 @@ #include #include -namespace Plugin +namespace GeorgesQt { CGeorgesFileSystemModel::CGeorgesFileSystemModel(QString ldPath, QObject *parent) @@ -159,6 +159,6 @@ void CGeorgesFileSystemModel::checkLDPath() // } // return QSortFilterProxyModel::data(index, role); //} -} /* namespace NLQT */ +} /* namespace GeorgesQt */ /* end of file */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.h index 03eb5ecc2..6c7a26055 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.h @@ -20,7 +20,7 @@ #include #include -namespace Plugin +namespace GeorgesQt { class CGeorgesFileSystemModel : public QFileSystemModel @@ -74,6 +74,6 @@ private Q_SLOTS: // bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; //}; -} /* namespace NLQT */ +} /* namespace GeorgesQt */ #endif // GEORGES_FILESYSTEM_MODEL_H \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.cpp index 13b0dab03..5a38c4ecf 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.cpp @@ -21,12 +21,20 @@ #include #include #include +#include // NeL includes #include #include #include +#include #include +#include +#include + +// OVQT Includes +#include "../core/icore.h" +#include "../core/core_constants.h" // Project includes #include "georges.h" @@ -39,7 +47,7 @@ using namespace NLMISC; using namespace NLGEORGES; -namespace Plugin +namespace GeorgesQt { CGeorgesTreeViewDialog::CGeorgesTreeViewDialog(QWidget *parent /*= 0*/) @@ -50,6 +58,12 @@ namespace Plugin m_georges = new CGeorges; loadedForm = ""; + // Set the default sheet dir dir to the level design path. + m_lastSheetDir = "."; + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + m_lastSheetDir = settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString(); + settings->endGroup(); m_ui.setupUi(this); m_header = new ExpandableHeaderView(Qt::Horizontal, m_ui.treeView); @@ -65,6 +79,10 @@ namespace Plugin FormDelegate *formdelegate = new FormDelegate(this); m_ui.treeView->setItemDelegateForColumn(1, formdelegate); + // Set up custom context menu. + setContextMenuPolicy(Qt::CustomContextMenu); + connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showContextMenu(const QPoint&))); + connect(m_ui.treeView, SIGNAL(doubleClicked (QModelIndex)), this, SLOT(doubleClicked (QModelIndex))); connect(m_ui.checkBoxParent, SIGNAL(toggled(bool)), @@ -84,10 +102,12 @@ namespace Plugin void CGeorgesTreeViewDialog::headerClicked(int section) { if (section == 0) + { if (*(m_header->expanded())) m_ui.treeView->expandAll(); else m_ui.treeView->collapseAll(); + } } void CGeorgesTreeViewDialog::setForm(const CForm *form) @@ -95,11 +115,12 @@ namespace Plugin m_form = (UForm*)form; } - CForm* CGeorgesTreeViewDialog::getFormByName(const QString formName) + NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByName(const QString formName) { if(NLMISC::CPath::exists(formName.toStdString())) { - return (CForm*)m_georges->loadForm(formName.toStdString()); + //NLGEORGES::CForm *form = dynamic_cast(m_georges->loadForm(formName.toStdString())); + return (NLGEORGES::CForm *)m_georges->loadForm(formName.toStdString()); } //else //{ @@ -135,9 +156,58 @@ namespace Plugin // } // return form; //} + nlinfo("File '%s' does not exist!", formName.toStdString().c_str()); return 0; } + NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByDfnName(const QString dfnName) + { + if(NLMISC::CPath::exists(dfnName.toStdString())) + { + // Create a new form object. + NLGEORGES::CForm *form = new NLGEORGES::CForm(); + m_form = form; + + // Retrieve a copy of the root definition. + NLGEORGES::CFormDfn *formDfn = dynamic_cast(m_georges->loadFormDfn(dfnName.toStdString())); + + // Next we'll use the root node to build a new form. + NLGEORGES::CFormElmStruct *fes = dynamic_cast(getRootNode(0)); + fes->build(formDfn); + + // And then initialize the held elements; + for(uint i = 0; i(getRootNode(i+1)); + fes->build(formDfn); + } + + return form; + } + nlinfo("File '%s' does not exist!", dfnName.toStdString().c_str()); + return NULL; + } + + NLGEORGES::CFormElm *CGeorgesTreeViewDialog::getRootNode(uint slot) + { + NLGEORGES::CForm *form = getFormPtr(); + + if(slot == 0) + { + const NLGEORGES::UFormElm &formElm = form->getRootNode(); + return (NLGEORGES::CFormElm *)&formElm; + } + + // Make sure the slot value is valid and then return the corresponding element. + nlassert(slot < NLGEORGES::CForm::HeldElementCount+1); + return getFormPtr()->HeldElements[slot-1]; + } + + NLGEORGES::CForm *CGeorgesTreeViewDialog::getFormPtr() + { + return dynamic_cast(m_form); + } + void CGeorgesTreeViewDialog::loadFormIntoDialog(CForm *form) { @@ -150,7 +220,8 @@ namespace Plugin root = &m_form->getRootNode(); QStringList parents; - for (uint i = 0; i < m_form->getNumParent(); i++) + uint cnt = form->getParentCount(); + for (uint i = 0; i < cnt /*form->getParentCount()*/; i++) { UForm *u = m_form->getParentForm(i); parents << u->getFilename().c_str(); @@ -203,9 +274,34 @@ namespace Plugin } } - void CGeorgesTreeViewDialog::addParentForm(CForm *form) + void CGeorgesTreeViewDialog::addParentForm(QString parentFormNm) { - //((CForm*)_form)->insertParent(((CForm*)_form)->getParentCount(), form->getFilename().c_str(), form); + // Try to load the form + NLGEORGES::UForm *uParentForm = m_georges->loadForm(parentFormNm.toStdString()); + NLGEORGES::CForm *parentForm = dynamic_cast(uParentForm); + NLGEORGES::CForm *mainForm = static_cast(m_form); + + CGeorgesFormProxyModel * proxyModel = dynamic_cast(m_ui.treeView->model()); + CGeorgesFormModel *model = dynamic_cast(proxyModel->sourceModel()); + + if(parentForm) + { + if (mainForm != parentForm) + { + // Check it is the same dfn + if (parentForm->Elements.FormDfn == mainForm->Elements.FormDfn) + { + // This is the parent form selector + if(!mainForm->insertParent(mainForm->getParentCount(),parentFormNm.toStdString().c_str(), parentForm)) + nlwarning("Failed to add parent form: %s", parentFormNm.toStdString().c_str()); + else + { + nlinfo("Successfullyadded parent form: %s", parentFormNm.toStdString().c_str()); + model->addParentForm(parentFormNm); + } + } + } + } } void CGeorgesTreeViewDialog::modifiedFile( ) @@ -221,12 +317,12 @@ namespace Plugin void CGeorgesTreeViewDialog::write( ) { - //COFile file; - //std::string s = CPath::lookup(loadedForm.toStdString(), false); - //if (file.open (s)) - //{ - // try - // { + NLMISC::COFile file; + std::string s = NLMISC::CPath::lookup(loadedForm.toStdString(), false); + if(file.open (s)) + { + try + { // if (loadedForm.contains(".typ")) // { // //nlassert (Type != NULL); @@ -239,7 +335,7 @@ namespace Plugin // // flushValueChange (); // //} // //Type->write (xmlStream.getDocument (), theApp.Georges4CVS); - // //modify (NULL, NULL, false); + // //modify (NULL, NULL, false); // //flushValueChange (); // //UpdateAllViews (NULL); // //return TRUE; @@ -261,17 +357,17 @@ namespace Plugin // } // else // { - // nlassert (_form != NULL); + nlassert (m_form != NULL); - // // Write the file + // Write the file // /*if (IsModified ()) // { // ((CForm*)(UForm*)Form)->Header.MinorVersion++; // }*/ // //((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS); - // _form->write(file, false); - // setWindowTitle(windowTitle().remove("*")); - // _modified = false; + m_form->write(file, false); + setWindowTitle(windowTitle().remove("*")); + m_modified = false; // //if (strcmp (xmlStream.getErrorString (), "") != 0) // //{ // // char message[512]; @@ -285,16 +381,16 @@ namespace Plugin // // Get the left view // //CView* pView = getLeftView (); // } - // } - // catch (Exception &e) - // { - // nlerror("Error while loading file: %s", e.what()); - // } - //} - //else - //{ //if (!file.open()) - // nlerror("Can't open the file %s for writing.", s.c_str()); - //} + } + catch (Exception &e) + { + nlerror("Error while loading file: %s", e.what()); + } + } + else + { + nlerror("Can't open the file %s for writing.", s.c_str()); + } } void CGeorgesTreeViewDialog::doubleClicked ( const QModelIndex & index ) @@ -385,4 +481,121 @@ namespace Plugin } } -} /* namespace NLQT */ + void CGeorgesTreeViewDialog::showContextMenu(const QPoint &pos) + { + QMenu contextMenu; + QMenu *structContext = NULL; + QPoint globalPos = this->mapToGlobal(pos); + + // Fisrt we're going to see if we've right clicked on a new item and select it. + const QModelIndex &index = this->m_ui.treeView->currentIndex(); + + if(!index.isValid()) + return; + + CGeorgesFormProxyModel * mp = dynamic_cast(m_ui.treeView->model()); + CGeorgesFormModel *m = dynamic_cast(mp->sourceModel()); + QModelIndex sourceIndex = mp->mapToSource(index); + + if (m) + { + + CFormItem *item = m->getItem(sourceIndex); + + // Right click on the "parents" item + if (item->data(0) == "parents") + contextMenu.addAction("Add parent..."); + // Right click on a parent item + else if(item->parent() && item->parent()->data(0) == "parents") + { + contextMenu.addAction("Add parent..."); + contextMenu.addAction("Remove parent"); + } + else if(item->getFormElm()->isArray()) + contextMenu.addAction("Add array entry..."); + else if(item->getFormElm()->isStruct()) + { + QMenu *structContext = new QMenu("Add struct element...", this); + contextMenu.addMenu(structContext); + + NLGEORGES::UFormDfn *defn = item->getFormElm()->getStructDfn(); + if(defn) + { + for(uint defnNum=0; defnNum < defn->getNumEntry(); defnNum++) + { + std::string entryName; + std::string dummy; + UFormElm::TWhereIsValue *whereV = new UFormElm::TWhereIsValue; + bool result = defn->getEntryName(defnNum, entryName); + bool result2 = item->getFormElm()->getValueByName(dummy, entryName.c_str(), NLGEORGES::UFormElm::Eval, whereV); + + + if(result2 && *whereV != UFormElm::ValueForm) + { + structContext->addAction(entryName.c_str()); + } + delete whereV; + } + } + } + else if(item->getFormElm()->isAtom() && item->valueFrom() == NLGEORGES::UFormElm::ValueForm) + contextMenu.addAction("Revert to parent/default..."); + + QAction *selectedItem = contextMenu.exec(globalPos); + if(selectedItem) + { + if(selectedItem->text() == "Add parent...") + { + // Get the file extension of the form so we can build a dialog pattern. + QString file = m_form->getFilename().c_str(); + file = file.remove(0,file.indexOf(".")+1); + QString filePattern = "Parent Sheets (*."+file+")"; + + nlinfo("parent defn name '%s'", file.toStdString().c_str()); + QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Select parent sheets..."), m_lastSheetDir, filePattern); + if(!fileNames.isEmpty()) + { + Q_FOREACH(QString fileToParent, fileNames) + { + // Get just the filename. Georges doesn't want the path. + QFileInfo pathInfo( fileToParent ); + QString tmpFileName( pathInfo.fileName() ); + + nlinfo("requesting to add parent form '%s'", tmpFileName.toStdString().c_str()); + + // Call to add the form and load it into the Georges form. + addParentForm(tmpFileName); + + // Save the file lookup path for future dialog boxes. + m_lastSheetDir = pathInfo.absolutePath(); + } + } + m_ui.treeView->expandAll(); + } + else if(selectedItem->text() == "Remove parent") + { + NLGEORGES::CForm *form = static_cast(m_form); + QString parentFileName = item->data(0).toString(); + + for(uint num = 0; num < form->getParentCount(); num++) + { + QString curParentName = form->getParent(num)->getFilename().c_str(); + if(parentFileName == curParentName) + { + form->removeParent(num); + m->removeParentForm(parentFileName); + break; + } + } + + m_ui.treeView->expandAll(); + } + + } // if selected context menu item is valid. + } // if 'm' model valid. + + if(structContext) + delete structContext; + } + +} /* namespace GeorgesQt */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.h index 4992c9b23..53e36ec22 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.h @@ -22,6 +22,9 @@ // Qt includes #include +#include +#include + // STL includes @@ -33,11 +36,12 @@ namespace NLGEORGES { class UForm; class CForm; + class CFormElm; } using namespace NLGEORGES; -namespace Plugin +namespace GeorgesQt { class CGeorges; @@ -53,13 +57,27 @@ namespace Plugin bool isModified() {return m_modified;} void setModified(bool m) {m_modified = m;} - CForm* getFormByName(const QString); - void addParentForm(CForm *form); + NLGEORGES::CForm* getFormByName(const QString formName); + NLGEORGES::CForm* getFormByDfnName(const QString dfnName); + + /// Retrieves the root element based on the slot (document or held elements.) + NLGEORGES::CFormElm *getRootNode(uint slot); + + /// Returns the form as a CForm pointer. + NLGEORGES::CForm *getFormPtr(); + + void addParentForm(QString parentFormNm); void write ( ); QTabWidget* tabWidget() { return m_ui.treeViewTabWidget; } + void setUndoStack(QUndoStack *stack) { + m_undoStack = stack; + } + + + QString loadedForm; protected: @@ -75,6 +93,7 @@ namespace Plugin void loadFormIntoDialog(CForm *form = 0); void modifiedFile( ); void checkVisibility(bool); + void showContextMenu(const QPoint &pos); private Q_SLOTS: void doubleClicked ( const QModelIndex & index ); @@ -87,10 +106,15 @@ namespace Plugin UForm *m_form; CGeorges *m_georges; + QUndoStack *m_undoStack; + + /// Contains a record of the last directory a sheet file dialog was opened for. + QString m_lastSheetDir; + bool m_modified; }; /* CGeorgesTreeViewDialog */ -} /* namespace NLQT */ +} /* namespace GeorgesQt */ #endif // GEORGES_TREEVIEWER_DIALOG_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_form.ui index 183b16118..8d53bfdd6 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_form.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_form.ui @@ -63,6 +63,9 @@ 0 + + true + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.cpp index f6b9c441b..ca016e052 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.cpp @@ -40,16 +40,16 @@ using namespace NLGEORGES; -namespace Plugin +namespace GeorgesQt { CGeorgesFormModel::CGeorgesFormModel(UFormElm *rootElm, QMap< QString, QStringList> deps, QString comment, QStringList parents, bool *expanded, QObject *parent) : QAbstractItemModel(parent) { - QList rootData; - rootData << "Value" << "Data" << "Extra";// << "Type"; + + m_rootData << "Value" << "Data" << "Extra";// << "Type"; m_rootElm = rootElm; - m_rootItem = new CFormItem(m_rootElm, rootData); + m_rootItem = new CFormItem(m_rootElm, m_rootData); m_dependencies = deps; m_comments = comment; m_parents = parents; @@ -669,6 +669,27 @@ namespace Plugin Q_EMIT layoutAboutToBeChanged(); Q_EMIT layoutChanged(); } -} /* namespace Plugin */ + + void CGeorgesFormModel::addParentForm(QString parentForm) + { + beginResetModel(); + m_parents.push_back(parentForm); + delete m_rootItem; + m_rootItem = new CFormItem(m_rootElm, m_rootData); + setupModelData(); + endResetModel(); + } + + void CGeorgesFormModel::removeParentForm(QString parentForm) + { + beginResetModel(); + m_parents.removeOne(parentForm); + + delete m_rootItem; + m_rootItem = new CFormItem(m_rootElm, m_rootData); + setupModelData(); + endResetModel(); + } +} /* namespace GeorgesQt */ /* end of file */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.h index 0d8ce6e69..05fadc498 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.h @@ -29,7 +29,7 @@ namespace NLGEORGES { class UFormElm; } -namespace Plugin +namespace GeorgesQt { class CFormItem; @@ -56,6 +56,9 @@ namespace Plugin bool showDefaults() { return m_showDefaults;} void setShowParents( bool show ); void setShowDefaults( bool show ); + void addParentForm(QString parentForm); + void removeParentForm(QString parentForm); + NLGEORGES::UFormElm *getRootForm() { return m_rootElm; } private: void setupModelData(); @@ -64,6 +67,7 @@ namespace Plugin CFormItem* m_rootItem; NLGEORGES::UFormElm* m_rootElm; + QList m_rootData; QMap< QString, QStringList> m_dependencies; QString m_comments; QStringList m_parents; @@ -71,10 +75,10 @@ namespace Plugin bool m_showParents; bool m_showDefaults; - bool *m_expanded; + bool *m_expanded; };/* class CGeorgesFormModel */ -} /* namespace Plugin */ +} /* namespace GeorgesQt */ #endif // GEORGESFORM_MODEL_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_proxy_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_proxy_model.cpp index ae3720a57..a99997925 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_proxy_model.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_proxy_model.cpp @@ -23,7 +23,7 @@ #include "georgesform_proxy_model.h" #include "georgesform_model.h" -namespace Plugin +namespace GeorgesQt { bool CGeorgesFormProxyModel::filterAcceptsRow(int sourceRow, @@ -76,6 +76,6 @@ namespace Plugin { return QSortFilterProxyModel::filterAcceptsColumn(sourceRow, sourceParent); } -} /* namespace Plugin */ +} /* namespace GeorgesQt */ /* end of file */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_proxy_model.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_proxy_model.h index 570913dab..73c384a99 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_proxy_model.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_proxy_model.h @@ -20,7 +20,7 @@ // Qt includes #include -namespace Plugin +namespace GeorgesQt { class CGeorgesFormProxyModel : public QSortFilterProxyModel @@ -40,6 +40,6 @@ namespace Plugin };/* class CGeorgesFormProxyModel */ -} /* namespace NLQT */ +} /* namespace GeorgesQt */ #endif // GEORGESFORM_PROXY_MODEL_H diff --git a/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp b/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp index 50dcf910a..646028c2c 100644 --- a/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp +++ b/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp @@ -147,8 +147,9 @@ void readFormId( string& outputFileName ) // get the file type from form name TFormId fid = (*itIF).first; string fileType; + bool fileTypeGet = getFileType((*itIF).second, fileType); - if((*itIF).second.empty() || (*itIF).second=="." || (*itIF).second==".." || (*itIF).second[0]=='_' || (*itIF).second.find(".#")==0) + if((*itIF).second.empty() || (*itIF).second=="." || (*itIF).second==".." || ((*itIF).second[0]=='_' && fileType != "sound") || (*itIF).second.find(".#")==0) { map::iterator itErase = itIF; ++itIF; @@ -156,7 +157,7 @@ void readFormId( string& outputFileName ) } else { - if( getFileType( (*itIF).second, fileType ) ) + if(fileTypeGet) { // insert the association (file type/file type id) map::iterator itFT = FileTypeToId.find(fileType); @@ -290,7 +291,8 @@ void makeId( list& dirs ) //----------------------------------------------- void addId( string fileName ) { - if(fileName.empty() || fileName=="." || fileName==".." || fileName[0]=='_' || fileName.find(".#")==0) + string extStr = CFile::getExtension( fileName ); + if(fileName.empty() || fileName=="." || fileName==".." || (fileName[0]=='_' && extStr != "sound") || fileName.find(".#")==0) { //nlinfo("Discarding file '%s'", fileName.c_str()); NbFilesDiscarded++; @@ -300,7 +302,6 @@ void addId( string fileName ) { if( !ExtensionsAllowed.empty() ) { - string extStr = CFile::getExtension( fileName ); if( ExtensionsAllowed.find(extStr) == ExtensionsAllowed.end() ) { NbFilesDiscarded++; diff --git a/code/nel/tools/nel_unit_test/nel_unit_test.cpp b/code/nel/tools/nel_unit_test/nel_unit_test.cpp index ba9b8851c..45e579b13 100644 --- a/code/nel/tools/nel_unit_test/nel_unit_test.cpp +++ b/code/nel/tools/nel_unit_test/nel_unit_test.cpp @@ -34,6 +34,8 @@ using namespace std; #ifdef _MSC_VER +#include + /** A special stream buffer that output in the 'output debug string' feature of windows. */ class CDebugOutput : public streambuf diff --git a/code/ryzom/CMakeLists.txt b/code/ryzom/CMakeLists.txt index eb3d1c642..933e305b5 100644 --- a/code/ryzom/CMakeLists.txt +++ b/code/ryzom/CMakeLists.txt @@ -7,15 +7,6 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/common/src ) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/common ) SET(RZ_SERVER_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/server/src) -IF(WITH_STATIC) - FIND_PACKAGE(OpenSSL QUIET) - IF(OPENSSL_FOUND) - SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR}) - SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES}) - ENDIF(OPENSSL_FOUND) - SET(CURL_DEFINITIONS -DCURL_STATICLIB) -ENDIF(WITH_STATIC) - ADD_SUBDIRECTORY(common) IF(WITH_RYZOM_CLIENT) @@ -26,6 +17,30 @@ IF(WITH_RYZOM_CLIENT) ENDIF(WITH_LUA51) FIND_PACKAGE(Luabind REQUIRED) FIND_PACKAGE(CURL REQUIRED) + + IF(WIN32 OR CURL_LIBRARIES MATCHES "\\.a") + SET(CURL_STATIC ON) + ENDIF(WIN32 OR CURL_LIBRARIES MATCHES "\\.a") + + IF(CURL_STATIC) + SET(CURL_DEFINITIONS -DCURL_STATICLIB) + + FIND_PACKAGE(OpenSSL QUIET) + + IF(OPENSSL_FOUND) + SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR}) + SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES}) + ENDIF(OPENSSL_FOUND) + + # CURL Macports version depends on libidn, libintl and libiconv too + IF(APPLE) + FIND_LIBRARY(IDN_LIBRARY idn) + FIND_LIBRARY(INTL_LIBRARY intl) + + SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${IDN_LIBRARY} ${INTL_LIBRARY}) + ENDIF(APPLE) + ENDIF(CURL_STATIC) + FIND_PACKAGE(Libwww REQUIRED) ADD_SUBDIRECTORY(client) diff --git a/code/ryzom/client/client_default.cfg b/code/ryzom/client/client_default.cfg index 997699ca8..311b7cddd 100644 --- a/code/ryzom/client/client_default.cfg +++ b/code/ryzom/client/client_default.cfg @@ -80,7 +80,7 @@ XMLOutGameInterfaceFiles = { "out_v2_keys.xml", }; -TexturesInterface = "texture_interfaces_v3"; +TexturesInterface = "texture_interfaces_v3"; TexturesInterfaceDXTC = "texture_interfaces_dxtc"; @@ -561,12 +561,9 @@ HelpPages = }; WebIgMainDomain = "atys.ryzom.com"; - -WebIgTrustedDomains = -{ +WebIgTrustedDomains = { "atys.ryzom.com" }; - PatchletUrl = "http://atys.ryzom.com/start/app_patchlet.php?patch=preload"; SelectedSlot = 0; diff --git a/code/ryzom/client/macosx/Info.plist b/code/ryzom/client/macosx/Info.plist new file mode 100644 index 000000000..8072a90c1 --- /dev/null +++ b/code/ryzom/client/macosx/Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleExecutable + ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleGetInfoString + ${MACOSX_BUNDLE_INFO_STRING} + CFBundleIconFile + ${MACOSX_BUNDLE_ICON_FILE} + CFBundleIdentifier + ${MACOSX_BUNDLE_GUI_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + ${MACOSX_BUNDLE_LONG_VERSION_STRING} + CFBundleName + ${MACOSX_BUNDLE_BUNDLE_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + ${MACOSX_BUNDLE_SHORT_VERSION_STRING} + CFBundleSignature + ???? + CFBundleVersion + ${MACOSX_BUNDLE_BUNDLE_VERSION} + NSHumanReadableCopyright + ${MACOSX_BUNDLE_COPYRIGHT} + LSMinimumSystemVersion + ${CMAKE_OSX_DEPLOYMENT_TARGET}.0 + LSFileQuarantineEnabled + + CSResourcesFileMapped + + LSRequiresCarbon + + LSApplicationCategoryType + public.app-category.role-playing-games + + diff --git a/code/ryzom/client/macosx/PkgInfo b/code/ryzom/client/macosx/PkgInfo new file mode 100644 index 000000000..bd04210fb --- /dev/null +++ b/code/ryzom/client/macosx/PkgInfo @@ -0,0 +1 @@ +APPL???? \ No newline at end of file diff --git a/code/ryzom/client/macosx/ryzom.icns b/code/ryzom/client/macosx/ryzom.icns new file mode 100644 index 000000000..6fb077d96 Binary files /dev/null and b/code/ryzom/client/macosx/ryzom.icns differ diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index 3971fb98f..26c8eb12a 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -42,30 +42,39 @@ SOURCE_GROUP("r2" FILES ${SRC_R2}) # on Mac, create a .App Bundle if(APPLE) + IF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) + SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6") + ENDIF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) + SET(MACOSX_BUNDLE_INFO_STRING "Ryzom Core Client") - SET(MACOSX_BUNDLE_ICON_FILE "atys.icns") + SET(MACOSX_BUNDLE_ICON_FILE "ryzom.icns") SET(MACOSX_BUNDLE_GUI_IDENTIFIER "") SET(MACOSX_BUNDLE_LONG_VERSION_STRING ${NL_VERSION}) SET(MACOSX_BUNDLE_BUNDLE_NAME "Ryzom Core Client") SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "0.8") SET(MACOSX_BUNDLE_BUNDLE_VERSION "1.0") SET(MACOSX_BUNDLE_COPYRIGHT "Winchgate and The Ryzom Core Community") - - # TODO: in release mode, cmake could copy all the dylibs into the .app - # bundle for redistribution... should some part of cpack handle that? - # ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD - # # make frameworks directory in app bundle - # COMMAND ${CMAKE_COMMAND} -E make_directory - # ${CMAKE_CURRENT_BINARY_DIR}/ryzom_client.app/Contents/Frameworks - # # copy framework into app bundle - # COMMAND ${CMAKE_COMMAND} -E copy ${SOME_LIBRARY} - # ${CMAKE_CURRENT_BINARY_DIR}/ryzom_client.app/Contents/Frameworks - # # ... - # # install_name_tool the lib pathes + SET(RYZOM_OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${MACOSX_BUNDLE_BUNDLE_NAME}.app) + SET(RYZOM_CONTENTS_DIR ${RYZOM_OUTPUT_DIR}/Contents) + SET(RYZOM_RESOURCES_DIR ${RYZOM_CONTENTS_DIR}/Resources) + SET(MAC_RESOURCES_DIR ${CMAKE_SOURCE_DIR}/ryzom/client/macosx) ENDIF(APPLE) ADD_EXECUTABLE(ryzom_client WIN32 MACOSX_BUNDLE ${SRC} ${SRC_INTERFACE} ${SRC_MODE} ${SRC_R2}) +IF(APPLE) + SET_TARGET_PROPERTIES(ryzom_client PROPERTIES OUTPUT_NAME ${MACOSX_BUNDLE_BUNDLE_NAME}) + SET_TARGET_PROPERTIES(ryzom_client PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${MAC_RESOURCES_DIR}/Info.plist) + ADD_CUSTOM_COMMAND(TARGET ryzom_client PRE_BUILD COMMAND mkdir -p ${RYZOM_RESOURCES_DIR}) + ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS ${MAC_RESOURCES_DIR}/PkgInfo ${RYZOM_CONTENTS_DIR}) + ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS ${MAC_RESOURCES_DIR}/ryzom.icns ${RYZOM_RESOURCES_DIR}) + ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS ${CMAKE_SOURCE_DIR}/ryzom/client/client_default.cfg ${RYZOM_RESOURCES_DIR}) + + IF(RYZOM_DATA_DIR) + ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp -R ARGS ${RYZOM_DATA_DIR} ${RYZOM_RESOURCES_DIR}) + ENDIF(RYZOM_DATA_DIR) +ENDIF(APPLE) + INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${LIBXML2_INCLUDE_DIR} diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index e0ed33abe..ec2ce131a 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -419,7 +419,7 @@ CClientConfig::CClientConfig() // only force patching under Windows by default #ifdef NL_OS_WINDOWS - PatchWanted = true; + PatchWanted = false;//true; #else PatchWanted = false; #endif @@ -841,6 +841,7 @@ void CClientConfig::setValues() if (nlstricmp(varPtr->asString(), "Auto") == 0 || nlstricmp(varPtr->asString(), "0") == 0) ClientCfg.Driver3D = CClientConfig::DrvAuto; else if (nlstricmp(varPtr->asString(), "OpenGL") == 0 || nlstricmp(varPtr->asString(), "1") == 0) ClientCfg.Driver3D = CClientConfig::OpenGL; else if (nlstricmp(varPtr->asString(), "Direct3D") == 0 || nlstricmp(varPtr->asString(), "2") == 0) ClientCfg.Driver3D = CClientConfig::Direct3D; + else if (nlstricmp(varPtr->asString(), "OpenGLES") == 0 || nlstricmp(varPtr->asString(), "3") == 0) ClientCfg.Driver3D = CClientConfig::OpenGLES; } else cfgWarning ("Default value used for 'Driver3D' !!!"); diff --git a/code/ryzom/client/src/client_cfg.h b/code/ryzom/client/src/client_cfg.h index 3925aaf2d..9f4787062 100644 --- a/code/ryzom/client/src/client_cfg.h +++ b/code/ryzom/client/src/client_cfg.h @@ -53,7 +53,7 @@ using std::string; //--------------------------------------------------- struct CClientConfig { - enum TDriver3D { DrvAuto = 0, OpenGL, Direct3D }; + enum TDriver3D { DrvAuto = 0, OpenGL, Direct3D, OpenGLES }; enum TDriverSound { SoundDrvAuto = 0, SoundDrvFMod, SoundDrvOpenAL, SoundDrvDirectSound, SoundDrvXAudio2 }; enum TStageLCTUsage { StageUseNoLCT = 0, StageUseAllLCT, StageUsePosOnlyLCT }; diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index f62d8f245..84c9a9ec5 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -5055,14 +5055,14 @@ NLMISC_COMMAND(reloadFogMaps, "Force to reload all the fog maps", "<>") NLMISC_COMMAND(dumpSounds, "Dump names of all loaded sound", "<>") { if (!args.empty()) return false; - std::vector sounds; + std::vector sounds; extern CSoundManager *SoundMngr; if (!SoundMngr) return false; if (!SoundMngr->getMixer()) return false; SoundMngr->getMixer()->getSoundNames(sounds); for(uint k = 0; k < sounds.size(); ++k) { - nlinfo(NLMISC::CStringMapper::unmap(sounds[k]).c_str()); + nlinfo(sounds[k].toString()/*NLMISC::CStringMapper::unmap(sounds[k])*/.c_str()); } return true; } diff --git a/code/ryzom/client/src/connection.cpp b/code/ryzom/client/src/connection.cpp index 32962cd93..75a87ce6b 100644 --- a/code/ryzom/client/src/connection.cpp +++ b/code/ryzom/client/src/connection.cpp @@ -2006,7 +2006,8 @@ public: virtual void execute (CCtrlBase * /* pCaller */, const string &Params) { string sName = getParam(Params, "name"); - TStringId id = CStringMapper::map(sName); + //TStringId id = CStringMapper::map(sName); + CSheetId id = CSheetId(sName); if (SoundMngr != NULL) SoundMngr->spawnSource(id,CVector(0,0,0)); } diff --git a/code/ryzom/client/src/ground_fx_manager.cpp b/code/ryzom/client/src/ground_fx_manager.cpp index 92267dd2a..2d3ce3810 100644 --- a/code/ryzom/client/src/ground_fx_manager.cpp +++ b/code/ryzom/client/src/ground_fx_manager.cpp @@ -64,7 +64,7 @@ CGroundFXManager::CGroundFXManager() : _MinSpeed(1.5f), _MaxSpeed(6.f), _SpeedWaterWalkFast(3.f), - _SpeedWaterSwimFast(3.f), + _SpeedWaterSwimFast(2.f), _MaxDist(50.f), _MaxNumFX(10), _NumFX(0), @@ -495,7 +495,7 @@ void CGroundFXManager::update(const NLMISC::CVectorD &camPos) break; case CInstance::Swim: if (speed == 0.f) fxName = "StepSwimIdle.ps"; - else if (speed > _SpeedWaterWalkFast) + else if (speed > _SpeedWaterSwimFast) { fxName = "StepSwimSpeed.ps"; fxNameUnderWater = "StepSwimSpeedUnderWater.ps"; diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index a43dd97c0..ef48fe603 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -819,33 +819,43 @@ void prelogInit() nmsg = "Creating 3d driver..."; ProgressBar.newMessage ( ClientCfg.buildLoadingString(nmsg) ); - bool direct3D = false; + UDriver::TDriver driver = UDriver::OpenGl; #ifdef NL_OS_WINDOWS + uint icon = (uint)LoadIcon(HInstance, MAKEINTRESOURCE(IDI_MAIN_ICON)); +#else + uint icon = 0; +#endif // NL_OS_WINDOWS + switch(ClientCfg.Driver3D) { case CClientConfig::DrvAuto: +#ifdef NL_OS_WINDOWS { // Fallback to D3D for card other than nVidia std::string deviceName; uint64 drvVersion; - CSystemInfo::getVideoInfo( deviceName, drvVersion); + CSystemInfo::getVideoInfo(deviceName, drvVersion); strlwr(deviceName); - direct3D = strstr(deviceName.c_str(), NVIDIA_RECOMMANDED_DRIVERS_STRING_TEST) == NULL; + driver = strstr(deviceName.c_str(), NVIDIA_RECOMMANDED_DRIVERS_STRING_TEST) == NULL ? UDriver::Direct3d:UDriver::OpenGl; } break; - case CClientConfig::OpenGL: - direct3D = false; - break; case CClientConfig::Direct3D: - direct3D = true; + driver = UDriver::Direct3d; + break; +#endif // NL_OS_WINDOWS + case CClientConfig::OpenGL: + driver = UDriver::OpenGl; + break; + case CClientConfig::OpenGLES: + driver = UDriver::OpenGlEs; + break; + default: break; } - Driver = UDriver::createDriver ((uint)LoadIcon (HInstance, MAKEINTRESOURCE(IDI_MAIN_ICON)), direct3D); -#else // NL_OS_WINDOWS - Driver = UDriver::createDriver (); -#endif // NL_OS_WINDOWS + Driver = UDriver::createDriver(icon, driver); + if(Driver == NULL) { ExitClientError (CI18N::get ("Can_t_load_the_display_driver").toUtf8().c_str ()); @@ -1111,7 +1121,7 @@ void prelogInit() CBloomEffect::getInstance().setDriver(Driver); // init bloom effect - CBloomEffect::getInstance().init(!direct3D); + CBloomEffect::getInstance().init(driver != UDriver::Direct3d); nlinfo ("PROFILE: %d seconds for prelogInit", (uint32)(ryzomGetLocalTime ()-initStart)/1000); diff --git a/code/ryzom/client/src/interface_v3/group_html.cpp b/code/ryzom/client/src/interface_v3/group_html.cpp index e17426a79..606c1f34b 100644 --- a/code/ryzom/client/src/interface_v3/group_html.cpp +++ b/code/ryzom/client/src/interface_v3/group_html.cpp @@ -580,7 +580,7 @@ void CGroupHTML::addLink (uint element_number, uint /* attribute_number */, HTCh // in ah: command we don't respect the uri standard so the HTAnchor_address doesn't work correctly _Link.push_back (suri); } - else if (_TrustedDomain && suri[0] == '#') + else if (_TrustedDomain && suri.find('#') == 0) { // Direct url (hack for lua beginElement) _Link.push_back (suri.substr(1)); diff --git a/code/ryzom/client/src/interface_v3/group_tree.h b/code/ryzom/client/src/interface_v3/group_tree.h index c2a299c01..556abab99 100644 --- a/code/ryzom/client/src/interface_v3/group_tree.h +++ b/code/ryzom/client/src/interface_v3/group_tree.h @@ -106,7 +106,7 @@ public: void setOpened(bool opened) { Opened = opened; } bool getOpened() const { return Opened; } void setText(const ucstring &text) { Text = text; } - const ucstring& getText() const { return Text; } + ucstring getText() const { return Text; } sint32 getFontSize() const { return FontSize; } void setFontSize(sint32 value) { FontSize = value; } sint32 getYDecal() const { return YDecal; } diff --git a/code/ryzom/client/src/interface_v3/interface_element.h b/code/ryzom/client/src/interface_v3/interface_element.h index 24982cad2..0202618ba 100644 --- a/code/ryzom/client/src/interface_v3/interface_element.h +++ b/code/ryzom/client/src/interface_v3/interface_element.h @@ -361,7 +361,7 @@ public: */ virtual void forceOpen() { setActive(true); } - virtual void enableBlink(int /* numBlinks */ = 0) {} + virtual void enableBlink(uint /* numBlinks */ = 0) {} virtual void disableBlink() {} virtual bool getBlink() const { return false; } diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index 157a97f8a..2d294dfd9 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -2528,7 +2528,6 @@ class CAHOnCreateAccountSubmit : public IActionHandler text->setMultiLineSpace(10); text->setColor(CRGBA(250, 30, 30, 255)); - std::vector< std::string > errors(5); errors[0] = "id=\"comment-Username\""; errors[1] = "id=\"comment-Password\""; diff --git a/code/ryzom/client/src/sound_manager.cpp b/code/ryzom/client/src/sound_manager.cpp index a82e4b422..948a13a51 100644 --- a/code/ryzom/client/src/sound_manager.cpp +++ b/code/ryzom/client/src/sound_manager.cpp @@ -107,9 +107,11 @@ enum TFilterMapping //----------------------------------------------- CSoundManager::CSoundManager(IProgressCallback * /* progressCallBack */) : _AudioMixer(NULL), + _GroupControllerEffects(NULL), + _GroupControllerEffectsGame(NULL), _EnvSoundRoot(NULL), - _UserEntitySoundLevel(1.0f), - _Sources(NULL) + _Sources(NULL), + _UserEntitySoundLevel(1.0f) { _EnableBackgroundMusicAtTime= 0; _GameMusicVolume= 1.f; @@ -139,6 +141,7 @@ CSoundManager::~CSoundManager() NL3D::UParticleSystemSound::setPSSound(NULL); _GroupControllerEffects = NULL; + _GroupControllerEffectsGame = NULL; // free the audio mixer (and delete all sources) delete _AudioMixer; @@ -407,6 +410,7 @@ void CSoundManager::reset () NL3D::UParticleSystemSound::setPSSound(NULL); _GroupControllerEffects = NULL; + _GroupControllerEffectsGame = NULL; delete _AudioMixer; _AudioMixer = NULL; @@ -482,7 +486,8 @@ void CSoundManager::init(IProgressCallback *progressCallBack) new CSoundAnimManager(_AudioMixer); // get the controller group for effects - _GroupControllerEffects = _AudioMixer->getGroupController("effects"); + _GroupControllerEffects = _AudioMixer->getGroupController("sound:effects"); + _GroupControllerEffectsGame = _AudioMixer->getGroupController("sound:effects:game"); // restore the volume SoundMngr->setSFXVolume(ClientCfg.SoundSFXVolume); @@ -619,7 +624,7 @@ void CSoundManager::init(IProgressCallback *progressCallBack) // add a new source to the world, attached to the specified entity // return 0 if creation failed, sound id if creation was successful //----------------------------------------------- -CSoundManager::TSourceId CSoundManager::addSource( const NLMISC::TStringId &soundName, const NLMISC::CVector &position, bool play, bool loop, const CEntityId &id) +CSoundManager::TSourceId CSoundManager::addSource( const NLMISC::CSheetId &soundName, const NLMISC::CVector &position, bool play, bool loop, const CEntityId &id) { uint32 retValue = 0; @@ -629,7 +634,7 @@ CSoundManager::TSourceId CSoundManager::addSource( const NLMISC::TStringId &soun // If the source is valid. if(pSource == 0) { - nlwarning("Sound '%s' not found !", CStringMapper::unmap(soundName).c_str()); + nlwarning("Sound '%s' not found !", /*CStringMapper::unmap(soundName).c_str()*/soundName.toString().c_str()); return retValue; } @@ -667,7 +672,7 @@ CSoundManager::TSourceId CSoundManager::addSource( const NLMISC::TStringId &soun // spawn a new source to the world // return false if creation failed, true if creation was successful //----------------------------------------------- -bool CSoundManager::spawnSource(const NLMISC::TStringId &soundName, CSoundContext &context) +bool CSoundManager::spawnSource(const NLMISC::CSheetId &soundName, CSoundContext &context) { if (!_PlaySound) return false; @@ -678,7 +683,7 @@ bool CSoundManager::spawnSource(const NLMISC::TStringId &soundName, CSoundContex // If the source is valid. if(pSource == 0) { - nlwarning("Sound '%s' not found !", soundName); + nlwarning("Sound '%s' not found !", soundName.toString().c_str()); return false; } @@ -697,7 +702,7 @@ bool CSoundManager::spawnSource(const NLMISC::TStringId &soundName, CSoundContex // spawn a new source to the world // return false if creation failed, true if creation was successful //----------------------------------------------- -bool CSoundManager::spawnSource(const NLMISC::TStringId &soundName, const NLMISC::CVector &position) +bool CSoundManager::spawnSource(const NLMISC::CSheetId &soundName, const NLMISC::CVector &position) { if (!_PlaySound) return false; @@ -707,7 +712,7 @@ bool CSoundManager::spawnSource(const NLMISC::TStringId &soundName, const NLMISC // If the source is valid. if(pSource == 0) { - nlwarning("Sound '%s' not found !", CStringMapper::unmap(soundName).c_str ()); + nlwarning("Sound '%s' not found !", /*CStringMapper::unmap(soundName).c_str ()*/soundName.toString().c_str()); return false; } @@ -742,7 +747,7 @@ nldebug("nb sources = %d", _Sources.size() ); { if ( (*it).second == sourceId ) { - (*it).second = NULL; + (*it).second = 0; // itOld = it; // ++it; @@ -1543,7 +1548,8 @@ void CSoundManager::updateVolume() _AudioMixer->setEventMusicVolume(_GameMusicVolume); // update sfx volume - _GroupControllerEffects->setGain(_FadeSFXVolume, _SFXVolume); + _GroupControllerEffects->setGain(_SFXVolume); + _GroupControllerEffectsGame->setGain(_FadeSFXVolume); } } diff --git a/code/ryzom/client/src/sound_manager.h b/code/ryzom/client/src/sound_manager.h index e5db85648..e4981055f 100644 --- a/code/ryzom/client/src/sound_manager.h +++ b/code/ryzom/client/src/sound_manager.h @@ -32,6 +32,7 @@ // sound #include "nel/sound/u_audio_mixer.h" #include "nel/sound/u_listener.h" +#include "nel/misc/sheet_id.h" extern class CSoundManager *SoundMngr; @@ -88,13 +89,13 @@ public: /// Return the audio mixer instance pointer. NLSOUND::UAudioMixer *getMixer(); - TSourceId addSource( const NLMISC::TStringId &soundName, const NLMISC::CVector &position, bool play = true , bool loop = false, const NLMISC::CEntityId &id = NLMISC::CEntityId::Unknown ); + TSourceId addSource( const NLMISC::CSheetId &soundName, const NLMISC::CVector &position, bool play = true , bool loop = false, const NLMISC::CEntityId &id = NLMISC::CEntityId::Unknown ); /// spawn a new source to the world but sound manager don't keep any link and the sound will be automatically deleted when finnished - bool spawnSource (const NLMISC::TStringId &soundName, NLSOUND::CSoundContext &context); + bool spawnSource (const NLMISC::CSheetId &soundName, NLSOUND::CSoundContext &context); /// spawn a new source to the world but sound manager don't keep any link and the sound will be automatically deleted when finnished - bool spawnSource( const NLMISC::TStringId &soundName, const NLMISC::CVector &position ); + bool spawnSource( const NLMISC::CSheetId &soundName, const NLMISC::CVector &position ); /** * remove a source @@ -332,9 +333,12 @@ private: /// Pointer on the audio mixer object NLSOUND::UAudioMixer *_AudioMixer; - /// The root effects group controller for volume settings + /// The root effects group controller for effects volume settings by the user NLSOUND::UGroupController *_GroupControllerEffects; + /// The root effects group controller for effects fading by the game + NLSOUND::UGroupController *_GroupControllerEffectsGame; + /// Pointer on the root of the environmental sounds tree (if any) NLSOUND::UEnvSound *_EnvSoundRoot; diff --git a/code/ryzom/client/src/stdpch.h b/code/ryzom/client/src/stdpch.h index 48c1a3c06..dd9f97b94 100644 --- a/code/ryzom/client/src/stdpch.h +++ b/code/ryzom/client/src/stdpch.h @@ -121,5 +121,6 @@ #ifdef NL_OS_WINDOWS #define NOMINMAX +#include #include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/common/data_leveldesign/primitives/newbieland/urban_newbieland.primitive b/code/ryzom/common/data_leveldesign/primitives/newbieland/urban_newbieland.primitive index 0aa00b3bb..42cd70726 100644 --- a/code/ryzom/common/data_leveldesign/primitives/newbieland/urban_newbieland.primitive +++ b/code/ryzom/common/data_leveldesign/primitives/newbieland/urban_newbieland.primitive @@ -1,7 +1,7 @@ - + class @@ -126,6 +126,10 @@ #mission tags and pre-requisites replayable solo + mission_category : Killing + player_replay_timer : 10 + global_replay_timer : 10 + mission_icon : tets #Variables declaration decl : bot : giver @@ -138,7 +142,7 @@ mission_title : WELCOME_RYZOM_CORE_TITLE mission_desc : WELCOME_RYZOM_CORE_DESC # step_4 - kill_fauna : chdfa1 3 + kill_fauna : chdfa1 1 recv_money : 10000 @@ -154,6 +158,157 @@ + + + class + mission + + + name + HUNTING_GROUNDS + + + script + # script generated from 'urban_newbieland.primitive' + + #mission tags and pre-requisites + replayable + guild + mission_category : Killing + player_replay_timer : 10 + global_replay_timer : 10 + mission_icon : test + + #Variables declaration + decl : bot : giver + decl : bot : player + decl : bot : chiang_the_strong + + #pre-requisites + req_guild + req_grade : Leader + + #script + mission_title : WELCOME_RYZOM_CORE_DESC + mission_desc : WELCOME_RYZOM_CORE_TITLE + # step_4 + spawn_mission : WELCOME_RYZOM_CORE : chiang_the_strong : guild + set_obj : MIS_DO_MISSION + mission : WELCOME_RYZOM_CORE 2 + kill_fauna : chdfa1 2 + recv_money : 100000 + recv_money : 20: guild + + + + + + class + alias + + + name + alias + + + + + + class + mission + + + name + GUILD_MISSION + + + script + # script generated from 'guild_missions.primitive' + + #mission tags and pre-requisites + replayable + guild + mission_category : Killing + + #Variables declaration + decl : bot : giver + decl : bot : player + decl : bot : chiang_the_strong + + #pre-requisites + req_guild + req_grade : Leader + + #script + mission_title : GUILD_MISSION_TITLE + mission_desc : GUILD_MISSION_DESC + # step + spawn_mission : SOLO_GUILD_MISSION : chiang_the_strong : guild + set_obj : MIS_DO_MISSION + mission : SOLO_GUILD_MISSION 2 + kill_fauna : chdfa1 2 + recv_money : 100: guild + recv_money : 50 + + + + + + class + alias + + + name + alias + + + + + + class + mission + + + name + SOLO_GUILD_MISSION + + + script + # script generated from 'guild_missions.primitive' + + #mission tags and pre-requisites + replayable + solo + mission_category : Killing + not_proposed + + #Variables declaration + decl : bot : giver + decl : bot : player + decl : bot : chiang_the_strong + + #pre-requisites + + #script + mission_title : SOLO_GUILD_MISSION_TITLE + mission_desc : SOLO_GUILD_MISSION_DESC + # step + kill_fauna : chdfa1 1 + recv_money : 20 + + + + + + class + alias + + + name + alias + + + @@ -317,6 +472,46 @@ + + + + chat_parameters + shop:guild_creator + menu: MENU_WHOAMI WHOAMI_GUILD_CLERK + + + class + npc_bot + + + equipment + CU: 4 + CL: 4 + + + is_stuck + true + + + name + creator + + + sheet_client + fyhc3old + + + + + class + alias + + + name + alias + + + @@ -396,19 +591,8 @@ chat_parameters - shop : NEWBIELAND_LARMOR_ALL - item : icmalb.sitem 10 - item : icmalb.sitem 20 - item : icmalb.sitem 50 - item : icfalb.sitem 10 - item : icfalb.sitem 20 - item : icfalb.sitem 50 - item : ictalb.sitem 10 - item : ictalb.sitem 20 - item : ictalb.sitem 50 - item : iczalb.sitem 10 - item : iczalb.sitem 20 - item : iczalb.sitem 50 + shop:guild_creator + menu: MENU_WHOAMI WHOAMI_GUILD_CLERK class @@ -444,6 +628,119 @@ + + + class + npc_folder + + + name + Guild creator + + + + + class + alias + + + name + alias + + + + + class + npc_zone + + + name + Npc Zone + + + + + class + alias + + + name + alias + + + + + bot_sheet_client + maha2 + + + class + npc_group + + + name + Group + + + + class + npc_group_parameters + + + name + parameters + + + + + + class + alias + + + name + alias + + + + + + chat_parameters + shop:guild_creator + menu: MENU_WHOAMI WHOAMI_GUILD_CLERK + + + class + npc_bot + + + equipment + CU: 4 + CL: 4 + + + name + guild_creator + + + sheet_client + fyhc3old + + + + + class + alias + + + name + alias + + + + + + @@ -455,14 +752,38 @@ missions_editor + + audience + solo + + + auto_remove_from_journal + false + + + automatic + false + class mission_tree + + fail_if_inventory_is_full + false + giver_primitive urban_newbieland.primitive + + global_replay_timer + 10 + + + mission_category + Killing + mission_description WELCOME_RYZOM_CORE_DESC @@ -471,10 +792,18 @@ mission_giver $givervar@fullname$ + + mission_icon + tets + mission_title WELCOME_RYZOM_CORE_TITLE + + mono_instance + false + name WELCOME_RYZOM_CORE @@ -483,10 +812,34 @@ need_validation false + + non_abandonnable + false + + + not_in_journal + false + + + not_proposed + false + + + phrase_auto_menu + TEST + + + player_replay_timer + 10 + replayable true + + run_only_once + false + class @@ -571,7 +924,7 @@ fauna/quantity - chdfa1 3 + chdfa1 1 @@ -597,6 +950,263 @@ + + + audience + guild + + + auto_remove_from_journal + false + + + automatic + false + + + class + mission_tree + + + fail_if_inventory_is_full + false + + + giver_primitive + urban_newbieland.primitive + + + global_replay_timer + 10 + + + mission_category + Killing + + + mission_description + WELCOME_RYZOM_CORE_TITLE + + + mission_giver + $givervar@fullname$ + + + mission_icon + test + + + mission_title + WELCOME_RYZOM_CORE_DESC + + + mono_instance + false + + + name + HUNTING_GROUNDS + + + need_validation + false + + + non_abandonnable + false + + + not_in_journal + false + + + not_proposed + false + + + phrase_auto_menu + TEST + + + player_replay_timer + 10 + + + replayable + true + + + run_only_once + false + + + + class + variables + + + name + variables + + + + class + var_npc + + + npc_function + fct_ranger_leader + + + npc_name + chiang_the_strong + + + var_name + givervar + + + + + + class + pre_requisite + + + name + pre_requisite + + + require_guild_grade + Leader + + + require_guild_membership + true + + + + + + class + alias + + + name + alias + + + + + class + step + + + name + step_4 + + + + class + actions + + + name + pre_actions + + + + class + spawn_mission + + + giver_name + chiang_the_strong + + + guild + true + + + mission_name + WELCOME_RYZOM_CORE + + + + + + class + mission_objectives + + + name + objectives + + + + class + do_mission + + + mission_names + WELCOME_RYZOM_CORE 2 + + + overload_objective + MIS_DO_MISSION + + + + + class + kill + + + fauna/quantity + chdfa1 2 + + + name + kill chdfa1 2 + + + + + + class + actions + + + name + post_actions + + + + amount + 100000 + + + class + recv_money + + + + + amount + 20 + + + class + recv_money + + + guild + true + + + + + diff --git a/code/ryzom/common/src/game_share/scenario_entry_points.cpp b/code/ryzom/common/src/game_share/scenario_entry_points.cpp index 81dd3e6e2..36b3a6aea 100644 --- a/code/ryzom/common/src/game_share/scenario_entry_points.cpp +++ b/code/ryzom/common/src/game_share/scenario_entry_points.cpp @@ -19,6 +19,7 @@ //----------------------------------------------------------------------------- #include "stdpch.h" +#include "utils.h" #include "nel/misc/file.h" #include "nel/misc/command.h" diff --git a/code/ryzom/common/src/game_share/stdpch.h b/code/ryzom/common/src/game_share/stdpch.h index 18f6f00e0..f14a31608 100644 --- a/code/ryzom/common/src/game_share/stdpch.h +++ b/code/ryzom/common/src/game_share/stdpch.h @@ -66,4 +66,8 @@ #include -#include "utils.h" +#ifdef NL_OS_WINDOWS +# define NOMINMAX +# include +# include +#endif diff --git a/code/ryzom/server/frontend_service.cfg b/code/ryzom/server/frontend_service.cfg index c9392bd51..a73c02316 100644 --- a/code/ryzom/server/frontend_service.cfg +++ b/code/ryzom/server/frontend_service.cfg @@ -6,7 +6,7 @@ BandwidthRatio = 1; FSUDPPort = 47851; -FSListenHost = "open.ryzom.com"; +FSListenHost = "192.168.1.112"; #include "frontend_service_default.cfg" diff --git a/code/ryzom/server/shard_start_cmake.bat b/code/ryzom/server/shard_start_cmake.bat index 943a0b5f3..9d68b5272 100644 --- a/code/ryzom/server/shard_start_cmake.bat +++ b/code/ryzom/server/shard_start_cmake.bat @@ -3,7 +3,7 @@ REM This script will start all the services with good parameters REM set MODE=Debug -set MODE=..\..\build\bin\Release +set MODE=..\..\build\bin\Debug rem AS start %MODE%\ryzom_admin_service.exe --fulladminname=admin_executor_service --shortadminname=AES diff --git a/code/ryzom/server/src/admin_modules/admin_modules_itf.h b/code/ryzom/server/src/admin_modules/admin_modules_itf.h index 248ba6834..5b6a4325a 100644 --- a/code/ryzom/server/src/admin_modules/admin_modules_itf.h +++ b/code/ryzom/server/src/admin_modules/admin_modules_itf.h @@ -33,10 +33,10 @@ #include "game_share/callback_adaptor.h" #include "nel/misc/time_nl.h" - + namespace ADMIN { - + class TGraphData; class TGraphDatas; @@ -50,12 +50,12 @@ namespace ADMIN // This is the interface used by PHP to call methods // on the Admin service module - class CAdminServiceWebItf + class CAdminServiceWebItf { protected: /// the callback server adaptor - std::auto_ptr _CallbackServer; + std::auto_ptr _CallbackServer; void getCallbakArray(NLNET::TCallbackItem *&arrayPtr, uint32 &arraySize) { @@ -94,7 +94,7 @@ namespace ADMIN public: /** Constructor, if you specify a replacement adaptor, then the object - * become owner of the adaptor (and it will be released with the + * become owner of the adaptor (and it will be released with the * interface). */ CAdminServiceWebItf(ICallbackServerAdaptor *replacementAdaptor = NULL) @@ -170,7 +170,7 @@ namespace ADMIN nldebug("CAdminServiceWeb::cb_globalCmd received from class '%s'", typeid(netbase).name()); #endif ICallbackServerAdaptor *adaptor = static_cast< ICallbackServerAdaptor *>(netbase.getUserData()); - + CAdminServiceWebItf *callback = (CAdminServiceWebItf *)adaptor->getContainerClass(); if (callback == NULL) @@ -195,7 +195,7 @@ namespace ADMIN nldebug("CAdminServiceWeb::cb_controlCmd received from class '%s'", typeid(netbase).name()); #endif ICallbackServerAdaptor *adaptor = static_cast< ICallbackServerAdaptor *>(netbase.getUserData()); - + CAdminServiceWebItf *callback = (CAdminServiceWebItf *)adaptor->getContainerClass(); if (callback == NULL) @@ -222,7 +222,7 @@ namespace ADMIN nldebug("CAdminServiceWeb::cb_serviceCmd received from class '%s'", typeid(netbase).name()); #endif ICallbackServerAdaptor *adaptor = static_cast< ICallbackServerAdaptor *>(netbase.getUserData()); - + CAdminServiceWebItf *callback = (CAdminServiceWebItf *)adaptor->getContainerClass(); if (callback == NULL) @@ -249,7 +249,7 @@ namespace ADMIN nldebug("CAdminServiceWeb::cb_getShardOrders received from class '%s'", typeid(netbase).name()); #endif ICallbackServerAdaptor *adaptor = static_cast< ICallbackServerAdaptor *>(netbase.getUserData()); - + CAdminServiceWebItf *callback = (CAdminServiceWebItf *)adaptor->getContainerClass(); if (callback == NULL) @@ -263,7 +263,7 @@ namespace ADMIN std::vector retValue; retValue = callback->on_getShardOrders(from); - + NLNET::CMessage retMsg("R_GSO"); nlWrite(retMsg, serialCont, retValue); @@ -280,7 +280,7 @@ namespace ADMIN nldebug("CAdminServiceWeb::cb_getStates received from class '%s'", typeid(netbase).name()); #endif ICallbackServerAdaptor *adaptor = static_cast< ICallbackServerAdaptor *>(netbase.getUserData()); - + CAdminServiceWebItf *callback = (CAdminServiceWebItf *)adaptor->getContainerClass(); if (callback == NULL) @@ -294,7 +294,7 @@ namespace ADMIN std::vector retValue; retValue = callback->on_getStates(from); - + NLNET::CMessage retMsg("R_GS"); nlWrite(retMsg, serialCont, retValue); @@ -311,7 +311,7 @@ namespace ADMIN nldebug("CAdminServiceWeb::cb_getHighRezGraphInfo received from class '%s'", typeid(netbase).name()); #endif ICallbackServerAdaptor *adaptor = static_cast< ICallbackServerAdaptor *>(netbase.getUserData()); - + CAdminServiceWebItf *callback = (CAdminServiceWebItf *)adaptor->getContainerClass(); if (callback == NULL) @@ -327,7 +327,7 @@ namespace ADMIN std::vector retValue; retValue = callback->on_getHighRezGraphInfo(from, varAddr); - + NLNET::CMessage retMsg("R_GHRGI"); nlWrite(retMsg, serialCont, retValue); @@ -344,7 +344,7 @@ namespace ADMIN nldebug("CAdminServiceWeb::cb_getHighRezGraph received from class '%s'", typeid(netbase).name()); #endif ICallbackServerAdaptor *adaptor = static_cast< ICallbackServerAdaptor *>(netbase.getUserData()); - + CAdminServiceWebItf *callback = (CAdminServiceWebItf *)adaptor->getContainerClass(); if (callback == NULL) @@ -366,7 +366,7 @@ namespace ADMIN std::vector retValue; retValue = callback->on_getHighRezGraph(from, varAddr, startDate, endDate, milliStep); - + NLNET::CMessage retMsg("R_GHRG"); nlWrite(retMsg, serialCont, retValue); @@ -389,7 +389,7 @@ namespace ADMIN // serviceCmdResult. virtual void on_globalCmd(NLNET::TSockId from, const std::string &command) =0; - // Send a service related command to the executor + // Send a service related command to the executor // (not to the controled service) // The result is returned by the return message // controlCmdResult. @@ -426,15 +426,15 @@ namespace ADMIN virtual std::vector on_getHighRezGraph(NLNET::TSockId from, const std::string &varAddr, uint32 startDate, uint32 endDate, uint32 milliStep) =0; }; - + // This is the interface used by PHP to call methods // on the Admin service module - /** This is the client side of the interface + /** This is the client side of the interface * Derive from this class to invoke method on the callback server - */ + */ - class CAdminServiceWebClientItf + class CAdminServiceWebClientItf { protected: @@ -476,18 +476,18 @@ namespace ADMIN initialized = true; } - + std::map < std::string, std::string>::const_iterator it(messageNames.find(methodName)); if (it != messageNames.end()) return it->second; - + static std::string emptyString; - + return emptyString; } - + CAdminServiceWebClientItf(ICallbackClientAdaptor *adaptorReplacement = NULL) { if (adaptorReplacement == NULL) @@ -553,7 +553,7 @@ namespace ADMIN _CallbackClient->send(message); } - // Send a service related command to the executor + // Send a service related command to the executor // (not to the controled service) // The result is returned by the return message // controlCmdResult. @@ -653,7 +653,7 @@ namespace ADMIN nldebug("CAdminServiceWebClient::cb_commandResult received from class '%s'", typeid(netbase).name()); #endif ICallbackClientAdaptor *adaptor = static_cast< ICallbackClientAdaptor *>(netbase.getUserData()); - + CAdminServiceWebClientItf *callback = (CAdminServiceWebClientItf *)adaptor->getContainerClass(); if (callback == NULL) @@ -685,16 +685,16 @@ namespace ADMIN class TGraphData { protected: - // + // std::string _ServiceAlias; - // + // std::string _VarName; - // + // uint32 _SamplePeriod; - // + // double _Value; public: - // + // const std::string &getServiceAlias() const { return _ServiceAlias; @@ -712,9 +712,9 @@ namespace ADMIN _ServiceAlias = value; - + } - // + // const std::string &getVarName() const { return _VarName; @@ -732,9 +732,9 @@ namespace ADMIN _VarName = value; - + } - // + // uint32 getSamplePeriod() const { return _SamplePeriod; @@ -746,7 +746,7 @@ namespace ADMIN _SamplePeriod = value; } - // + // double getValue() const { return _Value; @@ -758,7 +758,7 @@ namespace ADMIN _Value = value; } - + bool operator == (const TGraphData &other) const { return _ServiceAlias == other._ServiceAlias @@ -773,7 +773,7 @@ namespace ADMIN { } - + void serial(NLMISC::IStream &s) { s.serial(_ServiceAlias); @@ -782,10 +782,10 @@ namespace ADMIN s.serial(_Value); } - + private: - + }; @@ -796,12 +796,12 @@ namespace ADMIN class TGraphDatas { protected: - // + // uint32 _CurrentTime; - // + // std::vector < TGraphData > _Datas; public: - // + // uint32 getCurrentTime() const { return _CurrentTime; @@ -813,7 +813,7 @@ namespace ADMIN _CurrentTime = value; } - // + // const std::vector < TGraphData > &getDatas() const { return _Datas; @@ -831,9 +831,9 @@ namespace ADMIN _Datas = value; - + } - + bool operator == (const TGraphDatas &other) const { return _CurrentTime == other._CurrentTime @@ -846,17 +846,17 @@ namespace ADMIN { } - + void serial(NLMISC::IStream &s) { s.serial(_CurrentTime); s.serialCont(_Datas); } - + private: - + }; @@ -867,12 +867,12 @@ namespace ADMIN class THighRezData { protected: - // + // NLMISC::TTime _SampleTick; - // + // double _Value; public: - // + // NLMISC::TTime getSampleTick() const { return _SampleTick; @@ -884,7 +884,7 @@ namespace ADMIN _SampleTick = value; } - // + // double getValue() const { return _Value; @@ -896,7 +896,7 @@ namespace ADMIN _Value = value; } - + bool operator == (const THighRezData &other) const { return _SampleTick == other._SampleTick @@ -909,17 +909,17 @@ namespace ADMIN { } - + void serial(NLMISC::IStream &s) { s.serial(_SampleTick); s.serial(_Value); } - + private: - + }; @@ -930,16 +930,16 @@ namespace ADMIN class THighRezDatas { protected: - // + // std::string _ServiceAlias; - // + // std::string _VarName; - // + // uint32 _CurrentTime; - // + // std::vector < THighRezData > _Datas; public: - // + // const std::string &getServiceAlias() const { return _ServiceAlias; @@ -957,9 +957,9 @@ namespace ADMIN _ServiceAlias = value; - + } - // + // const std::string &getVarName() const { return _VarName; @@ -977,9 +977,9 @@ namespace ADMIN _VarName = value; - + } - // + // uint32 getCurrentTime() const { return _CurrentTime; @@ -991,7 +991,7 @@ namespace ADMIN _CurrentTime = value; } - // + // const std::vector < THighRezData > &getDatas() const { return _Datas; @@ -1009,9 +1009,9 @@ namespace ADMIN _Datas = value; - + } - + bool operator == (const THighRezDatas &other) const { return _ServiceAlias == other._ServiceAlias @@ -1026,7 +1026,7 @@ namespace ADMIN { } - + void serial(NLMISC::IStream &s) { s.serial(_ServiceAlias); @@ -1035,15 +1035,15 @@ namespace ADMIN s.serialCont(_Datas); } - + private: - + }; - + struct TShardOrders { @@ -1057,11 +1057,11 @@ namespace ADMIN end_of_enum, invalid_val, - + /// Number of enumerated values nb_enum_items = 2 }; - + /// Index table to convert enum value to linear index table const std::map &getIndexTable() const { @@ -1072,13 +1072,13 @@ namespace ADMIN // fill the index table indexTable.insert(std::make_pair(so_autostart_on, 0)); indexTable.insert(std::make_pair(so_autostart_off, 1)); - + init = true; } return indexTable; } - + static const NLMISC::CStringConversion &getConversionTable() { @@ -1086,9 +1086,9 @@ namespace ADMIN NL_STRING_CONVERSION_TABLE_ENTRY(so_autostart_on) NL_STRING_CONVERSION_TABLE_ENTRY(so_autostart_off) NL_STRING_CONVERSION_TABLE_ENTRY(invalid_val) - }; - static NLMISC::CStringConversion - conversionTable(TValues_nl_string_conversion_table, sizeof(TValues_nl_string_conversion_table) + }; + static NLMISC::CStringConversion + conversionTable(TValues_nl_string_conversion_table, sizeof(TValues_nl_string_conversion_table) / sizeof(TValues_nl_string_conversion_table[0]), invalid_val); return conversionTable; @@ -1167,16 +1167,16 @@ namespace ADMIN return getConversionTable().isValid(_Value); } - + uint32 asIndex() { std::map::const_iterator it(getIndexTable().find(_Value)); nlassert(it != getIndexTable().end()); return it->second; } - + }; - + struct TRunningOrders { @@ -1190,11 +1190,11 @@ namespace ADMIN end_of_enum, invalid_val, - + /// Number of enumerated values nb_enum_items = 2 }; - + /// Index table to convert enum value to linear index table const std::map &getIndexTable() const { @@ -1205,13 +1205,13 @@ namespace ADMIN // fill the index table indexTable.insert(std::make_pair(ro_deactivated, 0)); indexTable.insert(std::make_pair(ro_activated, 1)); - + init = true; } return indexTable; } - + static const NLMISC::CStringConversion &getConversionTable() { @@ -1219,9 +1219,9 @@ namespace ADMIN NL_STRING_CONVERSION_TABLE_ENTRY(ro_deactivated) NL_STRING_CONVERSION_TABLE_ENTRY(ro_activated) NL_STRING_CONVERSION_TABLE_ENTRY(invalid_val) - }; - static NLMISC::CStringConversion - conversionTable(TValues_nl_string_conversion_table, sizeof(TValues_nl_string_conversion_table) + }; + static NLMISC::CStringConversion + conversionTable(TValues_nl_string_conversion_table, sizeof(TValues_nl_string_conversion_table) / sizeof(TValues_nl_string_conversion_table[0]), invalid_val); return conversionTable; @@ -1300,16 +1300,16 @@ namespace ADMIN return getConversionTable().isValid(_Value); } - + uint32 asIndex() { std::map::const_iterator it(getIndexTable().find(_Value)); nlassert(it != getIndexTable().end()); return it->second; } - + }; - + struct TRunningState { @@ -1324,11 +1324,11 @@ namespace ADMIN end_of_enum, invalid_val, - + /// Number of enumerated values nb_enum_items = 3 }; - + /// Index table to convert enum value to linear index table const std::map &getIndexTable() const { @@ -1340,13 +1340,13 @@ namespace ADMIN indexTable.insert(std::make_pair(rs_stopped, 0)); indexTable.insert(std::make_pair(rs_running, 1)); indexTable.insert(std::make_pair(rs_online, 2)); - + init = true; } return indexTable; } - + static const NLMISC::CStringConversion &getConversionTable() { @@ -1355,9 +1355,9 @@ namespace ADMIN NL_STRING_CONVERSION_TABLE_ENTRY(rs_running) NL_STRING_CONVERSION_TABLE_ENTRY(rs_online) NL_STRING_CONVERSION_TABLE_ENTRY(invalid_val) - }; - static NLMISC::CStringConversion - conversionTable(TValues_nl_string_conversion_table, sizeof(TValues_nl_string_conversion_table) + }; + static NLMISC::CStringConversion + conversionTable(TValues_nl_string_conversion_table, sizeof(TValues_nl_string_conversion_table) / sizeof(TValues_nl_string_conversion_table[0]), invalid_val); return conversionTable; @@ -1436,16 +1436,16 @@ namespace ADMIN return getConversionTable().isValid(_Value); } - + uint32 asIndex() { std::map::const_iterator it(getIndexTable().find(_Value)); nlassert(it != getIndexTable().end()); return it->second; } - + }; - + struct TRunningTag { @@ -1465,11 +1465,11 @@ namespace ADMIN end_of_enum, invalid_val, - + /// Number of enumerated values nb_enum_items = 8 }; - + /// Index table to convert enum value to linear index table const std::map &getIndexTable() const { @@ -1486,13 +1486,13 @@ namespace ADMIN indexTable.insert(std::make_pair(rt_externaly_started, 5)); indexTable.insert(std::make_pair(rt_slow_to_stop, 6)); indexTable.insert(std::make_pair(rt_slow_to_start, 7)); - + init = true; } return indexTable; } - + static const NLMISC::CStringConversion &getConversionTable() { @@ -1506,9 +1506,9 @@ namespace ADMIN NL_STRING_CONVERSION_TABLE_ENTRY(rt_slow_to_stop) NL_STRING_CONVERSION_TABLE_ENTRY(rt_slow_to_start) NL_STRING_CONVERSION_TABLE_ENTRY(invalid_val) - }; - static NLMISC::CStringConversion - conversionTable(TValues_nl_string_conversion_table, sizeof(TValues_nl_string_conversion_table) + }; + static NLMISC::CStringConversion + conversionTable(TValues_nl_string_conversion_table, sizeof(TValues_nl_string_conversion_table) / sizeof(TValues_nl_string_conversion_table[0]), invalid_val); return conversionTable; @@ -1587,14 +1587,14 @@ namespace ADMIN return getConversionTable().isValid(_Value); } - + uint32 asIndex() { std::map::const_iterator it(getIndexTable().find(_Value)); nlassert(it != getIndexTable().end()); return it->second; } - + }; ///////////////////////////////////////////////////////////////// // WARNING : this is a generated file, don't change it ! @@ -1602,24 +1602,24 @@ namespace ADMIN class TServiceStatus { protected: - // + // std::string _ShardName; - // + // std::string _ServiceLongName; - // + // std::string _ServiceShortName; - // + // std::string _ServiceAliasName; - // + // TRunningState _RunningState; - // + // TRunningOrders _RunningOrders; - // + // std::set < TRunningTag > _RunningTags; - // + // std::string _Status; public: - // + // const std::string &getShardName() const { return _ShardName; @@ -1637,9 +1637,9 @@ namespace ADMIN _ShardName = value; - + } - // + // const std::string &getServiceLongName() const { return _ServiceLongName; @@ -1657,9 +1657,9 @@ namespace ADMIN _ServiceLongName = value; - + } - // + // const std::string &getServiceShortName() const { return _ServiceShortName; @@ -1677,9 +1677,9 @@ namespace ADMIN _ServiceShortName = value; - + } - // + // const std::string &getServiceAliasName() const { return _ServiceAliasName; @@ -1697,9 +1697,9 @@ namespace ADMIN _ServiceAliasName = value; - + } - // + // TRunningState getRunningState() const { return _RunningState; @@ -1711,7 +1711,7 @@ namespace ADMIN _RunningState = value; } - // + // TRunningOrders getRunningOrders() const { return _RunningOrders; @@ -1723,7 +1723,7 @@ namespace ADMIN _RunningOrders = value; } - // + // const std::set < TRunningTag > &getRunningTags() const { return _RunningTags; @@ -1741,9 +1741,9 @@ namespace ADMIN _RunningTags = value; - + } - // + // const std::string &getStatus() const { return _Status; @@ -1761,9 +1761,9 @@ namespace ADMIN _Status = value; - + } - + bool operator == (const TServiceStatus &other) const { return _ShardName == other._ShardName @@ -1782,7 +1782,7 @@ namespace ADMIN { } - + void serial(NLMISC::IStream &s) { s.serial(_ShardName); @@ -1795,15 +1795,15 @@ namespace ADMIN s.serial(_Status); } - + private: - + }; - + ///////////////////////////////////////////////////////////////// // WARNING : this is a generated file, don't change it ! ///////////////////////////////////////////////////////////////// @@ -1827,12 +1827,12 @@ namespace ADMIN _Interceptor.init(this, module); } - // unused interceptors + // unused interceptors std::string fwdBuildModuleManifest() const { return std::string(); } void fwdOnModuleUp(NLNET::IModuleProxy *moduleProxy) {} void fwdOnModuleDown(NLNET::IModuleProxy *moduleProxy) {} void fwdOnModuleSecurityChange(NLNET::IModuleProxy *moduleProxy) {} - + // process module message interceptor bool fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message); private: @@ -1842,7 +1842,7 @@ namespace ADMIN const TMessageHandlerMap &getMessageHandlers() const; - + void upServiceUpdate_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message); void graphUpdate_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message); @@ -1929,16 +1929,16 @@ namespace ADMIN // Message serializer. Return the message received in reference for easier integration static const NLNET::CMessage &buildMessageFor_upServiceUpdate(NLNET::CMessage &__message, const std::vector < TServiceStatus > &serviceStatus); - + // Message serializer. Return the message received in reference for easier integration static const NLNET::CMessage &buildMessageFor_graphUpdate(NLNET::CMessage &__message, const TGraphDatas &graphDatas); - + // Message serializer. Return the message received in reference for easier integration static const NLNET::CMessage &buildMessageFor_highRezGraphUpdate(NLNET::CMessage &__message, const THighRezDatas &graphDatas); - + // Message serializer. Return the message received in reference for easier integration static const NLNET::CMessage &buildMessageFor_commandResult(NLNET::CMessage &__message, uint32 commandId, const std::string &serviceAlias, const std::string &result); - + @@ -1967,12 +1967,12 @@ namespace ADMIN _Interceptor.init(this, module); } - // unused interceptors + // unused interceptors std::string fwdBuildModuleManifest() const { return std::string(); } void fwdOnModuleUp(NLNET::IModuleProxy *moduleProxy) {} void fwdOnModuleDown(NLNET::IModuleProxy *moduleProxy) {} void fwdOnModuleSecurityChange(NLNET::IModuleProxy *moduleProxy) {} - + // process module message interceptor bool fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message); private: @@ -1982,7 +1982,7 @@ namespace ADMIN const TMessageHandlerMap &getMessageHandlers() const; - + void setShardOrders_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message); void shutdownShard_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message); @@ -2097,7 +2097,7 @@ namespace ADMIN static void broadcast_setShardOrders(ProxyIterator first, ProxyIterator last, NLNET::IModule *sender, const std::string &shardName, const TShardOrders &shardOrders) { NLNET::CMessage message; - + // create the message to send to multiple dest buildMessageFor_setShardOrders(message , shardName, shardOrders); @@ -2116,7 +2116,7 @@ namespace ADMIN static void broadcast_shutdownShard(ProxyIterator first, ProxyIterator last, NLNET::IModule *sender, const std::string &shardName, uint32 delay) { NLNET::CMessage message; - + // create the message to send to multiple dest buildMessageFor_shutdownShard(message , shardName, delay); @@ -2135,7 +2135,7 @@ namespace ADMIN static void broadcast_controlCmd(ProxyIterator first, ProxyIterator last, NLNET::IModule *sender, uint32 commandId, const std::string &serviceAlias, const std::string &command) { NLNET::CMessage message; - + // create the message to send to multiple dest buildMessageFor_controlCmd(message , commandId, serviceAlias, command); @@ -2150,28 +2150,28 @@ namespace ADMIN // Message serializer. Return the message received in reference for easier integration static const NLNET::CMessage &buildMessageFor_setShardOrders(NLNET::CMessage &__message, const std::string &shardName, const TShardOrders &shardOrders); - + // Message serializer. Return the message received in reference for easier integration static const NLNET::CMessage &buildMessageFor_shutdownShard(NLNET::CMessage &__message, const std::string &shardName, uint32 delay); - + // Message serializer. Return the message received in reference for easier integration static const NLNET::CMessage &buildMessageFor_controlCmd(NLNET::CMessage &__message, uint32 commandId, const std::string &serviceAlias, const std::string &command); - + // Message serializer. Return the message received in reference for easier integration static const NLNET::CMessage &buildMessageFor_serviceCmd(NLNET::CMessage &__message, uint32 commandId, const std::string &serviceAlias, const std::string &command); - + // Message serializer. Return the message received in reference for easier integration static const NLNET::CMessage &buildMessageFor_commandResult(NLNET::CMessage &__message, uint32 commandId, const std::string &serviceAlias, const std::string &result); - + // Message serializer. Return the message received in reference for easier integration static const NLNET::CMessage &buildMessageFor_graphUpdate(NLNET::CMessage &__message, const TGraphDatas &graphDatas); - + // Message serializer. Return the message received in reference for easier integration static const NLNET::CMessage &buildMessageFor_highRezGraphUpdate(NLNET::CMessage &__message, const THighRezDatas &graphDatas); - + // Message serializer. Return the message received in reference for easier integration static const NLNET::CMessage &buildMessageFor_serviceStatusUpdate(NLNET::CMessage &__message, const std::string &status); - + @@ -2200,12 +2200,12 @@ namespace ADMIN _Interceptor.init(this, module); } - // unused interceptors + // unused interceptors std::string fwdBuildModuleManifest() const { return std::string(); } void fwdOnModuleUp(NLNET::IModuleProxy *moduleProxy) {} void fwdOnModuleDown(NLNET::IModuleProxy *moduleProxy) {} void fwdOnModuleSecurityChange(NLNET::IModuleProxy *moduleProxy) {} - + // process module message interceptor bool fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message); private: @@ -2215,7 +2215,7 @@ namespace ADMIN const TMessageHandlerMap &getMessageHandlers() const; - + void serviceCmd_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message); void serviceCmdNoReturn_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message); @@ -2290,15 +2290,15 @@ namespace ADMIN // Message serializer. Return the message received in reference for easier integration static const NLNET::CMessage &buildMessageFor_serviceCmd(NLNET::CMessage &__message, uint32 commandId, const std::string &command); - + // Message serializer. Return the message received in reference for easier integration static const NLNET::CMessage &buildMessageFor_serviceCmdNoReturn(NLNET::CMessage &__message, const std::string &command); - + }; } - + #endif diff --git a/code/ryzom/server/src/ai_service/nf_grp.cpp b/code/ryzom/server/src/ai_service/nf_grp.cpp index eabe61fd4..db5ae053c 100644 --- a/code/ryzom/server/src/ai_service/nf_grp.cpp +++ b/code/ryzom/server/src/ai_service/nf_grp.cpp @@ -2022,7 +2022,7 @@ Arguments: s(parameterName) -> @param[in] parameterName is a the id of the parameter to remove @code -()removeProfileParameter("running"); // retire le paramtre "running" ou "running:<*>" du groupe +()removeProfileParameter("running"); // remove "running" or "running:<*>" parameter from group @endcode */ @@ -2048,7 +2048,7 @@ Arguments: s(parameterName) -> @param[in] parameterName is a the id of the parameter to add @code -()addProfileParameter("running"); // quivalent un parameter "running" dans la primitive du groupe +()addProfileParameter("running"); // equivalent to "running" parameter in group primitive @endcode */ @@ -2077,7 +2077,7 @@ Arguments: s(parameterName),s(parameterContent) -> @param[in] parameterContent is the value of the parameter @code -()addPersistentProfileParameter("foo", "bar"); // quivalent un parameter "foo:bar" dans la primitive du groupe +()addPersistentProfileParameter("foo", "bar"); // equivalent to "foo:bar" parameter in group primitive @endcode */ @@ -2108,7 +2108,7 @@ Arguments: s(parameterName),f(parameterContent) -> @param[in] parameterContent is the value of the parameter @code -()addPersistentProfileParameter("foo", 0.5); // quivalent un parameter "foo:0.5" dans la primitive du groupe +()addPersistentProfileParameter("foo", 0.5); // equivalent to "foo:0.5" parameter in group primitive @endcode */ @@ -2137,7 +2137,7 @@ Arguments: s(parameterName) -> @param[in] parameterName is a the id of the parameter to remove @code -()removeProfileParameter("running"); // retire le paramtre "running" ou "running:<*>" du groupe +()removeProfileParameter("running"); // remove "running" or "running:<*>" parameters from group @endcode */ diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp index 8fa18d518..49a2955ca 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp @@ -119,7 +119,6 @@ class CMissionStepKillFauna : public IMissionStepTemplate } uint processEvent( const TDataSetRow & userRow, const CMissionEvent & event,uint subStepIndex,const TDataSetRow & giverRow ) { - nlinfo("Process Event"); string webAppUrl; bool ret = true; _User = PlayerManager.getChar(getEntityIdFromRow(userRow)); @@ -1253,4 +1252,4 @@ class CMissionStepKillPlayer : public IMissionStepTemplate MISSION_STEP_GETNEWPTR(CMissionStepKillPlayer) }; -MISSION_REGISTER_STEP(CMissionStepKillPlayer, "kill_player"); \ No newline at end of file +MISSION_REGISTER_STEP(CMissionStepKillPlayer, "kill_player"); diff --git a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_base.h b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_base.h index d48dcdb96..bdcb856dd 100644 --- a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_base.h +++ b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_base.h @@ -57,7 +57,7 @@ public: }; virtual ~IPVP() {} - + /// get PVP mode to send to the client virtual PVP_MODE::TPVPMode getPVPMode() const = 0; diff --git a/code/ryzom/server/src/monitor_service/service_main.cpp b/code/ryzom/server/src/monitor_service/service_main.cpp index d4f3e8d56..5ca88641e 100644 --- a/code/ryzom/server/src/monitor_service/service_main.cpp +++ b/code/ryzom/server/src/monitor_service/service_main.cpp @@ -29,7 +29,9 @@ #ifdef NL_OS_WINDOWS # define NOMINMAX -# include +# include +# include +typedef unsigned long ulong; #endif // NL_OS_WINDOWS #include diff --git a/code/ryzom/server/src/server_share/mysql_wrapper.h b/code/ryzom/server/src/server_share/mysql_wrapper.h index d2fbc09d6..2bc2489cf 100644 --- a/code/ryzom/server/src/server_share/mysql_wrapper.h +++ b/code/ryzom/server/src/server_share/mysql_wrapper.h @@ -26,8 +26,11 @@ #include "nel/net/module_common.h" #include "game_share/utils.h" #ifdef NL_OS_WINDOWS -# include +# include +# include +typedef unsigned long ulong; #endif + #include #include diff --git a/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp b/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp index 8088e14ca..cee3e4bf5 100644 --- a/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp +++ b/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp @@ -36,6 +36,11 @@ #include "nel_database_mapping.h" #include "character_sync.h" +// defined by MySQL config file +#ifdef access +#undef access +#endif + using namespace std; using namespace NLMISC; using namespace NLNET; diff --git a/code/ryzom/tools/sheets_packer/stdpch.h b/code/ryzom/tools/sheets_packer/stdpch.h index afa7d2137..11007e314 100644 --- a/code/ryzom/tools/sheets_packer/stdpch.h +++ b/code/ryzom/tools/sheets_packer/stdpch.h @@ -36,5 +36,6 @@ #ifdef NL_OS_WINDOWS #define NOMINMAX -#include +#include +#include #endif // NL_OS_WINDOWS diff --git a/code/web/api/client/auth.php b/code/web/api/client/auth.php new file mode 100644 index 000000000..f47dbd634 --- /dev/null +++ b/code/web/api/client/auth.php @@ -0,0 +1,47 @@ +. + */ + +require_once(RYAPI_PATH.'client/config.php'); + +// Og (non-ryzom.com) method +function ryzom_authenticate_with_serverkey($cid, $name, $authserver, $authkey) { +} + +// Ig method +function ryzom_authenticate_ingame($cid, $name, $authkey) { + if (isset($_SESSION['user'])) + return true; + + if (ryzom_get_param('user')) + return true; + + return false; +} + +// Session method +function ryzom_authenticate_with_session($name, $redirect) { + if (isset($_SESSION['user'])) + return true; + + if (ryzom_get_param('user')) + return true; + + return false; +} + +?> diff --git a/code/web/api/client/config.php.default b/code/web/api/client/config.php.default new file mode 100644 index 000000000..3c8ca869d --- /dev/null +++ b/code/web/api/client/config.php.default @@ -0,0 +1,20 @@ +. + */ + +// Url where player_auth.php is located +define('RYAPI_AUTH_SCRIPT', ''); diff --git a/code/web/api/client/user.php b/code/web/api/client/user.php new file mode 100644 index 000000000..b6e906b2c --- /dev/null +++ b/code/web/api/client/user.php @@ -0,0 +1,39 @@ +. + */ + +function ryzom_user_get_info($cid) { + if (isset($_SESSION['user'])) + return $_SESSION['user']; + + $user = unserialize(base64_decode(ryzom_get_param('user'))); + $_SESSION['user'] = $user; + return $user; +} + +function ryzom_get_user_id($cid, $name, $creation_date) { + if (isset($_SESSION['user'])) + return $_SESSION['user']['id']; + + $user = unserialize(base64_decode(ryzom_get_param('user'))); + $_SESSION['user'] = $user; + + return $user['id']; +} + + +?> diff --git a/code/web/api/client/utils.php b/code/web/api/client/utils.php new file mode 100644 index 000000000..62a2de0c8 --- /dev/null +++ b/code/web/api/client/utils.php @@ -0,0 +1,3 @@ + diff --git a/code/web/api/common/auth.php b/code/web/api/common/auth.php new file mode 100644 index 000000000..1d52c5d8e --- /dev/null +++ b/code/web/api/common/auth.php @@ -0,0 +1,67 @@ +The application '._t(APP_NAME).' require authentication. Please enter your credentials'; + + $c .= '
'.$welcome_message.'

'; + + if ($user['message']) + $c .= '
'._t($user['message']).'

'; + $c .= ryzom_render_login_form($name, false); + echo ryzom_app_render(_t('app_'.APP_NAME), $c); + exit; + } + return false; + } + } + + if ($lang) + $_SESSION['lang'] = $lang; + + // get user informations + $user = ryzom_user_get_info($cid); + $user['lang'] = $_SESSION['lang']; + if (isset($user['creation_date'])) + $user['id'] = ryzom_get_user_id($cid, $user['char_name'], $user['creation_date']); + if ($is_ingame && $user['last_played_date'] != '0') + $user['ig'] = true; + else + $user['ig'] = false; + unset($user['last_played_date']); + unset($user['creation_date']); + return true; +} + +?> diff --git a/code/web/api/common/config.php.default b/code/web/api/common/config.php.default new file mode 100644 index 000000000..3a00bb04e --- /dev/null +++ b/code/web/api/common/config.php.default @@ -0,0 +1,28 @@ +. + */ + +// Url where the api is +define('RYAPI_URL', 'http://'); +if (!defined('RYAPI_PATH')) + define('RYAPI_PATH', dirname(__FILE__).'/'); +// used by "home" link +if (!defined('RYAPP_URL')) + define('RYAPP_URL', 'http://'); + +?> diff --git a/code/web/api/common/db_lib.php b/code/web/api/common/db_lib.php new file mode 100644 index 000000000..c3c7e8677 --- /dev/null +++ b/code/web/api/common/db_lib.php @@ -0,0 +1,422 @@ +. + */ + +define('SQL_DEF_TEXT', 0); +define('SQL_DEF_BOOLEAN', 1); +define('SQL_DEF_INT', 2); +define('SQL_DEF_DATE', 3); + + +// Wrapper for SQL database interactions +class ServerDatabase +{ + var $hostname = ''; + var $username = ''; + var $password = ''; + var $database = ''; + + var $_connection = Null; + + function ServerDatabase($host='', $user='', $passwd='', $dbname='') + { + if (($host != '') && ($user != '') && ($dbname != '')) + { + $this->hostname = $host; + $this->username = $user; + $this->password = $passwd; + $this->database = $dbname; + } + + if (($this->hostname != '') && ($this->username != '') && ($this->database != '')) + { + $this->_connection = mysql_connect($this->hostname, $this->username, $this->password) + or die("ERR1"); // ace . $this->get_error()); + $this->select_db($this->database); + } + } + + function close() + { + @mysql_close($this->_connection); + } + + function query($sql_statement) + { + $result = mysql_query($sql_statement, $this->_connection); + return $result; + } + + function select_db($dbname) { + $this->database = $dbname; + mysql_select_db($this->database, $this->_connection) or die("Database selection error : " . $this->get_error()); + } + + function num_rows($result) + { + return @mysql_num_rows($result); + } + + function fetch_row($result, $result_type=MYSQL_BOTH) + { + return @mysql_fetch_array($result, $result_type); + } + + function fetch_assoc($result) + { + return @mysql_fetch_array($result, MYSQL_ASSOC); + } + + + function query_single_row($sql_statement) + { + $result = $this->query($sql_statement); + return @mysql_fetch_array($result); + } + + function free_result($result) + { + @mysql_free_result($result); + } + + function get_error() + { + return mysql_errno($this->_connection) .": ". mysql_error($this->_connection); + } + + function last_insert_id() + { + return @mysql_insert_id(); + } + + function change_to($host,$user,$pass,$dbname) + { + $this->close(); + $this->hostname = $host; + $this->username = $user; + $this->password = $pass; + $this->database = $dbname; + $this->ServerDatabase(); + } +} + + + + +class ryDB { + + private static $_instances = array(); + private $db; + private $defs = array(); + private $errors = ''; + + + private function __construct($db_name) { + global $_RYZOM_API_CONFIG; + + $this->db = new ServerDatabase(RYAPI_WEBDB_HOST, RYAPI_WEBDB_LOGIN, RYAPI_WEBDB_PASS, $db_name); + $this->db->query("SET NAMES utf8"); + } + + public static function getInstance($db_name) { + if (!array_key_exists($db_name, self::$_instances)) + self::$_instances[$db_name] = new ryDB($db_name); + + self::$_instances[$db_name]->db->select_db($db_name); + return self::$_instances[$db_name]; + } + + function setDbDefs($table, $defs) { + $this->defs[$table] = $defs; + } + + function getDefs($table) { + if (!array_key_exists($table, $this->defs)) + die("Please add tables defs using setDbDefs('$table', \$defs)"); + return $this->defs[$table]; + } + + function getErrors() { + return $this->db->get_error(); + } + + function now() { + return date('Y-m-d H:i:s', time()); + } + + function toDate($timestamp) { + return date('Y-m-d H:i:s', $timestamp); + } + + function fromDate($string_date) { + return strtotime($string_date); + } + + function addDbTableProp($table, $props) { + $this->props[$table] = $props; + } + + /// DIRECT QUERY + function sqlQuery($sql) { + $result = $this->db->query($sql); + $ret = array(); + while ($row = $this->db->fetch_row($result)) { + $ret[] = $row; + } + return $ret; + } + + + /// QUERY /// + function sqlSelect($table, $props, $values=array(), $extra='') { + if ($table) { + $sql = "SELECT\n\t"; + $params = array(); + $test = array(); + if (!$props) + die("Bad Select on [$table] : missing props"); + + foreach($props as $name => $type) + $params[] = '`'.addslashes($name).'`'; + + foreach($values as $name => $value) { + if ($name[0] == '=') + $test[] = '('.addslashes(substr($name, 1)).' LIKE '.var_export($value, true).')'; + else + $test[] = '('.addslashes($name).' = '.var_export($value, true).')'; + } + $sql .= implode(",\n\t", $params)."\nFROM\n\t".$table."\n"; + if ($test) + $sql .= "WHERE\n\t".implode("\nAND\n\t", $test); + } + + if ($extra) + $sql .= "\n".$extra; + return $sql.';'; + + } + + function querySingle($table, $values=array(), $extra='') { + $sql = $this->sqlSelect($table, $this->getDefs($table), $values, $extra); + $result = $this->db->query($sql); + return $this->db->fetch_row($result); + } + + function querySingleAssoc($table, $values=array(), $extra='') { + $sql = $this->sqlSelect($table, $this->getDefs($table), $values, $extra); + $result = $this->db->query($sql); + return $this->db->fetch_row($result, MYSQL_ASSOC); + } + + function query($table, $values=array(), $extra='') { + $sql = $this->sqlSelect($table, $this->getDefs($table), $values, $extra); + $result = $this->db->query($sql); + $ret = array(); + while ($row = $this->db->fetch_row($result)) { + $ret[] = $row; + } + return $ret; + } + + function queryAssoc($table, $values=array(), $extra='') { + $sql = $this->sqlSelect($table, $this->getDefs($table), $values, $extra); + $result = $this->db->query($sql); + $ret = array(); + while ($row = $this->db->fetch_row($result, MYSQL_ASSOC)) { + $ret[] = $row; + } + return $ret; + } + + /// INSERT /// + function sqlInsert($table, $props, $vals) { + $sql = 'INSERT INTO '.$table.' '; + $params = array(); + $values = array(); + foreach($props as $name => $type) { + if (!isset($vals[$name])) + continue; + $params[] = $name; + switch ($type) { + case SQL_DEF_BOOLEAN: + $values[] = $vals[$name]?1:0; + break; + case SQL_DEF_INT: + $values[] = $vals[$name]; + break; + case SQL_DEF_DATE: // date + if (is_string($vals[$name])) + $values[] = "'".addslashes($vals[$name])."'"; + else + $values[] = "'".$this->toDate($vals[$name])."'"; + break; + default: + $values[] = "'".addslashes($vals[$name])."'"; + break; + } + } + $sql .= "(\n\t".implode(",\n\t", $params)."\n) VALUES (\n\t".implode(",\n\t", $values)."\n);"; + return $sql; + } + + function insert($table, $values) { + $sql = $this->sqlInsert($table, $this->getDefs($table), $values); + $this->db->query($sql); + return $this->db->last_insert_id(); + } + + /// DELETE /// + function sqlDelete($table, $values=array(), $where='') { + $sql = "DELETE FROM\n\t".$table."\n"; + $test = array(); + foreach($values as $name => $value) + $test[] = '('.addslashes($name).' = '.var_export($value, true).')'; + + if ($test or $where) + $sql .= "WHERE\n\t"; + if ($test) + $sql .= implode("\nAND\n\t", $test); + if ($where) + $sql .= "\n".$where; + return $sql.';'; + } + + function delete($table, $values=array(), $where='') { + $sql = $this->sqlDelete($table, $values, $where); + $result = $this->db->query($sql); + return $result; + } + + /// UPDATE /// + function sqlUpdate($table, $props, $vals, $tests, $extra) { + $sql = 'UPDATE '.$table.' SET '; + $params = array(); + $test = array(); + $values = array(); + foreach($props as $name => $type) { + if (!array_key_exists($name, $vals)) + continue; + switch ($type) { + case SQL_DEF_BOOLEAN: + $values[] = '`'.$name.'` = '.($vals[$name]?'1':'0'); + break; + case SQL_DEF_DATE: + if (is_string($vals[$name])) + $values[] = '`'.$name.'` = \''.addslashes($vals[$name]).'\''; + else + $values[] = '`'.$name.'` = \''.$this->toDate($vals[$name]).'\''; + break; + default: + $values[] = '`'.$name.'` = \''.addslashes($vals[$name]).'\''; + break; + } + } + $sql .= "\n\t".implode(",\n\t", $values)."\n"; + + foreach($tests as $name => $value) { + $test[] = '('.addslashes($name).' = '.var_export($value, true).')'; + } + if ($test) + $sql .= "WHERE\n\t".implode("\nAND\n\t", $test); + + $sql .= "\n".$extra; + + return $sql; + } + + + function update($table, $values=array(), $test=array(), $extra='') { + $sql = $this->sqlUpdate($table, $this->getDefs($table), $values, $test, $extra); + $result = $this->db->query($sql); + return $result; + } + + function sqlInsertOrUpdate($table, $props, $vals) { + $sql = $this->sqlInsert($table, $props, $vals); + $sql = substr($sql, 0, strlen($sql)-1); + $params = array(); + $test = array(); + $values = array(); + foreach($props as $prop) { + if (!array_key_exists($prop[2], $vals)) + continue; + $type = $prop[0]; + $check = $prop[1]; + $name = $prop[2]; + if ($type{0} == '#') + $type = substr($type, 1); + if (($type{0} == '>') or ($type == 'id')) + continue; + switch ($type) { + case 'trad': + $values[] = '`'.$name."` = '".addslashes($vals[$name])."'"; + break; + case 'textarea': + case 'string': + case 'option': + $values[] = '`'.$name."` = '".addslashes($vals[$name])."'"; + break; + case 'id': + case 'int': + case 'float': + $values[] = '`'.$name.'` = '.addslashes($vals[$name]); + break; + case 'bool': + $values[] = '`'.$name.'` = '.($vals[$name]?'1':'0'); + break; + } + } + $sql .= "\nON DUPLICATE KEY UPDATE\n\t".implode(",\n\t", $values)."\n"; + return $sql; + } + + function insertOrUpdate($table, $values) { + $sql = $this->sqlInsertOrUpdate($table, $this->getDefs($table), $values); + return $result; + } + + + /// Display + function getTableHtml($name, $params, $values, $order_by='') + { + $ret = ''; + $tr_header = ''; + $ret .= _s('t header', $tr_header); + $i = 0; + if (!$values) + return ''; + $current_section = ''; + foreach ($values as $rows) { + if ($order_by && $rows[$order_by] != $current_section) { + $current_section = $rows[$order_by]; + if ($current_section != '0') + $ret .= _s('t row ', ''.str_repeat('', count($params)-1)); + } + $td = ''; + foreach ($params as $test => $param) + $td .= ''; + $ret .= _s('t row '.strval($i % 2), $td); + $i++; + } + $ret .= '
 '; + $tr_header .= implode(' ', array_keys($params)).''._s('section', $current_section).''._s('section', ' ').' '.$rows[$param].'
'; + return $ret; + } + +} + +?> diff --git a/code/web/api/common/logger.php b/code/web/api/common/logger.php new file mode 100644 index 000000000..1e5106b54 --- /dev/null +++ b/code/web/api/common/logger.php @@ -0,0 +1,43 @@ +log_indent += $indent; + if ($log) { + $tabs = str_repeat(" ", $this->log_indent); + $a = $tabs.str_replace("\n", "\n ".$tabs, $log); + $this->logs[] = ''.$a.''; + } + } + + function addPrint($log, $color='#FFFF00') { + $this->logs[] = ''.$log.''; + } + + function addError($log) { + $this->logs[] = ' ERROR: '.$log.''; + } + + function getLogs() { + $ret = ''; + if ($this->logs && $this->enable) + $ret = "Debug\n\n".implode("\n", $this->logs); + $this->logs = array(); + return $ret; + } +} + + +?> diff --git a/code/web/api/common/render.php b/code/web/api/common/render.php new file mode 100644 index 000000000..60b101d38 --- /dev/null +++ b/code/web/api/common/render.php @@ -0,0 +1,215 @@ +. + */ + +function ryzom_app_render($title, $content, $ig=false, $bgcolor='', $javascript=array(), $homeLink=false) { + $c = ''; + // Render header + $title_prefix = ''; + if (ON_IPHONE) { + $title_prefix = 'Ryzom - '; + } + + if (!$bgcolor) + $bgcolor = '#000000'.($ig?'00':''); + + if (!$ig) { + $c .= ''."\n"; + $c .= ' + '."\n"; + $c .= ' '.$title_prefix.(translation_exists($title)?_t($title):$title).''."\n"; + $c .= ' '."\n"; + $c .= ryzom_render_header(); + $c .= ryzom_render_header_www(); + $events = ON_IPHONE ? 'onorientationchange="updateOrientation();" ' : ''; + $c .= ' '."\n"; + $c .= ' '."\n"; + // Javascript + $js_code = ''; + foreach ($javascript as $js) + $js_code .= ''; + $c .= $js_code; + + $c .= ryzom_render_www(ryzom_render_window($title, $content, $homeLink)); + $c .= ''; + } else { + $c .= ''; + $c .= $content; + $debug = ryLogger::getInstance()->getLogs(); + if ($debug) + $c .= '
'.$debug.'
'; + $c .= ''; + } + return $c; +} + +function ryzom_render_header() { + if (ON_IPHONE) { + return ''; + } else { + return ' '; + } +} + +// Call this inside the part if you want to use ryzom_render_www +function ryzom_render_header_www() { + if (ON_IPHONE) { + return ' + + + + + '; + } else { + return ' + +'; + } +} + +// Render a Ryzom style window +function ryzom_render_window($title, $content, $homeLink=false) { + return ryzom_render_window_begin($title, $homeLink) . $content . ryzom_render_window_end(); +} + +function ryzom_render_window_begin($title, $homeLink=false) { + + if ($homeLink === false) + $homeLink = ''._t('home').''; + + return ' +
+
+
'.(translation_exists($title)?_t($title):$title).$homeLink.'
+
+
+
+
+'; +} + +function ryzom_render_window_end() { + return '
+
'.ryLogger::getInstance()->getLogs().'
+

powered by ryzom-api

+
+ '; +} + +// Render a webpage using www.ryzom.com style +function ryzom_render_www($content) { + return ryzom_render_www_begin() . $content . ryzom_render_www_end(); +} + +function ryzom_render_www_begin($url='') { + $style1 = 'position: relative; padding-top: 20px; padding-right: 30px; margin-bottom: -3px'; + $style2 = 'position: absolute; bottom: 0; right: 0; '; + if (ON_IPHONE) { + $style1 = 'position: relative; padding-top: 30px; padding-right: 30px; '; + $style2 = 'position: fixed; top: 0; right: 0; padding-right: 0px;'; + $marginBottom = ''; + } + if (!$url) { + $url_params = parse_query($_SERVER['REQUEST_URI']); + unset($url_params['lang']); + + $url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?'.http_build_query($url_params); + } + return ' +
+
+
+ English + French + German + Russian +
+ +
+
+'; +} + +function ryzom_render_www_end() { + return '
'; +} + +function ryzom_render_login_form($char, $aligned=true) { + $c = ''; + if ($aligned) { + $c .= '
'; + $c .= ''; + $c .= ''; + $c .= ''; + $c .= ''; + $c .= ''; + } else { + $c .= '
'._t('enter_char').'
'._t('enter_password').'
'; + $c .= ''; + $c .= ''; + $c .= ''; + $c .= ''; + $c .= ''; + } + $c .= '
'._t('login').'
'._t('password').'
'; + return $c; +} + +?> diff --git a/code/web/api/common/user.php b/code/web/api/common/user.php new file mode 100644 index 000000000..62a2de0c8 --- /dev/null +++ b/code/web/api/common/user.php @@ -0,0 +1,3 @@ + diff --git a/code/web/api/common/utils.php b/code/web/api/common/utils.php new file mode 100644 index 000000000..9f12fdfc1 --- /dev/null +++ b/code/web/api/common/utils.php @@ -0,0 +1,182 @@ + $v) { + if (is_int($k) && $prefix != null) { + $k = urlencode($prefix . $k); + } + if ((!empty($key)) || ($key === 0)) $k = $key.'['.urlencode($k).']'; + if (is_array($v) || is_object($v)) { + array_push($ret, http_build_query($v, '', $sep, $k)); + } else { + array_push($ret, $k.'='.urlencode($v)); + } + } + if (empty($sep)) $sep = ini_get('arg_separator.output'); + return implode($sep, $ret); + } +} + + +/*** + * + * Translation utilities + * + * ***/ + +function translation_exists($id) { + global $user, $ryzom_texts; + return isset($ryzom_texts[$id]) && isset($ryzom_texts[$id][$user['lang']]); +} + +// Translate the $id in the selected language +function get_translation($id, $lang, $args=array()) { + global $ryzom_texts, $user; + if(!isset($ryzom_texts[$id])) return '{'.$id.'}'; + if(!isset($ryzom_texts[$id][$lang])) return '{'.$id.'['.$lang.']}'; + if($ryzom_texts[$id][$lang] == '' && isset($ryzom_texts[$id]['en'])) return @vsprintf($ryzom_texts[$id]['en'], $args); + return @vsprintf($ryzom_texts[$id][$lang], $args); +} + + +// Translate the $id in the user language +function _t($id, $args=array()) { + global $ryzom_texts, $user; + + $a = ''; + if ($args) { + if (is_array($args)) { + $a = array(); + foreach ($args as $arg) + $a[] = strval($arg); + $a = ' '.implode(', ', $a); + } else + $a = ' '.strval($args); + } + if(!isset($ryzom_texts[$id])) return '{'.$id.$a.'}'; + if(!isset($ryzom_texts[$id][$user['lang']])) return '{'.$id.'['.$user['lang'].']'.$a.'}'; + if($ryzom_texts[$id][$user['lang']] == '' && isset($ryzom_texts[$id]['en']) && $ryzom_texts[$id]['en'] != '') return @vsprintf($ryzom_texts[$id]['en'], $args); + if($ryzom_texts[$id][$user['lang']] == '' && isset($ryzom_texts[$id]['fr']) && $ryzom_texts[$id]['fr'] != '') return '{'.$id.$a.'}'; + if($ryzom_texts[$id][$user['lang']] == '' && isset($ryzom_texts[$id]['de']) && $ryzom_texts[$id]['de'] != '') return '{'.$id.$a.'}'; + return @vsprintf($ryzom_texts[$id][$user['lang']], $args); +} + +/*** + * + * Ryzom time + * + * ***/ + + + +// Get a human and translated readable time, for example "3 days ago" +function ryzom_relative_time($timestamp) { + global $ryzom_periods, $user; + $difference = time() - $timestamp; + $lengths = array("60","60","24","7","4.35","12","10"); + + if ($difference >= 0) { // this was in the past + $ending = _t('ago'); + } else { // this was in the future + $difference = -$difference; + $ending = _t('to_go'); + } + for($j = 0,$m=count($lengths); $j<$m && $difference >= $lengths[$j]; $j++) + $difference /= $lengths[$j]; + // round hours as '1.2 hours to go' + $difference = round($difference, ($j == 2) ? 1 : 0); + + $form = ($difference == 1) ? 'singular' : 'plural'; + + // Handle exceptions + // French uses singular form if difference = 0 + if ($user['lang'] == 'fr' && ($difference == 0)) { + $form = 'singular'; + } + // Russian has a different plural form for plurals of 2 through 4 + if ($user['lang'] == 'ru' && ($form == 'plural')) { + if ($difference < 5) { + $form = '2-4'; + } + } + + $final = $ryzom_periods[$user['lang']][$form][$j]; + $text = _t('date_format', array($difference, $final, $ending)); + return $text; +} + +// Get a human and translated absolute date +function ryzom_absolute_time($timestamp) { + global $user, $ryzom_daysofweek, $ryzom_monthnames; + $day_of_month = date("j", $timestamp); + $dow = date("w", $timestamp); + $month = date("n", $timestamp); + $day_of_week = $ryzom_daysofweek[$user['lang']][$dow]; + $month_str = $ryzom_monthnames[$user['lang']][$month-1]; + $text = _t("absolute_date_format", array($day_of_month, $day_of_week, $month_str, $month, date("m", $timestamp), date("d", $timestamp))); + return $text; +} + +/*** + * + * Debug tools + * + * ***/ + +function p($var, $value=NULL) { + ob_start(); + debug_print_backtrace(); + $bt = ob_get_contents(); + ob_end_clean(); + $bt = explode("\n",$bt); + $bt = explode('[', $bt[1]); + ob_start(); + echo ''.substr($bt[count($bt)-1], 0, -1)."\n"; + if ($value !== NULL) { + echo ''.$var.' : '; + $var = $value; + } + //if (is_array($var)) + echo '
';
+	print_r($var);
+	echo '
'; +// else + // var_dump($var); + ryLogger::getInstance()->addPrint(ob_get_contents()); + ob_end_clean(); +} + +?> diff --git a/code/web/api/data/css/ryzom_iphone.css b/code/web/api/data/css/ryzom_iphone.css new file mode 100644 index 000000000..c837ffbf4 --- /dev/null +++ b/code/web/api/data/css/ryzom_iphone.css @@ -0,0 +1,248 @@ +/* Copyright (C) 2009 Winch Gate Property Limited + * + * This file is part of ryzom_api. + * ryzom_api is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ryzom_api 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with ryzom_api. If not, see . + */ + +html, body, form, fieldset, p, div, h1, h2, h3, h4, h5, h6 { + margin:0; + padding:0; + -webkit-text-size-adjust: none; +} + +body { + font-size: 14px; + background: black; + font-family: Helvetica; +} + +ul li { + padding: 0px 4px 10px 2px; + list-style: circle outside; +} +ol li { + padding: 0px 4px 10px 2px; +} +.ryzom-ui p { + padding-bottom:8px; +} + +#main { + clear: both; + padding-top: 0px; + overflow:auto; + margin-left:auto; + margin-right:auto; + text-align:left +} +.error { + padding:.5em; + background:#ff5555; + color:white; + font-weight:bold +} +/*----------------------------- + ORIENTATION +-----------------------------*/ + +.content_wide, +.content_normal { + display:none; +} + +.show_normal { + width: 320px; +} + +.show_wide { + width: 480px; +} + +.show_wide .content_wide, +.show_normal .content_normal { + display: block; +} + +/* ---------------------- */ + + +.ryzom-ui { + color: white; +} +.ryzom-ui input, .ryzom-ui select { + border-top: 1px solid #030403; + border-right: 1px solid #6e7f57; + border-bottom: 1px solid #889e6c; + border-left: 1px solid #272d1f; + background-color: #37402b; + color: #ddd; + font-size: 16px; + margin: 2px 0 5px 0; +} +.ryzom-ui input[type=text] { + width: 96%; +} + +.ryzom-ui textarea { + width: 96%; + background-color: black; + color: white; + font-size: 16px; + font-family: Helvetica; +} +/* input[type=submit] will make IE6 to ignore whole CSS rule, so cant combine this with .ryzom-ui-button below */ +input[type=submit] { + border-bottom: 1px solid #030403; + border-left: 1px solid #6e7f57; + border-top: 1px solid #889e6c; + border-right: 1px solid #272d1f; + background-color: #435120; +} +input.ryzom-ui-button, .ryzom-ui-button { + border-bottom: 1px solid #030403; + border-left: 1px solid #6e7f57; + border-top: 1px solid #889e6c; + border-right: 1px solid #272d1f; + background-color: #435120; +} + +a, a:visited {color:orange} + +a:hover {color:orange} + +a.ryzom-ui-button, a.ryzom-ui-button:visited { + color: white; + padding: 0 .5em; + text-decoration: none; +} +a.ryzom-ui-button:hover { + background: #536130; + color: #ddd; +} +/* window without title - just borders */ +.ryzom-ui-tl { +} +.ryzom-ui-tr { +} +.ryzom-ui-t { + background-image: url(skin_t.gif); + background-repeat: repeat-x; + background-position: left top; + height: 8px; + margin: 0; +} +/* window with proper header */ +.ryzom-ui-header .ryzom-ui-tl { + margin: 0px 0px; + height: 32px; +} +.ryzom-ui-header .ryzom-ui-tr { + height: 32px; +} +.ryzom-ui-header .ryzom-ui-t { + background-image: url(skin_header_m.gif); + background-repeat: repeat-x; + background-position: left top; + padding: 7px 0 0 12px; + height: 32px; + text-transform: uppercase; + color: white; + border-top: 1px solid #030403; +} +/* window body */ +.ryzom-ui-l { +} +.ryzom-ui-r { +} +.ryzom-ui-m { + margin: 0 0px; + padding: 0px; + background-image: url(skin_blank.png); + background-repeat: repeat; +} +.ryzom-ui-body { + background-image: url(skin_blank_inner.png); + background-repeat: repeat; + /* leave 5px room after bottom border */ + margin: 0 8px 5px 2px; + padding: 5px 5px 5px 5px; + border-top: 1px solid #030403; + border-right: 1px solid #6e7f57; + border-bottom: 1px solid #889e6c; + border-left: 1px solid #272d1f; +} +/* window bottom border */ +.ryzom-ui-bl { + height: 8px; +} +.ryzom-ui-br { + height: 8px; +} +.ryzom-ui-b { + height: 8px; + margin: 0 8px; +} +.ryzom-ui-notice { + margin: 0px; + padding: 0px; + color: #999; + text-align: center; +} +a.ryzom-ui-notice, a.ryzom-ui-notice:visited { + margin: 0px; + padding: 0px; + color: #BBB; + padding: 0 .5em; + text-decoration: underline; +} +a.ryzom-ui-notice:hover { + color: gray; +} + +.ryzom-ui-t .ryzom-ui-text-button { + font-size: 85%; +} +a.ryzom-ui-text-button, a:visited.ryzom-ui-text-button { + color:#FFFF11; + text-decoration:none; +} + +.ryzom-ui-text-button { + border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; +} +.ryzom-ui-text-button { + padding: 0;margin: 0; + border-color: #ff8 #ff3 #ff3 #ff8; + border-width: 1px; + border-style: solid; + padding: 0px 4px; + color: white; +} + +.ryzom-ui-wrap-ul { + float: left; + text-align: center; + padding: 0; + list-style: none; +} + +.ryzom-ui-wrap-li { + float: left; + margin: 0 0 10px 5px; + width: 6.1em; + list-style: none; + height: 70px; +} diff --git a/code/web/api/data/css/ryzom_ui.css b/code/web/api/data/css/ryzom_ui.css new file mode 100644 index 000000000..8342b77f8 --- /dev/null +++ b/code/web/api/data/css/ryzom_ui.css @@ -0,0 +1,227 @@ +/* Copyright (C) 2009 Winch Gate Property Limited + * + * This file is part of ryzom_api. + * ryzom_api is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ryzom_api 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with ryzom_api. If not, see . + */ + +/* + * Check ryzom_api/functions_render.php for easy php function to render ryzom layout or use this following html: + * +
+
+
+
+
+
+
+
+
+ */ + +.ryzom-ui { + color: white; +} +.ryzom-ui input, .ryzom-ui select { + border-top: 1px solid #030403; + border-right: 1px solid #6e7f57; + border-bottom: 1px solid #889e6c; + border-left: 1px solid #272d1f; + background-color: #37402b; + color: #ddd; + font-size: 12px; + margin: 2px 0 5px 0; +} +.ryzom-ui input[type=text] { + width: 100%; +} + +.ryzom-ui textarea { + width: 98%; +} + +/* input[type=submit] will make IE6 to ignore whole CSS rule, so cant combine this with .ryzom-ui-button below */ +input[type=submit] { + border-bottom: 1px solid #030403; + border-left: 1px solid #6e7f57; + border-top: 1px solid #889e6c; + border-right: 1px solid #272d1f; + background-color: #435120; +} +input.ryzom-ui-button, .ryzom-ui-button { + border-bottom: 1px solid #030403; + border-left: 1px solid #6e7f57; + border-top: 1px solid #889e6c; + border-right: 1px solid #272d1f; + background-color: #435120; +} +a.ryzom-ui-button, a.ryzom-ui-button:visited { + color: white; + padding: 0 .5em; + text-decoration: none; +} +a.ryzom-ui-button:hover { + background: #536130; + color: #ddd; +} +/* window without title - just borders */ +.ryzom-ui-tl { + background-image: url(skin_tl.gif); + background-repeat: no-repeat; + background-position: left top; + width: 100%; height: 8px; +} +.ryzom-ui-tr { + background-image: url(skin_tr.gif); + background-repeat: no-repeat; + background-position: right top; + height: 8px; +} +.ryzom-ui-t { + background-image: url(skin_t.gif); + background-repeat: repeat-x; + background-position: left top; + height: 8px; + margin: 0 8px; +} +/* window with proper header */ +.ryzom-ui-header .ryzom-ui-tl { + margin: 0px 0px; + background-image: url(skin_header_l.gif); + background-repeat: no-repeat; + background-position: left top; + height: 32px; +} +.ryzom-ui-header .ryzom-ui-tr { + background-image: url(skin_header_r.gif); + background-repeat: no-repeat; + background-position: right top; + height: 32px; +} +.ryzom-ui-header .ryzom-ui-t { + background-image: url(skin_header_m.gif); + background-repeat: repeat-x; + background-position: left top; + margin-left: 12px; + margin-right: 26px; + padding-top: 9px; + height: 32px; + text-transform: uppercase; + color: white; +} +/* window body */ +.ryzom-ui-l { + background-image: url(skin_l.gif); + background-position: left top; + background-repeat: repeat-y; + width: 100%; +} +.ryzom-ui-r { + background-image: url(skin_r.gif); + background-position: right top; + background-repeat: repeat-y; + width: 100%; +} +.ryzom-ui-m { + margin: 0 8px; + padding: 8px; + background-image: url(skin_blank.png); + background-repeat: repeat; +} +.ryzom-ui-body { + background-image: url(skin_blank_inner.png); + background-repeat: repeat; + /* leave 5px room after bottom border */ + margin: 0px 0 5px 0; + padding: 10px 10px 5px 10px; + border-top: 1px solid #030403; + border-right: 1px solid #6e7f57; + border-bottom: 1px solid #889e6c; + border-left: 1px solid #272d1f; +} +/* window bottom border */ +.ryzom-ui-bl { + background-image: url(skin_bl.gif); + background-repeat: no-repeat; + background-position: left top; + height: 8px; +} +.ryzom-ui-br { + background-image: url(skin_br.gif); + background-repeat: no-repeat; + background-position: right top; + height: 8px; +} +.ryzom-ui-b { + background-image: url(skin_b.gif); + background-repeat: repeat-x; + background-position: left top; + height: 8px; + margin: 0 8px; +} +.ryzom-ui-notice { + margin: 0px; + padding: 0px; + color: #333; + text-align: center; +} +a.ryzom-ui-notice, a.ryzom-ui-notice:visited { + margin: 0px; + padding: 0px; + color: #555; + padding: 0 .5em; + text-decoration: underline; +} +a.ryzom-ui-notice:hover { + color: gray; +} + +.ryzom-ui-t .ryzom-ui-text-button { + font-size: 85%; +} +a.ryzom-ui-text-button, a:visited.ryzom-ui-text-button { + color:#FFFF11; + text-decoration:none; +} + +.ryzom-ui-text-button { + border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; +} +.ryzom-ui-text-button { + padding: 0;margin: 0; + border-color: #ff8 #ff3 #ff3 #ff8; + border-width: 1px; + border-style: solid; + padding: 0px 4px; + color: white; +} + +.ryzom-ui-wrap-ul { + float: left; + text-align: center; + padding: 0; + list-style: none; + margin-top: -5px; + margin-bottom: -20px; +} + +.ryzom-ui-wrap-li { + float: left; + margin: 0 5px 10px 5px; + width: 6.1em; + padding: 0; + list-style: none; + height: 70px; +} diff --git a/code/web/api/data/css/skin_b.gif b/code/web/api/data/css/skin_b.gif new file mode 100644 index 000000000..a1a0390bc Binary files /dev/null and b/code/web/api/data/css/skin_b.gif differ diff --git a/code/web/api/data/css/skin_bl.gif b/code/web/api/data/css/skin_bl.gif new file mode 100644 index 000000000..459dc0065 Binary files /dev/null and b/code/web/api/data/css/skin_bl.gif differ diff --git a/code/web/api/data/css/skin_blank.png b/code/web/api/data/css/skin_blank.png new file mode 100644 index 000000000..0fefeaab0 Binary files /dev/null and b/code/web/api/data/css/skin_blank.png differ diff --git a/code/web/api/data/css/skin_blank_inner.png b/code/web/api/data/css/skin_blank_inner.png new file mode 100644 index 000000000..b728324ef Binary files /dev/null and b/code/web/api/data/css/skin_blank_inner.png differ diff --git a/code/web/api/data/css/skin_br.gif b/code/web/api/data/css/skin_br.gif new file mode 100644 index 000000000..3a01335f8 Binary files /dev/null and b/code/web/api/data/css/skin_br.gif differ diff --git a/code/web/api/data/css/skin_header_l.gif b/code/web/api/data/css/skin_header_l.gif new file mode 100644 index 000000000..288016a1d Binary files /dev/null and b/code/web/api/data/css/skin_header_l.gif differ diff --git a/code/web/api/data/css/skin_header_m.gif b/code/web/api/data/css/skin_header_m.gif new file mode 100644 index 000000000..48d539173 Binary files /dev/null and b/code/web/api/data/css/skin_header_m.gif differ diff --git a/code/web/api/data/css/skin_header_r.gif b/code/web/api/data/css/skin_header_r.gif new file mode 100644 index 000000000..c8711c2f5 Binary files /dev/null and b/code/web/api/data/css/skin_header_r.gif differ diff --git a/code/web/api/data/css/skin_l.gif b/code/web/api/data/css/skin_l.gif new file mode 100644 index 000000000..4ca369db5 Binary files /dev/null and b/code/web/api/data/css/skin_l.gif differ diff --git a/code/web/api/data/css/skin_r.gif b/code/web/api/data/css/skin_r.gif new file mode 100644 index 000000000..3c821e89e Binary files /dev/null and b/code/web/api/data/css/skin_r.gif differ diff --git a/code/web/api/data/css/skin_t.gif b/code/web/api/data/css/skin_t.gif new file mode 100644 index 000000000..aefc8416b Binary files /dev/null and b/code/web/api/data/css/skin_t.gif differ diff --git a/code/web/api/data/css/skin_tl.gif b/code/web/api/data/css/skin_tl.gif new file mode 100644 index 000000000..7dd640272 Binary files /dev/null and b/code/web/api/data/css/skin_tl.gif differ diff --git a/code/web/api/data/css/skin_tr.gif b/code/web/api/data/css/skin_tr.gif new file mode 100644 index 000000000..7543d7221 Binary files /dev/null and b/code/web/api/data/css/skin_tr.gif differ diff --git a/code/web/api/data/img/bg.jpg b/code/web/api/data/img/bg.jpg new file mode 100644 index 000000000..7d07d98c7 Binary files /dev/null and b/code/web/api/data/img/bg.jpg differ diff --git a/code/web/api/data/img/lang/de.png b/code/web/api/data/img/lang/de.png new file mode 100644 index 000000000..767abe088 Binary files /dev/null and b/code/web/api/data/img/lang/de.png differ diff --git a/code/web/api/data/img/lang/en.png b/code/web/api/data/img/lang/en.png new file mode 100644 index 000000000..2673310cc Binary files /dev/null and b/code/web/api/data/img/lang/en.png differ diff --git a/code/web/api/data/img/lang/fr.png b/code/web/api/data/img/lang/fr.png new file mode 100644 index 000000000..420474693 Binary files /dev/null and b/code/web/api/data/img/lang/fr.png differ diff --git a/code/web/api/data/img/lang/ru.png b/code/web/api/data/img/lang/ru.png new file mode 100644 index 000000000..53aaf57be Binary files /dev/null and b/code/web/api/data/img/lang/ru.png differ diff --git a/code/web/api/data/img/lang/sp.png b/code/web/api/data/img/lang/sp.png new file mode 100644 index 000000000..5ef5123ba Binary files /dev/null and b/code/web/api/data/img/lang/sp.png differ diff --git a/code/web/api/data/img/logo.gif b/code/web/api/data/img/logo.gif new file mode 100644 index 000000000..adc59fd29 Binary files /dev/null and b/code/web/api/data/img/logo.gif differ diff --git a/code/web/api/index.php b/code/web/api/index.php new file mode 100644 index 000000000..70e3eb1d2 --- /dev/null +++ b/code/web/api/index.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/code/web/api/player_auth.php b/code/web/api/player_auth.php new file mode 100644 index 000000000..984a96fe7 --- /dev/null +++ b/code/web/api/player_auth.php @@ -0,0 +1,44 @@ +. + */ + +require_once('ryzom_api.php'); +$cid = ryzom_get_param('cid'); +$name = ryzom_get_param('name'); +$authserver = ryzom_get_param('authserver'); +$authkey = ryzom_get_param('authkey'); + +if ($authserver) { + if (ryzom_authenticate_with_serverkey($cid, $name, $authserver, $authkey)) + die('1'); + die('0'); +} + +if (RYZOM_IG || ryzom_get_param('ig')) { + echo 'ig'; + if (ryzom_authenticate_ingame($cid, $name, $authkey)) { + echo 'ok'; + $user_infos = ryzom_user_get_info($cid); + echo ryzom_get_user_id($cid, $name, $user_infos['creation_date']); + die('1'); + } + die('0'); +} else { + echo ryzom_authenticate_with_session($name, $cid, $_RYZOM_API_CONFIG['base_url'].'index.php'); +} + +?> diff --git a/code/web/api/ryzom_api.php b/code/web/api/ryzom_api.php new file mode 100644 index 000000000..5cd9a7ba8 --- /dev/null +++ b/code/web/api/ryzom_api.php @@ -0,0 +1,43 @@ +. + */ + +session_start(); + +// Global defines +if (!defined('ON_IPHONE')) { + if(isset($_SERVER['HTTP_USER_AGENT'])) + define('ON_IPHONE', strpos($_SERVER['HTTP_USER_AGENT'], 'Ryzom')); + else + define('ON_IPHONE', false); +} + +$includes = array('auth', 'config', 'utils', 'user'); + +foreach ($includes as $include) { + if ($_SERVER['HTTP_HOST'] == 'shard.nuneo.org' || $_SERVER['HTTP_HOST'] == 'app.ryzom.com') + require_once("server/$include.php"); + else + require_once("client/$include.php"); + + require_once("common/$include.php"); +} + +require_once("common/db_lib.php"); +require_once("common/render.php"); + +?> diff --git a/code/web/api/server/auth.php b/code/web/api/server/auth.php new file mode 100644 index 000000000..2e2b3ca1c --- /dev/null +++ b/code/web/api/server/auth.php @@ -0,0 +1,118 @@ +. + */ + +function ryzom_authenticate_with_serverkey($cid, $name, $authserver, $authkey) { + $rawkey = RYAPI_COOKIE_KEY.$name.$cid.$authserver; + $authkey = md5($rawkey); + if ($authkey != $authkey) return false; + return true; +} + +function ryzom_authenticate_ingame($shardid, $cid, $name, $authkey) { + $db = new ServerDatabase(RYAPI_NELDB_HOST, RYAPI_NELDB_LOGIN, RYAPI_NELDB_PASS, RYAPI_NELDB_RING); + $uid = intval($cid / 16); + $sql = "SELECT cookie FROM ring_users WHERE user_id = $uid"; + $row = $db->query_single_row($sql); + + $rawkey = $shardid.$name.$cid.'\''.trim($row['cookie']).'\''; + $md5rawkey = md5($rawkey); + return $authkey == $md5rawkey; +} + +// take the character name and the account password and check if it's valid +function ryzom_authenticate_with_char_and_password($character, $password, &$cid) { + $db = new ServerDatabase(RYAPI_NELDB_HOST, RYAPI_NELDB_LOGIN, RYAPI_NELDB_PASS, RYAPI_NELDB_RING); + $char = mysql_real_escape_string($character, $db->_connection); + $sql = "SELECT char_id, char_name, user_id, home_mainland_session_id FROM characters WHERE char_name = '$char'"; + $row = $db->query_single_row($sql); + $character = $row['char_name']; + $cid = $row['char_id']; + $uid = $row['user_id']; + mysql_select_db('nel', $db->_connection); + $sql = "SELECT Password FROM user WHERE UId = $uid"; + $row = $db->query_single_row($sql); + $ok = $row['Password'] == crypt($password, $row['Password']); + return $ok; +} + +function ryzom_authenticate_with_session(&$name, &$cid, &$error_message) { + $c = ''; + + $action = ryzom_get_param('action'); + if ($action == 'logout') { + unset($_SESSION['name']); + unset($_SESSION['cid']); + } + + if (isset($_SESSION['name']) && ($name == '' || $_SESSION['name'] == $name)) { + $name = $_SESSION['cid']; + $cid = $_SESSION['cid']; + return true; + } + + $char = ryzom_get_param('char'); + $password = ryzom_get_param('password'); + + if ($char && $password) { + // check credentials + if (ryzom_authenticate_with_char_and_password($char, $password, $cid)) { + $_SESSION['name'] = $char; + $_SESSION['cid'] = $cid; + return true; + } else { + $error_message = 'bad_auth'; + } + } + + return false; +} + + + +function ryzom_get_user_id($cid, $name, $creation_date) { + $name = strtolower($name); + + $db = ryDB::getInstance('webig'); + $db->setDbDefs('players', array('id' => SQL_DEF_INT, 'cid' => SQL_DEF_INT, 'name' => SQL_DEF_TEXT, 'creation_date' => SQL_DEF_DATE, 'deleted' => SQL_DEF_BOOLEAN)); + + $charProps = $db->querySingle('players', array('cid' => intval($cid), 'deleted' => 0)); + // new char => create record + if (!$charProps) { + $charProps = array('name' => $name, 'cid' => $cid, 'creation_date' => $creation_date, 'deleted' => 0); + $charProps['id'] = $db->insert('players', $charProps); + if (!$charProps['id']) + die('ryDb New Char Error'); + } else { + // char renamed => update record + if ($charProps['name'] != $name) + if (!$db->update('players', array('name' => $name), array('id' => $charProps['id']))) + die('ryDb Rename Char Error'); + + // char deleted and recreated => change to deleted + if ($charProps['creation_date'] != $creation_date) { + if (!$db->update('players', array('deleted' => 1), array('id' => $charProps['id']))) + die('ryDb Delete char Error: '.$db->getErrors()); + $charProps = array('name' => $name, 'cid' => $cid, 'creation_date' => $creation_date, 'deleted' => 0); + if (!$charProps['id'] = $db->insert('players', $charProps)) + die('ryDb New Char in Slot Error'); + } + } + return $charProps['id']; +} + +?> diff --git a/code/web/api/server/config.php.default b/code/web/api/server/config.php.default new file mode 100644 index 000000000..d145da877 --- /dev/null +++ b/code/web/api/server/config.php.default @@ -0,0 +1,33 @@ +. + */ + +define('RYAPI_SHARDID', '101'); +define('RYAPI_WEBDB_HOST', 'localhost'); +define('RYAPI_WEBDB_LOGIN', 'localhost'); +define('RYAPI_WEBDB_PASS', 'localhost'); + +define('RYAPI_NELDB_HOST', 'localhost'); +define('RYAPI_NELDB_LOGIN', 'shard'); +define('RYAPI_NELDB_PASS', 'localhost'); +define('RYAPI_NELDB_RING', 'ring_open'); +define('RYAPI_NELDB_NEL', 'nel'); + +define('RYAPI_AUTH_SCRIPT', ''); +define('RYAPI_COOKIE_KEY', ''); + +?> diff --git a/code/web/api/server/user.php b/code/web/api/server/user.php new file mode 100644 index 000000000..9124191ae --- /dev/null +++ b/code/web/api/server/user.php @@ -0,0 +1,111 @@ +. + */ + +function ryzom_user_get_info($cid) { + // User information + global $_RYZOM_API_CONFIG; + $db = new ServerDatabase(RYAPI_NELDB_HOST, RYAPI_NELDB_LOGIN, RYAPI_NELDB_PASS, RYAPI_NELDB_RING); + $sql = "SELECT char_name, race, civilisation, cult, guild_id, creation_date, last_played_date FROM characters WHERE char_id = $cid"; + $result = $db->query($sql) or die('Could not query on ryzom_user_get_info'); + $found = $db->num_rows($result) >= 1; + if (!$found) + die('Could not found on ryzom_user_get_info'); + $row = $db->fetch_assoc($result); + $db->free_result($result); + if ($row) { + $row['race'] = substr($row['race'], 2); + $row['cult'] = substr($row['cult'], 2); + $row['civ'] = substr($row['civilisation'], 2); + if ($row['guild_id'] != '0') { + //$xml = @simplexml_load_file(ryzom_guild($row['guild_id'], false)); + $xml = false; + if ($xml !== false) { + $row['guild_icon'] = (string)$xml->icon; + $row['guild_name'] = (string)$xml->name; + $result = $xml->xpath("/guild/members/member[cid=$cid]"); + while(list( , $item) = each($result)) + $row['grade'] = (string)$item->grade; + } else { + $row['guild_name'] = 'UNKNOWN_GUILD_'.$row['guild_id']; // Unknow name (normal in yubo shard) + } + } + } + + $uid = intval($cid / 16); + $db = new ServerDatabase(RYAPI_NELDB_HOST, RYAPI_NELDB_LOGIN, RYAPI_NELDB_PASS, RYAPI_NELDB_NEL); + $sql = "SELECT Privilege FROM user WHERE UId = $uid"; + $result = $db->query($sql) or die("Could not query."); + $priv_row = $db->fetch_row($result, MYSQL_NUM); + $priv = $priv_row[0]; + $db->free_result($result); + $groups = array(); + + if (strpos($priv, ':DEV:') !== false) { + $groups[] = 'DEV'; + $groups[] = 'SGM'; + $groups[] = 'GM'; + $groups[] = 'EM'; + $groups[] = 'EG'; + $groups[] = 'VG'; + $groups[] = 'G'; + } + + if (strpos($priv, ':SGM:') !== false) { + $groups[] = 'SGM'; + $groups[] = 'GM'; + $groups[] = 'VG'; + $groups[] = 'G'; + } + + if (strpos($priv, ':GM:') !== false) { + $groups[] = 'GM'; + $groups[] = 'VG'; + $groups[] = 'G'; + } + + if (strpos($priv, ':VG:') !== false) { + $groups[] = 'VG'; + $groups[] = 'G'; + } + + if (strpos($priv, ':G:') !== false) { + $groups[] = 'G'; + } + + if (strpos($priv, ':SEM:') !== false) { + $groups[] = 'SEM'; + $groups[] = 'EM'; + $groups[] = 'EG'; + } + + if (strpos($priv, ':EM:') !== false) { + $groups[] = 'EM'; + $groups[] = 'EG'; + } + + if (strpos($priv, ':EG:') !== false) { + $groups[] = 'EG'; + } + + $groups[] = 'PLAYER'; + $row['groups'] = $groups; + + return $row; +} + +?> diff --git a/code/web/api/server/utils.php b/code/web/api/server/utils.php new file mode 100644 index 000000000..49860d24e --- /dev/null +++ b/code/web/api/server/utils.php @@ -0,0 +1,49 @@ +. + */ + + +function ryzom_name_to_file($name) +{ + $r = ''; + for ($i=0; $i= chr(127)) + $r .= sprintf("%%%02x", ord($name[$i])); + else + $r .= $name[$i]; + } + return $r; +} + +// ------------------------------------- +// get user home directory +// ------------------------------------- +function ryzom_get_user_dir($user) +{ + global $_RYZOM_API_CONFIG; + + if ($user == "") + die("INTERNAL ERROR CODE 1"); + + $user = ryzom_name_to_file($user); + return $_RYZOM_API_CONFIG['cookie_path'].'/'.$_RYZOM_API_CONFIG['shardid'].'/'.substr(strtolower($user), 0, 2).'/'.strtolower($user).'/'; +} + +?> diff --git a/code/web/app/app_test/favicon.png b/code/web/app/app_test/favicon.png new file mode 100644 index 000000000..623a56663 Binary files /dev/null and b/code/web/app/app_test/favicon.png differ diff --git a/code/web/app/app_test/index.php b/code/web/app/app_test/index.php new file mode 100644 index 000000000..ad5408e22 --- /dev/null +++ b/code/web/app/app_test/index.php @@ -0,0 +1,34 @@ +enable = true; + +// Debug log +p($user); + +// Update user acces on Db +$db = ryDB::getInstance(APP_NAME); +$db->setDbDefs('test', array('id' => SQL_DEF_INT, 'num_access' => SQL_DEF_INT)); + +$num_access = $db->querySingleAssoc('test', array('id' => $user['id'])); +if ($num_access) + $db->update('test', array('num_access' => ++$num_access['num_access']), array('id' => $user['id'])); +else + $db->insert('test', array('num_access' => $num_access['num_access']=1, 'id' => $user['id'])); + +// Content +$c = _t('access', $num_access['num_access']).'
'; + +echo ryzom_app_render(APP_NAME, $c, $user['ig']); + +?> diff --git a/code/web/app/app_test/lang.php b/code/web/app/app_test/lang.php new file mode 100644 index 000000000..0a877c548 --- /dev/null +++ b/code/web/app/app_test/lang.php @@ -0,0 +1,15 @@ + + array ( + 'en' => 'User access this page %s times', + 'fr' => 'L\'utilisateur a accede a cette page %s fois', + 'de' => '', + 'ru' => '', + ), +); +if(isset($ryzom_texts)) + $ryzom_texts = array_merge ($__texts, $ryzom_texts); +else + $ryzom_texts = $__texts; +?> \ No newline at end of file diff --git a/code/web/app/config.php.default b/code/web/app/config.php.default new file mode 100644 index 000000000..0ecb2c302 --- /dev/null +++ b/code/web/app/config.php.default @@ -0,0 +1,26 @@ +. + */ + +define('RYAPP_URL', 'http://'); +define('RYAPP_PATH', dirname(__FILE__).'/'); +define('RYAPI_PATH', dirname(__FILE__).'/../api/'); + +include_once(RYAPI_PATH.'ryzom_api.php'); + +?> diff --git a/code/web/app/index.php b/code/web/app/index.php new file mode 100644 index 000000000..86223a42f --- /dev/null +++ b/code/web/app/index.php @@ -0,0 +1,36 @@ +'._t('welcome', $user['char_name']).''; +} else { + if (!$user['ig']) { + if ($user['message']) + $c .= '
'._t($user['message']).'

'; + $c .= ryzom_render_login_form(ryzom_get_param('name')); + } +} + +foreach ($apps as $app) { + $c .= ''._t($app).'
'; +} + +if ($logged && !$user['ig']) + $c .= '
'._t('logout').''; + +// Print GET values on debug view +p($_GET); +echo ryzom_app_render('Ryzom', $c, $user['ig']); + +?> \ No newline at end of file diff --git a/code/web/app/lang.php b/code/web/app/lang.php new file mode 100644 index 000000000..4780fcd00 --- /dev/null +++ b/code/web/app/lang.php @@ -0,0 +1,371 @@ + + array ( + 'en' => 'Welcome %s', + 'fr' => 'Bienvenue %s', + 'de' => 'Willkommen %s', + 'ru' => 'Добро пожаловать %s', + ), + 'latest_news_rp' => + array ( + 'en' => 'Latest RP news', + 'fr' => 'Dernières nouvelles RP', + 'de' => 'Letzte RP-Nachrichten', + 'ru' => 'Ролевые новости', + ), + 'latest_news_off' => + array ( + 'en' => 'Latest Ryzom news', + 'fr' => 'Dernières nouvelles de Ryzom', + 'de' => 'Letzte Ryzom-Nachrichten', + 'ru' => 'Последние новости Ризома', + ), + 'avail_apps' => + array ( + 'en' => 'Available applications', + 'fr' => 'Applications disponibles', + 'de' => 'Verfügbare Anwendungen', + 'ru' => 'Доступные приложения', + ), + 'home' => + array ( + 'en' => 'Home', + 'fr' => 'Accueil', + 'de' => 'Home', + 'ru' => 'К началу', + ), + 'logout' => + array ( + 'en' => 'Log out', + 'fr' => 'se déconnecter', + 'de' => 'Ausloggen', + 'ru' => 'Выйти', + ), + 'by' => + array ( + 'en' => 'by', + 'fr' => 'par', + 'de' => 'von', + 'ru' => 'сообщение', + ), + 'date_format' => + array ( + 'en' => '%1$s %2$s %3$s', + 'fr' => '%3$s %1$s %2$s', + 'de' => '%3$s %1$s %2$s', + 'ru' => '%1$s %2$s %3$s', + ), + 'ago' => + array ( + 'en' => 'ago', + 'fr' => 'il y a', + 'de' => 'Vor', + 'ru' => 'назад', + ), + 'to_go' => + array ( + 'en' => 'to go', + 'fr' => 'dans', + 'de' => 'In', + 'ru' => 'осталось', + ), + 'posted' => + array ( + 'en' => 'Posted', + 'fr' => 'Posté', + 'de' => 'Geschrieben', + 'ru' => 'Отправлено', + ), + 'error_auth' => + array ( + 'en' => 'Please press the Refresh button to display the homepage.', + 'fr' => 'Cliquez sur le bouton Rafraichir pour afficher la page d\'accueil.', + 'de' => 'Um auf die Hauptseite zu gelangen drücke bitte auf Aktualisieren.', + 'ru' => 'Для отображения домашней страницы нажмите кнопку "Обновить"', + ), + 'submit' => + array ( + 'en' => 'Submit', + 'fr' => 'Envoyer', + 'de' => 'Absenden', + 'ru' => 'Отправить', + ), + 'enter_key' => + array ( + 'en' => 'Please enter the full character API Key that you can find on your profile page', + 'fr' => 'Entrez la clé d\'API complète de votre personnage que vous trouverez sur votre page de profil', + 'de' => 'Gib bitte den lompletten Charakter-API-Schlüssel ein, diesen findest du auf deiner Profilseite', + 'ru' => 'Пожалуйста, введите полный API Ключ, который вы можете получить по адресу your profile page', + ), + 'enter_shard' => + array ( + 'en' => 'Select the server of your character', + 'fr' => 'Sélectionnez le serveur où se trouve votre personnage', + 'de' => 'Wähle den Server deines Charakters aus', + 'ru' => 'Выбрать сервер', + ), + 'enter_char' => + array ( + 'en' => 'Enter your CHARACTER name (*not* your account name)', + 'fr' => 'Saisissez le nom de votre PERSONNAGE (pas votre nom de compte)', + 'de' => 'Gib den Namen deines CHARAKTERS ein (*nicht* deinen Account-Namen)', + 'ru' => 'Введите имя ПЕРСОНАЖА (*не* имя пользователя)', + ), + 'enter_password' => + array ( + 'en' => 'Enter the password of your ACCOUNT', + 'fr' => 'Saisissez le mot de passe de votre COMPTE', + 'de' => 'Gib das Passwort deines ACCOUNTS ein', + 'ru' => 'Введите пароль своей УЧЕТНОЙ ЗАПИСИ', + ), + 'bad_login_password' => + array ( + 'en' => 'Cannot login. Perhaps you entered a bad password or you didn\'t use your CHARACTER name.', + 'fr' => 'Connexion impossible. Peut-être avez vous saisi un mauvais mot de passe ou vous n\'avez pas utilisé le nom de votre PERSONNAGE.', + 'de' => 'Login fehlgeschlagen. Vielleicht hast du ein falsches Passwort eingegeben oder du hast nicht deinen CHARAKTER-Namen verwendet.', + 'ru' => 'Невозможно подключиться. Возможно, вы использовали неверный пароль или имя ПЕРСОНАЖА.', + ), + 'app_notes' => + array ( + 'en' => 'Notepad', + 'fr' => 'Bloc Note', + 'de' => 'Notizblock', + 'ru' => 'Блокнот', + ), + 'app_news' => + array ( + 'en' => 'News', + 'fr' => 'Nouvelles', + 'de' => 'News', + 'ru' => 'Новости', + ), + 'app_mail' => + array ( + 'en' => 'Mail', + 'fr' => 'Courrier', + 'de' => 'Mail', + 'ru' => 'Почта', + ), + 'app_patch' => + array ( + 'en' => 'Atysmas', + 'fr' => 'Noel', + 'de' => 'Weihnachten', + 'ru' => 'Christmas', + ), + 'app_wiki' => + array ( + 'en' => 'Atys Wiki', + 'fr' => 'Lore & Chroniques', + 'de' => 'Atys Wiki', + 'ru' => 'Wiki Атиса', + ), + 'app_bots' => + array ( + 'en' => 'Bots', + 'fr' => 'Bots', + 'de' => 'Bots', + 'ru' => 'Боты', + ), + 'app_test' => + array ( + 'en' => 'Test Application', + 'fr' => 'Application de test', + 'de' => '', + 'ru' => '', + ), + 'app_forum' => + array ( + 'en' => 'Forums', + 'fr' => 'Forums', + 'de' => 'Foren', + 'ru' => 'Форумы', + ), + 'app_translate' => + array ( + 'en' => 'Translate', + 'fr' => 'Traduction', + 'de' => 'Übersetzen', + 'ru' => 'Перевод', + ), + 'app_race' => + array ( + 'en' => 'Race', + 'fr' => 'Course', + 'de' => 'Rennen', + 'ru' => 'Гонка', + ), + 'app_poll' => + array ( + 'en' => 'Polls', + 'fr' => 'Sondages', + 'de' => 'Polls', + 'ru' => 'Голосование', + ), + 'app_zapping' => + array ( + 'en' => 'Atysmas', + 'fr' => 'Atysmas', + 'de' => 'Atysmas', + 'ru' => 'Атисмас', + ), + 'latest_blog' => + array ( + 'en' => 'Latest news from the dev blog', + 'fr' => 'Dernières nouvelles du blog des dév', + 'de' => 'Aktuelles aus dem Dev-Blog', + 'ru' => 'Последние новости Дневника разработчиков', + ), + 'app_profile' => + array ( + 'en' => 'Profile', + 'fr' => 'Profil', + 'de' => 'Profile', + 'ru' => 'Личные данные', + ), + 'next_events' => + array ( + 'en' => 'Next events', + 'fr' => 'Prochains événements', + 'de' => 'Nächste Events', + 'ru' => 'Ближайшие события', + ), + 'absolute_date_format' => + array ( + 'en' => '%2$s, %1$s %3$s', + 'fr' => '%2$s %1$s %3$s', + 'de' => '%2$s %1$s %3$s', + 'ru' => '%2$s, %1$s %3$s', + ), + 'app_craft' => + array ( + 'en' => 'Craft: Recipe-Book', + 'fr' => 'Craft : Livre de recettes', + 'de' => 'Craft: Recipe-Book', + 'ru' => 'Ремесло: чертежи', + ), + 'app_ryzhome' => + array ( + 'en' => 'RyzHome', + 'fr' => 'Mon appart', + 'de' => 'Meine Wohnung', + 'ru' => 'Мой Дом', + ), + 'app_event' => + array ( + 'en' => 'Event Pad', + 'fr' => 'Pad Event', + 'de' => 'Event-Pad', + 'ru' => 'События', + ), + 'app_calendar' => + array ( + 'en' => 'Calendar', + 'fr' => 'Calendrier', + 'de' => 'Kalender', + 'ru' => 'Календарь', + ), + 'app_contest' => + array ( + 'en' => 'Contest', + 'fr' => 'Concours', + 'de' => 'Contest', + 'ru' => 'конкурс', + ), + 'app_rpjobs_v2' => + array ( + 'en' => 'Occupations', + 'fr' => 'Métiers', + 'de' => 'Berufe', + 'ru' => 'Занятия', + ), + 'app_rewards' => + array ( + 'en' => 'Rewards', + 'fr' => 'Récompenses', + 'de' => 'Belohnungen', + 'ru' => 'Награды', + ), + 'admin_apps' => + array ( + 'en' => 'Ryzom Team Apps', + 'fr' => 'Applications Pour L\'équipe Ryzom', + 'de' => 'Ryzom Team Apps', + 'ru' => 'Ryzom Team Apps', + ), + 'dev_apps' => + array ( + 'en' => 'Devs Apps (don\'t use!)', + 'fr' => 'Applications Devs (Ne pas utiliser !)', + 'de' => 'Devs Apps (don\'t use!)', + 'ru' => 'Devs Apps (don\'t use!)', + ), + 'app_admin' => + array ( + 'en' => 'Administration', + 'fr' => 'Administration', + 'de' => '{app_admin}', + 'ru' => '{app_admin}', + ), + 'testing_apps' => + array ( + 'en' => 'Testing Apps (don\'t use without permission)', + 'fr' => 'Applications en test (N\'utilisez que si vous y êtes invité)', + 'de' => 'Testing Apps (don\'t use without permission)', + 'ru' => 'Testing Apps (don\'t use without permission)', + ), + 'app_arcc' => + array ( + 'en' => 'A.R.C.C.', + 'fr' => 'A.R.C.C.', + 'de' => 'A.R.C.C.', + 'ru' => 'A.R.C.C.', + ), + 'link_to_forum' => + array ( + 'en' => 'Show details in forum', + 'fr' => 'Voir détails sur le forum', + 'de' => 'Zeige Details im Forum', + 'ru' => '', + ), + 'aura_and_powers_reseted' => + array ( + 'en' => 'Your auras and powers have been reset. They can be reset again in 2 hours.', + 'fr' => 'Vos auras et pouvoirs ont été remis à zéro. Prochaine remise à zéro dans 2h.', + 'de' => 'Deine Auren und Kräfte wurden zurückgesetzt. Sie können erst in 2 Stunden erneut zurückgesetzt werden.', + 'ru' => '', + ), + 'pvp_reseted' => + array ( + 'en' => 'Your PvP timers have been reset. ', + 'fr' => 'Votre tag pvp à été remis à zéro.', + 'de' => 'Deine PvP-Timer wurden zurückgesetzt.', + 'ru' => '', + ), + 'temporary_fixes' => + array ( + 'en' => 'Temporary Fixes', + 'fr' => 'Correctifs temporaires', + 'de' => 'Temporäre Fixes', + 'ru' => '', + ), + 'aura_and_powers_wait' => + array ( + 'en' => 'Please wait %d min for next reset', + 'fr' => 'Merci d\'attendre %d minutes avant une nouvelle remise à zéro', + 'de' => 'Please wait %d min for next reset', + 'ru' => '', + ), + 'app_power_reset' => + array ( + 'en' => 'Reset of Aura and Powers', + 'fr' => 'Reset des Auras et Pouvoirs', + 'de' => 'Auren und Kräfte zurücksetzen', + 'ru' => '', + ), +); +if(isset($ryzom_texts)) + $ryzom_texts = array_merge ($__texts, $ryzom_texts); +else + $ryzom_texts = $__texts;