Added RTCW source

This commit is contained in:
Simon 2020-06-10 23:16:41 +01:00
parent ed2e26394c
commit 371ed1d9e2
877 changed files with 576425 additions and 10 deletions

View file

@ -1,10 +1,2 @@
include $(GL4ES_PATH)/Android.mk
include $(SUPPORT_LIBS)/SDL2/SDL2/Android.mk
include $(SUPPORT_LIBS)/SDL2/SDL2_mixer/Android.mk
include $(SUPPORT_LIBS)/jpeg8d/Android.mk
include $(SUPPORT_LIBS)/libzip/Android.mk
include $(SUPPORT_LIBS)/libpng/Android.mk
include $(SUPPORT_LIBS)/sigc++/Android.mk
include $(TOP_DIR)/quake2/Android.mk
include $(TOP_DIR)/quake2/Android_game.mk
include $(TOP_DIR)/quake2/Android_gl1.mk
include $(TOP_DIR)/rtcw/Android.mk

View file

@ -16,7 +16,7 @@ GL4ES_PATH := $(SUPPORT_LIBS)/gl4es
APP_ALLOW_MISSING_DEPS=true
APP_MODULES := yquake2 yquake2_game gl4es yquake2_gl1
APP_MODULES := gl4es qagamearm rtcw_client uiarm cgamearm
APP_STL := c++_shared

View file

@ -0,0 +1,10 @@
.gdb_history
.vscode/
CMakeFiles/
lib/
Makefile
CMakeCache.txt
cmake_install.cmake
spec/yml/gles-1.1-full.yml
/build/
/tests/*.png

View file

@ -0,0 +1,24 @@
language: c
sudo: false
dist: xenial
addons:
apt:
packages:
- cmake
compiler:
- gcc
#Build steps
before_script:
- mkdir build
- cd build
- cmake .. -DODROID=1
script:
- make
#after_script:
# - sudo apt-get install apitrace-gl-frontend=5\* imagemagick xvfb -y
# - cd ../tests
# - xvfb-run ./tests.sh ../lib

View file

@ -0,0 +1,86 @@
LOCAL_PATH := $(call my-dir)
###########################
#
# GL static library
#
###########################
include $(CLEAR_VARS)
LOCAL_MODULE := gl4es
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES) -DBCMHOST
LOCAL_SRC_FILES := \
src/gl/array.c \
src/gl/blend.c \
src/gl/blit.c \
src/gl/buffers.c \
src/gl/build_info.c \
src/gl/debug.c \
src/gl/decompress.c \
src/gl/depth.c \
src/gl/directstate.c \
src/gl/drawing.c \
src/gl/enable.c \
src/gl/eval.c \
src/gl/face.c \
src/gl/fog.c \
src/gl/fpe.c \
src/gl/fpe_shader.c \
src/gl/framebuffers.c \
src/gl/getter.c \
src/gl/gl4es.c \
src/gl/glstate.c \
src/gl/hint.c \
src/gl/init.c \
src/gl/light.c \
src/gl/line.c \
src/gl/list.c \
src/gl/listdraw.c \
src/gl/listrl.c \
src/gl/loader.c \
src/gl/matrix.c \
src/gl/matvec.c \
src/gl/pixel.c \
src/gl/planes.c \
src/gl/pointsprite.c \
src/gl/preproc.c \
src/gl/program.c \
src/gl/queries.c \
src/gl/raster.c \
src/gl/render.c \
src/gl/shader.c \
src/gl/shaderconv.c \
src/gl/stack.c \
src/gl/stencil.c \
src/gl/string_utils.c \
src/gl/stubs.c \
src/gl/texenv.c \
src/gl/texgen.c \
src/gl/texture.c \
src/gl/uniform.c \
src/gl/vertexattrib.c \
src/gl/wrap/gl4es.c \
src/gl/wrap/gles.c \
src/gl/wrap/glstub.c \
src/gl/math/eval.c \
src/glx/hardext.c \
src/glx/glx.c \
src/glx/lookup.c \
src/glx/gbm.c \
src/glx/streaming.c \
LOCAL_CFLAGS += -g -std=c99 -funwind-tables -O3 -DBCMHOST -fvisibility=hidden -include include/android_debug.h
LOCAL_CFLAGS += -DNOX11
LOCAL_CFLAGS += -DNO_GBM
LOCAL_CFLAGS += -DDEFAULT_ES=2
LOCAL_CFLAGS += -DNO_INIT_CONSTRUCTOR
LOCAL_LDLIBS := -ldl -llog -lEGL -lGLESv3
include $(BUILD_SHARED_LIBRARY)

View file

@ -0,0 +1,135 @@
Version history
----
##### current version
* Improved a bit the merger (wich merge subsequent `glBegin(...)`/`glEnd()`) efficiency
* Removed LIBGL_BEGINEND=2 (that was not working correctly, and it complexify the code too much)
* Added some Direct Acces function (from EXT_direct_access)
* Fixes and Improvements on depth (and depth_Stencil) Texture handling
* Handling of GL_BGRA color size in VA (for HumandRessourceMachine)
* Some fixes to fpe_shader (for Neverwinter Night)
* Rework of Header structure (from @rajdakin)
* Better test, using "make test" (from @rajdakin, still using apitrace for replay)
##### v1.1.0
* Default backend is now GLES2 (but not on Pandora, still GLES1.1 for compatibility reasons)
* Added LIBGL_SHADERNOGLES to remove the GLES part of shaders (if any).
* Various RPi improvments, mainly in the context creation.
* Various AmigaOS4 improvement and workaround (but still in a beta state)
* Various improvement in GLX function, with a more accurate way to emulate GLXFBConfig
* Improved the way eglSurface are created in glx.c, to avoid try to create 2 on the same window (EGL doesn't allow that)
* Added LIBGL_GLXRECYCLE to not delete eglSurface and recycle them
* Added tracking of Framebuffers Object and Renderbuffers Objects
* Added (real) support for Float and Half-float Texture (including has attachement to FBO, emulating it if not supported in Hardware)
* Added support for Depth Stencil texture when attached to an FBO
* Added LIBGL_FBO=WxH for all plateform
* Fixed some issue when resized textures attached to an FBO
* Added LIBGL_NODEPTHTEX to avoid using Depth Texture when available (using renderbuffer can be faster)
* Added support for Depth Texture when attached to an FBO (if supported by Hardware)
* Fixes some isue with blitting of FBO when size of Main Framebuffer changed
* Added option LIBGL_LOGSHADERERROR to get Shader compiler log and error
* Added support for (emulated) Hardware Instancing
* Added support for GL_ARB_draw_elements_base_vertex
##### v1.0.8
* Fixes and improvments to avoid unnecessary GLES state changes
* Fixes some memory issues with glBitmap
* Fixes to FPE (when using multitexture and GL_COMBINE)
* Added some TexEnv extension for GLES2 backend
* Fixes to Batch / Merger on GL_POLYGON primitives
* Fixes to LineStipple
* Pandora only: Fixed use of Texture Streaming on GLES2 backend
##### v1.0.6
* Factorised "Blit" function, and implemented `glBlitFramebuffer`
* Optimized `glBitmap`
* Added (limited) direct support to `GL_UNSIGNED_INT` for `glDrawElements` for hardware that support it
* Improved (a lot) `glBegin`/`glEnd` merger
* Added Anisotropic filterring support, for hardware that support it.
* Changed `LIBGL_BATCH`. It will now try to merge small (parametrable) subsequent `glDrawXXXX`
* Changed (simplified) the way texture "0" is handled
* Improvement to `glDrawArrays` and `glDrawElement`, with less copy of datas
* WIP AmigaOS4 support (and BigEndian architecture)
* Improved NPOT support for "Limited NPOT" hardware
* Lots of FPE fixes
* Improve the way multi glX Context are handled
* Added basic pre-proc (only handle comments for now)
* Small optimisation on when using `glDrawArrays` with GL_QUADS
* Improvement to GL_RENDER
* Improvement to line stipple
* Improvement to glPolygonMode(GL_LINE)
##### v1.0.4
* FPE is now usable. Most function are implemented
* ShaderConv in now usable. Basic GL 2 shader are supported
* Refactored Texture cache and handling, for better Tex1D/Tex3D/TexRectangle handling
##### v1.0.2
* Added GLES2 backend infrastructure
* Begin GLES2 backend
* Infrastructure for FPE (Fixed Pipeline Emulator)
* Basic and Crude Shader convertor
* Added blit function for GLES2 backend
* Added some OpenGL Builtin VAs and Uniforms
##### 1.0.0
* Removed old ES2 defines (ES2 will be dynamic later)
##### 0.9.8
* Added TravisCI build on github
* Added some optimisation when to discard call to glBindTexture if useless (same texture) between 2 glBegin/glEnd blocks
* Stubbed glGet with GL_DRAW_BUFFER
* Improvement to Raster operations
* Factorised Blit function (only 1 function for that now)
* Tracking ShadeModel
* Tracking TexEnv
##### 0.9.7
* Tracking Clip Planes
* Refactor Blitting function, and use glDrawTex extension if present
* Restructured README and split in several files
* Some improvments and fixes to LIBGL_BEGINEND=2 mode
* Some improvments to some LIBGL_SHRINK mode
* Proper support for DOT3 extension
* Some fixes to Read/Draw Buffer handling
* Some fix with the PixMap glX context creation
##### 0.9.6
* Some fixes in GL_TEXTURE_RECTANGLE_ARB handling
* Some other fixes in texture handling (unpack and glList related)
* Some fix with the PBuffer glX context creation
* Tracking of glFog
* Exposed glBlendEquation if supported
* New LIBGL_AVOID16BITS parameter to prefer 32bits texture (usefull on ODroid)
* Some optimisations in texture conversion
##### 0.9.5
* Added some optimisations for sequencial glBegin/glEnd blocks, with a switch to control them
* Fixed many issue with Lights introduced with 0.9.4
* Fixed Android build introduced with 0.9.4
##### 0.9.4
* Fixed some extended functions (like glBlendFuncSeparate) not working inside list (fixing some issues with Batch mode)
* Added back GL_TEXTURE_RECTANGLE_ARB handling (and using npot texture, even limited, if available)
* Added tracking of Lights and Materials
* Fixed (Added in fact) support for Multisampling on the GLX Context creation (a bit hacky, but seems to works)
* Added LIBGL_NODOWNSAMPLING and associated Hint
* Try to implement some caching on VAO to avoid some memcpy in renderlist (with a way to disable it just in case)
##### 0.9.3
* Added support for Cube Mapping (with hardware support)
* Improved Texture state tracking
* Added LIBGL_NOTEXMAT env. var. switch for Texture Matrix handling
* Added GL_EXT_vertex_array_bgra (and NEONinzed some loop)
* Finished GL_EXT_direct_state_access extension
* Mangled glX function (to be abble to use apitrace to capture GL frames)
* Return some values in glXQueryServerString, coherent with glXGetClientString
##### 0.9.2
* All matrix are tracked now
* Texture Matrix are 100% handled by gl4es. GLES Hardware keep an Identity matrix (TexCoord are transformed if needed). This allows a better handling of NPOT texture on hadware that doesn't support Full NPOT (fixed movies beiing horizontaly shifted in openmw with LIBGL_NPOT=1 for example)
##### 0.9.1
* Added gl4es specifics glHint capabilities. If the extension GL_GL4ES_hint is present, than a few Hint are accessible. Look in include/gl4eshint.h for the list.
##### 0.9.0
* New name: gl4es

View file

@ -0,0 +1,200 @@
cmake_minimum_required(VERSION 2.8)
project(gl4es LANGUAGES C)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
option(PANDORA "Set to ON if targeting an OpenPandora device" ${PANDORA})
option(BCMHOST "Set to ON if targeting an RPi(2) device" ${BCMHOST})
option(ODROID "Set to ON if targeting an ODroid device" ${ODROID})
option(CHIP "Set to ON if targeting an C.H.I.P. device" ${CHIP})
option(AMIGAOS4 "Set to ON if targeting an AmigaOS4/Warp3D platform (activate NOEGL and NOX11)" ${AMIGAOS4})
option(NOX11 "Set to ON to not use X11 (creation of context has to be done outside gl4es)" ${NOX11})
option(NOEGL "Set to ON to not use EGL (all functions are taken in GLES library)" ${NOEGL})
option(STATICLIB "Set to ON to build a static version of gl4es" ${STATICLIB})
option(GBM "Set to ON to not build GBM interface" ${GBM})
option(USE_CCACHE "Set to ON to use ccache if present in the system" ${USE_CCACHE})
# Pandora
if(PANDORA)
add_definitions(-DPANDORA)
add_definitions(-DTEXSTREAM)
add_definitions(-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -fsingle-precision-constant -ffast-math)
set(NO_GBM ON)
endif()
if((NOT GBM) OR PANDORA)
set(NO_GBM ON)
else()
set(NO_GBM OFF)
endif()
if(NOT DEFAULT_ES)
if(PANDORA)
set(DEFAULT_ES 1)
else()
set(DEFAULT_ES 2)
endif()
endif()
# Raspberry PI
if(BCMHOST)
include_directories(/opt/vc/include /opt/vc/include/interface/vcos/pthreads /opt/vc/include/interface/vmcs_host/linux)
link_directories(/opt/vc/lib)
add_definitions(-DBCMHOST)
endif()
# ODROID
if(ODROID)
add_definitions(-DODROID)
endif()
#PocketCHIP
if(CHIP)
add_definitions(-DCHIP)
add_definitions(-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard -ftree-vectorize -fsingle-precision-constant -ffast-math)
endif()
# AmigaOS4
if(AMIGAOS4)
set(CMAKE_C_COMPILER "ppc-amigaos-gcc")
set(CMAKE_CXX_COMPILER "ppc-amigaos-g++")
set(CMAKE_LINKER "ppc-amigaos-ld")
set(CMAKE_AR "ppc-amigaos-ar")
set(CMAKE_RANLIB "ppc-amigaos-ranlib")
add_definitions(-DAMIGAOS4)
set(NOX11 ON)
set(NOEGL ON)
set(NO_GBM ON)
endif()
#NOX11
if(NOX11)
add_definitions(-DNOX11)
endif()
#NOEGL
if(NOEGL)
add_definitions(-DNOEGL)
add_definitions(-DNOX11)
endif()
if(NOT NO_GBM)
find_package(PkgConfig REQUIRED)
pkg_check_modules(KMSDRM REQUIRED libdrm gbm egl)
link_directories(${KMSDRM_LIBRARY_DIRS})
include_directories(${KMSDRM_INCLUDE_DIRS})
endif()
if(NO_GBM)
add_definitions(-DNO_GBM)
endif()
#DEFAULT_ES=2
if(DEFAULT_ES EQUAL 2)
add_definitions(-DDEFAULT_ES=2)
endif()
if(DEFAULT_ES EQUAL 1)
add_definitions(-DDEFAULT_ES=1)
endif()
if(USE_CCACHE)
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif()
endif()
link_directories(${CMAKE_BINARY_DIR}/lib)
add_definitions(-std=gnu99 -funwind-tables -fvisibility=hidden)
include_directories(include)
add_subdirectory(src)
enable_testing()
macro(create_test test_name test_filename calls_count tolerance)
if (${ARGC} EQUAL 5)
add_test(${test_name}
${CMAKE_COMMAND}
-D LIBRARY_FOLDER=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-D TESTS_DIRECTORY=${CMAKE_SOURCE_DIR}/tests
-D TEST_FILENAME=${test_filename}
-D CALLS=${calls_count}
-D TOLERANCE=${tolerance}
-D EXTRACT_RANGE=${ARGV4}
-P ${CMAKE_SOURCE_DIR}/test.cmake)
elseif (${ARGC} EQUAL 6)
if (${ARGV4} STREQUAL "NOEXTRACT_RANGE")
add_test(${test_name}
${CMAKE_COMMAND}
-D LIBRARY_FOLDER=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-D TESTS_DIRECTORY=${CMAKE_SOURCE_DIR}/tests
-D TEST_FILENAME=${test_filename}
-D CALLS=${calls_count}
-D TOLERANCE_GLES1=${tolerance}
-D TOLERANCE_GLES2=${ARGV5}
-P ${CMAKE_SOURCE_DIR}/test.cmake)
else (${ARGV4} STREQUAL "NOEXTRACT_RANGE")
add_test(${test_name}
${CMAKE_COMMAND}
-D LIBRARY_FOLDER=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-D TESTS_DIRECTORY=${CMAKE_SOURCE_DIR}/tests
-D TEST_FILENAME=${test_filename}
-D CALLS=${calls_count}
-D TOLERANCE_GLES1=${tolerance}
-D TOLERANCE_GLES2=${ARGV5}
-D EXTRACT_RANGE=${ARGV4}
-P ${CMAKE_SOURCE_DIR}/test.cmake)
endif (${ARGV4} STREQUAL "NOEXTRACT_RANGE")
else (${ARGC} EQUAL 5)
add_test(${test_name}
${CMAKE_COMMAND}
-D LIBRARY_FOLDER=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-D TESTS_DIRECTORY=${CMAKE_SOURCE_DIR}/tests
-D TEST_FILENAME=${test_filename}
-D CALLS=${calls_count}
-D TOLERANCE=${tolerance}
-P ${CMAKE_SOURCE_DIR}/test.cmake)
endif (${ARGC} EQUAL 5)
endmacro(create_test)
macro(create_test_GLES test_name GLES test_filename calls_count tolerance)
if (${ARGC} EQUAL 5)
add_test(${test_name}_GLES${GLES}
${CMAKE_COMMAND}
-D LIBRARY_FOLDER=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-D TESTS_DIRECTORY=${CMAKE_SOURCE_DIR}/tests
-D TEST_FILENAME=${test_filename}
-D CALLS=${calls_count}
-D TOLERANCE=${tolerance}
-D EXTRACT_RANGE=${ARGV4}
-D GLES_FORCED=${GLES}
-P ${CMAKE_SOURCE_DIR}/test.cmake)
else (${ARGC} EQUAL 5)
add_test(${test_name}_GLES${GLES}
${CMAKE_COMMAND}
-D LIBRARY_FOLDER=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-D TESTS_DIRECTORY=${CMAKE_SOURCE_DIR}/tests
-D TEST_FILENAME=${test_filename}
-D CALLS=${calls_count}
-D TOLERANCE=${tolerance}
-D GLES_FORCED=${GLES}
-P ${CMAKE_SOURCE_DIR}/test.cmake)
endif (${ARGC} EQUAL 5)
endmacro(create_test_GLES)
create_test(GLXgears glxgears "0000008203" 25 "NOEXTRACT_RANGE" 700)
create_test(StuntCarRacer stuntcarracer "0000118817" 20 "638x478+1+1")
create_test(Neverball neverball "0000078750" 20 "798x478+1+1" 200)
create_test(FoobillardPlus foobillardplus "0000014748" 20 "798x478+1+1" 60)
create_test(PointSprite pointsprite "0000248810" 20)
create_test_GLES(OpenRA 2 openra "0000031249" 20 "638x478+1+1")
create_test_GLES(GLSL_lighting 2 glsl_lighting "0000505393" 20)

View file

@ -0,0 +1,87 @@
Compiling
----
*for Pandora*
`mkdir build; cd build; cmake .. -DPANDORA=1; make`
*or for the Raspberry Pi*
`mkdir build; cd build; cmake .. -DBCMHOST=1; make`
*or for the ODroid*
`mkdir build; cd build; cmake .. -DODROID=1; make`
*or for the OrangePI*
use ODROID profile.
*or for CHIP machines*
`mkdir build; cd build; cmake .. -DCHIP=1; make`
*or for Android*
An Android.mk is provided that should compile with an NDK
*or use ccmake*
Alternatively, you can use the curses-bases ccmake (or any other gui frontend for cmake) to select wich platform to use interactively.
*for other board*
You can avoid the use of X11 with `NOX11=1` and EGL with `NOEGL=1`, but then, you will need to create the EGL Context yourself (or using SDL for example). Be sure to synchronize the context you create with the Backend you use. By default GLES 1.1 backend is used. To used GLES2 by default, use `DEFAULT_ES=2`
You can use cmake and mix command line argument to custom build your version of GL4ES. For example, for a generic ARM with NEON platform, not using X11 or EGL, defaulting to GLES2 backend, and enabling RPi, you would do:
`mkdir build; cd build; cmake .. -DBCMHOST=1 -DNOEGL=1 -DNOX11=1 -DDEFAULT_ES=2 -DCMAKE_C_FLAGS="-marm -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard" ; make`
----
Testing
----
A few tests are included.
They can be launched with `tests/tests.sh`
You will need apitrace and imagemagick for them to run. (on debian and friend, it's `sudo apt install apitrace-gl-frontend imagemagick`)
The tests use a pre-recorded GL trace that is replayed, then a specific frame is captured and compared to a reference picture.
Because each renderer may render slightly differently, there are some fuzz in the comparison, so only significant changes will be detected.
For now, 2 tests are done, one with glxgears (basic testing, using mostly glBegin / glEnd) and stuntcarracer (with more GL stuff, textures and lighting).
----
Per-platform
----
##### OpenPandora
This is the main developpement platform for now. GL4ES works on all 3 models (CC, Rebirth and Gigahertz), and with all driver version.
For the SGX Driver version that doesn't support X11 Windowed mode (i.e. there is no `/usr/lib/libpvrPVR2D_X11WSEGL.so` library in the firmware), you need to use one of the framebuffer output: `LIBGL_FB=1` is the fastest, but you may need `LIBGL_FB=2` if you need 32bits framebuffer, or `LIBGL_FB=3` if you need GL in a Window (but it will be slow, as each frame has to be blitted back in the X11 windows).
On the Pandora, the special `LIBGL_GAMMA` can be used also, to boost gamma at load, using firmware command to change LCD gamma.
##### ODroid
GL4ES works well on ODroid. I can test on XU4 model, but it has been reported to work on all model, including 64bits version.
On ODroid, the EGL context can be created with SRGB attribute, by using `LIBGL_SRGB=1`, for a nice boost in the gamma (supported on most ODroid).
##### OrangePI
GL4ES works on OrangePI using ODROID profile. GLES Hardware is MALI and is similar to ODroid in many way. I don't own any OrangePI but I have seen many success in compiling and using the lib.
##### C.H.I.P.
GL4ES should work on CHIP and PocketCHIP. Framebuffers mode will probably not work, with only `LIBGL_FB=3` mode that seems to work fine, and with adequate performances (there is probably no slow blit, as the driver handle directly the GL->X11 blit).
Also, on the CHIP, you will probably need to do `sudo apt-get install chip-mali-userspace` to be sure the GLES driver of the CHIP is present.
##### RaspberryPI
GL4ES works on RaspberryPI. I don't own any RPi model, so I cannot fine tune it for this plateform.
Framebuffer mode should work on this plateform. It seems `LIBGL_FB=3` gives good result and should be used in most cases. `LIBGL_FB=1` try to use `DispManX` for more speed. Be aware that if you use X-less config, many SDL version dedicated to DispManX do not handle GL context creation. So trying to create a GL context with this version of SDL will fail, but GL4ES is never called, so I cannot "fix" that (the fix would be inside SDL/DispManX driver). Also, GLES 1.1 seems to be deprecated in latest version of the OS, so you may need to use ES2.0 backend.
##### Android
On Android build of GL4ES, no X11 function are called. So most `glX` function are not defined. That means that the GL context (in fact a GLES1.1 context) has to be created by other apps (mainly SDL or SDL2).
On Android version 4.0 and earlier, there is a bug that prevent dlopen to be called inside dlopen (see [here](http://grokbase.com/t/gg/android-ndk/124bdvscqx/block-with-calling-dlopen-and-dlclose)).
GL4ES use a "library constructor" to initialize itself a load, and that constructor do some dlopen (to load EGL and GLES libraries), so it will trigger that bug.
If you are targeting a wide range of device, you should probably activate the workaround:
1. Modify [Android.mk](Android.mk) to uncomment `#LOCAL_CFLAGS += -DNO_INIT_CONSTRUCTOR` near the end of the file, to prevent the use of the library constructor.
2. In your code, call `void initialize_gl4es()` as soon as possible after loading GL4ES, and before using any GL function.
To try the GLES2 backend, you can compile gl4es with ES2 by default (so you don't have to mess with env. variable). Simply uncomment `#LOCAL_CFLAGS += -DDEFAULT_ES=2`, and create the GL Context as GLES2.

View file

@ -0,0 +1,20 @@
Copyright (c) 2016-2018 Sebastien Chevalier
Copyright (c) 2013-2016 Ryan Hileman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View file

@ -0,0 +1,41 @@
GL4ES - OpenGL for GLES Hardware
====
Many OpenGL software already works with GL4ES.
![foobillards++](refs/foobillardplus.0000014748.png)
Complex OpenGL 1.5 games, like Foobillard++, that uses cascaded display list, line stipple, TexGen, works fine. Here running on the OpenPandora. It will work with both GLES1.1 and GLES2.0 backend. Most OpenGL 1.x games will runs.
[![Play on Youtube](https://img.youtube.com/vi/75FYb60L7zw/0.jpg)](https://www.youtube.com/watch?v=75FYb60L7zw)
The limit is an hardware one: GLES1.1 and GLES2.0 hardware do not allow reading Depth buffer, so some games that use it (like AssultCube) for game play wont run. Some FPS are using it just for cosmetics (Lens flare), the they still run fine without, Like Serious Sam (both First and Second Encouter), here on the OpenPandora again.
[![Play on Youtube](https://img.youtube.com/vi/kJPb2jYiBoM/0.jpg)](https://www.youtube.com/watch?v=kJPb2jYiBoM)
More complex program, like Blender, can also run.
![MineCraft](media/minecraft.png)
But also Minecraft, here on an ODroid in this old video.
![OpenRA](refs/openra.0000031249.png)
On the OpenGL 2.0, side using GLES2.0 backend, OpenRA can run on the Pandora.
And OpenGL 2.x opens a lot of dors. Many commercial games run just fine on gl4es.
[![Play on Youtube](https://img.youtube.com/vi/VUoeHWuwlMU/0.jpg)](https://www.youtube.com/watch?v=VUoeHWuwlMU)
Here some FNA games, running on an ODroid XU4 (using method described [there](https://magazine.odroid.com/article/playing-modern-fna-games-on-the-odroid-platform/)). That video show just a few, and even more can be make to run.
[![Play on Youtube](https://img.youtube.com/vi/B4YN37z3-ws/0.jpg)](https://www.youtube.com/watch?v=B4YN37z3-ws)
And with [Box86](https://github.com/ptitSeb/box86), even more commercial games can run, like here NeverWinter Night on an ODroid XU4

View file

@ -0,0 +1,90 @@
GL4ES - OpenGL for GLES Hardware
====
![gl4es build status](https://api.travis-ci.org/ptitSeb/gl4es.png "gl4es build status")
This is a library provide OpenGL 2.x functionality for GLES2.0 accelerated Hardware (and of course also support OpenGL 1.5 function, sometimes better then when using GLES 1.1 backend)
There is also support for GLES 1.1 Hardware, emulating OpenGL 1.5, and some OpenGL 2.x+ extensions, but without shaders.
GL4ES is known to work on many platform: OpenPandora, ODroid, RaspberryPI (2 and 3 at least), PocketCHIP, "otherfruit"PI (like the OrangePI), Android, x86 and x86_64 Linux (tested using mesa-egl). There is also some WIP support for AmigaOS4, using experimental GLES2 driver for Warp3D.
This library is based on glshim (https://github.com/lunixbochs/glshim) but as now evolved far from it, with different feature set and objectives. Go check this lib if you need things like RemoteGL or TinyGLES (for 100% software rendering).
The focus is on compatibility and speed with a wide selection of game and software.
It has been tested successfully of a large selection of games and software, including: Minecraft, OpenMW, SeriousSam (both First and Second Encounters), RVGL (ReVolt GL), TSMC (The Secret Maryo Chronicles), TORCS, SpeedDreams, GL-117, Foobillard(plus), Blender 2.68 to name just a few. I have also some success with Linux port of XNA games, using either MonoGame or FNA.
Most function of OpenGL up to 1.5 are supported, with some notable exceptions:
* Reading of Depth or Stencil buffer will not work
* GL_FEEDBACK mode is not implemented
* No Accum emulation
Some known general limitations:
* GL_SELECT as some limitation in its implementation (for exemple, current Depth buffer or binded texture are not taken into account, also custom vertex shader will not work here)
* NPOT texture are supported, but not with GL_REPEAT / GL_MIRRORED, only GL_CLAMP will work properly (unless the GLES Hardware support NPOT)
* Multiple Color attachment on Framebuffer are not supported
* OcclusionQuery is implemented, but with a 0 bits precision
* Probably many other things
Status of the GLES2 backend
* The FPE (Fixed Pipeline Emulator) has most OpenGL 1.5 drawing call implemented
* The Shader Conversion is really crude, so only simple shaders will work (especialy, the implicit conversion float <-> int is not handled)
* Lighting support double-side and color separation
* FogCoord are supported, along with secondary color
* An ES2 context should be usable (usefull for SDL2)
* OpenGL 2.x games that have been tested include: OpenRA, GZDoom, Danger from the Deep, SuperTuxKart 0.8.1, Hammerwatch, OpenMW, many FNA & MonoGames games (FEZ, Towerfall Ascension, Stardew Valley, Dust, Owlboy, and many other)...
* glxgears works, but FlatShade is not implemented (and will probably never be), so it's slightly different then using GLES1.1 or actuel GL hardware
* GL_TEXTURE_1D, GL_TEXTURE_3D and GL_TEXTURE_RECTANGLE_ARB are not yet supported in shaders (they are supported in fixed pipeline functions), and texture 3D are just a single 2D layer for now.
* Program that link only a GL_FRAGMENT or GL_VERTEX shader are not supported yet.
Status of the GLES1.1 backend
* Framebuffer use FRAMEBUFFER_OES extension (that must be present in the GLES 1.1 stack)
* Lighting doesn't support double-side or color separation
* FogCoord or Secondary colors are not supported
* GL_TEXTURE_3D are just a single 2D layer (the 1st layer).
If you use gl4es in your project (as a static or dynamic link), please mention gl4es in you readme / about / whatever.
----
Compiling
----
How to compile and per-platform specific comment can be found [here](COMPILE.md)
----
GLU
----
Standard GLU do works without any issues. You can find a version [here](https://github.com/ptitSeb/GLU) if you need one.
----
Installation
----
Put lib/libGL.so.1 in your `LD_LIBRARY_PATH`.
Beware that GL4ES is meant to replace any libGL you can have on your system (like Mesa for example)
----
Usage
----
There are many environnement variable to control gl4es behavour, also usable at runtime using `glHint(...)`.
See [here](USAGE.md) for all variables and what they do.
----
Media (what is working already)
----
Some screenshot and youtube links of stuffs that works [here](MEDIA.md)
----
Version history
----
The change log is [here](CHANGELOG.md)

View file

@ -0,0 +1,320 @@
Usage
----
There are many environnement variable to control gl4es behavour. All are numeric, except LIBGL_VERSION that take a string, LIBGL_FBO that takes a 2d size (WxH), and both LIBGL_EGL and LIBGL_GLES that take path/filename.
You can also change many of this variable at runtime using the `glHint(...)` function. See [gl4eshint.h](include/gl4eshint.h) for the list of #define to use in this function.
##### LIBGL_FB
Controls the Framebuffer output
* 0 : Default, using standard x11 rendering
* 1 : Use Framebuffer output (x11 bypassed, only fullscreen)
* 2 : Use Framebuffer, but also an intermediary FBO
* 3 : Use PBuffer, allowing x11 (and windowed) rendering even if driver doesn't support it
##### LIBGL_ES
Controls the version of GLES to use
* 0 : Default, using GLES 2.0 backend (unless built with DEFAULT_ES 1) (not on Pandora, still GLES 1.1 backend by default)
* 1 : Use GLES 1.1 backend
* 2 : Use GLES 2.0 backend
##### LIBGL_GL
Controls the version of OpenGL exposed
* 0 : Default, expose OpenGL 1.5 when using GLES1.1 or OpenGL 2.0 when using GLES2.0
* 15: Expose OpenGL 1.5
* 20: Expose OpenGL 2.0
* 21: Expose OpenGL 2.1
##### LIBGL_XREFRESH
Debug helper in specific cases
* 0 : Default, nothing special
* 1 : xrefresh will be called on cleanup
##### LIBGL_STACKTRACE
Automatic Backtrace log
* 0 : Default, nothing special
* 1 : stacktrace will be printed on crash
##### LIBGL_FPS
Print current FPS to the console
* 0 : Defaut, don't mesure or printf FPS
* 1 : Print FPS (on stdout) every second
##### LIBGL_VSYNC
VSync control
* 0 : Default, nothing special
* 1 : vsync enabled
##### LIBGL_RECYCLEFBO
Recycling FBO special case (don't delete a created FBO, but recycle it if needed)
* 0 : Default, nothing special
* 1 : Recycling of FBO enabled
##### LIBGL_MIPMAP
Handling of Manual and Automatic MIPMAP
* 0 : Default, nothing special
* 1 : AutoMipMap forced
* 2 : guess AutoMipMap (based on manual mipmaping on textures)
* 3 : ignore MipMap (mipmap creation / use entirely disabled)
* 4 : ignore AutoMipMap on non-squared textures
* 5 : calculate all sub-mipmap one time when uploading level 1
##### LIBGL_FORCENPOT
Forcing NPOT (Non-Power of Two) Texture size.
* 0 : Default, nothing special
* 1 : If hardware only support Limited NPOT, then disabling MIPMAP (i.e. LIBGL_MIPMAP=3), so all texture can be NPOT.
If Hardware support full NPOT, do nothing special. Usefull for GLES2 backend where limited NPOT is always supported.
##### LIBGL_TEXCOPY
Make a local copy of every texture for easy glGetTexImage2D
* 0 : Default, nothing special
* 1 : Texture copy enabled
##### LIBGL_SHRINK
Texture shrinking control
* 0 : Default, nothing special
* 1 : everything / 2 (using original algorithm for size reduction, all other shink mode use a refined algorithm)
* 2 : only textures wich one size > 512 are / 2
* 3 : only textures wich one size > 256 are / 2
* 4 : only textures wich one size > 256 are / 2, and the one > 1024 are / 4
* 5 : only textures wich one size > 256 are resized to 256 (if possible, because only /2 and /4 exists), but empty texture are not shrinked
* 6 : only textures wich one size > 128 are / 2, thoses >= 512 are resized to 256 (if possible, because only /2 and /4 exists), but empty texture are not shrinked
* 7 : only textures wich one size > 512 are / 2, but empty texture are not shrinked
* 8 : advertise a max texture size *4, but every texture wich one size > 2048 are shrinked to 2048
* 9 : advertise a max texture size *4, but every texture wich one size > 4096 are / 4 and the one > 512 are / 2, but empty texture are not shrinked
* 10: advertise a max texture size *4, but every texture wich one size > 2048 are / 4 and the one > 512 are / 2, but empty texture are not shrinked
* 11: advertise a max texture size *2, but every texture with one dimension > max texture size will get shrinked to max texture size
##### LIBGL_TEXDUMP
Texture dump
* 0 : Default, nothing special
* 1 : Texture dump enabled
##### LIBGL_ALPHAHACK
Experimental: enable Alpha test only when using texture that contains an alpha channel
* 0 : Default, nothing special
* 1 : Alpha Hack enabled
##### LIBGL_NODOWNSAMPLING
Texture downsampling control (deprecated, use LIBGL_AVOID16BITS instead)
* 0 : Default, DXTc texture are downsampled to 16bits
* 1 : DXTc texture are left as 32bits RGBA
##### LIBGL_STREAM
PANDORA only: enable Texture Streaming (works only on RGB textures)
* 0 : Default, nothing special
* 1 : Enabled on empty RGB textures
* 2 : Enabled on all RGB textures
##### LIBGL_COPY
Removed (Controled the glCopyTex(Sub)Image2D hack, it's now automatic, depending on how compatible is the readed framebuffer)
##### LIBGL_NOLUMALPHA
Control the availability of the LUMUNANCE_ALPHA format (can be buggy on Pandora model CC)
* 0 : Default,GL_LUMINANCE_ALPHA is available and used if needed
* 1 : GL_LUMINANCE_ALPHA hardware support disabled (a GL_RGBA texture will be used instead)
##### LIBGL_BLENDHACK
Experimental: Change Blend GL_SRC_ALPHA, GL_ONE to GL_ONE, GL_ONE
* 0 : Default, nothing special
* 1 : Change Blend GL_SRC_ALPHA, GL_ONE to GL_ONE, GL_ONE (can be usefull for Xash3D engine)
##### LIBGL_BLENDCOLOR
Hack: Export a (faked) glBlendColor
* 0 : Default, don't expose gBlendColor
* 1 : Exposed the function (if no hadware support, faked function willbe used)
##### LIBGL_VERSION
Hack: Control the glGetString version. Overide version string (should be in the form of "1.x")
##### LIBGL_BATCH
This has been changed with v1.0.5.
Now BATCH simply try to merge subsequents glDrawXXXXX (glDrawArrays, glDrawElements...). It only try to merge if arrays is less the 10*N vertices
The Batching stop when there is a change of GL State, but also if an Array of more then 100*N is encountered.
* 0 : Default: don't try to merge glDrawXXXXX
* N : Any number: try to merger arrays, 1st must be less than 10*N, max is 100*N vertices
##### LIBGL_NOERROR
Hack: glGetError() always return GL_NOERROR
* 0 : Default, glGetError behave as it should
* 1 : glGetError never fail.
##### LIBGL_GAMMA
Pandora Hack: Set a Gamma value (in decimal formal, 1.0 means no gamma boost)
* X.Y : Use X.Y as gamma when creating context (typical value can be 1.6 or 2.0)
##### LIBGL_SRGB
ODROID Hack: Enable sRGB Surface (so Gamma corrected), if Hardware support it
* 0 : Default, don't try to use sRGB surface
* 1 : Enable sRGB Surface (but support will be tested first, must have EGL_KHR_gl_colorspace extension)
##### LIBGL_FASTMATH
Hack: Activate some Fast Math in processor/coprocessor
* 0 : Default, nothing special
* 1 : On OpenPandora and CHIP, activate "RunFast" on Cortex-A8 (mode default NaN, flush-to-zero)
: Not implemented on other platforms (will do nothing)
##### LIBGL_SILENTSTUB
Debug: Hide or Show the Sub / Not found message
* 0 : The messages for Stub or absend function are printed
* 1 : Default, don't print the STUB or glXGetProcAddress glXXXXX not found message
##### LIBGL_NOBANNER
Show/Hide initial text
* 0 : Default, print starting message
* 1 : Silent: no LIBGL message at start (combine with LIBGL_SILENTSTUB for more silence)
##### LIBGL_NPOT
Expose NPOT (Non Power of Two) Support
* 0 : Default, expose the extension that are availble by the GLES backend
* 1 : Expose limited NPOT extension
* 2 : Expose GL_ARB_texture_non_power_of_two extension
##### LIBGL_GLQUERIES
Expose glQueries functions
* 0 : Don't expose the function (fake one will be used if called)
* 1 : Default, expose fake functions (always answer 0)
##### LIBGL_NOTEXMAT
Handling of Texture Matrix
* 0 : Default, perform handling internaly (better handling of NPOT texture on all hardware)
* 1 : Let the driver handle texmat (can be faster in some cases, but NPOT texture may be broken)
##### LIBGL_NOTEST
Initial Hardware test
* 0 : Default, perform intial hardware testing (using a PBuffer)
* 1 : Do not perform test (no extensions tested or used)
##### LIBGL_NOVAOCACHE
VAO Caching
* 0 : Default, try to cache vao to avoid memcpy in render list
* 1 : Don't cache VAO
##### LIBGL_VABGRA
Vertex Array BGRA extension
* 0 : Default, GL_ARB_vertex_array_bgra not exposed (still emulated)
* 1 : Extension exposed may be faster in some cases (Arx Libertatis mainly)
##### LIBGL_BEGINEND
Merge of subsequent glBegin/glEnd blocks (will be non-effective if BATCH mode is used)
* 0 : Don't try to merge
* 1 : Try to merge, even if there is a glColor / glNormal in between (default)
##### LIBGL_AVOID16BITS
Try to avoid 16bits textures
* 0 : Default, use 16bits texture if it can avoid a convertion or for DXTc textures
* 1 : Use 32bits texture unless specifically requested (using internalformat)
##### LIBGL_AVOID24BITS
Try to avoid 24bits textures (i.e. GL_RGB)
* 0 : Default, use 24bits texture when it's possible
* 1 : Force 32bits textures when GL_RGB is asked (as internal or not). Not recommanded, as it may break some blend functions (especialy on GLES 1.1 backend). Does not impact 16bits formats.
##### LIBGL_FORCE16BITS
Try to use 16bits textures
* 0 : Default, don't force 16bits texture
* 1 : Use 16bits texture instead of 32bits (i.e. use RGBA4 instead of RGBA8 and RGB5 instead of RGB8)
##### LIBGL_POTFRAMEBUFFER
Use only Power Of Two dimension for Framebuffer
* 0 : Default, use NPOT dimension if supported
* 1 : Force Framebuffer to be created with POT dimension (not advised on GLES2 backend)
##### LIBGL_NOBGRA
Ignore BGRA Texture hardware extension
* 0 : Default, use BGRA extension if possible
* 1 : Ignore BGRA extension, even if supported by GLES hardware
##### LIBGL_NOHIGHP
Usage of highp precision in fragment shader (ES2 backend only)
* 0 : Default, use highp if available
* 1 : Disable usage of highp in Fragment shaders
##### LIBGL_COMMENTS
Comments in shaders are kept (also for generated shaders by fpe_shaders)
* 0 : Default, no comments in shaders sent to GLES Hardware
* 1 : Comments are left in Shaders sent to GLES Hardware
##### LIBGL_DEFAULTWRAP
Hack to define default WRAP mode for texture
* 0 : Default wrap mode is GL_REPEAT (normal OpenGL behavour): default on NPOT hardware
* 1 : Default wrap mode is GL_CLAMP_TO_EDGE: default on limited NPOT or non-NPOT hardware
* 2 : Default wrap mode is GL_CLAMP_TO_EDGE, enforced (not advised)
##### LIBGL_FBOMAKECURRENT
Workaround for FBO and glXMakeCurrent (force unbind/bind FBO when changing context)
* 0 : Disabled (Default on most configuration)
* 1 : Enabled (Default if Vendor is ARM or if using LIBGL_FB 1 and 2)
##### LIBL_FBOUNBIND
Workaround on FBO where a binded texture is used for drawing
* 0 : Disabled (Default for all other configuration)
* 1 : Enabled (Default on ARM and PowerVR hardware)
##### LIBGL_FBOFORCETEX
For the Color Attachment 0 to be a Texture2D (even if program attachs a Renderbuffer) => may speedup glBlitFramebuffer if used
* 0 : Default, don't force
* 1 : For Color Attachment 0 of FBO to be a texture
##### LIBGL_FBO
Hack: define custom dimension for FBO (only used with LIBGL_FBO=2)
* WxH : Define FBO of WxH size (ex: LIBGL_FBO=1280x720)
##### LIBGL_NOTEXARRAY
Hack to force using discrete Texture instead of Array in all shader
* 0 : Default: Array of texture is used in shaders (not in FPE generated ones)
* 1 : Individual texture are forced in shaders (shaders may fail to compile if array are accessed by indice)
##### LIBGL_LOGSHADERERROR
Log to the console Shader Compile error, with initial and ShaderConv'd source of the shader
* 0 : Default, don't log
* 1 : Log Shader Compilation Errors
##### LIBGL_SHADERNOGLES
Don't use GL_ES part in shaders
* 0 : Default, let GL_ES part in shader
* 1 : Remove the GL_ES part in shader (usefull for Löve for example)
##### LIBGL_NODEPTHTEX
Disable the use of Depth texture
* 0 : Default, Use Depth Texture if supported by Hardware
* 1 : Disable the use of Depth Texture (renderbuffer will be used in FBO)
##### LIBGL_FLOAT
Expose support for FLOAT and HALF_FLOAT Texture support (and has attachement to FBO)
* 0 : Don't exposed, even if supported in hardware
* 1 : Default, exposed what is supported by hardware
* 2 : Force exposed, even if no supported (will be emulated has GL_UNSIGNED_BYTE if not supported)
##### LIBGL_GLXRECYCLE
Recycle EGLSurface per Drawable, instead of destroying them
* 0 : Default, don't recycle
* 1 : Don't destroy EGLSurface, per reused them per drawable (can fix EGL_BAD_ALLOC error). EGLSurface are never destroyed in this mode for now.
##### LIBGL_NOCLEAN
Debug: don't clean GLContext when they are destroy
* 0 : Default, clean GLContext
* 1 : Don't clean GLContext
##### LIBGL_EGL
Define EGL lib to use. Default folder are the standard one for dynamic librarie loading (LD_LIBRARY_PATH and friend) plus "/opt/vc/lib/", /usr/local/lib/" and "/usr/lib/".
* by default try to use libbrcmEGL and libEGL
* filename: try to load from the defaults folder (don't forget to use complete filename, with ".so" extension). If not found/loaded, default one will be tried.
* /path/to/filename: try to use exact path/filename. If not found/loaded, default one will be tried.
##### LIBGL_GLES
Define GLES(2) lib to use. Default folder are the standard one for dynamic librarie loading (LD_LIBRARY_PATH and friend) plus "/opt/vc/lib/", /usr/local/lib/" and "/usr/lib/". Be sure to point to correct GLES library depanding on wich GLES backend you are using.
* by default try to use libGLESv1_CM, libGLES_CM or libbrcmGLESv1_CM for GLES1.1 and libGLESv2_CM, libGLESv2 or libbrcmGLESv2 for GLES2 backend
* filename: try to load from the defaults folder (don't forget to use complete filename, with ".so" extension). If not found/loaded, default one will be tried.
* /path/to/filename: try to use exact path/filename. If not found/loaded, default one will be tried.
##### LIBGL_DBGSHADERCONV
Log to the console all shaders before and after conversion
* 0 : Default: don't log anything
* 1 : Log Vertex Shader
* 2 : Log Framegent Shader
* 4 : Log Shaders before going to Shaderconv
* 8 : Log Shaders after going to Shaderconv
Note that you can combine (logical or state. So 14 will be only Fragment shader before and after shaderconv)
Note also that if neither Fragment and Vertex are defined, both will be selected. Same for Before and After.
At last, the value "1" will be changed to "15", to log everything.

View file

@ -0,0 +1,2 @@
theme: jekyll-theme-hacker
title: GL4ES - The OpenGL driver for GLES Hardware

View file

@ -0,0 +1,84 @@
/**********************************************************************
*
* Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
* Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful but, except
* as otherwise stated in writing, without any warranty; without even the
* implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
* Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#ifndef __BC_CAT_H__
#define __BC_CAT_H__
#include <linux/ioctl.h>
#define BC_FOURCC(a,b,c,d) \
((unsigned long) ((a) | (b)<<8 | (c)<<16 | (d)<<24))
#define BC_PIX_FMT_NV12 BC_FOURCC('N', 'V', '1', '2') /*YUV 4:2:0*/
#define BC_PIX_FMT_UYVY BC_FOURCC('U', 'Y', 'V', 'Y') /*YUV 4:2:2*/
#define BC_PIX_FMT_YUYV BC_FOURCC('Y', 'U', 'Y', 'V') /*YUV 4:2:2*/
#define BC_PIX_FMT_RGB565 BC_FOURCC('R', 'G', 'B', 'P') /*RGB 5:6:5*/
enum BC_memory {
BC_MEMORY_MMAP = 1,
BC_MEMORY_USERPTR = 2,
};
typedef struct BCIO_package_TAG {
int input;
int output;
}BCIO_package;
/*
* the following types are tested for fourcc in struct bc_buf_params_t
* NV12
* UYVY
* RGB565 - not tested yet
* YUYV
*/
typedef struct bc_buf_params {
int count; /*number of buffers, [in/out]*/
int width; /*buffer width in pixel, multiple of 8 or 32*/
int height; /*buffer height in pixel*/
unsigned int fourcc; /*buffer pixel format*/
enum BC_memory type;
} bc_buf_params_t;
typedef struct bc_buf_ptr {
unsigned int index;
int size;
unsigned long pa;
} bc_buf_ptr_t;
#define BCIO_GID 'g'
#define BC_IOWR(INDEX) _IOWR(BCIO_GID, INDEX, BCIO_package)
#define BCIOGET_BUFFERCOUNT BC_IOWR(0) /*obsolete, since BCIOREQ_BUFFERS
return the number of buffers*/
#define BCIOGET_BUFFERPHYADDR BC_IOWR(1) /*get physical address by index*/
#define BCIOGET_BUFFERIDX BC_IOWR(2) /*get index by physical address*/
#define BCIOREQ_BUFFERS BC_IOWR(3)
#define BCIOSET_BUFFERPHYADDR BC_IOWR(4)
#endif

View file

@ -0,0 +1,329 @@
/* -*- mode: c; tab-width: 8; -*- */
/* vi: set sw=4 ts=8: */
/* Reference version of egl.h for EGL 1.4.
* $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
*/
/*
** Copyright (c) 2007-2009 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#ifndef __egl_h_
#define __egl_h_
/* All platform-dependent types and macro boilerplate (such as EGLAPI
* and EGLAPIENTRY) should go in eglplatform.h.
*/
#include <EGL/eglplatform.h>
#ifdef __cplusplus
extern "C" {
#endif
/* EGL Types */
/* EGLint is defined in eglplatform.h */
typedef unsigned int EGLBoolean;
typedef unsigned int EGLenum;
typedef void *EGLConfig;
typedef void *EGLContext;
typedef void *EGLDisplay;
typedef void *EGLSurface;
typedef void *EGLClientBuffer;
/* EGL Versioning */
#define EGL_VERSION_1_0 1
#define EGL_VERSION_1_1 1
#define EGL_VERSION_1_2 1
#define EGL_VERSION_1_3 1
#define EGL_VERSION_1_4 1
/* EGL Enumerants. Bitmasks and other exceptional cases aside, most
* enums are assigned unique values starting at 0x3000.
*/
/* EGL aliases */
#define EGL_FALSE 0
#define EGL_TRUE 1
/* Out-of-band handle values */
#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
#define EGL_NO_CONTEXT ((EGLContext)0)
#define EGL_NO_DISPLAY ((EGLDisplay)0)
#define EGL_NO_SURFACE ((EGLSurface)0)
/* Out-of-band attribute value */
#define EGL_DONT_CARE ((EGLint)-1)
/* Errors / GetError return values */
#define EGL_SUCCESS 0x3000
#define EGL_NOT_INITIALIZED 0x3001
#define EGL_BAD_ACCESS 0x3002
#define EGL_BAD_ALLOC 0x3003
#define EGL_BAD_ATTRIBUTE 0x3004
#define EGL_BAD_CONFIG 0x3005
#define EGL_BAD_CONTEXT 0x3006
#define EGL_BAD_CURRENT_SURFACE 0x3007
#define EGL_BAD_DISPLAY 0x3008
#define EGL_BAD_MATCH 0x3009
#define EGL_BAD_NATIVE_PIXMAP 0x300A
#define EGL_BAD_NATIVE_WINDOW 0x300B
#define EGL_BAD_PARAMETER 0x300C
#define EGL_BAD_SURFACE 0x300D
#define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */
/* Reserved 0x300F-0x301F for additional errors */
/* Config attributes */
#define EGL_BUFFER_SIZE 0x3020
#define EGL_ALPHA_SIZE 0x3021
#define EGL_BLUE_SIZE 0x3022
#define EGL_GREEN_SIZE 0x3023
#define EGL_RED_SIZE 0x3024
#define EGL_DEPTH_SIZE 0x3025
#define EGL_STENCIL_SIZE 0x3026
#define EGL_CONFIG_CAVEAT 0x3027
#define EGL_CONFIG_ID 0x3028
#define EGL_LEVEL 0x3029
#define EGL_MAX_PBUFFER_HEIGHT 0x302A
#define EGL_MAX_PBUFFER_PIXELS 0x302B
#define EGL_MAX_PBUFFER_WIDTH 0x302C
#define EGL_NATIVE_RENDERABLE 0x302D
#define EGL_NATIVE_VISUAL_ID 0x302E
#define EGL_NATIVE_VISUAL_TYPE 0x302F
#define EGL_SAMPLES 0x3031
#define EGL_SAMPLE_BUFFERS 0x3032
#define EGL_SURFACE_TYPE 0x3033
#define EGL_TRANSPARENT_TYPE 0x3034
#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
#define EGL_TRANSPARENT_RED_VALUE 0x3037
#define EGL_NONE 0x3038 /* Attrib list terminator */
#define EGL_BIND_TO_TEXTURE_RGB 0x3039
#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
#define EGL_MIN_SWAP_INTERVAL 0x303B
#define EGL_MAX_SWAP_INTERVAL 0x303C
#define EGL_LUMINANCE_SIZE 0x303D
#define EGL_ALPHA_MASK_SIZE 0x303E
#define EGL_COLOR_BUFFER_TYPE 0x303F
#define EGL_RENDERABLE_TYPE 0x3040
#define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */
#define EGL_CONFORMANT 0x3042
/* Reserved 0x3041-0x304F for additional config attributes */
/* Config attribute values */
#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */
#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */
#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */
#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */
#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */
/* More config attribute values, for EGL_TEXTURE_FORMAT */
#define EGL_NO_TEXTURE 0x305C
#define EGL_TEXTURE_RGB 0x305D
#define EGL_TEXTURE_RGBA 0x305E
#define EGL_TEXTURE_2D 0x305F
/* Config attribute mask bits */
#define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */
#define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */
#define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */
#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */
#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */
#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */
#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */
#define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */
#define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */
#define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */
#define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */
/* QueryString targets */
#define EGL_VENDOR 0x3053
#define EGL_VERSION 0x3054
#define EGL_EXTENSIONS 0x3055
#define EGL_CLIENT_APIS 0x308D
/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */
#define EGL_HEIGHT 0x3056
#define EGL_WIDTH 0x3057
#define EGL_LARGEST_PBUFFER 0x3058
#define EGL_TEXTURE_FORMAT 0x3080
#define EGL_TEXTURE_TARGET 0x3081
#define EGL_MIPMAP_TEXTURE 0x3082
#define EGL_MIPMAP_LEVEL 0x3083
#define EGL_RENDER_BUFFER 0x3086
#define EGL_VG_COLORSPACE 0x3087
#define EGL_VG_ALPHA_FORMAT 0x3088
#define EGL_HORIZONTAL_RESOLUTION 0x3090
#define EGL_VERTICAL_RESOLUTION 0x3091
#define EGL_PIXEL_ASPECT_RATIO 0x3092
#define EGL_SWAP_BEHAVIOR 0x3093
#define EGL_MULTISAMPLE_RESOLVE 0x3099
/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */
#define EGL_BACK_BUFFER 0x3084
#define EGL_SINGLE_BUFFER 0x3085
/* OpenVG color spaces */
#define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */
#define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */
/* OpenVG alpha formats */
#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */
#define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */
/* Constant scale factor by which fractional display resolutions &
* aspect ratio are scaled when queried as integer values.
*/
#define EGL_DISPLAY_SCALING 10000
/* Unknown display resolution/aspect ratio */
#define EGL_UNKNOWN ((EGLint)-1)
/* Back buffer swap behaviors */
#define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */
#define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */
/* CreatePbufferFromClientBuffer buffer types */
#define EGL_OPENVG_IMAGE 0x3096
/* QueryContext targets */
#define EGL_CONTEXT_CLIENT_TYPE 0x3097
/* CreateContext attributes */
#define EGL_CONTEXT_CLIENT_VERSION 0x3098
/* Multisample resolution behaviors */
#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */
#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */
/* BindAPI/QueryAPI targets */
#define EGL_OPENGL_ES_API 0x30A0
#define EGL_OPENVG_API 0x30A1
#define EGL_OPENGL_API 0x30A2
/* GetCurrentSurface targets */
#define EGL_DRAW 0x3059
#define EGL_READ 0x305A
/* WaitNative engines */
#define EGL_CORE_NATIVE_ENGINE 0x305B
/* EGL 1.2 tokens renamed for consistency in EGL 1.3 */
#define EGL_COLORSPACE EGL_VG_COLORSPACE
#define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT
#define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB
#define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR
#define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE
#define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE
/* EGL extensions must request enum blocks from the Khronos
* API Registrar, who maintains the enumerant registry. Submit
* a bug in Khronos Bugzilla against task "Registry".
*/
/* EGL Functions */
EGLAPI EGLint EGLAPIENTRY eglGetError(void);
EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id);
EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor);
EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy);
EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name);
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs,
EGLint config_size, EGLint *num_config);
EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list,
EGLConfig *configs, EGLint config_size,
EGLint *num_config);
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
EGLint attribute, EGLint *value);
EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
EGLNativeWindowType win,
const EGLint *attrib_list);
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config,
const EGLint *attrib_list);
EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
EGLNativePixmapType pixmap,
const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface);
EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface,
EGLint attribute, EGLint *value);
EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api);
EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void);
EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void);
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void);
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer(
EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
EGLConfig config, const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface,
EGLint attribute, EGLint value);
EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config,
EGLContext share_context,
const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx);
EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw,
EGLSurface read, EGLContext ctx);
EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void);
EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw);
EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx,
EGLint attribute, EGLint *value);
EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void);
EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine);
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface,
EGLNativePixmapType target);
/* This is a generic function pointer type, whose name indicates it must
* be cast to the proper type *and calling convention* before use.
*/
typedef void (*__eglMustCastToProperFunctionPointerType)(void);
/* Now, define eglGetProcAddress using the generic function ptr. type */
EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY
eglGetProcAddress(const char *procname);
#ifdef __cplusplus
}
#endif
#endif /* __egl_h_ */

View file

@ -0,0 +1,477 @@
#ifndef __eglext_h_
#define __eglext_h_
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2007-2012 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <EGL/eglplatform.h>
/*************************************************************/
/* Header file version number */
/* Current version at http://www.khronos.org/registry/egl/ */
/* $Revision: 19571 $ on $Date: 2012-10-31 10:10:33 -0700 (Wed, 31 Oct 2012) $ */
#define EGL_EGLEXT_VERSION 14
#ifndef EGL_KHR_config_attribs
#define EGL_KHR_config_attribs 1
#define EGL_CONFORMANT_KHR 0x3042 /* EGLConfig attribute */
#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 /* EGL_SURFACE_TYPE bitfield */
#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 /* EGL_SURFACE_TYPE bitfield */
#endif
#ifndef EGL_KHR_lock_surface
#define EGL_KHR_lock_surface 1
#define EGL_READ_SURFACE_BIT_KHR 0x0001 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 /* EGL_SURFACE_TYPE bitfield */
#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 /* EGL_SURFACE_TYPE bitfield */
#define EGL_MATCH_FORMAT_KHR 0x3043 /* EGLConfig attribute */
#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 /* EGL_MATCH_FORMAT_KHR value */
#define EGL_FORMAT_RGB_565_KHR 0x30C1 /* EGL_MATCH_FORMAT_KHR value */
#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 /* EGL_MATCH_FORMAT_KHR value */
#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 /* EGL_MATCH_FORMAT_KHR value */
#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 /* eglLockSurfaceKHR attribute */
#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 /* eglLockSurfaceKHR attribute */
#define EGL_BITMAP_POINTER_KHR 0x30C6 /* eglQuerySurface attribute */
#define EGL_BITMAP_PITCH_KHR 0x30C7 /* eglQuerySurface attribute */
#define EGL_BITMAP_ORIGIN_KHR 0x30C8 /* eglQuerySurface attribute */
#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 /* eglQuerySurface attribute */
#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA /* eglQuerySurface attribute */
#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB /* eglQuerySurface attribute */
#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC /* eglQuerySurface attribute */
#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD /* eglQuerySurface attribute */
#define EGL_LOWER_LEFT_KHR 0x30CE /* EGL_BITMAP_ORIGIN_KHR value */
#define EGL_UPPER_LEFT_KHR 0x30CF /* EGL_BITMAP_ORIGIN_KHR value */
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface);
#endif
#ifndef EGL_KHR_image
#define EGL_KHR_image 1
#define EGL_NATIVE_PIXMAP_KHR 0x30B0 /* eglCreateImageKHR target */
typedef void *EGLImageKHR;
#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0)
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
#endif
#ifndef EGL_KHR_vg_parent_image
#define EGL_KHR_vg_parent_image 1
#define EGL_VG_PARENT_IMAGE_KHR 0x30BA /* eglCreateImageKHR target */
#endif
#ifndef EGL_KHR_gl_texture_2D_image
#define EGL_KHR_gl_texture_2D_image 1
#define EGL_GL_TEXTURE_2D_KHR 0x30B1 /* eglCreateImageKHR target */
#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC /* eglCreateImageKHR attribute */
#endif
#ifndef EGL_KHR_gl_texture_cubemap_image
#define EGL_KHR_gl_texture_cubemap_image 1
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 /* eglCreateImageKHR target */
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 /* eglCreateImageKHR target */
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 /* eglCreateImageKHR target */
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 /* eglCreateImageKHR target */
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 /* eglCreateImageKHR target */
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 /* eglCreateImageKHR target */
#endif
#ifndef EGL_KHR_gl_texture_3D_image
#define EGL_KHR_gl_texture_3D_image 1
#define EGL_GL_TEXTURE_3D_KHR 0x30B2 /* eglCreateImageKHR target */
#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD /* eglCreateImageKHR attribute */
#endif
#ifndef EGL_KHR_gl_renderbuffer_image
#define EGL_KHR_gl_renderbuffer_image 1
#define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */
#endif
#if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */
#ifndef EGL_KHR_reusable_sync
#define EGL_KHR_reusable_sync 1
typedef void* EGLSyncKHR;
typedef khronos_utime_nanoseconds_t EGLTimeKHR;
#define EGL_SYNC_STATUS_KHR 0x30F1
#define EGL_SIGNALED_KHR 0x30F2
#define EGL_UNSIGNALED_KHR 0x30F3
#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5
#define EGL_CONDITION_SATISFIED_KHR 0x30F6
#define EGL_SYNC_TYPE_KHR 0x30F7
#define EGL_SYNC_REUSABLE_KHR 0x30FA
#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 /* eglClientWaitSyncKHR <flags> bitfield */
#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull
#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0)
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync);
EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync);
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
#endif
#endif
#ifndef EGL_KHR_image_base
#define EGL_KHR_image_base 1
/* Most interfaces defined by EGL_KHR_image_pixmap above */
#define EGL_IMAGE_PRESERVED_KHR 0x30D2 /* eglCreateImageKHR attribute */
#endif
#ifndef EGL_KHR_image_pixmap
#define EGL_KHR_image_pixmap 1
/* Interfaces defined by EGL_KHR_image above */
#endif
#ifndef EGL_IMG_context_priority
#define EGL_IMG_context_priority 1
#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100
#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101
#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102
#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103
#endif
#ifndef EGL_KHR_lock_surface2
#define EGL_KHR_lock_surface2 1
#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110
#endif
#ifndef EGL_NV_coverage_sample
#define EGL_NV_coverage_sample 1
#define EGL_COVERAGE_BUFFERS_NV 0x30E0
#define EGL_COVERAGE_SAMPLES_NV 0x30E1
#endif
#ifndef EGL_NV_depth_nonlinear
#define EGL_NV_depth_nonlinear 1
#define EGL_DEPTH_ENCODING_NV 0x30E2
#define EGL_DEPTH_ENCODING_NONE_NV 0
#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
#endif
#if KHRONOS_SUPPORT_INT64 /* EGLTimeNV requires 64-bit uint support */
#ifndef EGL_NV_sync
#define EGL_NV_sync 1
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6
#define EGL_SYNC_STATUS_NV 0x30E7
#define EGL_SIGNALED_NV 0x30E8
#define EGL_UNSIGNALED_NV 0x30E9
#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001
#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull
#define EGL_ALREADY_SIGNALED_NV 0x30EA
#define EGL_TIMEOUT_EXPIRED_NV 0x30EB
#define EGL_CONDITION_SATISFIED_NV 0x30EC
#define EGL_SYNC_TYPE_NV 0x30ED
#define EGL_SYNC_CONDITION_NV 0x30EE
#define EGL_SYNC_FENCE_NV 0x30EF
#define EGL_NO_SYNC_NV ((EGLSyncNV)0)
typedef void* EGLSyncNV;
typedef khronos_utime_nanoseconds_t EGLTimeNV;
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync);
EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync);
EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync);
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value);
#endif
#endif
#if KHRONOS_SUPPORT_INT64 /* Dependent on EGL_KHR_reusable_sync which requires 64-bit uint support */
#ifndef EGL_KHR_fence_sync
#define EGL_KHR_fence_sync 1
/* Reuses most tokens and entry points from EGL_KHR_reusable_sync */
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0
#define EGL_SYNC_CONDITION_KHR 0x30F8
#define EGL_SYNC_FENCE_KHR 0x30F9
#endif
#endif
#ifndef EGL_HI_clientpixmap
#define EGL_HI_clientpixmap 1
/* Surface Attribute */
#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74
/*
* Structure representing a client pixmap
* (pixmap's data is in client-space memory).
*/
struct EGLClientPixmapHI
{
void* pData;
EGLint iWidth;
EGLint iHeight;
EGLint iStride;
};
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI(EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
#endif /* EGL_HI_clientpixmap */
#ifndef EGL_HI_colorformats
#define EGL_HI_colorformats 1
/* Config Attribute */
#define EGL_COLOR_FORMAT_HI 0x8F70
/* Color Formats */
#define EGL_COLOR_RGB_HI 0x8F71
#define EGL_COLOR_RGBA_HI 0x8F72
#define EGL_COLOR_ARGB_HI 0x8F73
#endif /* EGL_HI_colorformats */
#ifndef EGL_MESA_drm_image
#define EGL_MESA_drm_image 1
#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 /* CreateDRMImageMESA attribute */
#define EGL_DRM_BUFFER_USE_MESA 0x31D1 /* CreateDRMImageMESA attribute */
#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 /* EGL_IMAGE_FORMAT_MESA attribute value */
#define EGL_DRM_BUFFER_MESA 0x31D3 /* eglCreateImageKHR target */
#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4
#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 /* EGL_DRM_BUFFER_USE_MESA bits */
#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 /* EGL_DRM_BUFFER_USE_MESA bits */
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
#endif
#ifndef EGL_NV_post_sub_buffer
#define EGL_NV_post_sub_buffer 1
#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
#endif
#ifndef EGL_ANGLE_query_surface_pointer
#define EGL_ANGLE_query_surface_pointer 1
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean eglQuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
#endif
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
#endif
#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle
#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1
#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200
#endif
#ifndef EGL_NV_coverage_sample_resolve
#define EGL_NV_coverage_sample_resolve 1
#define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131
#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132
#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133
#endif
#if KHRONOS_SUPPORT_INT64 /* EGLuint64NV requires 64-bit uint support */
#ifndef EGL_NV_system_time
#define EGL_NV_system_time 1
typedef khronos_utime_nanoseconds_t EGLuint64NV;
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV(void);
EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV(void);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void);
typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void);
#endif
#endif
#if KHRONOS_SUPPORT_INT64 /* EGLuint64KHR requires 64-bit uint support */
#ifndef EGL_KHR_stream
#define EGL_KHR_stream 1
typedef void* EGLStreamKHR;
typedef khronos_uint64_t EGLuint64KHR;
#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0)
#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210
#define EGL_PRODUCER_FRAME_KHR 0x3212
#define EGL_CONSUMER_FRAME_KHR 0x3213
#define EGL_STREAM_STATE_KHR 0x3214
#define EGL_STREAM_STATE_CREATED_KHR 0x3215
#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216
#define EGL_STREAM_STATE_EMPTY_KHR 0x3217
#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218
#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219
#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A
#define EGL_BAD_STREAM_KHR 0x321B
#define EGL_BAD_STATE_KHR 0x321C
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC)(EGLDisplay dpy, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
#endif
#endif
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
#ifndef EGL_KHR_stream_consumer_gltexture
#define EGL_KHR_stream_consumer_gltexture 1
#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
#endif
#endif
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
#ifndef EGL_KHR_stream_producer_eglsurface
#define EGL_KHR_stream_producer_eglsurface 1
#define EGL_STREAM_BIT_KHR 0x0800
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
#endif
#endif
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
#ifndef EGL_KHR_stream_producer_aldatalocator
#define EGL_KHR_stream_producer_aldatalocator 1
#endif
#endif
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
#ifndef EGL_KHR_stream_fifo
#define EGL_KHR_stream_fifo 1
/* reuse EGLTimeKHR */
#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC
#define EGL_STREAM_TIME_NOW_KHR 0x31FD
#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE
#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
#endif
#endif
#ifndef EGL_EXT_create_context_robustness
#define EGL_EXT_create_context_robustness 1
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138
#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE
#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF
#endif
#ifndef EGL_ANGLE_d3d_share_handle_client_buffer
#define EGL_ANGLE_d3d_share_handle_client_buffer 1
/* reuse EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE */
#endif
#ifndef EGL_KHR_create_context
#define EGL_KHR_create_context 1
#define EGL_CONTEXT_MAJOR_VERSION_KHR EGL_CONTEXT_CLIENT_VERSION
#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB
#define EGL_CONTEXT_FLAGS_KHR 0x30FC
#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD
#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE
#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF
#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004
#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001
#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002
#define EGL_OPENGL_ES3_BIT_KHR 0x00000040
#endif
#ifndef EGL_KHR_surfaceless_context
#define EGL_KHR_surfaceless_context 1
/* No tokens/entry points, just relaxes an error condition */
#endif
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
#ifndef EGL_KHR_stream_cross_process_fd
#define EGL_KHR_stream_cross_process_fd 1
typedef int EGLNativeFileDescriptorKHR;
#define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1))
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR(EGLDisplay dpy, EGLStreamKHR stream);
EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
#endif
#endif
#ifndef EGL_EXT_multiview_window
#define EGL_EXT_multiview_window 1
#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134
#endif
#ifndef EGL_KHR_wait_sync
#define EGL_KHR_wait_sync 1
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC)(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
#endif
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,121 @@
#ifndef __eglplatform_h_
#define __eglplatform_h_
/*
** Copyright (c) 2007-2009 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/* Platform-specific types and definitions for egl.h
* $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that
* they can be included in future versions of this file. Please submit changes
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
* by filing a bug against product "EGL" component "Registry".
*/
#include <KHR/khrplatform.h>
/* Macros used in EGL function prototype declarations.
*
* EGL functions should be prototyped as:
*
* EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
*
* KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
*/
#ifndef EGLAPI
#define EGLAPI KHRONOS_APICALL
#endif
#ifndef EGLAPIENTRY
#define EGLAPIENTRY KHRONOS_APIENTRY
#endif
#define EGLAPIENTRYP EGLAPIENTRY*
/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
* are aliases of window-system-dependent types, such as X Display * or
* Windows Device Context. They must be defined in platform-specific
* code below. The EGL-prefixed versions of Native*Type are the same
* types, renamed in EGL 1.3 so all types in the API start with "EGL".
*
* Khronos STRONGLY RECOMMENDS that you use the default definitions
* provided below, since these changes affect both binary and source
* portability of applications using EGL running on different EGL
* implementations.
*/
#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <windows.h>
typedef HDC EGLNativeDisplayType;
typedef HBITMAP EGLNativePixmapType;
typedef HWND EGLNativeWindowType;
#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
typedef int EGLNativeDisplayType;
typedef void *EGLNativeWindowType;
typedef void *EGLNativePixmapType;
#elif defined(__unix__) && !defined(ANDROID)
/* X11 (tentative) */
#include <X11/Xlib.h>
#include <X11/Xutil.h>
typedef Display *EGLNativeDisplayType;
typedef Pixmap EGLNativePixmapType;
typedef Window EGLNativeWindowType;
#elif defined(ANDROID)
typedef int EGLNativeDisplayType;
typedef void *EGLNativeWindowType;
typedef void *EGLNativePixmapType;
#else
#error "Platform not recognized"
#endif
/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
typedef EGLNativeDisplayType NativeDisplayType;
typedef EGLNativePixmapType NativePixmapType;
typedef EGLNativeWindowType NativeWindowType;
/* Define EGLint. This must be a signed integral type large enough to contain
* all legal attribute names and values passed into and out of EGL, whether
* their type is boolean, bitmask, enumerant (symbolic constant), integer,
* handle, or other. While in general a 32-bit integer will suffice, if
* handles are 64 bit types, then EGLint should be defined as a signed 64-bit
* integer type.
*/
typedef khronos_int32_t EGLint;
#endif /* __eglplatform_h */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,353 @@
/*
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice including the dates of first publication and
* either this permission notice or a reference to
* http://oss.sgi.com/projects/FreeB/
* shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Except as contained in this notice, the name of Silicon Graphics, Inc.
* shall not be used in advertising or otherwise to promote the sale, use or
* other dealings in this Software without prior written authorization from
* Silicon Graphics, Inc.
*/
#ifndef __glu_h__
#define __glu_h__
#if defined(USE_MGL_NAMESPACE)
#include "glu_mangle.h"
#endif
#include <GL/gl.h>
#ifndef GLAPIENTRY
#if defined(_MSC_VER) || defined(__MINGW32__)
#define GLAPIENTRY __stdcall
#else
#define GLAPIENTRY
#endif
#endif
#ifndef GLAPIENTRYP
#define GLAPIENTRYP GLAPIENTRY *
#endif
#if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32)
# undef GLAPI
# define GLAPI __declspec(dllexport)
#elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL)
/* tag specifying we're building for DLL runtime support */
# undef GLAPI
# define GLAPI __declspec(dllimport)
#elif !defined(GLAPI)
/* for use with static link lib build of Win32 edition only */
# define GLAPI extern
#endif /* _STATIC_MESA support */
#ifdef __cplusplus
extern "C" {
#endif
/*************************************************************/
/* Extensions */
#define GLU_EXT_object_space_tess 1
#define GLU_EXT_nurbs_tessellator 1
/* Boolean */
#define GLU_FALSE 0
#define GLU_TRUE 1
/* Version */
#define GLU_VERSION_1_1 1
#define GLU_VERSION_1_2 1
#define GLU_VERSION_1_3 1
/* StringName */
#define GLU_VERSION 100800
#define GLU_EXTENSIONS 100801
/* ErrorCode */
#define GLU_INVALID_ENUM 100900
#define GLU_INVALID_VALUE 100901
#define GLU_OUT_OF_MEMORY 100902
#define GLU_INCOMPATIBLE_GL_VERSION 100903
#define GLU_INVALID_OPERATION 100904
/* NurbsDisplay */
/* GLU_FILL */
#define GLU_OUTLINE_POLYGON 100240
#define GLU_OUTLINE_PATCH 100241
/* NurbsCallback */
#define GLU_NURBS_ERROR 100103
#define GLU_ERROR 100103
#define GLU_NURBS_BEGIN 100164
#define GLU_NURBS_BEGIN_EXT 100164
#define GLU_NURBS_VERTEX 100165
#define GLU_NURBS_VERTEX_EXT 100165
#define GLU_NURBS_NORMAL 100166
#define GLU_NURBS_NORMAL_EXT 100166
#define GLU_NURBS_COLOR 100167
#define GLU_NURBS_COLOR_EXT 100167
#define GLU_NURBS_TEXTURE_COORD 100168
#define GLU_NURBS_TEX_COORD_EXT 100168
#define GLU_NURBS_END 100169
#define GLU_NURBS_END_EXT 100169
#define GLU_NURBS_BEGIN_DATA 100170
#define GLU_NURBS_BEGIN_DATA_EXT 100170
#define GLU_NURBS_VERTEX_DATA 100171
#define GLU_NURBS_VERTEX_DATA_EXT 100171
#define GLU_NURBS_NORMAL_DATA 100172
#define GLU_NURBS_NORMAL_DATA_EXT 100172
#define GLU_NURBS_COLOR_DATA 100173
#define GLU_NURBS_COLOR_DATA_EXT 100173
#define GLU_NURBS_TEXTURE_COORD_DATA 100174
#define GLU_NURBS_TEX_COORD_DATA_EXT 100174
#define GLU_NURBS_END_DATA 100175
#define GLU_NURBS_END_DATA_EXT 100175
/* NurbsError */
#define GLU_NURBS_ERROR1 100251
#define GLU_NURBS_ERROR2 100252
#define GLU_NURBS_ERROR3 100253
#define GLU_NURBS_ERROR4 100254
#define GLU_NURBS_ERROR5 100255
#define GLU_NURBS_ERROR6 100256
#define GLU_NURBS_ERROR7 100257
#define GLU_NURBS_ERROR8 100258
#define GLU_NURBS_ERROR9 100259
#define GLU_NURBS_ERROR10 100260
#define GLU_NURBS_ERROR11 100261
#define GLU_NURBS_ERROR12 100262
#define GLU_NURBS_ERROR13 100263
#define GLU_NURBS_ERROR14 100264
#define GLU_NURBS_ERROR15 100265
#define GLU_NURBS_ERROR16 100266
#define GLU_NURBS_ERROR17 100267
#define GLU_NURBS_ERROR18 100268
#define GLU_NURBS_ERROR19 100269
#define GLU_NURBS_ERROR20 100270
#define GLU_NURBS_ERROR21 100271
#define GLU_NURBS_ERROR22 100272
#define GLU_NURBS_ERROR23 100273
#define GLU_NURBS_ERROR24 100274
#define GLU_NURBS_ERROR25 100275
#define GLU_NURBS_ERROR26 100276
#define GLU_NURBS_ERROR27 100277
#define GLU_NURBS_ERROR28 100278
#define GLU_NURBS_ERROR29 100279
#define GLU_NURBS_ERROR30 100280
#define GLU_NURBS_ERROR31 100281
#define GLU_NURBS_ERROR32 100282
#define GLU_NURBS_ERROR33 100283
#define GLU_NURBS_ERROR34 100284
#define GLU_NURBS_ERROR35 100285
#define GLU_NURBS_ERROR36 100286
#define GLU_NURBS_ERROR37 100287
/* NurbsProperty */
#define GLU_AUTO_LOAD_MATRIX 100200
#define GLU_CULLING 100201
#define GLU_SAMPLING_TOLERANCE 100203
#define GLU_DISPLAY_MODE 100204
#define GLU_PARAMETRIC_TOLERANCE 100202
#define GLU_SAMPLING_METHOD 100205
#define GLU_U_STEP 100206
#define GLU_V_STEP 100207
#define GLU_NURBS_MODE 100160
#define GLU_NURBS_MODE_EXT 100160
#define GLU_NURBS_TESSELLATOR 100161
#define GLU_NURBS_TESSELLATOR_EXT 100161
#define GLU_NURBS_RENDERER 100162
#define GLU_NURBS_RENDERER_EXT 100162
/* NurbsSampling */
#define GLU_OBJECT_PARAMETRIC_ERROR 100208
#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208
#define GLU_OBJECT_PATH_LENGTH 100209
#define GLU_OBJECT_PATH_LENGTH_EXT 100209
#define GLU_PATH_LENGTH 100215
#define GLU_PARAMETRIC_ERROR 100216
#define GLU_DOMAIN_DISTANCE 100217
/* NurbsTrim */
#define GLU_MAP1_TRIM_2 100210
#define GLU_MAP1_TRIM_3 100211
/* QuadricDrawStyle */
#define GLU_POINT 100010
#define GLU_LINE 100011
#define GLU_FILL 100012
#define GLU_SILHOUETTE 100013
/* QuadricCallback */
/* GLU_ERROR */
/* QuadricNormal */
#define GLU_SMOOTH 100000
#define GLU_FLAT 100001
#define GLU_NONE 100002
/* QuadricOrientation */
#define GLU_OUTSIDE 100020
#define GLU_INSIDE 100021
/* TessCallback */
#define GLU_TESS_BEGIN 100100
#define GLU_BEGIN 100100
#define GLU_TESS_VERTEX 100101
#define GLU_VERTEX 100101
#define GLU_TESS_END 100102
#define GLU_END 100102
#define GLU_TESS_ERROR 100103
#define GLU_TESS_EDGE_FLAG 100104
#define GLU_EDGE_FLAG 100104
#define GLU_TESS_COMBINE 100105
#define GLU_TESS_BEGIN_DATA 100106
#define GLU_TESS_VERTEX_DATA 100107
#define GLU_TESS_END_DATA 100108
#define GLU_TESS_ERROR_DATA 100109
#define GLU_TESS_EDGE_FLAG_DATA 100110
#define GLU_TESS_COMBINE_DATA 100111
/* TessContour */
#define GLU_CW 100120
#define GLU_CCW 100121
#define GLU_INTERIOR 100122
#define GLU_EXTERIOR 100123
#define GLU_UNKNOWN 100124
/* TessProperty */
#define GLU_TESS_WINDING_RULE 100140
#define GLU_TESS_BOUNDARY_ONLY 100141
#define GLU_TESS_TOLERANCE 100142
/* TessError */
#define GLU_TESS_ERROR1 100151
#define GLU_TESS_ERROR2 100152
#define GLU_TESS_ERROR3 100153
#define GLU_TESS_ERROR4 100154
#define GLU_TESS_ERROR5 100155
#define GLU_TESS_ERROR6 100156
#define GLU_TESS_ERROR7 100157
#define GLU_TESS_ERROR8 100158
#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
#define GLU_TESS_MISSING_END_POLYGON 100153
#define GLU_TESS_MISSING_END_CONTOUR 100154
#define GLU_TESS_COORD_TOO_LARGE 100155
#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
/* TessWinding */
#define GLU_TESS_WINDING_ODD 100130
#define GLU_TESS_WINDING_NONZERO 100131
#define GLU_TESS_WINDING_POSITIVE 100132
#define GLU_TESS_WINDING_NEGATIVE 100133
#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
/*************************************************************/
#ifdef __cplusplus
class GLUnurbs;
class GLUquadric;
class GLUtesselator;
#else
typedef struct GLUnurbs GLUnurbs;
typedef struct GLUquadric GLUquadric;
typedef struct GLUtesselator GLUtesselator;
#endif
typedef GLUnurbs GLUnurbsObj;
typedef GLUquadric GLUquadricObj;
typedef GLUtesselator GLUtesselatorObj;
typedef GLUtesselator GLUtriangulatorObj;
#define GLU_TESS_MAX_COORD 1.0e150
/* Internal convenience typedefs */
typedef void (GLAPIENTRYP _GLUfuncptr)(void);
GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb);
GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);
GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb);
GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb);
GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString);
GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);
GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb);
GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad);
GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess);
GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);
GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb);
GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess);
GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb);
GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb);
GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error);
GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data);
GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name);
GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);
GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);
GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void);
GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void);
GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void);
GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type);
GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);
GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData);
GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData);
GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);
GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value);
GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type);
GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);
GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);
GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);
GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);
GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw);
GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal);
GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation);
GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture);
GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);
GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess);
GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess);
GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess);
GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
#ifdef __cplusplus
}
#endif
#endif /* __glu_h__ */

View file

@ -0,0 +1,86 @@
/*
* Mesa 3-D graphics library
* Version: 3.0
* Copyright (C) 1995-1998 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef GLU_MANGLE_H
#define GLU_MANGLE_H
#define gluLookAt mgluLookAt
#define gluOrtho2D mgluOrtho2D
#define gluPerspective mgluPerspective
#define gluPickMatrix mgluPickMatrix
#define gluProject mgluProject
#define gluUnProject mgluUnProject
#define gluErrorString mgluErrorString
#define gluScaleImage mgluScaleImage
#define gluBuild1DMipmaps mgluBuild1DMipmaps
#define gluBuild2DMipmaps mgluBuild2DMipmaps
#define gluNewQuadric mgluNewQuadric
#define gluDeleteQuadric mgluDeleteQuadric
#define gluQuadricDrawStyle mgluQuadricDrawStyle
#define gluQuadricOrientation mgluQuadricOrientation
#define gluQuadricNormals mgluQuadricNormals
#define gluQuadricTexture mgluQuadricTexture
#define gluQuadricCallback mgluQuadricCallback
#define gluCylinder mgluCylinder
#define gluSphere mgluSphere
#define gluDisk mgluDisk
#define gluPartialDisk mgluPartialDisk
#define gluNewNurbsRenderer mgluNewNurbsRenderer
#define gluDeleteNurbsRenderer mgluDeleteNurbsRenderer
#define gluLoadSamplingMatrices mgluLoadSamplingMatrices
#define gluNurbsProperty mgluNurbsProperty
#define gluGetNurbsProperty mgluGetNurbsProperty
#define gluBeginCurve mgluBeginCurve
#define gluEndCurve mgluEndCurve
#define gluNurbsCurve mgluNurbsCurve
#define gluBeginSurface mgluBeginSurface
#define gluEndSurface mgluEndSurface
#define gluNurbsSurface mgluNurbsSurface
#define gluBeginTrim mgluBeginTrim
#define gluEndTrim mgluEndTrim
#define gluPwlCurve mgluPwlCurve
#define gluNurbsCallback mgluNurbsCallback
#define gluNewTess mgluNewTess
#define gluDeleteTess mgluDeleteTess
#define gluTessBeginPolygon mgluTessBeginPolygon
#define gluTessBeginContour mgluTessBeginContour
#define gluTessVertex mgluTessVertex
#define gluTessEndPolygon mgluTessEndPolygon
#define gluTessEndContour mgluTessEndContour
#define gluTessProperty mgluTessProperty
#define gluTessNormal mgluTessNormal
#define gluTessCallback mgluTessCallback
#define gluGetTessProperty mgluGetTessProperty
#define gluBeginPolygon mgluBeginPolygon
#define gluNextContour mgluNextContour
#define gluEndPolygon mgluEndPolygon
#define gluGetString mgluGetString
#define gluBuild1DMipmapLevels mgluBuild1DMipmapLevels
#define gluBuild2DMipmapLevels mgluBuild2DMipmapLevels
#define gluBuild3DMipmapLevels mgluBuild3DMipmapLevels
#define gluBuild3DMipmaps mgluBuild3DMipmaps
#define gluCheckExtension mgluCheckExtension
#define gluUnProject4 mgluUnProject4
#define gluNurbsCallbackData mgluNurbsCallbackData
#define gluNurbsCallbackDataEXT mgluNurbsCallbackDataEXT
#endif

View file

@ -0,0 +1,528 @@
/*
* Mesa 3-D graphics library
* Version: 6.5
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef GLX_H
#define GLX_H
#ifdef __VMS
#include <GL/vms_x_fix.h>
# ifdef __cplusplus
/* VMS Xlib.h gives problems with C++.
* this avoids a bunch of trivial warnings */
#pragma message disable nosimpint
#endif
#endif
#ifndef ANDROID
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#endif //ANDROID
#ifdef __VMS
# ifdef __cplusplus
#pragma message enable nosimpint
#endif
#endif
#include <GL/gl.h>
#if defined(USE_MGL_NAMESPACE)
#include "glx_mangle.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define GLX_VERSION_1_1 1
#define GLX_VERSION_1_2 1
#define GLX_VERSION_1_3 1
#define GLX_VERSION_1_4 1
#define GLX_EXTENSION_NAME "GLX"
/*
* Tokens for glXChooseVisual and glXGetConfig:
*/
#define GLX_USE_GL 1
#define GLX_BUFFER_SIZE 2
#define GLX_LEVEL 3
#define GLX_RGBA 4
#define GLX_DOUBLEBUFFER 5
#define GLX_STEREO 6
#define GLX_AUX_BUFFERS 7
#define GLX_RED_SIZE 8
#define GLX_GREEN_SIZE 9
#define GLX_BLUE_SIZE 10
#define GLX_ALPHA_SIZE 11
#define GLX_DEPTH_SIZE 12
#define GLX_STENCIL_SIZE 13
#define GLX_ACCUM_RED_SIZE 14
#define GLX_ACCUM_GREEN_SIZE 15
#define GLX_ACCUM_BLUE_SIZE 16
#define GLX_ACCUM_ALPHA_SIZE 17
/*
* Error codes returned by glXGetConfig:
*/
#define GLX_BAD_SCREEN 1
#define GLX_BAD_ATTRIBUTE 2
#define GLX_NO_EXTENSION 3
#define GLX_BAD_VISUAL 4
#define GLX_BAD_CONTEXT 5
#define GLX_BAD_VALUE 6
#define GLX_BAD_ENUM 7
/*
* GLX 1.1 and later:
*/
#define GLX_VENDOR 1
#define GLX_VERSION 2
#define GLX_EXTENSIONS 3
/*
* GLX 1.3 and later:
*/
#define GLX_CONFIG_CAVEAT 0x20
#define GLX_DONT_CARE 0xFFFFFFFF
#define GLX_X_VISUAL_TYPE 0x22
#define GLX_TRANSPARENT_TYPE 0x23
#define GLX_TRANSPARENT_INDEX_VALUE 0x24
#define GLX_TRANSPARENT_RED_VALUE 0x25
#define GLX_TRANSPARENT_GREEN_VALUE 0x26
#define GLX_TRANSPARENT_BLUE_VALUE 0x27
#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
#define GLX_WINDOW_BIT 0x00000001
#define GLX_PIXMAP_BIT 0x00000002
#define GLX_PBUFFER_BIT 0x00000004
#define GLX_AUX_BUFFERS_BIT 0x00000010
#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
#define GLX_DEPTH_BUFFER_BIT 0x00000020
#define GLX_STENCIL_BUFFER_BIT 0x00000040
#define GLX_ACCUM_BUFFER_BIT 0x00000080
#define GLX_NONE 0x8000
#define GLX_SLOW_CONFIG 0x8001
#define GLX_TRUE_COLOR 0x8002
#define GLX_DIRECT_COLOR 0x8003
#define GLX_PSEUDO_COLOR 0x8004
#define GLX_STATIC_COLOR 0x8005
#define GLX_GRAY_SCALE 0x8006
#define GLX_STATIC_GRAY 0x8007
#define GLX_TRANSPARENT_RGB 0x8008
#define GLX_TRANSPARENT_INDEX 0x8009
#define GLX_VISUAL_ID 0x800B
#define GLX_SCREEN 0x800C
#define GLX_NON_CONFORMANT_CONFIG 0x800D
#define GLX_DRAWABLE_TYPE 0x8010
#define GLX_RENDER_TYPE 0x8011
#define GLX_X_RENDERABLE 0x8012
#define GLX_FBCONFIG_ID 0x8013
#define GLX_RGBA_TYPE 0x8014
#define GLX_COLOR_INDEX_TYPE 0x8015
#define GLX_MAX_PBUFFER_WIDTH 0x8016
#define GLX_MAX_PBUFFER_HEIGHT 0x8017
#define GLX_MAX_PBUFFER_PIXELS 0x8018
#define GLX_PRESERVED_CONTENTS 0x801B
#define GLX_LARGEST_PBUFFER 0x801C
#define GLX_WIDTH 0x801D
#define GLX_HEIGHT 0x801E
#define GLX_EVENT_MASK 0x801F
#define GLX_DAMAGED 0x8020
#define GLX_SAVED 0x8021
#define GLX_WINDOW 0x8022
#define GLX_PBUFFER 0x8023
#define GLX_PBUFFER_HEIGHT 0x8040
#define GLX_PBUFFER_WIDTH 0x8041
#define GLX_RGBA_BIT 0x00000001
#define GLX_COLOR_INDEX_BIT 0x00000002
#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
/*
* GLX 1.4 and later:
*/
#define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/
#define GLX_SAMPLES 0x186a1 /*100001*/
typedef struct __GLXcontextRec *GLXContext;
typedef XID GLXPixmap;
typedef XID GLXDrawable;
/* GLX 1.3 and later */
typedef struct __GLXFBConfigRec *GLXFBConfig;
typedef XID GLXFBConfigID;
typedef XID GLXContextID;
typedef XID GLXWindow;
typedef XID GLXPbuffer;
/*
** Events.
** __GLX_NUMBER_EVENTS is set to 17 to account for the BufferClobberSGIX
** event - this helps initialization if the server supports the pbuffer
** extension and the client doesn't.
*/
#define GLX_PbufferClobber 0
#define GLX_BufferSwapComplete 1
#define __GLX_NUMBER_EVENTS 17
extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
int *attribList );
extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
GLXContext shareList, Bool direct );
extern void glXDestroyContext( Display *dpy, GLXContext ctx );
extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
GLXContext ctx);
extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
unsigned long mask );
extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
Pixmap pixmap );
extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
int attrib, int *value );
extern GLXContext glXGetCurrentContext( void );
extern GLXDrawable glXGetCurrentDrawable( void );
extern void glXWaitGL( void );
extern void glXWaitX( void );
extern void glXUseXFont( Font font, int first, int count, int list );
/* GLX 1.1 and later */
extern const char *glXQueryExtensionsString( Display *dpy, int screen );
extern const char *glXQueryServerString( Display *dpy, int screen, int name );
extern const char *glXGetClientString( Display *dpy, int name );
/* GLX 1.2 and later */
extern Display *glXGetCurrentDisplay( void );
/* GLX 1.3 and later */
extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen,
const int *attribList, int *nitems );
extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
int attribute, int *value );
extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen,
int *nelements );
extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
GLXFBConfig config );
extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
Window win, const int *attribList );
extern void glXDestroyWindow( Display *dpy, GLXWindow window );
extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
Pixmap pixmap, const int *attribList );
extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
const int *attribList );
extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
unsigned int *value );
extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
int renderType, GLXContext shareList,
Bool direct );
extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
GLXDrawable read, GLXContext ctx );
extern GLXDrawable glXGetCurrentReadDrawable( void );
extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
int *value );
extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
unsigned long mask );
extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
unsigned long *mask );
/* GLX 1.3 function pointer typedefs */
typedef GLXFBConfig * (* PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
typedef GLXFBConfig * (* PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
typedef int (* PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
typedef XVisualInfo * (* PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
typedef GLXWindow (* PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
typedef void (* PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
typedef GLXPixmap (* PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
typedef void (* PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
typedef GLXPbuffer (* PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
typedef void (* PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
typedef void (* PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
typedef GLXContext (* PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
typedef Bool (* PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
typedef GLXDrawable (* PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
typedef Display * (* PFNGLXGETCURRENTDISPLAYPROC) (void);
typedef int (* PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
typedef void (* PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
typedef void (* PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
/*
* ARB 2. GLX_ARB_get_proc_address
*/
#ifndef GLX_ARB_get_proc_address
#define GLX_ARB_get_proc_address 1
typedef void (*__GLXextFuncPtr)(void);
extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
#endif /* GLX_ARB_get_proc_address */
/* GLX 1.4 and later */
extern void (*glXGetProcAddress(const GLubyte *procname))( void );
/* GLX 1.4 function pointer typedefs */
typedef __GLXextFuncPtr (* PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
#ifndef GLX_GLXEXT_LEGACY
#include <GL/glxext.h>
#endif /* GLX_GLXEXT_LEGACY */
/**
** The following aren't in glxext.h yet.
**/
/*
* ???. GLX_NV_vertex_array_range
*/
#ifndef GLX_NV_vertex_array_range
#define GLX_NV_vertex_array_range
extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
extern void glXFreeMemoryNV(GLvoid *pointer);
typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer);
#endif /* GLX_NV_vertex_array_range */
/*
* ARB ?. GLX_ARB_render_texture
* XXX This was never finalized!
*/
#ifndef GLX_ARB_render_texture
#define GLX_ARB_render_texture 1
extern Bool glXBindTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
extern Bool glXReleaseTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attribList);
#endif /* GLX_ARB_render_texture */
/*
* Remove this when glxext.h is updated.
*/
#ifndef GLX_NV_float_buffer
#define GLX_NV_float_buffer 1
#define GLX_FLOAT_COMPONENTS_NV 0x20B0
#endif /* GLX_NV_float_buffer */
/*
* #?. GLX_MESA_swap_frame_usage
*/
#ifndef GLX_MESA_swap_frame_usage
#define GLX_MESA_swap_frame_usage 1
extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage);
extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage);
typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
#endif /* GLX_MESA_swap_frame_usage */
/*
* #?. GLX_MESA_swap_control
*/
#ifndef GLX_MESA_swap_control
#define GLX_MESA_swap_control 1
extern int glXSwapIntervalMESA(unsigned int interval);
extern int glXGetSwapIntervalMESA(void);
typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval);
typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void);
#endif /* GLX_MESA_swap_control */
/*
* #?. GLX_EXT_texture_from_pixmap
* XXX not finished?
*/
#ifndef GLX_EXT_texture_from_pixmap
#define GLX_EXT_texture_from_pixmap 1
#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
#define GLX_Y_INVERTED_EXT 0x20D4
#define GLX_TEXTURE_FORMAT_EXT 0x20D5
#define GLX_TEXTURE_TARGET_EXT 0x20D6
#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
#define GLX_TEXTURE_1D_EXT 0x20DB
#define GLX_TEXTURE_2D_EXT 0x20DC
#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
#define GLX_FRONT_LEFT_EXT 0x20DE
#define GLX_FRONT_RIGHT_EXT 0x20DF
#define GLX_BACK_LEFT_EXT 0x20E0
#define GLX_BACK_RIGHT_EXT 0x20E1
#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
#define GLX_AUX0_EXT 0x20E2
#define GLX_AUX1_EXT 0x20E3
#define GLX_AUX2_EXT 0x20E4
#define GLX_AUX3_EXT 0x20E5
#define GLX_AUX4_EXT 0x20E6
#define GLX_AUX5_EXT 0x20E7
#define GLX_AUX6_EXT 0x20E8
#define GLX_AUX7_EXT 0x20E9
#define GLX_AUX8_EXT 0x20EA
#define GLX_AUX9_EXT 0x20EB
extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
#endif /* GLX_EXT_texture_from_pixmap */
/*** Should these go here, or in another header? */
/*
** GLX Events
*/
typedef struct {
int event_type; /* GLX_DAMAGED or GLX_SAVED */
int draw_type; /* GLX_WINDOW or GLX_PBUFFER */
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if this came for SendEvent request */
Display *display; /* display the event was read from */
GLXDrawable drawable; /* XID of Drawable */
unsigned int buffer_mask; /* mask indicating which buffers are affected */
unsigned int aux_buffer; /* which aux buffer was affected */
int x, y;
int width, height;
int count; /* if nonzero, at least this many more */
} GLXPbufferClobberEvent;
typedef struct {
int type;
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if this came from a SendEvent request */
Display *display; /* Display the event was read from */
GLXDrawable drawable; /* drawable on which event was requested in event mask */
int event_type;
int64_t ust;
int64_t msc;
int64_t sbc;
} GLXBufferSwapComplete;
typedef union __GLXEvent {
GLXPbufferClobberEvent glxpbufferclobber;
GLXBufferSwapComplete glxbufferswapcomplete;
long pad[24];
} GLXEvent;
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,82 @@
/*
* Mesa 3-D graphics library
* Version: 6.5
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef GLX_MANGLE_H
#define GLX_MANGLE_H
#define glXChooseVisual mglXChooseVisual
#define glXCreateContext mglXCreateContext
#define glXDestroyContext mglXDestroyContext
#define glXMakeCurrent mglXMakeCurrent
#define glXCopyContext mglXCopyContext
#define glXSwapBuffers mglXSwapBuffers
#define glXCreateGLXPixmap mglXCreateGLXPixmap
#define glXDestroyGLXPixmap mglXDestroyGLXPixmap
#define glXQueryExtension mglXQueryExtension
#define glXQueryVersion mglXQueryVersion
#define glXIsDirect mglXIsDirect
#define glXGetConfig mglXGetConfig
#define glXGetCurrentContext mglXGetCurrentContext
#define glXGetCurrentDrawable mglXGetCurrentDrawable
#define glXWaitGL mglXWaitGL
#define glXWaitX mglXWaitX
#define glXUseXFont mglXUseXFont
#define glXQueryExtensionsString mglXQueryExtensionsString
#define glXQueryServerString mglXQueryServerString
#define glXGetClientString mglXGetClientString
#define glXCreateGLXPixmapMESA mglXCreateGLXPixmapMESA
#define glXReleaseBuffersMESA mglXReleaseBuffersMESA
#define glXCopySubBufferMESA mglXCopySubBufferMESA
#define glXGetVideoSyncSGI mglXGetVideoSyncSGI
#define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI
/* GLX 1.2 */
#define glXGetCurrentDisplay mglXGetCurrentDisplay
/* GLX 1.3 */
#define glXChooseFBConfig mglXChooseFBConfig
#define glXGetFBConfigAttrib mglXGetFBConfigAttrib
#define glXGetFBConfigs mglXGetFBConfigs
#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig
#define glXCreateWindow mglXCreateWindow
#define glXDestroyWindow mglXDestroyWindow
#define glXCreatePixmap mglXCreatePixmap
#define glXDestroyPixmap mglXDestroyPixmap
#define glXCreatePbuffer mglXCreatePbuffer
#define glXDestroyPbuffer mglXDestroyPbuffer
#define glXQueryDrawable mglXQueryDrawable
#define glXCreateNewContext mglXCreateNewContext
#define glXMakeContextCurrent mglXMakeContextCurrent
#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable
#define glXQueryContext mglXQueryContext
#define glXSelectEvent mglXSelectEvent
#define glXGetSelectedEvent mglXGetSelectedEvent
/* GLX 1.4 */
#define glXGetProcAddress mglXGetProcAddress
#define glXGetProcAddressARB mglXGetProcAddressARB
#endif

View file

@ -0,0 +1,993 @@
#ifndef __glxext_h_
#define __glxext_h_
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2007-2010 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/* Function declaration macros - to move into glplatform.h */
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#endif
#ifndef APIENTRY
#define APIENTRY
#endif
#ifndef APIENTRYP
#define APIENTRYP APIENTRY *
#endif
#ifndef GLAPI
#define GLAPI extern
#endif
/*************************************************************/
/* Header file version number, required by OpenGL ABI for Linux */
/* glxext.h last updated 2010/08/06 */
/* Current version at http://www.opengl.org/registry/ */
#define GLX_GLXEXT_VERSION 32
#ifndef GLX_VERSION_1_3
#define GLX_WINDOW_BIT 0x00000001
#define GLX_PIXMAP_BIT 0x00000002
#define GLX_PBUFFER_BIT 0x00000004
#define GLX_RGBA_BIT 0x00000001
#define GLX_COLOR_INDEX_BIT 0x00000002
#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
#define GLX_AUX_BUFFERS_BIT 0x00000010
#define GLX_DEPTH_BUFFER_BIT 0x00000020
#define GLX_STENCIL_BUFFER_BIT 0x00000040
#define GLX_ACCUM_BUFFER_BIT 0x00000080
#define GLX_CONFIG_CAVEAT 0x20
#define GLX_X_VISUAL_TYPE 0x22
#define GLX_TRANSPARENT_TYPE 0x23
#define GLX_TRANSPARENT_INDEX_VALUE 0x24
#define GLX_TRANSPARENT_RED_VALUE 0x25
#define GLX_TRANSPARENT_GREEN_VALUE 0x26
#define GLX_TRANSPARENT_BLUE_VALUE 0x27
#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
#define GLX_DONT_CARE 0xFFFFFFFF
#define GLX_NONE 0x8000
#define GLX_SLOW_CONFIG 0x8001
#define GLX_TRUE_COLOR 0x8002
#define GLX_DIRECT_COLOR 0x8003
#define GLX_PSEUDO_COLOR 0x8004
#define GLX_STATIC_COLOR 0x8005
#define GLX_GRAY_SCALE 0x8006
#define GLX_STATIC_GRAY 0x8007
#define GLX_TRANSPARENT_RGB 0x8008
#define GLX_TRANSPARENT_INDEX 0x8009
#define GLX_VISUAL_ID 0x800B
#define GLX_SCREEN 0x800C
#define GLX_NON_CONFORMANT_CONFIG 0x800D
#define GLX_DRAWABLE_TYPE 0x8010
#define GLX_RENDER_TYPE 0x8011
#define GLX_X_RENDERABLE 0x8012
#define GLX_FBCONFIG_ID 0x8013
#define GLX_RGBA_TYPE 0x8014
#define GLX_COLOR_INDEX_TYPE 0x8015
#define GLX_MAX_PBUFFER_WIDTH 0x8016
#define GLX_MAX_PBUFFER_HEIGHT 0x8017
#define GLX_MAX_PBUFFER_PIXELS 0x8018
#define GLX_PRESERVED_CONTENTS 0x801B
#define GLX_LARGEST_PBUFFER 0x801C
#define GLX_WIDTH 0x801D
#define GLX_HEIGHT 0x801E
#define GLX_EVENT_MASK 0x801F
#define GLX_DAMAGED 0x8020
#define GLX_SAVED 0x8021
#define GLX_WINDOW 0x8022
#define GLX_PBUFFER 0x8023
#define GLX_PBUFFER_HEIGHT 0x8040
#define GLX_PBUFFER_WIDTH 0x8041
#endif
#ifndef GLX_VERSION_1_4
#define GLX_SAMPLE_BUFFERS 100000
#define GLX_SAMPLES 100001
#endif
#ifndef GLX_ARB_get_proc_address
#endif
#ifndef GLX_ARB_multisample
#define GLX_SAMPLE_BUFFERS_ARB 100000
#define GLX_SAMPLES_ARB 100001
#endif
#ifndef GLX_ARB_vertex_buffer_object
#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095
#endif
#ifndef GLX_ARB_fbconfig_float
#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9
#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004
#endif
#ifndef GLX_ARB_framebuffer_sRGB
#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2
#endif
#ifndef GLX_ARB_create_context
#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001
#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
#define GLX_CONTEXT_FLAGS_ARB 0x2094
#endif
#ifndef GLX_ARB_create_context_profile
#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126
#endif
#ifndef GLX_ARB_create_context_robustness
#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252
#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261
#endif
#ifndef GLX_SGIS_multisample
#define GLX_SAMPLE_BUFFERS_SGIS 100000
#define GLX_SAMPLES_SGIS 100001
#endif
#ifndef GLX_EXT_visual_info
#define GLX_X_VISUAL_TYPE_EXT 0x22
#define GLX_TRANSPARENT_TYPE_EXT 0x23
#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
#define GLX_NONE_EXT 0x8000
#define GLX_TRUE_COLOR_EXT 0x8002
#define GLX_DIRECT_COLOR_EXT 0x8003
#define GLX_PSEUDO_COLOR_EXT 0x8004
#define GLX_STATIC_COLOR_EXT 0x8005
#define GLX_GRAY_SCALE_EXT 0x8006
#define GLX_STATIC_GRAY_EXT 0x8007
#define GLX_TRANSPARENT_RGB_EXT 0x8008
#define GLX_TRANSPARENT_INDEX_EXT 0x8009
#endif
#ifndef GLX_SGI_swap_control
#endif
#ifndef GLX_SGI_video_sync
#endif
#ifndef GLX_SGI_make_current_read
#endif
#ifndef GLX_SGIX_video_source
#endif
#ifndef GLX_EXT_visual_rating
#define GLX_VISUAL_CAVEAT_EXT 0x20
#define GLX_SLOW_VISUAL_EXT 0x8001
#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
/* reuse GLX_NONE_EXT */
#endif
#ifndef GLX_EXT_import_context
#define GLX_SHARE_CONTEXT_EXT 0x800A
#define GLX_VISUAL_ID_EXT 0x800B
#define GLX_SCREEN_EXT 0x800C
#endif
#ifndef GLX_SGIX_fbconfig
#define GLX_WINDOW_BIT_SGIX 0x00000001
#define GLX_PIXMAP_BIT_SGIX 0x00000002
#define GLX_RGBA_BIT_SGIX 0x00000001
#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
#define GLX_DRAWABLE_TYPE_SGIX 0x8010
#define GLX_RENDER_TYPE_SGIX 0x8011
#define GLX_X_RENDERABLE_SGIX 0x8012
#define GLX_FBCONFIG_ID_SGIX 0x8013
#define GLX_RGBA_TYPE_SGIX 0x8014
#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015
/* reuse GLX_SCREEN_EXT */
#endif
#ifndef GLX_SGIX_pbuffer
#define GLX_PBUFFER_BIT_SGIX 0x00000004
#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000
#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001
#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002
#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008
#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010
#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020
#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040
#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080
#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100
#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016
#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017
#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018
#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
#define GLX_PRESERVED_CONTENTS_SGIX 0x801B
#define GLX_LARGEST_PBUFFER_SGIX 0x801C
#define GLX_WIDTH_SGIX 0x801D
#define GLX_HEIGHT_SGIX 0x801E
#define GLX_EVENT_MASK_SGIX 0x801F
#define GLX_DAMAGED_SGIX 0x8020
#define GLX_SAVED_SGIX 0x8021
#define GLX_WINDOW_SGIX 0x8022
#define GLX_PBUFFER_SGIX 0x8023
#endif
#ifndef GLX_SGI_cushion
#endif
#ifndef GLX_SGIX_video_resize
#define GLX_SYNC_FRAME_SGIX 0x00000000
#define GLX_SYNC_SWAP_SGIX 0x00000001
#endif
#ifndef GLX_SGIX_dmbuffer
#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024
#endif
#ifndef GLX_SGIX_swap_group
#endif
#ifndef GLX_SGIX_swap_barrier
#endif
#ifndef GLX_SGIS_blended_overlay
#define GLX_BLENDED_RGBA_SGIS 0x8025
#endif
#ifndef GLX_SGIS_shared_multisample
#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
#endif
#ifndef GLX_SUN_get_transparent_index
#endif
#ifndef GLX_3DFX_multisample
#define GLX_SAMPLE_BUFFERS_3DFX 0x8050
#define GLX_SAMPLES_3DFX 0x8051
#endif
#ifndef GLX_MESA_copy_sub_buffer
#endif
#ifndef GLX_MESA_pixmap_colormap
#endif
#ifndef GLX_MESA_release_buffers
#endif
#ifndef GLX_MESA_set_3dfx_mode
#define GLX_3DFX_WINDOW_MODE_MESA 0x1
#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
#endif
#ifndef GLX_SGIX_visual_select_group
#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028
#endif
#ifndef GLX_OML_swap_method
#define GLX_SWAP_METHOD_OML 0x8060
#define GLX_SWAP_EXCHANGE_OML 0x8061
#define GLX_SWAP_COPY_OML 0x8062
#define GLX_SWAP_UNDEFINED_OML 0x8063
#endif
#ifndef GLX_OML_sync_control
#endif
#ifndef GLX_NV_float_buffer
#define GLX_FLOAT_COMPONENTS_NV 0x20B0
#endif
#ifndef GLX_SGIX_hyperpipe
#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91
#define GLX_BAD_HYPERPIPE_SGIX 92
#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
#define GLX_PIPE_RECT_SGIX 0x00000001
#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002
#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003
#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004
#define GLX_HYPERPIPE_ID_SGIX 0x8030
#endif
#ifndef GLX_MESA_agp_offset
#endif
#ifndef GLX_EXT_fbconfig_packed_float
#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
#endif
#ifndef GLX_EXT_framebuffer_sRGB
#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
#endif
#ifndef GLX_EXT_texture_from_pixmap
#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
#define GLX_Y_INVERTED_EXT 0x20D4
#define GLX_TEXTURE_FORMAT_EXT 0x20D5
#define GLX_TEXTURE_TARGET_EXT 0x20D6
#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
#define GLX_TEXTURE_1D_EXT 0x20DB
#define GLX_TEXTURE_2D_EXT 0x20DC
#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
#define GLX_FRONT_LEFT_EXT 0x20DE
#define GLX_FRONT_RIGHT_EXT 0x20DF
#define GLX_BACK_LEFT_EXT 0x20E0
#define GLX_BACK_RIGHT_EXT 0x20E1
#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
#define GLX_AUX0_EXT 0x20E2
#define GLX_AUX1_EXT 0x20E3
#define GLX_AUX2_EXT 0x20E4
#define GLX_AUX3_EXT 0x20E5
#define GLX_AUX4_EXT 0x20E6
#define GLX_AUX5_EXT 0x20E7
#define GLX_AUX6_EXT 0x20E8
#define GLX_AUX7_EXT 0x20E9
#define GLX_AUX8_EXT 0x20EA
#define GLX_AUX9_EXT 0x20EB
#endif
#ifndef GLX_NV_present_video
#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0
#endif
#ifndef GLX_NV_video_out
#define GLX_VIDEO_OUT_COLOR_NV 0x20C3
#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5
#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
#define GLX_VIDEO_OUT_FRAME_NV 0x20C8
#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9
#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA
#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB
#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC
#endif
#ifndef GLX_NV_swap_group
#endif
#ifndef GLX_NV_video_capture
#define GLX_DEVICE_ID_NV 0x20CD
#define GLX_UNIQUE_ID_NV 0x20CE
#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
#endif
#ifndef GLX_EXT_swap_control
#define GLX_SWAP_INTERVAL_EXT 0x20F1
#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2
#endif
#ifndef GLX_NV_copy_image
#endif
#ifndef GLX_INTEL_swap_event
#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000
#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180
#define GLX_COPY_COMPLETE_INTEL 0x8181
#define GLX_FLIP_COMPLETE_INTEL 0x8182
#endif
#ifndef GLX_NV_multisample_coverage
#define GLX_COVERAGE_SAMPLES_NV 100001
#define GLX_COLOR_SAMPLES_NV 0x20B3
#endif
#ifndef GLX_AMD_gpu_association
#define GLX_GPU_VENDOR_AMD 0x1F00
#define GLX_GPU_RENDERER_STRING_AMD 0x1F01
#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
#define GLX_GPU_RAM_AMD 0x21A3
#define GLX_GPU_CLOCK_AMD 0x21A4
#define GLX_GPU_NUM_PIPES_AMD 0x21A5
#define GLX_GPU_NUM_SIMD_AMD 0x21A6
#define GLX_GPU_NUM_RB_AMD 0x21A7
#define GLX_GPU_NUM_SPI_AMD 0x21A8
#endif
#ifndef GLX_EXT_create_context_es2_profile
#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
#endif
/*************************************************************/
#ifndef GLX_ARB_get_proc_address
typedef void (*__GLXextFuncPtr)(void);
#endif
#ifndef GLX_SGIX_video_source
typedef XID GLXVideoSourceSGIX;
#endif
#ifndef GLX_SGIX_fbconfig
typedef XID GLXFBConfigIDSGIX;
typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
#endif
#ifndef GLX_SGIX_pbuffer
typedef XID GLXPbufferSGIX;
typedef struct {
int type;
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if this came for SendEvent request */
Display *display; /* display the event was read from */
GLXDrawable drawable; /* i.d. of Drawable */
int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
unsigned int mask; /* mask indicating which buffers are affected*/
int x, y;
int width, height;
int count; /* if nonzero, at least this many more */
} GLXBufferClobberEventSGIX;
#endif
#ifndef GLX_NV_video_output
typedef unsigned int GLXVideoDeviceNV;
#endif
#ifndef GLX_NV_video_capture
typedef XID GLXVideoCaptureDeviceNV;
#endif
#ifndef GLEXT_64_TYPES_DEFINED
/* This code block is duplicated in glext.h, so must be protected */
#define GLEXT_64_TYPES_DEFINED
/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
/* (as used in the GLX_OML_sync_control extension). */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#include <inttypes.h>
#elif defined(__sun__) || defined(__digital__)
#include <inttypes.h>
#if defined(__STDC__)
#if defined(__arch64__) || defined(_LP64)
typedef long int int64_t;
typedef unsigned long int uint64_t;
#else
typedef long long int int64_t;
typedef unsigned long long int uint64_t;
#endif /* __arch64__ */
#endif /* __STDC__ */
#elif defined( __VMS ) || defined(__sgi)
#include <inttypes.h>
#elif defined(__SCO__) || defined(__USLC__)
#include <stdint.h>
#elif defined(__UNIXOS2__) || defined(__SOL64__)
typedef long int int32_t;
typedef long long int int64_t;
typedef unsigned long long int uint64_t;
#elif defined(_WIN32) && defined(__GNUC__)
#include <stdint.h>
#elif defined(_WIN32)
typedef __int32 int32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <inttypes.h> /* Fallback option */
#endif
#endif
#ifndef GLX_VERSION_1_3
#define GLX_VERSION_1_3 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern GLXFBConfig * glXGetFBConfigs (Display *dpy, int screen, int *nelements);
extern GLXFBConfig * glXChooseFBConfig (Display *dpy, int screen, const int *attrib_list, int *nelements);
extern int glXGetFBConfigAttrib (Display *dpy, GLXFBConfig config, int attribute, int *value);
extern XVisualInfo * glXGetVisualFromFBConfig (Display *dpy, GLXFBConfig config);
extern GLXWindow glXCreateWindow (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
extern void glXDestroyWindow (Display *dpy, GLXWindow win);
extern GLXPixmap glXCreatePixmap (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
extern void glXDestroyPixmap (Display *dpy, GLXPixmap pixmap);
extern GLXPbuffer glXCreatePbuffer (Display *dpy, GLXFBConfig config, const int *attrib_list);
extern void glXDestroyPbuffer (Display *dpy, GLXPbuffer pbuf);
extern void glXQueryDrawable (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
extern GLXContext glXCreateNewContext (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
extern Bool glXMakeContextCurrent (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
extern GLXDrawable glXGetCurrentReadDrawable (void);
extern Display * glXGetCurrentDisplay (void);
extern int glXQueryContext (Display *dpy, GLXContext ctx, int attribute, int *value);
extern void glXSelectEvent (Display *dpy, GLXDrawable draw, unsigned long event_mask);
extern void glXGetSelectedEvent (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
typedef Display * ( * PFNGLXGETCURRENTDISPLAYPROC) (void);
typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
#endif
#ifndef GLX_VERSION_1_4
#define GLX_VERSION_1_4 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *procName);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
#endif
#ifndef GLX_ARB_get_proc_address
#define GLX_ARB_get_proc_address 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
#endif
#ifndef GLX_ARB_multisample
#define GLX_ARB_multisample 1
#endif
#ifndef GLX_ARB_fbconfig_float
#define GLX_ARB_fbconfig_float 1
#endif
#ifndef GLX_ARB_framebuffer_sRGB
#define GLX_ARB_framebuffer_sRGB 1
#endif
#ifndef GLX_ARB_create_context
#define GLX_ARB_create_context 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern GLXContext glXCreateContextAttribsARB (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
#endif
#ifndef GLX_ARB_create_context_profile
#define GLX_ARB_create_context_profile 1
#endif
#ifndef GLX_ARB_create_context_robustness
#define GLX_ARB_create_context_robustness 1
#endif
#ifndef GLX_SGIS_multisample
#define GLX_SGIS_multisample 1
#endif
#ifndef GLX_EXT_visual_info
#define GLX_EXT_visual_info 1
#endif
#ifndef GLX_SGI_swap_control
#define GLX_SGI_swap_control 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXSwapIntervalSGI (int interval);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
#endif
#ifndef GLX_SGI_video_sync
#define GLX_SGI_video_sync 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXGetVideoSyncSGI (unsigned int *count);
extern int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int *count);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);
typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);
#endif
#ifndef GLX_SGI_make_current_read
#define GLX_SGI_make_current_read 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern Bool glXMakeCurrentReadSGI (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
extern GLXDrawable glXGetCurrentReadDrawableSGI (void);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
#endif
#ifndef GLX_SGIX_video_source
#define GLX_SGIX_video_source 1
#ifdef _VL_H
#ifdef GLX_GLXEXT_PROTOTYPES
extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
extern void glXDestroyGLXVideoSourceSGIX (Display *dpy, GLXVideoSourceSGIX glxvideosource);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource);
#endif /* _VL_H */
#endif
#ifndef GLX_EXT_visual_rating
#define GLX_EXT_visual_rating 1
#endif
#ifndef GLX_EXT_import_context
#define GLX_EXT_import_context 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern Display * glXGetCurrentDisplayEXT (void);
extern int glXQueryContextInfoEXT (Display *dpy, GLXContext context, int attribute, int *value);
extern GLXContextID glXGetContextIDEXT (const GLXContext context);
extern GLXContext glXImportContextEXT (Display *dpy, GLXContextID contextID);
extern void glXFreeContextEXT (Display *dpy, GLXContext context);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void);
typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);
typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);
#endif
#ifndef GLX_SGIX_fbconfig
#define GLX_SGIX_fbconfig 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXGetFBConfigAttribSGIX (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *dpy, int screen, int *attrib_list, int *nelements);
extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
extern GLXContext glXCreateContextWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *dpy, GLXFBConfigSGIX config);
extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *dpy, XVisualInfo *vis);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);
typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config);
typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis);
#endif
#ifndef GLX_SGIX_pbuffer
#define GLX_SGIX_pbuffer 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
extern void glXDestroyGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf);
extern int glXQueryGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
extern void glXSelectEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long mask);
extern void glXGetSelectedEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long *mask);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf);
typedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask);
typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask);
#endif
#ifndef GLX_SGI_cushion
#define GLX_SGI_cushion 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern void glXCushionSGI (Display *dpy, Window window, float cushion);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion);
#endif
#ifndef GLX_SGIX_video_resize
#define GLX_SGIX_video_resize 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXBindChannelToWindowSGIX (Display *display, int screen, int channel, Window window);
extern int glXChannelRectSGIX (Display *display, int screen, int channel, int x, int y, int w, int h);
extern int glXQueryChannelRectSGIX (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
extern int glXQueryChannelDeltasSGIX (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
extern int glXChannelRectSyncSGIX (Display *display, int screen, int channel, GLenum synctype);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window);
typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h);
typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype);
#endif
#ifndef GLX_SGIX_dmbuffer
#define GLX_SGIX_dmbuffer 1
#ifdef _DM_BUFFER_H_
#ifdef GLX_GLXEXT_PROTOTYPES
extern Bool glXAssociateDMPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
#endif /* _DM_BUFFER_H_ */
#endif
#ifndef GLX_SGIX_swap_group
#define GLX_SGIX_swap_group 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern void glXJoinSwapGroupSGIX (Display *dpy, GLXDrawable drawable, GLXDrawable member);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
#endif
#ifndef GLX_SGIX_swap_barrier
#define GLX_SGIX_swap_barrier 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern void glXBindSwapBarrierSGIX (Display *dpy, GLXDrawable drawable, int barrier);
extern Bool glXQueryMaxSwapBarriersSGIX (Display *dpy, int screen, int *max);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
#endif
#ifndef GLX_SUN_get_transparent_index
#define GLX_SUN_get_transparent_index 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern Status glXGetTransparentIndexSUN (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
#endif
#ifndef GLX_MESA_copy_sub_buffer
#define GLX_MESA_copy_sub_buffer 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern void glXCopySubBufferMESA (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
#endif
#ifndef GLX_MESA_pixmap_colormap
#define GLX_MESA_pixmap_colormap 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern GLXPixmap glXCreateGLXPixmapMESA (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
#endif
#ifndef GLX_MESA_release_buffers
#define GLX_MESA_release_buffers 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern Bool glXReleaseBuffersMESA (Display *dpy, GLXDrawable drawable);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
#endif
#ifndef GLX_MESA_set_3dfx_mode
#define GLX_MESA_set_3dfx_mode 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern Bool glXSet3DfxModeMESA (int mode);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
#endif
#ifndef GLX_SGIX_visual_select_group
#define GLX_SGIX_visual_select_group 1
#endif
#ifndef GLX_OML_swap_method
#define GLX_OML_swap_method 1
#endif
#ifndef GLX_OML_sync_control
#define GLX_OML_sync_control 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern Bool glXGetSyncValuesOML (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
extern Bool glXGetMscRateOML (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
extern int64_t glXSwapBuffersMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
extern Bool glXWaitForMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
extern Bool glXWaitForSbcOML (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
#endif
#ifndef GLX_NV_float_buffer
#define GLX_NV_float_buffer 1
#endif
#ifndef GLX_SGIX_hyperpipe
#define GLX_SGIX_hyperpipe 1
typedef struct {
char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
int networkId;
} GLXHyperpipeNetworkSGIX;
typedef struct {
char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
int channel;
unsigned int
participationType;
int timeSlice;
} GLXHyperpipeConfigSGIX;
typedef struct {
char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
int srcXOrigin, srcYOrigin, srcWidth, srcHeight;
int destXOrigin, destYOrigin, destWidth, destHeight;
} GLXPipeRect;
typedef struct {
char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
int XOrigin, YOrigin, maxHeight, maxWidth;
} GLXPipeRectLimits;
#ifdef GLX_GLXEXT_PROTOTYPES
extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *dpy, int *npipes);
extern int glXHyperpipeConfigSGIX (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *dpy, int hpId, int *npipes);
extern int glXDestroyHyperpipeConfigSGIX (Display *dpy, int hpId);
extern int glXBindHyperpipeSGIX (Display *dpy, int hpId);
extern int glXQueryHyperpipeBestAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
extern int glXHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
extern int glXQueryHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);
typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);
typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);
typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
#endif
#ifndef GLX_MESA_agp_offset
#define GLX_MESA_agp_offset 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern unsigned int glXGetAGPOffsetMESA (const void *pointer);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
#endif
#ifndef GLX_EXT_fbconfig_packed_float
#define GLX_EXT_fbconfig_packed_float 1
#endif
#ifndef GLX_EXT_framebuffer_sRGB
#define GLX_EXT_framebuffer_sRGB 1
#endif
#ifndef GLX_EXT_texture_from_pixmap
#define GLX_EXT_texture_from_pixmap 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern void glXBindTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
extern void glXReleaseTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer);
#endif
#ifndef GLX_NV_present_video
#define GLX_NV_present_video 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern unsigned int * glXEnumerateVideoDevicesNV (Display *dpy, int screen, int *nelements);
extern int glXBindVideoDeviceNV (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef unsigned int * ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements);
typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
#endif
#ifndef GLX_NV_video_output
#define GLX_NV_video_output 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXGetVideoDeviceNV (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
extern int glXReleaseVideoDeviceNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);
extern int glXBindVideoImageNV (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
extern int glXReleaseVideoImageNV (Display *dpy, GLXPbuffer pbuf);
extern int glXSendPbufferToVideoNV (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
extern int glXGetVideoInfoNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);
typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display *dpy, GLXPbuffer pbuf);
typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
#endif
#ifndef GLX_NV_swap_group
#define GLX_NV_swap_group 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern Bool glXJoinSwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint group);
extern Bool glXBindSwapBarrierNV (Display *dpy, GLuint group, GLuint barrier);
extern Bool glXQuerySwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
extern Bool glXQueryMaxSwapGroupsNV (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
extern Bool glXQueryFrameCountNV (Display *dpy, int screen, GLuint *count);
extern Bool glXResetFrameCountNV (Display *dpy, int screen);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint group);
typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display *dpy, GLuint group, GLuint barrier);
typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display *dpy, int screen, GLuint *count);
typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display *dpy, int screen);
#endif
#ifndef GLX_NV_video_capture
#define GLX_NV_video_capture 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXBindVideoCaptureDeviceNV (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
extern GLXVideoCaptureDeviceNV * glXEnumerateVideoCaptureDevicesNV (Display *dpy, int screen, int *nelements);
extern void glXLockVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device);
extern int glXQueryVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
extern void glXReleaseVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display *dpy, int screen, int *nelements);
typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);
typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);
#endif
#ifndef GLX_EXT_swap_control
#define GLX_EXT_swap_control 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXSwapIntervalEXT (Display *dpy, GLXDrawable drawable, int interval);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable, int interval);
#endif
#ifndef GLX_NV_copy_image
#define GLX_NV_copy_image 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
#endif
#ifndef GLX_INTEL_swap_event
#define GLX_INTEL_swap_event 1
#endif
#ifndef GLX_NV_multisample_coverage
#define GLX_NV_multisample_coverage 1
#endif
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,862 @@
/*
* Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
* Copyright 2007-2008 Red Hat, Inc.
* (C) Copyright IBM Corporation 2004
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file dri_interface.h
*
* This file contains all the types and functions that define the interface
* between a DRI driver and driver loader. Currently, the most common driver
* loader is the XFree86 libGL.so. However, other loaders do exist, and in
* the future the server-side libglx.a will also be a loader.
*
* \author Kevin E. Martin <kevin@precisioninsight.com>
* \author Ian Romanick <idr@us.ibm.com>
* \author Kristian Høgsberg <krh@redhat.com>
*/
#ifndef DRI_INTERFACE_H
#define DRI_INTERFACE_H
/* For archs with no drm.h */
#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__)
#ifndef __NOT_HAVE_DRM_H
#define __NOT_HAVE_DRM_H
#endif
#endif
#ifndef __NOT_HAVE_DRM_H
#include <drm.h>
#else
typedef unsigned int drm_context_t;
typedef unsigned int drm_drawable_t;
typedef struct drm_clip_rect drm_clip_rect_t;
#endif
/**
* \name DRI interface structures
*
* The following structures define the interface between the GLX client
* side library and the DRI (direct rendering infrastructure).
*/
/*@{*/
typedef struct __DRIdisplayRec __DRIdisplay;
typedef struct __DRIscreenRec __DRIscreen;
typedef struct __DRIcontextRec __DRIcontext;
typedef struct __DRIdrawableRec __DRIdrawable;
typedef struct __DRIconfigRec __DRIconfig;
typedef struct __DRIframebufferRec __DRIframebuffer;
typedef struct __DRIversionRec __DRIversion;
typedef struct __DRIcoreExtensionRec __DRIcoreExtension;
typedef struct __DRIextensionRec __DRIextension;
typedef struct __DRIcopySubBufferExtensionRec __DRIcopySubBufferExtension;
typedef struct __DRIswapControlExtensionRec __DRIswapControlExtension;
typedef struct __DRIframeTrackingExtensionRec __DRIframeTrackingExtension;
typedef struct __DRImediaStreamCounterExtensionRec __DRImediaStreamCounterExtension;
typedef struct __DRItexOffsetExtensionRec __DRItexOffsetExtension;
typedef struct __DRItexBufferExtensionRec __DRItexBufferExtension;
typedef struct __DRIlegacyExtensionRec __DRIlegacyExtension;
typedef struct __DRIswrastExtensionRec __DRIswrastExtension;
typedef struct __DRIbufferRec __DRIbuffer;
typedef struct __DRIdri2ExtensionRec __DRIdri2Extension;
typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension;
typedef struct __DRI2flushExtensionRec __DRI2flushExtension;
/*@}*/
/**
* Extension struct. Drivers 'inherit' from this struct by embedding
* it as the first element in the extension struct.
*
* We never break API in for a DRI extension. If we need to change
* the way things work in a non-backwards compatible manner, we
* introduce a new extension. During a transition period, we can
* leave both the old and the new extension in the driver, which
* allows us to move to the new interface without having to update the
* loader(s) in lock step.
*
* However, we can add entry points to an extension over time as long
* as we don't break the old ones. As we add entry points to an
* extension, we increase the version number. The corresponding
* #define can be used to guard code that accesses the new entry
* points at compile time and the version field in the extension
* struct can be used at run-time to determine how to use the
* extension.
*/
struct __DRIextensionRec {
const char *name;
int version;
};
/**
* The first set of extension are the screen extensions, returned by
* __DRIcore::getExtensions(). This entry point will return a list of
* extensions and the loader can use the ones it knows about by
* casting them to more specific extensions and advertising any GLX
* extensions the DRI extensions enables.
*/
/**
* Used by drivers to indicate support for setting the read drawable.
*/
#define __DRI_READ_DRAWABLE "DRI_ReadDrawable"
#define __DRI_READ_DRAWABLE_VERSION 1
/**
* Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
*/
#define __DRI_COPY_SUB_BUFFER "DRI_CopySubBuffer"
#define __DRI_COPY_SUB_BUFFER_VERSION 1
struct __DRIcopySubBufferExtensionRec {
__DRIextension base;
void (*copySubBuffer)(__DRIdrawable *drawable, int x, int y, int w, int h);
};
/**
* Used by drivers that implement the GLX_SGI_swap_control or
* GLX_MESA_swap_control extension.
*/
#define __DRI_SWAP_CONTROL "DRI_SwapControl"
#define __DRI_SWAP_CONTROL_VERSION 1
struct __DRIswapControlExtensionRec {
__DRIextension base;
void (*setSwapInterval)(__DRIdrawable *drawable, unsigned int inteval);
unsigned int (*getSwapInterval)(__DRIdrawable *drawable);
};
/**
* Used by drivers that implement the GLX_MESA_swap_frame_usage extension.
*/
#define __DRI_FRAME_TRACKING "DRI_FrameTracking"
#define __DRI_FRAME_TRACKING_VERSION 1
struct __DRIframeTrackingExtensionRec {
__DRIextension base;
/**
* Enable or disable frame usage tracking.
*
* \since Internal API version 20030317.
*/
int (*frameTracking)(__DRIdrawable *drawable, GLboolean enable);
/**
* Retrieve frame usage information.
*
* \since Internal API version 20030317.
*/
int (*queryFrameTracking)(__DRIdrawable *drawable,
int64_t * sbc, int64_t * missedFrames,
float * lastMissedUsage, float * usage);
};
/**
* Used by drivers that implement the GLX_SGI_video_sync extension.
*/
#define __DRI_MEDIA_STREAM_COUNTER "DRI_MediaStreamCounter"
#define __DRI_MEDIA_STREAM_COUNTER_VERSION 1
struct __DRImediaStreamCounterExtensionRec {
__DRIextension base;
/**
* Wait for the MSC to equal target_msc, or, if that has already passed,
* the next time (MSC % divisor) is equal to remainder. If divisor is
* zero, the function will return as soon as MSC is greater than or equal
* to target_msc.
*/
int (*waitForMSC)(__DRIdrawable *drawable,
int64_t target_msc, int64_t divisor, int64_t remainder,
int64_t * msc, int64_t * sbc);
/**
* Get the number of vertical refreshes since some point in time before
* this function was first called (i.e., system start up).
*/
int (*getDrawableMSC)(__DRIscreen *screen, __DRIdrawable *drawable,
int64_t *msc);
};
#define __DRI_TEX_OFFSET "DRI_TexOffset"
#define __DRI_TEX_OFFSET_VERSION 1
struct __DRItexOffsetExtensionRec {
__DRIextension base;
/**
* Method to override base texture image with a driver specific 'offset'.
* The depth passed in allows e.g. to ignore the alpha channel of texture
* images where the non-alpha components don't occupy a whole texel.
*
* For GLX_EXT_texture_from_pixmap with AIGLX.
*/
void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname,
unsigned long long offset, GLint depth, GLuint pitch);
};
/* Valid values for format in the setTexBuffer2 function below. These
* values match the GLX tokens for compatibility reasons, but we
* define them here since the DRI interface can't depend on GLX. */
#define __DRI_TEXTURE_FORMAT_NONE 0x20D8
#define __DRI_TEXTURE_FORMAT_RGB 0x20D9
#define __DRI_TEXTURE_FORMAT_RGBA 0x20DA
#define __DRI_TEX_BUFFER "DRI_TexBuffer"
#define __DRI_TEX_BUFFER_VERSION 2
struct __DRItexBufferExtensionRec {
__DRIextension base;
/**
* Method to override base texture image with the contents of a
* __DRIdrawable.
*
* For GLX_EXT_texture_from_pixmap with AIGLX. Deprecated in favor of
* setTexBuffer2 in version 2 of this interface
*/
void (*setTexBuffer)(__DRIcontext *pDRICtx,
GLint target,
__DRIdrawable *pDraw);
/**
* Method to override base texture image with the contents of a
* __DRIdrawable, including the required texture format attribute.
*
* For GLX_EXT_texture_from_pixmap with AIGLX.
*/
void (*setTexBuffer2)(__DRIcontext *pDRICtx,
GLint target,
GLint format,
__DRIdrawable *pDraw);
};
/**
* Used by drivers that implement DRI2
*/
#define __DRI2_FLUSH "DRI2_Flush"
#define __DRI2_FLUSH_VERSION 3
struct __DRI2flushExtensionRec {
__DRIextension base;
void (*flush)(__DRIdrawable *drawable);
/**
* Ask the driver to call getBuffers/getBuffersWithFormat before
* it starts rendering again.
*
* \param drawable the drawable to invalidate
*
* \since 3
*/
void (*invalidate)(__DRIdrawable *drawable);
};
/**
* XML document describing the configuration options supported by the
* driver.
*/
extern const char __driConfigOptions[];
/*@}*/
/**
* The following extensions describe loader features that the DRI
* driver can make use of. Some of these are mandatory, such as the
* getDrawableInfo extension for DRI and the DRI Loader extensions for
* DRI2, while others are optional, and if present allow the driver to
* expose certain features. The loader pass in a NULL terminated
* array of these extensions to the driver in the createNewScreen
* constructor.
*/
typedef struct __DRIgetDrawableInfoExtensionRec __DRIgetDrawableInfoExtension;
typedef struct __DRIsystemTimeExtensionRec __DRIsystemTimeExtension;
typedef struct __DRIdamageExtensionRec __DRIdamageExtension;
typedef struct __DRIloaderExtensionRec __DRIloaderExtension;
typedef struct __DRIswrastLoaderExtensionRec __DRIswrastLoaderExtension;
/**
* Callback to getDrawableInfo protocol
*/
#define __DRI_GET_DRAWABLE_INFO "DRI_GetDrawableInfo"
#define __DRI_GET_DRAWABLE_INFO_VERSION 1
struct __DRIgetDrawableInfoExtensionRec {
__DRIextension base;
/**
* This function is used to get information about the position, size, and
* clip rects of a drawable.
*/
GLboolean (* getDrawableInfo) ( __DRIdrawable *drawable,
unsigned int * index, unsigned int * stamp,
int * x, int * y, int * width, int * height,
int * numClipRects, drm_clip_rect_t ** pClipRects,
int * backX, int * backY,
int * numBackClipRects, drm_clip_rect_t ** pBackClipRects,
void *loaderPrivate);
};
/**
* Callback to get system time for media stream counter extensions.
*/
#define __DRI_SYSTEM_TIME "DRI_SystemTime"
#define __DRI_SYSTEM_TIME_VERSION 1
struct __DRIsystemTimeExtensionRec {
__DRIextension base;
/**
* Get the 64-bit unadjusted system time (UST).
*/
int (*getUST)(int64_t * ust);
/**
* Get the media stream counter (MSC) rate.
*
* Matching the definition in GLX_OML_sync_control, this function returns
* the rate of the "media stream counter". In practical terms, this is
* the frame refresh rate of the display.
*/
GLboolean (*getMSCRate)(__DRIdrawable *draw,
int32_t * numerator, int32_t * denominator,
void *loaderPrivate);
};
/**
* Damage reporting
*/
#define __DRI_DAMAGE "DRI_Damage"
#define __DRI_DAMAGE_VERSION 1
struct __DRIdamageExtensionRec {
__DRIextension base;
/**
* Reports areas of the given drawable which have been modified by the
* driver.
*
* \param drawable which the drawing was done to.
* \param rects rectangles affected, with the drawable origin as the
* origin.
* \param x X offset of the drawable within the screen (used in the
* front_buffer case)
* \param y Y offset of the drawable within the screen.
* \param front_buffer boolean flag for whether the drawing to the
* drawable was actually done directly to the front buffer (instead
* of backing storage, for example)
* \param loaderPrivate the data passed in at createNewDrawable time
*/
void (*reportDamage)(__DRIdrawable *draw,
int x, int y,
drm_clip_rect_t *rects, int num_rects,
GLboolean front_buffer,
void *loaderPrivate);
};
#define __DRI_SWRAST_IMAGE_OP_DRAW 1
#define __DRI_SWRAST_IMAGE_OP_CLEAR 2
#define __DRI_SWRAST_IMAGE_OP_SWAP 3
/**
* SWRast Loader extension.
*/
#define __DRI_SWRAST_LOADER "DRI_SWRastLoader"
#define __DRI_SWRAST_LOADER_VERSION 1
struct __DRIswrastLoaderExtensionRec {
__DRIextension base;
/*
* Drawable position and size
*/
void (*getDrawableInfo)(__DRIdrawable *drawable,
int *x, int *y, int *width, int *height,
void *loaderPrivate);
/**
* Put image to drawable
*/
void (*putImage)(__DRIdrawable *drawable, int op,
int x, int y, int width, int height,
char *data, void *loaderPrivate);
/**
* Get image from readable
*/
void (*getImage)(__DRIdrawable *readable,
int x, int y, int width, int height,
char *data, void *loaderPrivate);
};
/**
* Invalidate loader extension. The presence of this extension
* indicates to the DRI driver that the loader will call invalidate in
* the __DRI2_FLUSH extension, whenever the needs to query for new
* buffers. This means that the DRI driver can drop the polling in
* glViewport().
*
* The extension doesn't provide any functionality, it's only use to
* indicate to the driver that it can use the new semantics. A DRI
* driver can use this to switch between the different semantics or
* just refuse to initialize if this extension isn't present.
*/
#define __DRI_USE_INVALIDATE "DRI_UseInvalidate"
#define __DRI_USE_INVALIDATE_VERSION 1
typedef struct __DRIuseInvalidateExtensionRec __DRIuseInvalidateExtension;
struct __DRIuseInvalidateExtensionRec {
__DRIextension base;
};
/**
* The remaining extensions describe driver extensions, immediately
* available interfaces provided by the driver. To start using the
* driver, dlsym() for the __DRI_DRIVER_EXTENSIONS symbol and look for
* the extension you need in the array.
*/
#define __DRI_DRIVER_EXTENSIONS "__driDriverExtensions"
/**
* Tokens for __DRIconfig attribs. A number of attributes defined by
* GLX or EGL standards are not in the table, as they must be provided
* by the loader. For example, FBConfig ID or visual ID, drawable type.
*/
#define __DRI_ATTRIB_BUFFER_SIZE 1
#define __DRI_ATTRIB_LEVEL 2
#define __DRI_ATTRIB_RED_SIZE 3
#define __DRI_ATTRIB_GREEN_SIZE 4
#define __DRI_ATTRIB_BLUE_SIZE 5
#define __DRI_ATTRIB_LUMINANCE_SIZE 6
#define __DRI_ATTRIB_ALPHA_SIZE 7
#define __DRI_ATTRIB_ALPHA_MASK_SIZE 8
#define __DRI_ATTRIB_DEPTH_SIZE 9
#define __DRI_ATTRIB_STENCIL_SIZE 10
#define __DRI_ATTRIB_ACCUM_RED_SIZE 11
#define __DRI_ATTRIB_ACCUM_GREEN_SIZE 12
#define __DRI_ATTRIB_ACCUM_BLUE_SIZE 13
#define __DRI_ATTRIB_ACCUM_ALPHA_SIZE 14
#define __DRI_ATTRIB_SAMPLE_BUFFERS 15
#define __DRI_ATTRIB_SAMPLES 16
#define __DRI_ATTRIB_RENDER_TYPE 17
#define __DRI_ATTRIB_CONFIG_CAVEAT 18
#define __DRI_ATTRIB_CONFORMANT 19
#define __DRI_ATTRIB_DOUBLE_BUFFER 20
#define __DRI_ATTRIB_STEREO 21
#define __DRI_ATTRIB_AUX_BUFFERS 22
#define __DRI_ATTRIB_TRANSPARENT_TYPE 23
#define __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE 24
#define __DRI_ATTRIB_TRANSPARENT_RED_VALUE 25
#define __DRI_ATTRIB_TRANSPARENT_GREEN_VALUE 26
#define __DRI_ATTRIB_TRANSPARENT_BLUE_VALUE 27
#define __DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE 28
#define __DRI_ATTRIB_FLOAT_MODE 29
#define __DRI_ATTRIB_RED_MASK 30
#define __DRI_ATTRIB_GREEN_MASK 31
#define __DRI_ATTRIB_BLUE_MASK 32
#define __DRI_ATTRIB_ALPHA_MASK 33
#define __DRI_ATTRIB_MAX_PBUFFER_WIDTH 34
#define __DRI_ATTRIB_MAX_PBUFFER_HEIGHT 35
#define __DRI_ATTRIB_MAX_PBUFFER_PIXELS 36
#define __DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH 37
#define __DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT 38
#define __DRI_ATTRIB_VISUAL_SELECT_GROUP 39
#define __DRI_ATTRIB_SWAP_METHOD 40
#define __DRI_ATTRIB_MAX_SWAP_INTERVAL 41
#define __DRI_ATTRIB_MIN_SWAP_INTERVAL 42
#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGB 43
#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA 44
#define __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE 45
#define __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS 46
#define __DRI_ATTRIB_YINVERTED 47
/* __DRI_ATTRIB_RENDER_TYPE */
#define __DRI_ATTRIB_RGBA_BIT 0x01
#define __DRI_ATTRIB_COLOR_INDEX_BIT 0x02
#define __DRI_ATTRIB_LUMINANCE_BIT 0x04
/* __DRI_ATTRIB_CONFIG_CAVEAT */
#define __DRI_ATTRIB_SLOW_BIT 0x01
#define __DRI_ATTRIB_NON_CONFORMANT_CONFIG 0x02
/* __DRI_ATTRIB_TRANSPARENT_TYPE */
#define __DRI_ATTRIB_TRANSPARENT_RGB 0x00
#define __DRI_ATTRIB_TRANSPARENT_INDEX 0x01
/* __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS */
#define __DRI_ATTRIB_TEXTURE_1D_BIT 0x01
#define __DRI_ATTRIB_TEXTURE_2D_BIT 0x02
#define __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT 0x04
/**
* This extension defines the core DRI functionality.
*/
#define __DRI_CORE "DRI_Core"
#define __DRI_CORE_VERSION 1
struct __DRIcoreExtensionRec {
__DRIextension base;
__DRIscreen *(*createNewScreen)(int screen, int fd,
unsigned int sarea_handle,
const __DRIextension **extensions,
const __DRIconfig ***driverConfigs,
void *loaderPrivate);
void (*destroyScreen)(__DRIscreen *screen);
const __DRIextension **(*getExtensions)(__DRIscreen *screen);
int (*getConfigAttrib)(const __DRIconfig *config,
unsigned int attrib,
unsigned int *value);
int (*indexConfigAttrib)(const __DRIconfig *config, int index,
unsigned int *attrib, unsigned int *value);
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
const __DRIconfig *config,
unsigned int drawable_id,
unsigned int head,
void *loaderPrivate);
void (*destroyDrawable)(__DRIdrawable *drawable);
void (*swapBuffers)(__DRIdrawable *drawable);
__DRIcontext *(*createNewContext)(__DRIscreen *screen,
const __DRIconfig *config,
__DRIcontext *shared,
void *loaderPrivate);
int (*copyContext)(__DRIcontext *dest,
__DRIcontext *src,
unsigned long mask);
void (*destroyContext)(__DRIcontext *context);
int (*bindContext)(__DRIcontext *ctx,
__DRIdrawable *pdraw,
__DRIdrawable *pread);
int (*unbindContext)(__DRIcontext *ctx);
};
/**
* Stored version of some component (i.e., server-side DRI module, kernel-side
* DRM, etc.).
*
* \todo
* There are several data structures that explicitly store a major version,
* minor version, and patch level. These structures should be modified to
* have a \c __DRIversionRec instead.
*/
struct __DRIversionRec {
int major; /**< Major version number. */
int minor; /**< Minor version number. */
int patch; /**< Patch-level. */
};
/**
* Framebuffer information record. Used by libGL to communicate information
* about the framebuffer to the driver's \c __driCreateNewScreen function.
*
* In XFree86, most of this information is derrived from data returned by
* calling \c XF86DRIGetDeviceInfo.
*
* \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen
* __driUtilCreateNewScreen CallCreateNewScreen
*
* \bug This structure could be better named.
*/
struct __DRIframebufferRec {
unsigned char *base; /**< Framebuffer base address in the CPU's
* address space. This value is calculated by
* calling \c drmMap on the framebuffer handle
* returned by \c XF86DRIGetDeviceInfo (or a
* similar function).
*/
int size; /**< Framebuffer size, in bytes. */
int stride; /**< Number of bytes from one line to the next. */
int width; /**< Pixel width of the framebuffer. */
int height; /**< Pixel height of the framebuffer. */
int dev_priv_size; /**< Size of the driver's dev-priv structure. */
void *dev_priv; /**< Pointer to the driver's dev-priv structure. */
};
/**
* This extension provides alternative screen, drawable and context
* constructors for legacy DRI functionality. This is used in
* conjunction with the core extension.
*/
#define __DRI_LEGACY "DRI_Legacy"
#define __DRI_LEGACY_VERSION 1
struct __DRIlegacyExtensionRec {
__DRIextension base;
__DRIscreen *(*createNewScreen)(int screen,
const __DRIversion *ddx_version,
const __DRIversion *dri_version,
const __DRIversion *drm_version,
const __DRIframebuffer *frame_buffer,
void *pSAREA, int fd,
const __DRIextension **extensions,
const __DRIconfig ***driver_configs,
void *loaderPrivate);
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
const __DRIconfig *config,
drm_drawable_t hwDrawable,
int renderType, const int *attrs,
void *loaderPrivate);
__DRIcontext *(*createNewContext)(__DRIscreen *screen,
const __DRIconfig *config,
int render_type,
__DRIcontext *shared,
drm_context_t hwContext,
void *loaderPrivate);
};
/**
* This extension provides alternative screen, drawable and context
* constructors for swrast DRI functionality. This is used in
* conjunction with the core extension.
*/
#define __DRI_SWRAST "DRI_SWRast"
#define __DRI_SWRAST_VERSION 1
struct __DRIswrastExtensionRec {
__DRIextension base;
__DRIscreen *(*createNewScreen)(int screen,
const __DRIextension **extensions,
const __DRIconfig ***driver_configs,
void *loaderPrivate);
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
const __DRIconfig *config,
void *loaderPrivate);
};
/**
* DRI2 Loader extension.
*/
#define __DRI_BUFFER_FRONT_LEFT 0
#define __DRI_BUFFER_BACK_LEFT 1
#define __DRI_BUFFER_FRONT_RIGHT 2
#define __DRI_BUFFER_BACK_RIGHT 3
#define __DRI_BUFFER_DEPTH 4
#define __DRI_BUFFER_STENCIL 5
#define __DRI_BUFFER_ACCUM 6
#define __DRI_BUFFER_FAKE_FRONT_LEFT 7
#define __DRI_BUFFER_FAKE_FRONT_RIGHT 8
#define __DRI_BUFFER_DEPTH_STENCIL 9 /**< Only available with DRI2 1.1 */
struct __DRIbufferRec {
unsigned int attachment;
unsigned int name;
unsigned int pitch;
unsigned int cpp;
unsigned int flags;
};
#define __DRI_DRI2_LOADER "DRI_DRI2Loader"
#define __DRI_DRI2_LOADER_VERSION 3
struct __DRIdri2LoaderExtensionRec {
__DRIextension base;
__DRIbuffer *(*getBuffers)(__DRIdrawable *driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate);
/**
* Flush pending front-buffer rendering
*
* Any rendering that has been performed to the
* \c __DRI_BUFFER_FAKE_FRONT_LEFT will be flushed to the
* \c __DRI_BUFFER_FRONT_LEFT.
*
* \param driDrawable Drawable whose front-buffer is to be flushed
* \param loaderPrivate Loader's private data that was previously passed
* into __DRIdri2ExtensionRec::createNewDrawable
*/
void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
/**
* Get list of buffers from the server
*
* Gets a list of buffer for the specified set of attachments. Unlike
* \c ::getBuffers, this function takes a list of attachments paired with
* opaque \c unsigned \c int value describing the format of the buffer.
* It is the responsibility of the caller to know what the service that
* allocates the buffers will expect to receive for the format.
*
* \param driDrawable Drawable whose buffers are being queried.
* \param width Output where the width of the buffers is stored.
* \param height Output where the height of the buffers is stored.
* \param attachments List of pairs of attachment ID and opaque format
* requested for the drawable.
* \param count Number of attachment / format pairs stored in
* \c attachments.
* \param loaderPrivate Loader's private data that was previously passed
* into __DRIdri2ExtensionRec::createNewDrawable.
*/
__DRIbuffer *(*getBuffersWithFormat)(__DRIdrawable *driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate);
};
/**
* This extension provides alternative screen, drawable and context
* constructors for DRI2.
*/
#define __DRI_DRI2 "DRI_DRI2"
#define __DRI_DRI2_VERSION 2
#define __DRI_API_OPENGL 0
#define __DRI_API_GLES 1
#define __DRI_API_GLES2 2
struct __DRIdri2ExtensionRec {
__DRIextension base;
__DRIscreen *(*createNewScreen)(int screen, int fd,
const __DRIextension **extensions,
const __DRIconfig ***driver_configs,
void *loaderPrivate);
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
const __DRIconfig *config,
void *loaderPrivate);
__DRIcontext *(*createNewContext)(__DRIscreen *screen,
const __DRIconfig *config,
__DRIcontext *shared,
void *loaderPrivate);
/* Since version 2 */
unsigned int (*getAPIMask)(__DRIscreen *screen);
__DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
int api,
const __DRIconfig *config,
__DRIcontext *shared,
void *data);
};
/**
* This extension provides functionality to enable various EGLImage
* extensions.
*/
#define __DRI_IMAGE "DRI_IMAGE"
#define __DRI_IMAGE_VERSION 1
/**
* These formats correspond to the similarly named MESA_FORMAT_*
* tokens, except in the native endian of the CPU. For example, on
* little endian __DRI_IMAGE_FORMAT_XRGB8888 corresponds to
* MESA_FORMAT_XRGB8888, but MESA_FORMAT_XRGB8888_REV on big endian.
*/
#define __DRI_IMAGE_FORMAT_RGB565 0x1001
#define __DRI_IMAGE_FORMAT_XRGB8888 0x1002
#define __DRI_IMAGE_FORMAT_ARGB8888 0x1003
#define __DRI_IMAGE_USE_SHARE 0x0001
#define __DRI_IMAGE_USE_SCANOUT 0x0002
/**
* queryImage attributes
*/
#define __DRI_IMAGE_ATTRIB_STRIDE 0x2000
#define __DRI_IMAGE_ATTRIB_HANDLE 0x2001
#define __DRI_IMAGE_ATTRIB_NAME 0x2002
typedef struct __DRIimageRec __DRIimage;
typedef struct __DRIimageExtensionRec __DRIimageExtension;
struct __DRIimageExtensionRec {
__DRIextension base;
__DRIimage *(*createImageFromName)(__DRIscreen *screen,
int width, int height, int format,
int name, int pitch,
void *loaderPrivate);
__DRIimage *(*createImageFromRenderbuffer)(__DRIcontext *context,
int renderbuffer,
void *loaderPrivate);
void (*destroyImage)(__DRIimage *image);
__DRIimage *(*createImage)(__DRIscreen *screen,
int width, int height, int format,
unsigned int use,
void *loaderPrivate);
GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value);
};
/**
* This extension must be implemented by the loader and passed to the
* driver at screen creation time. The EGLImage entry points in the
* various client APIs take opaque EGLImage handles and use this
* extension to map them to a __DRIimage. At version 1, this
* extensions allows mapping EGLImage pointers to __DRIimage pointers,
* but future versions could support other EGLImage-like, opaque types
* with new lookup functions.
*/
#define __DRI_IMAGE_LOOKUP "DRI_IMAGE_LOOKUP"
#define __DRI_IMAGE_LOOKUP_VERSION 1
typedef struct __DRIimageLookupExtensionRec __DRIimageLookupExtension;
struct __DRIimageLookupExtensionRec {
__DRIextension base;
__DRIimage *(*lookupEGLImage)(__DRIscreen *screen, void *image,
void *loaderPrivate);
};
/**
* This extension allows for common DRI2 options
*/
#define __DRI2_CONFIG_QUERY "DRI_CONFIG_QUERY"
#define __DRI2_CONFIG_QUERY_VERSION 1
typedef struct __DRI2configQueryExtensionRec __DRI2configQueryExtension;
struct __DRI2configQueryExtensionRec {
__DRIextension base;
int (*configQueryb)(__DRIscreen *screen, const char *var, GLboolean *val);
int (*configQueryi)(__DRIscreen *screen, const char *var, GLint *val);
int (*configQueryf)(__DRIscreen *screen, const char *var, GLfloat *val);
};
#endif

View file

@ -0,0 +1,15 @@
/*
* Skeleton egl.h to provide compatibility for early GLES 1.0
* applications. Several early implementations included gl.h
* in egl.h leading applications to include only egl.h
*
* $Revision: 6252 $ on $Date:: 2008-08-06 16:35:08 -0700 #$
*/
#ifndef __legacy_egl_h_
#define __legacy_egl_h_
#include <EGL/egl.h>
#include <GLES/gl.h>
#endif /* __legacy_egl_h_ */

View file

@ -0,0 +1,770 @@
#ifndef __gl_h_
#define __gl_h_
/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */
#include <GLES/glplatform.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
typedef void GLvoid;
typedef char GLchar;
typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;
typedef khronos_int8_t GLbyte;
typedef short GLshort;
typedef int GLint;
typedef int GLsizei;
typedef khronos_uint8_t GLubyte;
typedef unsigned short GLushort;
typedef unsigned int GLuint;
typedef khronos_float_t GLfloat;
typedef khronos_float_t GLclampf;
typedef khronos_int32_t GLfixed;
typedef khronos_int32_t GLclampx;
typedef khronos_intptr_t GLintptr;
typedef khronos_ssize_t GLsizeiptr;
/*************************************************************/
/* OpenGL ES core versions */
#define GL_VERSION_ES_CM_1_0 1
#define GL_VERSION_ES_CL_1_0 1
#define GL_VERSION_ES_CM_1_1 1
#define GL_VERSION_ES_CL_1_1 1
/* ClearBufferMask */
#define GL_DEPTH_BUFFER_BIT 0x00000100
#define GL_STENCIL_BUFFER_BIT 0x00000400
#define GL_COLOR_BUFFER_BIT 0x00004000
/* Boolean */
#define GL_FALSE 0
#define GL_TRUE 1
/* BeginMode */
#define GL_POINTS 0x0000
#define GL_LINES 0x0001
#define GL_LINE_LOOP 0x0002
#define GL_LINE_STRIP 0x0003
#define GL_TRIANGLES 0x0004
#define GL_TRIANGLE_STRIP 0x0005
#define GL_TRIANGLE_FAN 0x0006
/* AlphaFunction */
#define GL_NEVER 0x0200
#define GL_LESS 0x0201
#define GL_EQUAL 0x0202
#define GL_LEQUAL 0x0203
#define GL_GREATER 0x0204
#define GL_NOTEQUAL 0x0205
#define GL_GEQUAL 0x0206
#define GL_ALWAYS 0x0207
/* BlendingFactorDest */
#define GL_ZERO 0
#define GL_ONE 1
#define GL_SRC_COLOR 0x0300
#define GL_ONE_MINUS_SRC_COLOR 0x0301
#define GL_SRC_ALPHA 0x0302
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
#define GL_DST_ALPHA 0x0304
#define GL_ONE_MINUS_DST_ALPHA 0x0305
/* BlendingFactorSrc */
/* GL_ZERO */
/* GL_ONE */
#define GL_DST_COLOR 0x0306
#define GL_ONE_MINUS_DST_COLOR 0x0307
#define GL_SRC_ALPHA_SATURATE 0x0308
/* GL_SRC_ALPHA */
/* GL_ONE_MINUS_SRC_ALPHA */
/* GL_DST_ALPHA */
/* GL_ONE_MINUS_DST_ALPHA */
/* ClipPlaneName */
#define GL_CLIP_PLANE0 0x3000
#define GL_CLIP_PLANE1 0x3001
#define GL_CLIP_PLANE2 0x3002
#define GL_CLIP_PLANE3 0x3003
#define GL_CLIP_PLANE4 0x3004
#define GL_CLIP_PLANE5 0x3005
/* ColorMaterialFace */
/* GL_FRONT_AND_BACK */
/* ColorMaterialParameter */
/* GL_AMBIENT_AND_DIFFUSE */
/* ColorPointerType */
/* GL_UNSIGNED_BYTE */
/* GL_FLOAT */
/* GL_FIXED */
/* CullFaceMode */
#define GL_FRONT 0x0404
#define GL_BACK 0x0405
#define GL_FRONT_AND_BACK 0x0408
/* DepthFunction */
/* GL_NEVER */
/* GL_LESS */
/* GL_EQUAL */
/* GL_LEQUAL */
/* GL_GREATER */
/* GL_NOTEQUAL */
/* GL_GEQUAL */
/* GL_ALWAYS */
/* EnableCap */
#define GL_FOG 0x0B60
#define GL_LIGHTING 0x0B50
#define GL_TEXTURE_2D 0x0DE1
#define GL_CULL_FACE 0x0B44
#define GL_ALPHA_TEST 0x0BC0
#define GL_BLEND 0x0BE2
#define GL_COLOR_LOGIC_OP 0x0BF2
#define GL_DITHER 0x0BD0
#define GL_STENCIL_TEST 0x0B90
#define GL_DEPTH_TEST 0x0B71
/* GL_LIGHT0 */
/* GL_LIGHT1 */
/* GL_LIGHT2 */
/* GL_LIGHT3 */
/* GL_LIGHT4 */
/* GL_LIGHT5 */
/* GL_LIGHT6 */
/* GL_LIGHT7 */
#define GL_POINT_SMOOTH 0x0B10
#define GL_LINE_SMOOTH 0x0B20
#define GL_SCISSOR_TEST 0x0C11
#define GL_COLOR_MATERIAL 0x0B57
#define GL_NORMALIZE 0x0BA1
#define GL_RESCALE_NORMAL 0x803A
#define GL_POLYGON_OFFSET_FILL 0x8037
#define GL_VERTEX_ARRAY 0x8074
#define GL_NORMAL_ARRAY 0x8075
#define GL_COLOR_ARRAY 0x8076
#define GL_TEXTURE_COORD_ARRAY 0x8078
#define GL_MULTISAMPLE 0x809D
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
#define GL_SAMPLE_COVERAGE 0x80A0
/* ErrorCode */
#define GL_NO_ERROR 0
#define GL_INVALID_ENUM 0x0500
#define GL_INVALID_VALUE 0x0501
#define GL_INVALID_OPERATION 0x0502
#define GL_STACK_OVERFLOW 0x0503
#define GL_STACK_UNDERFLOW 0x0504
#define GL_OUT_OF_MEMORY 0x0505
/* FogMode */
/* GL_LINEAR */
#define GL_EXP 0x0800
#define GL_EXP2 0x0801
/* FogParameter */
#define GL_FOG_DENSITY 0x0B62
#define GL_FOG_START 0x0B63
#define GL_FOG_END 0x0B64
#define GL_FOG_MODE 0x0B65
#define GL_FOG_COLOR 0x0B66
/* FrontFaceDirection */
#define GL_CW 0x0900
#define GL_CCW 0x0901
/* GetPName */
#define GL_CURRENT_COLOR 0x0B00
#define GL_CURRENT_NORMAL 0x0B02
#define GL_CURRENT_TEXTURE_COORDS 0x0B03
#define GL_POINT_SIZE 0x0B11
#define GL_POINT_SIZE_MIN 0x8126
#define GL_POINT_SIZE_MAX 0x8127
#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
#define GL_POINT_DISTANCE_ATTENUATION 0x8129
#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
#define GL_LINE_WIDTH 0x0B21
#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
#define GL_CULL_FACE_MODE 0x0B45
#define GL_FRONT_FACE 0x0B46
#define GL_SHADE_MODEL 0x0B54
#define GL_DEPTH_RANGE 0x0B70
#define GL_DEPTH_WRITEMASK 0x0B72
#define GL_DEPTH_CLEAR_VALUE 0x0B73
#define GL_DEPTH_FUNC 0x0B74
#define GL_STENCIL_CLEAR_VALUE 0x0B91
#define GL_STENCIL_FUNC 0x0B92
#define GL_STENCIL_VALUE_MASK 0x0B93
#define GL_STENCIL_FAIL 0x0B94
#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
#define GL_STENCIL_REF 0x0B97
#define GL_STENCIL_WRITEMASK 0x0B98
#define GL_MATRIX_MODE 0x0BA0
#define GL_VIEWPORT 0x0BA2
#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
#define GL_PROJECTION_STACK_DEPTH 0x0BA4
#define GL_TEXTURE_STACK_DEPTH 0x0BA5
#define GL_MODELVIEW_MATRIX 0x0BA6
#define GL_PROJECTION_MATRIX 0x0BA7
#define GL_TEXTURE_MATRIX 0x0BA8
#define GL_ALPHA_TEST_FUNC 0x0BC1
#define GL_ALPHA_TEST_REF 0x0BC2
#define GL_BLEND_DST 0x0BE0
#define GL_BLEND_SRC 0x0BE1
#define GL_LOGIC_OP_MODE 0x0BF0
#define GL_SCISSOR_BOX 0x0C10
#define GL_SCISSOR_TEST 0x0C11
#define GL_COLOR_CLEAR_VALUE 0x0C22
#define GL_COLOR_WRITEMASK 0x0C23
#define GL_UNPACK_ALIGNMENT 0x0CF5
#define GL_PACK_ALIGNMENT 0x0D05
#define GL_MAX_LIGHTS 0x0D31
#define GL_MAX_CLIP_PLANES 0x0D32
#define GL_MAX_TEXTURE_SIZE 0x0D33
#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
#define GL_MAX_VIEWPORT_DIMS 0x0D3A
#define GL_MAX_TEXTURE_UNITS 0x84E2
#define GL_SUBPIXEL_BITS 0x0D50
#define GL_RED_BITS 0x0D52
#define GL_GREEN_BITS 0x0D53
#define GL_BLUE_BITS 0x0D54
#define GL_ALPHA_BITS 0x0D55
#define GL_DEPTH_BITS 0x0D56
#define GL_STENCIL_BITS 0x0D57
#define GL_POLYGON_OFFSET_UNITS 0x2A00
#define GL_POLYGON_OFFSET_FILL 0x8037
#define GL_POLYGON_OFFSET_FACTOR 0x8038
#define GL_TEXTURE_BINDING_2D 0x8069
#define GL_VERTEX_ARRAY_SIZE 0x807A
#define GL_VERTEX_ARRAY_TYPE 0x807B
#define GL_VERTEX_ARRAY_STRIDE 0x807C
#define GL_NORMAL_ARRAY_TYPE 0x807E
#define GL_NORMAL_ARRAY_STRIDE 0x807F
#define GL_COLOR_ARRAY_SIZE 0x8081
#define GL_COLOR_ARRAY_TYPE 0x8082
#define GL_COLOR_ARRAY_STRIDE 0x8083
#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
#define GL_VERTEX_ARRAY_POINTER 0x808E
#define GL_NORMAL_ARRAY_POINTER 0x808F
#define GL_COLOR_ARRAY_POINTER 0x8090
#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
#define GL_SAMPLE_BUFFERS 0x80A8
#define GL_SAMPLES 0x80A9
#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
/* GetTextureParameter */
/* GL_TEXTURE_MAG_FILTER */
/* GL_TEXTURE_MIN_FILTER */
/* GL_TEXTURE_WRAP_S */
/* GL_TEXTURE_WRAP_T */
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
/* HintMode */
#define GL_DONT_CARE 0x1100
#define GL_FASTEST 0x1101
#define GL_NICEST 0x1102
/* HintTarget */
#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
#define GL_POINT_SMOOTH_HINT 0x0C51
#define GL_LINE_SMOOTH_HINT 0x0C52
#define GL_FOG_HINT 0x0C54
#define GL_GENERATE_MIPMAP_HINT 0x8192
/* LightModelParameter */
#define GL_LIGHT_MODEL_AMBIENT 0x0B53
#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
/* LightParameter */
#define GL_AMBIENT 0x1200
#define GL_DIFFUSE 0x1201
#define GL_SPECULAR 0x1202
#define GL_POSITION 0x1203
#define GL_SPOT_DIRECTION 0x1204
#define GL_SPOT_EXPONENT 0x1205
#define GL_SPOT_CUTOFF 0x1206
#define GL_CONSTANT_ATTENUATION 0x1207
#define GL_LINEAR_ATTENUATION 0x1208
#define GL_QUADRATIC_ATTENUATION 0x1209
/* DataType */
#define GL_BYTE 0x1400
#define GL_UNSIGNED_BYTE 0x1401
#define GL_SHORT 0x1402
#define GL_UNSIGNED_SHORT 0x1403
#define GL_FLOAT 0x1406
#define GL_FIXED 0x140C
/* LogicOp */
#define GL_CLEAR 0x1500
#define GL_AND 0x1501
#define GL_AND_REVERSE 0x1502
#define GL_COPY 0x1503
#define GL_AND_INVERTED 0x1504
#define GL_NOOP 0x1505
#define GL_XOR 0x1506
#define GL_OR 0x1507
#define GL_NOR 0x1508
#define GL_EQUIV 0x1509
#define GL_INVERT 0x150A
#define GL_OR_REVERSE 0x150B
#define GL_COPY_INVERTED 0x150C
#define GL_OR_INVERTED 0x150D
#define GL_NAND 0x150E
#define GL_SET 0x150F
/* MaterialFace */
/* GL_FRONT_AND_BACK */
/* MaterialParameter */
#define GL_EMISSION 0x1600
#define GL_SHININESS 0x1601
#define GL_AMBIENT_AND_DIFFUSE 0x1602
/* GL_AMBIENT */
/* GL_DIFFUSE */
/* GL_SPECULAR */
/* MatrixMode */
#define GL_MODELVIEW 0x1700
#define GL_PROJECTION 0x1701
#define GL_TEXTURE 0x1702
/* NormalPointerType */
/* GL_BYTE */
/* GL_SHORT */
/* GL_FLOAT */
/* GL_FIXED */
/* PixelFormat */
#define GL_ALPHA 0x1906
#define GL_RGB 0x1907
#define GL_RGBA 0x1908
#define GL_LUMINANCE 0x1909
#define GL_LUMINANCE_ALPHA 0x190A
/* PixelStoreParameter */
#define GL_UNPACK_ALIGNMENT 0x0CF5
#define GL_PACK_ALIGNMENT 0x0D05
/* PixelType */
/* GL_UNSIGNED_BYTE */
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
/* ShadingModel */
#define GL_FLAT 0x1D00
#define GL_SMOOTH 0x1D01
/* StencilFunction */
/* GL_NEVER */
/* GL_LESS */
/* GL_EQUAL */
/* GL_LEQUAL */
/* GL_GREATER */
/* GL_NOTEQUAL */
/* GL_GEQUAL */
/* GL_ALWAYS */
/* StencilOp */
/* GL_ZERO */
#define GL_KEEP 0x1E00
#define GL_REPLACE 0x1E01
#define GL_INCR 0x1E02
#define GL_DECR 0x1E03
/* GL_INVERT */
/* StringName */
#define GL_VENDOR 0x1F00
#define GL_RENDERER 0x1F01
#define GL_VERSION 0x1F02
#define GL_EXTENSIONS 0x1F03
/* TexCoordPointerType */
/* GL_SHORT */
/* GL_FLOAT */
/* GL_FIXED */
/* GL_BYTE */
/* TextureEnvMode */
#define GL_MODULATE 0x2100
#define GL_DECAL 0x2101
/* GL_BLEND */
#define GL_ADD 0x0104
/* GL_REPLACE */
/* TextureEnvParameter */
#define GL_TEXTURE_ENV_MODE 0x2200
#define GL_TEXTURE_ENV_COLOR 0x2201
/* TextureEnvTarget */
#define GL_TEXTURE_ENV 0x2300
/* TextureMagFilter */
#define GL_NEAREST 0x2600
#define GL_LINEAR 0x2601
/* TextureMinFilter */
/* GL_NEAREST */
/* GL_LINEAR */
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
/* TextureParameterName */
#define GL_TEXTURE_MAG_FILTER 0x2800
#define GL_TEXTURE_MIN_FILTER 0x2801
#define GL_TEXTURE_WRAP_S 0x2802
#define GL_TEXTURE_WRAP_T 0x2803
#define GL_GENERATE_MIPMAP 0x8191
/* TextureTarget */
/* GL_TEXTURE_2D */
/* TextureUnit */
#define GL_TEXTURE0 0x84C0
#define GL_TEXTURE1 0x84C1
#define GL_TEXTURE2 0x84C2
#define GL_TEXTURE3 0x84C3
#define GL_TEXTURE4 0x84C4
#define GL_TEXTURE5 0x84C5
#define GL_TEXTURE6 0x84C6
#define GL_TEXTURE7 0x84C7
#define GL_TEXTURE8 0x84C8
#define GL_TEXTURE9 0x84C9
#define GL_TEXTURE10 0x84CA
#define GL_TEXTURE11 0x84CB
#define GL_TEXTURE12 0x84CC
#define GL_TEXTURE13 0x84CD
#define GL_TEXTURE14 0x84CE
#define GL_TEXTURE15 0x84CF
#define GL_TEXTURE16 0x84D0
#define GL_TEXTURE17 0x84D1
#define GL_TEXTURE18 0x84D2
#define GL_TEXTURE19 0x84D3
#define GL_TEXTURE20 0x84D4
#define GL_TEXTURE21 0x84D5
#define GL_TEXTURE22 0x84D6
#define GL_TEXTURE23 0x84D7
#define GL_TEXTURE24 0x84D8
#define GL_TEXTURE25 0x84D9
#define GL_TEXTURE26 0x84DA
#define GL_TEXTURE27 0x84DB
#define GL_TEXTURE28 0x84DC
#define GL_TEXTURE29 0x84DD
#define GL_TEXTURE30 0x84DE
#define GL_TEXTURE31 0x84DF
#define GL_ACTIVE_TEXTURE 0x84E0
#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
/* TextureWrapMode */
#define GL_REPEAT 0x2901
#define GL_CLAMP_TO_EDGE 0x812F
/* VertexPointerType */
/* GL_SHORT */
/* GL_FLOAT */
/* GL_FIXED */
/* GL_BYTE */
/* LightName */
#define GL_LIGHT0 0x4000
#define GL_LIGHT1 0x4001
#define GL_LIGHT2 0x4002
#define GL_LIGHT3 0x4003
#define GL_LIGHT4 0x4004
#define GL_LIGHT5 0x4005
#define GL_LIGHT6 0x4006
#define GL_LIGHT7 0x4007
/* Buffer Objects */
#define GL_ARRAY_BUFFER 0x8892
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
#define GL_ARRAY_BUFFER_BINDING 0x8894
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
#define GL_STATIC_DRAW 0x88E4
#define GL_DYNAMIC_DRAW 0x88E8
#define GL_BUFFER_SIZE 0x8764
#define GL_BUFFER_USAGE 0x8765
/* Texture combine + dot3 */
#define GL_SUBTRACT 0x84E7
#define GL_COMBINE 0x8570
#define GL_COMBINE_RGB 0x8571
#define GL_COMBINE_ALPHA 0x8572
#define GL_RGB_SCALE 0x8573
#define GL_ADD_SIGNED 0x8574
#define GL_INTERPOLATE 0x8575
#define GL_CONSTANT 0x8576
#define GL_PRIMARY_COLOR 0x8577
#define GL_PREVIOUS 0x8578
#define GL_OPERAND0_RGB 0x8590
#define GL_OPERAND1_RGB 0x8591
#define GL_OPERAND2_RGB 0x8592
#define GL_OPERAND0_ALPHA 0x8598
#define GL_OPERAND1_ALPHA 0x8599
#define GL_OPERAND2_ALPHA 0x859A
#define GL_ALPHA_SCALE 0x0D1C
#define GL_SRC0_RGB 0x8580
#define GL_SRC1_RGB 0x8581
#define GL_SRC2_RGB 0x8582
#define GL_SRC0_ALPHA 0x8588
#define GL_SRC1_ALPHA 0x8589
#define GL_SRC2_ALPHA 0x858A
#define GL_DOT3_RGB 0x86AE
#define GL_DOT3_RGBA 0x86AF
/*------------------------------------------------------------------------*
* required OES extension tokens
*------------------------------------------------------------------------*/
/* OES_read_format */
#ifndef GL_OES_read_format
#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
#endif
/* GL_OES_compressed_paletted_texture */
#ifndef GL_OES_compressed_paletted_texture
#define GL_PALETTE4_RGB8_OES 0x8B90
#define GL_PALETTE4_RGBA8_OES 0x8B91
#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
#define GL_PALETTE4_RGBA4_OES 0x8B93
#define GL_PALETTE4_RGB5_A1_OES 0x8B94
#define GL_PALETTE8_RGB8_OES 0x8B95
#define GL_PALETTE8_RGBA8_OES 0x8B96
#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
#define GL_PALETTE8_RGBA4_OES 0x8B98
#define GL_PALETTE8_RGB5_A1_OES 0x8B99
#endif
/* OES_point_size_array */
#ifndef GL_OES_point_size_array
#define GL_POINT_SIZE_ARRAY_OES 0x8B9C
#define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A
#define GL_POINT_SIZE_ARRAY_STRIDE_OES 0x898B
#define GL_POINT_SIZE_ARRAY_POINTER_OES 0x898C
#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES 0x8B9F
#endif
/* GL_OES_point_sprite */
#ifndef GL_OES_point_sprite
#define GL_POINT_SPRITE_OES 0x8861
#define GL_COORD_REPLACE_OES 0x8862
#endif
/*************************************************************/
/* Available only in Common profile */
GL_API void GL_APIENTRY glAlphaFunc (GLenum func, GLclampf ref);
GL_API void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
GL_API void GL_APIENTRY glClearDepthf (GLclampf depth);
GL_API void GL_APIENTRY glClipPlanef (GLenum plane, const GLfloat *equation);
GL_API void GL_APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
GL_API void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
GL_API void GL_APIENTRY glFogf (GLenum pname, GLfloat param);
GL_API void GL_APIENTRY glFogfv (GLenum pname, const GLfloat *params);
GL_API void GL_APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat eqn[4]);
GL_API void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *params);
GL_API void GL_APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
GL_API void GL_APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);
GL_API void GL_APIENTRY glGetTexEnvfv (GLenum env, GLenum pname, GLfloat *params);
GL_API void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
GL_API void GL_APIENTRY glLightModelf (GLenum pname, GLfloat param);
GL_API void GL_APIENTRY glLightModelfv (GLenum pname, const GLfloat *params);
GL_API void GL_APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param);
GL_API void GL_APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params);
GL_API void GL_APIENTRY glLineWidth (GLfloat width);
GL_API void GL_APIENTRY glLoadMatrixf (const GLfloat *m);
GL_API void GL_APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param);
GL_API void GL_APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
GL_API void GL_APIENTRY glMultMatrixf (const GLfloat *m);
GL_API void GL_APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
GL_API void GL_APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
GL_API void GL_APIENTRY glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
GL_API void GL_APIENTRY glPointParameterf (GLenum pname, GLfloat param);
GL_API void GL_APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);
GL_API void GL_APIENTRY glPointSize (GLfloat size);
GL_API void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
GL_API void GL_APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
GL_API void GL_APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z);
GL_API void GL_APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param);
GL_API void GL_APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
GL_API void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
GL_API void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
GL_API void GL_APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z);
/* Available in both Common and Common-Lite profiles */
GL_API void GL_APIENTRY glActiveTexture (GLenum texture);
GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLclampx ref);
GL_API void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
GL_API void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
GL_API void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
GL_API void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
GL_API void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
GL_API void GL_APIENTRY glClear (GLbitfield mask);
GL_API void GL_APIENTRY glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
GL_API void GL_APIENTRY glClearDepthx (GLclampx depth);
GL_API void GL_APIENTRY glClearStencil (GLint s);
GL_API void GL_APIENTRY glClientActiveTexture (GLenum texture);
GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation);
GL_API void GL_APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
GL_API void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
GL_API void GL_APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
GL_API void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
GL_API void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
GL_API void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
GL_API void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
GL_API void GL_APIENTRY glCullFace (GLenum mode);
GL_API void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
GL_API void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
GL_API void GL_APIENTRY glDepthFunc (GLenum func);
GL_API void GL_APIENTRY glDepthMask (GLboolean flag);
GL_API void GL_APIENTRY glDepthRangex (GLclampx zNear, GLclampx zFar);
GL_API void GL_APIENTRY glDisable (GLenum cap);
GL_API void GL_APIENTRY glDisableClientState (GLenum array);
GL_API void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
GL_API void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
GL_API void GL_APIENTRY glEnable (GLenum cap);
GL_API void GL_APIENTRY glEnableClientState (GLenum array);
GL_API void GL_APIENTRY glFinish (void);
GL_API void GL_APIENTRY glFlush (void);
GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param);
GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *params);
GL_API void GL_APIENTRY glFrontFace (GLenum mode);
GL_API void GL_APIENTRY glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
GL_API void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *params);
GL_API void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed eqn[4]);
GL_API void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
GL_API void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
GL_API GLenum GL_APIENTRY glGetError (void);
GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params);
GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params);
GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params);
GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params);
GL_API void GL_APIENTRY glGetPointerv (GLenum pname, GLvoid **params);
GL_API const GLubyte * GL_APIENTRY glGetString (GLenum name);
GL_API void GL_APIENTRY glGetTexEnviv (GLenum env, GLenum pname, GLint *params);
GL_API void GL_APIENTRY glGetTexEnvxv (GLenum env, GLenum pname, GLfixed *params);
GL_API void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params);
GL_API void GL_APIENTRY glHint (GLenum target, GLenum mode);
GL_API GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
GL_API GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
GL_API GLboolean GL_APIENTRY glIsTexture (GLuint texture);
GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param);
GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *params);
GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param);
GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params);
GL_API void GL_APIENTRY glLineWidthx (GLfixed width);
GL_API void GL_APIENTRY glLoadIdentity (void);
GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m);
GL_API void GL_APIENTRY glLogicOp (GLenum opcode);
GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param);
GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *params);
GL_API void GL_APIENTRY glMatrixMode (GLenum mode);
GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m);
GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz);
GL_API void GL_APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
GL_API void GL_APIENTRY glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
GL_API void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param);
GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params);
GL_API void GL_APIENTRY glPointSizex (GLfixed size);
GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units);
GL_API void GL_APIENTRY glPopMatrix (void);
GL_API void GL_APIENTRY glPushMatrix (void);
GL_API void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
GL_API void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert);
GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z);
GL_API void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
GL_API void GL_APIENTRY glShadeModel (GLenum mode);
GL_API void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
GL_API void GL_APIENTRY glStencilMask (GLuint mask);
GL_API void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
GL_API void GL_APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
GL_API void GL_APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param);
GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param);
GL_API void GL_APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params);
GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params);
GL_API void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
GL_API void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param);
GL_API void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params);
GL_API void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z);
GL_API void GL_APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
GL_API void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
/*------------------------------------------------------------------------*
* Required OES extension functions
*------------------------------------------------------------------------*/
/* GL_OES_read_format */
#ifndef GL_OES_read_format
#define GL_OES_read_format 1
#endif
/* GL_OES_compressed_paletted_texture */
#ifndef GL_OES_compressed_paletted_texture
#define GL_OES_compressed_paletted_texture 1
#endif
/* GL_OES_point_size_array */
#ifndef GL_OES_point_size_array
#define GL_OES_point_size_array 1
GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer);
#endif
/* GL_OES_point_sprite */
#ifndef GL_OES_point_sprite
#define GL_OES_point_sprite 1
#endif
#ifdef __cplusplus
}
#endif
#endif /* __gl_h_ */

View file

@ -0,0 +1,620 @@
#ifndef __gl2_h_
#define __gl2_h_
/* $Revision: 16803 $ on $Date:: 2012-02-02 09:49:18 -0800 #$ */
#include <GLES2/gl2platform.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
/*-------------------------------------------------------------------------
* Data type definitions
*-----------------------------------------------------------------------*/
typedef void GLvoid;
typedef char GLchar;
typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;
typedef khronos_int8_t GLbyte;
typedef short GLshort;
typedef int GLint;
typedef int GLsizei;
typedef khronos_uint8_t GLubyte;
typedef unsigned short GLushort;
typedef unsigned int GLuint;
typedef khronos_float_t GLfloat;
typedef khronos_float_t GLclampf;
typedef khronos_int32_t GLfixed;
/* GL types for handling large vertex buffer objects */
typedef khronos_intptr_t GLintptr;
typedef khronos_ssize_t GLsizeiptr;
/* OpenGL ES core versions */
#define GL_ES_VERSION_2_0 1
/* ClearBufferMask */
#define GL_DEPTH_BUFFER_BIT 0x00000100
#define GL_STENCIL_BUFFER_BIT 0x00000400
#define GL_COLOR_BUFFER_BIT 0x00004000
/* Boolean */
#define GL_FALSE 0
#define GL_TRUE 1
/* BeginMode */
#define GL_POINTS 0x0000
#define GL_LINES 0x0001
#define GL_LINE_LOOP 0x0002
#define GL_LINE_STRIP 0x0003
#define GL_TRIANGLES 0x0004
#define GL_TRIANGLE_STRIP 0x0005
#define GL_TRIANGLE_FAN 0x0006
/* AlphaFunction (not supported in ES20) */
/* GL_NEVER */
/* GL_LESS */
/* GL_EQUAL */
/* GL_LEQUAL */
/* GL_GREATER */
/* GL_NOTEQUAL */
/* GL_GEQUAL */
/* GL_ALWAYS */
/* BlendingFactorDest */
#define GL_ZERO 0
#define GL_ONE 1
#define GL_SRC_COLOR 0x0300
#define GL_ONE_MINUS_SRC_COLOR 0x0301
#define GL_SRC_ALPHA 0x0302
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
#define GL_DST_ALPHA 0x0304
#define GL_ONE_MINUS_DST_ALPHA 0x0305
/* BlendingFactorSrc */
/* GL_ZERO */
/* GL_ONE */
#define GL_DST_COLOR 0x0306
#define GL_ONE_MINUS_DST_COLOR 0x0307
#define GL_SRC_ALPHA_SATURATE 0x0308
/* GL_SRC_ALPHA */
/* GL_ONE_MINUS_SRC_ALPHA */
/* GL_DST_ALPHA */
/* GL_ONE_MINUS_DST_ALPHA */
/* BlendEquationSeparate */
#define GL_FUNC_ADD 0x8006
#define GL_BLEND_EQUATION 0x8009
#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */
#define GL_BLEND_EQUATION_ALPHA 0x883D
/* BlendSubtract */
#define GL_FUNC_SUBTRACT 0x800A
#define GL_FUNC_REVERSE_SUBTRACT 0x800B
/* Separate Blend Functions */
#define GL_BLEND_DST_RGB 0x80C8
#define GL_BLEND_SRC_RGB 0x80C9
#define GL_BLEND_DST_ALPHA 0x80CA
#define GL_BLEND_SRC_ALPHA 0x80CB
#define GL_CONSTANT_COLOR 0x8001
#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
#define GL_CONSTANT_ALPHA 0x8003
#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
#define GL_BLEND_COLOR 0x8005
/* Buffer Objects */
#define GL_ARRAY_BUFFER 0x8892
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
#define GL_ARRAY_BUFFER_BINDING 0x8894
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
#define GL_STREAM_DRAW 0x88E0
#define GL_STATIC_DRAW 0x88E4
#define GL_DYNAMIC_DRAW 0x88E8
#define GL_BUFFER_SIZE 0x8764
#define GL_BUFFER_USAGE 0x8765
#define GL_CURRENT_VERTEX_ATTRIB 0x8626
/* CullFaceMode */
#define GL_FRONT 0x0404
#define GL_BACK 0x0405
#define GL_FRONT_AND_BACK 0x0408
/* DepthFunction */
/* GL_NEVER */
/* GL_LESS */
/* GL_EQUAL */
/* GL_LEQUAL */
/* GL_GREATER */
/* GL_NOTEQUAL */
/* GL_GEQUAL */
/* GL_ALWAYS */
/* EnableCap */
#define GL_TEXTURE_2D 0x0DE1
#define GL_CULL_FACE 0x0B44
#define GL_BLEND 0x0BE2
#define GL_DITHER 0x0BD0
#define GL_STENCIL_TEST 0x0B90
#define GL_DEPTH_TEST 0x0B71
#define GL_SCISSOR_TEST 0x0C11
#define GL_POLYGON_OFFSET_FILL 0x8037
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
#define GL_SAMPLE_COVERAGE 0x80A0
/* ErrorCode */
#define GL_NO_ERROR 0
#define GL_INVALID_ENUM 0x0500
#define GL_INVALID_VALUE 0x0501
#define GL_INVALID_OPERATION 0x0502
#define GL_OUT_OF_MEMORY 0x0505
/* FrontFaceDirection */
#define GL_CW 0x0900
#define GL_CCW 0x0901
/* GetPName */
#define GL_LINE_WIDTH 0x0B21
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
#define GL_CULL_FACE_MODE 0x0B45
#define GL_FRONT_FACE 0x0B46
#define GL_DEPTH_RANGE 0x0B70
#define GL_DEPTH_WRITEMASK 0x0B72
#define GL_DEPTH_CLEAR_VALUE 0x0B73
#define GL_DEPTH_FUNC 0x0B74
#define GL_STENCIL_CLEAR_VALUE 0x0B91
#define GL_STENCIL_FUNC 0x0B92
#define GL_STENCIL_FAIL 0x0B94
#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
#define GL_STENCIL_REF 0x0B97
#define GL_STENCIL_VALUE_MASK 0x0B93
#define GL_STENCIL_WRITEMASK 0x0B98
#define GL_STENCIL_BACK_FUNC 0x8800
#define GL_STENCIL_BACK_FAIL 0x8801
#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
#define GL_STENCIL_BACK_REF 0x8CA3
#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
#define GL_VIEWPORT 0x0BA2
#define GL_SCISSOR_BOX 0x0C10
/* GL_SCISSOR_TEST */
#define GL_COLOR_CLEAR_VALUE 0x0C22
#define GL_COLOR_WRITEMASK 0x0C23
#define GL_UNPACK_ALIGNMENT 0x0CF5
#define GL_PACK_ALIGNMENT 0x0D05
#define GL_MAX_TEXTURE_SIZE 0x0D33
#define GL_MAX_VIEWPORT_DIMS 0x0D3A
#define GL_SUBPIXEL_BITS 0x0D50
#define GL_RED_BITS 0x0D52
#define GL_GREEN_BITS 0x0D53
#define GL_BLUE_BITS 0x0D54
#define GL_ALPHA_BITS 0x0D55
#define GL_DEPTH_BITS 0x0D56
#define GL_STENCIL_BITS 0x0D57
#define GL_POLYGON_OFFSET_UNITS 0x2A00
/* GL_POLYGON_OFFSET_FILL */
#define GL_POLYGON_OFFSET_FACTOR 0x8038
#define GL_TEXTURE_BINDING_2D 0x8069
#define GL_SAMPLE_BUFFERS 0x80A8
#define GL_SAMPLES 0x80A9
#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
/* GetTextureParameter */
/* GL_TEXTURE_MAG_FILTER */
/* GL_TEXTURE_MIN_FILTER */
/* GL_TEXTURE_WRAP_S */
/* GL_TEXTURE_WRAP_T */
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
/* HintMode */
#define GL_DONT_CARE 0x1100
#define GL_FASTEST 0x1101
#define GL_NICEST 0x1102
/* HintTarget */
#define GL_GENERATE_MIPMAP_HINT 0x8192
/* DataType */
#define GL_BYTE 0x1400
#define GL_UNSIGNED_BYTE 0x1401
#define GL_SHORT 0x1402
#define GL_UNSIGNED_SHORT 0x1403
#define GL_INT 0x1404
#define GL_UNSIGNED_INT 0x1405
#define GL_FLOAT 0x1406
#define GL_FIXED 0x140C
/* PixelFormat */
#define GL_DEPTH_COMPONENT 0x1902
#define GL_ALPHA 0x1906
#define GL_RGB 0x1907
#define GL_RGBA 0x1908
#define GL_LUMINANCE 0x1909
#define GL_LUMINANCE_ALPHA 0x190A
/* PixelType */
/* GL_UNSIGNED_BYTE */
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
/* Shaders */
#define GL_FRAGMENT_SHADER 0x8B30
#define GL_VERTEX_SHADER 0x8B31
#define GL_MAX_VERTEX_ATTRIBS 0x8869
#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
#define GL_MAX_VARYING_VECTORS 0x8DFC
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
#define GL_SHADER_TYPE 0x8B4F
#define GL_DELETE_STATUS 0x8B80
#define GL_LINK_STATUS 0x8B82
#define GL_VALIDATE_STATUS 0x8B83
#define GL_ATTACHED_SHADERS 0x8B85
#define GL_ACTIVE_UNIFORMS 0x8B86
#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
#define GL_ACTIVE_ATTRIBUTES 0x8B89
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
#define GL_CURRENT_PROGRAM 0x8B8D
/* StencilFunction */
#define GL_NEVER 0x0200
#define GL_LESS 0x0201
#define GL_EQUAL 0x0202
#define GL_LEQUAL 0x0203
#define GL_GREATER 0x0204
#define GL_NOTEQUAL 0x0205
#define GL_GEQUAL 0x0206
#define GL_ALWAYS 0x0207
/* StencilOp */
/* GL_ZERO */
#define GL_KEEP 0x1E00
#define GL_REPLACE 0x1E01
#define GL_INCR 0x1E02
#define GL_DECR 0x1E03
#define GL_INVERT 0x150A
#define GL_INCR_WRAP 0x8507
#define GL_DECR_WRAP 0x8508
/* StringName */
#define GL_VENDOR 0x1F00
#define GL_RENDERER 0x1F01
#define GL_VERSION 0x1F02
#define GL_EXTENSIONS 0x1F03
/* TextureMagFilter */
#define GL_NEAREST 0x2600
#define GL_LINEAR 0x2601
/* TextureMinFilter */
/* GL_NEAREST */
/* GL_LINEAR */
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
/* TextureParameterName */
#define GL_TEXTURE_MAG_FILTER 0x2800
#define GL_TEXTURE_MIN_FILTER 0x2801
#define GL_TEXTURE_WRAP_S 0x2802
#define GL_TEXTURE_WRAP_T 0x2803
/* TextureTarget */
/* GL_TEXTURE_2D */
#define GL_TEXTURE 0x1702
#define GL_TEXTURE_CUBE_MAP 0x8513
#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
/* TextureUnit */
#define GL_TEXTURE0 0x84C0
#define GL_TEXTURE1 0x84C1
#define GL_TEXTURE2 0x84C2
#define GL_TEXTURE3 0x84C3
#define GL_TEXTURE4 0x84C4
#define GL_TEXTURE5 0x84C5
#define GL_TEXTURE6 0x84C6
#define GL_TEXTURE7 0x84C7
#define GL_TEXTURE8 0x84C8
#define GL_TEXTURE9 0x84C9
#define GL_TEXTURE10 0x84CA
#define GL_TEXTURE11 0x84CB
#define GL_TEXTURE12 0x84CC
#define GL_TEXTURE13 0x84CD
#define GL_TEXTURE14 0x84CE
#define GL_TEXTURE15 0x84CF
#define GL_TEXTURE16 0x84D0
#define GL_TEXTURE17 0x84D1
#define GL_TEXTURE18 0x84D2
#define GL_TEXTURE19 0x84D3
#define GL_TEXTURE20 0x84D4
#define GL_TEXTURE21 0x84D5
#define GL_TEXTURE22 0x84D6
#define GL_TEXTURE23 0x84D7
#define GL_TEXTURE24 0x84D8
#define GL_TEXTURE25 0x84D9
#define GL_TEXTURE26 0x84DA
#define GL_TEXTURE27 0x84DB
#define GL_TEXTURE28 0x84DC
#define GL_TEXTURE29 0x84DD
#define GL_TEXTURE30 0x84DE
#define GL_TEXTURE31 0x84DF
#define GL_ACTIVE_TEXTURE 0x84E0
/* TextureWrapMode */
#define GL_REPEAT 0x2901
#define GL_CLAMP_TO_EDGE 0x812F
#define GL_MIRRORED_REPEAT 0x8370
/* Uniform Types */
#define GL_FLOAT_VEC2 0x8B50
#define GL_FLOAT_VEC3 0x8B51
#define GL_FLOAT_VEC4 0x8B52
#define GL_INT_VEC2 0x8B53
#define GL_INT_VEC3 0x8B54
#define GL_INT_VEC4 0x8B55
#define GL_BOOL 0x8B56
#define GL_BOOL_VEC2 0x8B57
#define GL_BOOL_VEC3 0x8B58
#define GL_BOOL_VEC4 0x8B59
#define GL_FLOAT_MAT2 0x8B5A
#define GL_FLOAT_MAT3 0x8B5B
#define GL_FLOAT_MAT4 0x8B5C
#define GL_SAMPLER_2D 0x8B5E
#define GL_SAMPLER_CUBE 0x8B60
/* Vertex Arrays */
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
/* Read Format */
#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
/* Shader Source */
#define GL_COMPILE_STATUS 0x8B81
#define GL_INFO_LOG_LENGTH 0x8B84
#define GL_SHADER_SOURCE_LENGTH 0x8B88
#define GL_SHADER_COMPILER 0x8DFA
/* Shader Binary */
#define GL_SHADER_BINARY_FORMATS 0x8DF8
#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
/* Shader Precision-Specified Types */
#define GL_LOW_FLOAT 0x8DF0
#define GL_MEDIUM_FLOAT 0x8DF1
#define GL_HIGH_FLOAT 0x8DF2
#define GL_LOW_INT 0x8DF3
#define GL_MEDIUM_INT 0x8DF4
#define GL_HIGH_INT 0x8DF5
/* Framebuffer Object. */
#define GL_FRAMEBUFFER 0x8D40
#define GL_RENDERBUFFER 0x8D41
#define GL_RGBA4 0x8056
#define GL_RGB5_A1 0x8057
#define GL_RGB565 0x8D62
#define GL_DEPTH_COMPONENT16 0x81A5
#define GL_STENCIL_INDEX8 0x8D48
#define GL_RENDERBUFFER_WIDTH 0x8D42
#define GL_RENDERBUFFER_HEIGHT 0x8D43
#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
#define GL_RENDERBUFFER_RED_SIZE 0x8D50
#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
#define GL_COLOR_ATTACHMENT0 0x8CE0
#define GL_DEPTH_ATTACHMENT 0x8D00
#define GL_STENCIL_ATTACHMENT 0x8D20
#define GL_NONE 0
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
#define GL_FRAMEBUFFER_BINDING 0x8CA6
#define GL_RENDERBUFFER_BINDING 0x8CA7
#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
/*-------------------------------------------------------------------------
* GL core functions.
*-----------------------------------------------------------------------*/
GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name);
GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode );
GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth);
GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers);
GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers);
GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers);
GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures);
GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
GL_APICALL void GL_APIENTRY glFinish (void);
GL_APICALL void GL_APIENTRY glFlush (void);
GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers);
GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers);
GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures);
GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name);
GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params);
GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL GLenum GL_APIENTRY glGetError (void);
GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name);
GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params);
GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name);
GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer);
GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length);
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params);
GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params);
GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x);
GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x);
GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v);
GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y);
GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y);
GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v);
GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z);
GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v);
GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v);
GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x);
GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
#ifdef __cplusplus
}
#endif
#endif /* __gl2_h_ */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,30 @@
#ifndef __gl2platform_h_
#define __gl2platform_h_
/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
/*
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that
* they can be included in future versions of this file. Please submit changes
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
* by filing a bug against product "OpenGL-ES" component "Registry".
*/
#include <KHR/khrplatform.h>
#ifndef GL_APICALL
#define GL_APICALL KHRONOS_APICALL
#endif
#ifndef GL_APIENTRY
#define GL_APIENTRY KHRONOS_APIENTRY
#endif
#endif /* __gl2platform_h_ */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,24 @@
#ifndef __gl3ext_h_
#define __gl3ext_h_
/* $Revision: 17809 $ on $Date:: 2012-05-14 08:03:36 -0700 #$ */
/*
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
/* OpenGL ES 3 Extensions
*
* After an OES extension's interactions with OpenGl ES 3.0 have been documented,
* its tokens and function definitions should be added to this file in a manner
* that does not conflict with gl2ext.h or gl3.h.
*
* Tokens and function definitions for extensions that have become standard
* features in OpenGL ES 3.0 will not be added to this file.
*
* Applications using OpenGL-ES-2-only extensions should include gl2ext.h
*/
#endif /* __gl3ext_h_ */

View file

@ -0,0 +1,30 @@
#ifndef __gl3platform_h_
#define __gl3platform_h_
/* $Revision: 18437 $ on $Date:: 2012-07-08 23:31:39 -0700 #$ */
/*
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
/* Platform-specific types and definitions for OpenGL ES 3.X gl3.h
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that
* they can be included in future versions of this file. Please submit changes
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
* by filing a bug against product "OpenGL-ES" component "Registry".
*/
#include <KHR/khrplatform.h>
#ifndef GL_APICALL
#define GL_APICALL KHRONOS_APICALL
#endif
#ifndef GL_APIENTRY
#define GL_APIENTRY KHRONOS_APIENTRY
#endif
#endif /* __gl3platform_h_ */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,30 @@
#ifndef __glplatform_h_
#define __glplatform_h_
/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */
/*
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
/* Platform-specific types and definitions for OpenGL ES 1.X gl.h
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that
* they can be included in future versions of this file. Please submit changes
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
* by filing a bug against product "OpenGL-ES" component "Registry".
*/
#include <KHR/khrplatform.h>
#ifndef GL_API
#define GL_API KHRONOS_APICALL
#endif
#ifndef GL_APIENTRY
#define GL_APIENTRY KHRONOS_APIENTRY
#endif
#endif /* __glplatform_h_ */

View file

@ -0,0 +1,269 @@
#ifndef __khrplatform_h_
#define __khrplatform_h_
/*
** Copyright (c) 2008-2009 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/* Khronos platform-specific types and definitions.
*
* $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
*
* Adopters may modify this file to suit their platform. Adopters are
* encouraged to submit platform specific modifications to the Khronos
* group so that they can be included in future versions of this file.
* Please submit changes by sending them to the public Khronos Bugzilla
* (http://khronos.org/bugzilla) by filing a bug against product
* "Khronos (general)" component "Registry".
*
* A predefined template which fills in some of the bug fields can be
* reached using http://tinyurl.com/khrplatform-h-bugreport, but you
* must create a Bugzilla login first.
*
*
* See the Implementer's Guidelines for information about where this file
* should be located on your system and for more details of its use:
* http://www.khronos.org/registry/implementers_guide.pdf
*
* This file should be included as
* #include <KHR/khrplatform.h>
* by Khronos client API header files that use its types and defines.
*
* The types in khrplatform.h should only be used to define API-specific types.
*
* Types defined in khrplatform.h:
* khronos_int8_t signed 8 bit
* khronos_uint8_t unsigned 8 bit
* khronos_int16_t signed 16 bit
* khronos_uint16_t unsigned 16 bit
* khronos_int32_t signed 32 bit
* khronos_uint32_t unsigned 32 bit
* khronos_int64_t signed 64 bit
* khronos_uint64_t unsigned 64 bit
* khronos_intptr_t signed same number of bits as a pointer
* khronos_uintptr_t unsigned same number of bits as a pointer
* khronos_ssize_t signed size
* khronos_usize_t unsigned size
* khronos_float_t signed 32 bit floating point
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
* nanoseconds
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
* khronos_boolean_enum_t enumerated boolean type. This should
* only be used as a base type when a client API's boolean type is
* an enum. Client APIs which use an integer or other type for
* booleans cannot use this as the base type for their boolean.
*
* Tokens defined in khrplatform.h:
*
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
*
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
*
* Calling convention macros defined in this file:
* KHRONOS_APICALL
* KHRONOS_APIENTRY
* KHRONOS_APIATTRIBUTES
*
* These may be used in function prototypes as:
*
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
* int arg1,
* int arg2) KHRONOS_APIATTRIBUTES;
*/
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APICALL
*-------------------------------------------------------------------------
* This precedes the return type of the function in the function prototype.
*/
#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
# define KHRONOS_APICALL __declspec(dllimport)
#elif defined (__SYMBIAN32__)
# define KHRONOS_APICALL IMPORT_C
#else
# define KHRONOS_APICALL
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIENTRY
*-------------------------------------------------------------------------
* This follows the return type of the function and precedes the function
* name in the function prototype.
*/
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
/* Win32 but not WinCE */
# define KHRONOS_APIENTRY __stdcall
#else
# define KHRONOS_APIENTRY
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIATTRIBUTES
*-------------------------------------------------------------------------
* This follows the closing parenthesis of the function prototype arguments.
*/
#if defined (__ARMCC_2__)
#define KHRONOS_APIATTRIBUTES __softfp
#else
#define KHRONOS_APIATTRIBUTES
#endif
/*-------------------------------------------------------------------------
* basic type definitions
*-----------------------------------------------------------------------*/
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
/*
* Using <stdint.h>
*/
#include <stdint.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif defined(__VMS ) || defined(__sgi)
/*
* Using <inttypes.h>
*/
#include <inttypes.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
/*
* Win32
*/
typedef __int32 khronos_int32_t;
typedef unsigned __int32 khronos_uint32_t;
typedef __int64 khronos_int64_t;
typedef unsigned __int64 khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif defined(__sun__) || defined(__digital__)
/*
* Sun or Digital
*/
typedef int khronos_int32_t;
typedef unsigned int khronos_uint32_t;
#if defined(__arch64__) || defined(_LP64)
typedef long int khronos_int64_t;
typedef unsigned long int khronos_uint64_t;
#else
typedef long long int khronos_int64_t;
typedef unsigned long long int khronos_uint64_t;
#endif /* __arch64__ */
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif 0
/*
* Hypothetical platform with no float or int64 support
*/
typedef int khronos_int32_t;
typedef unsigned int khronos_uint32_t;
#define KHRONOS_SUPPORT_INT64 0
#define KHRONOS_SUPPORT_FLOAT 0
#else
/*
* Generic fallback
*/
#include <stdint.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#endif
/*
* Types that are (so far) the same on all platforms
*/
typedef signed char khronos_int8_t;
typedef unsigned char khronos_uint8_t;
typedef signed short int khronos_int16_t;
typedef unsigned short int khronos_uint16_t;
typedef signed long int khronos_intptr_t;
typedef unsigned long int khronos_uintptr_t;
typedef signed long int khronos_ssize_t;
typedef unsigned long int khronos_usize_t;
#if KHRONOS_SUPPORT_FLOAT
/*
* Float type
*/
typedef float khronos_float_t;
#endif
#if KHRONOS_SUPPORT_INT64
/* Time types
*
* These types can be used to represent a time interval in nanoseconds or
* an absolute Unadjusted System Time. Unadjusted System Time is the number
* of nanoseconds since some arbitrary system event (e.g. since the last
* time the system booted). The Unadjusted System Time is an unsigned
* 64 bit value that wraps back to 0 every 584 years. Time intervals
* may be either signed or unsigned.
*/
typedef khronos_uint64_t khronos_utime_nanoseconds_t;
typedef khronos_int64_t khronos_stime_nanoseconds_t;
#endif
/*
* Dummy value used to pad enum types to 32 bits.
*/
#ifndef KHRONOS_MAX_ENUM
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
#endif
/*
* Enumerated boolean type
*
* Values other than zero should be considered to be true. Therefore
* comparisons should not be made against KHRONOS_TRUE.
*/
typedef enum {
KHRONOS_FALSE = 0,
KHRONOS_TRUE = 1,
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
} khronos_boolean_enum_t;
#endif /* __khrplatform_h_ */

View file

@ -0,0 +1,70 @@
#ifndef __ANDROID_DEBUG_H__
#define __ANDROID_DEBUG_H__
// Redirect printf() to Android log
// Put this file into CFLAGS: "-include ../android_debug.h"
#include <stdio.h>
#include <stdarg.h>
#include <android/log.h>
#ifdef __cplusplus
// Include everything beforehand, so we wont' get compiler errors because of our #define
#include <string>
#include <ios>
#include <streambuf>
#include <sstream>
#include <fstream>
#include <iostream>
namespace std
{
class android_cout: public ostringstream
{
public:
android_cout() {}
template <class T>
android_cout &operator<<(const T &v)
{
*((ostringstream*)this) << v;
if( this->str().find('\n') != ::std::string::npos )
{
__android_log_print(ANDROID_LOG_INFO, "LIBGL", "%s", this->str().c_str());
this->str().clear();
}
return *this;
}
~android_cout()
{
__android_log_print(ANDROID_LOG_INFO, "LIBGL", "%s", this->str().c_str());
this->str().clear();
}
};
static const char * android_endl = "\n";
}
#define cout android_cout()
#define cerr android_cout()
#define endl android_endl
#endif
#define printf(...) __android_log_print(ANDROID_LOG_INFO, "LIBGL", __VA_ARGS__)
/*
// Override fprintf(stderr, ...) constructs
static inline int __sdl_logged_fprintf(FILE *stream, const char *format, ...)
{
int ret = 0;
va_list args;
va_start(args, format);
if( stream == stderr || stream == stdout )
ret = __android_log_vprint(ANDROID_LOG_INFO, "LIBGL", format, args);
else
ret = vfprintf(stream, format, args);
va_end(args);
return ret;
}
#define fprintf(...) __sdl_logged_fprintf(__VA_ARGS__)
*/
#endif

View file

@ -0,0 +1,36 @@
#ifndef _GL4ESINCLUDE_HINT_H_
#define _GL4ESINCLUDE_HINT_H_
// Custom hints to handles some specifics gl4es options
// same as using LIBGL_SHRINK=x
#define GL_SHRINK_HINT_GL4ES 0xA101
// same as using LIBGL_ALPHAHACK=x
#define GL_ALPHAHACK_HINT_GL4ES 0xA102
// same as using LIBGL_RECYCLEFBO=x
#define GL_RECYCLEFBO_HINT_GL4ES 0xA103
// same as using LIBGL_MIPMAP=x
#define GL_MIPMAP_HINT_GL4ES 0xA104
// same as using LIBGL_TEXDUMP=x
#define GL_TEXDUMP_HINT_GL4ES 0xA105
// same as using LIBGL_COPY=x
#define GL_COPY_HINT_GL4ES 0xA106
// same as using LIBGL_NOLUMALPHA=x
#define GL_NOLUMAPHA_HINT_GL4ES 0xA107
// same as using LIBGL_BLENDHACK=x
#define GL_BLENDHACK_HINT_GL4ES 0xA108
// REMOVED same as using LIBGL_BATCH=x
#define GL_BATCH_HINT_GL4ES 0xA109
// same as using LIBGL_NOERROR=x
#define GL_NOERROR_HINT_GL4ES 0xA10A
// same as using LIBGL_NODOWNSAMPLING=x
#define GL_NODOWNSAMPLING_HINT_GL4ES 0xA10B
// same as using LIBGL_NOVAOCACHE=x
#define GL_NOVAOCACHE_HINT_GL4ES 0xA10C
// same as using LIBGL_BEGINEND=x
#define GL_BEGINEND_HINT_GL4ES 0xA10D
// same as using LIBGL_AVOID16BITS=x
#define GL_AVOID16BITS_HINT_GL4ES 0xA10E
// same as using LIBGL_GAMMA=xx (PANDORA only)
#define GL_GAMMA_HINT_GL4ES 0xA10F
#endif // _GL4ESINCLUDE_HINT_H_

View file

@ -0,0 +1,652 @@
/* The MIT License
Copyright (c) 2008, 2009, 2011 by Attractive Chaos <attractor@live.co.uk>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/*
An example:
#include "khash.h"
KHASH_MAP_INIT_INT(32, char)
int main() {
int ret, is_missing;
khiter_t k;
khash_t(32) *h = kh_init(32);
k = kh_put(32, h, 5, &ret);
kh_value(h, k) = 10;
k = kh_get(32, h, 10);
is_missing = (k == kh_end(h));
k = kh_get(32, h, 5);
kh_del(32, h, k);
for (k = kh_begin(h); k != kh_end(h); ++k)
if (kh_exist(h, k)) kh_value(h, k) = 1;
kh_destroy(32, h);
return 0;
}
*/
/*
2013-05-02 (0.2.8):
* Use quadratic probing. When the capacity is power of 2, stepping function
i*(i+1)/2 guarantees to traverse each bucket. It is better than double
hashing on cache performance and is more robust than linear probing.
In theory, double hashing should be more robust than quadratic probing.
However, my implementation is probably not for large hash tables, because
the second hash function is closely tied to the first hash function,
which reduce the effectiveness of double hashing.
Reference: http://research.cs.vt.edu/AVresearch/hashing/quadratic.php
2011-12-29 (0.2.7):
* Minor code clean up; no actual effect.
2011-09-16 (0.2.6):
* The capacity is a power of 2. This seems to dramatically improve the
speed for simple keys. Thank Zilong Tan for the suggestion. Reference:
- http://code.google.com/p/ulib/
- http://nothings.org/computer/judy/
* Allow to optionally use linear probing which usually has better
performance for random input. Double hashing is still the default as it
is more robust to certain non-random input.
* Added Wang's integer hash function (not used by default). This hash
function is more robust to certain non-random input.
2011-02-14 (0.2.5):
* Allow to declare global functions.
2009-09-26 (0.2.4):
* Improve portability
2008-09-19 (0.2.3):
* Corrected the example
* Improved interfaces
2008-09-11 (0.2.2):
* Improved speed a little in kh_put()
2008-09-10 (0.2.1):
* Added kh_clear()
* Fixed a compiling error
2008-09-02 (0.2.0):
* Changed to token concatenation which increases flexibility.
2008-08-31 (0.1.2):
* Fixed a bug in kh_get(), which has not been tested previously.
2008-08-31 (0.1.1):
* Added destructor
*/
#ifndef __AC_KHASH_H
#define __AC_KHASH_H
/*!
@header
Generic hash table library.
*/
#define AC_VERSION_KHASH_H "0.2.8"
#include <stdlib.h>
#include <string.h>
#include <limits.h>
/* compiler specific configuration */
#if UINT_MAX == 0xffffffffu
typedef unsigned int khint32_t;
#elif ULONG_MAX == 0xffffffffu
typedef unsigned long khint32_t;
#endif
#if ULONG_MAX == ULLONG_MAX
typedef unsigned long khint64_t;
#else
typedef unsigned long long khint64_t;
#endif
#ifdef _MSC_VER
#define kh_inline __inline
#else
#define kh_inline inline
#endif
typedef khint32_t khint_t;
typedef khint_t khiter_t;
#define __ac_isempty(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&2)
#define __ac_isdel(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&1)
#define __ac_iseither(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&3)
#define __ac_set_isdel_false(flag, i) (flag[i>>4]&=~(1ul<<((i&0xfU)<<1)))
#define __ac_set_isempty_false(flag, i) (flag[i>>4]&=~(2ul<<((i&0xfU)<<1)))
#define __ac_set_isboth_false(flag, i) (flag[i>>4]&=~(3ul<<((i&0xfU)<<1)))
#define __ac_set_isdel_true(flag, i) (flag[i>>4]|=1ul<<((i&0xfU)<<1))
#define __ac_fsize(m) ((m) < 16? 1 : (m)>>4)
#ifndef kroundup32
#define kroundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x))
#endif
#ifndef kcalloc
#define kcalloc(N,Z) calloc(N,Z)
#endif
#ifndef kmalloc
#define kmalloc(Z) malloc(Z)
#endif
#ifndef krealloc
#define krealloc(P,Z) realloc(P,Z)
#endif
#ifndef kfree
#define kfree(P) free(P)
#endif
static const double __ac_HASH_UPPER = 0.77;
#define __KHASH_TYPE(name, khkey_t, khval_t) \
typedef struct { \
khint_t n_buckets, size, n_occupied, upper_bound; \
khint32_t *flags; \
khkey_t *keys; \
khval_t *vals; \
} kh_##name##_t;
#define __KHASH_PROTOTYPES(name, khkey_t, khval_t) \
extern kh_##name##_t *kh_init_##name(void); \
extern void kh_destroy_##name(kh_##name##_t *h); \
extern void kh_clear_##name(kh_##name##_t *h); \
extern khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key); \
extern int kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets); \
extern khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret); \
extern void kh_del_##name(kh_##name##_t *h, khint_t x);
#define __KHASH_IMPL(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \
SCOPE kh_##name##_t *kh_init_##name(void) { \
return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t)); \
} \
SCOPE void kh_destroy_##name(kh_##name##_t *h) \
{ \
if (h) { \
kfree((void *)h->keys); kfree(h->flags); \
kfree((void *)h->vals); \
kfree(h); \
} \
} \
SCOPE void kh_clear_##name(kh_##name##_t *h) \
{ \
if (h && h->flags) { \
memset(h->flags, 0xaa, __ac_fsize(h->n_buckets) * sizeof(khint32_t)); \
h->size = h->n_occupied = 0; \
} \
} \
SCOPE khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key) \
{ \
if (h->n_buckets) { \
khint_t k, i, last, mask, step = 0; \
mask = h->n_buckets - 1; \
k = __hash_func(key); i = k & mask; \
last = i; \
while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \
i = (i + (++step)) & mask; \
if (i == last) return h->n_buckets; \
} \
return __ac_iseither(h->flags, i)? h->n_buckets : i; \
} else return 0; \
} \
SCOPE int kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets) \
{ /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
khint32_t *new_flags = 0; \
khint_t j = 1; \
{ \
kroundup32(new_n_buckets); \
if (new_n_buckets < 4) new_n_buckets = 4; \
if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) j = 0; /* requested size is too small */ \
else { /* hash table size to be changed (shrink or expand); rehash */ \
new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
if (!new_flags) return -1; \
memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
if (h->n_buckets < new_n_buckets) { /* expand */ \
khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
if (!new_keys) return -1; \
h->keys = new_keys; \
if (kh_is_map) { \
khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
if (!new_vals) return -1; \
h->vals = new_vals; \
} \
} /* otherwise shrink */ \
} \
} \
if (j) { /* rehashing is needed */ \
for (j = 0; j != h->n_buckets; ++j) { \
if (__ac_iseither(h->flags, j) == 0) { \
khkey_t key = h->keys[j]; \
khval_t val; \
khint_t new_mask; \
new_mask = new_n_buckets - 1; \
if (kh_is_map) val = h->vals[j]; \
__ac_set_isdel_true(h->flags, j); \
while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
khint_t k, i, step = 0; \
k = __hash_func(key); \
i = k & new_mask; \
while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask; \
__ac_set_isempty_false(new_flags, i); \
if (i < h->n_buckets && __ac_iseither(h->flags, i) == 0) { /* kick out the existing element */ \
{ khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
__ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
} else { /* write the element and jump out of the loop */ \
h->keys[i] = key; \
if (kh_is_map) h->vals[i] = val; \
break; \
} \
} \
} \
} \
if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \
h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
} \
kfree(h->flags); /* free the working space */ \
h->flags = new_flags; \
h->n_buckets = new_n_buckets; \
h->n_occupied = h->size; \
h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
} \
return 0; \
} \
SCOPE khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret) \
{ \
khint_t x; \
if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
if (h->n_buckets > (h->size<<1)) { \
if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
*ret = -1; return h->n_buckets; \
} \
} else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
*ret = -1; return h->n_buckets; \
} \
} /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
{ \
khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
if (__ac_isempty(h->flags, i)) x = i; /* for speed up */ \
else { \
last = i; \
while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \
if (__ac_isdel(h->flags, i)) site = i; \
i = (i + (++step)) & mask; \
if (i == last) { x = site; break; } \
} \
if (x == h->n_buckets) { \
if (__ac_isempty(h->flags, i) && site != h->n_buckets) x = site; \
else x = i; \
} \
} \
} \
if (__ac_isempty(h->flags, x)) { /* not present at all */ \
h->keys[x] = key; \
__ac_set_isboth_false(h->flags, x); \
++h->size; ++h->n_occupied; \
*ret = 1; \
} else if (__ac_isdel(h->flags, x)) { /* deleted */ \
h->keys[x] = key; \
__ac_set_isboth_false(h->flags, x); \
++h->size; \
*ret = 2; \
} else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
return x; \
} \
SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x) \
{ \
if (x != h->n_buckets && !__ac_iseither(h->flags, x)) { \
__ac_set_isdel_true(h->flags, x); \
--h->size; \
} \
}
#define KHASH_DECLARE(name, khkey_t, khval_t) \
__KHASH_TYPE(name, khkey_t, khval_t) \
__KHASH_PROTOTYPES(name, khkey_t, khval_t)
#define KHASH_INIT2(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \
__KHASH_TYPE(name, khkey_t, khval_t) \
__KHASH_IMPL(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
#define KHASH_INIT(name, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \
KHASH_INIT2(name, static kh_inline, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
/* --- BEGIN OF HASH FUNCTIONS --- */
/*! @function
@abstract Integer hash function
@param key The integer [khint32_t]
@return The hash value [khint_t]
*/
#define kh_int_hash_func(key) (khint32_t)(key)
/*! @function
@abstract Integer comparison function
*/
#define kh_int_hash_equal(a, b) ((a) == (b))
/*! @function
@abstract 64-bit integer hash function
@param key The integer [khint64_t]
@return The hash value [khint_t]
*/
#define kh_int64_hash_func(key) (khint32_t)((key)>>33^(key)^(key)<<11)
/*! @function
@abstract 64-bit integer comparison function
*/
#define kh_int64_hash_equal(a, b) ((a) == (b))
/*! @function
@abstract const char* hash function
@param s Pointer to a null terminated string
@return The hash value
*/
static kh_inline khint_t __ac_X31_hash_string(const char *s)
{
khint_t h = (khint_t)*s;
if (h) for (++s ; *s; ++s) h = (h << 5) - h + (khint_t)*s;
return h;
}
/*! @function
@abstract Another interface to const char* hash function
@param key Pointer to a null terminated string [const char*]
@return The hash value [khint_t]
*/
#define kh_str_hash_func(key) __ac_X31_hash_string(key)
/*! @function
@abstract Const char* comparison function
*/
#define kh_str_hash_equal(a, b) (strcmp(a, b) == 0)
static kh_inline khint_t __ac_Wang_hash(khint_t key)
{
key += ~(key << 15);
key ^= (key >> 10);
key += (key << 3);
key ^= (key >> 6);
key += ~(key << 11);
key ^= (key >> 16);
return key;
}
#define kh_int_hash_func2(k) __ac_Wang_hash((khint_t)key)
/* --- END OF HASH FUNCTIONS --- */
/* Other convenient macros... */
/*!
@abstract Type of the hash table.
@param name Name of the hash table [symbol]
*/
#define khash_t(name) kh_##name##_t
/*! @function
@abstract Initiate a hash table.
@param name Name of the hash table [symbol]
@return Pointer to the hash table [khash_t(name)*]
*/
#define kh_init(name) kh_init_##name()
/*! @function
@abstract Destroy a hash table.
@param name Name of the hash table [symbol]
@param h Pointer to the hash table [khash_t(name)*]
*/
#define kh_destroy(name, h) kh_destroy_##name(h)
/*! @function
@abstract Reset a hash table without deallocating memory.
@param name Name of the hash table [symbol]
@param h Pointer to the hash table [khash_t(name)*]
*/
#define kh_clear(name, h) kh_clear_##name(h)
/*! @function
@abstract Resize a hash table.
@param name Name of the hash table [symbol]
@param h Pointer to the hash table [khash_t(name)*]
@param s New size [khint_t]
*/
#define kh_resize(name, h, s) kh_resize_##name(h, s)
/*! @function
@abstract Insert a key to the hash table.
@param name Name of the hash table [symbol]
@param h Pointer to the hash table [khash_t(name)*]
@param k Key [type of keys]
@param r Extra return code: 0 if the key is present in the hash table;
1 if the bucket is empty (never used); 2 if the element in
the bucket has been deleted [int*]
@return Iterator to the inserted element [khint_t]
*/
#define kh_put(name, h, k, r) kh_put_##name(h, k, r)
/*! @function
@abstract Retrieve a key from the hash table.
@param name Name of the hash table [symbol]
@param h Pointer to the hash table [khash_t(name)*]
@param k Key [type of keys]
@return Iterator to the found element, or kh_end(h) if the element is absent [khint_t]
*/
#define kh_get(name, h, k) kh_get_##name(h, k)
/*! @function
@abstract Remove a key from the hash table.
@param name Name of the hash table [symbol]
@param h Pointer to the hash table [khash_t(name)*]
@param k Iterator to the element to be deleted [khint_t]
*/
#define kh_del(name, h, k) kh_del_##name(h, k)
/*! @function
@abstract Test whether a bucket contains data.
@param h Pointer to the hash table [khash_t(name)*]
@param x Iterator to the bucket [khint_t]
@return 1 if containing data; 0 otherwise [int]
*/
#define kh_exist(h, x) (!__ac_iseither((h)->flags, (x)))
/*! @function
@abstract Get key given an iterator
@param h Pointer to the hash table [khash_t(name)*]
@param x Iterator to the bucket [khint_t]
@return Key [type of keys]
*/
#define kh_key(h, x) ((h)->keys[x])
/*! @function
@abstract Get value given an iterator
@param h Pointer to the hash table [khash_t(name)*]
@param x Iterator to the bucket [khint_t]
@return Value [type of values]
@discussion For hash sets, calling this results in segfault.
*/
#define kh_val(h, x) ((h)->vals[x])
/*! @function
@abstract Alias of kh_val()
*/
#define kh_value(h, x) ((h)->vals[x])
/*! @function
@abstract Get the start iterator
@param h Pointer to the hash table [khash_t(name)*]
@return The start iterator [khint_t]
*/
#define kh_begin(h) (khint_t)(0)
/*! @function
@abstract Get the end iterator
@param h Pointer to the hash table [khash_t(name)*]
@return The end iterator [khint_t]
*/
#define kh_end(h) ((h)->n_buckets)
/*! @function
@abstract Get the number of elements in the hash table
@param h Pointer to the hash table [khash_t(name)*]
@return Number of elements in the hash table [khint_t]
*/
#define kh_size(h) ((h)->size)
/*! @function
@abstract Get the number of buckets in the hash table
@param h Pointer to the hash table [khash_t(name)*]
@return Number of buckets in the hash table [khint_t]
*/
#define kh_n_buckets(h) ((h)->n_buckets)
/*! @function
@abstract Iterate over the entries in the hash table
@param h Pointer to the hash table [khash_t(name)*]
@param kvar Variable to which key will be assigned
@param vvar Variable to which value will be assigned
@param code Block of code to execute
*/
#define kh_foreach(h, kvar, vvar, code) { khint_t __i; \
for (__i = kh_begin(h); __i != kh_end(h); ++__i) { \
if (!kh_exist(h,__i)) continue; \
(kvar) = kh_key(h,__i); \
(vvar) = kh_val(h,__i); \
code; \
} }
/*! @function
@abstract Iterate over the values in the hash table
@param h Pointer to the hash table [khash_t(name)*]
@param vvar Variable to which value will be assigned
@param code Block of code to execute
*/
#define kh_foreach_value(h, vvar, code) { khint_t __i; \
for (__i = kh_begin(h); __i != kh_end(h); ++__i) { \
if (!kh_exist(h,__i)) continue; \
(vvar) = kh_val(h,__i); \
code; \
} }
/* More conenient interfaces */
/*! @function
@abstract Instantiate a hash set containing integer keys
@param name Name of the hash table [symbol]
*/
#define KHASH_SET_INIT_INT(name) \
KHASH_INIT(name, khint32_t, char, 0, kh_int_hash_func, kh_int_hash_equal)
#define KHASH_SET_DECLARE_INT(name) \
KHASH_DECLARE(name, khint32_t, char)
#define KHASH_SET_IMPL_INT(name) \
__KHASH_IMPL(name, , khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
/*! @function
@abstract Instantiate a hash map containing integer keys
@param name Name of the hash table [symbol]
@param khval_t Type of values [type]
*/
#define KHASH_MAP_INIT_INT(name, khval_t) \
KHASH_INIT(name, khint32_t, khval_t, 1, kh_int_hash_func, kh_int_hash_equal)
#define KHASH_MAP_DECLARE_INT(name, khval_t) \
KHASH_DECLARE(name, khint32_t, khval_t)
#define KHASH_MAP_IMPL_INT(name, khval_t) \
__KHASH_IMPL(name, , khint32_t, khval_t, 1, kh_int_hash_func, kh_int_hash_equal)
/*! @function
@abstract Instantiate a hash map containing 64-bit integer keys
@param name Name of the hash table [symbol]
*/
#define KHASH_SET_INIT_INT64(name) \
KHASH_INIT(name, khint64_t, char, 0, kh_int64_hash_func, kh_int64_hash_equal)
#define KHASH_SET_DECLARE_INT64(name) \
KHASH_DECLARE(name, khint64_t, char)
#define KHASH_SET_IMPL_INT64(name) \
__KHASH_IMPL(name, , khint64_t, char, 0, kh_int64_hash_func, kh_int64_hash_equal)
/*! @function
@abstract Instantiate a hash map containing 64-bit integer keys
@param name Name of the hash table [symbol]
@param khval_t Type of values [type]
*/
#define KHASH_MAP_INIT_INT64(name, khval_t) \
KHASH_INIT(name, khint64_t, khval_t, 1, kh_int64_hash_func, kh_int64_hash_equal)
#define KHASH_MAP_DECLARE_INT64(name, khval_t) \
KHASH_DECLARE(name, khint64_t, khval_t)
#define KHASH_MAP_IMPL_INT64(name, khval_t) \
__KHASH_IMPL(name, , khint64_t, khval_t, 1, kh_int64_hash_func, kh_int64_hash_equal)
typedef const char *kh_cstr_t;
/*! @function
@abstract Instantiate a hash map containing const char* keys
@param name Name of the hash table [symbol]
*/
#define KHASH_SET_INIT_STR(name) \
KHASH_INIT(name, kh_cstr_t, char, 0, kh_str_hash_func, kh_str_hash_equal)
#define KHASH_SET_DECLARE_STR(name) \
KHASH_DECLARE(name, kh_cstr_t, char)
#define KHASH_SET_IMPL_STR(name) \
__KHASH_IMPL(name, , kh_cstr_t, char, 0, kh_str_hash_func, kh_str_hash_equal)
/*! @function
@abstract Instantiate a hash map containing const char* keys
@param name Name of the hash table [symbol]
@param khval_t Type of values [type]
*/
#define KHASH_MAP_INIT_STR(name, khval_t) \
KHASH_INIT(name, kh_cstr_t, khval_t, 1, kh_str_hash_func, kh_str_hash_equal)
#define KHASH_MAP_DECLARE_STR(name, khval_t) \
KHASH_DECLARE(name, kh_cstr_t, khval_t)
#define KHASH_MAP_IMPL_STR(name, khval_t) \
__KHASH_IMPL(name, , kh_cstr_t, khval_t, 1, kh_str_hash_func, kh_str_hash_equal)
#endif /* __AC_KHASH_H */

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View file

@ -0,0 +1,17 @@
#!/bin/bash -ux
cd "$(dirname "$0")"
base=../src/
if [ -e yml/gles-1.1-full.yml ]; then rm yml/gles-1.1-full.yml ;fi
touch yml/gles-1.1-full.yml
cat yml/*-1.1.yml >> yml/gles-1.1-full.yml
gles1=$(ls -1 yml/*-1.1-full.yml | tr '\n' ',' | sed -e 's/,$//')
gles=$(ls -1 yml/*es-1.1.yml | tr '\n' ',' | sed -e 's/,$//')
glext=$(ls -1 yml/*ext-1.1.yml | tr '\n' ',' | sed -e 's/,$//')
#./gen.py "$gles" gleswrap.c.j2 gleswrap.c gles.h > "$base/gl/wrap/gles.c"
#./gen.py "$glext" glextwrap.c.j2 glextwrap.c gles.h > "$base/gl/wrap/glesext.c"
./gen.py "$gles1" gleswrap.c.j2 gleswrap.c gles.h ../gl4es.h ../loader.h skips.h > "$base/gl/wrap/gles.c"
./gen.py "$gles1" glwrap.h.j2 gleswrap.h ../gles.h > "$base/gl/wrap/gles.h"
./gen.py "$gles1" glxfuncs.j2 glxfuncs.inc ../gl/gl4es.h > "$base/glx/glesfuncs.inc"

View file

@ -0,0 +1,166 @@
#!/usr/bin/env python
import argparse
import jinja2
import re
from yaml import load
split_re = re.compile(r'^(?P<type>.*?)\s*(?P<name>\w+)$')
env = jinja2.Environment(
trim_blocks=True,
lstrip_blocks=True,
loader=jinja2.FileSystemLoader('template'),
)
def args(args, add_type=True):
return ', '.join(
'{} {}'.format(arg['type'], arg['name']) if add_type else arg['name']
for arg in args
)
f = '0.2f'
printf_lookup = {
'GLbitfield': 'd',
'GLboolean': 'd',
'GLbyte': 'c',
'GLubyte': 'c',
'GLchar': 'c',
'GLdouble': '0.2f',
'GLenum': 'u',
'GLfloat': '0.2f',
'GLint': 'd',
'GLintptr': 'd',
'GLintptrARB': 'd',
'GLshort': 'd',
'GLsizei': 'd',
'GLsizeiptr': 'd',
'GLsizeiptrARB': 'd',
'GLuint': 'u',
'GLushort': 'u',
'GLvoid': 'p',
}
def printf(args):
types = []
for arg in args:
typ = arg['type']
if '*' in typ:
t = 'p'
else:
t = printf_lookup.get(typ, 'p')
types.append(t)
return ', '.join('%' + t for t in types)
def unconst(s):
split = s.split(' ')
while 'const' in split:
split.remove('const')
return ' '.join(split)
env.filters['args'] = args
env.filters['printf'] = printf
env.filters['unconst'] = unconst
def split_arg(arg):
match = split_re.match(arg)
if match:
return match.groupdict()
else:
return {'type': 'unknown', 'name': arg}
def gen(files, template, guard_name, headers,
deep=False, cats=(), ifdef=None, ifndef=None):
funcs = {}
formats = []
unique_formats = set()
for data in files:
if deep and not isinstance(data.values()[0], list):
functions = []
for cat, f in data.items():
if not cats or cat in cats:
functions.extend(f.items())
else:
functions = data.items()
for name, args in sorted(functions):
props = {}
if args:
ret = args.pop(0)
else:
ret = 'void'
loadlib = 'LOAD_GLES'
if name.endswith('_OES_'):
loadlib = 'LOAD_GLES_OES'
name = name[:-5]
args = [split_arg(arg) for arg in args if not arg == 'void']
if any(arg.get('type') == 'unknown' for arg in args):
continue
if args:
args[0]['first'] = True
args[-1]['last'] = True
for i, arg in enumerate(args):
arg['index'] = i
types = '_'.join(
arg['type'].replace(' ', '_').replace('*', '__GENPT__')
for arg in [{'type': ret}] + args)
props.update({
'return': ret,
'name': name,
'args': args,
'types': types,
'void': ret == 'void',
'loadlib': loadlib,
})
if not types in unique_formats:
unique_formats.add(types)
formats.append(props)
funcs[name] = props
context = {
'functions': [i[1] for i in sorted(funcs.items())],
'formats': formats,
'headers': headers,
'name': guard_name,
'ifdef': ifdef,
'ifndef': ifndef,
}
t = env.get_template(template)
return t.render(**context).rstrip('\n')
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Generate code with yml/jinja.')
parser.add_argument('yaml', help='spec files')
parser.add_argument('template', help='jinja template to load')
parser.add_argument('name', help='header guard name')
parser.add_argument('headers', nargs='*', help='headers to include')
parser.add_argument('--deep', help='nested definitions', action='store_true')
parser.add_argument('--cats', help='deep category filter')
parser.add_argument('--ifdef', help='wrap with ifdef')
parser.add_argument('--ifndef', help='wrap with ifndef')
args = parser.parse_args()
files = []
for name in args.yaml.split(','):
with open(name) as f:
data = load(f)
if data:
files.append(data)
if args.cats:
cats = args.cats.split(',')
else:
cats = None
print gen(files, args.template, args.name,
args.headers, args.deep, cats,
args.ifdef, args.ifndef)

View file

@ -0,0 +1,2 @@
jinja2
pyyaml

View file

@ -0,0 +1,8 @@
{% if ifdef %}#ifdef {{ ifdef }}
{% endif %}
{% if ifndef %}#ifndef {{ ifndef }}
{% endif %}
{% block main %}{% endblock %}
{% block content %}{% endblock %}
{% if ifdef %}#endif{% endif %}
{% if ifndef %}#endif{% endif %}

View file

@ -0,0 +1,13 @@
packed_call_t* glCopyPackedCall(const packed_call_t *packed) {
switch (packed->format) {
{% for f in formats %}
case FORMAT_{{ f.types }}: {
int sizeofpacked = sizeof(PACKED_{{ f.types }});
PACKED_{{ f.types }} *newpacked = (PACKED_{{ f.types }}*)malloc(sizeofpacked);
memcpy(newpacked, packed, sizeofpacked);
return (packed_call_t*)newpacked;
break;
}
{% endfor %}
}
}

View file

@ -0,0 +1,5 @@
{% if func.args %}
printf("{{ func.name }}({{ func.args|printf }});\n", {{ func.args|args(0) }});
{% else %}
printf("{{ func.name }}();\n");
{% endif %}

View file

@ -0,0 +1,10 @@
{% extends "base/base.j2" %}
{% block main %}
{% include "base/headers.j2" %}
{% set guard = name.upper().replace('.', '_') -%}
#ifndef {{ guard }}
#define {{ guard }}
{% block content %}{% endblock %}
#endif
{% endblock %}

View file

@ -0,0 +1,9 @@
{% block headers %}
{% for header in headers %}
{% if "<" in header %}
#include {{ header }}
{% else %}
#include "{{ header }}"
{% endif %}
{% endfor %}
{% endblock %}

View file

@ -0,0 +1,22 @@
void glIndexedCall(const indexed_call_t *packed, void *ret_v) {
switch (packed->func) {
{% for f in functions %}
#ifndef skip_index_{{ f.name }}
case {{ f.name }}_INDEX: {
INDEXED_{{ f.types }} *unpacked = (INDEXED_{{ f.types }} *)packed;
{% if f.args %}
ARGS_{{ f.types }} args = unpacked->args;
{% endif %}
{% if not f.void %}
{{ f.return }} *ret = ({{ f.return }} *)ret_v;
*ret =
{% endif %}
{{ f.name }}({% for arg in f.args -%}
args.a{{ loop.index }}{% if not arg.last %}, {% endif %}
{% endfor %});
break;
}
#endif
{% endfor %}
}
}

View file

@ -0,0 +1,16 @@
void glPackedCall(const packed_call_t *packed) {
switch (packed->format) {
{% for f in formats %}
case FORMAT_{{ f.types }}: {
PACKED_{{ f.types }} *unpacked = (PACKED_{{ f.types }} *)packed;
{% if f.args %}
ARGS_{{ f.types }} args = unpacked->args;
{% endif %}
unpacked->func({% for arg in f.args -%}
args.a{{ loop.index }}{% if not arg.last %}, {% endif %}
{% endfor %});
break;
}
{% endfor %}
}
}

View file

@ -0,0 +1,15 @@
{% extends "base/base.j2" %}
{% block main %}
{% include "base/headers.j2" %}
{% for func in functions %}
{% block definition scoped %}
{{ func.return }} gl4es_{{ func.name }}({{ func.args|args }}) {
{% block load scoped %}{% endblock %}
{% block call scoped %}
{% if not func.void %}return {% endif %}{% block prefix %}wrap{% endblock %}_{{ func.name }}({{ func.args|args(0) }});
{%- endblock %}
}
{{ func.return }} {{ func.name }}({{ func.args|args }}) __attribute__((alias("gl4es_{{ func.name }}"))) __attribute__((visibility("default")));
{% endblock %}
{% endfor %}
{% endblock %}

View file

@ -0,0 +1,65 @@
{% extends "base/header.j2" %}
{% block content %}
typedef struct {
int format;
void *func;
void *args;
} packed_call_t;
typedef struct {
int func;
void *args;
} indexed_call_t;
enum FORMAT {
{% for f in formats %}
FORMAT_{{ f.types }},
{% endfor %}
};
{% for f in formats %}
typedef {{ f.return }} (*FUNC_{{ f.types }})({{ f.args|args }});
{% if f.args %}
typedef struct {
{% for arg in f.args %}
{{ arg.type|unconst }} a{{ loop.index }}{% if arg.type == 'GLdouble' %} __attribute__ ((aligned(8))){% endif %};
{% endfor %}
} ARGS_{{ f.types }};
{% endif %}
typedef struct {
int format;
FUNC_{{ f.types }} func;
{% if f.args %}
ARGS_{{ f.types }} args;
{% endif %}
} PACKED_{{ f.types }};
typedef struct {
int func;
{% if f.args %}
ARGS_{{ f.types }} args;
{% endif %}
} INDEXED_{{ f.types }};
{% endfor %}
extern void glPushCall(void *data);
void glPackedCall(const packed_call_t *packed);
void glIndexedCall(const indexed_call_t *packed, void *ret_v);
packed_call_t* glCopyPackedCall(const packed_call_t *packed);
{% for func in functions %}
#define {{ func.name }}_INDEX {{ loop.index }}
#define {{ func.name }}_RETURN {{ func.return }}
#define {{ func.name }}_ARG_NAMES {{ func.args|args(0) }}
#define {{ func.name }}_ARG_EXPAND {{ func.args|args }}
#define {{ func.name }}_PACKED PACKED_{{ func.types }}
#define {{ func.name }}_INDEXED INDEXED_{{ func.types }}
#define {{ func.name }}_FORMAT FORMAT_{{ func.types }}
{% endfor %}
{% for func in functions %}
{{ func.return }} gl4es_{{ func.name }}({{ func.name }}_ARG_EXPAND);
typedef {{ func.return }} (*{{ func.name }}_PTR)({{ func.name }}_ARG_EXPAND);
{% endfor %}
{% endblock %}

View file

@ -0,0 +1,52 @@
{% extends "base/wrap.c.j2" %}
{% block headers %}
#include <sys/syscall.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
{{ super() }}
{% endblock %}
{% block main %}
{{ super() }}
snd_config_t *snd_config = NULL;
__GLXextFuncPtr glXGetProcAddressARB(const GLubyte *name) {
{% for func in functions %}
{% if not func.name.startswith('snd_') %}
if (strcmp(name, "{{ func.name }}") == 0) {
return (void *){{ func.name }};
}
{% endif %}
{% endfor %}
printf("glXGetProcAddress(%s) not found\n", name);
return NULL;
}
__GLXextFuncPtr glXGetProcAddress(const GLubyte *name) {
return glXGetProcAddressARB(name);
}
{% endblock %}
{% block definition %}
#if !defined(skip_client_{{ func.name }}) && !defined(skip_index_{{ func.name }})
{{ super() -}}
#endif
{% endblock %}
{% block call %}
{{ func.name }}_INDEXED packed_data;
packed_data.func = {{ func.name }}_INDEX;
{% for arg in func.args %}
packed_data.args.a{{ loop.index }} = ({{ arg.type|unconst }}){{ arg.name }};
{% endfor %}
{% if not func.void %}
{{ func.return }} ret;
syscall(SYS_proxy, (void *)&packed_data, &ret);
return ret;
{% else %}
syscall(SYS_proxy, (void *)&packed_data, NULL);
{% endif %}
{% endblock %}

View file

@ -0,0 +1,23 @@
{% extends "base/wrap.c.j2" %}
{% block headers %}
{{ super() }}
void *egl_lib;
#define WARN_NULL(name) if (name == NULL) printf("LIBGL: warning, " #name " is NULL\n");
#define LOAD_EGL(type, name, args...) \
typedef type (*eglptr_##name)(args); \
static eglptr_##name egl_##name; \
if (egl##name == NULL) { \
if (egl_lib == NULL) { \
egl_lib = dlopen("libEGL.so", RTLD_LOCAL | RTLD_LAZY); \
WARN_NULL(egl_lib); \
} \
egl_##name = (eglptr_##name)dlsym(egl_lib, #name); \
WARN_NULL(egl_lib_##name); \
} \
{% endblock %}
{% block load %}
LOAD_EGL({{ func.return }}, {{ func.name }}
{%- if func.args %}, {{ func.args|args }}{% endif %});
{% endblock %}
{% block prefix %}egl{% endblock %}

View file

@ -0,0 +1,29 @@
{% extends "base/wrap.c.j2" %}
{% block headers %}
{{ super() }}
{% endblock %}
{% block content %}
{% include "base/packed_call.j2" %}
/*
{% include "base/copy_packed_call.j2" %}
*/
{% endblock %}
{% block definition %}
#ifndef skip_{{ func.name }}
{{ super() -}}
#endif
{% endblock %}
{% block load %}
{{ func.loadlib }}({{ func.name }});
{% endblock %}
{% block call %}
#ifndef direct_{{ func.name }}
PUSH_IF_COMPILING({{ func.name }})
#endif
{{ super() }}
{% endblock %}
{% block prefix %}gles{% endblock %}

View file

@ -0,0 +1,20 @@
{% extends "base/wrap.c.j2" %}
{% block headers %}
{{ super() }}
{% endblock %}
{% block definition %}
#ifndef skip_{{ func.name }}
{{ super() -}}
#endif
{% endblock %}
{% block load %}
{{ func.loadlib }}({{ func.name }});
{% endblock %}
{% block call %}
#ifndef direct_{{ func.name }}
PUSH_IF_COMPILING({{ func.name }})
#endif
{{ super() }}
{% endblock %}
{% block prefix %}gles{% endblock %}

View file

@ -0,0 +1,20 @@
{% extends "base/wrap.h.j2" %}
{% block content %}
{{ super() }}
{% for func in functions %}
#ifndef direct_{{ func.name }}
#define push_{{ func.name }}({{ func.args|args(0) }}) { \
{{ func.name }}_PACKED *packed_data = malloc(sizeof({{ func.name }}_PACKED)); \
packed_data->format = {{ func.name }}_FORMAT; \
packed_data->func = gl4es_{{ func.name }}; \
{% if func.args %}
{% for arg in func.args %}
packed_data->args.a{{ loop.index }} = ({{ arg.type|unconst }}){{ arg.name }}; \
{% endfor %}
{% endif %}
glPushCall((void *)packed_data); \
}
#endif
{% endfor %}
{% endblock %}

View file

@ -0,0 +1,3 @@
{% for func in functions %}
_EX({{ func.name }});
{% endfor %}

View file

@ -0,0 +1,6 @@
{% extends "base/header.j2" %}
{% block content %}
{% include "base/indexed_call.j2" %}
{% endblock %}

View file

@ -0,0 +1 @@
{% extends "base/wrap.h.j2" %}

View file

@ -0,0 +1,112 @@
#!/usr/bin/env python
from collections import defaultdict
import re
import xml.etree.ElementTree as ET
import yaml
def etna_to_yml(xml):
defs = xml.find('functions')
functions = defaultdict(dict)
for f in defs.findall('function'):
name = f.get('name')
ret = f.find('return')
if ret is not None:
ret = ret.get('type')
if ret is None:
ret = 'void'
params = []
for p in f.findall('param'):
params.append('{} {}'.format(p.get('type'), p.get('name')))
functions[name] = [ret] + params
return functions
def lua_to_yml(xml):
typemap = xml.find('typemap')
types = {}
for t in typemap:
name = t.get('typename')
types[name] = t.get('C-lang', name)
defs = xml.find('functions').find('function-defs')
functions = defaultdict(dict)
for f in defs.findall('function'):
cat = f.get('category')
ret = f.get('return')
ret = types.get(ret, ret)
func = f.get('name')
params = []
for param in f.findall('param'):
typ = param.get('type')
typ = types.get(typ, typ)
name = param.get('name')
kind = param.get('kind')
if kind in ('array', 'reference', 'array[size]'):
typ = typ.rstrip()
if not typ.endswith('*') or kind == 'reference':
typ += ' *'
if not 'const' in typ and param.get('input', 'false') == 'true':
typ = 'const ' + typ
p = '{} {}'.format(typ, name)
p = p.replace('* ', '*')
params.append(p)
args = [ret]
args.extend(params)
functions[cat][func] = args
return functions
def khronos_to_yml(xml):
def extract(node):
return node.findtext('ptype') or node.text, node.findtext('name')
def clean(s):
return re.sub('\s+', ' ', s).strip()
defs = xml.find('commands')
functions = defaultdict(dict)
for f in defs.findall('command'):
proto = f.find('proto')
ret, name = extract(proto)
params = []
for param in f.findall('param'):
params.append(clean(' '.join((param.itertext()))))
functions[name] = [ret] + params
return functions
def to_yml(filename):
with open(filename, 'r') as f:
data = f.read()
data = re.sub(' xmlns="[^"]+"', '', data, count=1)
xml = ET.fromstring(data)
if xml.tag == 'root':
functions = etna_to_yml(xml)
elif xml.tag == 'specification':
functions = lua_to_yml(xml)
elif xml.tag == 'registry':
functions = khronos_to_yml(xml)
else:
print 'unrecognized root tag:', xml.tag
yml = yaml.dump(dict(functions))
with open(filename.replace('xml', 'yml'), 'w') as o:
o.write(yml)
if __name__ == '__main__':
import sys
if len(sys.argv) < 2:
print 'Usage: {} <file.xml> [file.xml...]'.format(sys.argv[0])
sys.exit(1)
for name in sys.argv[1:]:
to_yml(name)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,108 @@
eglBindAPI: [EGLBoolean, EGLenum api]
eglBindTexImage: [EGLBoolean, EGLDisplay dpy, EGLSurface surface, EGLint buffer]
eglChooseConfig: [EGLBoolean, EGLDisplay dpy, const EGLint * attrib_list, EGLConfig
* configs, EGLint config_size, EGLint * num_config]
eglClientWaitSyncKHR: [EGLint, EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR
timeout]
eglClientWaitSyncNV: [EGLint, EGLSyncNV sync, EGLint flags, EGLTimeNV timeout]
eglCopyBuffers: [EGLBoolean, EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType
target]
eglCreateContext: [EGLContext, EGLDisplay dpy, EGLConfig config, EGLContext share_context,
const EGLint * attrib_list]
eglCreateDRMImageMESA: [EGLImageKHR, EGLDisplay dpy, const EGLint * attrib_list]
eglCreateFenceSyncNV: [EGLSyncNV, EGLDisplay dpy, EGLenum condition, const EGLint
* attrib_list]
eglCreateImageKHR: [EGLImageKHR, EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer
buffer, const EGLint * attrib_list]
eglCreatePbufferFromClientBuffer: [EGLSurface, EGLDisplay dpy, EGLenum buftype, EGLClientBuffer
buffer, EGLConfig config, const EGLint * attrib_list]
eglCreatePbufferSurface: [EGLSurface, EGLDisplay dpy, EGLConfig config, const EGLint
* attrib_list]
eglCreatePixmapSurface: [EGLSurface, EGLDisplay dpy, EGLConfig config, EGLNativePixmapType
pixmap, const EGLint * attrib_list]
eglCreatePixmapSurfaceHI: [EGLSurface, EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI
* pixmap]
eglCreateStreamFromFileDescriptorKHR: [EGLStreamKHR, EGLDisplay dpy, EGLNativeFileDescriptorKHR
file_descriptor]
eglCreateStreamKHR: [EGLStreamKHR, EGLDisplay dpy, const EGLint * attrib_list]
eglCreateStreamProducerSurfaceKHR: [EGLSurface, EGLDisplay dpy, EGLConfig config,
EGLStreamKHR stream, const EGLint * attrib_list]
eglCreateSyncKHR: [EGLSyncKHR, EGLDisplay dpy, EGLenum type, const EGLint * attrib_list]
eglCreateWindowSurface: [EGLSurface, EGLDisplay dpy, EGLConfig config, EGLNativeWindowType
win, const EGLint * attrib_list]
eglDestroyContext: [EGLBoolean, EGLDisplay dpy, EGLContext ctx]
eglDestroyImageKHR: [EGLBoolean, EGLDisplay dpy, EGLImageKHR image]
eglDestroyStreamKHR: [EGLBoolean, EGLDisplay dpy, EGLStreamKHR stream]
eglDestroySurface: [EGLBoolean, EGLDisplay dpy, EGLSurface surface]
eglDestroySyncKHR: [EGLBoolean, EGLDisplay dpy, EGLSyncKHR sync]
eglDestroySyncNV: [EGLBoolean, EGLSyncNV sync]
eglDupNativeFenceFDANDROID: [EGLint, EGLDisplay dpy, EGLSyncKHR sync]
eglExportDRMImageMESA: [EGLBoolean, EGLDisplay dpy, EGLImageKHR image, EGLint * name,
EGLint * handle, EGLint * stride]
eglFenceNV: [EGLBoolean, EGLSyncNV sync]
eglGetConfigAttrib: [EGLBoolean, EGLDisplay dpy, EGLConfig config, EGLint attribute,
EGLint * value]
eglGetConfigs: [EGLBoolean, EGLDisplay dpy, EGLConfig * configs, EGLint config_size,
EGLint * num_config]
eglGetCurrentContext: [EGLContext]
eglGetCurrentDisplay: [EGLDisplay]
eglGetCurrentSurface: [EGLSurface, EGLint readdraw]
eglGetDisplay: [EGLDisplay, EGLNativeDisplayType display_id]
eglGetError: [EGLint]
eglGetProcAddress: [__eglMustCastToProperFunctionPointerType, const char * procname]
eglGetStreamFileDescriptorKHR: [EGLNativeFileDescriptorKHR, EGLDisplay dpy, EGLStreamKHR
stream]
eglGetSyncAttribKHR: [EGLBoolean, EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute,
EGLint * value]
eglGetSyncAttribNV: [EGLBoolean, EGLSyncNV sync, EGLint attribute, EGLint * value]
eglGetSystemTimeFrequencyNV: [EGLuint64NV]
eglGetSystemTimeNV: [EGLuint64NV]
eglInitialize: [EGLBoolean, EGLDisplay dpy, EGLint * major, EGLint * minor]
eglLockSurfaceKHR: [EGLBoolean, EGLDisplay display, EGLSurface surface, const EGLint
* attrib_list]
eglMakeCurrent: [EGLBoolean, EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext
ctx]
eglPostSubBufferNV: [EGLBoolean, EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint
y, EGLint width, EGLint height]
eglQueryAPI: [EGLenum]
eglQueryContext: [EGLBoolean, EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint
* value]
eglQueryNativeDisplayNV: [EGLBoolean, EGLDisplay dpy, EGLNativeDisplayType * display_id]
eglQueryNativePixmapNV: [EGLBoolean, EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType
* pixmap]
eglQueryNativeWindowNV: [EGLBoolean, EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType
* window]
eglQueryStreamKHR: [EGLBoolean, EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute,
EGLint * value]
eglQueryStreamTimeKHR: [EGLBoolean, EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute,
EGLTimeKHR * value]
eglQueryStreamu64KHR: [EGLBoolean, EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute,
EGLuint64KHR * value]
eglQueryString: [const char *, EGLDisplay dpy, EGLint name]
eglQuerySurface: [EGLBoolean, EGLDisplay dpy, EGLSurface surface, EGLint attribute,
EGLint * value]
eglQuerySurfacePointerANGLE: [EGLBoolean, EGLDisplay dpy, EGLSurface surface, EGLint
attribute, void ** value]
eglReleaseTexImage: [EGLBoolean, EGLDisplay dpy, EGLSurface surface, EGLint buffer]
eglReleaseThread: [EGLBoolean]
eglSetBlobCacheFuncsANDROID: ['void ', EGLDisplay dpy, EGLSetBlobFuncANDROID set,
EGLGetBlobFuncANDROID get]
eglSignalSyncKHR: [EGLBoolean, EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode]
eglSignalSyncNV: [EGLBoolean, EGLSyncNV sync, EGLenum mode]
eglStreamAttribKHR: [EGLBoolean, EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute,
EGLint value]
eglStreamConsumerAcquireKHR: [EGLBoolean, EGLDisplay dpy, EGLStreamKHR stream]
eglStreamConsumerGLTextureExternalKHR: [EGLBoolean, EGLDisplay dpy, EGLStreamKHR stream]
eglStreamConsumerReleaseKHR: [EGLBoolean, EGLDisplay dpy, EGLStreamKHR stream]
eglSurfaceAttrib: [EGLBoolean, EGLDisplay dpy, EGLSurface surface, EGLint attribute,
EGLint value]
eglSwapBuffers: [EGLBoolean, EGLDisplay dpy, EGLSurface surface]
eglSwapBuffersWithDamageEXT: [EGLBoolean, EGLDisplay dpy, EGLSurface surface, EGLint
* rects, EGLint n_rects]
eglSwapInterval: [EGLBoolean, EGLDisplay dpy, EGLint interval]
eglTerminate: [EGLBoolean, EGLDisplay dpy]
eglUnlockSurfaceKHR: [EGLBoolean, EGLDisplay display, EGLSurface surface]
eglWaitClient: [EGLBoolean]
eglWaitGL: [EGLBoolean]
eglWaitNative: [EGLBoolean, EGLint engine]
eglWaitSyncKHR: [EGLint, EGLDisplay dpy, EGLSyncKHR sync, EGLint flags]

View file

@ -0,0 +1,148 @@
#GLES 1.1 Core
glActiveTexture: [void, GLenum texture]
glAlphaFunc: [void, GLenum func, GLclampf ref]
glAlphaFuncx: [void, GLenum func, GLclampx ref]
glBindBuffer: [void, GLenum target, GLuint buffer]
glBindTexture: [void, GLenum target, GLuint texture]
glBlendFunc: [void, GLenum sfactor, GLenum dfactor]
glBufferData: [void, GLenum target, GLsizeiptr size, "const GLvoid *data", GLenum usage]
glBufferSubData: [void, GLenum target, GLintptr offset, GLsizeiptr size, "const GLvoid *data"]
glClear: [void, GLbitfield mask]
glClearColor: [void, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha]
glClearColorx: [void, GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha]
glClearDepthf: [void, GLclampf depth]
glClearDepthx: [void, GLclampx depth]
glClearStencil: [void, GLint s]
glClientActiveTexture: [void, GLenum texture]
glClipPlanef: [void, GLenum plane, "const GLfloat *equation"]
glClipPlanex: [void, GLenum plane, "const GLfixed *equation"]
glColor4f: [void, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha]
glColor4ub: [void, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha]
glColor4x: [void, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha]
glColorMask: [void, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha]
glColorPointer: [void, GLint size, GLenum type, GLsizei stride, "const GLvoid *pointer"]
glCompressedTexImage2D: [void, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, "const GLvoid *data"]
glCompressedTexSubImage2D: [void, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, "const GLvoid *data"]
glCopyTexImage2D: [void, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border]
glCopyTexSubImage2D: [void, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height]
glCullFace: [void, GLenum mode]
glDeleteBuffers: [void, GLsizei n, "const GLuint *buffers"]
glDeleteTextures: [void, GLsizei n, "const GLuint *textures"]
glDepthFunc: [void, GLenum func]
glDepthMask: [void, GLboolean flag]
glDepthRangef: [void, GLclampf near, GLclampf far]
glDepthRangex: [void, GLclampx near, GLclampx far]
glDisable: [void, GLenum cap]
glDisableClientState: [void, GLenum array]
glDisableClientState: [void, GLenum array]
glDrawArrays: [void, GLenum mode, GLint first, GLsizei count]
glDrawElements: [void, GLenum mode, GLsizei count, GLenum type, "const GLvoid *indices"]
glEnable: [void, GLenum cap]
glEnableClientState: [void, GLenum array]
glEnableClientState: [void, GLenum array]
glFinish: [void, void]
glFlush: [void, void]
glFogf: [void, GLenum pname, GLfloat param]
glFogfv: [void, GLenum pname, "const GLfloat *params"]
glFogx: [void, GLenum pname, GLfixed param]
glFogxv: [void, GLenum pname, "const GLfixed *params"]
glFrontFace: [void, GLenum mode]
glFrustumf: [void, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat near, GLfloat far]
glFrustumx: [void, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed near, GLfixed far]
glGenBuffers: [void, GLsizei n, "GLuint *buffers"]
glGenTextures: [void, GLsizei n, "GLuint *textures"]
glGetBooleanv: [void, GLenum pname, "GLboolean *params"]
glGetBufferParameteriv: [void, GLenum target, GLenum pname, "GLint *params"]
glGetClipPlanef: [void, GLenum plane, "GLfloat *equation"]
glGetClipPlanex: [void, GLenum plane, "GLfixed *equation"]
glGetError: [GLenum, void]
glGetFixedv: [void, GLenum pname, "GLfixed *params"]
glGetFloatv: [void, GLenum pname, "GLfloat *params"]
glGetIntegerv: [void, GLenum pname, "GLint *params"]
glGetLightfv: [void, GLenum light, GLenum pname, "GLfloat *params"]
glGetLightxv: [void, GLenum light, GLenum pname, "GLfixed *params"]
glGetMaterialfv: [void, GLenum face, GLenum pname, "GLfloat *params"]
glGetMaterialxv: [void, GLenum face, GLenum pname, "GLfixed *params"]
glGetPointerv: [void, GLenum pname, "GLvoid **params"]
glGetString: [const GLubyte *, GLenum name]
glGetTexEnvfv: [void, GLenum target, GLenum pname, "GLfloat *params"]
glGetTexEnviv: [void, GLenum target, GLenum pname, "GLint *params"]
glGetTexEnvxv: [void, GLenum target, GLenum pname, "GLfixed *params"]
glGetTexParameterfv: [void, GLenum target, GLenum pname, "GLfloat *params"]
glGetTexParameteriv: [void, GLenum target, GLenum pname, "GLint *params"]
glGetTexParameterxv: [void, GLenum target, GLenum pname, "GLfixed *params"]
glHint: [void, GLenum target, GLenum mode]
glIsBuffer: [GLboolean, GLuint buffer]
glIsEnabled: [GLboolean, GLenum cap]
glIsTexture: [GLboolean, GLuint texture]
glLightf: [void, GLenum light, GLenum pname, GLfloat param]
glLightfv: [void, GLenum light, GLenum pname, "const GLfloat *params"]
glLightModelf: [void, GLenum pname, GLfloat param]
glLightModelfv: [void, GLenum pname, "const GLfloat *params"]
glLightModelx: [void, GLenum pname, GLfixed param]
glLightModelxv: [void, GLenum pname, "const GLfixed *params"]
glLightx: [void, GLenum light, GLenum pname, GLfixed param]
glLightxv: [void, GLenum light, GLenum pname, "const GLfixed *params"]
glLineWidth: [void, GLfloat width]
glLineWidthx: [void, GLfixed width]
glLoadIdentity: [void, void]
glLoadMatrixf: [void, "const GLfloat *m"]
glLoadMatrixx: [void, "const GLfixed *m"]
glLogicOp: [void, GLenum opcode]
glMaterialf: [void, GLenum face, GLenum pname, GLfloat param]
glMaterialfv: [void, GLenum face, GLenum pname, "const GLfloat *params"]
glMaterialx: [void, GLenum face, GLenum pname, GLfixed param]
glMaterialxv: [void, GLenum face, GLenum pname, "const GLfixed *params"]
glMatrixMode: [void, GLenum mode]
glMultiTexCoord4f: [void, GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q]
glMultiTexCoord4x: [void, GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q]
glMultMatrixf: [void, "const GLfloat *m"]
glMultMatrixx: [void, "const GLfixed *m"]
glNormal3f: [void, GLfloat nx, GLfloat ny, GLfloat nz]
glNormal3x: [void, GLfixed nx, GLfixed ny, GLfixed nz]
glNormalPointer: [void, GLenum type, GLsizei stride, "const GLvoid *pointer"]
glOrthof: [void, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat near, GLfloat far]
glOrthox: [void, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed near, GLfixed far]
glPixelStorei: [void, GLenum pname, GLint param]
glPointParameterf: [void, GLenum pname, GLfloat param]
glPointParameterfv: [void, GLenum pname, "const GLfloat *params"]
glPointParameterx: [void, GLenum pname, GLfixed param]
glPointParameterxv: [void, GLenum pname, "const GLfixed *params"]
glPointSize: [void, GLfloat size]
glPointSizePointerOES: [void, GLenum type, GLsizei stride, "const GLvoid *pointer"]
glPointSizex: [void, GLfixed size]
glPolygonOffset: [void, GLfloat factor, GLfloat units]
glPolygonOffsetx: [void, GLfixed factor, GLfixed units]
glPopMatrix: [void, void]
glPushMatrix: [void, void]
glReadPixels: [void, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, "GLvoid *pixels"]
glRotatef: [void, GLfloat angle, GLfloat x, GLfloat y, GLfloat z]
glRotatex: [void, GLfixed angle, GLfixed x, GLfixed y, GLfixed z]
glSampleCoverage: [void, GLclampf value, GLboolean invert]
glSampleCoveragex: [void, GLclampx value, GLboolean invert]
glScalef: [void, GLfloat x, GLfloat y, GLfloat z]
glScalex: [void, GLfixed x, GLfixed y, GLfixed z]
glScissor: [void, GLint x, GLint y, GLsizei width, GLsizei height]
glShadeModel: [void, GLenum mode]
glStencilFunc: [void, GLenum func, GLint ref, GLuint mask]
glStencilMask: [void, GLuint mask]
glStencilOp: [void, GLenum fail, GLenum zfail, GLenum zpass]
glTexCoordPointer: [void, GLint size, GLenum type, GLsizei stride, "const GLvoid *pointer"]
glTexEnvf: [void, GLenum target, GLenum pname, GLfloat param]
glTexEnvfv: [void, GLenum target, GLenum pname, "const GLfloat *params"]
glTexEnvi: [void, GLenum target, GLenum pname, GLint param]
glTexEnviv: [void, GLenum target, GLenum pname, "const GLint *params"]
glTexEnvx: [void, GLenum target, GLenum pname, GLfixed param]
glTexEnvxv: [void, GLenum target, GLenum pname, "const GLfixed *params"]
glTexImage2D: [void, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, "const GLvoid *data"]
glTexParameterf: [void, GLenum target, GLenum pname, GLfloat param]
glTexParameterfv: [void, GLenum target, GLenum pname, "const GLfloat *params"]
glTexParameteri: [void, GLenum target, GLenum pname, GLint param]
glTexParameteriv: [void, GLenum target, GLenum pname, "const GLint *params"]
glTexParameterx: [void, GLenum target, GLenum pname, GLfixed param]
glTexParameterxv: [void, GLenum target, GLenum pname, "const GLfixed *params"]
glTexSubImage2D: [void, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, "const GLvoid *data"]
glTranslatef: [void, GLfloat x, GLfloat y, GLfloat z]
glTranslatex: [void, GLfixed x, GLfixed y, GLfixed z]
glVertexPointer: [void, GLint size, GLenum type, GLsizei stride, "const GLvoid *pointer"]
glViewport: [void, GLint x, GLint y, GLsizei width, GLsizei height]

View file

@ -0,0 +1,169 @@
glActiveTexture: [void, GLenum texture]
glAttachShader: [void, GLuint program, GLuint shader]
glBindAttribLocation: [void, GLuint program, GLuint index, const GLchar * name]
glBindBuffer: [void, GLenum target, GLuint buffer]
glBindFramebuffer: [void, GLenum target, GLuint framebuffer]
glBindRenderbuffer: [void, GLenum target, GLuint renderbuffer]
glBindTexture: [void, GLenum target, GLuint texture]
glBlendColor: [void, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha]
glBlendEquation: [void, GLenum mode]
glBlendEquationSeparate: [void, GLenum modeRGB, GLenum modeA]
glBlendFunc: [void, GLenum sfactor, GLenum dfactor]
glBlendFuncSeparate: [void, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha,
GLenum dfactorAlpha]
glBufferData: [void, GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage]
glBufferSubData: [void, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid
* data]
glCheckFramebufferStatus: [GLenum, GLenum target]
glClear: [void, GLbitfield mask]
glClearColor: [void, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha]
glClearDepthf: [void, GLclampf depth]
glClearStencil: [void, GLint s]
glColorMask: [void, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha]
glCompileShader: [void, GLuint shader]
glCompressedTexImage2D: [void, GLenum target, GLint level, GLenum internalformat,
GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data]
glCompressedTexSubImage2D: [void, GLenum target, GLint level, GLint xoffset, GLint
yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const
GLvoid * data]
glCopyTexImage2D: [void, GLenum target, GLint level, GLenum internalformat, GLint
x, GLint y, GLsizei width, GLsizei height, GLint border]
glCopyTexSubImage2D: [void, GLenum target, GLint level, GLint xoffset, GLint yoffset,
GLint x, GLint y, GLsizei width, GLsizei height]
glCreateProgram: [GLuint]
glCreateShader: [GLuint, GLenum type]
glCullFace: [void, GLenum mode]
glDeleteBuffers: [void, GLsizei n, const GLuint * buffer]
glDeleteFramebuffers: [void, GLsizei n, const GLuint * framebuffers]
glDeleteProgram: [void, GLuint program]
glDeleteRenderbuffers: [void, GLsizei n, const GLuint * renderbuffers]
glDeleteShader: [void, GLuint program]
glDeleteTextures: [void, GLsizei n, const GLuint * textures]
glDepthFunc: [void, GLenum func]
glDepthMask: [void, GLboolean flag]
glDepthRangef: [void, GLclampf zNear, GLclampf zFar]
glDetachShader: [void, GLuint program, GLuint shader]
glDisable: [void, GLenum cap]
glDisableVertexAttribArray: [void, GLuint index]
glDrawArrays: [void, GLenum mode, GLint first, GLsizei count]
glDrawElements: [void, GLenum mode, GLsizei count, GLenum type, const GLvoid * indices]
glEnable: [void, GLenum cap]
glEnableVertexAttribArray: [void, GLuint index]
glFinish: [void]
glFlush: [void]
glFramebufferRenderbuffer: [void, GLenum target, GLenum attachment, GLenum renderbuffertarget,
GLuint renderbuffer]
glFramebufferTexture2D: [void, GLenum target, GLenum attachment, GLenum textarget,
GLuint texture, GLint level]
glFrontFace: [void, GLenum mode]
glGenBuffers: [void, GLsizei n, GLuint * buffer]
glGenFramebuffers: [void, GLsizei n, GLuint * framebuffers]
glGenRenderbuffers: [void, GLsizei n, GLuint * renderbuffers]
glGenTextures: [void, GLsizei n, GLuint * textures]
glGenerateMipmap: [void, GLenum target]
glGetActiveAttrib: [void, GLuint program, GLuint index, GLsizei bufSize, GLsizei *
length, GLint * size, GLenum * type, GLchar * name]
glGetActiveUniform: [void, GLuint program, GLuint index, GLsizei bufSize, GLsizei
* length, GLint * size, GLenum * type, GLchar * name]
glGetAttachedShaders: [void, GLuint program, GLsizei maxCount, GLsizei * count, GLuint
* obj]
glGetAttribLocation: [GLint, GLuint program, const GLchar * name]
glGetBooleanv: [void, GLenum pname, GLboolean * params]
glGetBufferParameteriv: [void, GLenum target, GLenum pname, GLint * params]
glGetError: [GLenum]
glGetFloatv: [void, GLenum pname, GLfloat * params]
glGetFramebufferAttachmentParameteriv: [void, GLenum target, GLenum attachment, GLenum
pname, GLint * params]
glGetIntegerv: [void, GLenum pname, GLint * params]
glGetProgramInfoLog: [void, GLuint program, GLsizei bufSize, GLsizei * length, GLchar
* infoLog]
glGetProgramiv: [void, GLuint program, GLenum pname, GLint * params]
glGetRenderbufferParameteriv: [void, GLenum target, GLenum pname, GLint * params]
glGetShaderInfoLog: [void, GLuint shader, GLsizei bufSize, GLsizei * length, GLchar
* infoLog]
glGetShaderPrecisionFormat: [void, GLenum shadertype, GLenum precisiontype, GLint
* range, GLint * precision]
glGetShaderSource: [void, GLuint shader, GLsizei bufSize, GLsizei * length, GLchar
* source]
glGetShaderiv: [void, GLuint shader, GLenum pname, GLint * params]
glGetString: [const GLubyte *, GLenum name]
glGetTexParameterfv: [void, GLenum target, GLenum pname, GLfloat * params]
glGetTexParameteriv: [void, GLenum target, GLenum pname, GLint * params]
glGetUniformLocation: [GLint, GLuint program, const GLchar * name]
glGetUniformfv: [void, GLuint program, GLint location, GLfloat * params]
glGetUniformiv: [void, GLuint program, GLint location, GLint * params]
glGetVertexAttribPointerv: [void, GLuint index, GLenum pname, GLvoid ** pointer]
glGetVertexAttribfv: [void, GLuint index, GLenum pname, GLfloat * params]
glGetVertexAttribiv: [void, GLuint index, GLenum pname, GLint * params]
glHint: [void, GLenum target, GLenum mode]
glIsBuffer: [GLboolean, GLuint buffer]
glIsEnabled: [GLboolean, GLenum cap]
glIsFramebuffer: [GLboolean, GLuint framebuffer]
glIsProgram: [GLboolean, GLuint program]
glIsRenderbuffer: [GLboolean, GLuint renderbuffer]
glIsShader: [GLboolean, GLuint shader]
glIsTexture: [GLboolean, GLuint texture]
glLineWidth: [void, GLfloat width]
glLinkProgram: [void, GLuint program]
glPixelStorei: [void, GLenum pname, GLint param]
glPolygonOffset: [void, GLfloat factor, GLfloat units]
glReadPixels: [void, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format,
GLenum type, GLvoid * pixels]
glReleaseShaderCompiler: [void]
glRenderbufferStorage: [void, GLenum target, GLenum internalformat, GLsizei width,
GLsizei height]
glSampleCoverage: [void, GLclampf value, GLboolean invert]
glScissor: [void, GLint x, GLint y, GLsizei width, GLsizei height]
glShaderBinary: [void, GLsizei n, const GLuint * shaders, GLenum binaryformat, const
GLvoid * binary, GLsizei length]
glShaderSource: [void, GLuint shader, GLsizei count, const GLchar * const * string,
const GLint * length]
glStencilFunc: [void, GLenum func, GLint ref, GLuint mask]
glStencilFuncSeparate: [void, GLenum face, GLenum func, GLint ref, GLuint mask]
glStencilMask: [void, GLuint mask]
glStencilMaskSeparate: [void, GLenum face, GLuint mask]
glStencilOp: [void, GLenum fail, GLenum zfail, GLenum zpass]
glStencilOpSeparate: [void, GLenum face, GLenum sfail, GLenum zfail, GLenum zpass]
glTexImage2D: [void, GLenum target, GLint level, GLint internalformat, GLsizei width,
GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels]
glTexParameterf: [void, GLenum target, GLenum pname, GLfloat param]
glTexParameterfv: [void, GLenum target, GLenum pname, const GLfloat * params]
glTexParameteri: [void, GLenum target, GLenum pname, GLint param]
glTexParameteriv: [void, GLenum target, GLenum pname, const GLint * params]
glTexSubImage2D: [void, GLenum target, GLint level, GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels]
glUniform1f: [void, GLint location, GLfloat v0]
glUniform1fv: [void, GLint location, GLsizei count, const GLfloat * value]
glUniform1i: [void, GLint location, GLint v0]
glUniform1iv: [void, GLint location, GLsizei count, const GLint * value]
glUniform2f: [void, GLint location, GLfloat v0, GLfloat v1]
glUniform2fv: [void, GLint location, GLsizei count, const GLfloat * value]
glUniform2i: [void, GLint location, GLint v0, GLint v1]
glUniform2iv: [void, GLint location, GLsizei count, const GLint * value]
glUniform3f: [void, GLint location, GLfloat v0, GLfloat v1, GLfloat v2]
glUniform3fv: [void, GLint location, GLsizei count, const GLfloat * value]
glUniform3i: [void, GLint location, GLint v0, GLint v1, GLint v2]
glUniform3iv: [void, GLint location, GLsizei count, const GLint * value]
glUniform4f: [void, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3]
glUniform4fv: [void, GLint location, GLsizei count, const GLfloat * value]
glUniform4i: [void, GLint location, GLint v0, GLint v1, GLint v2, GLint v3]
glUniform4iv: [void, GLint location, GLsizei count, const GLint * value]
glUniformMatrix2fv: [void, GLint location, GLsizei count, GLboolean transpose, const
GLfloat * value]
glUniformMatrix3fv: [void, GLint location, GLsizei count, GLboolean transpose, const
GLfloat * value]
glUniformMatrix4fv: [void, GLint location, GLsizei count, GLboolean transpose, const
GLfloat * value]
glUseProgram: [void, GLuint program]
glValidateProgram: [void, GLuint program]
glVertexAttrib1f: [void, GLuint index, GLfloat x]
glVertexAttrib1fv: [void, GLuint index, const GLfloat * v]
glVertexAttrib2f: [void, GLuint index, GLfloat x, GLfloat y]
glVertexAttrib2fv: [void, GLuint index, const GLfloat * v]
glVertexAttrib3f: [void, GLuint index, GLfloat x, GLfloat y, GLfloat z]
glVertexAttrib3fv: [void, GLuint index, const GLfloat * v]
glVertexAttrib4f: [void, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w]
glVertexAttrib4fv: [void, GLuint index, const GLfloat * v]
glVertexAttribPointer: [void, GLuint index, GLint size, GLenum type, GLboolean normalized,
GLsizei stride, const GLvoid * pointer]
glViewport: [void, GLint x, GLint y, GLsizei width, GLsizei height]

View file

@ -0,0 +1,31 @@
#GLES 1.1 Extensions (might be GLES 2.0 Core)
glBlendColor_OES_: [void, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha]
glBlendEquation_OES_: [void, GLenum mode]
glBlendEquationSeparate_OES_: [void, GLenum modeRGB, GLenum modeA]
glBlendFuncSeparate_OES_: [void, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha]
# glTexGenfOES_OES_: [void, GLenum coord, GLenum pname, GLfloat param]
glTexGenfv_OES_: [void, GLenum coord, GLenum pname, "const GLfloat *params"]
glTexGeni_OES_: [void, GLenum coord, GLenum pname, GLint param]
# glTexGenivOES_OES_: [void, GLenum coord, GLenum pname, "const GLint *params"]
glGenFramebuffers_OES_: [void, GLsizei n, "GLuint *ids"]
glDeleteFramebuffers_OES_: [void, GLsizei n, "GLuint *framebuffers"]
glIsFramebuffer_OES_: [GLboolean, GLuint framebuffer]
glCheckFramebufferStatus_OES_: [GLenum, GLenum target]
glBindFramebuffer_OES_: [void, GLenum target, GLuint framebuffer]
glFramebufferTexture2D_OES_: [void, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level]
glGenRenderbuffers_OES_: [void, GLsizei n, "GLuint *renderbuffers"]
glFramebufferRenderbuffer_OES_: [void, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer]
glDeleteRenderbuffers_OES_: [void, GLsizei n, "GLuint *renderbuffers"]
glRenderbufferStorage_OES_: [void, GLenum target, GLenum internalformat, GLsizei width, GLsizei height]
glBindRenderbuffer_OES_: [void, GLenum target, GLuint renderbuffer]
glIsRenderbuffer_OES_: [GLboolean, GLuint renderbuffer]
glGenerateMipmap_OES_: [void, GLenum target]
glGetFramebufferAttachmentParameteriv_OES_: [void, GLenum target, GLenum attachment, GLenum pname, "GLint *params"]
glGetRenderbufferParameteriv_OES_: [void, GLenum target, GLenum pname, "GLint * params"]
glDrawTexi_OES_: [void, GLint x, GLint y, GLint z, GLint width, GLint height]
glDrawTexf_OES_: [void, GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height]
glMultiDrawArrays_OES_: [void, GLenum mode, "const GLint *first", "const GLsizei *count", GLsizei primcount]
glMultiDrawElements_OES_: [void, GLenum mode, "GLsizei *count", GLenum type, "const void * const *indices", GLsizei primcount]

View file

@ -0,0 +1,93 @@
#GLES 2.0 Core (minus GLES 1.1 core+ext functions)
glAttachShader: [void, GLuint program, GLuint shader]
glBindAttribLocation: [void, GLuint program, GLuint index, const GLchar * name]
glBindBuffer: [void, GLenum target, GLuint buffer]
glBufferData: [void, GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage]
glBufferSubData: [void, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid
* data]
glCompileShader: [void, GLuint shader]
glCreateProgram: [GLuint]
glCreateShader: [GLuint, GLenum type]
glDeleteBuffers: [void, GLsizei n, const GLuint * buffer]
glDeleteProgram: [void, GLuint program]
glDeleteShader: [void, GLuint shader]
glDetachShader: [void, GLuint program, GLuint shader]
glDisableVertexAttribArray: [void, GLuint index]
glEnableVertexAttribArray: [void, GLuint index]
glGenBuffers: [void, GLsizei n, GLuint * buffer]
glGetActiveAttrib: [void, GLuint program, GLuint index, GLsizei bufSize, GLsizei *
length, GLint * size, GLenum * type, GLchar * name]
glGetActiveUniform: [void, GLuint program, GLuint index, GLsizei bufSize, GLsizei
* length, GLint * size, GLenum * type, GLchar * name]
glGetAttachedShaders: [void, GLuint program, GLsizei maxCount, GLsizei * count, GLuint
* obj]
glGetAttribLocation: [GLint, GLuint program, const GLchar * name]
glGetBufferParameteriv: [void, GLenum target, GLenum pname, GLint * params]
glGetProgramInfoLog: [void, GLuint program, GLsizei bufSize, GLsizei * length, GLchar
* infoLog]
glGetProgramiv: [void, GLuint program, GLenum pname, GLint * params]
glGetShaderInfoLog: [void, GLuint shader, GLsizei bufSize, GLsizei * length, GLchar
* infoLog]
glGetShaderPrecisionFormat: [void, GLenum shadertype, GLenum precisiontype, GLint
* range, GLint * precision]
glGetShaderSource: [void, GLuint shader, GLsizei bufSize, GLsizei * length, GLchar
* source]
glGetShaderiv: [void, GLuint shader, GLenum pname, GLint * params]
glGetUniformLocation: [GLint, GLuint program, const GLchar * name]
glGetUniformfv: [void, GLuint program, GLint location, GLfloat * params]
glGetUniformiv: [void, GLuint program, GLint location, GLint * params]
glGetVertexAttribPointerv: [void, GLuint index, GLenum pname, GLvoid ** pointer]
glGetVertexAttribfv: [void, GLuint index, GLenum pname, GLfloat * params]
glGetVertexAttribiv: [void, GLuint index, GLenum pname, GLint * params]
glIsBuffer: [GLboolean, GLuint buffer]
glIsProgram: [GLboolean, GLuint program]
glIsShader: [GLboolean, GLuint shader]
glLinkProgram: [void, GLuint program]
glReleaseShaderCompiler: [void]
glShaderBinary: [void, GLsizei n, const GLuint * shaders, GLenum binaryformat, const
GLvoid * binary, GLsizei length]
glShaderSource: [void, GLuint shader, GLsizei count, const GLchar * const * string,
const GLint * length]
glStencilFuncSeparate: [void, GLenum face, GLenum func, GLint ref, GLuint mask]
glStencilMaskSeparate: [void, GLenum face, GLuint mask]
glStencilOpSeparate: [void, GLenum face, GLenum sfail, GLenum zfail, GLenum zpass]
glUniform1f: [void, GLint location, GLfloat v0]
glUniform1fv: [void, GLint location, GLsizei count, const GLfloat * value]
glUniform1i: [void, GLint location, GLint v0]
glUniform1iv: [void, GLint location, GLsizei count, const GLint * value]
glUniform2f: [void, GLint location, GLfloat v0, GLfloat v1]
glUniform2fv: [void, GLint location, GLsizei count, const GLfloat * value]
glUniform2i: [void, GLint location, GLint v0, GLint v1]
glUniform2iv: [void, GLint location, GLsizei count, const GLint * value]
glUniform3f: [void, GLint location, GLfloat v0, GLfloat v1, GLfloat v2]
glUniform3fv: [void, GLint location, GLsizei count, const GLfloat * value]
glUniform3i: [void, GLint location, GLint v0, GLint v1, GLint v2]
glUniform3iv: [void, GLint location, GLsizei count, const GLint * value]
glUniform4f: [void, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3]
glUniform4fv: [void, GLint location, GLsizei count, const GLfloat * value]
glUniform4i: [void, GLint location, GLint v0, GLint v1, GLint v2, GLint v3]
glUniform4iv: [void, GLint location, GLsizei count, const GLint * value]
glUniformMatrix2fv: [void, GLint location, GLsizei count, GLboolean transpose, const
GLfloat * value]
glUniformMatrix3fv: [void, GLint location, GLsizei count, GLboolean transpose, const
GLfloat * value]
glUniformMatrix4fv: [void, GLint location, GLsizei count, GLboolean transpose, const
GLfloat * value]
glUseProgram: [void, GLuint program]
glValidateProgram: [void, GLuint program]
glVertexAttrib1f: [void, GLuint index, GLfloat x]
glVertexAttrib1fv: [void, GLuint index, const GLfloat * v]
glVertexAttrib2f: [void, GLuint index, GLfloat x, GLfloat y]
glVertexAttrib2fv: [void, GLuint index, const GLfloat * v]
glVertexAttrib3f: [void, GLuint index, GLfloat x, GLfloat y, GLfloat z]
glVertexAttrib3fv: [void, GLuint index, const GLfloat * v]
glVertexAttrib4f: [void, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w]
glVertexAttrib4fv: [void, GLuint index, const GLfloat * v]
glVertexAttribPointer: [void, GLuint index, GLint size, GLenum type, GLboolean normalized,
GLsizei stride, const GLvoid * pointer]
#Other function, probably in no GLES version
glFogCoordf: [void, GLfloat coord]
glFogCoordfv: [void, const GLfloat * coord]
glFogCoordPointer: [void, GLenum type, GLsizei stride, const GLvoid * pointer]

View file

@ -0,0 +1,68 @@
glx:
glXBindHyperpipeSGIX: [int, Display *dpy, int hpId]
glXBindSwapBarrierSGIX: [void, uint32_t window, uint32_t barrier]
glXChangeDrawableAttributes: [void, uint32_t drawable]
glXChangeDrawableAttributesSGIX: [void, uint32_t drawable]
glXClientInfo: [void]
glXCopyContext: [void, uint32_t source, uint32_t dest, uint32_t mask]
glXCreateContext: [void, uint32_t gc_id, uint32_t screen, uint32_t visual, uint32_t
share_list]
glXCreateContextWithConfigSGIX: [void, uint32_t gc_id, uint32_t screen, uint32_t
config, uint32_t share_list]
glXCreateGLXPbufferSGIX: [void, uint32_t config, uint32_t pbuffer]
glXCreateGLXPixmap: [void, uint32_t visual, uint32_t pixmap, uint32_t glxpixmap]
glXCreateGLXPixmapWithConfigSGIX: [void, uint32_t config, uint32_t pixmap, uint32_t
glxpixmap]
glXCreateGLXVideoSourceSGIX: [void, uint32_t dpy, uint32_t screen, uint32_t server,
uint32_t path, uint32_t class, uint32_t node]
glXCreateNewContext: [void, uint32_t config, uint32_t render_type, uint32_t share_list,
uint32_t direct]
glXCreatePbuffer: [void, uint32_t config, uint32_t pbuffer]
glXCreatePixmap: [void, uint32_t config, uint32_t pixmap, uint32_t glxpixmap]
glXCreateWindow: [void, uint32_t config, uint32_t window, uint32_t glxwindow]
glXDestroyContext: [void, uint32_t context]
glXDestroyGLXPbufferSGIX: [void, uint32_t pbuffer]
glXDestroyGLXPixmap: [void, uint32_t pixmap]
glXDestroyGLXVideoSourceSGIX: [void, uint32_t dpy, uint32_t glxvideosource]
glXDestroyHyperpipeConfigSGIX: [int, Display *dpy, int hpId]
glXDestroyPbuffer: [void, uint32_t pbuffer]
glXDestroyPixmap: [void, uint32_t glxpixmap]
glXDestroyWindow: [void, uint32_t glxwindow]
glXGetDrawableAttributes: [void, uint32_t drawable]
glXGetDrawableAttributesSGIX: [void, uint32_t drawable]
glXGetFBConfigs: [void]
glXGetFBConfigsSGIX: [void]
glXGetVisualConfigs: [void]
glXHyperpipeAttribSGIX: [int, Display *dpy, int timeSlice, int attrib, int size,
const void *attribList]
glXHyperpipeConfigSGIX: [int, Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX
cfg, int *hpId]
glXIsDirect: [void, uint32_t dpy, uint32_t context]
glXJoinSwapGroupSGIX: [void, uint32_t window, uint32_t group]
glXMakeContextCurrent: [void, uint32_t drawable, uint32_t readdrawable, uint32_t
context]
glXMakeCurrent: [void, uint32_t drawable, uint32_t context]
glXMakeCurrentReadSGI: [void, uint32_t drawable, uint32_t readdrawable, uint32_t
context]
glXQueryContext: [void]
glXQueryContextInfoEXT: [void]
glXQueryExtensionsString: [void, uint32_t screen]
glXQueryHyperpipeAttribSGIX: [int, Display *dpy, int timeSlice, int attrib, int
size, const void *returnAttribList]
glXQueryHyperpipeBestAttribSGIX: [int, Display *dpy, int timeSlice, int attrib,
int size, const void *attribList, void *returnAttribList]
glXQueryHyperpipeConfigSGIX: [GLXHyperpipeConfigSGIX *, Display *dpy, int hpId,
int *npipes]
glXQueryHyperpipeNetworkSGIX: [GLXHyperpipeNetworkSGIX *, Display *dpy, int *npipes]
glXQueryMaxSwapBarriersSGIX: [void]
glXQueryServerString: [void, uint32_t screen, uint32_t name]
glXQueryVersion: [void, uint32_t *major, uint32_t *minor]
glXRender: [void]
glXRenderLarge: [void]
glXSwapBuffers: [void, uint32_t drawable]
glXSwapIntervalSGI: [void]
glXUseXFont: [void, uint32_t font, uint32_t first, uint32_t count, uint32_t list_base]
glXVendorPrivate: [void]
glXVendorPrivateWithReply: [void]
glXWaitGL: [void, uint32_t context]
glXWaitX: [void]

View file

@ -0,0 +1,178 @@
ARB_create_context:
glXCreateContextAttribsARB: [GLXContext, Display *dpy, GLXFBConfig config, GLXContext
share_context, Bool direct, const int *attrib_list]
ARB_get_proc_address:
glXGetProcAddressARB: [__GLXextFuncPtr, const GLubyte *procName]
EXT_import_context:
glXFreeContextEXT: [void, Display *dpy, GLXContext context]
glXGetContextIDEXT: [GLXContextID, const GLXContext context]
glXGetCurrentDisplayEXT: [Display *]
glXImportContextEXT: [GLXContext, Display *dpy, GLXContextID contextID]
glXQueryContextInfoEXT: [int, Display *dpy, GLXContext context, int attribute, int
*value]
EXT_swap_control:
glXSwapIntervalEXT: [void, Display *dpy, GLXDrawable drawable, int interval]
EXT_texture_from_pixmap:
glXBindTexImageEXT: [void, Display *dpy, GLXDrawable drawable, int buffer, const
int *attrib_list]
glXReleaseTexImageEXT: [void, Display *dpy, GLXDrawable drawable, int buffer]
MESA_agp_offset:
glXGetAGPOffsetMESA: [unsigned int, const void *pointer]
MESA_copy_sub_buffer:
glXCopySubBufferMESA: [void, Display *dpy, GLXDrawable drawable, int x, int y, int
width, int height]
MESA_pixmap_colormap:
glXCreateGLXPixmapMESA: [GLXPixmap, Display *dpy, XVisualInfo *visual, Pixmap pixmap,
Colormap cmap]
MESA_release_buffers:
glXReleaseBuffersMESA: [Bool, Display *dpy, GLXDrawable drawable]
MESA_set_3dfx_mode:
glXSet3DfxModeMESA: [Bool, int mode]
NV_copy_image:
glXCopyImageSubDataNV: [void, Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum
srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx,
GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint
dstZ, GLsizei width, GLsizei height, GLsizei depth]
NV_present_video:
glXBindVideoDeviceNV: [int, Display *dpy, unsigned int video_slot, unsigned int
video_device, const int *attrib_list]
glXEnumerateVideoDevicesNV: [unsigned int *, Display *dpy, int screen, int *nelements]
NV_swap_group:
glXBindSwapBarrierNV: [Bool, Display *dpy, GLuint group, GLuint barrier]
glXJoinSwapGroupNV: [Bool, Display *dpy, GLXDrawable drawable, GLuint group]
glXQueryFrameCountNV: [Bool, Display *dpy, int screen, GLuint *count]
glXQueryMaxSwapGroupsNV: [Bool, Display *dpy, int screen, GLuint *maxGroups, GLuint
*maxBarriers]
glXQuerySwapGroupNV: [Bool, Display *dpy, GLXDrawable drawable, GLuint *group, GLuint
*barrier]
glXResetFrameCountNV: [Bool, Display *dpy, int screen]
NV_video_capture:
glXBindVideoCaptureDeviceNV: [int, Display *dpy, unsigned int video_capture_slot,
GLXVideoCaptureDeviceNV device]
glXEnumerateVideoCaptureDevicesNV: [GLXVideoCaptureDeviceNV *, Display *dpy, int
screen, int *nelements]
glXLockVideoCaptureDeviceNV: [void, Display *dpy, GLXVideoCaptureDeviceNV device]
glXQueryVideoCaptureDeviceNV: [int, Display *dpy, GLXVideoCaptureDeviceNV device,
int attribute, int *value]
glXReleaseVideoCaptureDeviceNV: [void, Display *dpy, GLXVideoCaptureDeviceNV device]
NV_video_output:
glXBindVideoImageNV: [int, Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer
pbuf, int iVideoBuffer]
glXGetVideoDeviceNV: [int, Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV
*pVideoDevice]
glXGetVideoInfoNV: [int, Display *dpy, int screen, GLXVideoDeviceNV VideoDevice,
unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo]
glXReleaseVideoDeviceNV: [int, Display *dpy, int screen, GLXVideoDeviceNV VideoDevice]
glXReleaseVideoImageNV: [int, Display *dpy, GLXPbuffer pbuf]
glXSendPbufferToVideoNV: [int, Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned
long *pulCounterPbuffer, GLboolean bBlock]
OML_sync_control:
glXGetMscRateOML: [Bool, Display *dpy, GLXDrawable drawable, int32_t *numerator,
int32_t *denominator]
glXGetSyncValuesOML: [Bool, Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t
*msc, int64_t *sbc]
glXSwapBuffersMscOML: [int64_t, Display *dpy, GLXDrawable drawable, int64_t target_msc,
int64_t divisor, int64_t remainder]
glXWaitForMscOML: [Bool, Display *dpy, GLXDrawable drawable, int64_t target_msc,
int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc]
glXWaitForSbcOML: [Bool, Display *dpy, GLXDrawable drawable, int64_t target_sbc,
int64_t *ust, int64_t *msc, int64_t *sbc]
SGIX_dmbuffer:
glXAssociateDMPbufferSGIX: [Bool, Display *dpy, GLXPbufferSGIX pbuffer, DMparams
*params, DMbuffer dmbuffer]
SGIX_fbconfig:
glXChooseFBConfigSGIX: [GLXFBConfigSGIX *, Display *dpy, int screen, int *attrib_list,
int *nelements]
glXCreateContextWithConfigSGIX: [GLXContext, Display *dpy, GLXFBConfigSGIX config,
int render_type, GLXContext share_list, Bool direct]
glXCreateGLXPixmapWithConfigSGIX: [GLXPixmap, Display *dpy, GLXFBConfigSGIX config,
Pixmap pixmap]
glXGetFBConfigAttribSGIX: [int, Display *dpy, GLXFBConfigSGIX config, int attribute,
int *value]
glXGetFBConfigFromVisualSGIX: [GLXFBConfigSGIX, Display *dpy, XVisualInfo *vis]
glXGetVisualFromFBConfigSGIX: [XVisualInfo *, Display *dpy, GLXFBConfigSGIX config]
SGIX_hyperpipe:
glXBindHyperpipeSGIX: [int, Display *dpy, int hpId]
glXDestroyHyperpipeConfigSGIX: [int, Display *dpy, int hpId]
glXHyperpipeAttribSGIX: [int, Display *dpy, int timeSlice, int attrib, int size,
void *attribList]
glXHyperpipeConfigSGIX: [int, Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX
*cfg, int *hpId]
glXQueryHyperpipeAttribSGIX: [int, Display *dpy, int timeSlice, int attrib, int
size, void *returnAttribList]
glXQueryHyperpipeBestAttribSGIX: [int, Display *dpy, int timeSlice, int attrib,
int size, void *attribList, void *returnAttribList]
glXQueryHyperpipeConfigSGIX: [GLXHyperpipeConfigSGIX *, Display *dpy, int hpId,
int *npipes]
glXQueryHyperpipeNetworkSGIX: [GLXHyperpipeNetworkSGIX *, Display *dpy, int *npipes]
SGIX_pbuffer:
glXCreateGLXPbufferSGIX: [GLXPbufferSGIX, Display *dpy, GLXFBConfigSGIX config,
unsigned int width, unsigned int height, int *attrib_list]
glXDestroyGLXPbufferSGIX: [void, Display *dpy, GLXPbufferSGIX pbuf]
glXGetSelectedEventSGIX: [void, Display *dpy, GLXDrawable drawable, unsigned long
*mask]
glXQueryGLXPbufferSGIX: [int, Display *dpy, GLXPbufferSGIX pbuf, int attribute,
unsigned int *value]
glXSelectEventSGIX: [void, Display *dpy, GLXDrawable drawable, unsigned long mask]
SGIX_swap_barrier:
glXBindSwapBarrierSGIX: [void, Display *dpy, GLXDrawable drawable, int barrier]
glXQueryMaxSwapBarriersSGIX: [Bool, Display *dpy, int screen, int *max]
SGIX_swap_group:
glXJoinSwapGroupSGIX: [void, Display *dpy, GLXDrawable drawable, GLXDrawable member]
SGIX_video_resize:
glXBindChannelToWindowSGIX: [int, Display *display, int screen, int channel, Window
window]
glXChannelRectSGIX: [int, Display *display, int screen, int channel, int x, int
y, int w, int h]
glXChannelRectSyncSGIX: [int, Display *display, int screen, int channel, GLenum
synctype]
glXQueryChannelDeltasSGIX: [int, Display *display, int screen, int channel, int
*x, int *y, int *w, int *h]
glXQueryChannelRectSGIX: [int, Display *display, int screen, int channel, int *dx,
int *dy, int *dw, int *dh]
SGIX_video_source:
glXCreateGLXVideoSourceSGIX: [GLXVideoSourceSGIX, Display *display, int screen,
VLServer server, VLPath path, int nodeClass, VLNode drainNode]
glXDestroyGLXVideoSourceSGIX: [void, Display *dpy, GLXVideoSourceSGIX glxvideosource]
SGI_cushion:
glXCushionSGI: [void, Display *dpy, Window window, float cushion]
SGI_make_current_read:
glXGetCurrentReadDrawableSGI: [GLXDrawable]
glXMakeCurrentReadSGI: [Bool, Display *dpy, GLXDrawable draw, GLXDrawable read,
GLXContext ctx]
SGI_swap_control:
glXSwapIntervalSGI: [int, int interval]
SGI_video_sync:
glXGetVideoSyncSGI: [int, unsigned int *count]
glXWaitVideoSyncSGI: [int, int divisor, int remainder, unsigned int *count]
SUN_get_transparent_index:
glXGetTransparentIndexSUN: [Status, Display *dpy, Window overlay, Window underlay,
long *pTransparentIndex]
VERSION_1_3:
glXChooseFBConfig: [GLXFBConfig *, Display *dpy, int screen, const int *attrib_list,
int *nelements]
glXCreateNewContext: [GLXContext, Display *dpy, GLXFBConfig config, int render_type,
GLXContext share_list, Bool direct]
glXCreatePbuffer: [GLXPbuffer, Display *dpy, GLXFBConfig config, const int *attrib_list]
glXCreatePixmap: [GLXPixmap, Display *dpy, GLXFBConfig config, Pixmap pixmap, const
int *attrib_list]
glXCreateWindow: [GLXWindow, Display *dpy, GLXFBConfig config, Window win, const
int *attrib_list]
glXDestroyPbuffer: [void, Display *dpy, GLXPbuffer pbuf]
glXDestroyPixmap: [void, Display *dpy, GLXPixmap pixmap]
glXDestroyWindow: [void, Display *dpy, GLXWindow win]
glXGetCurrentDisplay: [Display *]
glXGetCurrentReadDrawable: [GLXDrawable]
glXGetFBConfigAttrib: [int, Display *dpy, GLXFBConfig config, int attribute, int
*value]
glXGetFBConfigs: [GLXFBConfig *, Display *dpy, int screen, int *nelements]
glXGetSelectedEvent: [void, Display *dpy, GLXDrawable draw, unsigned long *event_mask]
glXGetVisualFromFBConfig: [XVisualInfo *, Display *dpy, GLXFBConfig config]
glXMakeContextCurrent: [Bool, Display *dpy, GLXDrawable draw, GLXDrawable read,
GLXContext ctx]
glXQueryContext: [int, Display *dpy, GLXContext ctx, int attribute, int *value]
glXQueryDrawable: [void, Display *dpy, GLXDrawable draw, int attribute, unsigned
int *value]
glXSelectEvent: [void, Display *dpy, GLXDrawable draw, unsigned long event_mask]
VERSION_1_4:
glXGetProcAddress: [__GLXextFuncPtr, const GLubyte *procName]

View file

@ -0,0 +1,76 @@
glx:
glXChooseVisual: [XVisualInfo *, Display *dpy, int screen, int *attribList]
glXBindHyperpipeSGIX: [int, Display *dpy, int hpId]
glXBindSwapBarrierSGIX: [void, uint32_t window, uint32_t barrier]
glXChangeDrawableAttributes: [void, uint32_t drawable]
glXChangeDrawableAttributesSGIX: [void, uint32_t drawable]
glXClientInfo: [void]
glXCopyContext: [void, Display *dpy, GLXContext src, GLXContext dst, unsigned long mask]
glXCreateContext: [GLXContext, Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct]
glXCreateContextAttribsARB: [GLXContext, Display *display, void *config, GLXContext share_context, Bool direct, const int *attrib_list]
glXCreateContextWithConfigSGIX: [void, uint32_t gc_id, uint32_t screen, uint32_t
config, uint32_t share_list]
glXCreateGLXPbufferSGIX: [void, uint32_t config, uint32_t pbuffer]
glXCreateGLXPixmap: [GLXPixmap, Display *dpy, XVisualInfo *visual, Pixmap pixmap]
glXCreateGLXPixmapWithConfigSGIX: [void, uint32_t config, uint32_t pixmap, uint32_t
glxpixmap]
glXCreateGLXVideoSourceSGIX: [void, Display *dpy, uint32_t screen, uint32_t server,
uint32_t path, uint32_t class, uint32_t node]
glXCreateNewContext: [void, uint32_t config, uint32_t render_type, uint32_t share_list,
uint32_t direct]
glXCreatePbuffer: [void, uint32_t config, uint32_t pbuffer]
glXCreatePixmap: [void, uint32_t config, uint32_t pixmap, uint32_t glxpixmap]
glXCreateWindow: [void, uint32_t config, uint32_t window, uint32_t glxwindow]
glXDestroyContext: [void, Display *dpy, GLXContext ctx]
glXDestroyGLXPbufferSGIX: [void, uint32_t pbuffer]
glXDestroyGLXPixmap: [void, Display *dpy, GLXPixmap pixmap]
glXDestroyGLXVideoSourceSGIX: [void, Display *dpy, uint32_t glxvideosource]
glXDestroyHyperpipeConfigSGIX: [int, Display *dpy, int hpId]
glXDestroyPbuffer: [void, uint32_t pbuffer]
glXDestroyPixmap: [void, uint32_t glxpixmap]
glXDestroyWindow: [void, uint32_t glxwindow]
glXGetDrawableAttributes: [void, uint32_t drawable]
glXGetDrawableAttributesSGIX: [void, uint32_t drawable]
glXGetClientString: [const char *, Display *display, int name]
glXGetCurrentContext: [GLXContext]
glXGetCurrentDrawable: [GLXDrawable]
glXGetConfig: [int, Display *display, XVisualInfo *visual, int attribute, int *value]
glXGetFBConfigs: [void]
glXGetFBConfigsSGIX: [void]
glXGetVisualConfigs: [void]
glXHyperpipeAttribSGIX: [int, Display *dpy, int timeSlice, int attrib, int size,
const void *attribList]
glXHyperpipeConfigSGIX: [int, Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX
cfg, int *hpId]
glXIsDirect: [Bool, Display *dpy, GLXContext ctx]
glXJoinSwapGroupSGIX: [void, uint32_t window, uint32_t group]
glXMakeContextCurrent: [void, uint32_t drawable, uint32_t readdrawable, uint32_t
context]
glXMakeCurrent: [Bool, Display *dpy, GLXDrawable drawable, GLXContext ctx]
glXMakeCurrentReadSGI: [void, uint32_t drawable, uint32_t readdrawable, uint32_t
context]
glXQueryContext: [void]
glXQueryContextInfoEXT: [void]
glXQueryExtension: [Bool, Display *display, int *errorBase, int *eventBase]
glXQueryExtensionsString: [const char *, Display *dpy, int screen]
glXQueryHyperpipeAttribSGIX: [int, Display *dpy, int timeSlice, int attrib, int
size, const void *returnAttribList]
glXQueryHyperpipeBestAttribSGIX: [int, Display *dpy, int timeSlice, int attrib,
int size, const void *attribList, void *returnAttribList]
glXQueryHyperpipeConfigSGIX: [GLXHyperpipeConfigSGIX *, Display *dpy, int hpId,
int *npipes]
glXQueryHyperpipeNetworkSGIX: [GLXHyperpipeNetworkSGIX *, Display *dpy, int *npipes]
glXQueryMaxSwapBarriersSGIX: [void]
glXQueryServerString: [const char *, Display *dpy, int screen, int name]
glXQueryVersion: [Bool, Display *dpy, int *maj, int *min]
glXReleaseBuffersMESA: [Bool, Display *dpy, GLXDrawable drawable]
glXRender: [void]
glXRenderLarge: [void]
glXSwapBuffers: [void, Display *dpy, GLXDrawable drawable]
glXSwapIntervalSGI: [void, unsigned int interval]
glXSwapIntervalMESA: [int, unsigned int interval]
glXUseXFont: [void, Font font, int first, int count, int list]
glXVendorPrivate: [void]
glXVendorPrivateWithReply: [void]
glXWaitGL: [void]
glXWaitX: [void]

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,177 @@
3DL_stereo_control:
wglSetStereoEmitterState3DL: [BOOL, HDC hDC, UINT uState]
AMD_gpu_association:
wglBlitContextFramebufferAMD: [VOID, HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint
srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield
mask, GLenum filter]
wglCreateAssociatedContextAMD: [HGLRC, UINT id]
wglCreateAssociatedContextAttribsAMD: [HGLRC, UINT id, HGLRC hShareContext, const
int *attribList]
wglDeleteAssociatedContextAMD: [BOOL, HGLRC hglrc]
wglGetContextGPUIDAMD: [UINT, HGLRC hglrc]
wglGetCurrentAssociatedContextAMD: [HGLRC]
wglGetGPUIDsAMD: [UINT, UINT maxCount, UINT *ids]
wglGetGPUInfoAMD: [INT, UINT id, int property, GLenum dataType, UINT size, void
*data]
wglMakeAssociatedContextCurrentAMD: [BOOL, HGLRC hglrc]
ARB_buffer_region:
wglCreateBufferRegionARB: [HANDLE, HDC hDC, int iLayerPlane, UINT uType]
wglDeleteBufferRegionARB: [VOID, HANDLE hRegion]
wglRestoreBufferRegionARB: [BOOL, HANDLE hRegion, int x, int y, int width, int height,
int xSrc, int ySrc]
wglSaveBufferRegionARB: [BOOL, HANDLE hRegion, int x, int y, int width, int height]
ARB_create_context:
wglCreateContextAttribsARB: [HGLRC, HDC hDC, HGLRC hShareContext, const int *attribList]
ARB_extensions_string:
wglGetExtensionsStringARB: [const char *, HDC hdc]
ARB_make_current_read:
wglGetCurrentReadDCARB: [HDC]
wglMakeContextCurrentARB: [BOOL, HDC hDrawDC, HDC hReadDC, HGLRC hglrc]
ARB_pbuffer:
wglCreatePbufferARB: [HPBUFFERARB, HDC hDC, int iPixelFormat, int iWidth, int iHeight,
const int *piAttribList]
wglDestroyPbufferARB: [BOOL, HPBUFFERARB hPbuffer]
wglGetPbufferDCARB: [HDC, HPBUFFERARB hPbuffer]
wglQueryPbufferARB: [BOOL, HPBUFFERARB hPbuffer, int iAttribute, int *piValue]
wglReleasePbufferDCARB: [int, HPBUFFERARB hPbuffer, HDC hDC]
ARB_pixel_format:
wglChoosePixelFormatARB: [BOOL, HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList,
UINT nMaxFormats, int *piFormats, UINT *nNumFormats]
wglGetPixelFormatAttribfvARB: [BOOL, HDC hdc, int iPixelFormat, int iLayerPlane,
UINT nAttributes, const int *piAttributes, FLOAT *pfValues]
wglGetPixelFormatAttribivARB: [BOOL, HDC hdc, int iPixelFormat, int iLayerPlane,
UINT nAttributes, const int *piAttributes, int *piValues]
ARB_render_texture:
wglBindTexImageARB: [BOOL, HPBUFFERARB hPbuffer, int iBuffer]
wglReleaseTexImageARB: [BOOL, HPBUFFERARB hPbuffer, int iBuffer]
wglSetPbufferAttribARB: [BOOL, HPBUFFERARB hPbuffer, const int *piAttribList]
EXT_display_color_table:
wglBindDisplayColorTableEXT: [GLboolean, GLushort id]
wglCreateDisplayColorTableEXT: [GLboolean, GLushort id]
wglDestroyDisplayColorTableEXT: [VOID, GLushort id]
wglLoadDisplayColorTableEXT: [GLboolean, const GLushort *table, GLuint length]
EXT_extensions_string:
wglGetExtensionsStringEXT: [const char *]
EXT_make_current_read:
wglGetCurrentReadDCEXT: [HDC]
wglMakeContextCurrentEXT: [BOOL, HDC hDrawDC, HDC hReadDC, HGLRC hglrc]
EXT_pbuffer:
wglCreatePbufferEXT: [HPBUFFEREXT, HDC hDC, int iPixelFormat, int iWidth, int iHeight,
const int *piAttribList]
wglDestroyPbufferEXT: [BOOL, HPBUFFEREXT hPbuffer]
wglGetPbufferDCEXT: [HDC, HPBUFFEREXT hPbuffer]
wglQueryPbufferEXT: [BOOL, HPBUFFEREXT hPbuffer, int iAttribute, int *piValue]
wglReleasePbufferDCEXT: [int, HPBUFFEREXT hPbuffer, HDC hDC]
EXT_pixel_format:
wglChoosePixelFormatEXT: [BOOL, HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList,
UINT nMaxFormats, int *piFormats, UINT *nNumFormats]
wglGetPixelFormatAttribfvEXT: [BOOL, HDC hdc, int iPixelFormat, int iLayerPlane,
UINT nAttributes, int *piAttributes, FLOAT *pfValues]
wglGetPixelFormatAttribivEXT: [BOOL, HDC hdc, int iPixelFormat, int iLayerPlane,
UINT nAttributes, int *piAttributes, int *piValues]
EXT_swap_control:
wglGetSwapIntervalEXT: [int]
wglSwapIntervalEXT: [BOOL, int interval]
I3D_digital_video_control:
wglGetDigitalVideoParametersI3D: [BOOL, HDC hDC, int iAttribute, int *piValue]
wglSetDigitalVideoParametersI3D: [BOOL, HDC hDC, int iAttribute, const int *piValue]
I3D_gamma:
wglGetGammaTableI3D: [BOOL, HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen,
USHORT *puBlue]
wglGetGammaTableParametersI3D: [BOOL, HDC hDC, int iAttribute, int *piValue]
wglSetGammaTableI3D: [BOOL, HDC hDC, int iEntries, const USHORT *puRed, const USHORT
*puGreen, const USHORT *puBlue]
wglSetGammaTableParametersI3D: [BOOL, HDC hDC, int iAttribute, const int *piValue]
I3D_genlock:
wglDisableGenlockI3D: [BOOL, HDC hDC]
wglEnableGenlockI3D: [BOOL, HDC hDC]
wglGenlockSampleRateI3D: [BOOL, HDC hDC, UINT uRate]
wglGenlockSourceDelayI3D: [BOOL, HDC hDC, UINT uDelay]
wglGenlockSourceEdgeI3D: [BOOL, HDC hDC, UINT uEdge]
wglGenlockSourceI3D: [BOOL, HDC hDC, UINT uSource]
wglGetGenlockSampleRateI3D: [BOOL, HDC hDC, UINT *uRate]
wglGetGenlockSourceDelayI3D: [BOOL, HDC hDC, UINT *uDelay]
wglGetGenlockSourceEdgeI3D: [BOOL, HDC hDC, UINT *uEdge]
wglGetGenlockSourceI3D: [BOOL, HDC hDC, UINT *uSource]
wglIsEnabledGenlockI3D: [BOOL, HDC hDC, BOOL *pFlag]
wglQueryGenlockMaxSourceDelayI3D: [BOOL, HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay]
I3D_image_buffer:
wglAssociateImageBufferEventsI3D: [BOOL, HDC hDC, const HANDLE *pEvent, const LPVOID
*pAddress, const DWORD *pSize, UINT count]
wglCreateImageBufferI3D: [LPVOID, HDC hDC, DWORD dwSize, UINT uFlags]
wglDestroyImageBufferI3D: [BOOL, HDC hDC, LPVOID pAddress]
wglReleaseImageBufferEventsI3D: [BOOL, HDC hDC, const LPVOID *pAddress, UINT count]
I3D_swap_frame_lock:
wglDisableFrameLockI3D: [BOOL]
wglEnableFrameLockI3D: [BOOL]
wglIsEnabledFrameLockI3D: [BOOL, BOOL *pFlag]
wglQueryFrameLockMasterI3D: [BOOL, BOOL *pFlag]
I3D_swap_frame_usage:
wglBeginFrameTrackingI3D: [BOOL]
wglEndFrameTrackingI3D: [BOOL]
wglGetFrameUsageI3D: [BOOL, float *pUsage]
wglQueryFrameTrackingI3D: [BOOL, DWORD *pFrameCount, DWORD *pMissedFrames, float
*pLastMissedUsage]
NV_DX_interop:
wglDXCloseDeviceNV: [BOOL, HANDLE hDevice]
wglDXLockObjectsNV: [BOOL, HANDLE hDevice, GLint count, HANDLE *hObjects]
wglDXObjectAccessNV: [BOOL, HANDLE hObject, GLenum access]
wglDXOpenDeviceNV: [HANDLE, void *dxDevice]
wglDXRegisterObjectNV: [HANDLE, HANDLE hDevice, void *dxObject, GLuint name, GLenum
type, GLenum access]
wglDXSetResourceShareHandleNV: [BOOL, void *dxObject, HANDLE shareHandle]
wglDXUnlockObjectsNV: [BOOL, HANDLE hDevice, GLint count, HANDLE *hObjects]
wglDXUnregisterObjectNV: [BOOL, HANDLE hDevice, HANDLE hObject]
NV_copy_image:
wglCopyImageSubDataNV: [BOOL, 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]
NV_gpu_affinity:
wglCreateAffinityDCNV: [HDC, const HGPUNV *phGpuList]
wglDeleteDCNV: [BOOL, HDC hdc]
wglEnumGpuDevicesNV: [BOOL, HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice]
wglEnumGpusFromAffinityDCNV: [BOOL, HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu]
wglEnumGpusNV: [BOOL, UINT iGpuIndex, HGPUNV *phGpu]
NV_present_video:
wglBindVideoDeviceNV: [BOOL, HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV
hVideoDevice, const int *piAttribList]
wglEnumerateVideoDevicesNV: [int, HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList]
wglQueryCurrentContextNV: [BOOL, int iAttribute, int *piValue]
NV_swap_group:
wglBindSwapBarrierNV: [BOOL, GLuint group, GLuint barrier]
wglJoinSwapGroupNV: [BOOL, HDC hDC, GLuint group]
wglQueryFrameCountNV: [BOOL, HDC hDC, GLuint *count]
wglQueryMaxSwapGroupsNV: [BOOL, HDC hDC, GLuint *maxGroups, GLuint *maxBarriers]
wglQuerySwapGroupNV: [BOOL, HDC hDC, GLuint *group, GLuint *barrier]
wglResetFrameCountNV: [BOOL, HDC hDC]
NV_vertex_array_range:
wglAllocateMemoryNV: [void *, GLsizei size, GLfloat readfreq, GLfloat writefreq,
GLfloat priority]
wglFreeMemoryNV: [void *, void *pointer]
NV_video_capture:
wglBindVideoCaptureDeviceNV: [BOOL, UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice]
wglEnumerateVideoCaptureDevicesNV: [UINT, HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList]
wglLockVideoCaptureDeviceNV: [BOOL, HDC hDc, HVIDEOINPUTDEVICENV hDevice]
wglQueryVideoCaptureDeviceNV: [BOOL, HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute,
int *piValue]
wglReleaseVideoCaptureDeviceNV: [BOOL, HDC hDc, HVIDEOINPUTDEVICENV hDevice]
NV_video_output:
wglBindVideoImageNV: [BOOL, HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer]
wglGetVideoDeviceNV: [BOOL, HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice]
wglGetVideoInfoNV: [BOOL, HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer,
unsigned long *pulCounterOutputVideo]
wglReleaseVideoDeviceNV: [BOOL, HPVIDEODEV hVideoDevice]
wglReleaseVideoImageNV: [BOOL, HPBUFFERARB hPbuffer, int iVideoBuffer]
wglSendPbufferToVideoNV: [BOOL, HPBUFFERARB hPbuffer, int iBufferType, unsigned
long *pulCounterPbuffer, BOOL bBlock]
OML_sync_control:
wglGetMscRateOML: [BOOL, HDC hdc, INT32 *numerator, INT32 *denominator]
wglGetSyncValuesOML: [BOOL, HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc]
wglSwapBuffersMscOML: [INT64, HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder]
wglSwapLayerBuffersMscOML: [INT64, HDC hdc, int fuPlanes, INT64 target_msc, INT64
divisor, INT64 remainder]
wglWaitForMscOML: [BOOL, HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder,
INT64 *ust, INT64 *msc, INT64 *sbc]
wglWaitForSbcOML: [BOOL, HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64
*sbc]

View file

@ -0,0 +1,191 @@
include_directories(util)
#file(GLOB_RECURSE GL_SOURCES gl/*.c)
SET(GL_SRC
gl/array.c
gl/blit.c
gl/blend.c
gl/buffers.c
gl/build_info.c
gl/debug.c
gl/decompress.c
gl/depth.c
gl/directstate.c
gl/drawing.c
gl/enable.c
gl/eval.c
gl/face.c
gl/fog.c
gl/fpe.c
gl/fpe_shader.c
gl/framebuffers.c
gl/getter.c
gl/gl4es.c
gl/glstate.c
gl/hint.c
gl/init.c
gl/light.c
gl/line.c
gl/list.c
gl/listdraw.c
gl/listrl.c
gl/loader.c
gl/matrix.c
gl/matvec.c
gl/pixel.c
gl/planes.c
gl/pointsprite.c
gl/preproc.c
gl/program.c
gl/queries.c
gl/raster.c
gl/render.c
gl/shader.c
gl/shaderconv.c
gl/stack.c
gl/stencil.c
gl/string_utils.c
gl/stubs.c
gl/texenv.c
gl/texgen.c
gl/texture.c
gl/uniform.c
gl/vertexattrib.c
gl/wrap/gl4es.c
gl/wrap/gles.c
gl/wrap/glstub.c
gl/math/eval.c
)
SET(GL_H
../version.h
gl/array.h
gl/blend.h
gl/blit.h
gl/buffers.h
gl/build_info.h
gl/const.h
gl/debug.h
gl/decompress.h
gl/defines.h
gl/depth.h
gl/directstate.h
gl/eval.h
gl/face.h
gl/fog.h
gl/fpe.h
gl/fpe_shader.h
gl/framebuffers.h
gl/gles.h
gl/gl4es.h
gl/glstate.h
gl/hint.h
gl/init.h
gl/light.h
gl/line.h
gl/list.h
gl/loader.h
gl/logs.h
gl/matrix.h
gl/matvec.h
gl/pixel.h
gl/planes.h
gl/pointsprite.h
gl/preproc.h
gl/program.h
gl/queries.h
gl/raster.h
gl/render.h
gl/shader.h
gl/shaderconv.h
gl/stack.h
gl/state.h
gl/stencil.h
gl/stb_dxt_104.h
gl/string_utils.h
gl/texenv.h
gl/texgen.h
gl/uniform.h
gl/texture.h
gl/vertexattrib.h
gl/math/eval.h
gl/wrap/gl4es.h
gl/wrap/gles.h
gl/wrap/stub.h
)
set_source_files_properties(gl/build_info.c PROPERTIES OBJECT_OUTPUTS "dummy.c")
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
include_directories(glx)
# aux_source_directory(glx GLX_SOURCES)
# list(APPEND GL_SOURCES ${GLX_SOURCES})
list(APPEND GL_SRC
glx/hardext.c
glx/gbm.c
glx/glx.c
glx/lookup.c
glx/rpi.c
glx/streaming.c
glx/utils.c
)
list(APPEND GL_H
glx/glx_gbm.h
glx/gbmfunc.h
glx/drmfunc.h
glx/glx.h
glx/hardext.h
glx/rpi.h
glx/streaming.h
glx/utils.h
)
else()
message(STATUS "Not on Linux: building without GLX support.")
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
include_directories(glx)
list(APPEND GL_SRC
glx/hardext.c
)
endif()
if(AMIGAOS4)
include_directories(agl)
list(APPEND GL_SRC
glx/hardext.c
glx/gbm.c
glx/glx.c
glx/lookup.c
agl/amigaos.c
agl/agl.c
)
list(APPEND GL_H
glx/hardext.h
glx/glx.h
agl/amigaos.h
agl/agl.h
)
endif()
if(STATICLIB)
add_library(GL STATIC ${GL_SRC})
else()
add_library(GL SHARED ${GL_SRC})
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(NOX11)
if(AMIGAOS4)
target_link_libraries(GL m)
else()
target_link_libraries(GL m dl)
endif()
else()
target_link_libraries(GL X11 m dl)
endif()
endif()
if(CMAKE_SHARED_LIBRARY_SUFFIX MATCHES ".so")
set_target_properties(GL PROPERTIES SUFFIX ".so.1")
endif()
endif()

View file

@ -0,0 +1,157 @@
#include "agl.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
//#include <stdarg.h>
#undef __USE_INLINE__
#include <proto/exec.h>
#include <interfaces/ogles2.h>
extern struct OGLES2IFace *IOGLES2;
void* NewGLState(void* shared_glstate, int es2only);
void DeleteGLState(void* oldstate);
void ActivateGLState(void* new_glstate);
void GetHardwareExtensions(int notest);
typedef struct _agl_ctx_glstate {
void* context;
void* glstate;
} agl_ctx_glstate;
static agl_ctx_glstate *agl_context = NULL;
static int agl_context_len = 0;
static int agl_context_cap = 0;
static void* agl_current_ctx = NULL;
// find (or add if not found) a context in the list, and activate glstate...
void agl_context_find(void* ctx) {
if(!ctx)
return;
if(!agl_context) {
agl_context_cap = 10;
agl_context = (agl_ctx_glstate*)malloc(sizeof(agl_ctx_glstate)*agl_context_cap);
memset(agl_context, 0, sizeof(agl_ctx_glstate)*agl_context_cap);
}
int idx = 0;
while (idx<agl_context_len && agl_context[idx].context!=ctx) idx++;
if(idx==agl_context_len) {
agl_context = (agl_ctx_glstate*)realloc(agl_context, sizeof(agl_ctx_glstate)*(agl_context_cap+10));
memset(agl_context+agl_context_cap, 0, sizeof(agl_ctx_glstate)*10);
agl_context_cap+=10;
}
agl_context[idx].context = ctx;
if(idx==agl_context_len) ++agl_context_len;
// create glstate if needed
if(!agl_context[idx].glstate) {
agl_context[idx].glstate = NewGLState(NULL, 0);
// Hardware testing
GetHardwareExtensions(0);
}
ActivateGLState(agl_context[idx].glstate);
}
// remove a context (delete array if size is null)
void agl_context_remove(void* ctx) {
if (!ctx)
return;
if(!agl_context)
return; // empty list?
int idx = 0;
while (idx<agl_context_len && agl_context[idx].context!=ctx) idx++;
if(idx==agl_context_len)
return; // not found...
if(agl_context[idx].glstate) {
DeleteGLState(agl_context[idx].glstate);
agl_context[idx].glstate = NULL;
}
agl_context[idx].context = 0;
// shrink if possible
while(agl_context_len && !agl_context[agl_context_len-1].context) --agl_context_len;
if(!agl_context_len) {
agl_context_cap = 0;
free(agl_context);
agl_context = NULL;
}
}
// AGL functions
void* aglCreateContext(ULONG * errcode, struct TagItem * tags) {
if(IOGLES2)
return IOGLES2->aglCreateContext2(errcode, tags);
return NULL;
}
void* aglCreateContext2(ULONG * errcode, struct TagItem * tags) {
return aglCreateContext(errcode, tags);
}
/*
void* VARARGS68K aglCreateContextTags(ULONG * errcode, ...) {
void* ret = NULL;
if(IOGLES2) {
struct TagItem tags[100];
VA_LIST args;
VA_START(args, errcode);
int i = 0;
do {
struct Tagitem tag = VA_ARG(args, struct TagItem);
tags[i++] = tag;
} while (tag!=TAG_DONE);
VA_END(args);
ret = IOGLES2->aglCreateContext2(errcode, tags);
}
return ret;
}
*/
void aglDestroyContext(void* context) {
if(IOGLES2) {
//bind the context before deleting stuffs.
if(context!=agl_current_ctx)
IOGLES2->aglMakeCurrent(context);
agl_context_remove(context); // remove the associated glstate
if(context!=agl_current_ctx) // rebind old context if needed
IOGLES2->aglMakeCurrent(agl_current_ctx);
IOGLES2->aglDestroyContext(context);
}
}
void aglMakeCurrent(void* context) {
agl_current_ctx = context;
if(IOGLES2) {
IOGLES2->aglMakeCurrent(context);
if (context)
agl_context_find(context); // activate (and create if needed) the correct glstate
}
}
void aglSetParams2(struct TagItem * tags) {
if(IOGLES2) {
return IOGLES2->aglSetParams2(tags);
}
}
void amiga_pre_swap();
void amiga_post_swap();
void aglSwapBuffers() {
amiga_pre_swap();
// Swap the Buffers!
if(IOGLES2) {
IOGLES2->aglSwapBuffers();
}
amiga_post_swap();
}
// what is the use of this function?
void aglSetBitmap(struct BitMap *bitmap) {
if(IOGLES2) {
IOGLES2->aglSetBitmap(bitmap);
}
}
//void* aglGetProcAddress(const char* name); //-> declared in glx/lookup.c

View file

@ -0,0 +1,34 @@
#ifndef _AGL_H_
#define _AGL_H_
#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif
#ifndef EXEC_EXEC_H
#include <exec/exec.h>
#endif
#ifndef EXEC_INTERFACES_H
#include <exec/interfaces.h>
#endif
#ifndef GRAPHICS_GFX_H
#include <graphics/gfx.h>
#endif
#ifndef OGLES2_OGLES2_DEFS_H
// it would be better to have an include with only the CreateContextTags enum difed, to avoid conflict
// of other typedef with full OpenGL header file...
#include <ogles2/ogles2_defs.h>
#endif
void* aglCreateContext(ULONG * errcode, struct TagItem * tags);
void* aglCreateContext2(ULONG * errcode, struct TagItem * tags);
//void* aglCreateContextTags(ULONG * errcode, ...);
void aglDestroyContext(void* context);
void aglMakeCurrent(void* context);
void aglSwapBuffers();
void aglSetParams2(struct TagItem * tags);
void aglSetBitmap(struct BitMap *bitmap);
void* aglGetProcAddress(const char* name);
#endif //_AGL_H_

View file

@ -0,0 +1,798 @@
#include "amigaos.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <proto/exec.h>
// make sure we don't use inline version here
#undef __USE_INLINE__
#include <proto/ogles2.h>
#include <proto/Warp3DNova.h>
#define MIN_W3DNOVA_LIB_VERSION 1
#define MIN_W3DNOVA_LIB_REVISION 62
#define MIN_OGLES2_LIB_VERSION 1
#define MIN_OGLES2_LIB_REVISION 22
struct Library *LOGLES2 = NULL;
struct OGLES2IFace *IOGLES2 = NULL;
// Open OGLES2 library and interface
void os4OpenLib(void** lib)
{
// first check version for Warp3DNova lib
struct Library *Warp3DNovaBase = NULL;
Warp3DNovaBase = IExec->OpenLibrary("Warp3DNova.library", MIN_W3DNOVA_LIB_VERSION);
if(!Warp3DNovaBase) {
printf("LIBGL: Error, cannot open Warp3DNova.library!\n");
return;
}
printf("LIBGL: Using Warp3DNova.library v%d revision %d\n", Warp3DNovaBase->lib_Version, Warp3DNovaBase->lib_Revision);
if (!(Warp3DNovaBase->lib_Version > MIN_W3DNOVA_LIB_VERSION || (Warp3DNovaBase->lib_Version == MIN_W3DNOVA_LIB_VERSION && Warp3DNovaBase->lib_Revision >= MIN_W3DNOVA_LIB_REVISION))) {
printf("LIBGL: Warning, your Warp3DNovaBase.library is too old, minimum is v%d.%d, please update!\n", MIN_W3DNOVA_LIB_VERSION,MIN_W3DNOVA_LIB_REVISION);
}
//close warp3dnova.library, we open it just for version check
IExec->CloseLibrary(Warp3DNovaBase);
Warp3DNovaBase = NULL;
LOGLES2 = IExec->OpenLibrary("ogles2.library", MIN_OGLES2_LIB_VERSION);
if(!LOGLES2) {
printf("LIBGL: Error, cannot open ogles2 Library!\n");
return;
}
printf("LIBGL: Using OGLES2.library v%d revision %d\n", LOGLES2->lib_Version, LOGLES2->lib_Revision);
if (!(LOGLES2->lib_Version > MIN_OGLES2_LIB_VERSION || (LOGLES2->lib_Version == MIN_OGLES2_LIB_VERSION && LOGLES2->lib_Revision >= MIN_OGLES2_LIB_REVISION))) {
printf("LIBGL: Warning, your OGLES2.library is too old, minimum is v%d.%d, please update!\n", MIN_OGLES2_LIB_VERSION,MIN_OGLES2_LIB_REVISION);
}
IOGLES2 = (struct OGLES2IFace *)IExec->GetInterface(LOGLES2, "main", 1, NULL);
if(!IOGLES2) {
printf("LIBGL: Warning, cannot open ogles2 Interface!\n");
IExec->CloseLibrary(LOGLES2);
LOGLES2 = NULL;
return;
}
*lib = LOGLES2;
// small debug message, always helpfull at beggining
printf("LIBGL: OGLES2 Library and Interface open successfuly\n");
}
// Close OGLES2 lib and interface
void os4CloseLib()
{
if(IOGLES2) {
IExec->DropInterface((struct Interface*)IOGLES2);
IOGLES2 = NULL;
}
if(LOGLES2) {
IExec->CloseLibrary(LOGLES2);
LOGLES2 = NULL;
}
printf("LIBGL: OGLES2 Library and Interface closed\n");
}
static void AmiglActiveTexture (GLenum texture) {
return IOGLES2->glActiveTexture(texture);
}
static void AmiglAttachShader (GLuint program, GLuint shader) {
return IOGLES2->glAttachShader(program, shader);
}
static void AmiglBindAttribLocation (GLuint program, GLuint index, const GLchar *name) {
return IOGLES2->glBindAttribLocation(program, index, name);
}
static void AmiglBindBuffer (GLenum target, GLuint buffer) {
return IOGLES2->glBindBuffer(target, buffer);
}
static void AmiglBindFramebuffer (GLenum target, GLuint framebuffer) {
return IOGLES2->glBindFramebuffer(target, framebuffer);
}
static void AmiglBindRenderbuffer (GLenum target, GLuint renderbuffer) {
return IOGLES2->glBindRenderbuffer(target, renderbuffer);
}
static void AmiglBindTexture (GLenum target, GLuint texture) {
return IOGLES2->glBindTexture(target, texture);
}
static void AmiglBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
return IOGLES2->glBlendColor(red, green, blue, alpha);
}
static void AmiglBlendEquation (GLenum mode) {
return IOGLES2->glBlendEquation(mode);
}
static void AmiglBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha) {
return IOGLES2->glBlendEquationSeparate(modeRGB, modeAlpha);
}
static void AmiglBlendFunc (GLenum sfactor, GLenum dfactor) {
return IOGLES2->glBlendFunc(sfactor, dfactor);
}
static void AmiglBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) {
return IOGLES2->glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
}
static void AmiglBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage) {
return IOGLES2->glBufferData(target, size, data, usage);
}
static void AmiglBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data) {
return IOGLES2->glBufferSubData(target, offset, size, data);
}
static GLenum AmiglCheckFramebufferStatus (GLenum target) {
return IOGLES2->glCheckFramebufferStatus(target);
}
static void AmiglClear (GLbitfield mask) {
return IOGLES2->glClear(mask);
}
static void AmiglClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
return IOGLES2->glClearColor(red, green, blue, alpha);
}
static void AmiglClearDepthf (GLfloat d) {
return IOGLES2->glClearDepthf(d);
}
static void AmiglClearStencil (GLint s) {
return IOGLES2->glClearStencil(s);
}
static void AmiglColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
return IOGLES2->glColorMask(red, green, blue, alpha);
}
static void AmiglCompileShader (GLuint shader) {
return IOGLES2->glCompileShader(shader);
}
static void AmiglCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data) {
return IOGLES2->glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
}
static void AmiglCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data) {
return IOGLES2->glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
}
static void AmiglCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
return IOGLES2->glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
}
static void AmiglCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
return IOGLES2->glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
}
static GLuint AmiglCreateProgram (void) {
return IOGLES2->glCreateProgram();
}
static GLuint AmiglCreateShader (GLenum type) {
return IOGLES2->glCreateShader(type);
}
static void AmiglCullFace (GLenum mode) {
return IOGLES2->glCullFace(mode);
}
static void AmiglDeleteBuffers (GLsizei n, const GLuint *buffers) {
return IOGLES2->glDeleteBuffers(n, buffers);
}
static void AmiglDeleteFramebuffers (GLsizei n, const GLuint *framebuffers) {
return IOGLES2->glDeleteFramebuffers(n, framebuffers);
}
static void AmiglDeleteProgram (GLuint program) {
return IOGLES2->glDeleteProgram(program);
}
static void AmiglDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers) {
return IOGLES2->glDeleteRenderbuffers(n, renderbuffers);
}
static void AmiglDeleteShader (GLuint shader) {
return IOGLES2->glDeleteShader(shader);
}
static void AmiglDeleteTextures (GLsizei n, const GLuint *textures) {
return IOGLES2->glDeleteTextures(n, textures);
}
static void AmiglDepthFunc (GLenum func) {
return IOGLES2->glDepthFunc(func);
}
static void AmiglDepthMask (GLboolean flag) {
return IOGLES2->glDepthMask(flag);
}
static void AmiglDepthRangef (GLfloat n, GLfloat f) {
return IOGLES2->glDepthRangef(n, f);
}
static void AmiglDetachShader (GLuint program, GLuint shader) {
return IOGLES2->glDetachShader(program, shader);
}
static void AmiglDisable (GLenum cap) {
return IOGLES2->glDisable(cap);
}
static void AmiglDisableVertexAttribArray (GLuint index) {
return IOGLES2->glDisableVertexAttribArray(index);
}
static void AmiglDrawArrays (GLenum mode, GLint first, GLsizei count) {
return IOGLES2->glDrawArrays(mode, first, count);
}
static void AmiglDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices) {
return IOGLES2->glDrawElements(mode, count, type, indices);
}
static void AmiglEnable (GLenum cap) {
return IOGLES2->glEnable(cap);
}
static void AmiglEnableVertexAttribArray (GLuint index) {
return IOGLES2->glEnableVertexAttribArray(index);
}
static void AmiglFinish (void) {
return IOGLES2->glFinish();
}
static void AmiglFlush (void) {
return IOGLES2->glFlush();
}
static void AmiglFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
return IOGLES2->glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
}
static void AmiglFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
return IOGLES2->glFramebufferTexture2D(target, attachment, textarget, texture, level);
}
static void AmiglFrontFace (GLenum mode) {
return IOGLES2->glFrontFace(mode);
}
static void AmiglGenBuffers (GLsizei n, GLuint *buffers) {
return IOGLES2->glGenBuffers(n, buffers);
}
static void AmiglGenerateMipmap (GLenum target) {
return IOGLES2->glGenerateMipmap(target);
}
static void AmiglGenFramebuffers (GLsizei n, GLuint *framebuffers) {
return IOGLES2->glGenFramebuffers(n, framebuffers);
}
static void AmiglGenRenderbuffers (GLsizei n, GLuint *renderbuffers) {
return IOGLES2->glGenRenderbuffers(n, renderbuffers);
}
static void AmiglGenTextures (GLsizei n, GLuint *textures) {
return IOGLES2->glGenTextures(n, textures);
}
static void AmiglGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name) {
return IOGLES2->glGetActiveAttrib(program, index, bufSize, length, size, type, name);
}
static void AmiglGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name) {
return IOGLES2->glGetActiveUniform(program, index, bufSize, length, size, type, name);
}
static void AmiglGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders) {
return IOGLES2->glGetAttachedShaders(program, maxCount, count, shaders);
}
static GLint AmiglGetAttribLocation (GLuint program, const GLchar *name) {
return IOGLES2->glGetAttribLocation(program, name);
}
static void AmiglGetBooleanv (GLenum pname, GLboolean *data) {
return IOGLES2->glGetBooleanv(pname, data);
}
static void AmiglGetBufferParameteriv (GLenum target, GLenum pname, GLint *params) {
return IOGLES2->glGetBufferParameteriv(target, pname, params);
}
static GLenum AmiglGetError (void) {
return IOGLES2->glGetError();
}
static void AmiglGetFloatv (GLenum pname, GLfloat *data) {
return IOGLES2->glGetFloatv(pname, data);
}
static void AmiglGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params) {
return IOGLES2->glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
}
static void AmiglGetIntegerv (GLenum pname, GLint *data) {
return IOGLES2->glGetIntegerv(pname, data);
}
static void AmiglGetProgramiv (GLuint program, GLenum pname, GLint *params) {
return IOGLES2->glGetProgramiv(program, pname, params);
}
static void AmiglGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog) {
return IOGLES2->glGetProgramInfoLog(program, bufSize, length, infoLog);
}
static void AmiglGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params) {
return IOGLES2->glGetRenderbufferParameteriv(target, pname, params);
}
static void AmiglGetShaderiv (GLuint shader, GLenum pname, GLint *params) {
return IOGLES2->glGetShaderiv(shader, pname, params);
}
static void AmiglGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog) {
return IOGLES2->glGetShaderInfoLog(shader, bufSize, length, infoLog);
}
static void AmiglGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision) {
return IOGLES2->glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
}
static void AmiglGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source) {
return IOGLES2->glGetShaderSource(shader, bufSize, length, source);
}
static const GLubyte *AmiglGetString (GLenum name) {
return IOGLES2->glGetString(name);
}
static void AmiglGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params) {
return IOGLES2->glGetTexParameterfv(target, pname, params);
}
static void AmiglGetTexParameteriv (GLenum target, GLenum pname, GLint *params) {
return IOGLES2->glGetTexParameteriv(target, pname, params);
}
static void AmiglGetUniformfv (GLuint program, GLint location, GLfloat *params) {
return IOGLES2->glGetUniformfv(program, location, params);
}
static void AmiglGetUniformiv (GLuint program, GLint location, GLint *params) {
return IOGLES2->glGetUniformiv(program, location, params);
}
static GLint AmiglGetUniformLocation (GLuint program, const GLchar *name) {
return IOGLES2->glGetUniformLocation(program, name);
}
static void AmiglGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params) {
return IOGLES2->glGetVertexAttribfv(index, pname, params);
}
static void AmiglGetVertexAttribiv (GLuint index, GLenum pname, GLint *params) {
return IOGLES2->glGetVertexAttribiv(index, pname, params);
}
static void AmiglGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer) {
return IOGLES2->glGetVertexAttribPointerv(index, pname, pointer);
}
static void AmiglHint (GLenum target, GLenum mode) {
return IOGLES2->glHint(target, mode);
}
static GLboolean AmiglIsBuffer (GLuint buffer) {
return IOGLES2->glIsBuffer(buffer);
}
static GLboolean AmiglIsEnabled (GLenum cap) {
return IOGLES2->glIsEnabled(cap);
}
static GLboolean AmiglIsFramebuffer (GLuint framebuffer) {
return IOGLES2->glIsFramebuffer(framebuffer);
}
static GLboolean AmiglIsProgram (GLuint program) {
return IOGLES2->glIsProgram(program);
}
static GLboolean AmiglIsRenderbuffer (GLuint renderbuffer) {
return IOGLES2->glIsRenderbuffer(renderbuffer);
}
static GLboolean AmiglIsShader (GLuint shader) {
return IOGLES2->glIsShader(shader);
}
static GLboolean AmiglIsTexture (GLuint texture) {
return IOGLES2->glIsTexture(texture);
}
static void AmiglLineWidth (GLfloat width) {
return IOGLES2->glLineWidth(width);
}
static void AmiglLinkProgram (GLuint program) {
return IOGLES2->glLinkProgram(program);
}
static void AmiglPixelStorei (GLenum pname, GLint param) {
return IOGLES2->glPixelStorei(pname, param);
}
static void AmiglPolygonOffset (GLfloat factor, GLfloat units) {
return IOGLES2->glPolygonOffset(factor, units);
}
static void AmiglReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels) {
return IOGLES2->glReadPixels(x, y, width, height, format, type, pixels);
}
static void AmiglReleaseShaderCompiler (void) {
return IOGLES2->glReleaseShaderCompiler();
}
static void AmiglRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
return IOGLES2->glRenderbufferStorage(target, internalformat, width, height);
}
static void AmiglSampleCoverage (GLfloat value, GLboolean invert) {
return IOGLES2->glSampleCoverage(value, invert);
}
static void AmiglScissor (GLint x, GLint y, GLsizei width, GLsizei height) {
return IOGLES2->glScissor(x, y, width, height);
}
static void AmiglShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length) {
return IOGLES2->glShaderBinary(count, shaders, binaryformat, binary, length);
}
static void AmiglShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length) {
return IOGLES2->glShaderSource(shader, count, string, length);
}
static void AmiglStencilFunc (GLenum func, GLint ref, GLuint mask) {
return IOGLES2->glStencilFunc(func, ref, mask);
}
static void AmiglStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask) {
return IOGLES2->glStencilFuncSeparate(face, func, ref, mask);
}
static void AmiglStencilMask (GLuint mask) {
return IOGLES2->glStencilMask(mask);
}
static void AmiglStencilMaskSeparate (GLenum face, GLuint mask) {
return IOGLES2->glStencilMaskSeparate(face, mask);
}
static void AmiglStencilOp (GLenum fail, GLenum zfail, GLenum zpass) {
return IOGLES2->glStencilOp(fail, zfail, zpass);
}
static void AmiglStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) {
return IOGLES2->glStencilOpSeparate(face, sfail, dpfail, dppass);
}
static void AmiglTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels) {
return IOGLES2->glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
}
static void AmiglTexParameterf (GLenum target, GLenum pname, GLfloat param) {
return IOGLES2->glTexParameterf(target, pname, param);
}
static void AmiglTexParameterfv (GLenum target, GLenum pname, const GLfloat *params) {
return IOGLES2->glTexParameterfv(target, pname, params);
}
static void AmiglTexParameteri (GLenum target, GLenum pname, GLint param) {
return IOGLES2->glTexParameteri(target, pname, param);
}
static void AmiglTexParameteriv (GLenum target, GLenum pname, const GLint *params) {
return IOGLES2->glTexParameteriv(target, pname, params);
}
static void AmiglTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels) {
return IOGLES2->glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
}
static void AmiglUniform1f (GLint location, GLfloat v0) {
return IOGLES2->glUniform1f(location, v0);
}
static void AmiglUniform1fv (GLint location, GLsizei count, const GLfloat *value) {
return IOGLES2->glUniform1fv(location, count, value);
}
static void AmiglUniform1i (GLint location, GLint v0) {
return IOGLES2->glUniform1i(location, v0);
}
static void AmiglUniform1iv (GLint location, GLsizei count, const GLint *value) {
return IOGLES2->glUniform1iv(location, count, value);
}
static void AmiglUniform2f (GLint location, GLfloat v0, GLfloat v1) {
return IOGLES2->glUniform2f(location, v0, v1);
}
static void AmiglUniform2fv (GLint location, GLsizei count, const GLfloat *value) {
return IOGLES2->glUniform2fv(location, count, value);
}
static void AmiglUniform2i (GLint location, GLint v0, GLint v1) {
return IOGLES2->glUniform2i(location, v0, v1);
}
static void AmiglUniform2iv (GLint location, GLsizei count, const GLint *value) {
return IOGLES2->glUniform2iv(location, count, value);
}
static void AmiglUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {
return IOGLES2->glUniform3f(location, v0, v1, v2);
}
static void AmiglUniform3fv (GLint location, GLsizei count, const GLfloat *value) {
return IOGLES2->glUniform3fv(location, count, value);
}
static void AmiglUniform3i (GLint location, GLint v0, GLint v1, GLint v2) {
return IOGLES2->glUniform3i(location, v0, v1, v2);
}
static void AmiglUniform3iv (GLint location, GLsizei count, const GLint *value) {
return IOGLES2->glUniform3iv(location, count, value);
}
static void AmiglUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {
return IOGLES2->glUniform4f(location, v0, v1, v2, v3);
}
static void AmiglUniform4fv (GLint location, GLsizei count, const GLfloat *value) {
return IOGLES2->glUniform4fv(location, count, value);
}
static void AmiglUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {
return IOGLES2->glUniform4i(location, v0, v1, v2, v3);
}
static void AmiglUniform4iv (GLint location, GLsizei count, const GLint *value) {
return IOGLES2->glUniform4iv(location, count, value);
}
static void AmiglUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
return IOGLES2->glUniformMatrix2fv(location, count, transpose, value);
}
static void AmiglUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
return IOGLES2->glUniformMatrix3fv(location, count, transpose, value);
}
static void AmiglUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
return IOGLES2->glUniformMatrix4fv(location, count, transpose, value);
}
static void AmiglUseProgram (GLuint program) {
return IOGLES2->glUseProgram(program);
}
static void AmiglValidateProgram (GLuint program) {
return IOGLES2->glValidateProgram(program);
}
static void AmiglVertexAttrib1f (GLuint index, GLfloat x) {
return IOGLES2->glVertexAttrib1f(index, x);
}
static void AmiglVertexAttrib1fv (GLuint index, const GLfloat *v) {
return IOGLES2->glVertexAttrib1fv(index, v);
}
static void AmiglVertexAttrib2f (GLuint index, GLfloat x, GLfloat y) {
return IOGLES2->glVertexAttrib2f(index, x, y);
}
static void AmiglVertexAttrib2fv (GLuint index, const GLfloat *v) {
return IOGLES2->glVertexAttrib2fv(index, v);
}
static void AmiglVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z) {
return IOGLES2->glVertexAttrib3f(index, x, y, z);
}
static void AmiglVertexAttrib3fv (GLuint index, const GLfloat *v) {
return IOGLES2->glVertexAttrib3fv(index, v);
}
static void AmiglVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
return IOGLES2->glVertexAttrib4f(index, x, y, z, w);
}
static void AmiglVertexAttrib4fv (GLuint index, const GLfloat *v) {
return IOGLES2->glVertexAttrib4fv(index, v);
}
static void AmiglVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer) {
return IOGLES2->glVertexAttribPointer(index, size, type, normalized, stride, pointer);
}
static void AmiglViewport (GLint x, GLint y, GLsizei width, GLsizei height) {
return IOGLES2->glViewport(x, y, width, height);
}
// Using glXXX name, return the function pointer of that function in ogles2 library
#define MAP(func_name, func) \
if (strcmp(name, func_name) == 0) return (void *)Ami##func;
#define EX(func_name) MAP(#func_name, func_name)
void* os4GetProcAddress(const char* name)
{
if(!IOGLES2)
return NULL;
// All GL functions from OGLES2 drivers
EX(glActiveTexture)
EX(glAttachShader)
EX(glBindAttribLocation)
EX(glBindBuffer)
EX(glBindFramebuffer)
EX(glBindRenderbuffer)
EX(glBindTexture)
EX(glBlendColor)
EX(glBlendEquation)
EX(glBlendEquationSeparate)
EX(glBlendFunc)
EX(glBlendFuncSeparate)
EX(glBufferData)
EX(glBufferSubData)
EX(glCheckFramebufferStatus)
EX(glClear)
EX(glClearColor)
EX(glClearDepthf)
EX(glClearStencil)
EX(glColorMask)
EX(glCompileShader)
EX(glCompressedTexImage2D)
EX(glCompressedTexSubImage2D)
EX(glCopyTexImage2D)
EX(glCopyTexSubImage2D)
EX(glCreateProgram)
EX(glCreateShader)
EX(glCullFace)
EX(glDeleteBuffers)
EX(glDeleteFramebuffers)
EX(glDeleteProgram)
EX(glDeleteRenderbuffers)
EX(glDeleteShader)
EX(glDeleteTextures)
EX(glDepthFunc)
EX(glDepthMask)
EX(glDepthRangef)
EX(glDetachShader)
EX(glDisable)
EX(glDisableVertexAttribArray)
EX(glDrawArrays)
EX(glDrawElements)
EX(glEnable)
EX(glEnableVertexAttribArray)
EX(glFinish)
EX(glFlush)
EX(glFramebufferRenderbuffer)
EX(glFramebufferTexture2D)
EX(glFrontFace)
EX(glGenBuffers)
EX(glGenerateMipmap)
EX(glGenFramebuffers)
EX(glGenRenderbuffers)
EX(glGenTextures)
EX(glGetActiveAttrib)
EX(glGetActiveUniform)
EX(glGetAttachedShaders)
EX(glGetAttribLocation)
EX(glGetBooleanv)
EX(glGetBufferParameteriv)
EX(glGetError)
EX(glGetFloatv)
EX(glGetFramebufferAttachmentParameteriv)
EX(glGetIntegerv)
EX(glGetProgramiv)
EX(glGetProgramInfoLog)
EX(glGetRenderbufferParameteriv)
EX(glGetShaderiv)
EX(glGetShaderInfoLog)
EX(glGetShaderPrecisionFormat)
EX(glGetShaderSource)
EX(glGetString)
EX(glGetTexParameterfv)
EX(glGetTexParameteriv)
EX(glGetUniformfv)
EX(glGetUniformiv)
EX(glGetUniformLocation)
EX(glGetVertexAttribfv)
EX(glGetVertexAttribiv)
EX(glGetVertexAttribPointerv)
EX(glHint)
EX(glIsBuffer)
EX(glIsEnabled)
EX(glIsFramebuffer)
EX(glIsProgram)
EX(glIsRenderbuffer)
EX(glIsShader)
EX(glIsTexture)
EX(glLineWidth)
EX(glLinkProgram)
EX(glPixelStorei)
EX(glPolygonOffset)
EX(glReadPixels)
EX(glReleaseShaderCompiler)
EX(glRenderbufferStorage)
EX(glSampleCoverage)
EX(glScissor)
EX(glShaderBinary)
EX(glShaderSource)
EX(glStencilFunc)
EX(glStencilFuncSeparate)
EX(glStencilMask)
EX(glStencilMaskSeparate)
EX(glStencilOp)
EX(glStencilOpSeparate)
EX(glTexImage2D)
EX(glTexParameterf)
EX(glTexParameterfv)
EX(glTexParameteri)
EX(glTexParameteriv)
EX(glTexSubImage2D)
EX(glUniform1f)
EX(glUniform1fv)
EX(glUniform1i)
EX(glUniform1iv)
EX(glUniform2f)
EX(glUniform2fv)
EX(glUniform2i)
EX(glUniform2iv)
EX(glUniform3f)
EX(glUniform3fv)
EX(glUniform3i)
EX(glUniform3iv)
EX(glUniform4f)
EX(glUniform4fv)
EX(glUniform4i)
EX(glUniform4iv)
EX(glUniformMatrix2fv)
EX(glUniformMatrix3fv)
EX(glUniformMatrix4fv)
EX(glUseProgram)
EX(glValidateProgram)
EX(glVertexAttrib1f)
EX(glVertexAttrib1fv)
EX(glVertexAttrib2f)
EX(glVertexAttrib2fv)
EX(glVertexAttrib3f)
EX(glVertexAttrib3fv)
EX(glVertexAttrib4f)
EX(glVertexAttrib4fv)
EX(glVertexAttribPointer)
EX(glViewport)
//EX(glPolygonMode) //This is a non-standard function, and gl4es will ignore it (and emulate it), even if Amiga OGLES2 driver implement it
return NULL;
}

View file

@ -0,0 +1,9 @@
#ifndef _AMIGAOS_H_
#define _AMIGAOS_H_
void* os4GetProcAddress(const char* name);
void os4OpenLib(void** lib);
void os4CloseLib();
#endif //_AMIGAOS_H_

View file

@ -0,0 +1,16 @@
#ifndef _GL4ES_MAIN_CONFIG_H
#define _GL4ES_MAIN_CONFIG_H
#define SYS_proxy 9999
#define MAX_EVAL_ORDER 30
#define MAX_TEX 8
#define MAX_LIGHT 8
#define MAX_STACK_PROJECTION 16
#define MAX_STACK_TEXTURE 16
#define MAX_STACK_MODELVIEW 64
#define MAX_STACK_COLOR 16
#define MAX_CLIP_PLANES 6
#define MAX_VATTRIB 32
#define MAX_MAP_SIZE 256
#endif // _GL4ES_MAIN_CONFIG_H

View file

@ -0,0 +1,469 @@
#include "array.h"
#include "debug.h"
#include "enum_info.h"
#include "glcase.h"
#include "light.h"
#include "state.h"
GLvoid *copy_gl_array(const GLvoid *src,
GLenum from, GLsizei width, GLsizei stride,
GLenum to, GLsizei to_width, GLsizei skip, GLsizei count) {
if (! src || !count)
return NULL;
if (! stride)
stride = width * gl_sizeof(from);
const char *unknown_str = "LIBGL: copy_gl_array -> unknown type: %x\n";
GLvoid *dst = malloc((count-skip) * to_width * gl_sizeof(to));
GLsizei from_size = gl_sizeof(from) * width;
if (to_width < width) {
/* printf("Warning: copy_gl_array: %i < %i\n", to_width, width);
return NULL;*/
width = to_width;
}
// quick path if just copying same to same and no specific stride involved
if(stride == (to_width*gl_sizeof(to)) && width==to_width && from==to) {
memcpy(dst, (char*)src + stride*skip, (count-skip) * to_width * gl_sizeof(to));
return dst;
}
// if stride is weird, we need to be able to arbitrarily shift src
// so we leave it in a uintptr_t and cast after incrementing
uintptr_t in = (uintptr_t)src;
in += stride*skip;
if (from == to && to_width >= width) {
GL_TYPE_SWITCH(out, dst, to,
for (int i = skip; i < count; i++) {
memcpy(out, (GLvoid *)in, from_size);
for (int j = width; j < to_width; j++) {
out[j] = 0;
}
out += to_width;
in += stride;
},
default:
printf(unknown_str, from);
return NULL;
)
} else {
GL_TYPE_SWITCH(out, dst, to,
for (int i = skip; i < count; i++) {
GL_TYPE_SWITCH(input, in, from,
for (int j = 0; j < width; j++) {
out[j] = input[j];
}
for (int j = width; j < to_width; j++) {
out[j] = 0;
}
out += to_width;
in += stride;
,
default:
printf(unknown_str, from);
return NULL;
)
},
default:
printf(unknown_str, to);
return NULL;
)
}
return dst;
}
GLvoid *copy_gl_array_texcoord(const GLvoid *src,
GLenum from, GLsizei width, GLsizei stride,
GLenum to, GLsizei to_width, GLsizei skip, GLsizei count, GLvoid* filler, void* dest) {
if (! src || !count)
return NULL;
if (! stride)
stride = width * gl_sizeof(from);
const char *unknown_str = "LIBGL: copy_gl_array -> unknown type: %x\n";
GLvoid *dst = (dest)?dest:malloc((count-skip) * to_width * gl_sizeof(to));
GLsizei from_size = gl_sizeof(from) * width;
GLsizei to_elem = gl_sizeof(to);
uintptr_t in = (uintptr_t)src;
in += stride*skip;
if (from == to && to_width >= width) {
GL_TYPE_SWITCH(out, dst, to,
for (int i = skip; i < count; i++) {
memcpy(out, (GLvoid *)in, from_size);
for (int j = width; j < to_width; j++) {
if(j==to_width-1)
memcpy(out+j, filler, to_elem);
else
out[j] = 0;
}
out += to_width;
in += stride;
},
default:
printf(unknown_str, from);
return NULL;
)
} else {
GL_TYPE_SWITCH(out, dst, to,
for (int i = skip; i < count; i++) {
GL_TYPE_SWITCH(input, in, from,
for (int j = 0; j < width; j++) {
out[j] = input[j];
}
for (int j = width; j < to_width; j++) {
if(j==3)
memcpy(out+j, filler, to_elem);
else
out[j] = 0;
}
out += to_width;
in += stride;
,
default:
printf(unknown_str, from);
return NULL;
)
},
default:
printf(unknown_str, to);
return NULL;
)
}
return dst;
}
GLvoid *copy_gl_array_quickconvert(const GLvoid *src,
GLenum from, GLsizei stride,
GLsizei skip, GLsizei count) {
if (! stride)
stride = 4 * gl_sizeof(from);
const char *unknown_str = "LIBGL: copy_gl_array_quickconvert -> unknown type: %x\n";
GLvoid *dst = malloc((count-skip) * 4 * gl_sizeof(GL_FLOAT));
uintptr_t in = (uintptr_t)src;
in += stride*skip;
int j;
GLfloat *out = (GLfloat*)dst;
GL_TYPE_SWITCH2(input, in, from,
const GLfloat maxf = 1.0f/gl_max_value(from);
for (int i = skip; i < count; i++)
,
for (j = 0; j < 4; j++) {
out[j] = ((GLfloat)input[j])*maxf;
}
out += 4;
in += stride;
,
default:
printf(unknown_str, from);
return NULL;
)
return dst;
}
GLvoid *copy_gl_array_convert(const GLvoid *src,
GLenum from, GLsizei width, GLsizei stride,
GLenum to, GLsizei to_width, GLsizei skip, GLsizei count, GLvoid* filler) {
if (! src || !count)
return NULL;
if(to==GL_FLOAT && width==to_width && width==4)
return copy_gl_array_quickconvert(src, from, stride, skip, count);
if (! stride)
stride = width * gl_sizeof(from);
const char *unknown_str = "LIBGL: copy_gl_array_convert -> unknown type: %x\n";
GLvoid *dst = malloc((count-skip) * to_width * gl_sizeof(to));
GLsizei from_size = gl_sizeof(from) * width;
if (to_width < width) {
/*printf("Warning: copy_gl_array: %i < %i\n", to_width, width);
return NULL;*/
width = to_width;
}
// if stride is weird, we need to be able to arbitrarily shift src
// so we leave it in a uintptr_t and cast after incrementing
uintptr_t in = (uintptr_t)src;
in += stride*skip;
int j;
if (from == to && to_width >= width) {
GL_TYPE_SWITCH(out, dst, to,
for (int i = skip; i < count; i++) {
memcpy(out, (GLvoid *)in, from_size);
for (j = width; j < to_width-1; j++) {
out[j]=0;
}
for (; j < to_width; j++) {
memcpy(&out[j], filler, gl_sizeof(to));
}
out += to_width;
in += stride;
},
default:
printf(unknown_str, from);
return NULL;
)
} else {
GL_TYPE_SWITCH_MAX(out, dst, to,
GL_TYPE_SWITCH2(input, in, from,
const GLuint maxf = gl_max_value(from);
for (int i = skip; i < count; i++)
,
for (j = 0; j < width; j++) {
out[j] = input[j]*maxv/maxf;
}
for (; j < to_width-1; j++) {
out[j]=0;
}
for (; j < to_width; j++) {
memcpy(&out[j], filler, gl_sizeof(to));
}
out += to_width;
in += stride;
,
default:
printf(unknown_str, from);
return NULL;
),
default:
printf(unknown_str, to);
return NULL;
)
}
return dst;
}
GLvoid *copy_gl_pointer(pointer_state_t *ptr, GLsizei width, GLsizei skip, GLsizei count) {
float filler = 0.0f;
return copy_gl_array_convert(ptr->pointer, ptr->type, ptr->size, ptr->stride,
GL_FLOAT, width, skip, count, &filler);
}
GLvoid *copy_gl_pointer_color(pointer_state_t *ptr, GLsizei width, GLsizei skip, GLsizei count) {
float filler = 1.0f;
return copy_gl_array_convert(ptr->pointer, ptr->type, ptr->size, ptr->stride,
GL_FLOAT, width, skip, count, &filler);
}
GLvoid *copy_gl_pointer_bytecolor(pointer_state_t *ptr, GLsizei width, GLsizei skip, GLsizei count) {
GLubyte filler = 255;
return copy_gl_array_convert(ptr->pointer, ptr->type, ptr->size, ptr->stride,
GL_UNSIGNED_BYTE, width, skip, count, &filler);
}
GLvoid *copy_gl_pointer_raw(pointer_state_t *ptr, GLsizei width, GLsizei skip, GLsizei count) {
return copy_gl_array(ptr->pointer, ptr->type, ptr->size, ptr->stride,
GL_FLOAT, width, skip, count);
}
GLvoid *copy_gl_pointer_tex(pointer_state_t *ptr, GLsizei width, GLsizei skip, GLsizei count) {
float filler = 1.0f;
return copy_gl_array_texcoord(ptr->pointer, ptr->type, ptr->size, ptr->stride,
GL_FLOAT, width, skip, count, &filler, 0);
}
void copy_gl_pointer_tex_noalloc(void* dest, pointer_state_t *ptr, GLsizei width, GLsizei skip, GLsizei count) {
float filler = 1.0f;
copy_gl_array_texcoord(ptr->pointer, ptr->type, ptr->size, ptr->stride,
GL_FLOAT, width, skip, count, &filler, dest);
}
GLfloat *gl_pointer_index(pointer_state_t *p, GLint index) {
static GLfloat buf[4];
GLsizei size = gl_sizeof(p->type);
GLsizei stride = p->stride ? p->stride : (size * p->size);
uintptr_t ptr = (uintptr_t)(p->pointer) + (stride * index);
GL_TYPE_SWITCH(src, ptr, p->type,
for (int i = 0; i < p->size; i++) {
buf[i] = src[i];
}
// zero anything not set by the pointer
for (int i = p->size; i < 4; i++) {
buf[i] = 0;
},
default:
printf("LIBGL: unknown pointer type: 0x%x\n", p->type);
)
return buf;
}
GLfloat *copy_eval_double1(GLenum target, GLint ustride, GLint uorder,
const GLdouble *src) {
GLsizei width = get_map_width(target);
GLfloat* out;
if(!src || !width)
return NULL;
out = malloc(uorder*width*sizeof(GLfloat));
GLfloat *p = out;
for (int i=0; i<uorder; i++, src+=ustride)
for (int k=0; k<width; k++)
*p++ = src[k];
return out;
}
GLfloat *copy_eval_float1(GLenum target, GLint ustride, GLint uorder,
const GLfloat *src) {
GLsizei width = get_map_width(target);
GLfloat* out;
if(!src || !width)
return NULL;
out = malloc(uorder*width*sizeof(GLfloat));
GLfloat *p = out;
for (int i=0; i<uorder; i++, src+=ustride)
for (int k=0; k<width; k++)
*p++ = src[k];
return out;
}
GLfloat *copy_eval_double2(GLenum target, GLint ustride, GLint uorder,
GLint vstride, GLint vorder,
const GLdouble *src) {
/* Additional memory is allocated to be used by the horner and
* de Casteljau evaluation schemes.*/
GLsizei width = get_map_width(target);
GLfloat* out;
if(!src || !width)
return NULL;
int dsize = (uorder == 2 && vorder == 2)? 0 : uorder*vorder;
int hsize = (uorder > vorder ? uorder : vorder)*width;
if(hsize>dsize)
out = malloc((uorder*vorder*width+hsize)*sizeof(GLfloat));
else
out = malloc((uorder*vorder*width+dsize)*sizeof(GLfloat));
int uinc = ustride - vorder*vstride;
GLfloat* p = out;
for (int i=0; i<uorder; i++, src += uinc)
for (int j=0; j<vorder; j++, src += vstride)
for (int k=0; k<width; k++)
*p++ = src[k];
return out;
}
GLfloat *copy_eval_float2(GLenum target, GLint ustride, GLint uorder,
GLint vstride, GLint vorder,
const GLfloat *src) {
/* Additional memory is allocated to be used by the horner and
* de Casteljau evaluation schemes.*/
GLsizei width = get_map_width(target);
GLfloat* out;
if(!src || !width)
return NULL;
int dsize = (uorder == 2 && vorder == 2)? 0 : uorder*vorder;
int hsize = (uorder > vorder ? uorder : vorder)*width;
if(hsize>dsize)
out = malloc((uorder*vorder*width+hsize)*sizeof(GLfloat));
else
out = malloc((uorder*vorder*width+dsize)*sizeof(GLfloat));
int uinc = ustride - vorder*vstride;
GLfloat* p = out;
for (int i=0; i<uorder; i++, src += uinc)
for (int j=0; j<vorder; j++, src += vstride)
for (int k=0; k<width; k++)
*p++ = src[k];
return out;
}
void getminmax_indices_us(const GLushort *indices, GLsizei *max, GLsizei *min, GLsizei count) {
if (!count) return;
*max = indices[0];
*min = indices[0];
for (int i = 1; i < count; i++) {
GLsizei n = indices[i];
if( n < *min) *min = n;
if (n > *max) *max = n;
}
}
void normalize_indices_us(GLushort *indices, GLsizei *max, GLsizei *min, GLsizei count) {
getminmax_indices_us(indices, max, min, count);
for (int i = 0; i < count; i++) {
indices[i] -= *min;
}
}
void getminmax_indices_ui(const GLuint *indices, GLsizei *max, GLsizei *min, GLsizei count) {
if (!count) return;
*max = indices[0];
*min = indices[0];
for (int i = 1; i < count; i++) {
GLsizei n = indices[i];
if( n < *min) *min = n;
if (n > *max) *max = n;
}
}
void normalize_indices_ui(GLuint *indices, GLsizei *max, GLsizei *min, GLsizei count) {
getminmax_indices_ui(indices, max, min, count);
for (int i = 0; i < count; i++) {
indices[i] -= *min;
}
}
GLvoid *copy_gl_pointer_color_bgra(const void *ptr, GLint stride, GLsizei width, GLsizei skip, GLsizei count) {
// this one only convert from BGRA (unsigned byte) to RGBA FLOAT
GLubyte* src = (GLubyte*)ptr;
if (! src || !(count-skip))
return NULL;
if (! stride)
stride = 4;
void* out = malloc(4*sizeof(GLfloat)*(count-skip));
GLfloat* dst = out;
src += skip*(stride);
static const float d = 1.0f/255.0f;
for (int i=skip; i<count; i++) {
#ifdef __ARM_NEON__
int lsrc = *(int*)src;
lsrc = (lsrc&0xff00ff00) | ((lsrc&0x00ff0000)>>16) | ((lsrc&0x000000ff)<<16);
asm volatile (
"vmov s12, %1 \n\t" // because you cannot vmovl.u8 d6, s11
"vmovl.u8 q3, d6 \n\t" // Expand to 16-bit (so unsetuped s13 is expanded in d7)
"vmovl.u16 q3, d6 \n\t" // Expand to 32-bit, ignoring expanded d7
"vcvt.f32.u32 q3, q3 \n\t" // Convert to float
"vmul.f32 q3, q3, %y2 \n\t" // Normalize
"vst1.f32 {q3}, [%0]! \n\t" // Store, next
:"+r"(dst) :"r"(lsrc), "w"(d)
: "q3", "memory"
);
#else
const GLubyte b = src[0], g = src[1], r = src[2], a = src[3];
*dst++ = r*d;
*dst++ = g*d;
*dst++ = b*d;
*dst++ = a*d;
#endif
src+=stride;
}
return out;
}

View file

@ -0,0 +1,33 @@
#ifndef _GL4ES_ARRAY_H_
#define _GL4ES_ARRAY_H_
#include "buffers.h"
#include "gles.h"
GLvoid *copy_gl_array(const GLvoid *src,
GLenum from, GLsizei width, GLsizei stride,
GLenum to, GLsizei to_width, GLsizei skip, GLsizei count);
GLvoid *copy_gl_array_convert(const GLvoid *src,
GLenum from, GLsizei width, GLsizei stride,
GLenum to, GLsizei to_width, GLsizei skip, GLsizei count, GLvoid* filler);
GLvoid *copy_gl_pointer(pointer_state_t *ptr, GLsizei width, GLsizei skip, GLsizei count);
GLvoid *copy_gl_pointer_color(pointer_state_t *ptr, GLsizei width, GLsizei skip, GLsizei count);
GLvoid *copy_gl_pointer_color_bgra(const void *ptr, GLint stride, GLsizei width, GLsizei skip, GLsizei count);
GLvoid *copy_gl_pointer_bytecolor(pointer_state_t *ptr, GLsizei width, GLsizei skip, GLsizei count);
GLvoid *copy_gl_pointer_raw(pointer_state_t *ptr, GLsizei width, GLsizei skip, GLsizei count);
GLvoid *copy_gl_pointer_tex(pointer_state_t *ptr, GLsizei width, GLsizei skip, GLsizei count);
void copy_gl_pointer_tex_noalloc(void* dest, pointer_state_t *ptr, GLsizei width, GLsizei skip, GLsizei count);
GLfloat *gl_pointer_index(pointer_state_t *ptr, GLint index);
void normalize_indices_us(GLushort *indices, GLsizei *max, GLsizei *min, GLsizei count);
void getminmax_indices_us(const GLushort *indices, GLsizei *max, GLsizei *min, GLsizei count);
void normalize_indices_ui(GLuint *indices, GLsizei *max, GLsizei *min, GLsizei count);
void getminmax_indices_ui(const GLuint *indices, GLsizei *max, GLsizei *min, GLsizei count);
GLfloat *copy_eval_double1(GLenum target, GLint ustride, GLint uorder, const GLdouble *points);
GLfloat *copy_eval_float1(GLenum target, GLint ustride, GLint uorder, const GLfloat *points);
GLfloat *copy_eval_double2(GLenum target, GLint ustride, GLint uorder, GLint vstride, GLint vorder, const GLdouble *points);
GLfloat *copy_eval_float2(GLenum target, GLint ustride, GLint uorder, GLint vstride, GLint vorder, const GLfloat *points);
#endif // _GL4ES_ARRAY_H_

View file

@ -0,0 +1,35 @@
#ifndef _GL4ES_ATTRIBUTES_H_
#define _GL4ES_ATTRIBUTES_H_
#ifndef AliasExport
#ifdef __EMSCRIPTEN__
#define AliasExport(name)
#else
#define AliasExport(name) __attribute__((alias(name))) __attribute__((visibility("default")))
#endif
#endif // AliasExport
#ifndef FASTMATH
#ifdef __GNUC__
#ifdef __arm__
#ifdef __ARM_PCS_VFP
//#warning Arm Hardfloat detected
#define FASTMATH
#else // __ARM_PCS_VFP
#if defined(__ARM_FP) && defined(PANDORA)
//#warning Arm SoftFP detected
#define FASTMATH __attribute__((pcs("aapcs-vfp")))
#else // defined(__ARM_FP) && defined(PANDORA)
//#warning Arm no FP detected
#define FASTMATH
#endif // defined(__ARM_FP) && defined(PANDORA)
#endif // __ARM_PCS_VFP
#else // __arm__
#define FASTMATH
#endif // __arm__
#else // __GNUC__
#define FASTMATH
#endif // __GNUC__
#endif // FASTMATH
#endif // _GL4ES_ATTRIBUTES_H_

View file

@ -0,0 +1,172 @@
#include "blend.h"
#include "../glx/hardext.h"
#include "debug.h"
#include "gl4es.h"
#include "glstate.h"
#include "init.h"
#include "loader.h"
#include "logs.h"
void gl4es_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
PUSH_IF_COMPILING(glBlendColor);
LOAD_GLES2_OR_OES(glBlendColor);
if (gles_glBlendColor)
gles_glBlendColor(red, green, blue, alpha);
else {
static int test = 1;
if (test) {
LOGD("stub glBlendColor(%f, %f, %f, %f)\n", red, green, blue, alpha);
test = 0;
}
}
}
void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) AliasExport("gl4es_glBlendColor");
void glBlendColorEXT(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) AliasExport("gl4es_glBlendColor");
void glBlendColorARB(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) AliasExport("gl4es_glBlendColor");
void gl4es_glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
{
if(!glstate->list.pending)
PUSH_IF_COMPILING(glBlendFuncSeparate)
LOAD_GLES2_OR_OES(glBlendFuncSeparate);
if(sfactorRGB==glstate->blendsfactorrgb && dfactorRGB==glstate->blenddfactorrgb
&& sfactorAlpha==glstate->blendsfactoralpha && dfactorAlpha==glstate->blenddfactoralpha)
return; // no change...
if(glstate->list.pending)
flush();
#ifndef PANDORA
if(gles_glBlendFuncSeparate==NULL) {
// some fallback function to have better rendering with SDL2, better then nothing...
if(sfactorRGB==GL_SRC_ALPHA && dfactorRGB==GL_ONE_MINUS_SRC_ALPHA && sfactorAlpha==GL_ONE && dfactorAlpha==GL_ONE_MINUS_SRC_ALPHA)
gl4es_glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
else if (sfactorRGB==GL_SRC_ALPHA && dfactorRGB==GL_ONE && sfactorAlpha==GL_ZERO && dfactorAlpha==GL_ONE)
gl4es_glBlendFunc(GL_SRC_ALPHA, GL_ONE);
else if (sfactorRGB==GL_ZERO && dfactorRGB==GL_SRC_COLOR && sfactorAlpha==GL_ZERO && dfactorAlpha==GL_ONE)
gl4es_glBlendFunc(GL_ZERO, GL_SRC_COLOR);
else if (sfactorRGB==sfactorAlpha && dfactorRGB==dfactorAlpha)
gl4es_glBlendFunc(sfactorRGB, dfactorRGB);
} else
#endif
gles_glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
glstate->blendsfactorrgb = sfactorRGB;
glstate->blenddfactorrgb = dfactorRGB;
glstate->blendsfactoralpha = sfactorAlpha;
glstate->blenddfactoralpha = dfactorAlpha;
}
void glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) AliasExport("gl4es_glBlendFuncSeparate");
void glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) AliasExport("gl4es_glBlendFuncSeparate");
void gl4es_glBlendEquationSeparate(GLenum modeRGB, GLenum modeA) {
PUSH_IF_COMPILING(glBlendEquationSeparate);
LOAD_GLES2_OR_OES(glBlendEquationSeparate);
#ifndef PANDORA
if(gles_glBlendEquationSeparate)
#endif
gles_glBlendEquationSeparate(modeRGB, modeA);
}
void glBlendEquationSeparate(GLenum modeRGB, GLenum modeA) AliasExport("gl4es_glBlendEquationSeparate");
void glBlendEquationSeparateEXT(GLenum modeRGB, GLenum modeA) AliasExport("gl4es_glBlendEquationSeparate");
void gl4es_glBlendFunc(GLenum sfactor, GLenum dfactor) {
if(!glstate->list.pending)
PUSH_IF_COMPILING(glBlendFunc)
if(sfactor==glstate->blendsfactorrgb && dfactor==glstate->blenddfactorrgb
&& sfactor==glstate->blendsfactoralpha && dfactor==glstate->blenddfactoralpha)
return; // already set
if(glstate->list.pending)
flush();
LOAD_GLES(glBlendFunc);
LOAD_GLES2_OR_OES(glBlendFuncSeparate);
errorGL();
glstate->blendsfactorrgb = sfactor;
glstate->blenddfactorrgb = dfactor;
glstate->blendsfactoralpha = sfactor;
glstate->blenddfactoralpha = dfactor;
// There are some limitations in GLES1.1 Blend functions
switch(sfactor) {
#if 0
case GL_SRC_COLOR:
if (gles_glBlendFuncSeparate) {
gles_glBlendFuncSeparate(sfactor, dfactor, sfactor, dfactor);
return;
}
sfactor = GL_ONE; // approx...
break;
case GL_ONE_MINUS_SRC_COLOR:
if (gles_glBlendFuncSeparate) {
gles_glBlendFuncSeparate(sfactor, dfactor, sfactor, dfactor);
return;
}
sfactor = GL_ONE; // not sure it make sense...
break;
#endif
// here, we need support for glBlendColor...
case GL_CONSTANT_COLOR:
case GL_CONSTANT_ALPHA:
if(hardext.blendcolor==0)
sfactor = GL_ONE;
break;
case GL_ONE_MINUS_CONSTANT_COLOR:
case GL_ONE_MINUS_CONSTANT_ALPHA:
if(hardext.blendcolor==0)
sfactor = GL_ZERO;
break;
default:
break;
}
switch(dfactor) {
#if 0
case GL_DST_COLOR:
sfactor = GL_ONE; // approx...
break;
case GL_ONE_MINUS_DST_COLOR:
sfactor = GL_ZERO; // not sure it make sense...
break;
#endif
// here, we need support for glBlendColor...
case GL_CONSTANT_COLOR:
case GL_CONSTANT_ALPHA:
if(hardext.blendcolor==0)
sfactor = GL_ONE;
break;
case GL_ONE_MINUS_CONSTANT_COLOR:
case GL_ONE_MINUS_CONSTANT_ALPHA:
if(hardext.blendcolor==0)
sfactor = GL_ZERO;
break;
default:
break;
}
if ((globals4es.blendhack) && (sfactor==GL_SRC_ALPHA) && (dfactor==GL_ONE)) {
// special case, as seen in Xash3D, but it breaks torus_trooper, so behind a parameter
sfactor = GL_ONE;
}
#ifdef ODROID
if(gles_glBlendFunc)
#endif
gles_glBlendFunc(sfactor, dfactor);
}
void glBlendFunc(GLenum sfactor, GLenum dfactor) AliasExport("gl4es_glBlendFunc");
void gl4es_glBlendEquation(GLenum mode) {
PUSH_IF_COMPILING(glBlendEquation)
LOAD_GLES2_OR_OES(glBlendEquation);
errorGL();
#ifdef ODROID
if(gles_glBlendEquation)
#endif
gles_glBlendEquation(mode);
}
void glBlendEquation(GLenum mode) AliasExport("gl4es_glBlendEquation");
void glBlendEquationEXT(GLenum mode) AliasExport("gl4es_glBlendEquation");

View file

@ -0,0 +1,12 @@
#ifndef _GL4ES_BLEND_H_
#define _GL4ES_BLEND_H_
#include "gles.h"
void gl4es_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
void gl4es_glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
void gl4es_glBlendEquationSeparate(GLenum modeRGB, GLenum modeA);
void gl4es_glBlendFunc(GLenum sfactor, GLenum dfactor);
void gl4es_glBlendEquation(GLenum mode);
#endif //_GL4ES_BLEND_H_

View file

@ -0,0 +1,435 @@
/* Blit utility function */
#include "blit.h"
#include <math.h>
#include "fpe.h"
#include "gl4es.h"
#include "glstate.h"
#include "init.h"
#include "loader.h"
#ifdef TEXSTREAM
# ifndef GL_TEXTURE_STREAM_IMG
# define GL_TEXTURE_STREAM_IMG 0x8C0D
# endif
#include "../glx/streaming.h"
#endif
#define SHUT(a) if(!globals4es.nobanner) a
// hacky viewport temporary changes
void pushViewport(GLint x, GLint y, GLsizei width, GLsizei height);
void popViewport();
void gl4es_blitTexture_gles1(GLuint texture,
GLfloat sx, GLfloat sy,
GLfloat width, GLfloat height,
GLfloat nwidth, GLfloat nheight,
GLfloat zoomx, GLfloat zoomy,
GLfloat vpwidth, GLfloat vpheight,
GLfloat x, GLfloat y, GLint mode) {
LOAD_GLES(glClientActiveTexture);
GLfloat old_projection[16], old_modelview[16], old_texture[16];
int customvp = (vpwidth>0.0);
int drawtexok = (hardext.drawtex) && (zoomx==1.0f) && (zoomy==1.0f);
GLuint old_cli = glstate->texture.client;
if (old_cli!=0) gles_glClientActiveTexture(GL_TEXTURE0);
gl4es_glDisable(GL_LIGHTING);
gl4es_glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
gl4es_glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
switch (mode) {
case BLIT_OPAQUE:
gl4es_glDisable(GL_ALPHA_TEST);
gl4es_glDisable(GL_BLEND);
break;
case BLIT_ALPHA:
gl4es_glEnable(GL_ALPHA_TEST);
gl4es_glAlphaFunc(GL_GREATER, 0.0f);
break;
case BLIT_COLOR:
break;
}
if(drawtexok) {
LOAD_GLES_OES(glDrawTexf);
LOAD_GLES(glTexParameteriv);
// setup texture first
int sourceRect[4] = {sx, sy, width, height};
gles_glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, sourceRect);
// take x/y of ViewPort into account
GLfloat dx = (customvp)?0.0f:glstate->raster.viewport.x;
GLfloat dy = (customvp)?0.0f:glstate->raster.viewport.y;
//TODO: do something with width / height of ViewPort?
// then draw it
gles_glDrawTexf(x+dx, y+dy, 0.0f, width, height);
} else {
LOAD_GLES(glEnableClientState);
LOAD_GLES(glDisableClientState);
LOAD_GLES(glVertexPointer);
LOAD_GLES(glTexCoordPointer);
LOAD_GLES(glDrawArrays);
GLfloat w2 = 2.0f / (customvp?vpwidth:glstate->raster.viewport.width);
GLfloat h2 = 2.0f / (customvp?vpheight:glstate->raster.viewport.height);
GLfloat blit_x1=roundf(x);
GLfloat blit_x2=roundf(x+width*zoomx);
GLfloat blit_y1=roundf(y);
GLfloat blit_y2=roundf(y+height*zoomy);
GLfloat blit_vert[] = {
blit_x1*w2-1.0f, blit_y1*h2-1.0f,
blit_x2*w2-1.0f, blit_y1*h2-1.0f,
blit_x2*w2-1.0f, blit_y2*h2-1.0f,
blit_x1*w2-1.0f, blit_y2*h2-1.0f
};
GLfloat sw = sx/nwidth;
GLfloat sh = sy/nheight;
GLfloat rw = (sx+width)/nwidth;
GLfloat rh = (sy+height)/nheight;
GLfloat blit_tex[] = {
sw, sh,
rw, sh,
rw, rh,
sw, rh
};
gl4es_glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT | GL_CLIENT_PIXEL_STORE_BIT);
gl4es_glGetFloatv(GL_TEXTURE_MATRIX, old_texture);
gl4es_glGetFloatv(GL_PROJECTION_MATRIX, old_projection);
gl4es_glGetFloatv(GL_MODELVIEW_MATRIX, old_modelview);
gl4es_glMatrixMode(GL_TEXTURE);
gl4es_glLoadIdentity();
gl4es_glMatrixMode(GL_PROJECTION);
gl4es_glLoadIdentity();
gl4es_glMatrixMode(GL_MODELVIEW);
gl4es_glLoadIdentity();
if(customvp)
pushViewport(0,0,vpwidth, vpheight);
if(!glstate->clientstate[ATT_VERTEX])
{
gles_glEnableClientState(GL_VERTEX_ARRAY);
glstate->clientstate[ATT_VERTEX] = 1;
}
gles_glVertexPointer(2, GL_FLOAT, 0, blit_vert);
if(!glstate->clientstate[ATT_MULTITEXCOORD0])
{
gles_glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glstate->clientstate[ATT_MULTITEXCOORD0] = 1;
}
gles_glTexCoordPointer(2, GL_FLOAT, 0, blit_tex);
for (int a=1; a <hardext.maxtex; a++)
if(glstate->clientstate[ATT_MULTITEXCOORD0+a]) {
gles_glClientActiveTexture(GL_TEXTURE0 + a);
gles_glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glstate->clientstate[ATT_MULTITEXCOORD0+a] = 0;
gles_glClientActiveTexture(GL_TEXTURE0);
}
if(glstate->clientstate[ATT_COLOR]) {
gles_glDisableClientState(GL_COLOR_ARRAY);
glstate->clientstate[ATT_COLOR] = 0;
}
if(glstate->clientstate[ATT_NORMAL]) {
gles_glDisableClientState(GL_NORMAL_ARRAY);
glstate->clientstate[ATT_NORMAL] = 0;
}
gles_glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
if(customvp)
popViewport();
gl4es_glPopClientAttrib();
gl4es_glMatrixMode(GL_TEXTURE);
gl4es_glLoadMatrixf(old_texture);
gl4es_glMatrixMode(GL_MODELVIEW);
gl4es_glLoadMatrixf(old_modelview);
gl4es_glMatrixMode(GL_PROJECTION);
gl4es_glLoadMatrixf(old_projection);
}
if (old_cli!=0) gles_glClientActiveTexture(GL_TEXTURE0+old_cli);
}
const char _blit_vsh[] = "#version 100 \n" \
"attribute highp vec2 aPosition; \n" \
"attribute highp vec2 aTexCoord; \n" \
"varying mediump vec2 vTexCoord; \n" \
"void main(){ \n" \
"gl_Position = vec4(aPosition.x, aPosition.y, 0.0, 1.0);\n" \
"vTexCoord = aTexCoord; \n" \
"} \n";
const char _blit_fsh[] = "#version 100 \n" \
"uniform sampler2D uTex; \n" \
"varying mediump vec2 vTexCoord; \n" \
"void main(){ \n" \
"gl_FragColor = texture2D(uTex, vTexCoord); \n" \
"} \n";
const char _blit_vsh_alpha[] = "#version 100 \n" \
"attribute highp vec2 aPosition; \n" \
"attribute highp vec2 aTexCoord; \n" \
"varying mediump vec2 vTexCoord; \n" \
"void main(){ \n" \
"gl_Position = vec4(aPosition.x, aPosition.y, 0.0, 1.0);\n" \
"vTexCoord = aTexCoord; \n" \
"} \n";
const char _blit_fsh_alpha[] = "#version 100 \n" \
"uniform sampler2D uTex; \n" \
"varying mediump vec2 vTexCoord; \n" \
"void main(){ \n" \
"lowp vec4 p = texture2D(uTex, vTexCoord); \n" \
"if (p.a==0.0) discard; \n" \
"gl_FragColor = p; \n" \
"} \n";
void gl4es_blitTexture_gles2(GLuint texture,
GLfloat sx, GLfloat sy,
GLfloat width, GLfloat height,
GLfloat nwidth, GLfloat nheight,
GLfloat zoomx, GLfloat zoomy,
GLfloat vpwidth, GLfloat vpheight,
GLfloat x, GLfloat y, GLint mode) {
LOAD_GLES(glDrawArrays);
if(!glstate->blit) {
LOAD_GLES2(glCreateShader);
LOAD_GLES2(glShaderSource);
LOAD_GLES2(glCompileShader);
LOAD_GLES2(glGetShaderiv);
LOAD_GLES2(glBindAttribLocation);
LOAD_GLES2(glAttachShader);
LOAD_GLES2(glCreateProgram);
LOAD_GLES2(glLinkProgram);
LOAD_GLES2(glGetProgramiv);
LOAD_GLES(glGetUniformLocation);
LOAD_GLES2(glUniform1i);
LOAD_GLES2(glUseProgram);
glstate->blit = (glesblit_t*)malloc(sizeof(glesblit_t));
memset(glstate->blit, 0, sizeof(glesblit_t));
GLint success;
const char *src[1];
src[0] = _blit_fsh;
glstate->blit->pixelshader = gles_glCreateShader( GL_FRAGMENT_SHADER );
gles_glShaderSource( glstate->blit->pixelshader, 1, (const char**) src, NULL );
gles_glCompileShader( glstate->blit->pixelshader );
gles_glGetShaderiv( glstate->blit->pixelshader, GL_COMPILE_STATUS, &success );
if (!success)
{
LOAD_GLES(glGetShaderInfoLog);
char log[400];
gles_glGetShaderInfoLog(glstate->blit->pixelshader_alpha, 399, NULL, log);
SHUT(printf("LIBGL: Failed to produce blit fragment shader.\n%s", log);)
free(glstate->blit);
glstate->blit = NULL;
}
src[0] = _blit_fsh_alpha;
glstate->blit->pixelshader_alpha = gles_glCreateShader( GL_FRAGMENT_SHADER );
gles_glShaderSource( glstate->blit->pixelshader_alpha, 1, (const char**) src, NULL );
gles_glCompileShader( glstate->blit->pixelshader_alpha );
gles_glGetShaderiv( glstate->blit->pixelshader_alpha, GL_COMPILE_STATUS, &success );
if (!success)
{
LOAD_GLES(glGetShaderInfoLog);
char log[400];
gles_glGetShaderInfoLog(glstate->blit->pixelshader_alpha, 399, NULL, log);
SHUT(printf("LIBGL: Failed to produce blit with alpha fragment shader.\n%s", log);)
free(glstate->blit);
glstate->blit = NULL;
}
src[0] = _blit_vsh;
glstate->blit->vertexshader = gles_glCreateShader( GL_VERTEX_SHADER );
gles_glShaderSource( glstate->blit->vertexshader, 1, (const char**) src, NULL );
gles_glCompileShader( glstate->blit->vertexshader );
gles_glGetShaderiv( glstate->blit->vertexshader, GL_COMPILE_STATUS, &success );
if( !success )
{
LOAD_GLES(glGetShaderInfoLog);
char log[400];
gles_glGetShaderInfoLog(glstate->blit->pixelshader_alpha, 399, NULL, log);
SHUT(printf("LIBGL: Failed to produce blit vertex shader.\n%s", log);)
free(glstate->blit);
glstate->blit = NULL;
}
src[0] = _blit_vsh_alpha;
glstate->blit->vertexshader_alpha = gles_glCreateShader( GL_VERTEX_SHADER );
gles_glShaderSource( glstate->blit->vertexshader_alpha, 1, (const char**) src, NULL );
gles_glCompileShader( glstate->blit->vertexshader_alpha );
gles_glGetShaderiv( glstate->blit->vertexshader_alpha, GL_COMPILE_STATUS, &success );
if( !success )
{
LOAD_GLES(glGetShaderInfoLog);
char log[400];
gles_glGetShaderInfoLog(glstate->blit->pixelshader_alpha, 399, NULL, log);
SHUT(printf("LIBGL: Failed to produce blit with alpha vertex shader.\n%s", log);)
free(glstate->blit);
glstate->blit = NULL;
}
glstate->blit->program = gles_glCreateProgram();
gles_glBindAttribLocation( glstate->blit->program, 0, "aPosition" );
gles_glBindAttribLocation( glstate->blit->program, 1, "aTexCoord" );
gles_glAttachShader( glstate->blit->program, glstate->blit->pixelshader );
gles_glAttachShader( glstate->blit->program, glstate->blit->vertexshader );
gles_glLinkProgram( glstate->blit->program );
gles_glGetProgramiv( glstate->blit->program, GL_LINK_STATUS, &success );
if( !success )
{
SHUT(printf("LIBGL: Failed to link blit program.\n");)
free(glstate->blit);
glstate->blit = NULL;
}
GLuint oldprog = glstate->gleshard->program;
gles_glUseProgram(glstate->blit->program);
gles_glUniform1i( gles_glGetUniformLocation( glstate->blit->program, "uTex" ), 0 );
glstate->blit->program_alpha = gles_glCreateProgram();
gles_glBindAttribLocation( glstate->blit->program_alpha, 0, "aPosition" );
gles_glBindAttribLocation( glstate->blit->program_alpha, 1, "aTexCoord" );
gles_glAttachShader( glstate->blit->program_alpha, glstate->blit->pixelshader_alpha );
gles_glAttachShader( glstate->blit->program_alpha, glstate->blit->vertexshader_alpha );
gles_glLinkProgram( glstate->blit->program_alpha );
gles_glGetProgramiv( glstate->blit->program_alpha, GL_LINK_STATUS, &success );
if( !success )
{
SHUT(printf("LIBGL: Failed to link blit program.\n");)
free(glstate->blit);
glstate->blit = NULL;
}
gles_glUseProgram(glstate->blit->program_alpha);
gles_glUniform1i( gles_glGetUniformLocation( glstate->blit->program_alpha, "uTex" ), 0 );
gles_glUseProgram(oldprog);
}
int customvp = (vpwidth>0.0);
GLfloat w2 = 2.0f / (customvp?vpwidth:glstate->raster.viewport.width);
GLfloat h2 = 2.0f / (customvp?vpheight:glstate->raster.viewport.height);
GLfloat blit_x1=roundf(x);
GLfloat blit_x2=roundf(x+width*zoomx);
GLfloat blit_y1=roundf(y);
GLfloat blit_y2=roundf(y+height*zoomy);
GLfloat *vert = glstate->blit->vert;
GLfloat *tex = glstate->blit->tex;
vert[0] = blit_x1*w2-1.0f; vert[1] = blit_y1*h2-1.0f;
vert[2] = blit_x2*w2-1.0f; vert[3] = vert[1];
vert[4] = vert[2]; vert[5] = blit_y2*h2-1.0f;
vert[6] = vert[0]; vert[7] = vert[5];
GLfloat sw = sx/nwidth;
GLfloat sh = sy/nheight;
GLfloat rw = (sx+width)/nwidth;
GLfloat rh = (sy+height)/nheight;
tex[0] = sw; tex[1] = sh;
tex[2] = rw; tex[3] = sh;
tex[4] = rw; tex[5] = rh;
tex[6] = sw; tex[7] = rh;
gl4es_glDisable(GL_BLEND);
int alpha = 0;
switch (mode) {
case BLIT_OPAQUE:
//gl4es_glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
break;
case BLIT_ALPHA:
alpha = 1;
break;
case BLIT_COLOR:
//gl4es_glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
break;
}
realize_blitenv(alpha);
gles_glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
void gl4es_blitTexture(GLuint texture,
GLfloat sx, GLfloat sy,
GLfloat width, GLfloat height,
GLfloat nwidth, GLfloat nheight,
GLfloat zoomx, GLfloat zoomy,
GLfloat vpwidth, GLfloat vpheight,
GLfloat x, GLfloat y, GLint mode) {
//printf("blitTexture(%d, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %d) customvp=%d, vp=%d/%d/%d/%d\n", texture, sx, sy, width, height, nwidth, nheight, zoomx, zoomy, vpwidth, vpheight, x, y, mode, (vpwidth>0.0), glstate->raster.viewport.x, glstate->raster.viewport.y, glstate->raster.viewport.width, glstate->raster.viewport.height);
LOAD_GLES(glBindTexture);
LOAD_GLES(glActiveTexture);
LOAD_GLES(glEnable);
LOAD_GLES(glDisable);
realize_textures();
gl4es_glPushAttrib(GL_TEXTURE_BIT | GL_ENABLE_BIT | GL_TRANSFORM_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT);
if(glstate->gleshard->active) {
glstate->gleshard->active = 0;
gles_glActiveTexture(GL_TEXTURE0);
}
GLint depthwrite = glstate->depth.mask;
gl4es_glDisable(GL_DEPTH_TEST);
gl4es_glDisable(GL_CULL_FACE);
gl4es_glDisable(GL_STENCIL_TEST);
if(depthwrite)
gl4es_glDepthMask(GL_FALSE);
#ifdef TEXSTREAM
if(glstate->bound_stream[0] && hardext.esversion==1) {
//printf("TMU%d, turning off Streaming (blit)\n", 0);
gles_glDisable(GL_TEXTURE_STREAM_IMG);
DeactivateStreaming();
}
#endif
int tmp = glstate->enable.texture[0];
if(glstate->actual_tex2d[0] != texture);
gles_glBindTexture(GL_TEXTURE_2D, texture);
if(hardext.esversion==1) {
if(!IS_TEX2D(tmp))
gles_glEnable(GL_TEXTURE_2D);
if(IS_CUBE_MAP(tmp))
gles_glDisable(GL_TEXTURE_CUBE_MAP);
gl4es_blitTexture_gles1(texture, sx, sy, width, height,
nwidth, nheight, zoomx, zoomy,
vpwidth, vpheight, x, y, mode);
if(!IS_TEX2D(tmp))
gles_glDisable(GL_TEXTURE_2D);
if(IS_CUBE_MAP(tmp))
gles_glEnable(GL_TEXTURE_CUBE_MAP);
} else {
gl4es_blitTexture_gles2(texture, sx, sy, width, height,
nwidth, nheight, zoomx, zoomy,
vpwidth, vpheight, x, y, mode);
}
// All the previous states are Pushed / Poped anyway...
#ifdef TEXSTREAM
if(glstate->bound_stream[0] && hardext.esversion==1) {
//printf("TMU%d, turning ON Streaming (blit)\n", 0);
gltexture_t *tex = glstate->texture.bound[0][ENABLED_TEX2D];
ActivateStreaming(tex->streamingID);
gles_glEnable(GL_TEXTURE_STREAM_IMG);
} else
#endif
if (glstate->actual_tex2d[0] != texture)
gles_glBindTexture(GL_TEXTURE_2D, glstate->actual_tex2d[0]);
if(depthwrite)
gl4es_glDepthMask(GL_TRUE);
gl4es_glPopAttrib();
}

View file

@ -0,0 +1,18 @@
#ifndef _GL4ES_BLIT_H_
#define _GL4ES_BLIT_H_
#include "gles.h"
#define BLIT_ALPHA 0
#define BLIT_OPAQUE 1
#define BLIT_COLOR 2
void gl4es_blitTexture(GLuint texture,
GLfloat sx, GLfloat sy,
GLfloat width, GLfloat height,
GLfloat nwidth, GLfloat nheight,
GLfloat zoomx, GLfloat zoomy,
GLfloat vpwidth, GLfloat vpheight,
GLfloat x, GLfloat y, GLint mode);
#endif // _GL4ES_BLIT_H_

View file

@ -0,0 +1,663 @@
#include "buffers.h"
#include "khash.h"
#include "../glx/hardext.h"
#include "attributes.h"
#include "debug.h"
#include "gl4es.h"
#include "glstate.h"
#include "logs.h"
//#define DEBUG
#ifdef DEBUG
#define DBG(a) a
#else
#define DBG(a)
#endif
KHASH_MAP_IMPL_INT(buff, glbuffer_t *);
KHASH_MAP_IMPL_INT(glvao, glvao_t*);
static GLuint lastbuffer = 1;
// Utility function to bind / unbind a particular buffer
glbuffer_t** BUFF(GLenum target) {
switch(target) {
case GL_ARRAY_BUFFER:
return &glstate->vao->vertex;
break;
case GL_ELEMENT_ARRAY_BUFFER:
return &glstate->vao->elements;
break;
case GL_PIXEL_PACK_BUFFER:
return &glstate->vao->pack;
break;
case GL_PIXEL_UNPACK_BUFFER:
return &glstate->vao->unpack;
break;
default:
LOGD("LIBGL: Warning, unknown buffer target 0x%04X\n", target);
}
return (glbuffer_t**)NULL;
}
void unbind_buffer(GLenum target) {
glbuffer_t **t = BUFF(target);
if (t)
*t=(glbuffer_t*)NULL;
}
void bind_buffer(GLenum target, glbuffer_t* buff) {
glbuffer_t ** t = BUFF(target);
if (t)
*t = buff;
}
glbuffer_t* getbuffer_buffer(GLenum target) {
glbuffer_t ** t = BUFF(target);
if (t)
return *t;
return NULL;
}
glbuffer_t* getbuffer_id(GLuint buffer) {
if(!buffer)
return NULL;
khint_t k;
int ret;
khash_t(buff) *list = glstate->buffers;
k = kh_get(buff, list, buffer);
if (k == kh_end(list))
return NULL;
return kh_value(list, k);
}
int buffer_target(GLenum target) {
if (target==GL_ARRAY_BUFFER)
return 1;
if (target==GL_ELEMENT_ARRAY_BUFFER)
return 1;
if (target==GL_PIXEL_PACK_BUFFER)
return 1;
if (target==GL_PIXEL_UNPACK_BUFFER)
return 1;
return 0;
}
void gl4es_glGenBuffers(GLsizei n, GLuint * buffers) {
DBG(printf("glGenBuffers(%i, %p)\n", n, buffers);)
noerrorShim();
if (n<1) {
errorShim(GL_INVALID_VALUE);
return;
}
for (int i=0; i<n; i++) {
buffers[i] = lastbuffer++;
}
}
void gl4es_glBindBuffer(GLenum target, GLuint buffer) {
DBG(printf("glBindBuffer(%s, %u)\n", PrintEnum(target), buffer);)
if (glstate->list.pending) // this is probably not needed as long as real VBO are not used
flush();
khint_t k;
int ret;
khash_t(buff) *list = glstate->buffers;
if (!buffer_target(target)) {
errorShim(GL_INVALID_ENUM);
return;
}
// if buffer = 0 => unbind buffer!
if (buffer == 0) {
// unbind buffer
unbind_buffer(target);
} else {
// search for an existing buffer
k = kh_get(buff, list, buffer);
glbuffer_t *buff = NULL;
if (k == kh_end(list)){
k = kh_put(buff, list, buffer, &ret);
buff = kh_value(list, k) = malloc(sizeof(glbuffer_t));
buff->buffer = buffer;
buff->type = target;
buff->data = NULL;
buff->usage = GL_STATIC_DRAW;
buff->size = 0;
buff->access = GL_READ_WRITE;
buff->mapped = 0;
} else {
buff = kh_value(list, k);
}
bind_buffer(target, buff);
}
noerrorShim();
}
void gl4es_glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) {
DBG(printf("glBufferData(%s, %i, %p, %s)\n", PrintEnum(target), size, data, PrintEnum(usage));)
if (!buffer_target(target)) {
errorShim(GL_INVALID_ENUM);
return;
}
glbuffer_t *buff = getbuffer_buffer(target);
if (buff==NULL) {
errorShim(GL_INVALID_OPERATION);
LOGE("LIBGL: Warning, null buffer for target=0x%04X for glBufferData\n", target);
return;
}
if (buff->data) {
free(buff->data);
}
if(target==GL_ARRAY_BUFFER)
VaoSharedClear(glstate->vao);
buff->size = size;
buff->usage = usage;
buff->data = malloc(size);
buff->access = GL_READ_WRITE;
if (data)
memcpy(buff->data, data, size);
noerrorShim();
}
void gl4es_glNamedBufferData(GLuint buffer, GLsizeiptr size, const GLvoid * data, GLenum usage) {
DBG(printf("glNamedBufferData(%u, %i, %p, %s)\n", buffer, size, data, PrintEnum(usage));)
glbuffer_t *buff = getbuffer_id(buffer);
if (buff==NULL) {
errorShim(GL_INVALID_OPERATION);
return;
}
if (buff->data) {
free(buff->data);
}
buff->size = size;
buff->usage = usage;
buff->data = malloc(size);
buff->access = GL_READ_WRITE;
if (data)
memcpy(buff->data, data, size);
noerrorShim();
}
void gl4es_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) {
DBG(printf("glBufferSubData(%s, %p, %i, %p)\n", PrintEnum(target), offset, size, data);)
if (!buffer_target(target)) {
errorShim(GL_INVALID_ENUM);
return;
}
glbuffer_t *buff = getbuffer_buffer(target);
if (buff==NULL) {
errorShim(GL_INVALID_OPERATION);
DBG(printf("LIBGL: Warning, null buffer for target=0x%04X for glBufferSubData\n", target);)
return;
}
if(target==GL_ARRAY_BUFFER)
VaoSharedClear(glstate->vao);
if (offset<0 || size<0 || offset+size>buff->size) {
errorShim(GL_INVALID_VALUE);
return;
}
memcpy(buff->data + offset, data, size);
noerrorShim();
}
void gl4es_glNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid * data) {
DBG(printf("glNamedBufferSubData(%u, %p, %i, %p)\n", buffer, offset, size, data);)
glbuffer_t *buff = getbuffer_id(buffer);
if (buff==NULL) {
errorShim(GL_INVALID_OPERATION);
return;
}
if (offset<0 || size<0 || offset+size>buff->size) {
errorShim(GL_INVALID_VALUE);
return;
}
memcpy(buff->data + offset, data, size);
noerrorShim();
}
void gl4es_glDeleteBuffers(GLsizei n, const GLuint * buffers) {
DBG(printf("glDeleteBuffers(%i, %p)\n", n, buffers);)
if(!glstate) return;
FLUSH_BEGINEND;
VaoSharedClear(glstate->vao);
khash_t(buff) *list = glstate->buffers;
if (list) {
khint_t k;
glbuffer_t *buff;
for (int i = 0; i < n; i++) {
GLuint t = buffers[i];
if (t) { // don't allow to remove default one
k = kh_get(buff, list, t);
if (k != kh_end(list)) {
buff = kh_value(list, k);
if (glstate->vao->vertex == buff)
glstate->vao->vertex = NULL;
if (glstate->vao->elements == buff)
glstate->vao->elements = NULL;
if (glstate->vao->pack == buff)
glstate->vao->pack = NULL;
if (glstate->vao->unpack == buff)
glstate->vao->unpack = NULL;
for (int j = 0; j < hardext.maxvattrib; j++)
if (glstate->vao->vertexattrib[j].buffer == buff)
glstate->vao->vertexattrib[j].buffer = NULL;
if (buff->data) free(buff->data);
kh_del(buff, list, k);
free(buff);
}
}
}
}
noerrorShim();
}
GLboolean gl4es_glIsBuffer(GLuint buffer) {
DBG(printf("glIsBuffer(%u)\n", buffer);)
khash_t(buff) *list = glstate->buffers;
khint_t k;
noerrorShim();
if (list) {
k = kh_get(buff, list, buffer);
if (k != kh_end(list)) {
return GL_TRUE;
}
}
return GL_FALSE;
}
static void* bufferGetParameteriv(glbuffer_t* buff, GLenum value, GLint * data) {
noerrorShim();
switch (value) {
case GL_BUFFER_ACCESS:
data[0] = buff->access;
break;
case GL_BUFFER_ACCESS_FLAGS:
data[0] = GL_MAP_READ_BIT | GL_MAP_WRITE_BIT;
break;
case GL_BUFFER_MAPPED:
data[0]=(buff->mapped)?GL_TRUE:GL_FALSE;
break;
case GL_BUFFER_MAP_LENGTH:
data[0]=(buff->mapped)?buff->size:0;
break;
case GL_BUFFER_MAP_OFFSET:
data[0]=0;
break;
case GL_BUFFER_SIZE:
data[0] = buff->size;
break;
case GL_BUFFER_USAGE:
data[0] = buff->usage;
break;
default:
errorShim(GL_INVALID_ENUM);
/* TODO Error if something else */
}
}
void gl4es_glGetBufferParameteriv(GLenum target, GLenum value, GLint * data) {
DBG(printf("glGetBufferParameteriv(%s, %s, %p)\n", PrintEnum(target), PrintEnum(value), data);)
if (!buffer_target(target)) {
errorShim(GL_INVALID_ENUM);
return;
}
glbuffer_t* buff = getbuffer_buffer(target);
if (buff==NULL) {
errorShim(GL_INVALID_OPERATION);
return; // Should generate an error!
}
bufferGetParameteriv(buff, value, data);
}
void gl4es_glGetNamedBufferParameteriv(GLuint buffer, GLenum value, GLint * data) {
DBG(printf("glGetNamedBufferParameteriv(%u, %s, %p)\n", buffer, PrintEnum(value), data);)
glbuffer_t* buff = getbuffer_id(buffer);
if (buff==NULL) {
errorShim(GL_INVALID_OPERATION);
return; // Should generate an error!
}
bufferGetParameteriv(buff, value, data);
}
void *gl4es_glMapBuffer(GLenum target, GLenum access) {
DBG(printf("glMapBuffer(%s, %s)\n", PrintEnum(target), PrintEnum(access));)
if (!buffer_target(target)) {
errorShim(GL_INVALID_ENUM);
return (void*)NULL;
}
if(target==GL_ARRAY_BUFFER)
VaoSharedClear(glstate->vao);
glbuffer_t *buff = getbuffer_buffer(target);
if (buff==NULL)
return (void*)NULL; // Should generate an error!
buff->access = access; // not used
buff->mapped = 1;
noerrorShim();
return buff->data; // Not nice, should do some copy or something probably
}
void *gl4es_glMapNamedBuffer(GLuint buffer, GLenum access) {
DBG(printf("glMapNamedBuffer(%u, %s)\n", buffer, PrintEnum(access));)
glbuffer_t *buff = getbuffer_id(buffer);
if (buff==NULL)
return (void*)NULL; // Should generate an error!
buff->access = access; // not used
buff->mapped = 1;
noerrorShim();
return buff->data; // Not nice, should do some copy or something probably
}
GLboolean gl4es_glUnmapBuffer(GLenum target) {
DBG(printf("glUnmapBuffer(%s)\n", PrintEnum(target));)
if(glstate->list.compiling) {errorShim(GL_INVALID_OPERATION); return GL_FALSE;}
if(glstate->list.active)
flush();
if (!buffer_target(target)) {
errorShim(GL_INVALID_ENUM);
return GL_FALSE;
}
if(target==GL_ARRAY_BUFFER)
VaoSharedClear(glstate->vao);
glbuffer_t *buff = getbuffer_buffer(target);
if (buff==NULL)
return GL_FALSE; // Should generate an error!
noerrorShim();
if (buff->mapped) {
buff->mapped = 0;
return GL_TRUE;
}
return GL_FALSE;
}
GLboolean gl4es_glUnmapNamedBuffer(GLuint buffer) {
DBG(printf("glUnmapNamedBuffer(%u)\n", buffer);)
if(glstate->list.compiling) {errorShim(GL_INVALID_OPERATION); return GL_FALSE;}
if(glstate->list.active)
flush();
glbuffer_t *buff = getbuffer_id(buffer);
if (buff==NULL)
return GL_FALSE; // Should generate an error!
noerrorShim();
if (buff->mapped) {
buff->mapped = 0;
return GL_TRUE;
}
return GL_FALSE;
}
void gl4es_glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) {
DBG(printf("glGetBufferSubData(%s, %p, %i, %p)\n", PrintEnum(target), offset, size, data);)
if (!buffer_target(target)) {
errorShim(GL_INVALID_ENUM);
return;
}
glbuffer_t *buff = getbuffer_buffer(target);
if (buff==NULL)
return; // Should generate an error!
// TODO, check parameter consistancie
memcpy(data, buff->data+offset, size);
noerrorShim();
}
void gl4es_glGetNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid * data) {
DBG(printf("glGetNamedBufferSubData(%u, %p, %i, %p)\n", buffer, offset, size, data);)
glbuffer_t *buff = getbuffer_id(buffer);
if (buff==NULL)
return; // Should generate an error!
// TODO, check parameter consistancie
memcpy(data, buff->data+offset, size);
noerrorShim();
}
void gl4es_glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params) {
DBG(printf("glGetBufferPointerv(%s, %s, %p)\n", PrintEnum(target), PrintEnum(pname), params);)
if (!buffer_target(target)) {
errorShim(GL_INVALID_ENUM);
return;
}
glbuffer_t *buff = getbuffer_buffer(target);
if (buff==NULL)
return; // Should generate an error!
if (pname != GL_BUFFER_MAP_POINTER) {
errorShim(GL_INVALID_ENUM);
return;
}
if (!buff->mapped) {
params[0] = NULL;
} else {
params[0] = buff->data;
}
}
void gl4es_glGetNamedBufferPointerv(GLuint buffer, GLenum pname, GLvoid ** params) {
DBG(printf("glGetNamedBufferPointerv(%u, %s, %p)\n", buffer, PrintEnum(pname), params);)
glbuffer_t *buff = getbuffer_id(buffer);
if (buff==NULL)
return; // Should generate an error!
if (pname != GL_BUFFER_MAP_POINTER) {
errorShim(GL_INVALID_ENUM);
return;
}
if (!buff->mapped) {
params[0] = NULL;
} else {
params[0] = buff->data;
}
}
void* gl4es_glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
{
DBG(printf("glMapBuffer(%s, %s)\n", PrintEnum(target), PrintEnum(access));)
if (!buffer_target(target)) {
errorShim(GL_INVALID_ENUM);
return (void*)NULL;
}
if(target==GL_ARRAY_BUFFER)
VaoSharedClear(glstate->vao);
glbuffer_t *buff = getbuffer_buffer(target);
if (buff==NULL)
return (void*)NULL; // Should generate an error!
buff->access = access; // not used
buff->mapped = 1;
noerrorShim();
uintptr_t ret = (uintptr_t)buff->data;
ret += offset;
return (void*)ret; // Not nice, should do some copy or something probably
}
void gl4es_glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
{
// ignored for now. A proprer handling is probably necessary
// but that would mean also proprer handling of MapBuffer in the first place
// with shadow copy for example when in read mode only
}
//Direct wrapper
void glGenBuffers(GLsizei n, GLuint * buffers) AliasExport("gl4es_glGenBuffers");
void glBindBuffer(GLenum target, GLuint buffer) AliasExport("gl4es_glBindBuffer");
void glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) AliasExport("gl4es_glBufferData");
void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) AliasExport("gl4es_glBufferSubData");
void glDeleteBuffers(GLsizei n, const GLuint * buffers) AliasExport("gl4es_glDeleteBuffers");
GLboolean glIsBuffer(GLuint buffer) AliasExport("gl4es_glIsBuffer");
void glGetBufferParameteriv(GLenum target, GLenum value, GLint * data) AliasExport("gl4es_glGetBufferParameteriv");
void *glMapBuffer(GLenum target, GLenum access) AliasExport("gl4es_glMapBuffer");
GLboolean glUnmapBuffer(GLenum target) AliasExport("gl4es_glUnmapBuffer");
void glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) AliasExport("gl4es_glGetBufferSubData");
void glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params) AliasExport("gl4es_glGetBufferPointerv");
void *glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) AliasExport("gl4es_glMapBufferRange");
void glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) AliasExport("gl4es_glFlushMappedBufferRange");
//ARB wrapper
void glGenBuffersARB(GLsizei n, GLuint * buffers) AliasExport("gl4es_glGenBuffers");
void glBindBufferARB(GLenum target, GLuint buffer) AliasExport("gl4es_glBindBuffer");
void glBufferDataARB(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) AliasExport("gl4es_glBufferData");
void glBufferSubDataARB(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) AliasExport("gl4es_glBufferSubData");
void glDeleteBuffersARB(GLsizei n, const GLuint * buffers) AliasExport("gl4es_glDeleteBuffers");
GLboolean glIsBufferARB(GLuint buffer) AliasExport("gl4es_glIsBuffer");
void glGetBufferParameterivARB(GLenum target, GLenum value, GLint * data) AliasExport("gl4es_glGetBufferParameteriv");
void *glMapBufferARB(GLenum target, GLenum access) AliasExport("gl4es_glMapBuffer");
GLboolean glUnmapBufferARB(GLenum target) AliasExport("gl4es_glUnmapBuffer");
void glGetBufferSubDataARB(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) AliasExport("gl4es_glGetBufferSubData");
void glGetBufferPointervARB(GLenum target, GLenum pname, GLvoid ** params) AliasExport("gl4es_glGetBufferPointerv");
//Direct Access
void glNamedBufferData(GLuint buffer, GLsizeiptr size, const GLvoid * data, GLenum usage) AliasExport("gl4es_glNamedBufferData");
void glNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid * data) AliasExport("gl4es_glNamedBufferSubData");
void glGetNamedBufferParameteriv(GLuint buffer, GLenum value, GLint * data) AliasExport("gl4es_glGetNamedBufferParameteriv");
void *glMapNamedBuffer(GLuint buffer, GLenum access) AliasExport("gl4es_glMapNamedBuffer");
GLboolean glUnmapNamedBuffer(GLuint buffer) AliasExport("gl4es_glUnmapNamedBuffer");
void glGetNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid * data) AliasExport("gl4es_glGetNamedBufferSubData");
void glGetNamedBufferPointerv(GLuint buffer, GLenum pname, GLvoid ** params) AliasExport("gl4es_glGetNamedBufferPointerv");
void glNamedBufferDataEXT(GLuint buffer, GLsizeiptr size, const GLvoid * data, GLenum usage) AliasExport("gl4es_glNamedBufferData");
void glNamedBufferSubDataEXT(GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid * data) AliasExport("gl4es_glNamedBufferSubData");
void glGetNamedBufferParameterivEXT(GLuint buffer, GLenum value, GLint * data) AliasExport("gl4es_glGetNamedBufferParameteriv");
void *glMapNamedBufferEXT(GLuint buffer, GLenum access) AliasExport("gl4es_glMapNamedBuffer");
GLboolean glUnmapNamedBufferEXT(GLuint buffer) AliasExport("gl4es_glUnmapNamedBuffer");
void glGetNamedBufferSubDataEXT(GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid * data) AliasExport("gl4es_glGetNamedBufferSubData");
void glGetNamedBufferPointervEXT(GLuint buffer, GLenum pname, GLvoid ** params) AliasExport("gl4es_glGetNamedBufferPointerv");
// VAO ****************
static GLuint lastvao = 1;
void gl4es_glGenVertexArrays(GLsizei n, GLuint *arrays) {
DBG(printf("glGenVertexArrays(%i, %p)\n", n, arrays);)
noerrorShim();
if (n<1) {
errorShim(GL_INVALID_VALUE);
return;
}
for (int i=0; i<n; i++) {
arrays[i] = lastvao++;
}
}
void gl4es_glBindVertexArray(GLuint array) {
DBG(printf("glBindVertexArray(%u)\n", array);)
if (glstate->list.pending)
flush();
khint_t k;
int ret;
khash_t(glvao) *list = glstate->vaos;
// if array = 0 => unbind buffer!
if (array == 0) {
// unbind buffer
glstate->vao = glstate->defaultvao;
} else {
// search for an existing buffer
k = kh_get(glvao, list, array);
glvao_t *glvao = NULL;
if (k == kh_end(list)){
k = kh_put(glvao, list, array, &ret);
glvao = kh_value(list, k) = malloc(sizeof(glvao_t));
// new vao is binded to nothing
VaoInit(glvao);
// TODO: check if should copy status of current VAO instead of cleanning everything
// just put is number
glvao->array = array;
} else {
glvao = kh_value(list, k);
}
glstate->vao = glvao;
}
// TODO: find a better way to do that, to many useless copying stuff
if(glstate->fpe_state)
memcpy(glstate->glesva.wanted, glstate->vao->vertexattrib, MAX_VATTRIB * sizeof(vertexattrib_t));
noerrorShim();
}
void gl4es_glDeleteVertexArrays(GLsizei n, const GLuint *arrays) {
DBG(printf("glDeleteVertexArrays(%i, %p)\n", n, arrays);)
if(!glstate) return;
FLUSH_BEGINEND;
khash_t(glvao) *list = glstate->vaos;
if (list) {
khint_t k;
glvao_t *glvao;
for (int i = 0; i < n; i++) {
GLuint t = arrays[i];
if (t) { // don't allow to remove the default one
k = kh_get(glvao, list, t);
if (k != kh_end(list)) {
glvao = kh_value(list, k);
VaoSharedClear(glvao);
kh_del(glvao, list, k);
//free(glvao); //let the use delete those
}
}
}
}
noerrorShim();
}
GLboolean gl4es_glIsVertexArray(GLuint array) {
DBG(printf("glIsVertexArray(%u)\n", array);)
if(!glstate)
return GL_FALSE;
khash_t(glvao) *list = glstate->vaos;
khint_t k;
noerrorShim();
if (list) {
k = kh_get(glvao, list, array);
if (k != kh_end(list)) {
return GL_TRUE;
}
}
return GL_FALSE;
}
void VaoSharedClear(glvao_t *vao) {
if(vao==NULL || vao->shared_arrays==NULL)
return;
if(!(--(*vao->shared_arrays))) {
free(vao->vert.ptr);
free(vao->color.ptr);
free(vao->secondary.ptr);
free(vao->normal.ptr);
for (int i=0; i<hardext.maxtex; i++)
free(vao->tex[i].ptr);
free(vao->shared_arrays);
}
vao->vert.ptr = NULL;
vao->color.ptr = NULL;
vao->secondary.ptr = NULL;
vao->normal.ptr = NULL;
for (int i=0; i<hardext.maxtex; i++)
vao->tex[i].ptr = NULL;
vao->shared_arrays = NULL;
}
void VaoInit(glvao_t *vao) {
memset(vao, 0, sizeof(glvao_t));
for (int i=0; i<hardext.maxvattrib; i++) {
vao->vertexattrib[i].size = 4;
vao->vertexattrib[i].type = GL_FLOAT;
vao->vertexattrib[i].current[3] = 1.0f;
}
}
//Direct wrapper
void glGenVertexArrays(GLsizei n, GLuint *arrays) AliasExport("gl4es_glGenVertexArrays");
void glBindVertexArray(GLuint array) AliasExport("gl4es_glBindVertexArray");
void glDeleteVertexArrays(GLsizei n, const GLuint *arrays) AliasExport("gl4es_glDeleteVertexArrays");
GLboolean glIsVertexArray(GLuint array) AliasExport("gl4es_glIsVertexArray");

View file

@ -0,0 +1,167 @@
#ifndef _GL4ES_BUFFERS_H_
#define _GL4ES_BUFFERS_H_
#include "khash.h"
#include "../config.h"
#include "gles.h"
// VBO *****************
typedef struct {
GLuint buffer;
GLenum type;
GLsizeiptr size;
GLenum usage;
GLint access;
int mapped;
GLvoid *data;
} glbuffer_t;
KHASH_MAP_DECLARE_INT(buff, glbuffer_t *);
void gl4es_glGenBuffers(GLsizei n, GLuint * buffers);
void gl4es_glBindBuffer(GLenum target, GLuint buffer);
void gl4es_glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
void gl4es_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data);
void gl4es_glDeleteBuffers(GLsizei n, const GLuint * buffers);
GLboolean gl4es_glIsBuffer(GLuint buffer);
void gl4es_glGetBufferParameteriv(GLenum target, GLenum value, GLint * data);
void *gl4es_glMapBuffer(GLenum target, GLenum access);
GLboolean gl4es_glUnmapBuffer(GLenum target);
void gl4es_glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params);
void gl4es_glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data);
void *gl4es_glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
void gl4es_glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length);
void glGenBuffers(GLsizei n, GLuint * buffers);
void glBindBuffer(GLenum target, GLuint buffer);
void glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data);
void glDeleteBuffers(GLsizei n, const GLuint * buffers);
GLboolean glIsBuffer(GLuint buffer);
void glGetBufferParameteriv(GLenum target, GLenum value, GLint * data);
void *glMapBuffer(GLenum target, GLenum access);
GLboolean glUnmapBuffer(GLenum target);
void glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params);
void glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data);
void *glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
void glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length);
void glGenBuffersARB(GLsizei n, GLuint * buffers);
void glBindBufferARB(GLenum target, GLuint buffer);
void glBufferDataARB(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
void glBufferSubDataARB(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data);
void glDeleteBuffersARB(GLsizei n, const GLuint * buffers);
GLboolean glIsBufferARB(GLuint buffer);
void glGetBufferParameterivARB(GLenum target, GLenum value, GLint * data);
void *glMapBufferARB(GLenum target, GLenum access);
GLboolean glUnmapBufferARB(GLenum target);
void glGetBufferSubDataARB(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data);
void glGetBufferPointervARB(GLenum target, GLenum pname, GLvoid ** params);
// Pointer..... ******
typedef struct {
GLint size;
GLenum type;
GLsizei stride;
const GLvoid *pointer;
GLboolean enabled;
} pointer_state_t;
typedef enum {
ATT_VERTEX = 0,
ATT_COLOR,
ATT_MULTITEXCOORD0,
ATT_MULTITEXCOORD1,
ATT_MULTITEXCOORD2,
ATT_MULTITEXCOORD3,
ATT_MULTITEXCOORD4,
ATT_MULTITEXCOORD5,
ATT_MULTITEXCOORD6,
ATT_MULTITEXCOORD7,
ATT_NORMAL,
ATT_SECONDARY,
ATT_FOGCOORD,
//ATT_POINTSIZE, //this one is supported by GLES hardware
ATT_MAX
} reserved_attrib_t;
#define NB_VA (ATT_MAX)
typedef struct {
GLfloat *ptr;
pointer_state_t state;
GLboolean enabled;
} pointer_cache_t;
// Vertex Attrib.. ***
typedef struct {
GLint size;
GLenum type;
GLsizei stride;
const GLvoid* pointer;
GLboolean vaarray;
GLboolean normalized;
glbuffer_t *buffer; // reference buffer
GLfloat current[4];
GLint divisor;
} vertexattrib_t;
// VAO ****************
typedef struct {
GLuint array;
// pointer state
pointer_state_t pointers[NB_VA];
// buffer state
glbuffer_t *vertex;
glbuffer_t *elements;
glbuffer_t *pack;
glbuffer_t *unpack;
// locked arrays
GLboolean locked;
GLsizei count;
GLint first;
GLboolean locked_mapped;
pointer_state_t locked_pointers[NB_VA];
int maxtex; // upper limit enabled tex_coord
// VAO optimisation: keep a shared copy of the digested datas (unless the vao is the default one)
int *shared_arrays;
pointer_cache_t vert;
pointer_cache_t normal;
pointer_cache_t color;
pointer_cache_t secondary;
pointer_cache_t fog;
pointer_cache_t tex[MAX_TEX];
int cache_count;
// Vertex Attrib
vertexattrib_t vertexattrib[MAX_VATTRIB];
// TODO: Cache VA also?
} glvao_t;
void VaoSharedClear(glvao_t *vao);
void VaoInit(glvao_t *vao);
KHASH_MAP_DECLARE_INT(glvao, glvao_t*);
void gl4es_glGenVertexArrays(GLsizei n, GLuint *arrays);
void gl4es_glBindVertexArray(GLuint array);
void gl4es_glDeleteVertexArrays(GLsizei n, const GLuint *arrays);
GLboolean gl4es_glIsVertexArray(GLuint array);
void glGenVertexArrays(GLsizei n, GLuint *arrays);
void glBindVertexArray(GLuint array);
void glDeleteVertexArrays(GLsizei n, const GLuint *arrays);
GLboolean glIsVertexArray(GLuint array);
void gl4es_glNamedBufferData(GLuint buffer, GLsizeiptr size, const GLvoid * data, GLenum usage);
void gl4es_glNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid * data);
void gl4es_glGetNamedBufferParameteriv(GLuint buffer, GLenum value, GLint * data);
void* gl4es_glMapNamedBuffer(GLuint buffer, GLenum access);
GLboolean gl4es_glUnmapNamedBuffer(GLuint buffer);
void gl4es_glGetNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid * data);
void gl4es_glGetNamedBufferPointerv(GLuint buffer, GLenum pname, GLvoid ** params);
#endif // _GL4ES_BUFFERS_H_

View file

@ -0,0 +1,9 @@
#include <stdio.h>
#include "build_info.h"
#include "logs.h"
#include "../../version.h"
void print_build_infos()
{
LOGD("LIBGL: v%d.%d.%d built on %s %s\n", MAJOR, MINOR, REVISION, __DATE__, __TIME__);
}

View file

@ -0,0 +1,6 @@
#ifndef _GL4ES_BUILD_INFO_H_
#define _GL4ES_BUILD_INFO_H_
void print_build_infos();
#endif // _GL4ES_BUILD_INFO_H_

View file

@ -0,0 +1,771 @@
#ifndef _GL4ES_CONST_H_
#define _GL4ES_CONST_H_
#define GL_QUADS 7
#define GL_QUAD_STRIP 8
#define GL_POLYGON 9
#define GL_MAJOR_VERSION 0x821B
#define GL_MINOR_VERSION 0x821C
#define GL_DOUBLEBUFFER 0x0C32
/* texture mapping */
#define GL_TEXTURE_ENV 0x2300
#define GL_TEXTURE_ENV_MODE 0x2200
#define GL_TEXTURE_1D 0x0DE0
#define GL_TEXTURE_2D 0x0DE1
#define GL_TEXTURE_3D 0x806F
#define GL_TEXTURE_WRAP_S 0x2802
#define GL_TEXTURE_WRAP_T 0x2803
#define GL_TEXTURE_WRAP_R 0x8072
#define GL_TEXTURE_MAG_FILTER 0x2800
#define GL_TEXTURE_MIN_FILTER 0x2801
#define GL_TEXTURE_ENV_COLOR 0x2201
#define GL_TEXTURE_GEN_S 0x0C60
#define GL_TEXTURE_GEN_T 0x0C61
#define GL_TEXTURE_GEN_MODE 0x2500
#define GL_TEXTURE_BORDER_COLOR 0x1004
#define GL_TEXTURE_BORDER 0x1005
#define GL_TEXTURE_WIDTH 0x1000
#define GL_TEXTURE_HEIGHT 0x1001
#define GL_TEXTURE_BORDER 0x1005
#define GL_TEXTURE_COMPONENTS 0x1003
#define GL_TEXTURE_RED_SIZE 0x805C
#define GL_TEXTURE_GREEN_SIZE 0x805D
#define GL_TEXTURE_BLUE_SIZE 0x805E
#define GL_TEXTURE_ALPHA_SIZE 0x805F
#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
#define GL_TEXTURE_INTENSITY_SIZE 0x8061
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
#define GL_OBJECT_LINEAR 0x2401
#define GL_OBJECT_PLANE 0x2501
#define GL_EYE_LINEAR 0x2400
#define GL_EYE_PLANE 0x2502
#define GL_SPHERE_MAP 0x2402
#define GL_NORMAL_MAP 0x8511
#define GL_REFLECTION_MAP 0x8512
#define GL_DECAL 0x2101
#define GL_MODULATE 0x2100
#define GL_NEAREST 0x2600
#define GL_REPEAT 0x2901
#define GL_CLAMP 0x2900
#define GL_S 0x2000
#define GL_T 0x2001
#define GL_R 0x2002
#define GL_Q 0x2003
#define GL_TEXTURE_GEN_R 0x0C62
#define GL_TEXTURE_GEN_Q 0x0C63
#define GL_PROXY_TEXTURE_1D 0x8063
#define GL_PROXY_TEXTURE_2D 0x8064
#define GL_PROXY_TEXTURE_3D 0x8070
#define GL_TEXTURE_MIN_LOD 0x813A
#define GL_TEXTURE_MAX_LOD 0x813B
#define GL_TEXTURE_FILTER_CONTROL 0x8500
#define GL_TEXTURE_LOD_BIAS 0x8501
#define GL_TEXTURE_CUBE_MAP 0x8513
#define GL_TEXTURE_GEN_STR 0x8D60
#define GL_CLAMP_TO_BORDER 0x812D
#define GL_MAX_TEXTURE_COORDS 0x8871
#define GL_TEXTURE_COMPARE_MODE 0x884C
// GL_ARB_point_sprite
#define GL_POINT_SPRITE 0x8861
#define GL_COORD_REPLACE 0x8862
// GL_ARB_texture_rectangle
#define GL_TEXTURE_RECTANGLE_ARB 0x84F5
#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6
#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7
#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
#define GL_LINE_SMOOTH 0x0B20
#define GL_LINE_STIPPLE 0x0B24
#define GL_LINE_STIPPLE_PATTERN 0x0B25
#define GL_LINE_STIPPLE_REPEAT 0x0B26
#define GL_LINE_WIDTH 0x0B21
#define GL_LINE_WIDTH_GRANULARITY 0x0B23
#define GL_LINE_WIDTH_RANGE 0x0B22
#define GL_OBJECT_LINEAR 0x2401
#define GL_OBJECT_PLANE 0x2501
#define GL_EYE_LINEAR 0x2400
#define GL_EYE_PLANE 0x2502
#define GL_SPHERE_MAP 0x2402
#define GL_CURRENT_BIT 0x00001
#define GL_POINT_BIT 0x00002
#define GL_LINE_BIT 0x00004
#define GL_POLYGON_BIT 0x00008
#define GL_POLYGON_STIPPLE_BIT 0x00010
#define GL_PIXEL_MODE_BIT 0x00020
#define GL_LIGHTING_BIT 0x00040
#define GL_FOG_BIT 0x00080
// some of these are already defined in GLES
// #define GL_DEPTH_BUFFER_BIT 0x00100
#define GL_ACCUM_BUFFER_BIT 0x00200
// #define GL_STENCIL_BUFFER_BIT 0x00400
#define GL_VIEWPORT_BIT 0x00800
#define GL_TRANSFORM_BIT 0x01000
#define GL_ENABLE_BIT 0x02000
// #define GL_COLOR_BUFFER_BIT 0x04000
#define GL_HINT_BIT 0x08000
#define GL_EVAL_BIT 0x10000
#define GL_LIST_BIT 0x20000
#define GL_TEXTURE_BIT 0x40000
#define GL_SCISSOR_BIT 0x80000
#define GL_ALL_ATTRIB_BITS 0xFFFFF
#define GL_MULTISAMPLE_BIT 0x20000000
#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF
#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
// secondary color
#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
#define GL_SECONDARY_COLOR_ARRAY 0x845E
#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
#define GL_COLOR_SUM 0x8458
#define GL_CURRENT_SECONDARY_COLOR 0x8459
// pixel formats
#define GL_COLOR_INDEX 0x1900
#define GL_RED 0x1903
#define GL_R3_G3_B2 0x2A10
#define GL_RG 0x8227
#define GL_BGR 0x80E0
#define GL_BGRA 0x80E1
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
#define GL_UNSIGNED_INT_8_8_8_8 0x8035
#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
#define GL_UNSIGNED_INT_10_10_10_2 0x8036
#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
#define GL_RGB8 0x8051
#define GL_RGB5 0x8050
#define GL_RGBA8 0x8058
#define GL_RGBA16 0x805B
#define GL_ALPHA4 0x803B
#define GL_ALPHA8 0x803C
#define GL_ALPHA12 0x803D
#define GL_ALPHA16 0x803E
#define GL_ALPHA16F 0x881C
#define GL_ALPHA32F 0x8816
#define GL_LUMINANCE4 0x803F
#define GL_LUMINANCE8 0x8040
#define GL_LUMINANCE12 0x8041
#define GL_LUMINANCE16 0x8042
#define GL_LUMINANCE16F 0x881E
#define GL_LUMINANCE32F 0x8818
#define GL_LUMINANCE4_ALPHA4 0x8043
#define GL_LUMINANCE6_ALPHA2 0x8044
#define GL_LUMINANCE8_ALPHA8 0x8045
#define GL_LUMINANCE12_ALPHA4 0x8046
#define GL_LUMINANCE12_ALPHA12 0x8047
#define GL_LUMINANCE16_ALPHA16 0x8048
#define GL_LUMINANCE_ALPHA16F 0x881F
#define GL_LUMINANCE_ALPHA32F 0x8819
#define GL_INTENSITY 0x8049
#define GL_INTENSITY4 0x804A
#define GL_INTENSITY8 0x804B
#define GL_INTENSITY12 0x804C
#define GL_INTENSITY16 0x804D
#define GL_INTENSITY16F 0x881D
#define GL_INTENSITY32F 0x8817
#define GL_RGB10_A2 0x8059
#define GL_RGBA16F 0x881A
#define GL_RGB16F 0x881B
#define GL_RGBA32F 0x8814
#define GL_RGB32F 0x8815
#define GL_LUMINANCE16_ALPHA16 0x8048
#define GL_RGB16 0x8054
#define GL_RGBA4 0x8056
#define GL_RGB5_A1 0x8057
#define GL_COMPRESSED_ALPHA 0x84E9
#define GL_COMPRESSED_LUMINANCE 0x84EA
#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
#define GL_COMPRESSED_INTENSITY 0x84EC
#define GL_COMPRESSED_RGB 0x84ED
#define GL_COMPRESSED_RGBA 0x84EE
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
#define GL_HALF_FLOAT_OES 0x8D61
#define GL_RGB565 0x8D62
// types
#define GL_BYTE 0x1400
#define GL_UNSIGNED_BYTE 0x1401
#define GL_SHORT 0x1402
#define GL_UNSIGNED_SHORT 0x1403
#define GL_INT 0x1404
#define GL_UNSIGNED_INT 0x1405
#define GL_FLOAT 0x1406
#define GL_2_BYTES 0x1407
#define GL_3_BYTES 0x1408
#define GL_4_BYTES 0x1409
#define GL_DOUBLE 0x140A
#define GL_HALF_FLOAT 0x140B
#define GL_BITMAP 0x1A00
#define GL_COMPILE 0x1300
#define GL_COMPILE_AND_EXECUTE 0x1301
// fog
#define GL_FOG 0x0B60
#define GL_FOG_MODE 0x0B65
#define GL_FOG_DENSITY 0x0B62
#define GL_FOG_COLOR 0x0B66
#define GL_FOG_INDEX 0x0B61
#define GL_FOG_START 0x0B63
#define GL_FOG_END 0x0B64
#define GL_LINEAR 0x2601
#define GL_EXP 0x0800
#define GL_EXP2 0x0801
#define GL_FOG_COORDINATE_SOURCE 0x8450
#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE
#define GL_FRAGMENT_DEPTH 0x8452
#define GL_FOG_COORDINATE 0x8451
#define GL_FOG_COORD GL_FOG_COORDINATE
#define GL_CURRENT_FOG_COORD 0x8453
#define GL_FOG_COORD_ARRAY_TYPE 0x8454
#define GL_FOG_COORD_ARRAY_STRIDE 0x8455
#define GL_FOG_COORD_ARRAY_POINTER 0x8456
#define GL_FOG_COORD_ARRAY 0x8457
#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D
// lighting
#define GL_LIGHTING 0x0B50
#define GL_LIGHT0 0x4000
#define GL_LIGHT1 0x4001
#define GL_LIGHT2 0x4002
#define GL_LIGHT3 0x4003
#define GL_LIGHT4 0x4004
#define GL_LIGHT5 0x4005
#define GL_LIGHT6 0x4006
#define GL_LIGHT7 0x4007
#define GL_SPOT_EXPONENT 0x1205
#define GL_SPOT_CUTOFF 0x1206
#define GL_CONSTANT_ATTENUATION 0x1207
#define GL_LINEAR_ATTENUATION 0x1208
#define GL_QUADRATIC_ATTENUATION 0x1209
#define GL_AMBIENT 0x1200
#define GL_DIFFUSE 0x1201
#define GL_SPECULAR 0x1202
#define GL_SHININESS 0x1601
#define GL_EMISSION 0x1600
#define GL_POSITION 0x1203
#define GL_SPOT_DIRECTION 0x1204
#define GL_AMBIENT_AND_DIFFUSE 0x1602
#define GL_COLOR_INDEXES 0x1603
#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
#define GL_LIGHT_MODEL_AMBIENT 0x0B53
#define GL_FRONT_AND_BACK 0x0408
#define GL_SHADE_MODEL 0x0B54
#define GL_FLAT 0x1D00
#define GL_SMOOTH 0x1D01
#define GL_COLOR_MATERIAL 0x0B57
#define GL_COLOR_MATERIAL_FACE 0x0B55
#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
#define GL_NORMALIZE 0x0BA1
#define GL_DRAW_BUFFER 0x0C01
#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
#define GL_SINGLE_COLOR 0x81F9
#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
// stencil
#define GL_STENCIL_BACK_FUNC 0x8800
#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
#define GL_STENCIL_BACK_REF 0x8CA3
#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
#define GL_STENCIL_BACK_FAIL 0x8801
#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
// pixel transfer
#define GL_MAP_COLOR 0x0D10
#define GL_MAP_STENCIL 0x0D11
#define GL_INDEX_SHIFT 0x0D12
#define GL_INDEX_OFFSET 0x0D13
#define GL_RED_SCALE 0x0D14
#define GL_RED_BIAS 0x0D15
#define GL_GREEN_SCALE 0x0D18
#define GL_GREEN_BIAS 0x0D19
#define GL_BLUE_SCALE 0x0D1A
#define GL_BLUE_BIAS 0x0D1B
#define GL_ALPHA_SCALE 0x0D1C
#define GL_ALPHA_BIAS 0x0D1D
#define GL_DEPTH_SCALE 0x0D1E
#define GL_DEPTH_BIAS 0x0D1F
#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1
#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0
#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2
#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3
#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4
#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5
#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6
#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7
#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8
#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9
#define GL_PIXEL_MAP_S_TO_S 0x0C71
#define GL_PIXEL_MAP_I_TO_I 0x0C70
#define GL_PIXEL_MAP_I_TO_R 0x0C72
#define GL_PIXEL_MAP_I_TO_G 0x0C73
#define GL_PIXEL_MAP_I_TO_B 0x0C74
#define GL_PIXEL_MAP_I_TO_A 0x0C75
#define GL_PIXEL_MAP_R_TO_R 0x0C76
#define GL_PIXEL_MAP_G_TO_G 0x0C77
#define GL_PIXEL_MAP_B_TO_B 0x0C78
#define GL_PIXEL_MAP_A_TO_A 0x0C79
#define GL_PACK_ALIGNMENT 0x0D05
#define GL_PACK_LSB_FIRST 0x0D01
#define GL_PACK_ROW_LENGTH 0x0D02
#define GL_PACK_SKIP_PIXELS 0x0D04
#define GL_PACK_SKIP_ROWS 0x0D03
#define GL_PACK_SWAP_BYTES 0x0D00
#define GL_UNPACK_ALIGNMENT 0x0CF5
#define GL_UNPACK_LSB_FIRST 0x0CF1
#define GL_UNPACK_ROW_LENGTH 0x0CF2
#define GL_UNPACK_SKIP_PIXELS 0x0CF4
#define GL_UNPACK_SKIP_ROWS 0x0CF3
#define GL_UNPACK_SWAP_BYTES 0x0CF0
#define GL_UNPACK_IMAGE_HEIGHT 0x806E
#define GL_PACK_IMAGE_HEIGHT 0x806C
#define GL_ZOOM_X 0x0D16
#define GL_ZOOM_Y 0x0D17
#define GL_MAX_PIXEL_MAP_TABLE 0x0D34
#define GL_TEXTURE_BASE_LEVEL 0x813C
// blending
#define GL_BLEND 0x0BE2
#define GL_BLEND_SRC 0x0BE1
#define GL_BLEND_DST 0x0BE0
#define GL_SRC_COLOR 0x0300
#define GL_ONE_MINUS_SRC_COLOR 0x0301
#define GL_SRC_ALPHA 0x0302
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
#define GL_DST_ALPHA 0x0304
#define GL_ONE_MINUS_DST_ALPHA 0x0305
#define GL_DST_COLOR 0x0306
#define GL_ONE_MINUS_DST_COLOR 0x0307
#define GL_SRC_ALPHA_SATURATE 0x0308
#define GL_CONSTANT_COLOR 0x8001
#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
#define GL_CONSTANT_ALPHA 0x8003
#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
#define GL_DOT3_RGB_EXT 0x8740
#define GL_DOT3_RGBA_EXT 0x8741
#define GL_BLEND_DST_RGB 0x80C8
#define GL_BLEND_SRC_RGB 0x80C9
#define GL_BLEND_DST_ALPHA 0x80CA
#define GL_BLEND_SRC_ALPHA 0x80CB
// glGet
#define GL_AUX_BUFFERS 0x0C00
#define GL_MAX_ELEMENTS_VERTICES 0x80E8
#define GL_MAX_ELEMENTS_INDICES 0x80E9
#define GL_POINT_SIZE_RANGE 0x0B12
#define GL_RENDER_MODE 0x0C40
#define GL_NAME_STACK_DEPTH 0x0D70
#define GL_MAX_NAME_STACK_DEPTH 0x0D37
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
#define GL_INDEX_ARRAY_POINTER 0x8091
#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
#define GL_SELECTION_BUFFER_POINTER 0x0DF3
// evaluators
#define GL_AUTO_NORMAL 0x0D80
#define GL_MAP1_COLOR_4 0x0D90
#define GL_MAP1_INDEX 0x0D91
#define GL_MAP1_NORMAL 0x0D92
#define GL_MAP1_TEXTURE_COORD_1 0x0D93
#define GL_MAP1_TEXTURE_COORD_2 0x0D94
#define GL_MAP1_TEXTURE_COORD_3 0x0D95
#define GL_MAP1_TEXTURE_COORD_4 0x0D96
#define GL_MAP1_VERTEX_3 0x0D97
#define GL_MAP1_VERTEX_4 0x0D98
#define GL_MAP2_COLOR_4 0x0DB0
#define GL_MAP2_INDEX 0x0DB1
#define GL_MAP2_NORMAL 0x0DB2
#define GL_MAP2_TEXTURE_COORD_1 0x0DB3
#define GL_MAP2_TEXTURE_COORD_2 0x0DB4
#define GL_MAP2_TEXTURE_COORD_3 0x0DB5
#define GL_MAP2_TEXTURE_COORD_4 0x0DB6
#define GL_MAP2_VERTEX_3 0x0DB7
#define GL_MAP2_VERTEX_4 0x0DB8
#define GL_MAP1_GRID_DOMAIN 0x0DD0
#define GL_MAP1_GRID_SEGMENTS 0x0DD1
#define GL_MAP2_GRID_DOMAIN 0x0DD2
#define GL_MAP2_GRID_SEGMENTS 0x0DD3
#define GL_COEFF 0x0A00
#define GL_ORDER 0x0A01
#define GL_DOMAIN 0x0A02
#define GL_MAX_LIST_NESTING 0x0B31
/* polygons */
#define GL_POINT 0x1B00
#define GL_LINE 0x1B01
#define GL_FILL 0x1B02
#define GL_CW 0x0900
#define GL_CCW 0x0901
#define GL_FRONT 0x0404
#define GL_BACK 0x0405
#define GL_POLYGON_MODE 0x0B40
#define GL_POLYGON_SMOOTH 0x0B41
#define GL_POLYGON_STIPPLE 0x0B42
#define GL_EDGE_FLAG 0x0B43
#define GL_CULL_FACE 0x0B44
#define GL_CULL_FACE_MODE 0x0B45
#define GL_FRONT_FACE 0x0B46
#define GL_POLYGON_OFFSET_FACTOR 0x8038
#define GL_POLYGON_OFFSET_UNITS 0x2A00
#define GL_POLYGON_OFFSET_POINT 0x2A01
#define GL_POLYGON_OFFSET_LINE 0x2A02
/* Shader Source */
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
#define GL_COMPILE_STATUS 0x8B81
#define GL_INFO_LOG_LENGTH 0x8B84
#define GL_SHADER_SOURCE_LENGTH 0x8B88
#define GL_SHADER_COMPILER 0x8DFA
/* Shader Binary */
#define GL_SHADER_BINARY_FORMATS 0x8DF8
#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
/* Shader Precision-Specified Types */
#define GL_LOW_FLOAT 0x8DF0
#define GL_MEDIUM_FLOAT 0x8DF1
#define GL_HIGH_FLOAT 0x8DF2
#define GL_LOW_INT 0x8DF3
#define GL_MEDIUM_INT 0x8DF4
#define GL_HIGH_INT 0x8DF5
/* Texture Parameters */
#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
#define GL_TEXTURE_RED_SIZE 0x805C
#define GL_TEXTURE_GREEN_SIZE 0x805D
#define GL_TEXTURE_BLUE_SIZE 0x805E
#define GL_TEXTURE_ALPHA_SIZE 0x805F
#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
#define GL_TEXTURE_INTENSITY_SIZE 0x8061
#define GL_TEXTURE_RED_TYPE 0x8C10
#define GL_TEXTURE_GREEN_TYPE 0x8C11
#define GL_TEXTURE_BLUE_TYPE 0x8C12
#define GL_TEXTURE_ALPHA_TYPE 0x8C13
#define GL_TEXTURE_DEPTH_TYPE 0x8C16
#define GL_TEXTURE_DEPTH 0x8071
#define GL_TEXTURE_DEPTH_SIZE 0x884A
#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
#define GL_TEXTURE_COMPRESSED 0x86A1
#define GL_TEXTURE_MAX_LEVEL 0x813D
/* Compressed Textures */
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
/* Render Mode */
#define GL_SELECT 0x1c02
#define GL_RENDER 0x1C00
/* Interleaved Array */
#define GL_V2F 0x2A20
#define GL_V3F 0x2A21
#define GL_C4UB_V2F 0x2A22
#define GL_C4UB_V3F 0x2A23
#define GL_C3F_V3F 0x2A24
#define GL_N3F_V3F 0x2A25
#define GL_C4F_N3F_V3F 0x2A26
#define GL_T2F_V3F 0x2A27
#define GL_T4F_V4F 0x2A28
#define GL_T2F_C4UB_V3F 0x2A29
#define GL_T2F_C3F_V3F 0x2A2A
#define GL_T2F_N3F_V3F 0x2A2B
#define GL_T2F_C4F_N3F_V3F 0x2A2C
#define GL_T4F_C4F_N3F_V4F 0x2A2D
/* Buffers Array */
#define GL_BUFFER_SIZE 0x8764
#define GL_BUFFER_USAGE 0x8765
#define GL_QUERY_COUNTER_BITS 0x8864
#define GL_CURRENT_QUERY 0x8865
#define GL_QUERY_RESULT 0x8866
#define GL_QUERY_RESULT_AVAILABLE 0x8867
#define GL_ARRAY_BUFFER 0x8892
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
#define GL_ARRAY_BUFFER_BINDING 0x8894
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
#define GL_READ_ONLY 0x88B8
#define GL_WRITE_ONLY 0x88B9
#define GL_READ_WRITE 0x88BA
#define GL_BUFFER_ACCESS 0x88BB
#define GL_BUFFER_MAPPED 0x88BC
#define GL_BUFFER_MAP_POINTER 0x88BD
#define GL_STREAM_DRAW 0x88E0
#define GL_STREAM_READ 0x88E1
#define GL_STREAM_COPY 0x88E2
#define GL_STATIC_DRAW 0x88E4
#define GL_STATIC_READ 0x88E5
#define GL_STATIC_COPY 0x88E6
#define GL_DYNAMIC_DRAW 0x88E8
#define GL_DYNAMIC_READ 0x88E9
#define GL_DYNAMIC_COPY 0x88EA
#define GL_SAMPLES_PASSED 0x8914
#define GL_SRC1_ALPHA 0x8589
#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
#define GL_MAP_READ_BIT 0x0001
#define GL_MAP_WRITE_BIT 0x0002
#define GL_BUFFER_ACCESS_FLAGS 0x911F
#define GL_BUFFER_MAP_LENGTH 0x9120
#define GL_BUFFER_MAP_OFFSET 0x9121
#define GL_READ_ONLY 0x88B8
#define GL_WRITE_ONLY 0x88B9
#define GL_READ_WRITE 0x88BA
#define GL_PIXEL_PACK_BUFFER 0x88EB
#define GL_PIXEL_UNPACK_BUFFER 0x88EC
#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
#define GL_CURRENT_VERTEX_ATTRIB 0x8626
/* Framebuffers */
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
#define GL_FRAMEBUFFER_DEFAULT 0x8218
#define GL_FRAMEBUFFER_UNDEFINED 0x8219
#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
#define GL_DEPTH_STENCIL 0x84F9
#define GL_UNSIGNED_INT_24_8 0x84FA
#define GL_DEPTH24_STENCIL8 0x88F0
#define GL_TEXTURE_STENCIL_SIZE 0x88F1
#define GL_TEXTURE_RED_TYPE 0x8C10
#define GL_TEXTURE_GREEN_TYPE 0x8C11
#define GL_TEXTURE_BLUE_TYPE 0x8C12
#define GL_TEXTURE_ALPHA_TYPE 0x8C13
#define GL_TEXTURE_DEPTH_TYPE 0x8C16
#define GL_UNSIGNED_NORMALIZED 0x8C17
#define GL_FRAMEBUFFER_BINDING 0x8CA6
#ifndef GL_DRAW_FRAMEBUFFER_BINDING
#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING
#endif
#define GL_RENDERBUFFER_BINDING 0x8CA7
#define GL_READ_FRAMEBUFFER 0x8CA8
#define GL_DRAW_FRAMEBUFFER 0x8CA9
#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
#define GL_RENDERBUFFER_SAMPLES 0x8CAB
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
#define GL_COLOR_ATTACHMENT0 0x8CE0
#define GL_COLOR_ATTACHMENT1 0x8CE1
#define GL_COLOR_ATTACHMENT2 0x8CE2
#define GL_COLOR_ATTACHMENT3 0x8CE3
#define GL_COLOR_ATTACHMENT4 0x8CE4
#define GL_COLOR_ATTACHMENT5 0x8CE5
#define GL_COLOR_ATTACHMENT6 0x8CE6
#define GL_COLOR_ATTACHMENT7 0x8CE7
#define GL_COLOR_ATTACHMENT8 0x8CE8
#define GL_COLOR_ATTACHMENT9 0x8CE9
#define GL_COLOR_ATTACHMENT10 0x8CEA
#define GL_COLOR_ATTACHMENT11 0x8CEB
#define GL_COLOR_ATTACHMENT12 0x8CEC
#define GL_COLOR_ATTACHMENT13 0x8CED
#define GL_COLOR_ATTACHMENT14 0x8CEE
#define GL_COLOR_ATTACHMENT15 0x8CEF
#define GL_DEPTH_ATTACHMENT 0x8D00
#define GL_STENCIL_ATTACHMENT 0x8D20
#define GL_FRAMEBUFFER 0x8D40
#define GL_RENDERBUFFER 0x8D41
#define GL_RENDERBUFFER_WIDTH 0x8D42
#define GL_RENDERBUFFER_HEIGHT 0x8D43
#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
#define GL_STENCIL_INDEX1 0x8D46
#define GL_STENCIL_INDEX4 0x8D47
#define GL_STENCIL_INDEX8 0x8D48
#define GL_STENCIL_INDEX16 0x8D49
#define GL_RENDERBUFFER_RED_SIZE 0x8D50
#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
#define GL_MAX_SAMPLES 0x8D57
#define GL_INDEX 0x8222
#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14
#define GL_TEXTURE_INTENSITY_TYPE 0x8C15
#define GL_DEPTH_COMPONENT32 0x81A7
#define GL_DEPTH_COMPONENT24 0x81A6
#define GL_DEPTH_COMPONENT16 0x81A5
#define GL_DEPTH_COMPONENT 0x1902
#define GL_MAX_DRAW_BUFFERS_ARB 0x8824
// point sprite extension
#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
#define GL_LOWER_LEFT 0x8CA1
#define GL_UPPER_LEFT 0x8CA2
// clear buffer
#define GL_COLOR 0x1800
#define GL_DEPTH 0x1801
#define GL_STENCIL 0x1802
// direct state
#define GL_MATRIX0_ARB 0x88C0
#define GL_PROGRAM_MATRIX_EXT 0x8E2D
#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E
#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F
#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7
#define GL_CURRENT_MATRIX_ARB 0x8641
#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E
#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D
#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C
#define GL_TEXTURE_BINDING_1D 0x8068
#define GL_TEXTURE_BINDING_2D 0x8069
#define GL_TEXTURE_BINDING_3D 0x806A
#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
#define GL_TEXTURE_COORD_ARRAY_COUNT 0x808B
// cube mapping
#define GL_TEXTURE_CUBE_MAP 0x8513
#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
#define GL_AX_CUBE_MAP_TEXTURE_SIZE 0x851C
// Shaders
#define GL_FRAGMENT_SHADER 0x8B30
#define GL_VERTEX_SHADER 0x8B31
#define GL_MAX_VERTEX_ATTRIBS 0x8869
#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
#define GL_MAX_VARYING_VECTORS 0x8DFC
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
#define GL_SHADER_TYPE 0x8B4F
#define GL_DELETE_STATUS 0x8B80
#define GL_LINK_STATUS 0x8B82
#define GL_VALIDATE_STATUS 0x8B83
#define GL_ATTACHED_SHADERS 0x8B85
#define GL_ACTIVE_UNIFORMS 0x8B86
#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
#define GL_ACTIVE_ATTRIBUTES 0x8B89
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
#define GL_CURRENT_PROGRAM 0x8B8D
// Shaders extensions
#define GL_PROGRAM_BINARY_LENGTH 0x8741
#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
#define GL_PROGRAM_BINARY_FORMATS 0x87FF
#define GL_PROGRAM_OBJECT_ARB 0x8B40
// Vertex Arrays
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
// Uniform Types
#define GL_FLOAT_VEC2 0x8B50
#define GL_FLOAT_VEC3 0x8B51
#define GL_FLOAT_VEC4 0x8B52
#define GL_INT_VEC2 0x8B53
#define GL_INT_VEC3 0x8B54
#define GL_INT_VEC4 0x8B55
#define GL_BOOL 0x8B56
#define GL_BOOL_VEC2 0x8B57
#define GL_BOOL_VEC3 0x8B58
#define GL_BOOL_VEC4 0x8B59
#define GL_FLOAT_MAT2 0x8B5A
#define GL_FLOAT_MAT3 0x8B5B
#define GL_FLOAT_MAT4 0x8B5C
#define GL_SAMPLER_2D 0x8B5E
#define GL_SAMPLER_CUBE 0x8B60
// Getter
#define GL_NUM_EXTENSIONS 0x821D
// Anisotropic
#define GL_TEXTURE_MAX_ANISOTROPY 0x84FE
#define GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF
// ATI_texture_env_combine3
#define GL_MODULATE_ADD_ATI 0x8744
#define GL_MODULATE_SIGNED_ADD_ATI 0x8745
#define GL_MODULATE_SUBTRACT_ATI 0x8746
// ATIX_texture_env_route
#define GL_SECONDARY_COLOR_ATIX 0x8747
#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748
#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749
//GL_NV_texture_env_combine4
#define GL_COMBINE4 0x8503
#define GL_SRC3_RGB 0x8583
#define GL_SRC3_ALPHA 0x858B
#define GL_OPERAND3_RGB 0x8593
#define GL_OPERAND3_ALPHA 0x859B
//GL_ARB_instanced_arrays
#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
#endif // _GL4ES_CONST_H_

View file

@ -0,0 +1,368 @@
#include "debug.h"
#include <string.h>
#include "wrap/gles.h"
#include "const.h"
#include "loader.h"
#include "logs.h"
#include "gl4es.h"
#include "gles.h"
#define p(a) \
case a: return #a
const char* PrintEnum(GLenum what) {
static char fallback[64];
switch(what)
{
// error
p(GL_INVALID_ENUM);
p(GL_INVALID_VALUE);
p(GL_INVALID_OPERATION);
// target
p(GL_TEXTURE_1D);
p(GL_TEXTURE_2D);
p(GL_TEXTURE_3D);
p(GL_TEXTURE_RECTANGLE_ARB);
p(GL_FRAMEBUFFER);
p(GL_RENDERBUFFER);
p(GL_PROXY_TEXTURE_1D);
p(GL_PROXY_TEXTURE_2D);
p(GL_PROXY_TEXTURE_3D);
p(GL_READ_FRAMEBUFFER);
p(GL_DRAW_FRAMEBUFFER);
p(GL_TEXTURE_CUBE_MAP);
p(GL_TEXTURE_CUBE_MAP_POSITIVE_X);
p(GL_TEXTURE_CUBE_MAP_NEGATIVE_X);
p(GL_TEXTURE_CUBE_MAP_POSITIVE_Y);
p(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y);
p(GL_TEXTURE_CUBE_MAP_POSITIVE_Z);
p(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z);
// format
p(GL_COLOR_INDEX);
p(GL_RED);
p(GL_R);
p(GL_R3_G3_B2);
p(GL_RGB);
p(GL_BGR);
p(GL_RGB8);
p(GL_RGB5);
p(GL_RGB16);
p(GL_RGB16F);
p(GL_RGB32F);
p(GL_BGRA);
p(GL_RGBA);
p(GL_RGBA4);
p(GL_RGB5_A1);
p(GL_RGB10_A2);
p(GL_RGBA8);
p(GL_RGBA16);
p(GL_RGBA16F);
p(GL_RGBA32F);
p(GL_COMPRESSED_RGB_S3TC_DXT1_EXT);
p(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT);
p(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT);
p(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT);
p(GL_LUMINANCE8_ALPHA8);
p(GL_LUMINANCE_ALPHA);
p(GL_LUMINANCE4_ALPHA4);
p(GL_LUMINANCE16_ALPHA16);
p(GL_LUMINANCE_ALPHA16F);
p(GL_LUMINANCE_ALPHA32F);
p(GL_LUMINANCE);
p(GL_ALPHA);
p(GL_LUMINANCE8);
p(GL_LUMINANCE16);
p(GL_LUMINANCE16F);
p(GL_LUMINANCE32F);
p(GL_ALPHA8);
p(GL_ALPHA16F);
p(GL_ALPHA32F);
p(GL_COMPRESSED_ALPHA);
p(GL_COMPRESSED_LUMINANCE);
p(GL_COMPRESSED_LUMINANCE_ALPHA);
p(GL_COMPRESSED_RGB);
p(GL_COMPRESSED_RGBA);
p(GL_HALF_FLOAT);
p(GL_INTENSITY);
p(GL_INTENSITY8);
p(GL_INTENSITY16F);
p(GL_INTENSITY32F);
p(GL_DEPTH_STENCIL);
// type
p(GL_BYTE);
p(GL_UNSIGNED_BYTE);
p(GL_UNSIGNED_BYTE_2_3_3_REV);
p(GL_UNSIGNED_BYTE_3_3_2);
p(GL_UNSIGNED_INT);
p(GL_UNSIGNED_SHORT);
p(GL_UNSIGNED_SHORT_5_5_5_1);
p(GL_UNSIGNED_SHORT_1_5_5_5_REV);
p(GL_UNSIGNED_SHORT_4_4_4_4);
p(GL_UNSIGNED_SHORT_4_4_4_4_REV);
p(GL_UNSIGNED_SHORT_5_6_5);
p(GL_UNSIGNED_SHORT_5_6_5_REV);
p(GL_UNSIGNED_INT_8_8_8_8_REV);
p(GL_UNSIGNED_INT_8_8_8_8);
p(GL_FLOAT);
p(GL_DOUBLE);
p(GL_UNSIGNED_INT_24_8);
// texture infos
p(GL_TEXTURE_WIDTH);
p(GL_TEXTURE_HEIGHT);
p(GL_TEXTURE_COMPRESSED);
p(GL_TEXTURE_BORDER);
p(GL_TEXTURE_INTERNAL_FORMAT);
p(GL_MAX_TEXTURE_SIZE);
p(GL_MAX_TEXTURE_COORDS);
// texture pack/unpack
p(GL_UNPACK_ALIGNMENT);
p(GL_PACK_ALIGNMENT);
p(GL_UNPACK_ROW_LENGTH);
// framebuffer
p(GL_COLOR_ATTACHMENT0);
p(GL_COLOR_ATTACHMENT1);
p(GL_COLOR_ATTACHMENT2);
p(GL_COLOR_ATTACHMENT3);
p(GL_COLOR_ATTACHMENT4);
p(GL_DEPTH_ATTACHMENT);
p(GL_DEPTH_STENCIL_ATTACHMENT);
p(GL_STENCIL_ATTACHMENT);
p(GL_DEPTH_COMPONENT);
p(GL_DEPTH24_STENCIL8);
p(GL_MAX_DRAW_BUFFERS_ARB);
// VBO
p(GL_STATIC_DRAW);
p(GL_READ_WRITE);
p(GL_ARRAY_BUFFER);
p(GL_ELEMENT_ARRAY_BUFFER);
p(GL_PIXEL_PACK_BUFFER);
p(GL_PIXEL_UNPACK_BUFFER);
// Texture
p(GL_TEXTURE0);
p(GL_TEXTURE1);
p(GL_TEXTURE2);
p(GL_TEXTURE3);
p(GL_TEXTURE4);
p(GL_TEXTURE5);
p(GL_TEXTURE6);
p(GL_TEXTURE7);
p(GL_TEXTURE_WRAP_S);
p(GL_TEXTURE_WRAP_T);
p(GL_LINEAR);
p(GL_NEAREST);
p(GL_NEAREST_MIPMAP_NEAREST);
p(GL_NEAREST_MIPMAP_LINEAR);
p(GL_LINEAR_MIPMAP_NEAREST);
p(GL_LINEAR_MIPMAP_LINEAR);
p(GL_TEXTURE_MAX_LEVEL);
p(GL_TEXTURE_BASE_LEVEL);
p(GL_TEXTURE_MIN_FILTER);
p(GL_TEXTURE_MAG_FILTER);
p(GL_CLAMP_TO_EDGE);
p(GL_REPEAT);
p(GL_MIRRORED_REPEAT_OES);
p(GL_GENERATE_MIPMAP);
// mode
p(GL_POINTS);
p(GL_LINES);
p(GL_LINE_LOOP);
p(GL_LINE_STRIP);
p(GL_TRIANGLES);
p(GL_TRIANGLE_STRIP);
p(GL_TRIANGLE_FAN);
p(GL_QUADS);
p(GL_QUAD_STRIP);
p(GL_POLYGON);
// texgen
p(GL_S);
p(GL_T);
p(GL_Q);
p(GL_TEXTURE_GEN_MODE);
p(GL_OBJECT_LINEAR);
p(GL_EYE_LINEAR);
p(GL_SPHERE_MAP);
p(GL_NORMAL_MAP);
p(GL_REFLECTION_MAP);
p(GL_TEXTURE_GEN_S);
p(GL_TEXTURE_GEN_T);
p(GL_TEXTURE_GEN_R);
p(GL_TEXTURE_GEN_Q);
// matrix mode
p(GL_PROJECTION);
p(GL_MODELVIEW);
p(GL_TEXTURE);
// blend
p(GL_SRC_ALPHA);
p(GL_DST_ALPHA);
p(GL_ONE_MINUS_SRC_ALPHA);
p(GL_ONE_MINUS_DST_ALPHA);
// lights
p(GL_LIGHT0);
p(GL_LIGHT1);
p(GL_LIGHT2);
p(GL_LIGHT3);
p(GL_LIGHT4);
p(GL_LIGHT5);
p(GL_LIGHT6);
p(GL_LIGHT7);
p(GL_AMBIENT);
p(GL_DIFFUSE);
p(GL_SPECULAR);
p(GL_POSITION);
p(GL_SPOT_DIRECTION);
p(GL_SPOT_EXPONENT);
p(GL_SPOT_CUTOFF);
p(GL_CONSTANT_ATTENUATION);
p(GL_LINEAR_ATTENUATION);
p(GL_QUADRATIC_ATTENUATION);
// Misc enabled
p(GL_LIGHTING);
p(GL_NORMALIZE);
p(GL_CULL_FACE);
p(GL_DEPTH_TEST);
p(GL_RESCALE_NORMAL);
p(GL_ALPHA_TEST);
p(GL_ALPHA_TEST_FUNC);
p(GL_BLEND);
p(GL_BLEND_SRC);
p(GL_BLEND_DST);
p(GL_LOGIC_OP_MODE);
// uniform type
p(GL_FLOAT_VEC2);
p(GL_FLOAT_VEC3);
p(GL_FLOAT_VEC4);
p(GL_INT_VEC2);
p(GL_INT_VEC3);
p(GL_INT_VEC4);
p(GL_BOOL);
p(GL_BOOL_VEC2);
p(GL_BOOL_VEC3);
p(GL_BOOL_VEC4);
p(GL_FLOAT_MAT2);
p(GL_FLOAT_MAT3);
p(GL_FLOAT_MAT4);
p(GL_SAMPLER_2D);
p(GL_SAMPLER_CUBE);
// Shaders
p(GL_FRAGMENT_SHADER);
p(GL_VERTEX_SHADER);
p(GL_MAX_VERTEX_ATTRIBS);
p(GL_MAX_VERTEX_UNIFORM_VECTORS);
p(GL_MAX_VARYING_VECTORS);
p(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS);
p(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS);
p(GL_MAX_TEXTURE_IMAGE_UNITS);
p(GL_MAX_FRAGMENT_UNIFORM_VECTORS);
p(GL_SHADER_TYPE);
p(GL_DELETE_STATUS);
p(GL_LINK_STATUS);
p(GL_COMPILE_STATUS);
p(GL_VALIDATE_STATUS);
p(GL_ATTACHED_SHADERS);
p(GL_ACTIVE_UNIFORMS);
p(GL_ACTIVE_UNIFORM_MAX_LENGTH);
p(GL_ACTIVE_ATTRIBUTES);
p(GL_ACTIVE_ATTRIBUTE_MAX_LENGTH);
p(GL_SHADING_LANGUAGE_VERSION);
p(GL_CURRENT_PROGRAM);
p(GL_PROGRAM_BINARY_LENGTH);
p(GL_NUM_PROGRAM_BINARY_FORMATS);
p(GL_PROGRAM_BINARY_FORMATS);
p(GL_INFO_LOG_LENGTH);
// Client State
p(GL_VERTEX_ARRAY);
p(GL_COLOR_ARRAY);
p(GL_NORMAL_ARRAY);
p(GL_TEXTURE_COORD_ARRAY);
p(GL_SECONDARY_COLOR_ARRAY);
p(GL_FOG_COORD_ARRAY);
// TexEnv
p(GL_POINT_SPRITE);
p(GL_COORD_REPLACE);
p(GL_TEXTURE_FILTER_CONTROL);
p(GL_TEXTURE_LOD_BIAS);
p(GL_TEXTURE_ENV);
p(GL_TEXTURE_ENV_MODE);
p(GL_MODULATE);
p(GL_ADD);
p(GL_DECAL);
p(GL_REPLACE);
p(GL_COMBINE);
p(GL_COMBINE_RGB);
p(GL_ADD_SIGNED);
p(GL_INTERPOLATE);
p(GL_SUBTRACT);
p(GL_DOT3_RGB);
p(GL_DOT3_RGBA);
p(GL_COMBINE_ALPHA);
p(GL_SRC0_RGB);
p(GL_SRC1_RGB);
p(GL_SRC2_RGB);
p(GL_CONSTANT);
p(GL_PRIMARY_COLOR);
p(GL_PREVIOUS);
p(GL_SRC0_ALPHA);
p(GL_SRC1_ALPHA);
p(GL_SRC2_ALPHA);
p(GL_OPERAND0_RGB);
p(GL_OPERAND1_RGB);
p(GL_OPERAND2_RGB);
p(GL_SRC_COLOR);
p(GL_ONE_MINUS_SRC_COLOR);
p(GL_OPERAND0_ALPHA);
p(GL_OPERAND1_ALPHA);
p(GL_OPERAND2_ALPHA);
p(GL_RGB_SCALE);
p(GL_ALPHA_SCALE);
p(GL_TEXTURE_ENV_COLOR);
// misc
p(GL_NUM_EXTENSIONS);
default:
sprintf(fallback, "0x%04X", what);
}
return fallback;
}
const char* PrintEGLError(int onlyerror) {
#ifdef NOEGL
return "";
#else
LOAD_EGL(eglGetError);
static char fallback[64];
GLenum what = egl_eglGetError();
if(onlyerror && what==EGL_SUCCESS)
return NULL;
switch(what)
{
p(EGL_SUCCESS);
p(EGL_NOT_INITIALIZED);
p(EGL_BAD_ACCESS);
p(EGL_BAD_ALLOC);
p(EGL_BAD_ATTRIBUTE);
p(EGL_BAD_CONTEXT);
p(EGL_BAD_CONFIG);
p(EGL_BAD_CURRENT_SURFACE);
p(EGL_BAD_DISPLAY);
p(EGL_BAD_SURFACE);
p(EGL_BAD_MATCH);
p(EGL_BAD_PARAMETER);
p(EGL_BAD_NATIVE_PIXMAP);
p(EGL_BAD_NATIVE_WINDOW);
p(EGL_CONTEXT_LOST);
default:
sprintf(fallback, "0x%04X", what);
}
return fallback;
#endif
}
void CheckGLError(int fwd) {
LOAD_GLES(glGetError);
GLenum err=gles_glGetError();
if(err!=GL_NO_ERROR) {
printf("LIBGL: glGetError(): %s\n", PrintEnum(err));
if(fwd)
errorShim(err);
}
}

View file

@ -0,0 +1,12 @@
#ifndef _GL4ES_DEBUG_H_
#define _GL4ES_DEBUG_H_
#include "gles.h"
const char* PrintEnum(GLenum what);
const char* PrintEGLError(int onlyerror);
void CheckGLError(int fwd);
#endif // _GL4ES_DEBUG_H_

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