Compare commits

..

No commits in common. "master" and "glew-2.1.0" have entirely different histories.

155 changed files with 2629 additions and 92983 deletions

View File

@ -1,217 +0,0 @@
name: CMake
on:
pull_request:
branches:
- master
types:
- opened
- synchronize
- reopened
push:
branches:
- master
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
container: ubuntu:latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: apt update && DEBIAN_FRONTEND=noninteractive apt install -y cmake gcc g++ libglu1-mesa-dev pkg-config libx11-dev libxext-dev
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: |
mkdir build_test
mkdir from_installed
mkdir pkg-config
mkdir as_subdirectory
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: build_test
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build test
working-directory: build_test
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
- name: Install test
shell: bash
working-directory: from_installed
run: |
mkdir -p ext_project/build
cp $GITHUB_WORKSPACE/src/glewinfo.c ext_project/
cmake $GITHUB_WORKSPACE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/glew-root-cmake
cmake --build . --target install
cd ext_project
cp $GITHUB_WORKSPACE/glew-cmake/cmake-install-test.cmake CMakeLists.txt
cmake -DCMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/glew-root-cmake/ .
cmake --build .
- name: Package config test
shell: bash
working-directory: pkg-config
run: |
mkdir -p ext_project
cp $GITHUB_WORKSPACE/src/glewinfo.c ext_project/
cmake $GITHUB_WORKSPACE -DPKG_CONFIG_REPRESENTATIVE_TARGET=libglew_static -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/glew-root-pkg-config
cmake --build . --target install
cd ext_project
gcc $GITHUB_WORKSPACE/src/glewinfo.c $(PKG_CONFIG_PATH=$GITHUB_WORKSPACE/glew-root-pkg-config/lib/pkgconfig pkg-config --libs --cflags glew) -o glewinfo
- name: Subdirectory test
shell: bash
working-directory: as_subdirectory
run: |
cp $GITHUB_WORKSPACE/src/glewinfo.c ./
cp $GITHUB_WORKSPACE/glew-cmake/sub-directory-test.cmake CMakeLists.txt
cmake .
cmake --build .
build_2_8:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
container: ubuntu:14.04
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: apt update && apt install -y cmake gcc libgl1-mesa-dev libx11-dev libxext-dev
- name: Configure CMake
shell: bash
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build test
shell: bash
run: cmake --build .
- name: Check alias
shell: bash
run: test -e lib/libGLEW.a
build_3_10:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
container: ubuntu:18.04
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: apt update && apt install -y cmake gcc libgl1-mesa-dev libx11-dev libxext-dev
- name: Configure CMake
shell: bash
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build test
shell: bash
run: cmake --build .
- name: Check alias
shell: bash
run: test -e lib/libGLEW.a
build_latest:
runs-on: ubuntu-latest
container: ubuntu:latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: apt update && apt install -y python3 python3-pip gcc libgl1-mesa-dev libx11-dev libxext-dev && pip install cmake
- name: Configure CMake
shell: bash
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build test
shell: bash
run: cmake --build .
- name: Check alias
shell: bash
run: test -e lib/libGLEW.a
build_mingw:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
container: ubuntu:18.04
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: apt update && apt install -y cmake g++-mingw-w64-x86-64 make libgl1-mesa-dev libx11-dev libxext-dev
- name: Configure CMake
shell: bash
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE="$GITHUB_WORKSPACE/glew-cmake/mingw.cmake"
- name: Build test
shell: bash
run: cmake --build .
build_mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Configure CMake
shell: bash
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build test
shell: bash
run: cmake --build .
build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Configure CMake
shell: bash
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build test
shell: bash
run: cmake --build .

5
.gitignore vendored
View File

@ -5,9 +5,7 @@
/build/*.rc
/build/*/*.sdf
/build/*/*.suo
/build/*/*.db
/build/*/*.vcxproj.user
/build/*/.vs/
/build/*/tmp/
/build/cmake/CMakeFiles/
/build/cmake/CMakeCache.txt
@ -20,6 +18,3 @@
/tmp
/out
.DS_Store*
auto/EGL-Registry
auto/OpenGL-Registry
auto/glfixes

View File

@ -1,12 +0,0 @@
extraction:
cpp:
prepare:
packages:
- "build-essential"
- "libxmu-dev"
- "libxi-dev"
- "libgl-dev"
index:
build_command:
- "cd auto; make all -j8; cd .."
- "make all -j8"

View File

@ -1,18 +1,18 @@
language: cpp
dist: trusty
sudo: false
install:
script:
- make -C auto clobber
- make extensions
- make dist-src
- make clean && SYSTEM=linux make
- make clean && SYSTEM=linux-osmesa make
- make clean && SYSTEM=linux-egl make
- make clean && SYSTEM=linux-clang make
- make clean && SYSTEM=linux-clang-egl make
- pushd build/cmake && git clean -xdf . && cmake -G 'Unix Makefiles' . && make && popd
- pushd build/cmake && git clean -xdf . && cmake -G 'Unix Makefiles' -DGLEW_OSMESA=ON . && make && popd
- pushd build/cmake && git clean -xdf . && cmake -G 'Unix Makefiles' -DGLEW_EGL=ON -DGLEW_X11=OFF . && make && popd
- make clean; SYSTEM=linux make
- make clean; SYSTEM=linux-osmesa make
- make clean; SYSTEM=linux-egl make
- make clean; SYSTEM=linux-clang make
- make clean; SYSTEM=linux-clang-egl make
- pushd build/cmake; git clean -xdf .; cmake -G 'Unix Makefiles' . ; make; popd
- pushd build/cmake; git clean -xdf .; cmake -G 'Unix Makefiles' -DGLEW_OSMESA=1 . ; make; popd
- pushd build/cmake; git clean -xdf .; cmake -G 'Unix Makefiles' -DGLEW_EGL=1 . ; make; popd
addons:
apt:
packages:
@ -22,6 +22,8 @@ addons:
- libosmesa6-dev
- libegl1-mesa-dev
artifacts:
bucket: glew
s3_region: "us-east-1"
paths:
- $(ls *.zip *.tgz | tr "\n" ":")
- $(find doc -type f | tr "\n" ":")

53
.travis.yml.conan Normal file
View File

@ -0,0 +1,53 @@
env:
global:
- CONAN_USERNAME="nigels-com"
- CONAN_REFERENCE="glew/master"
- CONAN_CHANNEL="testing"
linux: &linux
os: linux
sudo: required
language: python
python: "2.7"
services:
- docker
osx: &osx
os: osx
language: generic
matrix:
include:
- <<: *linux
env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=lasote/conangcc49
- <<: *linux
env: CONAN_GCC_VERSIONS=5.4 CONAN_DOCKER_IMAGE=lasote/conangcc54
- <<: *linux
env: CONAN_GCC_VERSIONS=6.3 CONAN_DOCKER_IMAGE=lasote/conangcc63
- <<: *linux
env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=lasote/conanclang39
- <<: *linux
env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=lasote/conanclang40
- <<: *osx
osx_image: xcode7.3
env: CONAN_APPLE_CLANG_VERSIONS=7.3
- <<: *osx
osx_image: xcode8.2
env: CONAN_APPLE_CLANG_VERSIONS=8.0
- <<: *osx
osx_image: xcode8.3
env: CONAN_APPLE_CLANG_VERSIONS=8.1
install:
- chmod +x ./build/conan/.travis/install.sh
- ./build/conan/.travis/install.sh
script:
# Building master
- cp -rf ./build/conan/* .
- cp -rf ./build/conan/.travis .
- chmod +x .travis/run.sh
- .travis/run.sh
# Building released version
#- chmod +x ./build/conan/.travis/run.sh
#- cd ./build/conan && .travis/run.sh

View File

@ -1,287 +0,0 @@
cmake_minimum_required(VERSION 2.8.12...3.5)
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/config/version _VERSION_MAJOR_STRING REGEX "GLEW_MAJOR[ ]*=[ ]*[0-9]+.*")
string(REGEX REPLACE "GLEW_MAJOR[ ]*=[ ]*([0-9]+)" "\\1" MAJOR_VERSION ${_VERSION_MAJOR_STRING})
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/config/version _VERSION_MINOR_STRING REGEX "GLEW_MINOR[ ]*=[ ]*[0-9]+.*")
string(REGEX REPLACE "GLEW_MINOR[ ]*=[ ]*([0-9]+)" "\\1" MINOR_VERSION ${_VERSION_MINOR_STRING})
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/config/version _VERSION_PATCH_STRING REGEX "GLEW_MICRO[ ]*=[ ]*[0-9]+.*")
string(REGEX REPLACE "GLEW_MICRO[ ]*=[ ]*([0-9]+)" "\\1" PATCH_VERSION ${_VERSION_PATCH_STRING})
set(GLEW_VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION})
if(NOT CMAKE_VERSION VERSION_LESS 3.0)
cmake_policy(SET CMP0048 NEW)
project("glew" VERSION ${GLEW_VERSION} LANGUAGES C)
else()
project("glew" C)
set(CPACK_PACKAGE_VERSION_MAJOR ${MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH ${MAJOR_VERSION})
endif()
set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(INCLUDE_DIR "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>$<INSTALL_INTERFACE:include>")
set(RC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
include("GeneratePkgConfig.cmake")
if (POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif()
option(glew-cmake_BUILD_SHARED "Build the shared glew library" ON)
option(glew-cmake_BUILD_STATIC "Build the static glew library" ON)
option(USE_GLU "Use GLU" OFF)
option(GLEW_OSMESA "Off-screen Mesa mode" OFF)
option(PKG_CONFIG_REPRESENTATIVE_TARGET "Generate pc file for specified target as glew. libglew_static|libglew_shared" OFF)
option(ONLY_LIBS "Do not build executables" OFF)
set(LIBGLEW_SRCS ${SRC_DIR}/glew.c)
set(DEFINITIONS)
if(WIN32)
list(APPEND DEFINITIONS -DWIN32_MEAN_AND_LEAN -DVC_EXTRALEAN -D_CRT_SECURE_NO_WARNINGS)
endif()
if(MSVC)
list(APPEND LIBGLEW_SRCS ${RC_DIR}/glew.rc)
endif()
# Use namespaced libraries when supported
if(NOT CMAKE_VERSION VERSION_LESS 3.14)
set(USE_NAMESPACED_LIB YES)
else()
set(USE_NAMESPACED_LIB NO)
endif()
if(POLICY CMP0028)
cmake_policy(SET CMP0028 NEW)
endif()
if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif()
if(POLICY CMP0072)
set(OpenGL_GL_PREFERENCE GLVND)
endif()
if(NOT (WIN32 OR APPLE))
message("Try to find OpenGL with GLVND")
find_package(OpenGL REQUIRED
COMPONENTS OpenGL GLX)
endif()
if(OPENGL_FOUND AND OpenGL_GLX_FOUND AND TARGET OpenGL::OpenGL)
set(USE_GLVND YES)
else()
message("GLVND not supported. Try find OpenGL legacy")
find_package(OpenGL REQUIRED)
set(USE_GLVND NO)
endif()
set(pc_requires)
if(NOT USE_GLU)
list(APPEND DEFINITIONS -DGLEW_NO_GLU)
else()
if(NOT OPENGL_GLU_FOUND)
message(FATAL_ERROR "GLU is not found. but GLU option is enabled")
endif()
list(APPEND pc_requires glu)
if(USE_NAMESPACED_LIB)
list(APPEND LIBRARIES OpenGL::GLU)
else()
list(APPEND LIBRARIES ${OPENGL_glu_LIBRARY})
endif()
endif()
list(APPEND pc_requires gl)
if(USE_NAMESPACED_LIB)
if(USE_GLVND)
list(APPEND LIBRARIES OpenGL::OpenGL)
else()
list(APPEND LIBRARIES OpenGL::GL)
endif()
else()
if(USE_GLVND)
list(APPEND LIBRARIES ${OPENGL_opengl_LIBRARY})
else()
list(APPEND LIBRARIES ${OPENGL_gl_LIBRARY})
endif()
endif()
# OS Specific dependencies
if(APPLE)
find_library(AGL_LIBRARY AGL REQUIRED)
list(APPEND LIBRARIES ${AGL_LIBRARY})
elseif(NOT WIN32)
if(GLEW_OSMESA)
find_library(OSMESA_LIBRARY OSMesa REQUIRED)
list(APPEND LIBRARIES ${OSMESA_LIBRARY})
list(APPEND DEFINITIONS -DGLEW_OSMESA)
list(APPEND pc_requires osmesa)
else()
if(USE_GLVND)
if(NOT OpenGL_GLX_FOUND)
message(FATAL_ERROR "GLX is not found. Try with PREFER_GLVND=NO")
endif()
if(USE_NAMESPACED_LIB)
list(APPEND LIBRARIES OpenGL::GLX)
else()
list(APPEND LIBRARIES ${OPENGL_glx_LIBRARY})
endif()
endif()
find_package(X11 REQUIRED)
list(APPEND pc_requires x11 xext)
if(USE_NAMESPACED_LIB)
list(APPEND LIBRARIES X11::X11 X11::Xext)
else()
list(APPEND LIBRARIES ${X11_X11_LIB} ${X11_Xext_LIB})
endif()
endif()
endif()
set(GLEW_TARGETS)
if(NOT CMAKE_INSTALL_LIBDIR)
set(INSTALL_LIBDIR lib)
else()
set(INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
endif()
execute_process(
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}/test_fs_support_case_sensitivity
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}/test_fs_support_CASE_sensitivity)
file(GLOB TEST_FILE_LIST ${CMAKE_BINARY_DIR}/test_fs_support_*_sensitivity)
list(LENGTH TEST_FILE_LIST TEST_FILE_COUNT)
if(TEST_FILE_COUNT EQUAL 2)
set(SUPPORT_CASE_SENSITIVE_FS YES)
else()
set(SUPPORT_CASE_SENSITIVE_FS NO)
endif()
function(set_representative_target TARGET)
set_target_properties(${TARGET} PROPERTIES
OUTPUT_NAME "glew"
DEBUG_POSTFIX d)
# Windows & macOS use case-insensetive FS. do not create symbolic link
if(SUPPORT_CASE_SENSITIVE_FS)
get_target_property(TARGET_TYPE ${TARGET} TYPE)
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
if(CMAKE_BUILD_TYPE_LOWER STREQUAL "debug" AND NOT ANDROID)
set(GLEW_DEBUG_SUFFIX "d")
else()
set(GLEW_DEBUG_SUFFIX "")
endif()
if(TARGET_TYPE STREQUAL STATIC_LIBRARY)
set(EXT ".a")
get_target_property(OUT_DIR ${TARGET} ARCHIVE_OUTPUT_DIRECTORY)
else()
set(EXT ".so")
get_target_property(OUT_DIR ${TARGET} LIBRARY_OUTPUT_DIRECTORY)
endif()
if(NOT ${CMAKE_VERSION} VERSION_LESS 3.0)
add_custom_command(TARGET ${TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink libglew${GLEW_DEBUG_SUFFIX}${EXT} libGLEW${GLEW_DEBUG_SUFFIX}${EXT}
WORKING_DIRECTORY ${OUT_DIR}
BYPRODUCTS ${OUT_DIR}/libGLEW${GLEW_DEBUG_SUFFIX}${EXT}
COMMENT "create libGLEW${GLEW_DEBUG_SUFFIX} symbolic link")
else()
add_custom_command(TARGET ${TARGET} POST_BUILD
COMMAND bash ARGS -c "( test ! -e ${OUT_DIR}/libGLEW${GLEW_DEBUG_SUFFIX}${EXT} && cd ${OUT_DIR} && ${CMAKE_COMMAND} -E create_symlink libglew${GLEW_DEBUG_SUFFIX}${EXT} libGLEW${GLEW_DEBUG_SUFFIX}${EXT} ) || true"
COMMENT "create libGLEW${GLEW_DEBUG_SUFFIX} symbolic link"
VERBATIM)
endif()
if(NOT ${CMAKE_VERSION} VERSION_LESS 3.14)
install(FILES ${OUT_DIR}/libGLEW${GLEW_DEBUG_SUFFIX}${EXT} TYPE LIB)
else()
install(FILES ${OUT_DIR}/libGLEW${GLEW_DEBUG_SUFFIX}${EXT} DESTINATION ${INSTALL_LIBDIR})
endif()
endif()
endfunction()
if(glew-cmake_BUILD_STATIC)
add_library(libglew_static STATIC ${LIBGLEW_SRCS})
set_representative_target(libglew_static)
target_compile_definitions(libglew_static PUBLIC GLEW_STATIC)
list(APPEND GLEW_TARGETS libglew_static)
endif()
if(glew-cmake_BUILD_SHARED)
add_library(libglew_shared SHARED ${LIBGLEW_SRCS})
if(glew-cmake_BUILD_STATIC)
set_target_properties(libglew_shared PROPERTIES
OUTPUT_NAME "glew-shared"
DEBUG_POSTFIX d)
else()
set_representative_target(libglew_shared)
endif()
target_compile_definitions(libglew_shared PRIVATE GLEW_BUILD)
if(MINGW)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
target_link_options(libglew_shared PRIVATE -nostdlib)
else()
target_link_libraries(libglew_shared PRIVATE -nostdlib)
endif()
endif()
list(APPEND GLEW_TARGETS libglew_shared)
endif()
foreach(GLEW_TARGET ${GLEW_TARGETS})
target_compile_definitions(${GLEW_TARGET} PUBLIC ${DEFINITIONS})
target_include_directories(${GLEW_TARGET} PUBLIC ${INCLUDE_DIR})
target_link_libraries(${GLEW_TARGET} PUBLIC ${LIBRARIES})
set_target_properties(${GLEW_TARGET} PROPERTIES VERSION ${GLEW_VERSION})
endforeach()
if(PKG_CONFIG_REPRESENTATIVE_TARGET)
GeneratePkgConfigFile(${PKG_CONFIG_REPRESENTATIVE_TARGET} "The OpenGL Extension Wrangler library"
NAME "glew"
LIBRARY_DIR ${INSTALL_LIBDIR}
REQUIRES ${pc_requires})
endif()
install(TARGETS ${GLEW_TARGETS} EXPORT glew-cmake
ARCHIVE DESTINATION ${INSTALL_LIBDIR}
LIBRARY DESTINATION ${INSTALL_LIBDIR})
install(EXPORT glew-cmake DESTINATION ${INSTALL_LIBDIR}/cmake/glew FILE glewConfig.cmake)
file(GLOB PUBLIC_HEADERS "include/GL/*.h")
install(FILES ${PUBLIC_HEADERS} DESTINATION include/GL/)
if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR} AND NOT ONLY_LIBS)
set(GLEWINFO_SRCS ${SRC_DIR}/glewinfo.c)
set(VISUALINFO_SRCS ${SRC_DIR}/visualinfo.c)
if(MSVS)
list(APPEND GLEWINFO_SRCS ${RC_DIR}/glewinfo.rc)
list(APPEND VISUALINFO_SRCS ${RC_DIR}/visualinfo.rc)
endif()
add_executable(glewinfo ${GLEWINFO_SRCS})
add_executable(visualinfo ${VISUALINFO_SRCS})
if(glew-cmake_BUILD_STATIC)
target_link_libraries(glewinfo libglew_static)
target_link_libraries(visualinfo libglew_static)
else()
target_link_libraries(glewinfo libglew_shared)
target_link_libraries(visualinfo libglew_shared)
endif()
install(TARGETS glewinfo visualinfo DESTINATION bin)
endif()

View File

@ -1,62 +0,0 @@
function(GeneratePkgConfigFile target description)
cmake_parse_arguments(pc "" "NAME;LIBRARY_DIR" "REQUIRES" ${ARGV})
if(NOT pc_LIBRARY_DIR)
set(pc_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR})
endif()
if(WIN32)
set(PKGCONFIG_INSTALL_DIR)
else()
set(PKGCONFIG_INSTALL_DIR ${pc_LIBRARY_DIR}/pkgconfig)
endif()
if(NOT pc_NAME)
set(pc_NAME ${target})
endif()
get_property(raw_definitions TARGET ${target} PROPERTY INTERFACE_COMPILE_DEFINITIONS)
set(definitions "")
foreach(def IN LISTS raw_definitions)
if(def MATCHES "-D")
list(APPEND definitions ${def})
else()
list(APPEND definitions "-D${def}")
endif()
endforeach()
list(JOIN definitions " " definitions)
get_property(target_output TARGET ${target} PROPERTY OUTPUT_NAME)
get_filename_component(target_output ${target_output} NAME)
set(links "-l${target_output}")
get_property(raw_links TARGET ${target} PROPERTY INTERFACE_LINK_LIBRARIES)
foreach(link IN LISTS raw_links)
if(link MATCHES "-l")
list(APPEND links ${link})
elseif(TARGET ${link})
get_property(is_imported TARGET ${link} PROPERTY IMPORTED)
if(NOT is_imported)
get_property(link_target TARGET ${link} PROPERTY OUTPUT_NAME)
list(APPEND links ${link_target})
endif()
else()
list(APPEND links "-l${link}")
endif()
endforeach()
list(JOIN links " " links)
get_property(version TARGET ${target} PROPERTY VERSION)
set(out_file "${CMAKE_CURRENT_BINARY_DIR}/${pc_NAME}.pc")
file(WRITE ${out_file} "prefix=${CMAKE_INSTALL_PREFIX}\n")
file(APPEND ${out_file} "exec_prefix=\${prefix}\n")
file(APPEND ${out_file} "libdir=\${prefix}/${pc_LIBRARY_DIR}\n")
file(APPEND ${out_file} "includedir=\${prefix}/include\n")
file(APPEND ${out_file} "\n")
file(APPEND ${out_file} "Name: ${pc_NAME}\n")
file(APPEND ${out_file} "Description: ${description}\n")
file(APPEND ${out_file} "Version: ${version}\n")
file(APPEND ${out_file} "Cflags: -I\${includedir} ${definitions}\n")
file(APPEND ${out_file} "Libs: -L\${libdir} ${links}\n")
if(pc_REQUIRES)
string(REPLACE ";" " " REQUIRES "${pc_REQUIRES}")
file(APPEND ${out_file} "Requires: ${REQUIRES}")
endif()
install(FILES ${out_file} DESTINATION "${PKGCONFIG_INSTALL_DIR}")
endfunction()

View File

@ -31,7 +31,7 @@
include config/version
SHELL = /bin/sh
SYSTEM ?= $(shell config/config.guess | cut -d - -f 3 | sed -e 's/\.//g' -e 's/[0-9]\{1,\}.*//')
SYSTEM ?= $(shell config/config.guess | cut -d - -f 3 | sed -e 's/[0-9\.]//g;')
SYSTEM.SUPPORTED = $(shell test -f config/Makefile.$(SYSTEM) && echo 1)
ifeq ($(SYSTEM.SUPPORTED), 1)
@ -40,8 +40,8 @@ else
$(error "Platform '$(SYSTEM)' not supported")
endif
GLEW_PREFIX ?= /usr/local
GLEW_DEST ?= /usr/local
GLEW_PREFIX ?= /usr
GLEW_DEST ?= /usr
BINDIR ?= $(GLEW_DEST)/bin
LIBDIR ?= $(GLEW_DEST)/lib
INCDIR ?= $(GLEW_DEST)/include/GL
@ -61,6 +61,7 @@ DIST_DIR := $(shell mktemp -d /tmp/glew.XXXXXX)/$(DIST_NAME)
# To disable stripping of linked binaries either:
# - use STRIP= on gmake command-line
# - edit this makefile to set STRIP to the empty string
# (Note: STRIP does not affect the strip in the install step)
#
# To disable symlinks:
# - use LN= on gmake command-line
@ -76,7 +77,6 @@ DOS2UNIX ?= dos2unix -q
ifneq (,$(filter debug,$(MAKECMDGOALS)))
OPT = -g
STRIP :=
else
OPT = $(POPT)
endif
@ -89,7 +89,6 @@ all debug: glew.lib glew.bin
LIB.LDFLAGS := $(LDFLAGS.EXTRA) $(LDFLAGS.GL)
LIB.LIBS := $(GL_LDFLAGS)
LIB.SHARED.DIR ?= lib
LIB.SRCS := src/glew.c
LIB.SRCS.NAMES := $(notdir $(LIB.SRCS))
@ -101,7 +100,7 @@ LIB.SOBJS := $(LIB.SOBJS:.c=.o)
glew.lib: glew.lib.shared glew.lib.static
glew.lib.shared: lib $(LIB.SHARED.DIR) $(LIB.SHARED.DIR)/$(LIB.SHARED) glew.pc
glew.lib.shared: lib lib/$(LIB.SHARED) glew.pc
glew.lib.static: lib lib/$(LIB.STATIC) glew.pc
.PHONY: glew.lib glew.lib.shared glew.lib.static
@ -119,11 +118,11 @@ ifneq ($(STRIP),)
$(STRIP) -x $@
endif
$(LIB.SHARED.DIR)/$(LIB.SHARED): $(LIB.SOBJS)
lib/$(LIB.SHARED): $(LIB.SOBJS)
$(LD) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
ifneq ($(LN),)
$(LN) $(LIB.SHARED) $(LIB.SHARED.DIR)/$(LIB.SONAME)
$(LN) $(LIB.SHARED) $(LIB.SHARED.DIR)/$(LIB.DEVLNK)
$(LN) $(LIB.SHARED) lib/$(LIB.SONAME)
$(LN) $(LIB.SHARED) lib/$(LIB.DEVLNK)
endif
ifneq ($(STRIP),)
$(STRIP) -x $@
@ -150,7 +149,6 @@ glew.pc: glew.pc.in
-e "s|@version@|$(GLEW_VERSION)|g" \
-e "s|@cflags@||g" \
-e "s|@libname@|$(NAME)|g" \
-e "s|@libgl@|$(LDFLAGS.GL)|g" \
-e "s|@requireslib@|$(LIBGLU)|g" \
< $< > $@
@ -171,20 +169,21 @@ VISUALINFO.BIN.OBJ := $(VISUALINFO.BIN.OBJ:.c=.o)
# Don't build glewinfo or visualinfo for NaCL, yet.
ifneq ($(filter nacl%,$(SYSTEM)),)
glew.bin: glew.lib
glew.bin: glew.lib bin
else
glew.bin: glew.lib bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN)
glew.bin: glew.lib bin bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN)
endif
bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.OBJ) $(LIB.SHARED.DIR)/$(LIB.SHARED)
@mkdir -p $(dir $@)
bin:
mkdir bin
bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.OBJ) lib/$(LIB.SHARED)
$(CC) $(CFLAGS) -o $@ $(GLEWINFO.BIN.OBJ) $(BIN.LIBS)
ifneq ($(STRIP),)
$(STRIP) -x $@
endif
bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.OBJ) $(LIB.SHARED.DIR)/$(LIB.SHARED)
@mkdir -p $(dir $@)
bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.OBJ) lib/$(LIB.SHARED)
$(CC) $(CFLAGS) -o $@ $(VISUALINFO.BIN.OBJ) $(BIN.LIBS)
ifneq ($(STRIP),)
$(STRIP) -x $@
@ -209,9 +208,9 @@ install.lib: glew.lib
# runtime
ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
$(INSTALL) -d -m 0755 "$(DESTDIR)$(BINDIR)"
$(INSTALL) -m 0755 $(LIB.SHARED.DIR)/$(LIB.SHARED) "$(DESTDIR)$(BINDIR)/"
$(INSTALL) -m 0755 lib/$(LIB.SHARED) "$(DESTDIR)$(BINDIR)/"
else
$(INSTALL) -m 0644 $(LIB.SHARED.DIR)/$(LIB.SHARED) "$(DESTDIR)$(LIBDIR)/"
$(INSTALL) -m 0644 lib/$(LIB.SHARED) "$(DESTDIR)$(LIBDIR)/"
endif
ifneq ($(LN),)
$(LN) $(LIB.SHARED) "$(DESTDIR)$(LIBDIR)/$(LIB.SONAME)"
@ -228,14 +227,13 @@ endif
install.bin: glew.bin
$(INSTALL) -d -m 0755 "$(DESTDIR)$(BINDIR)"
$(INSTALL) -m 0755 bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) "$(DESTDIR)$(BINDIR)/"
$(INSTALL) -s -m 0755 bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) "$(DESTDIR)$(BINDIR)/"
install.include:
$(INSTALL) -d -m 0755 "$(DESTDIR)$(INCDIR)"
$(INSTALL) -m 0644 include/GL/wglew.h "$(DESTDIR)$(INCDIR)/"
$(INSTALL) -m 0644 include/GL/glew.h "$(DESTDIR)$(INCDIR)/"
$(INSTALL) -m 0644 include/GL/glxew.h "$(DESTDIR)$(INCDIR)/"
$(INSTALL) -m 0644 include/GL/eglew.h "$(DESTDIR)$(INCDIR)/"
install.pkgconfig: glew.pc
$(INSTALL) -d -m 0755 "$(DESTDIR)$(PKGDIR)"
@ -294,9 +292,6 @@ dist-src:
mkdir -p $(DIST_DIR)/lib
cp -a auto $(DIST_DIR)
$(RM) -Rf $(DIST_DIR)/auto/registry
$(RM) -Rf $(DIST_DIR)/auto/glfixes
$(RM) -Rf $(DIST_DIR)/auto/OpenGL-Registry
$(RM) -Rf $(DIST_DIR)/auto/EGL-Registry
cp -a build $(DIST_DIR)
cp -a config $(DIST_DIR)
cp -a src $(DIST_DIR)

197
README.md
View File

@ -1,29 +1,190 @@
# GLEW-cmake - nightly pre-generated snapshot with old unofficial cmake support
# GLEW - The OpenGL Extension Wrangler Library
[GLEW](https://github.com/nigels-com/glew) is upstream of this project.
But *GLEW* repository does not contain generated sources. Only releases include generated sources.
![](http://glew.sourceforge.net/glew.png)
*GLEW-cmake* has generated sources based on the latest *GLEW*. Sources are generated nightly.
If you need only the latest snapshot of *GLEW*, try the build system of *GLEW*. It is placed under the `build` directory. Official `CMakeLists.txt` is placed in `build/cmake`.
Please check [README_glew.md](./README_glew.md) for using build system of *GLEW*.
http://glew.sourceforge.net/
Also, *GLEW-cmake* has unofficial cmake support - It is created when the official CMake support of *GLEW* does not exist.
You can see some CMake script examples in [`glew-cmake`](./glew-cmake/) directory. But, I **strongly** recommend using official CMakeLists of *GLEW*.
https://github.com/nigels-com/glew
## Usage
[![Build Status](https://travis-ci.org/nigels-com/glew.svg?branch=master)](https://travis-ci.org/nigels-com/glew)
[![Gitter](https://badges.gitter.im/nigels-com/glew.svg)](https://gitter.im/nigels-com/glew?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Download](https://img.shields.io/sourceforge/dm/glew.svg)](https://sourceforge.net/projects/glew/files/latest/download)
This project provide `libglew_static` and `libglew_shared` library targets and `glewinfo` and `visualinfo` executable targets.
## Downloads
`libglew_static` provides a static library, and `libglew_shared` provides a shared library.
*glew-cmake* does not affected by [BUILD_SHARED_LIBS](https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html).
Current release is [2.1.0](https://sourceforge.net/projects/glew/files/glew/2.1.0/).
[(Change Log)](http://glew.sourceforge.net/log.html)
You can disable each library target by setting `glew-cmake_BUILD_SHARED` or `glew-cmake_BUILD_STATIC` falsy value (ex. `NO`, `FALSE`).
Sources available as
[ZIP](https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.zip/download) or
[TGZ](https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.tgz/download).
If you need only libraries, Please set `ONLY_LIBS` to `ON`. Otherwise, cmake generates executable targets also.
Windows binaries for [32-bit and 64-bit](https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0-win32.zip/download).
You can get pkg-config fils by setting `PKG_CONFIG_REPRESENTATIVE_TARGET` to `libglew_static` or `libglew_shared`.
### Recent snapshots
Simply specify dependency of your target with `libglew_static` or `libglew_shared` by `target_link_libraries`.
It will set the additional include directory & the libraries to link to your target.
Snapshots may contain new features, bug-fixes or new OpenGL extensions ahead of tested, official releases.
If you are not familiar with cmake, Some `sub-directory-test.cmake`, `fetch-content.cmake` in [`glew-cmake`](./glew-cmake/) could be helpful.
## Build
It is highly recommended to build from a tgz or zip release snapshot.
The code generation workflow is a complex brew of gnu make, perl and python, that works best on Linux or Mac.
For most end-users of GLEW the official releases are the best choice, with first class support.
### Linux and Mac
#### Using GNU Make
##### Install build tools
Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libxmu-dev libxi-dev libgl-dev libosmesa-dev`
RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel`
##### Build
$ make
$ sudo make install
$ make clean
Targets: `all, glew.lib (sub-targets: glew.lib.shared, glew.lib.static), glew.bin, clean, install, uninstall`
Variables: `SYSTEM=linux-clang, GLEW_DEST=/usr/local, STRIP=`
_Note: may need to make **auto** folder_
#### Using cmake
*CMake 2.8.12 or higher is required.*
##### Install build tools
Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libXmu-dev libXi-dev libgl-dev cmake`
RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel cmake`
##### Build
$ cd build
$ cmake ./cmake
$ make -j4
| Target | Description |
| ---------- | ----------- |
| glew | Build the glew shared library. |
| glew_s | Build the glew static library. |
| glewinfo | Build the `glewinfo` executable (requires `BUILD_UTILS` to be `ON`). |
| visualinfo | Build the `visualinfo` executable (requires `BUILD_UTILS` to be `ON`). |
| install | Install all enabled targets into `CMAKE_INSTALL_PREFIX`. |
| clean | Clean up build artifacts. |
| all | Build all enabled targets (default target). |
| Variables | Description |
| --------------- | ----------- |
| BUILD_UTILS | Build the `glewinfo` and `visualinfo` executables. |
| GLEW_REGAL | Build in Regal mode. |
| GLEW_OSMESA | Build in off-screen Mesa mode. |
| BUILD_FRAMEWORK | Build as MacOSX Framework. Setting `CMAKE_INSTALL_PREFIX` to `/Library/Frameworks` is recommended. |
### Windows
#### Visual Studio
Use the provided Visual Studio project file in build/vc12/
Projects for vc6 and vc10 are also provided
#### MSYS/Mingw
Available from [Mingw](http://www.mingw.org/)
Requirements: bash, make, gcc
$ mingw32-make
$ mingw32-make install
$ mingw32-make install.all
Alternative toolchain: `SYSTEM=mingw-win32`
#### MSYS2/Mingw-w64
Available from [Msys2](http://msys2.github.io/) and/or [Mingw-w64](http://mingw-w64.org/)
Requirements: bash, make, gcc
$ pacman -S gcc make mingw-w64-i686-gcc mingw-w64-x86_64-gcc
$ make
$ make install
$ make install.all
Alternative toolchain: `SYSTEM=msys, SYSTEM=msys-win32, SYSTEM=msys-win64`
## glewinfo
`glewinfo` is a command-line tool useful for inspecting the capabilities of an
OpenGL implementation and GLEW support for that. Please include `glewinfo.txt`
with bug reports, as appropriate.
---------------------------
GLEW Extension Info
---------------------------
GLEW version 2.0.0
Reporting capabilities of pixelformat 3
Running on a Intel(R) HD Graphics 3000 from Intel
OpenGL version 3.1.0 - Build 9.17.10.4229 is supported
GL_VERSION_1_1: OK
---------------
GL_VERSION_1_2: OK
---------------
glCopyTexSubImage3D: OK
glDrawRangeElements: OK
glTexImage3D: OK
glTexSubImage3D: OK
...
## Code Generation
A Unix or Mac environment is needed for building GLEW from scratch to
include new extensions, or customize the code generation. The extension
data is regenerated from the top level source directory with:
make extensions
An alternative to generating the GLEW sources from scratch is to
download a pre-generated (unsupported) snapshot:
https://sourceforge.net/projects/glew/files/glew/snapshots/
Travis-built snapshots are also available:
https://glew.s3.amazonaws.com/index.html
## Authors
GLEW is currently maintained by [Nigel Stewart](https://github.com/nigels-com)
with bug fixes, new OpenGL extension support and new releases.
GLEW was developed by [Milan Ikits](http://www.cs.utah.edu/~ikits/)
and [Marcelo Magallon](http://wwwvis.informatik.uni-stuttgart.de/~magallon/).
Aaron Lefohn, Joe Kniss, and Chris Wyman were the first users and also
assisted with the design and debugging process.
The acronym GLEW originates from Aaron Lefohn.
Pasi K&auml;rkk&auml;inen identified and fixed several problems with
GLX and SDL. Nate Robins created the `wglinfo` utility, to
which modifications were made by Michael Wimmer.
## Copyright and Licensing
GLEW is originally derived from the EXTGL project by Lev Povalahev.
The source code is licensed under the
[Modified BSD License](http://glew.sourceforge.net/glew.txt), the
[Mesa 3-D License](http://glew.sourceforge.net/mesa.txt) (MIT) and the
[Khronos License](http://glew.sourceforge.net/khronos.txt) (MIT).
The automatic code generation scripts are released under the
[GNU GPL](http://glew.sourceforge.net/gpl.txt).

View File

@ -1,256 +0,0 @@
# GLEW - The OpenGL Extension Wrangler Library
The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library. GLEW provides efficient run-time mechanisms for determining which OpenGL extensions are supported on the target platform. OpenGL core and extension functionality is exposed in a single header file. GLEW has been tested on a variety of operating systems, including Windows, Linux, Mac OS X, FreeBSD, Irix, and Solaris.
![](http://glew.sourceforge.net/glew.png)
http://glew.sourceforge.net/
https://github.com/nigels-com/glew
[![Gitter](https://badges.gitter.im/nigels-com/glew.svg)](https://gitter.im/nigels-com/glew?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Download](https://img.shields.io/sourceforge/dm/glew.svg)](https://sourceforge.net/projects/glew/files/latest/download)
[![Health](https://codebuild.ap-southeast-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiZ0cxMFNORFBPTGQ5Z1MyRUsxRnU5V1ZyOUNUWmZZRFJwNWdBNng5MnNtdFFObGNsTEJkQkxZa0lHYmtMNEZRREZaZmdvMUh2bDMxVjhFc3c2L29odFQ4PSIsIml2UGFyYW1ldGVyU3BlYyI6InhLVlFqWXVaMEZRVFh6c1QiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=master)](https://ap-southeast-2.codebuild.aws.amazon.com/project/eyJlbmNyeXB0ZWREYXRhIjoiK3RLWndGOVVkMWthbXRQZCtVTTNOQ0w2dEpxakZ1cVBTNDZ1UldGODdqUERSdkx0U21Nd0RFaGhQL1kycVlmNzh2OXpEYnRKV3hXTVJJdjUvVStCbTl0dkliZm5jRTFsc0VBPSIsIml2UGFyYW1ldGVyU3BlYyI6ImZ0ekRoMkNjaU0rRUt5K2UiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D)
## Table of Contents
* [Downloads](#downloads)
* [Recent snapshots](#recent-snapshots)
* [Build](#build)
* [Linux and Mac](#linux-and-mac)
* [Using GNU Make](#using-gnu-make)
* [Install build tools](#install-build-tools)
* [Build](#build-1)
* [Linux EGL](#linux-egl)
* [Linux OSMesa](#linux-osmesa)
* [Linux mingw-w64](#linux-mingw-w64)
* [Using cmake](#using-cmake)
* [Install build tools](#install-build-tools-1)
* [Build](#build-2)
* [Windows](#windows)
* [Visual Studio](#visual-studio)
* [MSYS/Mingw](#msysmingw)
* [MSYS2/Mingw-w64](#msys2mingw-w64)
* [glewinfo](#glewinfo)
* [Code Generation](#code-generation)
* [Authors](#authors)
* [Contributions](#contributions)
* [Copyright and Licensing](#copyright-and-licensing)
## Downloads
Current release is [2.2.0](https://github.com/nigels-com/glew/releases/tag/glew-2.2.0).
[(Change Log)](http://glew.sourceforge.net/log.html)
Sources available as
[ZIP](https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.zip) or
[TGZ](https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.tgz).
Windows binaries for [32-bit and 64-bit](https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0-win32.zip).
### Recent snapshots
Snapshots may contain new features, bug-fixes or new OpenGL extensions ahead of tested, official releases.
[glew-20220402.tgz](https://sourceforge.net/projects/glew/files/glew/snapshots/glew-20220402.tgz/download) *GLEW 2.2.0 - with fix for glCreateProgressFenceNVX*
## Build
It is highly recommended to build from a tgz or zip release snapshot.
The code generation workflow is a complex brew of gnu make, perl and python, that works best on Linux or Mac.
The code generation is known to work on Windows using [MSYS2](https://www.msys2.org/).
For most end-users of GLEW the official releases are the best choice, with first class support.
### Linux and Mac
#### Using GNU Make
GNU make is the primary build system for GLEW, historically.
It includes targets for building the sources and headers, for maintenance purposes.
##### Install build tools
Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libxmu-dev libxi-dev libgl-dev`
RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel`
FreeBSD: `# pkg install xorg lang/gcc git cmake gmake bash python perl5`
##### Build
$ make
$ sudo make install
$ make clean
Targets: `all, glew.lib (sub-targets: glew.lib.shared, glew.lib.static), glew.bin, clean, install, uninstall`
Variables: `SYSTEM=linux-clang, GLEW_DEST=/usr/local, STRIP=`
_Note: you may need to call `make` in the **auto** folder first_
##### Linux EGL
$ sudo apt install libegl1-mesa-dev
$ make SYSTEM=linux-egl
##### Linux OSMesa
$ sudo apt install libosmesa-dev
$ make SYSTEM=linux-osmesa
##### Linux mingw-w64
$ sudo apt install mingw-w64
$ make SYSTEM=linux-mingw32
$ make SYSTEM=linux-mingw64
#### Using cmake
The cmake build is mostly contributor maintained.
Due to the multitude of use cases this is maintained on a _best effort_ basis.
Pull requests are welcome.
*CMake 3.16 or higher is required.*
##### Install build tools
Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libxmu-dev libxi-dev libgl-dev cmake git`
RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel cmake git`
##### Build
$ cd build
$ cmake ./cmake
$ make -j4
| Target | Description |
| ---------- | ----------- |
| glew | Build the glew shared library. |
| glew_s | Build the glew static library. |
| glewinfo | Build the `glewinfo` executable (requires `BUILD_UTILS` to be `ON`). |
| visualinfo | Build the `visualinfo` executable (requires `BUILD_UTILS` to be `ON`). |
| install | Install all enabled targets into `CMAKE_INSTALL_PREFIX`. |
| clean | Clean up build artifacts. |
| all | Build all enabled targets (default target). |
| Variables | Description |
| --------------- | ----------- |
| BUILD_UTILS | Build the `glewinfo` and `visualinfo` executables. |
| GLEW_REGAL | Build in Regal mode. |
| GLEW_OSMESA | Build in off-screen Mesa mode. |
| BUILD_FRAMEWORK | Build as MacOSX Framework. Setting `CMAKE_INSTALL_PREFIX` to `/Library/Frameworks` is recommended. |
### Windows
#### Visual Studio
Use the provided Visual Studio project file in build/vc15/
Projects for vc6, vc10, vc12 and vc14 are also provided
#### MSYS/Mingw
Available from [Mingw](http://www.mingw.org/)
Requirements: bash, make, gcc
$ mingw32-make
$ mingw32-make install
$ mingw32-make install.all
Alternative toolchain: `SYSTEM=mingw-win32`
#### MSYS2/Mingw-w64
Available from [Msys2](http://msys2.github.io/) and/or [Mingw-w64](http://mingw-w64.org/)
Requirements: bash, make, gcc
$ pacman -S gcc make mingw-w64-i686-gcc mingw-w64-x86_64-gcc
$ make
$ make install
$ make install.all
Alternative toolchain: `SYSTEM=msys, SYSTEM=msys-win32, SYSTEM=msys-win64`
## glewinfo
`glewinfo` is a command-line tool useful for inspecting the capabilities of an
OpenGL implementation and GLEW support for that. Please include `glewinfo.txt`
with bug reports, as appropriate.
---------------------------
GLEW Extension Info
---------------------------
GLEW version 2.0.0
Reporting capabilities of pixelformat 3
Running on a Intel(R) HD Graphics 3000 from Intel
OpenGL version 3.1.0 - Build 9.17.10.4229 is supported
GL_VERSION_1_1: OK
---------------
GL_VERSION_1_2: OK
---------------
glCopyTexSubImage3D: OK
glDrawRangeElements: OK
glTexImage3D: OK
glTexSubImage3D: OK
...
## Code Generation
A Unix or Mac environment is needed for building GLEW from scratch to
include new extensions, or customize the code generation. The extension
data is regenerated from the top level source directory with:
make extensions
An alternative to generating the GLEW sources from scratch is to
download a pre-generated (unsupported) snapshot:
https://sourceforge.net/projects/glew/files/glew/snapshots/
## Authors
GLEW is currently maintained by [Nigel Stewart](https://github.com/nigels-com)
with bug fixes, new OpenGL extension support and new releases.
GLEW was developed by [Milan Ikits](http://www.cs.utah.edu/~ikits/)
and [Marcelo Magallon](http://wwwvis.informatik.uni-stuttgart.de/~magallon/).
Aaron Lefohn, Joe Kniss, and Chris Wyman were the first users and also
assisted with the design and debugging process.
The acronym GLEW originates from Aaron Lefohn.
Pasi K&auml;rkk&auml;inen identified and fixed several problems with
GLX and SDL. Nate Robins created the `wglinfo` utility, to
which modifications were made by Michael Wimmer.
## Contributions
GLEW welcomes community contributions. Typically these are co-ordinated
via [Issues](https://github.com/nigels-com/glew/issues) or
[Pull Requests](https://github.com/nigels-com/glew/pulls) in the
GitHub web interface.
Be sure to mention platform and compiler toolchain details when filing
a bug report. The output of `glewinfo` can be quite useful for discussion
also.
Generally GLEW is usually released once a year, around the time of the Siggraph
computer graphics conference. If you're not using the current release
version of GLEW, be sure to check if the issue or bug is fixed there.
## Copyright and Licensing
GLEW is originally derived from the EXTGL project by Lev Povalahev.
The source code is licensed under the
[Modified BSD License](http://glew.sourceforge.net/glew.txt), the
[Mesa 3-D License](http://glew.sourceforge.net/mesa.txt) (MIT) and the
[Khronos License](http://glew.sourceforge.net/khronos.txt) (MIT).
The automatic code generation scripts are released under the
[GNU GPL](http://glew.sourceforge.net/gpl.txt).

View File

@ -12,12 +12,29 @@ include ../config/version
SHELL = bash
PYTHON ?= python
EXT = extensions/gl
CORE = core/gl
### Use git repository for GL extension specifications
REPO_OPENGL ?= https://github.com/KhronosGroup/OpenGL-Registry.git
REPO_EGL ?= https://github.com/KhronosGroup/EGL-Registry.git
REPO_GLFIXES ?= https://github.com/nigels-com/glfixes
GIT_CLONE ?= git clone --branch glew https://github.com/nigels-com/glfixes.git
###
### Conventional desktop OpenGL settings
###
REGISTRY = registry/gl/specs
EXT = extensions/gl
FILTER = filter_gl_ext.sh
CORE = core/gl
REGISTRY_URL = http://www.opengl.org/registry/
###
### Experimental OpenGL ES settings
###
# REGISTRY = registry/gles
# EXT = extensions/gles
# FILTER = filter_gles_ext.sh
# CORE = core/gles
# REGISTRY_URL = http://www.khronos.org/registry/gles/
BIN = bin
SRC = src
@ -86,55 +103,30 @@ B.TARGETS = \
all custom: $(I.TARGETS) $(S.TARGETS) $(D.TARGETS) $(B.TARGETS)
registry: $(REGISTRY)/.dummy
ext: $(EXT)/.dummy
OpenGL-Registry/.dummy:
$(REGISTRY)/.dummy:
@echo "--------------------------------------------------------------------"
@echo "Downloading OpenGL-Registry"
@echo "Downloading registry"
@echo "--------------------------------------------------------------------"
git clone --depth=1 $(REPO_OPENGL) OpenGL-Registry
git clone --depth=1 --branch glew $(REPO_GLFIXES) glfixes
$(GIT_CLONE) registry
touch $@
EGL-Registry/.dummy:
$(EXT)/.dummy: $(REGISTRY)/.dummy
@echo "--------------------------------------------------------------------"
@echo "Downloading EGL-Registry"
@echo "--------------------------------------------------------------------"
git clone --depth=1 $(REPO_EGL) EGL-Registry
touch $@
$(EXT)/.dummy: OpenGL-Registry/.dummy EGL-Registry/.dummy
@echo "--------------------------------------------------------------------"
@echo "OpenGL descriptors"
@echo "Creating descriptors"
@echo "--------------------------------------------------------------------"
rm -rf $(EXT)
cp -r glfixes/gl/specs/ANGLE OpenGL-Registry/extensions
cp -r glfixes/gl/specs/REGAL OpenGL-Registry/extensions
$(BIN)/update_ext.sh $(EXT) OpenGL-Registry/extensions $(BLACKLIST)
@echo "--------------------------------------------------------------------"
@echo "WGL descriptors"
@echo "--------------------------------------------------------------------"
rm -f $(EXT)/WGL_*
$(PYTHON) $(BIN)/parse_xml.py OpenGL-Registry/xml/wgl.xml --api wgl --extensions extensions/gl
@echo "--------------------------------------------------------------------"
@echo "GLX descriptors"
@echo "--------------------------------------------------------------------"
rm -f $(EXT)/GLX_*
$(PYTHON) $(BIN)/parse_xml.py OpenGL-Registry/xml/glx.xml --api glx --extensions extensions/gl
@echo "--------------------------------------------------------------------"
@echo "EGL descriptors"
@echo "--------------------------------------------------------------------"
$(PYTHON) $(BIN)/parse_xml.py EGL-Registry/api/egl.xml --api egl --extensions extensions/gl
@echo "--------------------------------------------------------------------"
@echo "filter descriptors"
@echo "--------------------------------------------------------------------"
$(BIN)/filter_gl_ext.sh $(EXT)
$(BIN)/update_ext.sh $(EXT) $(REGISTRY) $(BLACKLIST)
$(PYTHON) $(BIN)/parse_xml.py registry/xml/egl.xml --core core/gl --extensions extensions/gl
$(BIN)/$(FILTER) $(EXT)
ifeq ($(patsubst Darwin%,Darwin,$(SYSTEM)), Darwin)
find $(CORE) -maxdepth 1 -type f | grep -v VERSION | grep -v "~" | \
xargs -J % cp % $(EXT)
else
find $(CORE) -maxdepth 1 -type f | grep -v VERSION | grep -v "~" | \
xargs -I % -n 1 cp % $(EXT)
xargs cp --target-directory=$(EXT)
endif
touch $@
@ -217,7 +209,7 @@ $(S.DEST)/glew.c: $(EXT)/.dummy
$(BIN)/make_def_var.pl GL $(GL_EXT_SPEC) >> $@
echo -e "\nstatic const char * _glewExtensionLookup[] = {" >> $@;
$(BIN)/make_index.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@
echo -e " NULL\n};\n\n" >> $@;
echo -e " NULL\n};\n" >> $@;
$(BIN)/make_enable_index.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@
$(BIN)/make_initd.pl GL $(GL_CORE_SPEC) >> $@
$(BIN)/make_initd.pl GL $(GL_EXT_SPEC) >> $@
@ -310,7 +302,7 @@ $(S.DEST)/glewinfo.c: $(EXT)/.dummy
$(BIN)/make_info_list.pl $(EGL_CORE_SPEC) >> $@
$(BIN)/make_info_list.pl $(EGL_EXT_SPEC) >> $@
cat $(SRC)/glewinfo_tail.c >> $@
perl -e 's/"glColorSubTable"/"glBlendEquation", glBlendEquation == NULL);\n glewInfoFunc(fi, "glColorSubTable"/g' -pi $@
perl -e 's/"glColorSubTable"/"glBlendEquation", glBlendEquation == NULL);\n glewInfoFunc("glColorSubTable"/g' -pi $@
rm -f $@.bak
# Update documentation

View File

@ -1,6 +1,5 @@
#!/usr/bin/env bash
#!/bin/bash
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
@ -78,6 +77,10 @@ EOT
# fix GL_NV_occlusion_query and GL_HP_occlusion_test
grep -v '_HP' $1/GL_NV_occlusion_query > tmp
mv tmp $1/GL_NV_occlusion_query
perl -e's/OCCLUSION_TEST_HP.*/OCCLUSION_TEST_HP 0x8165/' -pi \
$1/GL_HP_occlusion_test
perl -e's/OCCLUSION_TEST_RESULT_HP.*/OCCLUSION_TEST_RESULT_HP 0x8166/' -pi \
$1/GL_HP_occlusion_test
# add deprecated constants to GL_ATI_fragment_shader
cat >> $1/GL_ATI_fragment_shader <<EOT
@ -148,14 +151,9 @@ EOT
typedef struct __GLXFBConfigRec *GLXFBConfigSGIX
EOT
# Skip GLX_SGIX_dmbuffer and GLX_SGIX_video_source
# unknown DMparams, DMbuffer, etc
rm -f $1/GLX_SGIX_dmbuffer
rm -f $1/GLX_SGIX_video_source
# add typedefs to GLX_SGIX_pbuffer
cat >> $1/GLX_SGIX_pbuffer <<EOT
typedef XID GLXPbufferSGIX
typedef XID GLXPbufferSGIX
typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX
EOT
@ -289,9 +287,9 @@ EOT
BOOL 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)
EOT
# Filter glProgramUniform from GL_EXT_separate_shader_objects
cat $1/GL_EXT_separate_shader_objects | grep -v "glProgramUniform" | grep -v "glProgramParameteri" > tmp
mv tmp $1/GL_EXT_separate_shader_objects
# Filter glProgramParameteri from GL_ARB_separate_shader_objects
# grep -v "glProgramParameteri" $1/GL_ARB_separate_shader_objects > tmp
# mv tmp $1/GL_ARB_separate_shader_objects
# Filter out EXT functions from GL_ARB_viewport_array
grep -v "EXT" $1/GL_ARB_viewport_array > tmp
@ -340,6 +338,11 @@ EOT
grep -v "glGetPointerv" $1/GL_KHR_debug > tmp
mv tmp $1/GL_KHR_debug
# Remove GL_ARB_debug_group, GL_ARB_debug_label and GL_ARB_debug_output2, for now
rm -f $1/GL_ARB_debug_group
rm -f $1/GL_ARB_debug_label
rm -f $1/GL_ARB_debug_output2
# add typedefs to GL_ARB_cl_event
# parse_spec.pl can't parse typedefs from New Types section, but ought to
cat >> $1/GL_ARB_cl_event <<EOT
@ -481,9 +484,8 @@ EOT
head -n4 $1/GL_AMD_gpu_shader_int64 > tmp
mv tmp $1/GL_AMD_gpu_shader_int64
# Filter out GL_NO_ERROR enum and glGetGraphicsResetStatus from GL_KHR_robustness
grep -v 'GL_NO_ERROR' $1/GL_KHR_robustness |
grep -v 'glGetGraphicsResetStatus' > tmp
# Filter out GL_NO_ERROR enum from GL_KHR_robustness
grep -v 'GL_NO_ERROR' $1/GL_KHR_robustness > tmp
mv tmp $1/GL_KHR_robustness
# Filter out all enums from GL_KHR_blend_equation_advanced_coherent
@ -498,6 +500,10 @@ EOT
grep -v 'GL_NONE' $1/GL_KHR_context_flush_control > tmp
mv tmp $1/GL_KHR_context_flush_control
# Filter out GL_NONE enum from GL_EGL_KHR_context_flush_control
grep -v 'GL_NONE' $1/GL_EGL_KHR_context_flush_control > tmp
mv tmp $1/GL_EGL_KHR_context_flush_control
# Filter out CoverageModulation from NV_framebuffer_mixed_samples
# Superset of EXT_raster_multisample
@ -552,50 +558,6 @@ EOT
grep -v "TextureStorage" $1/GL_ARB_texture_storage > tmp
mv tmp $1/GL_ARB_texture_storage
# Filter out functions from GL_EXT_occlusion_query_boolean
grep -v "(" $1/GL_EXT_occlusion_query_boolean > tmp
mv tmp $1/GL_EXT_occlusion_query_boolean
# Filter out duplicate enums from GL_EXT_protected_textures
cat $1/GL_EXT_protected_textures | grep -v GL_TRUE | grep -v GL_FALSE > tmp
mv tmp $1/GL_EXT_protected_textures
# Filter out duplicate enums from GL_EXT_robustness
cat $1/GL_EXT_robustness | grep -v GL_NO_ERROR > tmp
mv tmp $1/GL_EXT_robustness
# Filter GL_EXT_shader_framebuffer_fetch_non_coherent
grep -v "FramebufferFetchBarrierEXT" $1/GL_EXT_shader_framebuffer_fetch_non_coherent > tmp
mv tmp $1/GL_EXT_shader_framebuffer_fetch_non_coherent
# Filter GL_EXT_tessellation_shader
grep -v "PatchParameteriEXT" $1/GL_EXT_tessellation_shader > tmp
mv tmp $1/GL_EXT_tessellation_shader
# Filter GL_EXT_texture_buffer
grep -v "TexBuffer" $1/GL_EXT_texture_buffer > tmp
mv tmp $1/GL_EXT_texture_buffer
# Filter GL_EXT_texture_border_clamp
grep -v "TexParameter" $1/GL_EXT_texture_border_clamp > tmp
mv tmp $1/GL_EXT_texture_border_clamp
# Filter GL_EXT_disjoint_timer_query
cat $1/GL_EXT_disjoint_timer_query | grep -v GetQueryObjecti64v | grep -v GetQueryObjectui64v > tmp
mv tmp $1/GL_EXT_disjoint_timer_query
# Filter GL_NV_read_buffer_front
grep -v "ReadBufferNV" $1/GL_NV_read_buffer_front > tmp
mv tmp $1/GL_NV_read_buffer_front
# Append GLVULKANPROCNV to GL_NV_draw_vulkan_image
# Probably ought to be explicitly mentioned in the spec language
@ -604,11 +566,5 @@ EOT
typedef void (APIENTRY *GLVULKANPROCNV)(void)
EOT
# GLU extensions are not relevant here
rm -f $1/GL_GLU_*
# Not complete
rm -f $1/GL_SGIX_color_type
# clean up
rm -f patterns $1/*.bak

View File

@ -1,6 +1,5 @@
#!/usr/bin/env bash
#!/bin/bash
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##

View File

@ -1,5 +1,4 @@
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
@ -10,7 +9,7 @@
my %regex = (
extname => qr/^[A-Z][A-Za-z0-9_]+$/,
exturl => qr/^http.+$/,
function => qr/^(.+) ([a-z][a-z0-9_]*) \((.*)\)$/i,
function => qr/^(.+) ([a-z][a-z0-9_]*) \((.+)\)$/i,
token => qr/^([A-Z][A-Z0-9_x]*)\s+((?:0x)?[0-9A-Fa-f]+(u(ll)?)?|[A-Z][A-Z0-9_]*)$/,
type => qr/^typedef\s+(.+)$/,
exact => qr/.*;$/,

View File

@ -1,6 +1,5 @@
#!/usr/bin/env perl
#!/usr/bin/perl
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##

View File

@ -1,6 +1,5 @@
#!/usr/bin/env perl
#!/usr/bin/perl
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##

View File

@ -1,6 +1,5 @@
#!/usr/bin/env perl
#!/usr/bin/perl
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
@ -10,7 +9,6 @@
use strict;
use warnings;
use File::Basename;
use lib '.';
do 'bin/make.pl';
@ -31,7 +29,7 @@ if (@ARGV)
print "/* Detected via extension string or experimental mode */\n";
print "static GLboolean* _glewExtensionEnabled[] = {\n";;
foreach my $ext (sort { basename($a) cmp basename($b) } @extlist)
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) =
parse_ext($ext);
@ -44,5 +42,5 @@ if (@ARGV)
print "#endif\n";
}
print " NULL\n};\n\n";
print " NULL\n};\n";
}

View File

@ -1,6 +1,5 @@
#!/usr/bin/env perl
#!/usr/bin/perl
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##

View File

@ -1,6 +1,5 @@
#!/usr/bin/env perl
#!/usr/bin/perl
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##

View File

@ -1,6 +1,5 @@
#!/usr/bin/env perl
#!/usr/bin/perl
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
@ -10,7 +9,6 @@
use strict;
use warnings;
use File::Basename;
use lib '.';
do 'bin/make.pl';
@ -29,7 +27,7 @@ if (@ARGV)
{
@extlist = @ARGV;
foreach my $ext (sort { basename($a) cmp basename($b) } @extlist)
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) =
parse_ext($ext);

View File

@ -1,6 +1,5 @@
#!/usr/bin/env perl
#!/usr/bin/perl
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
@ -20,7 +19,7 @@ do 'bin/make.pl';
sub make_pfn_info($%)
{
my $name = $_[0];
return " glewInfoFunc(fi, \"$_[0]\", $name == NULL);";
return " glewInfoFunc(\"$_[0]\", $name == NULL);";
}
#---------------------------------------------------------------------------------------
@ -44,23 +43,13 @@ if (@ARGV)
#make_separator($extname);
print "#ifdef $extname\n\n";
print "static void _glewInfo_$extname (void)\n{\n";
if (! %$functions)
{
print " ";
}
else
{
print " GLboolean fi = ";
}
if ($extvar =~ /VERSION/)
{
print "glewPrintExt(\"$extname\", $extvar, $extvar, $extvar);\n";
print " glewPrintExt(\"$extname\", $extvar, $extvar, $extvar);\n";
}
else
{
print "glewPrintExt(\"$extname\", $extvar, $extpre" .
print " glewPrintExt(\"$extname\", $extvar, $extpre" .
"ewIsSupported(\"$extname\"), $extpre" .
"ewGetExtension(\"$extstring\"));\n";
}

View File

@ -1,6 +1,5 @@
#!/usr/bin/env perl
#!/usr/bin/perl
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##

View File

@ -1,6 +1,5 @@
#!/usr/bin/env perl
#!/usr/bin/perl
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##

View File

@ -1,6 +1,5 @@
#!/usr/bin/env perl
#!/usr/bin/perl
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##

View File

@ -1,6 +1,5 @@
#!/usr/bin/env perl
#!/usr/bin/perl
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##

View File

@ -1,6 +1,5 @@
#!/usr/bin/env perl
#!/usr/bin/perl
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##

View File

@ -1,6 +1,5 @@
#!/usr/bin/env perl
#!/usr/bin/perl
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##

View File

@ -1,6 +1,5 @@
#!/usr/bin/env perl
#!/usr/bin/perl
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##

View File

@ -1,6 +1,5 @@
#!/usr/bin/env perl
#!/usr/bin/perl
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##

View File

@ -1,6 +1,5 @@
#!/usr/bin/env perl
#!/usr/bin/perl
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
@ -70,10 +69,6 @@ my %typemap = (
uint64 => "GLuint64",
sync => "GLsync",
# GL_EXT_EGL_image_storage
eglImageOES => "GLeglImageOES",
# AMD_debug_output
DEBUGPROCAMD => "GLDEBUGPROCAMD",
@ -114,7 +109,7 @@ my %taboo_tokens = (
);
# list of function definitions to be ignored, unless they are being defined in
# the given spec. This is an ugly hack around the fact that people writing
# the given spec. This is an ugly hack arround the fact that people writing
# spec files seem to shut down all brain activity while they are at this task.
#
# This will be moved to its own file eventually.
@ -142,14 +137,6 @@ my %fnc_ignore_list = (
"ProgramLocalParameter4fARB" => "ARB_vertex_program",
"ProgramLocalParameter4fvARB" => "ARB_vertex_program",
"ProgramStringARB" => "ARB_vertex_program",
"EGLImageTargetTexture2DOES" => "OES_EGL_image",
"FramebufferTextureOES" => "GL_OES_geometry_shader",
"PatchParameteriOES" => "GL_OES_tessellation_shader",
"PointSizePointerOES" => "GL_OES_point_size_array",
"LockArraysEXT" => "EXT_compiled_vertex_array",
"UnlockArraysEXT" => "EXT_compiled_vertex_array",
"CoverageMaskNV" => "NV_coverage_sample",
"CoverageOperationNV" => "NV_coverage_sample",
"glXCreateContextAttribsARB" => "ARB_create_context_profile",
"wglCreateContextAttribsARB" => "WGL_ARB_create_context_profile",
);
@ -158,9 +145,9 @@ my %regex = (
eofnc => qr/(?:\);?$|^$)/, # )$ | );$ | ^$
extname => qr/^[A-Z][A-Za-z0-9_]+$/,
none => qr/^\(none\)$/,
function => qr/^(.+) ([a-z][a-z0-9_]*) \((.*)\)$/i,
prefix => qr/^(?:[aw]?gl|glX|egl)/, # gl | agl | wgl | glX
tprefix => qr/^(?:[AW]?GL|GLX|EGL)_/, # GL_ | AGL_ | WGL_ | GLX_
function => qr/^(.+) ([a-z][a-z0-9_]*) \((.+)\)$/i,
prefix => qr/^(?:[aw]?gl|glX)/, # gl | agl | wgl | glX
tprefix => qr/^(?:[AW]?GL|GLX)_/, # GL_ | AGL_ | WGL_ | GLX_
section => compile_regex('^(', join('|', @sections), ')$'), # sections in spec
token => qr/^([A-Z0-9][A-Z0-9_x]*):?\s+((?:0x)?[0-9A-Fa-f]+(u(ll)?)?)(|\s[^\?]*)$/, # define tokens
types => compile_regex('\b(', join('|', keys %typemap), ')\b'), # var types
@ -185,7 +172,7 @@ sub normalize_prototype
return $_;
}
# Ugly hack to work around the fact that functions are declared in more
# Ugly hack to work arround the fact that functions are declared in more
# than one spec file.
sub ignore_function($$)
{
@ -258,10 +245,6 @@ sub parse_spec($)
$parms =~ s/$regex{voidtype}/$voidtypemap{$1}/og;
$parms =~ s/GLvoid/void/og;
$parms =~ s/ void\* / void */og;
if ($parms eq "")
{
$parms = "void"; # NVX_progress_fence and others
}
}
# add to functions hash
$functions{$name} = {
@ -328,7 +311,7 @@ my @speclist = ();
my %extensions = ();
my $ext_dir = shift;
my $reg_http = "https://www.khronos.org/registry/OpenGL/extensions/";
my $reg_http = "http://www.opengl.org/registry/specs/";
# Take command line arguments or read list from file
if (@ARGV)
@ -349,7 +332,7 @@ foreach my $spec (sort @speclist)
open EXT, ">$info";
print EXT $ext . "\n"; # Extension name
my $specname = $spec;
$specname =~ s/OpenGL-Registry\/extensions\///;
$specname =~ s/registry\/gl\/specs\///;
print EXT $reg_http . $specname . "\n"; # Extension info URL
print EXT $ext . "\n"; # Extension string
print EXT "\n"; # Resuses nothing by default

View File

@ -1,13 +1,9 @@
#!/usr/bin/env python
#!/usr/bin/python
import re
import sys
from xml.dom.minidom import parse, Node
#
# DOM traversal utility functions
#
def findChildren(node, path):
result = []
if len(path)==1:
@ -25,8 +21,6 @@ def findChildren(node, path):
def findData(node, path):
return [ i.firstChild.data for i in findChildren(node, path) ]
isPointer = re.compile('(.*)([ ]+)([*]+)')
def findParams(node):
n = findData(node, ['name'])[0]
t = ''
@ -35,15 +29,15 @@ def findParams(node):
t += i.data
if i.nodeType==Node.ELEMENT_NODE and i.tagName=='ptype':
t += i.firstChild.data
t.strip()
m = isPointer.match(t)
if m:
t = ('%s%s'%(m.group(1), m.group(3))).strip()
return ( t, n.strip())
return ( t, n)
def findEnums(dom):
return {i.getAttribute('name'): i.getAttribute('value') for i in findChildren(dom, [ 'registry', 'enums', 'enum' ])}
ret = {}
for i in findChildren(dom, [ 'registry', 'enums', 'enum' ]):
n = i.getAttribute('name')
v = i.getAttribute('value')
ret[n] = v
return ret
def findCommands(dom):
ret = {}
@ -57,8 +51,12 @@ def findFeatures(dom):
ret = {}
for i in findChildren(dom, [ 'registry', 'feature' ]):
n = i.getAttribute('name')
e = [j.getAttribute("name") for j in findChildren(i, [ 'require', 'enum' ])]
c = [j.getAttribute("name") for j in findChildren(i, [ 'require', 'command' ])]
e = []
c = []
for j in findChildren(i, [ 'require', 'enum' ]):
e.append(j.getAttribute("name"))
for j in findChildren(i, [ 'require', 'command' ]):
c.append(j.getAttribute("name"))
ret[n] = (e,c)
return ret
@ -66,8 +64,12 @@ def findExtensions(dom):
ret = {}
for i in findChildren(dom, [ 'registry', 'extensions', 'extension' ]):
n = i.getAttribute('name')
e = [j.getAttribute("name") for j in findChildren(i, [ 'require', 'enum' ])]
c = [j.getAttribute("name") for j in findChildren(i, [ 'require', 'command' ])]
e = []
c = []
for j in findChildren(i, [ 'require', 'enum' ]):
e.append(j.getAttribute("name"))
for j in findChildren(i, [ 'require', 'command' ]):
c.append(j.getAttribute("name"))
ret[n] = (e,c)
return ret
@ -78,68 +80,52 @@ def findApi(dom, name):
extensions = findExtensions(dom)
return (enums, commands, features, extensions)
#
#
#
isWGL = re.compile('WGL_([A-Z0-9]+)_.*')
def writeExtension(f, name, extension, enums, commands):
f.write(('%s\n'%name).encode())
url = 'https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf'
m = isWGL.match(name)
if m:
url = 'https://www.khronos.org/registry/OpenGL/extensions/%s/%s.txt'%(m.group(1), name)
f.write(('%s\n'%(url)).encode())
f.write('%s\n'%name)
f.write('%s\n'%'https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf')
if name.find('_VERSION_')==-1:
f.write(('%s\n'%name).encode())
f.write('%s\n'%name)
else:
f.write('\n'.encode())
f.write('\n'.encode())
f.write('\n')
f.write('\n')
enums = [ (j, enums[j]) for j in extension[0] ]
for e in sorted(enums, key=lambda i: i[1]):
f.write(('\t%s %s\n'%(e[0], e[1])).encode())
f.write('\t%s %s\n'%(e[0], e[1]))
commands = [ (j, commands[j]) for j in extension[1] ]
for c in sorted(commands):
params = ', '.join( [ '%s %s'%(j[0].strip(), j[1].strip()) for j in c[1][1] ] )
params = ', '.join( [ '%s %s'%(j[0], j[1]) for j in c[1][1] ] )
if len(params)==0:
params = 'void'
f.write(('\t%s %s (%s)\n'%(c[1][0].strip(), c[0].strip(), params)).encode())
params = ' void '
f.write('\t%s %s (%s)\n'%(c[1][0], c[0], params))
if __name__ == '__main__':
from argparse import ArgumentParser
from optparse import OptionParser
import os
parser = ArgumentParser(description='usage: %prog [options] [XML specs...]')
parser.add_argument("--core", dest="core", help="location for core outputs", default='')
parser.add_argument("--api", dest="name", help="API name: egl, wgl, glx, etc", default='')
parser.add_argument("--extensions", dest="extensions", help="location for extensions outputs", default='')
parser = OptionParser('usage: %prog [options] [XML specs...]')
parser.add_option("--core", dest="core", help="location for core outputs", default='')
parser.add_option("--extensions", dest="extensions", help="location for extensions outputs", default='')
(options, args) = parser.parse_known_args()
options = vars(options)
(options, args) = parser.parse_args()
for i in args:
dom = parse(i)
api = findApi(dom, options['name'])
api = findApi(dom, 'egl')
print('Found {} enums, {} commands, {} features and {} extensions.'.format(
len(api[0]), len(api[1]), len(api[2]), len(api[3])))
if len(options['core']):
if len(options.core):
for i in api[2].keys():
with open(os.path.join(options['core'], i), 'wb') as f:
writeExtension(f, i, api[2][i], api[0], api[1])
f = open('%s/%s'%(options.core, i), 'w')
writeExtension(f, i, api[2][i], api[0], api[1])
f.close()
if len(options['extensions']):
if len(options.extensions):
for i in api[3].keys():
with open(os.path.join(options['extensions'], i), 'wb') as f:
writeExtension(f, i, api[3][i], api[0], api[1])
f = open('%s/%s'%(options.extensions, i), 'w')
writeExtension(f, i, api[3][i], api[0], api[1])
f.close()

View File

@ -1,6 +1,5 @@
#!/usr/bin/env bash
#!/bin/bash
##
## Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##

View File

@ -4,25 +4,11 @@ EXT/vertex_array_set.alt.txt
EXT/vertex_array_set.txt
EXT/nurbs_tessellator.txt
EXT/object_space_tess.txt
MESA/MESA_sampler_objects.txt
SGI/filter4_parameters.txt
SGIS/SGIS_texture_color_mask.txt
SGIX/SGIX_dmbuffer.txt
SGIX/SGIX_instruments.txt
SGIX/SGIX_video_source.txt
SGIX/SGIX_hyperpipe_group.txt
SGIS/texture_color_mask.txt
SGIX/dmbuffer.txt
SGIX/instruments.txt
SGIX/video_source.txt
SGIX/hyperpipe_group.txt
OES/OES_fixed_point.txt
OES/OES_query_matrix.txt
IMG/IMG_user_clip_plane.txt
NV/NV_query_resource.txt
NV/EGL_NV_coverage_sample.txt
OES/OES_draw_elements_base_vertex.txt
OES/OES_viewport_array.txt
OES/EGL_KHR_fence_sync.txt
EXT/EXT_texenv_op.txt
EXT/EXT_transform_feedback2.txt
EXT/EXT_vertex_array_set.txt
EXT/EXT_separate_shader_objects.gles.txt
IGLOO/IGLOO_swap_triangle_strip_vertex_pointerXXX.txt
IGLOO/IGLOO_viewport_offsetXXX.txt
IGLOO/IGLOO_toggle_color_and_lightXXX.txt

View File

@ -1,7 +0,0 @@
EGL_EXT_device_base
https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf
EGL_EXT_device_base
EGL_BAD_DEVICE_EXT 0x322B
EGL_DEVICE_EXT 0x322C
EGL_NO_DEVICE_EXT EGL_CAST(EGLDeviceEXT,0)

View File

@ -1,7 +0,0 @@
EGL_KHR_fence_sync
https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf
EGL_KHR_fence_sync
EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0
EGL_SYNC_CONDITION_KHR 0x30F8
EGL_SYNC_FENCE_KHR 0x30F9

View File

@ -1,6 +0,0 @@
EGL_KHR_image_base
https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf
EGL_KHR_image_base
EGL_IMAGE_PRESERVED_KHR 0x30D2
EGL_NO_IMAGE_KHR EGL_CAST(EGLImageKHR,0)

View File

@ -1,27 +0,0 @@
EGL_KHR_lock_surface3
https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf
EGL_KHR_lock_surface3
EGL_READ_SURFACE_BIT_KHR 0x0001
EGL_WRITE_SURFACE_BIT_KHR 0x0002
EGL_LOCK_SURFACE_BIT_KHR 0x0080
EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100
EGL_MATCH_FORMAT_KHR 0x3043
EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0
EGL_FORMAT_RGB_565_KHR 0x30C1
EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2
EGL_FORMAT_RGBA_8888_KHR 0x30C3
EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4
EGL_LOCK_USAGE_HINT_KHR 0x30C5
EGL_BITMAP_POINTER_KHR 0x30C6
EGL_BITMAP_PITCH_KHR 0x30C7
EGL_BITMAP_ORIGIN_KHR 0x30C8
EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9
EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA
EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB
EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC
EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD
EGL_LOWER_LEFT_KHR 0x30CE
EGL_UPPER_LEFT_KHR 0x30CF
EGL_BITMAP_PIXEL_SIZE_KHR 0x3110
EGLBoolean eglQuerySurface64KHR (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR * value)

View File

@ -1,86 +0,0 @@
EGL_VERSION_1_0
https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf
EGL_FALSE 0
EGL_PBUFFER_BIT 0x0001
EGL_PIXMAP_BIT 0x0002
EGL_WINDOW_BIT 0x0004
EGL_SUCCESS 0x3000
EGL_NOT_INITIALIZED 0x3001
EGL_BAD_ACCESS 0x3002
EGL_BAD_ALLOC 0x3003
EGL_BAD_ATTRIBUTE 0x3004
EGL_BAD_CONFIG 0x3005
EGL_BAD_CONTEXT 0x3006
EGL_BAD_CURRENT_SURFACE 0x3007
EGL_BAD_DISPLAY 0x3008
EGL_BAD_MATCH 0x3009
EGL_BAD_NATIVE_PIXMAP 0x300A
EGL_BAD_NATIVE_WINDOW 0x300B
EGL_BAD_PARAMETER 0x300C
EGL_BAD_SURFACE 0x300D
EGL_BUFFER_SIZE 0x3020
EGL_ALPHA_SIZE 0x3021
EGL_BLUE_SIZE 0x3022
EGL_GREEN_SIZE 0x3023
EGL_RED_SIZE 0x3024
EGL_DEPTH_SIZE 0x3025
EGL_STENCIL_SIZE 0x3026
EGL_CONFIG_CAVEAT 0x3027
EGL_CONFIG_ID 0x3028
EGL_LEVEL 0x3029
EGL_MAX_PBUFFER_HEIGHT 0x302A
EGL_MAX_PBUFFER_PIXELS 0x302B
EGL_MAX_PBUFFER_WIDTH 0x302C
EGL_NATIVE_RENDERABLE 0x302D
EGL_NATIVE_VISUAL_ID 0x302E
EGL_NATIVE_VISUAL_TYPE 0x302F
EGL_SAMPLES 0x3031
EGL_SAMPLE_BUFFERS 0x3032
EGL_SURFACE_TYPE 0x3033
EGL_TRANSPARENT_TYPE 0x3034
EGL_TRANSPARENT_BLUE_VALUE 0x3035
EGL_TRANSPARENT_GREEN_VALUE 0x3036
EGL_TRANSPARENT_RED_VALUE 0x3037
EGL_NONE 0x3038
EGL_SLOW_CONFIG 0x3050
EGL_NON_CONFORMANT_CONFIG 0x3051
EGL_TRANSPARENT_RGB 0x3052
EGL_VENDOR 0x3053
EGL_VERSION 0x3054
EGL_EXTENSIONS 0x3055
EGL_HEIGHT 0x3056
EGL_WIDTH 0x3057
EGL_LARGEST_PBUFFER 0x3058
EGL_DRAW 0x3059
EGL_READ 0x305A
EGL_CORE_NATIVE_ENGINE 0x305B
EGL_TRUE 1
EGL_NO_CONTEXT EGL_CAST(EGLContext,0)
EGL_NO_DISPLAY EGL_CAST(EGLDisplay,0)
EGL_NO_SURFACE EGL_CAST(EGLSurface,0)
EGL_DONT_CARE EGL_CAST(EGLint,-1)
EGLBoolean eglChooseConfig (EGLDisplay dpy, const EGLint * attrib_list, EGLConfig * configs, EGLint config_size, EGLint * num_config)
EGLBoolean eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target)
EGLContext eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint * attrib_list)
EGLSurface eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint * attrib_list)
EGLSurface eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint * attrib_list)
EGLSurface eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint * attrib_list)
EGLBoolean eglDestroyContext (EGLDisplay dpy, EGLContext ctx)
EGLBoolean eglDestroySurface (EGLDisplay dpy, EGLSurface surface)
EGLBoolean eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint * value)
EGLBoolean eglGetConfigs (EGLDisplay dpy, EGLConfig * configs, EGLint config_size, EGLint * num_config)
EGLDisplay eglGetCurrentDisplay ( void )
EGLSurface eglGetCurrentSurface (EGLint readdraw)
EGLDisplay eglGetDisplay (EGLNativeDisplayType display_id)
EGLint eglGetError ( void )
EGLBoolean eglInitialize (EGLDisplay dpy, EGLint * major, EGLint * minor)
EGLBoolean eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
EGLBoolean eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint * value)
const char * eglQueryString (EGLDisplay dpy, EGLint name)
EGLBoolean eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint * value)
EGLBoolean eglSwapBuffers (EGLDisplay dpy, EGLSurface surface)
EGLBoolean eglTerminate (EGLDisplay dpy)
EGLBoolean eglWaitGL ( void )
EGLBoolean eglWaitNative (EGLint engine)

View File

@ -1,22 +0,0 @@
EGL_VERSION_1_1
https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf
EGL_CONTEXT_LOST 0x300E
EGL_BIND_TO_TEXTURE_RGB 0x3039
EGL_BIND_TO_TEXTURE_RGBA 0x303A
EGL_MIN_SWAP_INTERVAL 0x303B
EGL_MAX_SWAP_INTERVAL 0x303C
EGL_NO_TEXTURE 0x305C
EGL_TEXTURE_RGB 0x305D
EGL_TEXTURE_RGBA 0x305E
EGL_TEXTURE_2D 0x305F
EGL_TEXTURE_FORMAT 0x3080
EGL_TEXTURE_TARGET 0x3081
EGL_MIPMAP_TEXTURE 0x3082
EGL_MIPMAP_LEVEL 0x3083
EGL_BACK_BUFFER 0x3084
EGLBoolean eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer)
EGLBoolean eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer)
EGLBoolean eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value)
EGLBoolean eglSwapInterval (EGLDisplay dpy, EGLint interval)

View File

@ -1,38 +0,0 @@
EGL_VERSION_1_2
https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf
EGL_OPENGL_ES_BIT 0x0001
EGL_OPENVG_BIT 0x0002
EGL_LUMINANCE_SIZE 0x303D
EGL_ALPHA_MASK_SIZE 0x303E
EGL_COLOR_BUFFER_TYPE 0x303F
EGL_RENDERABLE_TYPE 0x3040
EGL_SINGLE_BUFFER 0x3085
EGL_RENDER_BUFFER 0x3086
EGL_COLORSPACE 0x3087
EGL_ALPHA_FORMAT 0x3088
EGL_COLORSPACE_sRGB 0x3089
EGL_COLORSPACE_LINEAR 0x308A
EGL_ALPHA_FORMAT_NONPRE 0x308B
EGL_ALPHA_FORMAT_PRE 0x308C
EGL_CLIENT_APIS 0x308D
EGL_RGB_BUFFER 0x308E
EGL_LUMINANCE_BUFFER 0x308F
EGL_HORIZONTAL_RESOLUTION 0x3090
EGL_VERTICAL_RESOLUTION 0x3091
EGL_PIXEL_ASPECT_RATIO 0x3092
EGL_SWAP_BEHAVIOR 0x3093
EGL_BUFFER_PRESERVED 0x3094
EGL_BUFFER_DESTROYED 0x3095
EGL_OPENVG_IMAGE 0x3096
EGL_CONTEXT_CLIENT_TYPE 0x3097
EGL_OPENGL_ES_API 0x30A0
EGL_OPENVG_API 0x30A1
EGL_DISPLAY_SCALING 10000
EGL_UNKNOWN EGL_CAST(EGLint,-1)
EGLBoolean eglBindAPI (EGLenum api)
EGLSurface eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint * attrib_list)
EGLenum eglQueryAPI ( void )
EGLBoolean eglReleaseThread ( void )
EGLBoolean eglWaitClient ( void )

View File

@ -1,16 +0,0 @@
EGL_VERSION_1_3
https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf
EGL_OPENGL_ES2_BIT 0x0004
EGL_VG_COLORSPACE_LINEAR_BIT 0x0020
EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040
EGL_MATCH_NATIVE_PIXMAP 0x3041
EGL_CONFORMANT 0x3042
EGL_VG_COLORSPACE 0x3087
EGL_VG_ALPHA_FORMAT 0x3088
EGL_VG_COLORSPACE_sRGB 0x3089
EGL_VG_COLORSPACE_LINEAR 0x308A
EGL_VG_ALPHA_FORMAT_NONPRE 0x308B
EGL_VG_ALPHA_FORMAT_PRE 0x308C
EGL_CONTEXT_CLIENT_VERSION 0x3098

View File

@ -1,13 +0,0 @@
EGL_VERSION_1_4
https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf
EGL_OPENGL_BIT 0x0008
EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200
EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400
EGL_MULTISAMPLE_RESOLVE 0x3099
EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A
EGL_MULTISAMPLE_RESOLVE_BOX 0x309B
EGL_OPENGL_API 0x30A2
EGL_DEFAULT_DISPLAY EGL_CAST(EGLNativeDisplayType,0)
EGLContext eglGetCurrentContext ( void )

View File

@ -1,59 +0,0 @@
EGL_VERSION_1_5
https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf
EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001
EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002
EGL_OPENGL_ES3_BIT 0x00000040
EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001
EGL_GL_COLORSPACE_SRGB 0x3089
EGL_GL_COLORSPACE_LINEAR 0x308A
EGL_CONTEXT_MAJOR_VERSION 0x3098
EGL_CL_EVENT_HANDLE 0x309C
EGL_GL_COLORSPACE 0x309D
EGL_GL_TEXTURE_2D 0x30B1
EGL_GL_TEXTURE_3D 0x30B2
EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3
EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4
EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5
EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6
EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7
EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8
EGL_GL_RENDERBUFFER 0x30B9
EGL_GL_TEXTURE_LEVEL 0x30BC
EGL_GL_TEXTURE_ZOFFSET 0x30BD
EGL_IMAGE_PRESERVED 0x30D2
EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0
EGL_SYNC_STATUS 0x30F1
EGL_SIGNALED 0x30F2
EGL_UNSIGNALED 0x30F3
EGL_TIMEOUT_EXPIRED 0x30F5
EGL_CONDITION_SATISFIED 0x30F6
EGL_SYNC_TYPE 0x30F7
EGL_SYNC_CONDITION 0x30F8
EGL_SYNC_FENCE 0x30F9
EGL_CONTEXT_MINOR_VERSION 0x30FB
EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD
EGL_SYNC_CL_EVENT 0x30FE
EGL_SYNC_CL_EVENT_COMPLETE 0x30FF
EGL_CONTEXT_OPENGL_DEBUG 0x31B0
EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1
EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2
EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2
EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD
EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD
EGL_NO_RESET_NOTIFICATION 0x31BE
EGL_LOSE_CONTEXT_ON_RESET 0x31BF
EGL_FOREVER 0xFFFFFFFFFFFFFFFF
EGL_NO_IMAGE EGL_CAST(EGLImage,0)
EGL_NO_SYNC EGL_CAST(EGLSync,0)
EGLint eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout)
EGLImage eglCreateImage (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib * attrib_list)
EGLSurface eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void * native_pixmap, const EGLAttrib * attrib_list)
EGLSurface eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void * native_window, const EGLAttrib * attrib_list)
EGLSync eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib * attrib_list)
EGLBoolean eglDestroyImage (EGLDisplay dpy, EGLImage image)
EGLBoolean eglDestroySync (EGLDisplay dpy, EGLSync sync)
EGLDisplay eglGetPlatformDisplay (EGLenum platform, void * native_display, const EGLAttrib * attrib_list)
EGLBoolean eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib * value)
EGLBoolean eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags)

View File

@ -0,0 +1,23 @@
GLX_AMD_gpu_association
http://www.opengl.org/registry/specs/AMD/glx_gpu_association.txt
GLX_AMD_gpu_association
GLX_GPU_VENDOR_AMD 0x1F00
GLX_GPU_RENDERER_STRING_AMD 0x1F01
GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
GLX_GPU_RAM_AMD 0x21A3
GLX_GPU_CLOCK_AMD 0x21A4
GLX_GPU_NUM_PIPES_AMD 0x21A5
GLX_GPU_NUM_SIMD_AMD 0x21A6
GLX_GPU_NUM_RB_AMD 0x21A7
GLX_GPU_NUM_SPI_AMD 0x21A8
void glXBlitContextFramebufferAMD (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
GLXContext glXCreateAssociatedContextAMD (unsigned int id, GLXContext share_list)
GLXContext glXCreateAssociatedContextAttribsAMD (unsigned int id, GLXContext share_context, const int* attribList)
Bool glXDeleteAssociatedContextAMD (GLXContext ctx)
unsigned int glXGetContextGPUIDAMD (GLXContext ctx)
GLXContext glXGetCurrentAssociatedContextAMD (void)
unsigned int glXGetGPUIDsAMD (unsigned int maxCount, unsigned int* ids)
int glXGetGPUInfoAMD (unsigned int id, int property, GLenum dataType, unsigned int size, void* data)
Bool glXMakeAssociatedContextCurrentAMD (GLXContext ctx)

View File

@ -0,0 +1,5 @@
GLX_EXT_create_context_es2_profile
http://www.opengl.org/registry/specs/EXT/glx_create_context_es2_profile.txt
GLX_EXT_create_context_es2_profile
GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004

View File

@ -0,0 +1,5 @@
GLX_EXT_create_context_es_profile
http://www.opengl.org/registry/specs/EXT/glx_create_context_es_profile.txt
GLX_EXT_create_context_es_profile
GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004

View File

@ -0,0 +1,6 @@
GLX_EXT_fbconfig_packed_float
http://developer.download.nvidia.com/opengl/specs/GL_EXT_packed_float.txt
GLX_EXT_fbconfig_packed_float
GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008

View File

@ -0,0 +1,5 @@
GLX_EXT_framebuffer_sRGB
http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt
GLX_EXT_framebuffer_sRGB
GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2

View File

@ -1,4 +0,0 @@
GLX_EXT_scene_marker
https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_scene_marker.txt
GLX_EXT_scene_marker

View File

@ -0,0 +1,6 @@
GLX_MESA_swap_control
http://cgit.freedesktop.org/mesa/mesa/plain/docs/MESA_swap_control.spec
GLX_MESA_swap_control
int glXGetSwapIntervalMESA (void)
int glXSwapIntervalMESA (unsigned int interval)

View File

@ -0,0 +1,5 @@
GLX_NV_float_buffer
http://cvs1.nvidia.com/inc/GL/glxtokens.h
GLX_NV_float_buffer
GLX_FLOAT_COMPONENTS_NV 0x20B0

View File

@ -1,4 +0,0 @@
GLX_SGIS_color_range
https://www.khronos.org/registry/OpenGL/extensions/SGIS/GLX_SGIS_color_range.txt
GLX_SGIS_color_range

View File

@ -0,0 +1,6 @@
GLX_SGIS_shared_multisample
GLX_SGIS_shared_multisample
GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027

View File

@ -0,0 +1,6 @@
GLX_SGIX_swap_barrier
http://oss.sgi.com/projects/ogl-sample/registry/SGIX/swap_barrier.txt
GLX_SGIX_swap_barrier
void glXBindSwapBarrierSGIX (Display *dpy, GLXDrawable drawable, int barrier)
Bool glXQueryMaxSwapBarriersSGIX (Display *dpy, int screen, int *max)

View File

@ -0,0 +1,5 @@
GLX_SGIX_swap_group
http://oss.sgi.com/projects/ogl-sample/registry/SGIX/swap_group.txt
GLX_SGIX_swap_group
void glXJoinSwapGroupSGIX (Display *dpy, GLXDrawable drawable, GLXDrawable member)

View File

@ -0,0 +1,6 @@
GLX_SGI_video_sync
http://www.opengl.org/registry/specs/SGI/video_sync.txt
GLX_SGI_video_sync
int glXGetVideoSyncSGI (unsigned int* count)
int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int* count)

View File

@ -9,6 +9,13 @@ GL_EXT_memory_object
GL_TILING_TYPES_EXT 0x9583
GL_OPTIMAL_TILING_EXT 0x9584
GL_LINEAR_TILING_EXT 0x9585
GL_LAYOUT_GENERAL_EXT 0x958D
GL_LAYOUT_COLOR_ATTACHMENT_EXT 0x958E
GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F
GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590
GL_LAYOUT_SHADER_READ_ONLY_EXT 0x9591
GL_LAYOUT_TRANSFER_SRC_EXT 0x9592
GL_LAYOUT_TRANSFER_DST_EXT 0x9593
GL_NUM_DEVICE_UUIDS_EXT 0x9596
GL_DEVICE_UUID_EXT 0x9597
GL_DRIVER_UUID_EXT 0x9598

View File

@ -1,6 +0,0 @@
GL_EXT_scene_marker
https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_scene_marker.txt
GL_EXT_scene_marker
void glBeginSceneEXT (void)
void glEndSceneEXT (void)

View File

@ -2,16 +2,6 @@ GL_EXT_semaphore
http://www.opengl.org/registry/specs/EXT/external_objects.txt
GL_EXT_semaphore
GL_LAYOUT_GENERAL_EXT 0x958D
GL_LAYOUT_COLOR_ATTACHMENT_EXT 0x958E
GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F
GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590
GL_LAYOUT_SHADER_READ_ONLY_EXT 0x9591
GL_LAYOUT_TRANSFER_SRC_EXT 0x9592
GL_LAYOUT_TRANSFER_DST_EXT 0x9593
GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT 0x9530
GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT 0x9531
void glDeleteSemaphoresEXT (GLsizei n, const GLuint* semaphores)
void glGenSemaphoresEXT (GLsizei n, GLuint* semaphores)
void glGetSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, GLuint64* params)

View File

@ -1,7 +0,0 @@
GL_KHR_context_flush_control
https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_context_flush_control.txt
GL_KHR_context_flush_control
GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB
GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC

View File

@ -1,15 +0,0 @@
GL_NV_sample_locations
https://www.khronos.org/registry/OpenGL/extensions/NV/NV_sample_locations.txt
GL_NV_sample_locations
GL_SAMPLE_LOCATION_NV 0x8E50
GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D
GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E
GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F
GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340
GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341
GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342
GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343
void glFramebufferSampleLocationsfvNV (GLenum target, GLuint start, GLsizei count, const GLfloat* v)
void glNamedFramebufferSampleLocationsfvNV (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v)
void glResolveDepthValuesNV (void)

View File

@ -89,7 +89,7 @@ http://www.opengl.org/documentation/specs/version2.0/glspec20.pdf
void glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha)
void glDrawBuffers (GLsizei n, const GLenum* bufs)
void glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass)
void glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask)
void glStencilFuncSeparate (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask)
void glStencilMaskSeparate (GLenum face, GLuint mask)
void glAttachShader (GLuint program, GLuint shader)
void glBindAttribLocation (GLuint program, GLuint index, const GLchar* name)

View File

@ -0,0 +1,13 @@
WGL_ARB_create_context
http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt
WGL_ARB_create_context
WGL_CONTEXT_DEBUG_BIT_ARB 0x0001
WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
WGL_CONTEXT_FLAGS_ARB 0x2094
ERROR_INVALID_VERSION_ARB 0x2095
ERROR_INVALID_PROFILE_ARB 0x2096
HGLRC wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int* attribList)

View File

@ -0,0 +1,5 @@
WGL_ATI_render_texture_rectangle
WGL_ATI_render_texture_rectangle
WGL_TEXTURE_RECTANGLE_ATI 0x21A5

View File

@ -0,0 +1,5 @@
WGL_EXT_create_context_es2_profile
http://www.opengl.org/registry/specs/EXT/wgl_create_context_es2_profile.txt
WGL_EXT_create_context_es2_profile
WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004

View File

@ -0,0 +1,5 @@
WGL_EXT_create_context_es_profile
http://www.opengl.org/registry/specs/EXT/wgl_create_context_es_profile.txt
WGL_EXT_create_context_es_profile
WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004

View File

@ -0,0 +1,5 @@
WGL_EXT_framebuffer_sRGB
http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt
WGL_EXT_framebuffer_sRGB
WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9

View File

@ -0,0 +1,5 @@
WGL_EXT_pixel_format_packed_float
http://developer.download.nvidia.com/opengl/specs/GL_EXT_packed_float.txt
WGL_EXT_pixel_format_packed_float
WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8

View File

@ -0,0 +1,6 @@
WGL_NV_vertex_array_range
http://oss.sgi.com/projects/ogl-sample/registry/NV/vertex_array_range.txt
WGL_NV_vertex_array_range
void * wglAllocateMemoryNV (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority)
void wglFreeMemoryNV (void *pointer)

View File

@ -88,7 +88,7 @@ terminated with a semicolon.
<h3>Custom Code Generation</h3>
<p>
Starting from GLEW 1.3.0, it is possible to control which extensions
to include in the library by specifying a list in
to include in the libarary by specifying a list in
<tt>auto/custom.txt</tt>. This is useful when you do not need all the
extensions and would like to reduce the size of the source files.
Type <tt>make clean; make custom</tt> in the <tt>auto</tt> directory

View File

@ -13,7 +13,7 @@ Mac OS X, FreeBSD, Irix, and Solaris.
<a href="http://sourceforge.net/projects/glew/">GLEW</a> is distributed
as source and precompiled binaries.<br/>
The latest release is
<a href="https://github.com/nigels-com/glew/releases/tag/glew-2.2.0">2.2.0</a>[03-15-20]:
<a href="https://sourceforge.net/projects/glew/files/glew/2.1.0/">2.1.0</a>[07-31-17]:
</p>
<p>
</p>
@ -27,8 +27,8 @@ The latest release is
<td align="right"><b>Source</b></td>
<td></td>
<td align="left">
<a href="https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.zip">ZIP</a>&nbsp;|&nbsp;
<a href="https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.tgz">TGZ</a></td>
<a href="https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.zip/download">ZIP</a>&nbsp;|&nbsp;
<a href="https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.tgz/download">TGZ</a></td>
<td></td>
</tr>
<tr>
@ -36,7 +36,7 @@ The latest release is
<td align="right"><b>Binaries</b></td>
<td></td>
<td align="left">
<a href="https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0-win32.zip">Windows 32-bit and 64-bit</a>
<a href="https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0-win32.zip/download">Windows 32-bit and 64-bit</a>
</td>
<td></td>
</tr>
@ -65,9 +65,8 @@ The latest release contains support for OpenGL 4.6, compatibility and forward-co
<h2>News</h2>
<ul>
<li>[03-15-20] <a href="https://github.com/nigels-com/glew/releases/tag/glew-2.2.0">GLEW 2.2.0</a> new extensions and minor bug fixes</li>
<li>[07-31-17] <a href="https://github.com/nigels-com/glew/releases/tag/glew-2.1.0">GLEW 2.1.0</a> adds support for OpenGL 4.6, new extensions and minor bug fixes</li>
<li>[07-24-16] <a href="https://github.com/nigels-com/glew/releases/tag/glew-2.0.0">GLEW 2.0.0</a> adds support for forward-compatible contexts, adds new extensions, OSMesa and EGL support, MX discontinued and minor bug fixes</li>
<li>[07-31-17] <a href="https://sourceforge.net/projects/glew/files/glew/2.1.0/">GLEW 2.1.0</a> adds support for OpenGL 4.6, new extensions and minor bug fixes</li>
<li>[07-24-16] <a href="https://sourceforge.net/projects/glew/files/glew/2.0.0/">GLEW 2.0.0</a> adds support for forward-compatible contexts, adds new extensions, OSMesa and EGL support, MX discontinued and minor bug fixes</li>
<li>[08-10-15] <a href="https://sourceforge.net/projects/glew/files/glew/1.13.0/">GLEW 1.13.0</a> adds support for new extensions, fixes minor bugs</li>
<li>[26-01-15] <a href="https://sourceforge.net/projects/glew/files/glew/1.12.0/">GLEW 1.12.0</a> fixes minor bugs and adds new extensions</li>
<li>[08-11-14] <a href="https://sourceforge.net/projects/glew/files/glew/1.11.0/">GLEW 1.11.0</a> adds support for OpenGL 4.5, new extensions</li>

View File

@ -1,188 +1,5 @@
<h2>Change Log</h2>
<hr align="center">
<ul class="none">
<li><b>2.2.0</b> [03-15-20]
<ul>
<li> Bug fixes:
<ul>
<li> GL_EXT_semaphore constants
<li> Some const pointer fixups in OpenGL API
<li> Correction for GLEW_VERSION_4_5
<li> Windows build updates and fixes
</ul>
</ul>
<ul>
<li> New extensions:
<ul>
<li> GL_AMD_framebuffer_multisample_advanced
<li> GL_AMD_gpu_shader_half_float_fetch
<li> GL_AMD_shader_image_load_store_lod
<li> GL_ARM_texture_unnormalized_coordinates
<li> GL_DMP_program_binary
<li> GL_DMP_shader_binary
<li> GL_EXT_EGL_image_external_wrap_modes
<li> GL_EXT_EGL_image_storage
<li> GL_EXT_EGL_sync
<li> GL_EXT_clip_control
<li> GL_EXT_depth_clamp
<li> GL_EXT_disjoint_timer_query
<li> GL_EXT_draw_transform_feedback
<li> GL_EXT_multiview_tessellation_geometry_shader
<li> GL_EXT_multiview_texture_multisample
<li> GL_EXT_multiview_timer_query
<li> GL_EXT_occlusion_query_boolean
<li> GL_EXT_primitive_bounding_box
<li> GL_EXT_protected_textures
<li> GL_EXT_robustness
<li> GL_EXT_shader_framebuffer_fetch_non_coherent
<li> GL_EXT_static_vertex_array
<li> GL_EXT_tessellation_point_size
<li> GL_EXT_tessellation_shader
<li> GL_EXT_texture_border_clamp
<li> GL_EXT_texture_buffer
<li> GL_EXT_texture_compression_s3tc_srgb
<li> GL_EXT_texture_format_sRGB_override
<li> GL_EXT_texture_mirror_clamp_to_edge
<li> GL_EXT_texture_query_lod
<li> GL_EXT_texture_shadow_lod
<li> GL_FJ_shader_binary_GCCSO
<li> GL_IMG_bindless_texture
<li> GL_IMG_framebuffer_downsample
<li> GL_IMG_multisampled_render_to_texture
<li> GL_IMG_program_binary
<li> GL_IMG_read_format
<li> GL_IMG_shader_binary
<li> GL_IMG_texture_compression_pvrtc
<li> GL_IMG_texture_compression_pvrtc2
<li> GL_IMG_texture_env_enhanced_fixed_function
<li> GL_IMG_texture_filter_cubic
<li> GL_INTEL_blackhole_render
<li> GL_INTEL_shader_integer_functions2
<li> GL_KHR_shader_subgroup
<li> GL_MESA_framebuffer_flip_y
<li> GL_MESA_program_binary_formats
<li> GL_MESA_tile_raster_order
<li> GL_NVX_gpu_multicast2
<li> GL_NVX_progress_fence
<li> GL_NV_compute_shader_derivatives
<li> GL_NV_conservative_raster_pre_snap
<li> GL_NV_conservative_raster_underestimation
<li> GL_NV_depth_nonlinear
<li> GL_NV_fragment_shader_barycentric
<li> GL_NV_memory_attachment
<li> GL_NV_mesh_shader
<li> GL_NV_query_resource_tag
<li> GL_NV_read_buffer
<li> GL_NV_read_buffer_front
<li> GL_NV_representative_fragment_test
<li> GL_NV_scissor_exclusive
<li> GL_NV_shader_subgroup_partitioned
<li> GL_NV_shader_texture_footprint
<li> GL_NV_shading_rate_image
<li> GL_NV_vdpau_interop2
<li> GL_OES_EGL_image
<li> GL_OES_EGL_image_external
<li> GL_OES_EGL_image_external_essl3
<li> GL_OES_blend_equation_separate
<li> GL_OES_blend_func_separate
<li> GL_OES_blend_subtract
<li> GL_OES_compressed_ETC1_RGB8_texture
<li> GL_OES_compressed_paletted_texture
<li> GL_OES_copy_image
<li> GL_OES_depth24
<li> GL_OES_depth32
<li> GL_OES_depth_texture
<li> GL_OES_depth_texture_cube_map
<li> GL_OES_draw_buffers_indexed
<li> GL_OES_draw_texture
<li> GL_OES_element_index_uint
<li> GL_OES_extended_matrix_palette
<li> GL_OES_fbo_render_mipmap
<li> GL_OES_fragment_precision_high
<li> GL_OES_framebuffer_object
<li> GL_OES_geometry_point_size
<li> GL_OES_geometry_shader
<li> GL_OES_get_program_binary
<li> GL_OES_gpu_shader5
<li> GL_OES_mapbuffer
<li> GL_OES_matrix_get
<li> GL_OES_matrix_palette
<li> GL_OES_packed_depth_stencil
<li> GL_OES_point_size_array
<li> GL_OES_point_sprite
<li> GL_OES_read_format
<li> GL_OES_required_internalformat
<li> GL_OES_rgb8_rgba8
<li> GL_OES_sample_shading
<li> GL_OES_sample_variables
<li> GL_OES_shader_image_atomic
<li> GL_OES_shader_io_blocks
<li> GL_OES_shader_multisample_interpolation
<li> GL_OES_single_precision
<li> GL_OES_standard_derivatives
<li> GL_OES_stencil1
<li> GL_OES_stencil4
<li> GL_OES_stencil8
<li> GL_OES_surfaceless_context
<li> GL_OES_tessellation_point_size
<li> GL_OES_tessellation_shader
<li> GL_OES_texture_3D
<li> GL_OES_texture_border_clamp
<li> GL_OES_texture_buffer
<li> GL_OES_texture_compression_astc
<li> GL_OES_texture_cube_map
<li> GL_OES_texture_cube_map_array
<li> GL_OES_texture_env_crossbar
<li> GL_OES_texture_mirrored_repeat
<li> GL_OES_texture_npot
<li> GL_OES_texture_stencil8
<li> GL_OES_texture_storage_multisample_2d_array
<li> GL_OES_texture_view
<li> GL_OES_vertex_array_object
<li> GL_OES_vertex_half_float
<li> GL_OES_vertex_type_10_10_10_2
<li> GL_QCOM_YUV_texture_gather
<li> GL_QCOM_shader_framebuffer_fetch_rate
<li> GL_QCOM_texture_foveated
<li> GL_QCOM_texture_foveated_subsampled_layout
<li> GL_VIV_shader_binary
<li> EGL_ANDROID_GLES_layers
<li> EGL_ANDROID_get_frame_timestamps
<li> EGL_ANDROID_get_native_client_buffer
<li> EGL_ARM_image_format
<li> EGL_EXT_bind_to_front
<li> EGL_EXT_client_sync
<li> EGL_EXT_compositor
<li> EGL_EXT_gl_colorspace_display_p3
<li> EGL_EXT_gl_colorspace_display_p3_linear
<li> EGL_EXT_gl_colorspace_display_p3_passthrough
<li> EGL_EXT_gl_colorspace_scrgb
<li> EGL_EXT_image_gl_colorspace
<li> EGL_EXT_image_implicit_sync_control
<li> EGL_EXT_surface_CTA861_3_metadata
<li> EGL_EXT_sync_reuse
<li> EGL_KHR_display_reference
<li> EGL_MESA_query_driver
<li> EGL_NV_context_priority_realtime
<li> EGL_NV_quadruple_buffer
<li> EGL_NV_stream_dma
<li> EGL_NV_stream_flush
<li> EGL_NV_stream_origin
<li> EGL_NV_triple_buffer
<li> EGL_WL_bind_wayland_display
<li> EGL_WL_create_wayland_buffer_from_image
<li> GLX_EXT_context_priority
<li> GLX_EXT_no_config_context
<li> GLX_NV_multigpu_context
<li> WGL_NV_multigpu_context
</ul>
</ul>
</ul>
<hr align="center">
<ul class="none">
<li><b>2.1.0</b> [07-31-17]
@ -198,7 +15,7 @@
<ul>
<li> Bug fixes:
<ul>
<li> Resolved crash when glXGetCurrentDisplay() is NULL
<li> Resovled crash when glXGetCurrentDisplay() is NULL
<li> CMake: only install PDB files with MSVC
<li> wglGetProcAddress crash with NOGDI defined
<li> Mac: using -Os rather than -O2
@ -927,7 +744,7 @@
</ul>
<li> Bug fixes:
<ul>
<li> Incorrect 64-bit type definitions
<li> Incorrent 64-bit type definitions
<li> Do not strip static library on install
<li> Missing tokens in GL_ATI_fragment_shader and WGL_{ARB,EXT}_make_current_read
<li> Missing tokens in GL_VERSION_2_1
@ -975,7 +792,7 @@ corruption of their values
<li> Missing include guards in glxew.h
<li> Makefile and install problems for Cygwin builds
<li> Install problem for Linux AMD64 builds
<li> Incorrect token in GL_ATI_texture_compression_3dc
<li> Incorrent token in GL_ATI_texture_compression_3dc
<li> Missing tokens from GL_ATIX_point_sprites
</ul>
</ul>

View File

@ -27,11 +27,7 @@
#include <KHR/khrplatform.h>
#include <EGL/eglplatform.h>
#ifndef GLEW_INCLUDE
# include <GL/glew.h>
#else
# include GLEW_INCLUDE
#endif
#include <GL/glew.h>
#ifdef __cplusplus
extern "C" {
@ -76,12 +72,6 @@ typedef khronos_utime_nanoseconds_t EGLuint64NV;
typedef khronos_stime_nanoseconds_t EGLnsecsANDROID;
struct EGLClientPixmapHI;
struct AHardwareBuffer;
/* Wayland types for WL_bind_wayland_display purposes */
struct wl_buffer;
struct wl_display;
struct wl_resource;
#define EGL_DONT_CARE ((EGLint)-1)

View File

@ -19,7 +19,7 @@
//
// Version
//
VS_VERSION_INFO VERSIONINFO
VS_VERSION_INFO VERSIONINFO
FILEVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0
PRODUCTVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
@ -40,9 +40,8 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments",
VALUE "Comments",
"The OpenGL Extension Wrangler Library\r\n"
"Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>\r\n"
"Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>\r\n"
"Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>\r\n"
"Copyright (C) 2002, Lev Povalahev\r\n"
@ -120,7 +119,7 @@ BEGIN
VALUE "FileDescription", "The OpenGL Extension Wrangler Library\0"
VALUE "FileVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0"
VALUE "InternalName", "GLEW\0"
VALUE "LegalCopyright", "(C) 2002-2019 Nigel Stewart & Milan Ikits & Marcelo Magallon\0"
VALUE "LegalCopyright", "© 2002-2008 Milan Ikits & Marcelo Magallon\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", FILENAME "\0"
VALUE "PrivateBuild", "\0"

View File

@ -1,20 +1,12 @@
#ifndef GLEW_INCLUDE
# include <GL/glew.h>
#include <GL/glew.h>
#else
# include GLEW_INCLUDE
#include GLEW_INCLUDE
#endif
#if defined(GLEW_OSMESA)
# define GLAPI extern
# ifndef APIENTRY
# define APIENTRY
# define GLEW_APIENTRY_DEFINED
# endif
# include <GL/osmesa.h>
# ifdef GLEW_APIENTRY_DEFINED
# undef APIENTRY
# undef GLEW_APIENTRY_DEFINED
# endif
#elif defined(GLEW_EGL)
# include <GL/eglew.h>
#elif defined(_WIN32)
@ -36,7 +28,7 @@
#if defined(GLEW_EGL)
#elif defined(GLEW_REGAL)
/* In GLEW_REGAL mode we call directly into the linked
/* In GLEW_REGAL mode we call direcly into the linked
libRegal.so glGetProcAddressREGAL for looking up
the GL function pointers. */
@ -78,7 +70,7 @@ void* dlGetProcAddress (const GLubyte* name)
#include <string.h>
#include <AvailabilityMacros.h>
#if defined(MAC_OS_X_VERSION_10_3) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
#ifdef MAC_OS_X_VERSION_10_3
#include <dlfcn.h>
@ -128,7 +120,7 @@ void* NSGLGetProcAddress (const GLubyte *name)
return NULL;
#endif
}
#endif /* defined(MAC_OS_X_VERSION_10_3) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 */
#endif /* MAC_OS_X_VERSION_10_3 */
#endif /* __APPLE__ */
/*
@ -229,7 +221,7 @@ static GLboolean _glewStrSame1 (const GLubyte** a, GLuint* na, const GLubyte* b,
if(*na >= nb)
{
GLuint i=0;
while (i < nb && (*a)[i] == b[i]) i++;
while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++;
if(i == nb)
{
*a = *a + nb;
@ -245,7 +237,7 @@ static GLboolean _glewStrSame2 (const GLubyte** a, GLuint* na, const GLubyte* b,
if(*na >= nb)
{
GLuint i=0;
while (i < nb && (*a)[i] == b[i]) i++;
while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++;
if(i == nb)
{
*a = *a + nb;
@ -261,7 +253,7 @@ static GLboolean _glewStrSame3 (const GLubyte** a, GLuint* na, const GLubyte* b,
if(*na >= nb)
{
GLuint i=0;
while (i < nb && (*a)[i] == b[i]) i++;
while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++;
if (i == nb && (*na == nb || (*a)[i] == ' ' || (*a)[i] == '\n' || (*a)[i] == '\r' || (*a)[i] == '\t'))
{
*a = *a + nb;

View File

@ -2,7 +2,7 @@
#define __glew_h__
#define __GLEW_H__
#if defined(__gl_h_) || defined(__GL_H__) || defined(_GL_H) || defined(__gl_gl_h_) || defined(__X_GL_H)
#if defined(__gl_h_) || defined(__GL_H__) || defined(_GL_H) || defined(__X_GL_H)
#error gl.h included before glew.h
#endif
#if defined(__gl2_h_)
@ -14,7 +14,7 @@
#if defined(__REGAL_H__)
#error Regal.h included before glew.h
#endif
#if defined(__glext_h_) || defined(__GLEXT_H_) || defined(__gl_glext_h_)
#if defined(__glext_h_) || defined(__GLEXT_H_)
#error glext.h included before glew.h
#endif
#if defined(__gl_ATI_h_)
@ -25,13 +25,11 @@
#define __gl2_h_
#define __GL_H__
#define _GL_H
#define __gl_gl_h_
#define __gltypes_h_
#define __REGAL_H__
#define __X_GL_H
#define __glext_h_
#define __GLEXT_H_
#define __gl_glext_h_
#define __gl_ATI_h_
#if defined(_WIN32)
@ -63,6 +61,11 @@
# define APIENTRY
# endif
#endif
#ifndef GLAPI
# if defined(__MINGW32__) || defined(__CYGWIN__)
# define GLAPI extern
# endif
#endif
/* <winnt.h> */
#ifndef CALLBACK
#define GLEW_CALLBACK_DEFINED
@ -136,26 +139,15 @@ typedef _W64 int ptrdiff_t;
* (mem, 2004-01-04)
*/
#if defined(__APPLE__) || defined(__linux__)
# if defined(__cplusplus)
# include <cstddef>
# include <cstdint>
# else
# include <stddef.h>
# include <stdint.h>
# endif
#else
# include <stddef.h>
#include <stddef.h>
/* SGI MIPSPro doesn't like stdint.h in C++ mode */
/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */
# if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__)
# include <inttypes.h>
# else
# include <stdint.h>
# endif
#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__)
#include <inttypes.h>
#else
#include <stdint.h>
#endif
#define GLEW_APIENTRY_DEFINED
@ -239,8 +231,6 @@ typedef struct __GLsync *GLsync;
typedef char GLchar;
typedef void *GLeglImageOES; /* GL_EXT_EGL_image_storage */
#define GL_ZERO 0
#define GL_FALSE 0
#define GL_LOGIC_OP 0x0BF1

View File

@ -25,7 +25,7 @@ GLenum eglewInit (EGLDisplay display)
if (!initialize || !queryString)
return 1;
/* query EGL version */
/* query EGK version */
if (initialize(display, &major, &minor) != EGL_TRUE)
return 1;

View File

@ -73,12 +73,13 @@ GLboolean GLEWAPIENTRY glewGetExtension (const char* name)
typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGPROC) (GLenum name);
typedef void (GLAPIENTRY * PFNGLGETINTEGERVPROC) (GLenum pname, GLint *params);
GLenum GLEWAPIENTRY glewContextInit (void)
static GLenum GLEWAPIENTRY glewContextInit ()
{
PFNGLGETSTRINGPROC getString;
const GLubyte* s;
GLuint dot;
GLint major, minor;
size_t n;
#ifdef _WIN32
getString = glGetString;
@ -109,7 +110,7 @@ GLenum GLEWAPIENTRY glewContextInit (void)
else
{
GLEW_VERSION_4_6 = ( major > 4 ) || ( major == 4 && minor >= 6 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_4_5 = GLEW_VERSION_4_6 == GL_TRUE || ( major == 4 && minor >= 5 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_4_5 = GLEW_VERSION_4_4 == GL_TRUE || ( major == 4 && minor >= 5 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_4_4 = GLEW_VERSION_4_5 == GL_TRUE || ( major == 4 && minor >= 4 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_4_3 = GLEW_VERSION_4_4 == GL_TRUE || ( major == 4 && minor >= 3 ) ? GL_TRUE : GL_FALSE;
GLEW_VERSION_4_2 = GLEW_VERSION_4_3 == GL_TRUE || ( major == 4 && minor >= 2 ) ? GL_TRUE : GL_FALSE;
@ -129,11 +130,8 @@ GLenum GLEWAPIENTRY glewContextInit (void)
GLEW_VERSION_1_1 = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE;
}
{
size_t i;
for (i = 0; i < sizeof(_glewExtensionString) / sizeof(_glewExtensionString[0]); ++i)
_glewExtensionString[i] = GL_FALSE;
}
for (n = 0; n < sizeof(_glewExtensionString) / sizeof(_glewExtensionString[0]); ++n)
_glewExtensionString[n] = GL_FALSE;
if (GLEW_VERSION_3_0)
{

View File

@ -8,7 +8,6 @@ const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error)
(const GLubyte*)"Missing GL version",
(const GLubyte*)"GL 1.1 and up are not supported",
(const GLubyte*)"GLX 1.2 and up are not supported",
(const GLubyte*)"No GLX display",
(const GLubyte*)"Unknown error"
};
const size_t max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1;

View File

@ -1,6 +1,6 @@
/*
** The OpenGL Extension Wrangler Library
** Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
** Copyright (C) 2008-2017, Nigel Stewart <nigels[]users sourceforge net>
** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
** Copyright (C) 2002, Lev Povalahev

View File

@ -27,7 +27,6 @@ VERSION_MICRO GLEW_VERSION_MICRO_STRING
/* API */
GLEWAPI GLenum GLEWAPIENTRY glewInit (void);
GLEWAPI GLenum GLEWAPIENTRY glewContextInit (void);
GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name);
#define glewIsExtensionSupported(x) glewIsSupported(x)

View File

@ -11,7 +11,7 @@
//
// Version
//
VS_VERSION_INFO VERSIONINFO
VS_VERSION_INFO VERSIONINFO
FILEVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0
PRODUCTVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
@ -28,9 +28,8 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments",
VALUE "Comments",
"The OpenGL Extension Wrangler Library\r\n"
"Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>\r\n"
"Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>\r\n"
"Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>\r\n"
"Copyright (C) 2002, Lev Povalahev\r\n"
@ -108,7 +107,7 @@ BEGIN
VALUE "FileDescription", "Utility for verifying extension entry points\0"
VALUE "FileVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0"
VALUE "InternalName", "glewinfo\0"
VALUE "LegalCopyright", "(C) 2002-2019 Nigel Stewart & Milan Ikits & Marcelo Magallon\0"
VALUE "LegalCopyright", "© 2002-2008 Milan Ikits & Marcelo Magallon\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", FILENAME "\0"
VALUE "PrivateBuild", "\0"

View File

@ -40,9 +40,6 @@ struct createParams
/* https://www.opengl.org/registry/specs/ARB/glx_create_context.txt */
int profile; /* core = 1, compatibility = 2 */
int flags; /* debug = 1, forward compatible = 2 */
/* GLEW experimental mode */
int experimental;
};
GLboolean glewCreateContext (struct createParams *params);
@ -53,7 +50,7 @@ void glewDestroyContext ();
/* ------------------------------------------------------------------------- */
static GLboolean glewPrintExt (const char* name, GLboolean def1, GLboolean def2, GLboolean def3)
static void glewPrintExt (const char* name, GLboolean def1, GLboolean def2, GLboolean def3)
{
unsigned int i;
fprintf(f, "\n%s:", name);
@ -68,19 +65,15 @@ static GLboolean glewPrintExt (const char* name, GLboolean def1, GLboolean def2,
for (i=0; i<strlen(name)+1; i++) fprintf(f, "-");
fprintf(f, "\n");
fflush(f);
return def1 || def2 || def3 || glewExperimental; /* Enable per-function info too? */
}
static void glewInfoFunc (GLboolean fi, const char* name, GLint undefined)
static void glewInfoFunc (const char* name, GLint undefined)
{
unsigned int i;
if (fi)
{
fprintf(f, " %s:", name);
for (i=0; i<60-strlen(name); i++) fprintf(f, " ");
fprintf(f, "%s\n", undefined ? "MISSING" : "OK");
fflush(f);
}
fprintf(f, " %s:", name);
for (i=0; i<60-strlen(name); i++) fprintf(f, " ");
fprintf(f, "%s\n", undefined ? "MISSING" : "OK");
fflush(f);
}
/* ----------------------------- GL_VERSION_1_1 ---------------------------- */

View File

@ -20,8 +20,7 @@ int main (int argc, char** argv)
0, /* major */
0, /* minor */
0, /* profile mask */
0, /* flags */
0 /* experimental */
0 /* flags */
};
#if defined(GLEW_EGL)
@ -42,8 +41,7 @@ int main (int argc, char** argv)
#endif
"[-version <OpenGL version>] "
"[-profile core|compatibility] "
"[-flag debug|forward] "
"[-experimental]"
"[-flag debug|forward]"
"\n");
return 1;
}
@ -54,7 +52,7 @@ int main (int argc, char** argv)
glewDestroyContext();
return 1;
}
glewExperimental = params.experimental ? GL_TRUE : GL_FALSE;
glewExperimental = GL_TRUE;
err = glewInit();
if (GLEW_OK != err)
{
@ -129,11 +127,7 @@ GLboolean glewParseArgs (int argc, char** argv, struct createParams *params)
if (!strcmp(argv[p], "-version"))
{
if (++p >= argc) return GL_TRUE;
#if defined(__STDC_LIB_EXT1__) || (defined(_MSC_VER) && (_MSC_VER >= 1400))
if (sscanf_s(argv[p++], "%d.%d", &params->major, &params->minor) != 2) return GL_TRUE;
#else
if (sscanf(argv[p++], "%d.%d", &params->major, &params->minor) != 2) return GL_TRUE;
#endif
}
else if (!strcmp(argv[p], "-profile"))
{
@ -164,18 +158,13 @@ GLboolean glewParseArgs (int argc, char** argv, struct createParams *params)
{
if (++p >= argc) return GL_TRUE;
params->display = argv[p++];
}
}
else if (!strcmp(argv[p], "-visual"))
{
if (++p >= argc) return GL_TRUE;
params->visual = (int)strtol(argv[p++], NULL, 0);
}
#endif
else if (!strcmp(argv[p], "-experimental"))
{
params->experimental = 1;
++p;
}
else
return GL_TRUE;
}

View File

@ -19,12 +19,7 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xmd.h>
#ifndef GLEW_INCLUDE
# include <GL/glew.h>
#else
# include GLEW_INCLUDE
#endif
#include <GL/glew.h>
#ifdef __cplusplus
extern "C" {

View File

@ -1,7 +1,7 @@
<!-- begin header.html -->
<!--
The OpenGL Extension Wrangler Library
Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>
Copyright (C) 2008-2015, Nigel Stewart <nigels[]users sourceforge net>
Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
Copyright (C) 2002, Lev Povalahev
@ -46,7 +46,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
<td valign="top">
<table border="0" width="100%" cellpadding="0" cellspacing="0" align="left">
<tr><td align="center"><i>Latest Release: <a href="https://github.com/nigels-com/glew/releases/tag/glew-2.2.0">2.2.0</a></i></td></tr>
<tr><td align="center"><i>Latest Release: <a href="https://sourceforge.net/projects/glew/files/glew/2.1.0/">2.1.0</a></i></td></tr>
<tr><td align="center"><br></td></tr>
<tr><td align="center"><img src="./glew.png" alt="GLEW Logo" width="97" height="75"></td></tr>
<tr><td align="center"><br></td></tr>
@ -62,6 +62,8 @@ THE POSSIBILITY OF SUCH DAMAGE.
<tr><td align="center"><a href="https://github.com/nigels-com/glew">GitHub</a></td></tr>
<tr><td align="center"><a href="https://github.com/nigels-com/glew/issues">Issues</a></td></tr>
<tr><td align="center"><a href="https://github.com/nigels-com/glew/pulls">Pull Requests</a></td></tr>
<tr><td align="center"><a href="https://github.com/nigels-com/glew#authors">Authors</a></td></tr>
<tr><td align="center"><a href="https://github.com/nigels-com/glew#copyright-and-licensing">Licensing</a></td></tr>
<tr><td align="center"><br></tr>
<tr><td align="center"><a href="https://sourceforge.net/projects/glew">SourceForge Page</a></td></tr>
</table>
@ -73,7 +75,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
<td valign="bottom">
<table border="0" width="100%" cellpadding="5" cellspacing="0" align="left">
<tr><td align="center"><i>Last Update: 03-15-20</i></td></tr>
<tr><td align="center"><i>Last Update: 07-31-17</i></td></tr>
<tr><td align="center">
<a href="http://www.opengl.org"><img src="./ogl_sm.jpg" width="68" height="35" border="0" alt="OpenGL Logo"></a><br/>
<a href="https://github.com/nigels-com/glew"><img src="github.png" width="70" height="29" border="0" alt="GitHub Logo"></a><br/>

View File

@ -11,7 +11,7 @@
//
// Version
//
VS_VERSION_INFO VERSIONINFO
VS_VERSION_INFO VERSIONINFO
FILEVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0
PRODUCTVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
@ -28,9 +28,8 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments",
VALUE "Comments",
"The OpenGL Extension Wrangler Library\r\n"
"Copyright (C) 2008-2019, Nigel Stewart <nigels[]users sourceforge net>\r\n"
"Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>\r\n"
"Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>\r\n"
"Copyright (C) 2002, Lev Povalahev\r\n"
@ -108,7 +107,7 @@ BEGIN
VALUE "FileDescription", "Utility for listing pixelformat capabilities\0"
VALUE "FileVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0"
VALUE "InternalName", "visualinfo\0"
VALUE "LegalCopyright", "(C) 2002-2019 Nigel Stewart & Milan Ikits & Marcelo Magallon\0"
VALUE "LegalCopyright", "© 2002-2008 Milan Ikits & Marcelo Magallon\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", FILENAME "\0"
VALUE "PrivateBuild", "\0"

View File

@ -1,22 +0,0 @@
schedules:
- cron: "0 0 * * *"
displayName: Daily midnight build
branches:
include:
- master
always: true
jobs:
- job: NightlyUpdate
pool:
vmImage: 'ubuntu-latest'
container: perlmint/glew-cmake:20190922
steps:
- checkout: self
persistCredentials: true
- bash: |
export TEST_MODE=false
git config --global user.email $GIT_USEREMAIL &&
git config --global user.name $GIT_USERNAME &&
unset SYSTEM # remove SYSTEM variable set by azure pipeline
./glew-cmake/maintain.sh

View File

@ -1,12 +1,18 @@
cmake_minimum_required(VERSION 3.16)
project(glew LANGUAGES C)
if ( NOT DEFINED CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE Release CACHE STRING "Build type" )
endif ()
project (glew)
cmake_minimum_required (VERSION 2.8.12)
include(GNUInstallDirs)
if (COMMAND cmake_policy)
cmake_policy (SET CMP0003 NEW)
cmake_policy (SET CMP0042 NEW)
endif()
set(CMAKE_DEBUG_POSTFIX d)
option (BUILD_UTILS "utilities" ON)
@ -15,9 +21,6 @@ option (GLEW_OSMESA "OSMesa mode" OFF)
if (APPLE)
option (BUILD_FRAMEWORK "Build Framework bundle for OSX" OFF)
endif ()
option (GLEW_X11 "X11 mode" ON)
option (GLEW_EGL "EGL mode" OFF)
option (BUILD_SHARED_LIBS "install/link shared instead of static libs" ON)
set (GLEW_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../..)
@ -30,25 +33,16 @@ file (STRINGS ${GLEW_DIR}/config/version _VERSION_PATCH_STRING REGEX "GLEW_MICR
string (REGEX REPLACE "GLEW_MICRO[ ]*=[ ]*([0-9]+)" "\\1" CPACK_PACKAGE_VERSION_PATCH ${_VERSION_PATCH_STRING})
set (GLEW_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
if (NOT GLEW_CUSTOM_OUTPUT_DIRS)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
endif()
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
find_package (OpenGL REQUIRED)
# prefer GLVND
if (OPENGL_opengl_LIBRARY)
set (GLEW_LIBRARIES ${OPENGL_opengl_LIBRARY})
else ()
set (GLEW_LIBRARIES ${OPENGL_gl_LIBRARY})
endif ()
# X11 required except for Windows and Apple OSX platforms
if (GLEW_X11 AND NOT WIN32 AND NOT APPLE)
# X11 required when builing visualinfo and glewinfo,
# but not for Windows or Apple OSX platforms
if (BUILD_UTILS AND NOT WIN32 AND NOT APPLE)
find_package (X11)
list (APPEND GLEW_LIBRARIES ${OPENGL_glx_LIBRARY} ${X11_LIBRARIES})
endif()
if (WIN32)
@ -58,6 +52,8 @@ else ()
set (DLL_PREFIX lib)
endif ()
set (GLEW_LIBRARIES ${OPENGL_LIBRARIES})
add_definitions (-DGLEW_NO_GLU)
#### Regal mode ####
@ -81,30 +77,15 @@ if (GLEW_OSMESA)
set (OSMESA_LIB_NAME OSMesa)
endif ()
add_definitions (-DGLEW_OSMESA)
list (APPEND GLEW_LIBRARIES ${OSMESA_LIB_NAME})
set (GLEW_LIBRARIES ${OSMESA_LIB_NAME} ${OPENGL_LIBRARIES})
set (X11_LIBRARIES)
endif ()
#### EGL ####
if (GLEW_EGL AND UNIX)
add_definitions (-DGLEW_EGL)
if (NOT OpenGL_EGL_FOUND)
message (FATAL_ERROR "EGL library set but not found.")
endif ()
list (APPEND GLEW_LIBRARIES ${OPENGL_egl_LIBRARY})
endif ()
#### GLEW ####
include_directories (${GLEW_DIR}/include ${X11_INCLUDE_DIR})
include_directories (${GLEW_DIR}/include)
set (GLEW_PUBLIC_HEADERS_FILES
${GLEW_DIR}/include/GL/wglew.h
${GLEW_DIR}/include/GL/glew.h
${GLEW_DIR}/include/GL/glxew.h
${GLEW_DIR}/include/GL/eglew.h
)
set (GLEW_PUBLIC_HEADERS_FILES ${GLEW_DIR}/include/GL/wglew.h ${GLEW_DIR}/include/GL/glew.h ${GLEW_DIR}/include/GL/glxew.h)
set (GLEW_SRC_FILES ${GLEW_DIR}/src/glew.c)
if (WIN32)
@ -122,16 +103,12 @@ if (MSVC)
# add options from visual studio project
target_compile_definitions (glew PRIVATE "GLEW_BUILD;VC_EXTRALEAN")
target_compile_definitions (glew_s PRIVATE "GLEW_STATIC;VC_EXTRALEAN")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i?86|x86|x86_32)$")
target_link_libraries (glew LINK_PRIVATE -BASE:0x62AA0000)
endif()
target_link_libraries (glew LINK_PRIVATE -BASE:0x62AA0000)
# kill security checks which are dependent on stdlib
target_compile_options (glew PRIVATE -GS-)
target_compile_options (glew_s PRIVATE -GS-)
# remove stdlib dependency
target_link_libraries (glew LINK_PRIVATE -nodefaultlib -noentry)
target_link_libraries (glew LINK_PRIVATE libvcruntime.lib)
target_link_libraries (glew LINK_PRIVATE msvcrt.lib )
string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
elseif (WIN32 AND ((CMAKE_C_COMPILER_ID MATCHES "GNU") OR (CMAKE_C_COMPILER_ID MATCHES "Clang")))
# remove stdlib dependency on windows with GCC and Clang (for similar reasons
@ -157,24 +134,31 @@ endif()
target_link_libraries (glew LINK_PUBLIC ${GLEW_LIBRARIES})
target_link_libraries (glew_s ${GLEW_LIBRARIES})
target_compile_definitions(glew_s INTERFACE "GLEW_STATIC")
foreach(t glew glew_s)
target_include_directories(${t} PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
endforeach()
if(CMAKE_VERSION VERSION_LESS 2.8.12)
set(MAYBE_EXPORT "")
else()
target_compile_definitions(glew_s INTERFACE "GLEW_STATIC")
foreach(t glew glew_s)
target_include_directories(${t} PUBLIC $<INSTALL_INTERFACE:include>)
endforeach()
set(MAYBE_EXPORT EXPORT glew-targets)
endif()
set(targets_to_install "")
if(BUILD_SHARED_LIBS)
if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
list(APPEND targets_to_install glew)
else ()
endif()
if(NOT DEFINED BUILD_SHARED_LIBS OR NOT BUILD_SHARED_LIBS)
list(APPEND targets_to_install glew_s)
endif()
install ( TARGETS ${targets_to_install}
EXPORT glew-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Runtime
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
FRAMEWORK DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT Runtime
${MAYBE_EXPORT}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
FRAMEWORK DESTINATION ${CMAKE_INSTALL_PREFIX}
)
if (BUILD_UTILS)
@ -183,11 +167,7 @@ if (BUILD_UTILS)
list (APPEND GLEWINFO_SRC_FILES ${GLEW_DIR}/build/glewinfo.rc)
endif ()
add_executable (glewinfo ${GLEWINFO_SRC_FILES})
if(BUILD_SHARED_LIBS)
target_link_libraries (glewinfo glew)
else()
target_link_libraries (glewinfo glew_s)
endif()
target_link_libraries (glewinfo glew)
if (NOT WIN32)
target_link_libraries(glewinfo ${X11_LIBRARIES})
endif ()
@ -197,18 +177,13 @@ if (BUILD_UTILS)
list (APPEND VISUALINFO_SRC_FILES ${GLEW_DIR}/build/visualinfo.rc)
endif ()
add_executable (visualinfo ${VISUALINFO_SRC_FILES})
if(BUILD_SHARED_LIBS)
target_link_libraries (visualinfo glew)
else()
target_link_libraries (visualinfo glew_s)
endif()
target_link_libraries (visualinfo glew)
if (NOT WIN32)
target_link_libraries(visualinfo ${X11_LIBRARIES})
endif ()
install ( TARGETS glewinfo visualinfo
DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT Runtime)
DESTINATION ${CMAKE_INSTALL_BINDIR})
endif ()
set (prefix ${CMAKE_INSTALL_PREFIX})
@ -225,35 +200,34 @@ if (APPLE)
set (requireslib)
endif ()
configure_file (${GLEW_DIR}/glew.pc.in ${CMAKE_CURRENT_BINARY_DIR}/glew.pc @ONLY)
configure_file (${GLEW_DIR}/glew.pc.in ${GLEW_DIR}/glew.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/glew.pc
install(FILES ${GLEW_DIR}/glew.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
COMPONENT Development
)
if(WIN32 AND MSVC AND (NOT MSVC_VERSION LESS 1600))
if(WIN32 AND MSVC AND (NOT MSVC_VERSION LESS 1600) AND (NOT CMAKE_VERSION VERSION_LESS "3.1"))
install(
FILES $<TARGET_PDB_FILE:glew>
DESTINATION ${CMAKE_INSTALL_LIBDIR}
CONFIGURATIONS Debug RelWithDebInfo
COMPONENT Runtime
)
endif()
install (
FILES ${GLEW_PUBLIC_HEADERS_FILES}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/GL
COMPONENT Development)
install (FILES
${GLEW_DIR}/include/GL/wglew.h
${GLEW_DIR}/include/GL/glew.h
${GLEW_DIR}/include/GL/glxew.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/GL)
install(EXPORT glew-targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/glew
COMPONENT Development
NAMESPACE GLEW::)
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/glew-config.cmake
${CMAKE_CURRENT_SOURCE_DIR}/CopyImportedTargetProperties.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/glew
COMPONENT Development)
if(MAYBE_EXPORT)
install(EXPORT glew-targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/glew
NAMESPACE GLEW::)
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/glew-config.cmake
${CMAKE_CURRENT_SOURCE_DIR}/CopyImportedTargetProperties.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/glew)
endif()
if(NOT TARGET uninstall)
configure_file(

View File

@ -1,13 +1,13 @@
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
if (NOT DEFINED CMAKE_INSTALL_PREFIX)
set (CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
endif ()
message(${CMAKE_INSTALL_PREFIX})
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16)
project(glew-cmake-test LANGUAGES C)
cmake_minimum_required(VERSION 2.8.12)
project(glew-cmake-test)
find_package(GLEW REQUIRED CONFIG)
find_package(GLEW REQUIRED CONFIG) # call twice to test multiple call
@ -10,10 +10,16 @@ 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 $<CONFIGURATION>)
else()
set(cgex $<CONFIG>)
endif()
target_compile_definitions(cmake-test PRIVATE
-DGLEW_CMAKE_TEST_CONFIG=$<CONFIG>
-DGLEW_CMAKE_TEST_CONFIG=${cgex}
-DGLEW_CMAKE_TEST_TARGET_FILE_NAME=$<TARGET_FILE_NAME:GLEW::GLEW>
-DGLEW_CMAKE_TEST_TARGET_TYPE=$<TARGET_PROPERTY:GLEW::GLEW,TYPE>
)
install(TARGETS cmake-test DESTINATION bin COMPONENT Runtime)
install(TARGETS cmake-test DESTINATION bin)

17
build/conan/.gitignore vendored Normal file
View File

@ -0,0 +1,17 @@
#Backup files
*\~
*swp
#OSX
Thumbs.db
.DS_Store
#Emacs buffers
\#*\#
\.#*
#Conan
test_package/build
conanfile.pyc
conaninfo.txt
conanbuildinfo.cmake

View File

@ -0,0 +1,24 @@
#!/bin/bash
set -e
set -x
if [[ "$(uname -s)" == 'Darwin' ]]; then
brew update || brew update
brew outdated pyenv || brew upgrade pyenv
brew install pyenv-virtualenv
brew install cmake || true
if which pyenv > /dev/null; then
eval "$(pyenv init -)"
fi
pyenv install 2.7.10
pyenv virtualenv 2.7.10 conan
pyenv rehash
pyenv activate conan
fi
pip install conan_package_tools
conan user

13
build/conan/.travis/run.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
set -e
set -x
if [[ "$(uname -s)" == 'Darwin' ]]; then
if which pyenv > /dev/null; then
eval "$(pyenv init -)"
fi
pyenv activate conan
fi
python build.py

View File

@ -0,0 +1,18 @@
find_path(
GLEW_INCLUDE_DIR
NAMES
GL
PATHS
include)
find_library(
GLEW_LIBRARY
NAMES
GLEW GLEWd glew32 glew32s glew32d glew32sd
PATHS
lib)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLEW REQUIRED_VARS GLEW_LIBRARY GLEW_INCLUDE_DIR)

12
build/conan/build.py Normal file
View File

@ -0,0 +1,12 @@
from conan.packager import ConanMultiPackager
import os, platform
if __name__ == "__main__":
builder = ConanMultiPackager(args="--build missing")
builder.add_common_builds()
filtered_builds = []
for settings, options, env_vars, build_requires in builder.builds:
if not (settings["arch"] == "x86"):
filtered_builds.append([settings, options, env_vars, build_requires])
builder.builds = filtered_builds
builder.run()

143
build/conan/conanfile.py Normal file
View File

@ -0,0 +1,143 @@
import os
from conans import ConanFile, CMake
from conans.tools import os_info, SystemPackageTool, ConanException
from conans import tools, VisualStudioBuildEnvironment
from conans.tools import build_sln_command, vcvars_command, replace_in_file, download, unzip
class GlewConan(ConanFile):
name = "glew"
version = "master"
source_directory = "%s-%s" % (name, version) if version != "master" else "."
description = "The GLEW library"
generators = "cmake", "txt"
settings = "os", "arch", "build_type", "compiler"
options = {"shared": [True, False]}
default_options = "shared=False"
url="http://github.com/nigels-com/glew"
license="https://github.com/nigels-com/glew#copyright-and-licensing"
if version == "master":
if os.path.isfile("Makefile"):
exports_sources = "*"
else:
exports_sources = os.sep.join(["..", "..", "*"])
else:
exports = "FindGLEW.cmake"
def system_requirements(self):
if os_info.is_linux:
if os_info.with_apt:
installer = SystemPackageTool()
if self.version == "master":
installer.install("build-essential")
installer.install("libxmu-dev")
installer.install("libxi-dev")
installer.install("libgl-dev")
installer.install("libosmesa-dev")
installer.install("libglu1-mesa-dev")
elif os_info.with_yum:
installer = SystemPackageTool()
if self.version == "master":
installer.install("libXmu-devel")
installer.install("libXi-devel")
installer.install("libGL-devel")
installer.install("mesa-libGLU-devel")
else:
self.output.warn("Could not determine Linux package manager, skipping system requirements installation.")
def configure(self):
del self.settings.compiler.libcxx
def source(self):
if self.version != "master":
zip_name = "%s.tgz" % self.source_directory
download("https://sourceforge.net/projects/glew/files/glew/%s/%s/download" % (self.version, zip_name), zip_name)
unzip(zip_name)
os.unlink(zip_name)
def build(self):
if self.settings.os == "Windows" and self.version == "master":
raise ConanException("Trunk builds are not supported on Windows (cannot build directly from master git repository).")
if self.settings.compiler == "Visual Studio":
env = VisualStudioBuildEnvironment(self)
with tools.environment_append(env.vars):
version = min(12, int(self.settings.compiler.version.value))
version = 10 if version == 11 else version
cd_build = "cd %s\\%s\\build\\vc%s" % (self.conanfile_directory, self.source_directory, version)
build_command = build_sln_command(self.settings, "glew.sln")
vcvars = vcvars_command(self.settings)
self.run("%s && %s && %s" % (vcvars, cd_build, build_command.replace("x86", "Win32")))
else:
if self.settings.os == "Windows":
replace_in_file("%s/build/cmake/CMakeLists.txt" % self.source_directory, \
"if(WIN32 AND (NOT MSVC_VERSION LESS 1600)", \
"if(WIN32 AND MSVC AND (NOT MSVC_VERSION LESS 1600)")
if self.version == "master":
self.run("make extensions")
cmake = CMake(self)
cmake.configure(source_dir="%s/build/cmake" % self.source_directory, defs={"BUILD_UTILS": "OFF"})
cmake.build()
def package(self):
find_glew_dir = "%s/build/conan" % self.conanfile_directory if self.version == "master" else "."
self.copy("FindGLEW.cmake", ".", find_glew_dir, keep_path=False)
self.copy("include/*", ".", "%s" % self.source_directory, keep_path=True)
self.copy("%s/license*" % self.source_directory, dst="licenses", ignore_case=True, keep_path=False)
if self.settings.os == "Windows":
if self.settings.compiler == "Visual Studio":
self.copy(pattern="*.pdb", dst="bin", keep_path=False)
if self.options.shared:
self.copy(pattern="*32.lib", dst="lib", keep_path=False)
self.copy(pattern="*32d.lib", dst="lib", keep_path=False)
self.copy(pattern="*.dll", dst="bin", keep_path=False)
else:
self.copy(pattern="*32s.lib", dst="lib", keep_path=False)
self.copy(pattern="*32sd.lib", dst="lib", keep_path=False)
else:
if self.options.shared:
self.copy(pattern="*32.dll.a", dst="lib", keep_path=False)
self.copy(pattern="*32d.dll.a", dst="lib", keep_path=False)
self.copy(pattern="*.dll", dst="bin", keep_path=False)
else:
self.copy(pattern="*32.a", dst="lib", keep_path=False)
self.copy(pattern="*32d.a", dst="lib", keep_path=False)
elif self.settings.os == "Macos":
if self.options.shared:
self.copy(pattern="*.dylib", dst="lib", keep_path=False)
else:
self.copy(pattern="*.a", dst="lib", keep_path=False)
else:
if self.options.shared:
self.copy(pattern="*.so", dst="lib", keep_path=False)
else:
self.copy(pattern="*.a", dst="lib", keep_path=False)
def package_info(self):
if self.settings.os == "Windows":
self.cpp_info.libs = ['glew32']
if not self.options.shared:
self.cpp_info.defines.append("GLEW_STATIC")
if self.settings.compiler == "Visual Studio":
if not self.options.shared:
self.cpp_info.libs[0] += "s"
self.cpp_info.libs.append("OpenGL32.lib")
if self.settings.compiler.runtime != "MT":
self.cpp_info.exelinkflags.append('-NODEFAULTLIB:LIBCMTD')
self.cpp_info.exelinkflags.append('-NODEFAULTLIB:LIBCMT')
else:
self.cpp_info.libs.append("opengl32")
else:
self.cpp_info.libs = ['GLEW']
if self.settings.os == "Macos":
self.cpp_info.exelinkflags.append("-framework OpenGL")
elif not self.options.shared:
self.cpp_info.libs.append("GL")
if self.settings.build_type == "Debug":
self.cpp_info.libs[0] += "d"

View File

@ -0,0 +1,9 @@
project(GlewTest)
cmake_minimum_required(VERSION 3.0.0)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
add_executable(testGlew main.c)
target_compile_definitions(testGlew PUBLIC "${CONAN_DEFINES}")
target_link_libraries(testGlew PUBLIC "${CONAN_LIBS}")
set_target_properties(testGlew PROPERTIES LINK_FLAGS "${CONAN_EXE_LINKER_FLAGS}")

View File

@ -0,0 +1,21 @@
from conans import ConanFile, CMake
import os
class TestGlew(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
def build(self):
cmake = CMake(self)
self.run('cmake "%s" %s' % (self.conanfile_directory, cmake.command_line))
self.run("cmake --build . %s" % cmake.build_config)
def test(self):
self.run(os.sep.join([".","bin", "testGlew"]))
def imports(self):
if self.settings.os == "Windows":
self.copy(pattern="*.dll", dst="bin", src="bin")
self.copy(pattern="*.pdb", dst="bin", src="bin")
if self.settings.os == "Macos":
self.copy(pattern="*.dylib", dst="bin", src="lib")

View File

@ -0,0 +1,6 @@
#include "GL/glew.h"
int main (){
glewGetString(GLEW_VERSION);
return 0;
}

Some files were not shown because too many files have changed in this diff Show More