visual)
vi = &vis[i];
}
if (vi == NULL) return GL_TRUE;
@@ -293,6 +360,54 @@ GLboolean glewCreateContext (const char* display, int* visual)
CWBorderPixel | CWColormap, &swa);
/* make context current */
if (!glXMakeCurrent(dpy, wnd, ctx)) return GL_TRUE;
+ if (params->major || params->profile || params->flags)
+ {
+ GLXContext oldCtx = ctx;
+ GLXFBConfig *FBConfigs;
+ int FBConfigAttrs[] = { GLX_FBCONFIG_ID, 0, None };
+ int contextAttrs[20];
+ int nelems, i;
+
+ glxewInit();
+
+ if (!glxewGetExtension("GLX_ARB_create_context"))
+ return GL_TRUE;
+
+ if (glXQueryContext(dpy, oldCtx, GLX_FBCONFIG_ID, &FBConfigAttrs[1]))
+ return GL_TRUE;
+ FBConfigs = glXChooseFBConfig(dpy, vi->screen, FBConfigAttrs, &nelems);
+
+ if (nelems < 1)
+ return GL_TRUE;
+
+ i = 0;
+ if (params->major)
+ {
+ contextAttrs[i++] = GLX_CONTEXT_MAJOR_VERSION_ARB;
+ contextAttrs[i++] = params->major;
+ contextAttrs[i++] = GLX_CONTEXT_MINOR_VERSION_ARB;
+ contextAttrs[i++] = params->minor;
+ }
+ if (params->profile)
+ {
+ contextAttrs[i++] = GLX_CONTEXT_PROFILE_MASK_ARB;
+ contextAttrs[i++] = params->profile;
+ }
+ if (params->flags)
+ {
+ contextAttrs[i++] = GLX_CONTEXT_FLAGS_ARB;
+ contextAttrs[i++] = params->flags;
+ }
+ contextAttrs[i++] = None;
+ ctx = glXCreateContextAttribsARB(dpy, *FBConfigs, NULL, True, contextAttrs);
+
+ if (NULL == ctx) return GL_TRUE;
+ if (!glXMakeCurrent(dpy, wnd, ctx)) return GL_TRUE;
+
+ glXDestroyContext(dpy, oldCtx);
+
+ XFree(FBConfigs);
+ }
return GL_FALSE;
}
diff --git a/auto/src/glxew_tail.h b/auto/src/glxew_tail.h
index 39e9953..e086253 100644
--- a/auto/src/glxew_tail.h
+++ b/auto/src/glxew_tail.h
@@ -14,11 +14,12 @@ GLEWAPI GLboolean GLEWAPIENTRY glxewContextIsSupported (const GLXEWContext *ctx,
#else /* GLEW_MX */
+GLEWAPI GLenum GLEWAPIENTRY glxewInit ();
+GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name);
+
#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x)
#define GLXEW_GET_FUN(x) x
-GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name);
-
#endif /* GLEW_MX */
GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name);
diff --git a/auto/src/header.html b/auto/src/header.html
index 292c45d..f986557 100644
--- a/auto/src/header.html
+++ b/auto/src/header.html
@@ -31,7 +31,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-->
-
GLEW: The OpenGL Extension Wrangler Library
@@ -47,7 +46,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
-Latest Release: 1.12.0 |
+Latest Release: 1.13.0 |
|
|
|
@@ -73,7 +72,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
-Last Update: 26-01-15 |
+Last Update: 08-10-15 |
diff --git a/auto/src/visualinfo.rc b/auto/src/visualinfo.rc
index 2373944..ed747df 100644
--- a/auto/src/visualinfo.rc
+++ b/auto/src/visualinfo.rc
@@ -36,7 +36,81 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
- VALUE "Comments", "The OpenGL Extension Wrangler Library\r\nCopyright (C) 2002-2008, Milan Ikits \r\nCopyright (C) 2002-2008, Marcelo E. Magallon \r\nCopyright (C) 2002, Lev Povalahev\r\nAll rights reserved.\r\n \r\nRedistribution and use in source and binary forms, with or without \r\nmodification, are permitted provided that the following conditions are met:\r\n\r\n* Redistributions of source code must retain the above copyright notice, \r\n this list of conditions and the following disclaimer.\r\n* Redistributions in binary form must reproduce the above copyright notice, \r\n this list of conditions and the following disclaimer in the documentation \r\n and/or other materials provided with the distribution.\r\n* The name of the author may be used to endorse or promote products \r\n derived from this software without specific prior written permission.\r\n\r\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' \r\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \r\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \r\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \r\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \r\nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\r\nTHE POSSIBILITY OF SUCH DAMAGE.\r\n\r\nLicense Applicability. Except to the extent portions of this file are\r\nmade subject to an alternative license as permitted in the SGI Free\r\nSoftware License B, Version 1.1 (the 'License'), the contents of this\r\nfile are subject only to the provisions of the License. You may not use\r\nthis file except in compliance with the License. You may obtain a copy\r\nof the License at Silicon Graphics, Inc., attn: Legal Services, 1600\r\nAmphitheatre Parkway, Mountain View, CA 94043-1351, or at:\r\n\r\nhttp://oss.sgi.com/projects/FreeB\r\n\r\nNote that, as provided in the License, the Software is distributed on an\r\n'AS IS' basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS\r\nDISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND\r\nCONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A\r\nPARTICULAR PURPOSE, AND NON-INFRINGEMENT.\r\n\r\nOriginal Code. The Original Code is: OpenGL Sample Implementation,\r\nVersion 1.2.1, released January 26, 2000, developed by Silicon Graphics,\r\nInc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.\r\nCopyright in any portions created by third parties is as indicated\r\nelsewhere herein. All Rights Reserved.\r\n\r\nAdditional Notice Provisions: This software was created using the\r\nOpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has\r\nnot been independently verified as being compliant with the OpenGL(R)\r\nversion 1.2.1 Specification.\0"
+ VALUE "Comments",
+ "The OpenGL Extension Wrangler Library\r\n"
+ "Copyright (C) 2002-2008, Milan Ikits \r\n"
+ "Copyright (C) 2002-2008, Marcelo E. Magallon \r\n"
+ "Copyright (C) 2002, Lev Povalahev\r\n"
+ "All rights reserved.\r\n"
+ "\r\n"
+ "Redistribution and use in source and binary forms, with or without \r\n"
+ "modification, are permitted provided that the following conditions are met:\r\n"
+ "\r\n"
+ "* Redistributions of source code must retain the above copyright notice, \r\n"
+ " this list of conditions and the following disclaimer.\r\n"
+ "* Redistributions in binary form must reproduce the above copyright notice, \r\n"
+ " this list of conditions and the following disclaimer in the documentation \r\n"
+ " and/or other materials provided with the distribution.\r\n"
+ "* The name of the author may be used to endorse or promote products \r\n"
+ " derived from this software without specific prior written permission.\r\n"
+ "\r\n"
+ "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' \r\n"
+ "AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \r\n"
+ "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n"
+ "ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \r\n"
+ "LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \r\n"
+ "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \r\n"
+ "SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n"
+ "INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n"
+ "CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n"
+ "ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\r\n"
+ "THE POSSIBILITY OF SUCH DAMAGE.\r\n"
+ "\r\n"
+ "\r\n"
+ "Mesa 3-D graphics library\r\n"
+ "\r\n"
+ "Version: 7.0\r\n"
+ "\r\n"
+ "Copyright (C) 1999-2007 Brian Paul All Rights Reserved.\r\n"
+ "\r\n"
+ "Permission is hereby granted, free of charge, to any person obtaining a\r\n"
+ "copy of this software and associated documentation files (the ''Software''),\r\n"
+ "to deal in the Software without restriction, including without limitation\r\n"
+ "the rights to use, copy, modify, merge, publish, distribute, sublicense,\r\n"
+ "and/or sell copies of the Software, and to permit persons to whom the\r\n"
+ "Software is furnished to do so, subject to the following conditions:\r\n"
+ "\r\n"
+ "The above copyright notice and this permission notice shall be included\r\n"
+ "in all copies or substantial portions of the Software.\r\n"
+ "\r\n"
+ "THE SOFTWARE IS PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS\r\n"
+ "OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n"
+ "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r\n"
+ "BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r\n"
+ "AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r\n"
+ "CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n"
+ "\r\n"
+ "\r\n"
+ "Copyright (c) 2007 The Khronos Group Inc.\r\n"
+ "\r\n"
+ "Permission is hereby granted, free of charge, to any person obtaining a\r\n"
+ "copy of this software and/or associated documentation files (the\r\n"
+ "''Materials''), to deal in the Materials without restriction, including\r\n"
+ "without limitation the rights to use, copy, modify, merge, publish,\r\n"
+ "distribute, sublicense, and/or sell copies of the Materials, and to\r\n"
+ "permit persons to whom the Materials are furnished to do so, subject to\r\n"
+ "the following conditions:\r\n"
+ "\r\n"
+ "The above copyright notice and this permission notice shall be included\r\n"
+ "in all copies or substantial portions of the Materials.\r\n"
+ "\r\n"
+ "THE MATERIALS ARE PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND,\r\n"
+ "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\n"
+ "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r\n"
+ "IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r\n"
+ "CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r\n"
+ "TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r\n"
+ "MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\0"
VALUE "CompanyName", "\0"
VALUE "FileDescription", "Utility for listing pixelformat capabilities\0"
VALUE "FileVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0"
diff --git a/auto/src/wglew_tail.h b/auto/src/wglew_tail.h
index 9bbe945..f48f36c 100644
--- a/auto/src/wglew_tail.h
+++ b/auto/src/wglew_tail.h
@@ -14,11 +14,12 @@ GLEWAPI GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext *ctx,
#else /* GLEW_MX */
+GLEWAPI GLenum GLEWAPIENTRY wglewInit ();
+GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name);
+
#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x)
#define WGLEW_GET_FUN(x) x
-GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name);
-
#endif /* GLEW_MX */
GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name);
diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt
index e08fe62..1563f9f 100644
--- a/build/cmake/CMakeLists.txt
+++ b/build/cmake/CMakeLists.txt
@@ -10,6 +10,8 @@ if (COMMAND cmake_policy)
cmake_policy (SET CMP0003 NEW)
endif()
+set(CMAKE_DEBUG_POSTFIX d)
+
option (BUILD_UTILS "utilities" ON)
set (GLEW_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../..)
@@ -55,7 +57,29 @@ set_target_properties (glewmx_s PROPERTIES COMPILE_DEFINITIONS "GLEW_STATIC;GLEW
target_link_libraries (glewmx ${GLEW_LIBRARIES})
target_link_libraries (glewmx_s ${GLEW_LIBRARIES})
-install ( TARGETS glew glew_s glewmx glewmx_s
+if(CMAKE_VERSION VERSION_LESS 2.8.12)
+ set(MAYBE_EXPORT "")
+else()
+ target_compile_definitions(glew_s INTERFACE "GLEW_STATIC")
+ target_compile_definitions(glewmx INTERFACE "GLEW_MX")
+ target_compile_definitions(glewmx_s INTERFACE "GLEW_STATIC;GLEW_MX")
+ foreach(t glew glew_s glewmx glewmx_s)
+ target_include_directories(${t} PUBLIC $)
+ endforeach()
+ set(MAYBE_EXPORT EXPORT glew-targets)
+endif()
+
+set(targets_to_install "")
+if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
+ list(APPEND targets_to_install glew glewmx)
+endif()
+
+if(NOT DEFINED BUILD_SHARED_LIBS OR NOT BUILD_SHARED_LIBS)
+ list(APPEND targets_to_install glew_s glewmx_s)
+endif()
+
+install ( TARGETS ${targets_to_install}
+ ${MAYBE_EXPORT}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
@@ -89,3 +113,18 @@ configure_file (${GLEW_DIR}/glew.pc.in ${GLEW_DIR}/glewmx.pc @ONLY)
install(FILES ${GLEW_DIR}/glew.pc ${GLEW_DIR}/glewmx.pc
DESTINATION lib/pkgconfig
)
+
+install (FILES
+ ${GLEW_DIR}/include/GL/wglew.h
+ ${GLEW_DIR}/include/GL/glew.h
+ ${GLEW_DIR}/include/GL/glxew.h
+ DESTINATION include/GL)
+
+if(MAYBE_EXPORT)
+ install(EXPORT glew-targets DESTINATION lib/cmake/glew
+ NAMESPACE GLEW::)
+ install(FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/glew-config.cmake
+ ${CMAKE_CURRENT_SOURCE_DIR}/CopyImportedTargetProperties.cmake
+ DESTINATION lib/cmake/glew)
+endif()
diff --git a/build/cmake/CopyImportedTargetProperties.cmake b/build/cmake/CopyImportedTargetProperties.cmake
new file mode 100644
index 0000000..a7ade98
--- /dev/null
+++ b/build/cmake/CopyImportedTargetProperties.cmake
@@ -0,0 +1,88 @@
+#.rst:
+# CopyImportedTargetProperties
+# --------------------------
+#
+# Copies the `INTERFACE*` and `IMPORTED*` properties from a target
+# to another one.
+# This function can be used to duplicate an `IMPORTED` or an `ALIAS` library
+# with a different name since ``add_library(... ALIAS ...)`` does not work
+# for those targets.
+#
+# ::
+#
+# copy_imported_target_properties( )
+#
+# The function copies all the `INTERFACE*` and `IMPORTED*` target
+# properties from `` to ``.
+#
+# The function uses the `IMPORTED_CONFIGURATIONS` property to determine
+# which configuration-dependent properties should be copied
+# (`IMPORTED_LOCATION_`, etc...)
+#
+# Example:
+#
+# Internally the CMake project of ZLIB builds the ``zlib`` and
+# ``zlibstatic`` targets which can be exported in the ``ZLIB::`` namespace
+# with the ``install(EXPORT ...)`` command.
+#
+# The config-module will then create the import libraries ``ZLIB::zlib`` and
+# ``ZLIB::zlibstatic``. To use ``ZLIB::zlibstatic`` under the standard
+# ``ZLIB::ZLIB`` name we need to create the ``ZLIB::ZLIB`` imported library
+# and copy the appropriate properties:
+#
+# add_library(ZLIB::ZLIB STATIC IMPORTED)
+# copy_imported_target_properties(ZLIB::zlibstatic ZLIB::ZLIB)
+#
+
+function(copy_imported_target_properties src_target dest_target)
+
+ set(config_dependent_props
+ IMPORTED_IMPLIB
+ IMPORTED_LINK_DEPENDENT_LIBRARIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES
+ IMPORTED_LINK_INTERFACE_LIBRARIES
+ IMPORTED_LINK_INTERFACE_MULTIPLICITY
+ IMPORTED_LOCATION
+ IMPORTED_NO_SONAME
+ IMPORTED_SONAME
+ )
+
+ # copy configuration-independent properties
+ foreach(prop
+ ${config_dependent_props}
+ IMPORTED_CONFIGURATIONS
+ INTERFACE_AUTOUIC_OPTIONS
+ INTERFACE_COMPILE_DEFINITIONS
+ INTERFACE_COMPILE_FEATURES
+ INTERFACE_COMPILE_OPTIONS
+ INTERFACE_INCLUDE_DIRECTORIES
+ INTERFACE_LINK_LIBRARIES
+ INTERFACE_POSITION_INDEPENDENT_CODE
+ INTERFACE_SOURCES
+ INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
+ )
+ get_property(is_set TARGET ${src_target} PROPERTY ${prop} SET)
+ if(is_set)
+ get_target_property(v ${src_target} ${prop})
+ set_target_properties(${dest_target} PROPERTIES ${prop} "${v}")
+ # message(STATUS "set_target_properties(${dest_target} PROPERTIES ${prop} ${v})")
+ endif()
+ endforeach()
+
+ # copy configuration-dependent properties
+ get_target_property(imported_configs ${src_target}
+ IMPORTED_CONFIGURATIONS)
+
+ foreach(config ${imported_configs})
+ foreach(prop_prefix ${config_dependent_props})
+ set(prop ${prop_prefix}_${config})
+ get_property(is_set TARGET ${src_target} PROPERTY ${prop} SET)
+ if(is_set)
+ get_target_property(v ${src_target} ${prop})
+ set_target_properties(${dest_target}
+ PROPERTIES ${prop} "${v}")
+ # message(STATUS "set_target_properties(${dest_target} PROPERTIES ${prop} ${v})")
+ endif()
+ endforeach()
+ endforeach()
+endfunction()
diff --git a/build/cmake/glew-config.cmake b/build/cmake/glew-config.cmake
new file mode 100644
index 0000000..8d2907a
--- /dev/null
+++ b/build/cmake/glew-config.cmake
@@ -0,0 +1,46 @@
+# This config-module creates the following import libraries:
+#
+# - GLEW::glew and GLEW::glewmx shared libs
+# - GLEW::glew_s and GLEW::glewmx_s static libs
+#
+# Additionally GLEW::GLEW and GLEW::GLEWMX will be created as an
+# copy of either the shared (default) or the static libs.
+#
+# Dependending on the setting of BUILD_SHARED_LIBS at GLEW build time
+# either the static or shared versions may not be available.
+#
+# Set GLEW_USE_STATIC_LIBS to OFF or ON to force using the shared
+# or static libs for GLEW::GLEW and GLEW::GLEWMX
+#
+
+include(${CMAKE_CURRENT_LIST_DIR}/glew-targets.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/CopyImportedTargetProperties.cmake)
+
+# decide which import library (glew/glew_s and glewmx/glewmx_s)
+# needs to be copied to GLEW::GLEW and GLEW::GLEWMX
+set(_glew_target_postfix "")
+set(_glew_target_type SHARED)
+if(DEFINED GLEW_USE_STATIC_LIBS)
+ # if defined, use only static or shared
+ if(GLEW_USE_STATIC_LIBS)
+ set(_glew_target_postfix "_s")
+ endif()
+ # else use static only if no shared
+elseif(NOT TARGET GLEW::glew AND TARGET GLEW::glew_s)
+ set(_glew_target_postfix "_s")
+endif()
+if(_glew_target_postfix STREQUAL "")
+ set(_glew_target_type SHARED)
+else()
+ set(_glew_target_type STATIC)
+endif()
+
+# CMake doesn't allow creating ALIAS lib for an IMPORTED lib
+# so create imported ones and copy the properties
+foreach(_glew_target glew glewmx)
+ set(_glew_src_target "GLEW::${_glew_target}${_glew_target_postfix}")
+ string(TOUPPER "GLEW::${_glew_target}" _glew_dest_target)
+ add_library(${_glew_dest_target} ${_glew_target_type} IMPORTED)
+ # message(STATUS "add_library(${_glew_dest_target} ${_glew_target_type} IMPORTED)")
+ copy_imported_target_properties(${_glew_src_target} ${_glew_dest_target})
+endforeach()
diff --git a/build/cmake/testbuild/CMakeLists.txt b/build/cmake/testbuild/CMakeLists.txt
new file mode 100644
index 0000000..275e24d
--- /dev/null
+++ b/build/cmake/testbuild/CMakeLists.txt
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 2.8.12)
+project(glew-cmake-test)
+
+find_package(GLEW REQUIRED CONFIG)
+find_package(OpenGL REQUIRED)
+
+add_executable(cmake-test main.c)
+set_target_properties(cmake-test PROPERTIES DEBUG_POSTFIX _d)
+target_link_libraries(cmake-test PRIVATE GLEW::GLEW ${OPENGL_LIBRARIES})
+target_include_directories(cmake-test PRIVATE ${OPENGL_INCLUDE_DIR})
+
+if(CMAKE_VERSION VERSION_LESS 3.0)
+ set(cgex $)
+else()
+ set(cgex $)
+endif()
+
+target_compile_definitions(cmake-test PRIVATE
+ -DGLEW_CMAKE_TEST_CONFIG=${cgex}
+ -DGLEW_CMAKE_TEST_TARGET_FILE_NAME=$
+ -DGLEW_CMAKE_TEST_TARGET_TYPE=$
+ )
+
+install(TARGETS cmake-test DESTINATION bin)
diff --git a/build/cmake/testbuild/main.c b/build/cmake/testbuild/main.c
new file mode 100644
index 0000000..5975817
--- /dev/null
+++ b/build/cmake/testbuild/main.c
@@ -0,0 +1,23 @@
+#include
+
+#include
+#include
+
+#define S(x) SS(x)
+#define SS(x) #x
+
+int main(int argc, char* argv[]) {
+ printf("GLEW CMake test, %s build\n",
+ S(GLEW_CMAKE_TEST_CONFIG));
+ printf("-- linked to %s which is %s\n",
+ S(GLEW_CMAKE_TEST_TARGET_FILE_NAME),
+ S(GLEW_CMAKE_TEST_TARGET_TYPE));
+ const GLubyte* v = glewGetString(GLEW_VERSION);
+ if(v) {
+ printf("-- glewGetString(GLEW_VERSION) returns %s\n-- test passed.\n", v);
+ return EXIT_SUCCESS;
+ } else {
+ printf("-- glewGetString(GLEW_VERSION) returns NULL\n-- test failed.\n");
+ return EXIT_FAILURE;
+ }
+}
diff --git a/build/vc12/glewinfo.vcxproj b/build/vc12/glewinfo.vcxproj
index 26e57c3..4a82364 100644
--- a/build/vc12/glewinfo.vcxproj
+++ b/build/vc12/glewinfo.vcxproj
@@ -440,6 +440,9 @@
{664e6f0d-6784-4760-9565-d54f8eb1edf4}
+
+
+
diff --git a/build/vc12/visualinfo.vcxproj b/build/vc12/visualinfo.vcxproj
index 692b778..e6e2a8b 100644
--- a/build/vc12/visualinfo.vcxproj
+++ b/build/vc12/visualinfo.vcxproj
@@ -439,6 +439,9 @@
{664e6f0d-6784-4760-9565-d54f8eb1edf4}
+
+
+
diff --git a/cmake-testbuild.sh b/cmake-testbuild.sh
new file mode 100755
index 0000000..0dbbfd2
--- /dev/null
+++ b/cmake-testbuild.sh
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+# This script tests the CMake build:
+#
+# - builds the main CMakeLists.txt
+# - builds and runs a small test app in a separate build tree so
+# the config-module is tested, too
+#
+# Options (environment variables):
+#
+# - The variable BUILD_SHARED_LIBS will be forwarded to the CMake project
+# that builds and installs the GLEW libraries. Set BUILD_SHARED_LIBS to
+# ON or OFF to install only static or shared libs. Leave it unset to
+# install both.
+#
+# Note: BUILD_SHARED_LIBS controls only what to install not what to build.
+#
+# - GLEW_USE_STATIC_LIBS will be forwarded to the test project that calls
+# `find_package` to find GLEW. Set GLEW_USE_STATIC LIBS to ON or OFF force
+# finding the shared or static versions of GLEW. Leave it unset to find
+# the shared or what is available.
+#
+# Examples:
+#
+# Build & install shared + static, find default (shared)
+#
+# ./cmake-testbuild.shh
+#
+# Build & install shared + static, find static
+#
+# GLEW_USE_STATIC_LIBS=ON ./cmake-testbuild.sh
+#
+# Install static only (still build both)
+#
+# BUILD_SHARED_LIBS=OFF ./cmake-testbuild.sh
+#
+
+set -ex
+
+rm -rf out/include
+rm -rf out/lib*
+rm -rf out/bin
+
+if [ -n "$BUILD_SHARED_LIBS" ]; then
+ bsl=-DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS
+else
+ bsl=-UBUILD_SHARED_LIBS
+fi
+
+if [ -n "$GLEW_USE_STATIC_LIBS" ]; then
+ gusl=-DGLEW_USE_STATIC_LIBS=$GLEW_USE_STATIC_LIBS
+else
+ gusl=-UGLEW_USE_STATIC_LIBS
+fi
+
+cmake -Hbuild/cmake -Bout/build/glew -DCMAKE_INSTALL_PREFIX=${PWD}/out -DCMAKE_BUILD_TYPE=Debug $bsl
+cmake --build out/build/glew --target install --config Debug
+cmake out/build/glew -DCMAKE_BUILD_TYPE=Release
+cmake --build out/build/glew --target install --config Release --clean-first
+
+cmake -Hbuild/cmake/testbuild -Bout/build/cmake-testbuild -DCMAKE_INSTALL_PREFIX=${PWD}/out -DCMAKE_PREFIX_PATH=${PWD}/out -DCMAKE_BUILD_TYPE=Debug $gusl
+cmake --build out/build/cmake-testbuild --target install --config Debug
+
+cmake out/build/cmake-testbuild -DCMAKE_BUILD_TYPE=Release
+cmake --build out/build/cmake-testbuild --target install --config Release --clean-first
+
+export LD_LIBRARY_PATH=${PWD}/out/lib:$LD_LIBRARY_PATH
+export DYLD_LIBRARY_PATH=${PWD}/out/lib:$DYLD_LIBRARY_PATH
+
+out/bin/cmake-test_d
+out/bin/cmake-test
diff --git a/config/Makefile.darwin b/config/Makefile.darwin
index bf34a0e..8dd6262 100644
--- a/config/Makefile.darwin
+++ b/config/Makefile.darwin
@@ -2,13 +2,14 @@ NAME = $(GLEW_NAME)
CC = cc
LD = cc
CFLAGS.EXTRA = -dynamic -fno-common
+CFLAGS.EXTRA += -ansi -pedantic
#CFLAGS.EXTRA += -no-cpp-precomp
LDFLAGS.EXTRA =
ifneq (undefined, $(origin GLEW_APPLE_GLX))
CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
else
-LDFLAGS.GL = -framework AGL -framework OpenGL
+LDFLAGS.GL = -framework OpenGL
endif
LDFLAGS.STATIC =
LDFLAGS.DYNAMIC =
diff --git a/config/Makefile.darwin-ppc b/config/Makefile.darwin-ppc
index 46c8b73..60ae3fd 100644
--- a/config/Makefile.darwin-ppc
+++ b/config/Makefile.darwin-ppc
@@ -8,7 +8,7 @@ ifneq (undefined, $(origin GLEW_APPLE_GLX))
CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
else
-LDFLAGS.GL = -framework AGL -framework OpenGL
+LDFLAGS.GL = -framework OpenGL
endif
LDFLAGS.STATIC =
LDFLAGS.DYNAMIC =
diff --git a/config/Makefile.darwin-universal b/config/Makefile.darwin-universal
index 5f3f278..2b3156b 100644
--- a/config/Makefile.darwin-universal
+++ b/config/Makefile.darwin-universal
@@ -12,7 +12,7 @@ ifneq (undefined, $(origin GLEW_APPLE_GLX))
CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
else
-LDFLAGS.GL = -framework AGL -framework OpenGL
+LDFLAGS.GL = -framework OpenGL
endif
LDFLAGS.DYNAMIC =
WARN = -Wall -W
diff --git a/config/Makefile.darwin-x86_64 b/config/Makefile.darwin-x86_64
index e6eb050..5e8156b 100644
--- a/config/Makefile.darwin-x86_64
+++ b/config/Makefile.darwin-x86_64
@@ -8,7 +8,7 @@ ifneq (undefined, $(origin GLEW_APPLE_GLX))
CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
else
-LDFLAGS.GL = -framework AGL -framework OpenGL
+LDFLAGS.GL = -framework OpenGL
endif
LDFLAGS.STATIC =
LDFLAGS.DYNAMIC =
diff --git a/config/Makefile.linux b/config/Makefile.linux
index 55e4a23..6b9da03 100644
--- a/config/Makefile.linux
+++ b/config/Makefile.linux
@@ -24,6 +24,7 @@ WARN = -Wall -W
POPT = -O2
CFLAGS.EXTRA += -fPIC
CFLAGS.EXTRA += -Wcast-qual
+CFLAGS.EXTRA += -ansi -pedantic
BIN.SUFFIX =
LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
LIB.DEVLNK = lib$(NAME).so
diff --git a/config/Makefile.linux-clang b/config/Makefile.linux-clang
new file mode 100644
index 0000000..dd14f4f
--- /dev/null
+++ b/config/Makefile.linux-clang
@@ -0,0 +1,38 @@
+NAME = $(GLEW_NAME)
+CC = clang
+LD = clang
+M_ARCH ?= $(shell uname -m)
+ARCH64 = false
+ifeq (x86_64,${M_ARCH})
+ ARCH64 = true
+endif
+ifeq (ppc64,${M_ARCH})
+ ARCH64 = true
+endif
+ifeq (${ARCH64},true)
+ LDFLAGS.EXTRA = -L/usr/X11R6/lib64 -L/usr/lib64
+ LIBDIR = $(GLEW_DEST)/lib64
+else
+ LDFLAGS.EXTRA = -L/usr/X11R6/lib -L/usr/lib
+ LIBDIR = $(GLEW_DEST)/lib
+endif
+LDFLAGS.GL = -lGL -lX11
+LDFLAGS.STATIC = -Wl,-Bstatic
+LDFLAGS.DYNAMIC = -Wl,-Bdynamic
+NAME = GLEW
+WARN = -Wall -W
+POPT = -O2
+CFLAGS.EXTRA += -fPIC
+CFLAGS.EXTRA += -Wcast-qual
+CFLAGS.EXTRA += -ansi -pedantic
+BIN.SUFFIX =
+LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
+LIB.DEVLNK = lib$(NAME).so
+LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
+LIB.STATIC = lib$(NAME).a
+LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME)
+LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR)
+LIB.DEVLNK.MX = lib$(NAME)mx.so
+LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION)
+LIB.STATIC.MX = lib$(NAME)mx.a
+LDFLAGS.SO.MX = -shared -Wl,-soname=$(LIB.SONAME.MX)
diff --git a/config/version b/config/version
index b6a9753..b8e1df7 100644
--- a/config/version
+++ b/config/version
@@ -1,5 +1,5 @@
GLEW_MAJOR = 1
-GLEW_MINOR = 12
+GLEW_MINOR = 13
GLEW_MICRO = 0
GLEW_VERSION = $(GLEW_MAJOR).$(GLEW_MINOR).$(GLEW_MICRO)
GLEW_NAME = GLEW
diff --git a/doc/advanced.html b/doc/advanced.html
index f224727..8165a72 100644
--- a/doc/advanced.html
+++ b/doc/advanced.html
@@ -31,7 +31,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-->
-
GLEW: The OpenGL Extension Wrangler Library
@@ -47,7 +46,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
-Latest Release: 1.12.0 |
+Latest Release: 1.13.0 |
|
|
|
@@ -73,7 +72,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
-Last Update: 26-01-15 |
+Last Update: 08-10-15 |
diff --git a/doc/basic.html b/doc/basic.html
index e885b7d..038a155 100644
--- a/doc/basic.html
+++ b/doc/basic.html
@@ -31,7 +31,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-->
-
GLEW: The OpenGL Extension Wrangler Library
@@ -47,7 +46,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
|
-Latest Release: 1.12.0 |
+Latest Release: 1.13.0 |
|
|
|
@@ -73,7 +72,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
-Last Update: 26-01-15 |
+Last Update: 08-10-15 |
diff --git a/doc/build.html b/doc/build.html
index 832d390..ba0d681 100644
--- a/doc/build.html
+++ b/doc/build.html
@@ -31,7 +31,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-->
-
GLEW: The OpenGL Extension Wrangler Library
@@ -47,7 +46,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
|
-Latest Release: 1.12.0 |
+Latest Release: 1.13.0 |
|
|
|
@@ -73,7 +72,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
-Last Update: 26-01-15 |
+Last Update: 08-10-15 |
diff --git a/doc/credits.html b/doc/credits.html
index 05e1534..259ace5 100644
--- a/doc/credits.html
+++ b/doc/credits.html
@@ -31,7 +31,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-->
-
GLEW: The OpenGL Extension Wrangler Library
@@ -47,7 +46,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
|
-Latest Release: 1.12.0 |
+Latest Release: 1.13.0 |
|
|
|
@@ -73,7 +72,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
-Last Update: 26-01-15 |
+Last Update: 08-10-15 |
diff --git a/doc/glew.html b/doc/glew.html
index cc74afd..1b26e5f 100644
--- a/doc/glew.html
+++ b/doc/glew.html
@@ -31,7 +31,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-->
-
GLEW: The OpenGL Extension Wrangler Library
@@ -47,7 +46,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
|
-Latest Release: 1.12.0 |
+Latest Release: 1.13.0 |
|
|
|
@@ -73,7 +72,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
|
diff --git a/doc/glxew.html b/doc/glxew.html
index 1ab8aee..576ddd3 100644
--- a/doc/glxew.html
+++ b/doc/glxew.html
@@ -31,7 +31,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-->
-
GLEW: The OpenGL Extension Wrangler Library
@@ -47,7 +46,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
|
-Latest Release: 1.12.0 |
+Latest Release: 1.13.0 |
|
|
|
@@ -73,7 +72,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
-Last Update: 26-01-15 |
+Last Update: 08-10-15 |
diff --git a/doc/index.html b/doc/index.html
index 80992bd..b9b3605 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -31,7 +31,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-->
-
GLEW: The OpenGL Extension Wrangler Library
@@ -47,7 +46,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
|
-Latest Release: 1.12.0 |
+Latest Release: 1.13.0 |
|
|
|
@@ -73,7 +72,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
-Last Update: 26-01-15 |
+Last Update: 08-10-15 |
@@ -108,7 +107,7 @@ Mac OS X, FreeBSD, Irix, and Solaris.
GLEW is distributed
as source and precompiled binaries.
The latest release is
-1.12.0[26-01-15]:
+1.13.0[08-10-15]:
@@ -122,8 +121,8 @@ The latest release is
| Source |
|
-ZIP |
-TGZ |
+ZIP |
+TGZ
|
@@ -131,7 +130,7 @@ The latest release is
Binaries |
|
-Windows 32-bit and 64-bit
+Windows 32-bit and 64-bit
|
|
@@ -155,8 +154,8 @@ An up-to-date copy is also available using git
Unsupported snapshots are also available:
Supported Extensions
@@ -171,6 +170,7 @@ The latest release contains support for OpenGL 4.5 and the following extensions:
News
+- [08-10-15] GLEW 1.13.0 adds support for new extensions, fixes minor bugs
- [26-01-15] GLEW 1.12.0 fixes minor bugs and adds new extensions
- [08-11-14] GLEW 1.11.0 adds support for OpenGL 4.5, new extensions
- [07-22-13] GLEW 1.10.0 adds support for OpenGL 4.4, new extensions
diff --git a/doc/install.html b/doc/install.html
index 9e575e4..4d00db8 100644
--- a/doc/install.html
+++ b/doc/install.html
@@ -31,7 +31,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-->
-
GLEW: The OpenGL Extension Wrangler Library
@@ -47,7 +46,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
-Latest Release: 1.12.0 |
+Latest Release: 1.13.0 |
|
|
|
@@ -73,7 +72,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
-Last Update: 26-01-15 |
+Last Update: 08-10-15 |
diff --git a/doc/log.html b/doc/log.html
index e7e9dde..efa0a9f 100644
--- a/doc/log.html
+++ b/doc/log.html
@@ -31,7 +31,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-->
-
GLEW: The OpenGL Extension Wrangler Library
@@ -47,7 +46,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
|
-Latest Release: 1.12.0 |
+Latest Release: 1.13.0 |
|
|
|
@@ -73,7 +72,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
-Last Update: 26-01-15 |
+Last Update: 08-10-15 |
@@ -97,7 +96,42 @@ THE POSSIBILITY OF SUCH DAMAGE.
-- 1.12.0 [26-01-15]
+
- 1.13.0 [08-10-15]
+
+- Enhancements:
+
+- glxewInit, wglewInit
+
- glewinfo adds support for -version, -profile core|compatibility and -flag debug|forward parameters
+
- Improved cmake build support
+
+- New extensions:
+
+- GL_ARB_ES3_2_compatibility
+
- GL_ARB_fragment_shader_interlock
+
- GL_ARB_gpu_shader_int64
+
- GL_ARB_parallel_shader_compile
+
- GL_ARB_post_depth_coverage
+
- GL_ARB_sample_locations
+
- GL_ARB_shader_atomic_counter_ops
+
- GL_ARB_shader_ballot
+
- GL_ARB_shader_clock
+
- GL_ARB_shader_viewport_layer_array
+
- GL_ARB_sparse_texture2
+
- GL_ARB_sparse_texture_clamp
+
- GL_ARB_texture_filter_minmax
+
- GL_INTEL_framebuffer_CMAA
+
- GL_KHR_no_error
+
- GL_NV_conservative_raster_dilate
+
- GL_OVR_multiview
+
- GL_OVR_multiview2
+
+ - Bug fixes
+
+
+
+
+
+- 1.12.0 [01-26-15]
- New extensions:
diff --git a/doc/wglew.html b/doc/wglew.html
index 9f6fc4d..903cb36 100644
--- a/doc/wglew.html
+++ b/doc/wglew.html
@@ -31,7 +31,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-->
-
GLEW: The OpenGL Extension Wrangler Library
@@ -47,7 +46,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
-Latest Release: 1.12.0 |
+Latest Release: 1.13.0 |
|
|
|
@@ -73,7 +72,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
-Last Update: 26-01-15 |
+Last Update: 08-10-15 |
diff --git a/src/visualinfo.c b/src/visualinfo.c
index 23a8499..fd27c7b 100644
--- a/src/visualinfo.c
+++ b/src/visualinfo.c
@@ -37,7 +37,8 @@
#if defined(_WIN32)
#include
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
-#include
+#include
+#include
#elif !defined(__HAIKU__)
#include
#endif
@@ -61,7 +62,7 @@ typedef struct GLContextStruct
HDC dc;
HGLRC rc;
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
- AGLContext ctx, octx;
+ CGLContextObj ctx, octx;
#elif !defined(__HAIKU__)
Display* dpy;
XVisualInfo* vi;
@@ -1072,30 +1073,28 @@ void InitContext (GLContext* ctx)
GLboolean CreateContext (GLContext* ctx)
{
- int attrib[] = { AGL_RGBA, AGL_NONE };
- AGLPixelFormat pf;
+ CGLPixelFormatAttribute attrib[] = { kCGLPFAAccelerated, 0 };
+ CGLPixelFormatObj pf;
+ GLint npix;
+ CGLError error;
/* check input */
if (NULL == ctx) return GL_TRUE;
- /*int major, minor;
- SetPortWindowPort(wnd);
- aglGetVersion(&major, &minor);
- fprintf(stderr, "GL %d.%d\n", major, minor);*/
- pf = aglChoosePixelFormat(NULL, 0, attrib);
- if (NULL == pf) return GL_TRUE;
- ctx->ctx = aglCreateContext(pf, NULL);
- if (NULL == ctx->ctx || AGL_NO_ERROR != aglGetError()) return GL_TRUE;
- aglDestroyPixelFormat(pf);
- /*aglSetDrawable(ctx, GetWindowPort(wnd));*/
- ctx->octx = aglGetCurrentContext();
- if (GL_FALSE == aglSetCurrentContext(ctx->ctx)) return GL_TRUE;
+ error = CGLChoosePixelFormat(attrib, &pf, &npix);
+ if (error) return GL_TRUE;
+ error = CGLCreateContext(pf, NULL, &ctx->ctx);
+ if (error) return GL_TRUE;
+ CGLReleasePixelFormat(pf);
+ ctx->octx = CGLGetCurrentContext();
+ error = CGLSetCurrentContext(ctx->ctx);
+ if (error) return GL_TRUE;
return GL_FALSE;
}
void DestroyContext (GLContext* ctx)
{
if (NULL == ctx) return;
- aglSetCurrentContext(ctx->octx);
- if (NULL != ctx->ctx) aglDestroyContext(ctx->ctx);
+ CGLSetCurrentContext(ctx->octx);
+ if (NULL != ctx->ctx) CGLReleaseContext(ctx->ctx);
}
/* ------------------------------------------------------------------------ */
| | | | | | | | | | | | | | | | | | | | | | |