summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames Cowgill <james410@cowgill.org.uk>2014-12-09 20:21:40 +0000
committerJames Cowgill <james410@cowgill.org.uk>2014-12-09 20:21:40 +0000
commitfa21c65d0c764705cfc377bf0d0de08fac26874e (patch)
treedbc9e87bbd8684d15e79fc0c8b7a8985389c3b35 /src
parentdd835931261c340acd5f0409341d13fa2670423e (diff)
Imported Upstream version 2.2.0+dfsg
Diffstat (limited to 'src')
-rw-r--r--src/SFML/Android.mk183
-rw-r--r--src/SFML/Audio/ALCheck.cpp218
-rw-r--r--src/SFML/Audio/ALCheck.hpp156
-rw-r--r--src/SFML/Audio/AudioDevice.cpp250
-rw-r--r--src/SFML/Audio/AudioDevice.hpp182
-rw-r--r--src/SFML/Audio/CMakeLists.txt118
-rw-r--r--src/SFML/Audio/Listener.cpp256
-rw-r--r--src/SFML/Audio/Music.cpp302
-rw-r--r--src/SFML/Audio/Sound.cpp396
-rw-r--r--src/SFML/Audio/SoundBuffer.cpp561
-rw-r--r--src/SFML/Audio/SoundBufferRecorder.cpp136
-rw-r--r--src/SFML/Audio/SoundFile.cpp876
-rw-r--r--src/SFML/Audio/SoundFile.hpp459
-rw-r--r--src/SFML/Audio/SoundRecorder.cpp493
-rw-r--r--src/SFML/Audio/SoundSource.cpp388
-rw-r--r--src/SFML/Audio/SoundStream.cpp834
-rw-r--r--src/SFML/CMakeLists.txt98
-rw-r--r--src/SFML/Graphics/BlendMode.cpp103
-rw-r--r--src/SFML/Graphics/CMakeLists.txt297
-rw-r--r--src/SFML/Graphics/CircleShape.cpp2
-rw-r--r--src/SFML/Graphics/Color.cpp257
-rw-r--r--src/SFML/Graphics/ConvexShape.cpp2
-rw-r--r--src/SFML/Graphics/Font.cpp1318
-rw-r--r--src/SFML/Graphics/GLCheck.cpp242
-rw-r--r--src/SFML/Graphics/GLCheck.hpp144
-rw-r--r--src/SFML/Graphics/GLExtensions.cpp (renamed from src/SFML/Main/SFML_Main.cpp)102
-rw-r--r--src/SFML/Graphics/GLExtensions.hpp130
-rw-r--r--src/SFML/Graphics/Image.cpp657
-rw-r--r--src/SFML/Graphics/ImageLoader.cpp642
-rw-r--r--src/SFML/Graphics/ImageLoader.hpp282
-rw-r--r--src/SFML/Graphics/RectangleShape.cpp2
-rw-r--r--src/SFML/Graphics/RenderStates.cpp12
-rw-r--r--src/SFML/Graphics/RenderTarget.cpp969
-rw-r--r--src/SFML/Graphics/RenderTexture.cpp310
-rw-r--r--src/SFML/Graphics/RenderTextureImpl.cpp86
-rw-r--r--src/SFML/Graphics/RenderTextureImpl.hpp178
-rw-r--r--src/SFML/Graphics/RenderTextureImplDefault.cpp2
-rw-r--r--src/SFML/Graphics/RenderTextureImplDefault.hpp8
-rw-r--r--src/SFML/Graphics/RenderTextureImplFBO.cpp293
-rw-r--r--src/SFML/Graphics/RenderTextureImplFBO.hpp230
-rw-r--r--src/SFML/Graphics/RenderWindow.cpp234
-rw-r--r--src/SFML/Graphics/Shader.cpp1379
-rw-r--r--src/SFML/Graphics/Shape.cpp610
-rw-r--r--src/SFML/Graphics/Sprite.cpp348
-rw-r--r--src/SFML/Graphics/Text.cpp757
-rw-r--r--src/SFML/Graphics/Texture.cpp70
-rw-r--r--src/SFML/Graphics/TextureSaver.cpp2
-rw-r--r--src/SFML/Graphics/TextureSaver.hpp6
-rw-r--r--src/SFML/Graphics/Transform.cpp2
-rw-r--r--src/SFML/Graphics/Transformable.cpp2
-rw-r--r--src/SFML/Graphics/Vertex.cpp2
-rw-r--r--src/SFML/Graphics/VertexArray.cpp2
-rw-r--r--src/SFML/Graphics/View.cpp480
-rw-r--r--src/SFML/Main/CMakeLists.txt58
-rw-r--r--src/SFML/Main/MainAndroid.cpp512
-rw-r--r--src/SFML/Main/MainWin32.cpp54
-rw-r--r--src/SFML/Main/MainiOS.mm63
-rw-r--r--src/SFML/Main/SFMLActivity.cpp193
-rw-r--r--src/SFML/Network/CMakeLists.txt114
-rw-r--r--src/SFML/Network/Ftp.cpp1256
-rw-r--r--src/SFML/Network/Http.cpp791
-rw-r--r--src/SFML/Network/IpAddress.cpp510
-rw-r--r--src/SFML/Network/Packet.cpp1102
-rw-r--r--src/SFML/Network/Socket.cpp288
-rw-r--r--src/SFML/Network/SocketImpl.hpp78
-rw-r--r--src/SFML/Network/SocketSelector.cpp346
-rw-r--r--src/SFML/Network/TcpListener.cpp248
-rw-r--r--src/SFML/Network/TcpSocket.cpp763
-rw-r--r--src/SFML/Network/UdpSocket.cpp386
-rw-r--r--src/SFML/Network/Unix/SocketImpl.cpp204
-rw-r--r--src/SFML/Network/Unix/SocketImpl.hpp218
-rw-r--r--src/SFML/Network/Win32/SocketImpl.cpp224
-rw-r--r--src/SFML/Network/Win32/SocketImpl.hpp224
-rw-r--r--src/SFML/System/Android/Activity.cpp69
-rw-r--r--src/SFML/System/Android/Activity.hpp101
-rw-r--r--src/SFML/System/Android/ResourceStream.cpp85
-rw-r--r--src/SFML/System/Android/ResourceStream.hpp113
-rw-r--r--src/SFML/System/CMakeLists.txt182
-rw-r--r--src/SFML/System/Clock.cpp126
-rw-r--r--src/SFML/System/Err.cpp220
-rw-r--r--src/SFML/System/Lock.cpp96
-rw-r--r--src/SFML/System/Mutex.cpp132
-rw-r--r--src/SFML/System/Sleep.cpp92
-rw-r--r--src/SFML/System/String.cpp735
-rw-r--r--src/SFML/System/Thread.cpp172
-rw-r--r--src/SFML/System/ThreadLocal.cpp134
-rw-r--r--src/SFML/System/Time.cpp23
-rw-r--r--src/SFML/System/Unix/ClockImpl.cpp6
-rw-r--r--src/SFML/System/Unix/ClockImpl.hpp6
-rw-r--r--src/SFML/System/Unix/MutexImpl.cpp138
-rw-r--r--src/SFML/System/Unix/MutexImpl.hpp166
-rw-r--r--src/SFML/System/Unix/SleepImpl.cpp48
-rw-r--r--src/SFML/System/Unix/SleepImpl.hpp2
-rw-r--r--src/SFML/System/Unix/ThreadImpl.cpp179
-rw-r--r--src/SFML/System/Unix/ThreadImpl.hpp185
-rw-r--r--src/SFML/System/Unix/ThreadLocalImpl.cpp128
-rw-r--r--src/SFML/System/Unix/ThreadLocalImpl.hpp174
-rw-r--r--src/SFML/System/Win32/ClockImpl.cpp4
-rw-r--r--src/SFML/System/Win32/ClockImpl.hpp6
-rw-r--r--src/SFML/System/Win32/MutexImpl.cpp128
-rw-r--r--src/SFML/System/Win32/MutexImpl.hpp166
-rw-r--r--src/SFML/System/Win32/SleepImpl.cpp13
-rw-r--r--src/SFML/System/Win32/SleepImpl.hpp2
-rw-r--r--src/SFML/System/Win32/ThreadImpl.cpp186
-rw-r--r--src/SFML/System/Win32/ThreadImpl.hpp207
-rw-r--r--src/SFML/System/Win32/ThreadLocalImpl.cpp128
-rw-r--r--src/SFML/System/Win32/ThreadLocalImpl.hpp174
-rw-r--r--src/SFML/Window/Android/InputImpl.cpp204
-rw-r--r--src/SFML/Window/Android/InputImpl.hpp168
-rw-r--r--src/SFML/Window/Android/JoystickImpl.cpp97
-rw-r--r--src/SFML/Window/Android/JoystickImpl.hpp117
-rw-r--r--src/SFML/Window/Android/SensorImpl.cpp214
-rw-r--r--src/SFML/Window/Android/SensorImpl.hpp137
-rw-r--r--src/SFML/Window/Android/VideoModeImpl.cpp63
-rw-r--r--src/SFML/Window/Android/WindowImplAndroid.cpp703
-rw-r--r--src/SFML/Window/Android/WindowImplAndroid.hpp233
-rw-r--r--src/SFML/Window/CMakeLists.txt375
-rw-r--r--src/SFML/Window/Context.cpp126
-rw-r--r--src/SFML/Window/EGLCheck.cpp161
-rw-r--r--src/SFML/Window/EGLCheck.hpp68
-rw-r--r--src/SFML/Window/EglContext.cpp307
-rw-r--r--src/SFML/Window/EglContext.hpp183
-rw-r--r--src/SFML/Window/FreeBSD/JoystickImpl.cpp346
-rw-r--r--src/SFML/Window/FreeBSD/JoystickImpl.hpp129
-rw-r--r--src/SFML/Window/GlContext.cpp580
-rw-r--r--src/SFML/Window/GlContext.hpp468
-rw-r--r--src/SFML/Window/GlResource.cpp170
-rw-r--r--src/SFML/Window/InputImpl.hpp8
-rw-r--r--src/SFML/Window/Joystick.cpp19
-rw-r--r--src/SFML/Window/JoystickImpl.hpp27
-rw-r--r--src/SFML/Window/JoystickManager.cpp19
-rw-r--r--src/SFML/Window/JoystickManager.hpp23
-rw-r--r--src/SFML/Window/Keyboard.cpp9
-rw-r--r--src/SFML/Window/Linux/JoystickImpl.cpp256
-rw-r--r--src/SFML/Window/Mouse.cpp2
-rw-r--r--src/SFML/Window/OSX/AutoreleasePoolWrapper.h28
-rw-r--r--src/SFML/Window/OSX/AutoreleasePoolWrapper.mm156
-rw-r--r--src/SFML/Window/OSX/HIDInputManager.hpp118
-rw-r--r--src/SFML/Window/OSX/HIDInputManager.mm567
-rw-r--r--src/SFML/Window/OSX/HIDJoystickManager.cpp53
-rw-r--r--src/SFML/Window/OSX/HIDJoystickManager.hpp65
-rw-r--r--src/SFML/Window/OSX/InputImpl.hpp51
-rw-r--r--src/SFML/Window/OSX/InputImpl.mm139
-rw-r--r--src/SFML/Window/OSX/JoystickImpl.cpp344
-rw-r--r--src/SFML/Window/OSX/JoystickImpl.hpp30
-rw-r--r--src/SFML/Window/OSX/SFApplication.h18
-rw-r--r--src/SFML/Window/OSX/SFApplication.m220
-rw-r--r--src/SFML/Window/OSX/SFApplicationDelegate.h53
-rw-r--r--src/SFML/Window/OSX/SFApplicationDelegate.m54
-rw-r--r--src/SFML/Window/OSX/SFContext.hpp32
-rw-r--r--src/SFML/Window/OSX/SFContext.mm143
-rw-r--r--src/SFML/Window/OSX/SFKeyboardModifiersHelper.h25
-rw-r--r--src/SFML/Window/OSX/SFKeyboardModifiersHelper.mm75
-rw-r--r--src/SFML/Window/OSX/SFOpenGLView.h108
-rw-r--r--src/SFML/Window/OSX/SFOpenGLView.mm568
-rw-r--r--src/SFML/Window/OSX/SFSilentResponder.h5
-rw-r--r--src/SFML/Window/OSX/SFSilentResponder.m5
-rw-r--r--src/SFML/Window/OSX/SFViewController.h25
-rw-r--r--src/SFML/Window/OSX/SFViewController.mm128
-rw-r--r--src/SFML/Window/OSX/SFWindow.h75
-rw-r--r--src/SFML/Window/OSX/SFWindow.m63
-rw-r--r--src/SFML/Window/OSX/SFWindowController.h52
-rw-r--r--src/SFML/Window/OSX/SFWindowController.mm555
-rw-r--r--src/SFML/Window/OSX/SensorImpl.cpp88
-rw-r--r--src/SFML/Window/OSX/SensorImpl.hpp101
-rw-r--r--src/SFML/Window/OSX/VideoModeImpl.cpp74
-rw-r--r--src/SFML/Window/OSX/WindowImplCocoa.hpp143
-rw-r--r--src/SFML/Window/OSX/WindowImplCocoa.mm401
-rw-r--r--src/SFML/Window/OSX/WindowImplDelegateProtocol.h121
-rw-r--r--src/SFML/Window/OSX/cg_sf_conversion.cpp119
-rw-r--r--src/SFML/Window/OSX/cg_sf_conversion.hpp34
-rw-r--r--src/SFML/Window/OSX/cpp_objc_conversion.h17
-rw-r--r--src/SFML/Window/OSX/cpp_objc_conversion.mm14
-rw-r--r--src/SFML/Window/Sensor.cpp53
-rw-r--r--src/SFML/Window/SensorImpl.hpp57
-rw-r--r--src/SFML/Window/SensorManager.cpp129
-rw-r--r--src/SFML/Window/SensorManager.hpp138
-rw-r--r--src/SFML/Window/Touch.cpp54
-rw-r--r--src/SFML/Window/Unix/Display.cpp (renamed from src/SFML/Window/Linux/Display.cpp)17
-rw-r--r--src/SFML/Window/Unix/Display.hpp (renamed from src/SFML/Window/Linux/Display.hpp)2
-rw-r--r--src/SFML/Window/Unix/GlxContext.cpp (renamed from src/SFML/Window/Linux/GlxContext.cpp)684
-rw-r--r--src/SFML/Window/Unix/GlxContext.hpp (renamed from src/SFML/Window/Linux/GlxContext.hpp)296
-rw-r--r--src/SFML/Window/Unix/InputImpl.cpp (renamed from src/SFML/Window/Linux/InputImpl.cpp)37
-rw-r--r--src/SFML/Window/Unix/InputImpl.hpp (renamed from src/SFML/Window/Linux/InputImpl.hpp)49
-rw-r--r--src/SFML/Window/Unix/JoystickImpl.cpp388
-rw-r--r--src/SFML/Window/Unix/JoystickImpl.hpp126
-rw-r--r--src/SFML/Window/Unix/SensorImpl.cpp88
-rw-r--r--src/SFML/Window/Unix/SensorImpl.hpp101
-rw-r--r--src/SFML/Window/Unix/VideoModeImpl.cpp (renamed from src/SFML/Window/Linux/VideoModeImpl.cpp)10
-rw-r--r--src/SFML/Window/Unix/WindowImplX11.cpp (renamed from src/SFML/Window/Linux/WindowImplX11.cpp)417
-rw-r--r--src/SFML/Window/Unix/WindowImplX11.hpp (renamed from src/SFML/Window/Linux/WindowImplX11.hpp)32
-rw-r--r--src/SFML/Window/VideoMode.cpp292
-rw-r--r--src/SFML/Window/VideoModeImpl.hpp136
-rw-r--r--src/SFML/Window/Win32/InputImpl.cpp35
-rw-r--r--src/SFML/Window/Win32/InputImpl.hpp49
-rw-r--r--src/SFML/Window/Win32/JoystickImpl.cpp491
-rw-r--r--src/SFML/Window/Win32/JoystickImpl.hpp260
-rw-r--r--src/SFML/Window/Win32/SensorImpl.cpp88
-rw-r--r--src/SFML/Window/Win32/SensorImpl.hpp101
-rw-r--r--src/SFML/Window/Win32/VideoModeImpl.cpp142
-rw-r--r--src/SFML/Window/Win32/WglContext.cpp650
-rw-r--r--src/SFML/Window/Win32/WglContext.hpp272
-rw-r--r--src/SFML/Window/Win32/WindowImplWin32.cpp1964
-rw-r--r--src/SFML/Window/Win32/WindowImplWin32.hpp509
-rw-r--r--src/SFML/Window/Window.cpp839
-rw-r--r--src/SFML/Window/WindowImpl.cpp468
-rw-r--r--src/SFML/Window/WindowImpl.hpp508
-rw-r--r--src/SFML/Window/glext/glext.h18306
-rw-r--r--src/SFML/Window/glext/glxext.h993
-rw-r--r--src/SFML/Window/glext/wglext.h1282
-rw-r--r--src/SFML/Window/iOS/EaglContext.hpp165
-rw-r--r--src/SFML/Window/iOS/EaglContext.mm234
-rw-r--r--src/SFML/Window/iOS/InputImpl.hpp168
-rw-r--r--src/SFML/Window/iOS/InputImpl.mm116
-rw-r--r--src/SFML/Window/iOS/JoystickImpl.hpp (renamed from src/SFML/Window/Linux/JoystickImpl.hpp)35
-rw-r--r--src/SFML/Window/iOS/JoystickImpl.mm97
-rw-r--r--src/SFML/Window/iOS/ObjCType.hpp37
-rw-r--r--src/SFML/Window/iOS/SFAppDelegate.hpp112
-rw-r--r--src/SFML/Window/iOS/SFAppDelegate.mm277
-rw-r--r--src/SFML/Window/iOS/SFMain.hpp35
-rw-r--r--src/SFML/Window/iOS/SFMain.mm61
-rw-r--r--src/SFML/Window/iOS/SFView.hpp59
-rw-r--r--src/SFML/Window/iOS/SFView.mm205
-rw-r--r--src/SFML/Window/iOS/SFViewController.hpp73
-rw-r--r--src/SFML/Window/iOS/SFViewController.mm59
-rw-r--r--src/SFML/Window/iOS/SensorImpl.hpp114
-rw-r--r--src/SFML/Window/iOS/SensorImpl.mm242
-rw-r--r--src/SFML/Window/iOS/VideoModeImpl.mm58
-rw-r--r--src/SFML/Window/iOS/WindowImplUIKit.hpp225
-rw-r--r--src/SFML/Window/iOS/WindowImplUIKit.mm219
230 files changed, 40550 insertions, 30209 deletions
diff --git a/src/SFML/Android.mk b/src/SFML/Android.mk
new file mode 100644
index 0000000..d3ec278
--- /dev/null
+++ b/src/SFML/Android.mk
@@ -0,0 +1,183 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := sfml-system
+LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libsfml-system.so
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+
+prebuilt_path := $(call local-prebuilt-path,$(LOCAL_SRC_FILES))
+prebuilt := $(strip $(wildcard $(prebuilt_path)))
+
+ifdef prebuilt
+ include $(PREBUILT_SHARED_LIBRARY)
+endif
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := sfml-window
+LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libsfml-window.so
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_EXPORT_LDLIBS := -lEGL -llog -landroid
+LOCAL_SHARED_LIBRARIES := sfml-system
+
+prebuilt_path := $(call local-prebuilt-path,$(LOCAL_SRC_FILES))
+prebuilt := $(strip $(wildcard $(prebuilt_path)))
+
+ifdef prebuilt
+ include $(PREBUILT_SHARED_LIBRARY)
+endif
+include $(CLEAR_VARS)
+LOCAL_MODULE := sfml-graphics
+LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libsfml-graphics.so
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_SHARED_LIBRARIES += sfml-system sfml-window
+
+prebuilt_path := $(call local-prebuilt-path,$(LOCAL_SRC_FILES))
+prebuilt := $(strip $(wildcard $(prebuilt_path)))
+
+ifdef prebuilt
+ include $(PREBUILT_SHARED_LIBRARY)
+endif
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := sfml-audio
+LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libsfml-audio.so
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_SHARED_LIBRARIES := sfml-window sfml-system openal sndfile
+
+prebuilt_path := $(call local-prebuilt-path,$(LOCAL_SRC_FILES))
+prebuilt := $(strip $(wildcard $(prebuilt_path)))
+
+ifdef prebuilt
+ include $(PREBUILT_SHARED_LIBRARY)
+endif
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := sfml-network
+LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libsfml-network.so
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_SHARED_LIBRARIES := sfml-system
+
+prebuilt_path := $(call local-prebuilt-path,$(LOCAL_SRC_FILES))
+prebuilt := $(strip $(wildcard $(prebuilt_path)))
+
+ifdef prebuilt
+ include $(PREBUILT_SHARED_LIBRARY)
+endif
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := sfml-main
+LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libsfml-main.a
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_SHARED_LIBRARIES := sfml-window sfml-system
+
+prebuilt_path := $(call local-prebuilt-path,$(LOCAL_SRC_FILES))
+prebuilt := $(strip $(wildcard $(prebuilt_path)))
+
+ifdef prebuilt
+ include $(PREBUILT_STATIC_LIBRARY)
+endif
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := sfml-activity
+LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libsfml-activity.so
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+
+prebuilt_path := $(call local-prebuilt-path,$(LOCAL_SRC_FILES))
+prebuilt := $(strip $(wildcard $(prebuilt_path)))
+
+ifdef prebuilt
+ include $(PREBUILT_SHARED_LIBRARY)
+endif
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := sfml-system-d
+LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libsfml-system-d.so
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+
+prebuilt_path := $(call local-prebuilt-path,$(LOCAL_SRC_FILES))
+prebuilt := $(strip $(wildcard $(prebuilt_path)))
+
+ifdef prebuilt
+ include $(PREBUILT_SHARED_LIBRARY)
+endif
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := sfml-window-d
+LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libsfml-window-d.so
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_EXPORT_LDLIBS := -lEGL -llog -landroid
+LOCAL_SHARED_LIBRARIES := sfml-system-d
+
+prebuilt_path := $(call local-prebuilt-path,$(LOCAL_SRC_FILES))
+prebuilt := $(strip $(wildcard $(prebuilt_path)))
+
+ifdef prebuilt
+ include $(PREBUILT_SHARED_LIBRARY)
+endif
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := sfml-graphics-d
+LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libsfml-graphics-d.so
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_SHARED_LIBRARIES += sfml-system-d sfml-window-d
+
+prebuilt_path := $(call local-prebuilt-path,$(LOCAL_SRC_FILES))
+prebuilt := $(strip $(wildcard $(prebuilt_path)))
+
+ifdef prebuilt
+ include $(PREBUILT_SHARED_LIBRARY)
+endif
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := sfml-audio-d
+LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libsfml-audio-d.so
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_SHARED_LIBRARIES := sfml-window-d sfml-system-d openal sndfile
+
+prebuilt_path := $(call local-prebuilt-path,$(LOCAL_SRC_FILES))
+prebuilt := $(strip $(wildcard $(prebuilt_path)))
+
+ifdef prebuilt
+ include $(PREBUILT_SHARED_LIBRARY)
+endif
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := sfml-network-d
+LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libsfml-network-d.so
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_SHARED_LIBRARIES := sfml-system-d
+
+prebuilt_path := $(call local-prebuilt-path,$(LOCAL_SRC_FILES))
+prebuilt := $(strip $(wildcard $(prebuilt_path)))
+
+ifdef prebuilt
+ include $(PREBUILT_SHARED_LIBRARY)
+endif
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := sfml-main-d
+LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libsfml-main-d.a
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_SHARED_LIBRARIES := sfml-window-d sfml-system-d
+
+prebuilt_path := $(call local-prebuilt-path,$(LOCAL_SRC_FILES))
+prebuilt := $(strip $(wildcard $(prebuilt_path)))
+
+ifdef prebuilt
+ include $(PREBUILT_STATIC_LIBRARY)
+endif
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := sfml-activity-d
+LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libsfml-activity-d.so
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+
+prebuilt_path := $(call local-prebuilt-path,$(LOCAL_SRC_FILES))
+prebuilt := $(strip $(wildcard $(prebuilt_path)))
+
+ifdef prebuilt
+ include $(PREBUILT_SHARED_LIBRARY)
+endif
+
+$(call import-module,sfml/extlibs)
+
diff --git a/src/SFML/Audio/ALCheck.cpp b/src/SFML/Audio/ALCheck.cpp
index 0558f11..1a7e4bb 100644
--- a/src/SFML/Audio/ALCheck.cpp
+++ b/src/SFML/Audio/ALCheck.cpp
@@ -1,109 +1,109 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Audio/ALCheck.hpp>
-#include <SFML/Audio/AudioDevice.hpp>
-#include <SFML/System/Err.hpp>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-void alCheckError(const std::string& file, unsigned int line)
-{
- // Get the last error
- ALenum errorCode = alGetError();
-
- if (errorCode != AL_NO_ERROR)
- {
- std::string error, description;
-
- // Decode the error code
- switch (errorCode)
- {
- case AL_INVALID_NAME :
- {
- error = "AL_INVALID_NAME";
- description = "an unacceptable name has been specified";
- break;
- }
-
- case AL_INVALID_ENUM :
- {
- error = "AL_INVALID_ENUM";
- description = "an unacceptable value has been specified for an enumerated argument";
- break;
- }
-
- case AL_INVALID_VALUE :
- {
- error = "AL_INVALID_VALUE";
- description = "a numeric argument is out of range";
- break;
- }
-
- case AL_INVALID_OPERATION :
- {
- error = "AL_INVALID_OPERATION";
- description = "the specified operation is not allowed in the current state";
- break;
- }
-
- case AL_OUT_OF_MEMORY :
- {
- error = "AL_OUT_OF_MEMORY";
- description = "there is not enough memory left to execute the command";
- break;
- }
- }
-
- // Log the error
- err() << "An internal OpenAL call failed in "
- << file.substr(file.find_last_of("\\/") + 1) << " (" << line << ") : "
- << error << ", " << description
- << std::endl;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-/// Make sure that OpenAL is initialized
-////////////////////////////////////////////////////////////
-void ensureALInit()
-{
- // The audio device is instanciated on demand rather than at global startup,
- // which solves a lot of weird crashes and errors.
- // It is destroyed at global exit which is fine.
-
- static AudioDevice globalDevice;
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/ALCheck.hpp>
+#include <SFML/Audio/AudioDevice.hpp>
+#include <SFML/System/Err.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+void alCheckError(const std::string& file, unsigned int line)
+{
+ // Get the last error
+ ALenum errorCode = alGetError();
+
+ if (errorCode != AL_NO_ERROR)
+ {
+ std::string error, description;
+
+ // Decode the error code
+ switch (errorCode)
+ {
+ case AL_INVALID_NAME:
+ {
+ error = "AL_INVALID_NAME";
+ description = "an unacceptable name has been specified";
+ break;
+ }
+
+ case AL_INVALID_ENUM:
+ {
+ error = "AL_INVALID_ENUM";
+ description = "an unacceptable value has been specified for an enumerated argument";
+ break;
+ }
+
+ case AL_INVALID_VALUE:
+ {
+ error = "AL_INVALID_VALUE";
+ description = "a numeric argument is out of range";
+ break;
+ }
+
+ case AL_INVALID_OPERATION:
+ {
+ error = "AL_INVALID_OPERATION";
+ description = "the specified operation is not allowed in the current state";
+ break;
+ }
+
+ case AL_OUT_OF_MEMORY:
+ {
+ error = "AL_OUT_OF_MEMORY";
+ description = "there is not enough memory left to execute the command";
+ break;
+ }
+ }
+
+ // Log the error
+ err() << "An internal OpenAL call failed in "
+ << file.substr(file.find_last_of("\\/") + 1) << " (" << line << ") : "
+ << error << ", " << description
+ << std::endl;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+/// Make sure that OpenAL is initialized
+////////////////////////////////////////////////////////////
+void ensureALInit()
+{
+ // The audio device is instantiated on demand rather than at global startup,
+ // which solves a lot of weird crashes and errors.
+ // It is destroyed at global exit which is fine.
+
+ static AudioDevice globalDevice;
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Audio/ALCheck.hpp b/src/SFML/Audio/ALCheck.hpp
index 7c7d659..b31a031 100644
--- a/src/SFML/Audio/ALCheck.hpp
+++ b/src/SFML/Audio/ALCheck.hpp
@@ -1,78 +1,78 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_ALCHECK_HPP
-#define SFML_ALCHECK_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Config.hpp>
-#include <iostream>
-#include <string>
-#include <al.h>
-#include <alc.h>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// Let's define a macro to quickly check every OpenAL API calls
-////////////////////////////////////////////////////////////
-#ifdef SFML_DEBUG
-
- // If in debug mode, perform a test on every call
- #define alCheck(Func) ((Func), priv::alCheckError(__FILE__, __LINE__))
-
-#else
-
- // Else, we don't add any overhead
- #define alCheck(Func) (Func)
-
-#endif
-
-
-////////////////////////////////////////////////////////////
-/// Check the last OpenAL error
-///
-/// \param file Source file where the call is located
-/// \param line Line number of the source file where the call is located
-///
-////////////////////////////////////////////////////////////
-void alCheckError(const std::string& file, unsigned int line);
-
-////////////////////////////////////////////////////////////
-/// Make sure that OpenAL is initialized
-///
-////////////////////////////////////////////////////////////
-void ensureALInit();
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_ALCHECK_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_ALCHECK_HPP
+#define SFML_ALCHECK_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <iostream>
+#include <string>
+#include <al.h>
+#include <alc.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// Let's define a macro to quickly check every OpenAL API calls
+////////////////////////////////////////////////////////////
+#ifdef SFML_DEBUG
+
+ // If in debug mode, perform a test on every call
+ #define alCheck(x) x; sf::priv::alCheckError(__FILE__, __LINE__);
+
+#else
+
+ // Else, we don't add any overhead
+ #define alCheck(Func) (Func)
+
+#endif
+
+
+////////////////////////////////////////////////////////////
+/// Check the last OpenAL error
+///
+/// \param file Source file where the call is located
+/// \param line Line number of the source file where the call is located
+///
+////////////////////////////////////////////////////////////
+void alCheckError(const std::string& file, unsigned int line);
+
+////////////////////////////////////////////////////////////
+/// Make sure that OpenAL is initialized
+///
+////////////////////////////////////////////////////////////
+void ensureALInit();
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_ALCHECK_HPP
diff --git a/src/SFML/Audio/AudioDevice.cpp b/src/SFML/Audio/AudioDevice.cpp
index d218b91..2c9b833 100644
--- a/src/SFML/Audio/AudioDevice.cpp
+++ b/src/SFML/Audio/AudioDevice.cpp
@@ -1,125 +1,125 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Audio/AudioDevice.hpp>
-#include <SFML/Audio/ALCheck.hpp>
-#include <SFML/Audio/Listener.hpp>
-#include <SFML/System/Err.hpp>
-
-
-namespace
-{
- ALCdevice* audioDevice = NULL;
- ALCcontext* audioContext = NULL;
-}
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-AudioDevice::AudioDevice()
-{
- // Create the device
- audioDevice = alcOpenDevice(NULL);
-
- if (audioDevice)
- {
- // Create the context
- audioContext = alcCreateContext(audioDevice, NULL);
-
- if (audioContext)
- {
- // Set the context as the current one (we'll only need one)
- alcMakeContextCurrent(audioContext);
- }
- else
- {
- err() << "Failed to create the audio context" << std::endl;
- }
- }
- else
- {
- err() << "Failed to open the audio device" << std::endl;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-AudioDevice::~AudioDevice()
-{
- // Destroy the context
- alcMakeContextCurrent(NULL);
- if (audioContext)
- alcDestroyContext(audioContext);
-
- // Destroy the device
- if (audioDevice)
- alcCloseDevice(audioDevice);
-}
-
-
-////////////////////////////////////////////////////////////
-bool AudioDevice::isExtensionSupported(const std::string& extension)
-{
- ensureALInit();
-
- if ((extension.length() > 2) && (extension.substr(0, 3) == "ALC"))
- return alcIsExtensionPresent(audioDevice, extension.c_str()) != AL_FALSE;
- else
- return alIsExtensionPresent(extension.c_str()) != AL_FALSE;
-}
-
-
-////////////////////////////////////////////////////////////
-int AudioDevice::getFormatFromChannelCount(unsigned int channelCount)
-{
- ensureALInit();
-
- // Find the good format according to the number of channels
- int format = 0;
- switch (channelCount)
- {
- case 1 : format = AL_FORMAT_MONO16; break;
- case 2 : format = AL_FORMAT_STEREO16; break;
- case 4 : format = alGetEnumValue("AL_FORMAT_QUAD16"); break;
- case 6 : format = alGetEnumValue("AL_FORMAT_51CHN16"); break;
- case 7 : format = alGetEnumValue("AL_FORMAT_61CHN16"); break;
- case 8 : format = alGetEnumValue("AL_FORMAT_71CHN16"); break;
- default : format = 0; break;
- }
-
- // Fixes a bug on OS X
- if (format == -1)
- format = 0;
-
- return format;
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/AudioDevice.hpp>
+#include <SFML/Audio/ALCheck.hpp>
+#include <SFML/Audio/Listener.hpp>
+#include <SFML/System/Err.hpp>
+
+
+namespace
+{
+ ALCdevice* audioDevice = NULL;
+ ALCcontext* audioContext = NULL;
+}
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+AudioDevice::AudioDevice()
+{
+ // Create the device
+ audioDevice = alcOpenDevice(NULL);
+
+ if (audioDevice)
+ {
+ // Create the context
+ audioContext = alcCreateContext(audioDevice, NULL);
+
+ if (audioContext)
+ {
+ // Set the context as the current one (we'll only need one)
+ alcMakeContextCurrent(audioContext);
+ }
+ else
+ {
+ err() << "Failed to create the audio context" << std::endl;
+ }
+ }
+ else
+ {
+ err() << "Failed to open the audio device" << std::endl;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+AudioDevice::~AudioDevice()
+{
+ // Destroy the context
+ alcMakeContextCurrent(NULL);
+ if (audioContext)
+ alcDestroyContext(audioContext);
+
+ // Destroy the device
+ if (audioDevice)
+ alcCloseDevice(audioDevice);
+}
+
+
+////////////////////////////////////////////////////////////
+bool AudioDevice::isExtensionSupported(const std::string& extension)
+{
+ ensureALInit();
+
+ if ((extension.length() > 2) && (extension.substr(0, 3) == "ALC"))
+ return alcIsExtensionPresent(audioDevice, extension.c_str()) != AL_FALSE;
+ else
+ return alIsExtensionPresent(extension.c_str()) != AL_FALSE;
+}
+
+
+////////////////////////////////////////////////////////////
+int AudioDevice::getFormatFromChannelCount(unsigned int channelCount)
+{
+ ensureALInit();
+
+ // Find the good format according to the number of channels
+ int format = 0;
+ switch (channelCount)
+ {
+ case 1: format = AL_FORMAT_MONO16; break;
+ case 2: format = AL_FORMAT_STEREO16; break;
+ case 4: format = alGetEnumValue("AL_FORMAT_QUAD16"); break;
+ case 6: format = alGetEnumValue("AL_FORMAT_51CHN16"); break;
+ case 7: format = alGetEnumValue("AL_FORMAT_61CHN16"); break;
+ case 8: format = alGetEnumValue("AL_FORMAT_71CHN16"); break;
+ default: format = 0; break;
+ }
+
+ // Fixes a bug on OS X
+ if (format == -1)
+ format = 0;
+
+ return format;
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Audio/AudioDevice.hpp b/src/SFML/Audio/AudioDevice.hpp
index 01c7b4c..85c121b 100644
--- a/src/SFML/Audio/AudioDevice.hpp
+++ b/src/SFML/Audio/AudioDevice.hpp
@@ -1,91 +1,91 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_AUDIODEVICE_HPP
-#define SFML_AUDIODEVICE_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <set>
-#include <string>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief High-level wrapper around the audio API, it manages
-/// the creation and destruction of the audio device and
-/// context and stores the device capabilities
-///
-////////////////////////////////////////////////////////////
-class AudioDevice
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Default constructor
- ///
- ////////////////////////////////////////////////////////////
- AudioDevice();
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor
- ///
- ////////////////////////////////////////////////////////////
- ~AudioDevice();
-
- ////////////////////////////////////////////////////////////
- /// \brief Check if an OpenAL extension is supported
- ///
- /// This functions automatically finds whether it
- /// is an AL or ALC extension, and calls the corresponding
- /// function.
- ///
- /// \param extension Name of the extension to test
- ///
- /// \return True if the extension is supported, false if not
- ///
- ////////////////////////////////////////////////////////////
- static bool isExtensionSupported(const std::string& extension);
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the OpenAL format that matches the given number of channels
- ///
- /// \param channelCount Number of channels
- ///
- /// \return Corresponding format
- ///
- ////////////////////////////////////////////////////////////
- static int getFormatFromChannelCount(unsigned int channelCount);
-};
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_AUDIODEVICE_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_AUDIODEVICE_HPP
+#define SFML_AUDIODEVICE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <set>
+#include <string>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief High-level wrapper around the audio API, it manages
+/// the creation and destruction of the audio device and
+/// context and stores the device capabilities
+///
+////////////////////////////////////////////////////////////
+class AudioDevice
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ AudioDevice();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~AudioDevice();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if an OpenAL extension is supported
+ ///
+ /// This functions automatically finds whether it
+ /// is an AL or ALC extension, and calls the corresponding
+ /// function.
+ ///
+ /// \param extension Name of the extension to test
+ ///
+ /// \return True if the extension is supported, false if not
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isExtensionSupported(const std::string& extension);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the OpenAL format that matches the given number of channels
+ ///
+ /// \param channelCount Number of channels
+ ///
+ /// \return Corresponding format
+ ///
+ ////////////////////////////////////////////////////////////
+ static int getFormatFromChannelCount(unsigned int channelCount);
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_AUDIODEVICE_HPP
diff --git a/src/SFML/Audio/CMakeLists.txt b/src/SFML/Audio/CMakeLists.txt
index 818b9b6..ee7b7cb 100644
--- a/src/SFML/Audio/CMakeLists.txt
+++ b/src/SFML/Audio/CMakeLists.txt
@@ -1,53 +1,65 @@
-
-set(INCROOT ${PROJECT_SOURCE_DIR}/include/SFML/Audio)
-set(SRCROOT ${PROJECT_SOURCE_DIR}/src/SFML/Audio)
-
-# all source files
-set(SRC
- ${SRCROOT}/ALCheck.cpp
- ${SRCROOT}/ALCheck.hpp
- ${SRCROOT}/AudioDevice.cpp
- ${SRCROOT}/AudioDevice.hpp
- ${INCROOT}/Export.hpp
- ${SRCROOT}/Listener.cpp
- ${INCROOT}/Listener.hpp
- ${SRCROOT}/Music.cpp
- ${INCROOT}/Music.hpp
- ${SRCROOT}/Sound.cpp
- ${INCROOT}/Sound.hpp
- ${SRCROOT}/SoundBuffer.cpp
- ${INCROOT}/SoundBuffer.hpp
- ${SRCROOT}/SoundBufferRecorder.cpp
- ${INCROOT}/SoundBufferRecorder.hpp
- ${SRCROOT}/SoundFile.cpp
- ${SRCROOT}/SoundFile.hpp
- ${SRCROOT}/SoundRecorder.cpp
- ${INCROOT}/SoundRecorder.hpp
- ${SRCROOT}/SoundSource.cpp
- ${INCROOT}/SoundSource.hpp
- ${SRCROOT}/SoundStream.cpp
- ${INCROOT}/SoundStream.hpp
-)
-source_group("" FILES ${SRC})
-
-# let CMake know about our additional audio libraries paths (on Windows and OSX)
-if(WINDOWS)
- set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/AL")
- set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/libsndfile/windows")
-elseif (MACOSX)
- set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/libsndfile/osx")
- set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-osx/Frameworks")
-endif()
-
-# find external libraries
-find_package(OpenAL REQUIRED)
-find_package(Sndfile REQUIRED)
-
-# add include paths of external libraries
-include_directories(${OPENAL_INCLUDE_DIR} ${SNDFILE_INCLUDE_DIR})
-
-# define the sfml-audio target
-sfml_add_library(sfml-audio
- SOURCES ${SRC}
- DEPENDS sfml-system
- EXTERNAL_LIBS ${OPENAL_LIBRARY} ${SNDFILE_LIBRARY})
+
+set(INCROOT ${PROJECT_SOURCE_DIR}/include/SFML/Audio)
+set(SRCROOT ${PROJECT_SOURCE_DIR}/src/SFML/Audio)
+
+# all source files
+set(SRC
+ ${SRCROOT}/ALCheck.cpp
+ ${SRCROOT}/ALCheck.hpp
+ ${SRCROOT}/AudioDevice.cpp
+ ${SRCROOT}/AudioDevice.hpp
+ ${INCROOT}/Export.hpp
+ ${SRCROOT}/Listener.cpp
+ ${INCROOT}/Listener.hpp
+ ${SRCROOT}/Music.cpp
+ ${INCROOT}/Music.hpp
+ ${SRCROOT}/Sound.cpp
+ ${INCROOT}/Sound.hpp
+ ${SRCROOT}/SoundBuffer.cpp
+ ${INCROOT}/SoundBuffer.hpp
+ ${SRCROOT}/SoundBufferRecorder.cpp
+ ${INCROOT}/SoundBufferRecorder.hpp
+ ${SRCROOT}/SoundFile.cpp
+ ${SRCROOT}/SoundFile.hpp
+ ${SRCROOT}/SoundRecorder.cpp
+ ${INCROOT}/SoundRecorder.hpp
+ ${SRCROOT}/SoundSource.cpp
+ ${INCROOT}/SoundSource.hpp
+ ${SRCROOT}/SoundStream.cpp
+ ${INCROOT}/SoundStream.hpp
+)
+source_group("" FILES ${SRC})
+
+# let CMake know about our additional audio libraries paths (on Windows and OSX)
+if(SFML_OS_WINDOWS)
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/AL")
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/libsndfile/windows")
+elseif(SFML_OS_MACOSX)
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/libsndfile/osx")
+ set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-osx/Frameworks")
+elseif(SFML_OS_ANDROID)
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/AL")
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/libsndfile/android")
+endif()
+
+# find external libraries
+if(NOT SFML_OS_ANDROID)
+ find_package(OpenAL REQUIRED)
+ find_package(Sndfile REQUIRED)
+else()
+ find_host_package(OpenAL REQUIRED)
+ find_host_package(Sndfile REQUIRED)
+endif()
+include_directories(${OPENAL_INCLUDE_DIR} ${SNDFILE_INCLUDE_DIR})
+
+# build the list of external libraries to link
+if(SFML_OS_ANDROID)
+ list(APPEND AUDIO_EXT_LIBS -landroid -lOpenSLES)
+endif()
+list(APPEND AUDIO_EXT_LIBS ${OPENAL_LIBRARY} ${SNDFILE_LIBRARY})
+
+# define the sfml-audio target
+sfml_add_library(sfml-audio
+ SOURCES ${SRC}
+ DEPENDS sfml-system
+ EXTERNAL_LIBS ${AUDIO_EXT_LIBS})
diff --git a/src/SFML/Audio/Listener.cpp b/src/SFML/Audio/Listener.cpp
index a4995ce..ec0a32f 100644
--- a/src/SFML/Audio/Listener.cpp
+++ b/src/SFML/Audio/Listener.cpp
@@ -1,111 +1,145 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Audio/Listener.hpp>
-#include <SFML/Audio/ALCheck.hpp>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-void Listener::setGlobalVolume(float volume)
-{
- priv::ensureALInit();
-
- alCheck(alListenerf(AL_GAIN, volume * 0.01f));
-}
-
-
-////////////////////////////////////////////////////////////
-float Listener::getGlobalVolume()
-{
- priv::ensureALInit();
-
- float volume = 0.f;
- alCheck(alGetListenerf(AL_GAIN, &volume));
-
- return volume * 100;
-}
-
-
-////////////////////////////////////////////////////////////
-void Listener::setPosition(float x, float y, float z)
-{
- priv::ensureALInit();
-
- alCheck(alListener3f(AL_POSITION, x, y, z));
-}
-
-
-////////////////////////////////////////////////////////////
-void Listener::setPosition(const Vector3f& position)
-{
- setPosition(position.x, position.y, position.z);
-}
-
-
-////////////////////////////////////////////////////////////
-Vector3f Listener::getPosition()
-{
- priv::ensureALInit();
-
- Vector3f position;
- alCheck(alGetListener3f(AL_POSITION, &position.x, &position.y, &position.z));
-
- return position;
-}
-
-
-////////////////////////////////////////////////////////////
-void Listener::setDirection(float x, float y, float z)
-{
- priv::ensureALInit();
-
- float orientation[] = {x, y, z, 0.f, 1.f, 0.f};
- alCheck(alListenerfv(AL_ORIENTATION, orientation));
-}
-
-
-////////////////////////////////////////////////////////////
-void Listener::setDirection(const Vector3f& direction)
-{
- setDirection(direction.x, direction.y, direction.z);
-}
-
-
-////////////////////////////////////////////////////////////
-Vector3f Listener::getDirection()
-{
- priv::ensureALInit();
-
- float orientation[6];
- alCheck(alGetListenerfv(AL_ORIENTATION, orientation));
-
- return Vector3f(orientation[0], orientation[1], orientation[2]);
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/Listener.hpp>
+#include <SFML/Audio/ALCheck.hpp>
+
+
+namespace
+{
+ float listenerVolume = 100.f;
+ sf::Vector3f listenerPosition (0.f, 0.f, 0.f);
+ sf::Vector3f listenerDirection(0.f, 0.f, -1.f);
+ sf::Vector3f listenerUpVector (0.f, 1.f, 0.f);
+}
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+void Listener::setGlobalVolume(float volume)
+{
+ if (volume != listenerVolume)
+ {
+ priv::ensureALInit();
+
+ alCheck(alListenerf(AL_GAIN, volume * 0.01f));
+ listenerVolume = volume;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+float Listener::getGlobalVolume()
+{
+ return listenerVolume;
+}
+
+
+////////////////////////////////////////////////////////////
+void Listener::setPosition(float x, float y, float z)
+{
+ setPosition(Vector3f(x, y, z));
+}
+
+
+////////////////////////////////////////////////////////////
+void Listener::setPosition(const Vector3f& position)
+{
+ if (position != listenerPosition)
+ {
+ priv::ensureALInit();
+
+ alCheck(alListener3f(AL_POSITION, position.x, position.y, position.z));
+ listenerPosition = position;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+Vector3f Listener::getPosition()
+{
+ return listenerPosition;
+}
+
+
+////////////////////////////////////////////////////////////
+void Listener::setDirection(float x, float y, float z)
+{
+ setDirection(Vector3f(x, y, z));
+}
+
+
+////////////////////////////////////////////////////////////
+void Listener::setDirection(const Vector3f& direction)
+{
+ if (direction != listenerDirection)
+ {
+ priv::ensureALInit();
+
+ float orientation[] = {direction.x, direction.y, direction.z, listenerUpVector.x, listenerUpVector.y, listenerUpVector.z};
+ alCheck(alListenerfv(AL_ORIENTATION, orientation));
+ listenerDirection = direction;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+Vector3f Listener::getDirection()
+{
+ return listenerDirection;
+}
+
+
+////////////////////////////////////////////////////////////
+void Listener::setUpVector(float x, float y, float z)
+{
+ setUpVector(Vector3f(x, y, z));
+}
+
+
+////////////////////////////////////////////////////////////
+void Listener::setUpVector(const Vector3f& upVector)
+{
+ if (upVector != listenerUpVector)
+ {
+ priv::ensureALInit();
+
+ float orientation[] = {listenerDirection.x, listenerDirection.y, listenerDirection.z, upVector.x, upVector.y, upVector.z};
+ alCheck(alListenerfv(AL_ORIENTATION, orientation));
+ listenerUpVector = upVector;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+Vector3f Listener::getUpVector()
+{
+ return listenerUpVector;
+}
+
+} // namespace sf
diff --git a/src/SFML/Audio/Music.cpp b/src/SFML/Audio/Music.cpp
index ef784e4..6f3b6db 100644
--- a/src/SFML/Audio/Music.cpp
+++ b/src/SFML/Audio/Music.cpp
@@ -1,151 +1,151 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Audio/Music.hpp>
-#include <SFML/Audio/ALCheck.hpp>
-#include <SFML/Audio/SoundFile.hpp>
-#include <SFML/System/Lock.hpp>
-#include <SFML/System/Err.hpp>
-#include <fstream>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-Music::Music() :
-m_file (new priv::SoundFile),
-m_duration()
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-Music::~Music()
-{
- // We must stop before destroying the file :)
- stop();
-
- delete m_file;
-}
-
-
-////////////////////////////////////////////////////////////
-bool Music::openFromFile(const std::string& filename)
-{
- // First stop the music if it was already running
- stop();
-
- // Open the underlying sound file
- if (!m_file->openRead(filename))
- return false;
-
- // Perform common initializations
- initialize();
-
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-bool Music::openFromMemory(const void* data, std::size_t sizeInBytes)
-{
- // First stop the music if it was already running
- stop();
-
- // Open the underlying sound file
- if (!m_file->openRead(data, sizeInBytes))
- return false;
-
- // Perform common initializations
- initialize();
-
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-bool Music::openFromStream(InputStream& stream)
-{
- // First stop the music if it was already running
- stop();
-
- // Open the underlying sound file
- if (!m_file->openRead(stream))
- return false;
-
- // Perform common initializations
- initialize();
-
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-Time Music::getDuration() const
-{
- return m_duration;
-}
-
-
-////////////////////////////////////////////////////////////
-bool Music::onGetData(SoundStream::Chunk& data)
-{
- Lock lock(m_mutex);
-
- // Fill the chunk parameters
- data.samples = &m_samples[0];
- data.sampleCount = m_file->read(&m_samples[0], m_samples.size());
-
- // Check if we have reached the end of the audio file
- return data.sampleCount == m_samples.size();
-}
-
-
-////////////////////////////////////////////////////////////
-void Music::onSeek(Time timeOffset)
-{
- Lock lock(m_mutex);
-
- m_file->seek(timeOffset);
-}
-
-
-////////////////////////////////////////////////////////////
-void Music::initialize()
-{
- // Compute the music duration
- m_duration = seconds(static_cast<float>(m_file->getSampleCount()) / m_file->getSampleRate() / m_file->getChannelCount());
-
- // Resize the internal buffer so that it can contain 1 second of audio samples
- m_samples.resize(m_file->getSampleRate() * m_file->getChannelCount());
-
- // Initialize the stream
- SoundStream::initialize(m_file->getChannelCount(), m_file->getSampleRate());
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/Music.hpp>
+#include <SFML/Audio/ALCheck.hpp>
+#include <SFML/Audio/SoundFile.hpp>
+#include <SFML/System/Lock.hpp>
+#include <SFML/System/Err.hpp>
+#include <fstream>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Music::Music() :
+m_file (new priv::SoundFile),
+m_duration()
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+Music::~Music()
+{
+ // We must stop before destroying the file
+ stop();
+
+ delete m_file;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Music::openFromFile(const std::string& filename)
+{
+ // First stop the music if it was already running
+ stop();
+
+ // Open the underlying sound file
+ if (!m_file->openRead(filename))
+ return false;
+
+ // Perform common initializations
+ initialize();
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Music::openFromMemory(const void* data, std::size_t sizeInBytes)
+{
+ // First stop the music if it was already running
+ stop();
+
+ // Open the underlying sound file
+ if (!m_file->openRead(data, sizeInBytes))
+ return false;
+
+ // Perform common initializations
+ initialize();
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Music::openFromStream(InputStream& stream)
+{
+ // First stop the music if it was already running
+ stop();
+
+ // Open the underlying sound file
+ if (!m_file->openRead(stream))
+ return false;
+
+ // Perform common initializations
+ initialize();
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+Time Music::getDuration() const
+{
+ return m_duration;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Music::onGetData(SoundStream::Chunk& data)
+{
+ Lock lock(m_mutex);
+
+ // Fill the chunk parameters
+ data.samples = &m_samples[0];
+ data.sampleCount = m_file->read(&m_samples[0], m_samples.size());
+
+ // Check if we have reached the end of the audio file
+ return data.sampleCount == m_samples.size();
+}
+
+
+////////////////////////////////////////////////////////////
+void Music::onSeek(Time timeOffset)
+{
+ Lock lock(m_mutex);
+
+ m_file->seek(timeOffset);
+}
+
+
+////////////////////////////////////////////////////////////
+void Music::initialize()
+{
+ // Compute the music duration
+ m_duration = seconds(static_cast<float>(m_file->getSampleCount()) / m_file->getSampleRate() / m_file->getChannelCount());
+
+ // Resize the internal buffer so that it can contain 1 second of audio samples
+ m_samples.resize(m_file->getSampleRate() * m_file->getChannelCount());
+
+ // Initialize the stream
+ SoundStream::initialize(m_file->getChannelCount(), m_file->getSampleRate());
+}
+
+} // namespace sf
diff --git a/src/SFML/Audio/Sound.cpp b/src/SFML/Audio/Sound.cpp
index 8619cab..d138893 100644
--- a/src/SFML/Audio/Sound.cpp
+++ b/src/SFML/Audio/Sound.cpp
@@ -1,196 +1,200 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Audio/Sound.hpp>
-#include <SFML/Audio/SoundBuffer.hpp>
-#include <SFML/Audio/ALCheck.hpp>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-Sound::Sound() :
-m_buffer(NULL)
-{
-}
-
-
-////////////////////////////////////////////////////////////
-Sound::Sound(const SoundBuffer& buffer) :
-m_buffer(NULL)
-{
- setBuffer(buffer);
-}
-
-
-////////////////////////////////////////////////////////////
-Sound::Sound(const Sound& copy) :
-SoundSource(copy),
-m_buffer (NULL)
-{
- if (copy.m_buffer)
- setBuffer(*copy.m_buffer);
- setLoop(copy.getLoop());
-}
-
-
-////////////////////////////////////////////////////////////
-Sound::~Sound()
-{
- stop();
- if (m_buffer)
- m_buffer->detachSound(this);
-}
-
-
-////////////////////////////////////////////////////////////
-void Sound::play()
-{
- alCheck(alSourcePlay(m_source));
-}
-
-
-////////////////////////////////////////////////////////////
-void Sound::pause()
-{
- alCheck(alSourcePause(m_source));
-}
-
-
-////////////////////////////////////////////////////////////
-void Sound::stop()
-{
- alCheck(alSourceStop(m_source));
-}
-
-
-////////////////////////////////////////////////////////////
-void Sound::setBuffer(const SoundBuffer& buffer)
-{
- // First detach from the previous buffer
- if (m_buffer)
- {
- stop();
- m_buffer->detachSound(this);
- }
-
- // Assign and use the new buffer
- m_buffer = &buffer;
- m_buffer->attachSound(this);
- alCheck(alSourcei(m_source, AL_BUFFER, m_buffer->m_buffer));
-}
-
-
-////////////////////////////////////////////////////////////
-void Sound::setLoop(bool Loop)
-{
- alCheck(alSourcei(m_source, AL_LOOPING, Loop));
-}
-
-
-////////////////////////////////////////////////////////////
-void Sound::setPlayingOffset(Time timeOffset)
-{
- alCheck(alSourcef(m_source, AL_SEC_OFFSET, timeOffset.asSeconds()));
-}
-
-
-////////////////////////////////////////////////////////////
-const SoundBuffer* Sound::getBuffer() const
-{
- return m_buffer;
-}
-
-
-////////////////////////////////////////////////////////////
-bool Sound::getLoop() const
-{
- ALint loop;
- alCheck(alGetSourcei(m_source, AL_LOOPING, &loop));
-
- return loop != 0;
-}
-
-
-////////////////////////////////////////////////////////////
-Time Sound::getPlayingOffset() const
-{
- ALfloat secs = 0.f;
- alCheck(alGetSourcef(m_source, AL_SEC_OFFSET, &secs));
-
- return seconds(secs);
-}
-
-
-////////////////////////////////////////////////////////////
-Sound::Status Sound::getStatus() const
-{
- return SoundSource::getStatus();
-}
-
-
-////////////////////////////////////////////////////////////
-Sound& Sound::operator =(const Sound& right)
-{
- // Here we don't use the copy-and-swap idiom, because it would mess up
- // the list of sound instances contained in the buffers
-
- // Detach the sound instance from the previous buffer (if any)
- if (m_buffer)
- {
- stop();
- m_buffer->detachSound(this);
- m_buffer = NULL;
- }
-
- // Copy the sound attributes
- if (right.m_buffer)
- setBuffer(*right.m_buffer);
- setLoop(right.getLoop());
- setPitch(right.getPitch());
- setVolume(right.getVolume());
- setPosition(right.getPosition());
- setRelativeToListener(right.isRelativeToListener());
- setMinDistance(right.getMinDistance());
- setAttenuation(right.getAttenuation());
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-void Sound::resetBuffer()
-{
- // First stop the sound in case it is playing
- stop();
-
- // Detach the buffer
- alCheck(alSourcei(m_source, AL_BUFFER, 0));
- m_buffer = NULL;
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/Sound.hpp>
+#include <SFML/Audio/SoundBuffer.hpp>
+#include <SFML/Audio/ALCheck.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Sound::Sound() :
+m_buffer(NULL)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+Sound::Sound(const SoundBuffer& buffer) :
+m_buffer(NULL)
+{
+ setBuffer(buffer);
+}
+
+
+////////////////////////////////////////////////////////////
+Sound::Sound(const Sound& copy) :
+SoundSource(copy),
+m_buffer (NULL)
+{
+ if (copy.m_buffer)
+ setBuffer(*copy.m_buffer);
+ setLoop(copy.getLoop());
+}
+
+
+////////////////////////////////////////////////////////////
+Sound::~Sound()
+{
+ stop();
+ if (m_buffer)
+ m_buffer->detachSound(this);
+}
+
+
+////////////////////////////////////////////////////////////
+void Sound::play()
+{
+ alCheck(alSourcePlay(m_source));
+}
+
+
+////////////////////////////////////////////////////////////
+void Sound::pause()
+{
+ alCheck(alSourcePause(m_source));
+}
+
+
+////////////////////////////////////////////////////////////
+void Sound::stop()
+{
+ alCheck(alSourceStop(m_source));
+}
+
+
+////////////////////////////////////////////////////////////
+void Sound::setBuffer(const SoundBuffer& buffer)
+{
+ // First detach from the previous buffer
+ if (m_buffer)
+ {
+ stop();
+ m_buffer->detachSound(this);
+ }
+
+ // Assign and use the new buffer
+ m_buffer = &buffer;
+ m_buffer->attachSound(this);
+ alCheck(alSourcei(m_source, AL_BUFFER, m_buffer->m_buffer));
+}
+
+
+////////////////////////////////////////////////////////////
+void Sound::setLoop(bool loop)
+{
+ alCheck(alSourcei(m_source, AL_LOOPING, loop));
+}
+
+
+////////////////////////////////////////////////////////////
+void Sound::setPlayingOffset(Time timeOffset)
+{
+ alCheck(alSourcef(m_source, AL_SEC_OFFSET, timeOffset.asSeconds()));
+}
+
+
+////////////////////////////////////////////////////////////
+const SoundBuffer* Sound::getBuffer() const
+{
+ return m_buffer;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Sound::getLoop() const
+{
+ ALint loop;
+ alCheck(alGetSourcei(m_source, AL_LOOPING, &loop));
+
+ return loop != 0;
+}
+
+
+////////////////////////////////////////////////////////////
+Time Sound::getPlayingOffset() const
+{
+ ALfloat secs = 0.f;
+ alCheck(alGetSourcef(m_source, AL_SEC_OFFSET, &secs));
+
+ return seconds(secs);
+}
+
+
+////////////////////////////////////////////////////////////
+Sound::Status Sound::getStatus() const
+{
+ return SoundSource::getStatus();
+}
+
+
+////////////////////////////////////////////////////////////
+Sound& Sound::operator =(const Sound& right)
+{
+ // Here we don't use the copy-and-swap idiom, because it would mess up
+ // the list of sound instances contained in the buffers
+
+ // Detach the sound instance from the previous buffer (if any)
+ if (m_buffer)
+ {
+ stop();
+ m_buffer->detachSound(this);
+ m_buffer = NULL;
+ }
+
+ // Copy the sound attributes
+ if (right.m_buffer)
+ setBuffer(*right.m_buffer);
+ setLoop(right.getLoop());
+ setPitch(right.getPitch());
+ setVolume(right.getVolume());
+ setPosition(right.getPosition());
+ setRelativeToListener(right.isRelativeToListener());
+ setMinDistance(right.getMinDistance());
+ setAttenuation(right.getAttenuation());
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+void Sound::resetBuffer()
+{
+ // First stop the sound in case it is playing
+ stop();
+
+ // Detach the buffer
+ if (m_buffer)
+ {
+ alCheck(alSourcei(m_source, AL_BUFFER, 0));
+ m_buffer->detachSound(this);
+ m_buffer = NULL;
+ }
+}
+
+} // namespace sf
diff --git a/src/SFML/Audio/SoundBuffer.cpp b/src/SFML/Audio/SoundBuffer.cpp
index 406a9fe..0d8818c 100644
--- a/src/SFML/Audio/SoundBuffer.cpp
+++ b/src/SFML/Audio/SoundBuffer.cpp
@@ -1,275 +1,286 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Audio/SoundBuffer.hpp>
-#include <SFML/Audio/SoundFile.hpp>
-#include <SFML/Audio/Sound.hpp>
-#include <SFML/Audio/AudioDevice.hpp>
-#include <SFML/Audio/ALCheck.hpp>
-#include <SFML/System/Err.hpp>
-#include <memory>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-SoundBuffer::SoundBuffer() :
-m_buffer (0),
-m_duration()
-{
- priv::ensureALInit();
-
- // Create the buffer
- alCheck(alGenBuffers(1, &m_buffer));
-}
-
-
-////////////////////////////////////////////////////////////
-SoundBuffer::SoundBuffer(const SoundBuffer& copy) :
-m_buffer (0),
-m_samples (copy.m_samples),
-m_duration(copy.m_duration),
-m_sounds () // don't copy the attached sounds
-{
- // Create the buffer
- alCheck(alGenBuffers(1, &m_buffer));
-
- // Update the internal buffer with the new samples
- update(copy.getChannelCount(), copy.getSampleRate());
-}
-
-
-////////////////////////////////////////////////////////////
-SoundBuffer::~SoundBuffer()
-{
- // First detach the buffer from the sounds that use it (to avoid OpenAL errors)
- for (SoundList::const_iterator it = m_sounds.begin(); it != m_sounds.end(); ++it)
- (*it)->resetBuffer();
-
- // Destroy the buffer
- if (m_buffer)
- alCheck(alDeleteBuffers(1, &m_buffer));
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundBuffer::loadFromFile(const std::string& filename)
-{
- priv::SoundFile file;
- if (file.openRead(filename))
- return initialize(file);
- else
- return false;
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundBuffer::loadFromMemory(const void* data, std::size_t sizeInBytes)
-{
- priv::SoundFile file;
- if (file.openRead(data, sizeInBytes))
- return initialize(file);
- else
- return false;
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundBuffer::loadFromStream(InputStream& stream)
-{
- priv::SoundFile file;
- if (file.openRead(stream))
- return initialize(file);
- else
- return false;
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundBuffer::loadFromSamples(const Int16* samples, std::size_t sampleCount, unsigned int channelCount, unsigned int sampleRate)
-{
- if (samples && sampleCount && channelCount && sampleRate)
- {
- // Copy the new audio samples
- m_samples.assign(samples, samples + sampleCount);
-
- // Update the internal buffer with the new samples
- return update(channelCount, sampleRate);
- }
- else
- {
- // Error...
- err() << "Failed to load sound buffer from samples ("
- << "array: " << samples << ", "
- << "count: " << sampleCount << ", "
- << "channels: " << channelCount << ", "
- << "samplerate: " << sampleRate << ")"
- << std::endl;
-
- return false;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundBuffer::saveToFile(const std::string& filename) const
-{
- // Create the sound file in write mode
- priv::SoundFile file;
- if (file.openWrite(filename, getChannelCount(), getSampleRate()))
- {
- // Write the samples to the opened file
- file.write(&m_samples[0], m_samples.size());
-
- return true;
- }
- else
- {
- return false;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-const Int16* SoundBuffer::getSamples() const
-{
- return m_samples.empty() ? NULL : &m_samples[0];
-}
-
-
-////////////////////////////////////////////////////////////
-std::size_t SoundBuffer::getSampleCount() const
-{
- return m_samples.size();
-}
-
-
-////////////////////////////////////////////////////////////
-unsigned int SoundBuffer::getSampleRate() const
-{
- ALint sampleRate;
- alCheck(alGetBufferi(m_buffer, AL_FREQUENCY, &sampleRate));
-
- return sampleRate;
-}
-
-
-////////////////////////////////////////////////////////////
-unsigned int SoundBuffer::getChannelCount() const
-{
- ALint channelCount;
- alCheck(alGetBufferi(m_buffer, AL_CHANNELS, &channelCount));
-
- return channelCount;
-}
-
-
-////////////////////////////////////////////////////////////
-Time SoundBuffer::getDuration() const
-{
- return m_duration;
-}
-
-
-////////////////////////////////////////////////////////////
-SoundBuffer& SoundBuffer::operator =(const SoundBuffer& right)
-{
- SoundBuffer temp(right);
-
- std::swap(m_samples, temp.m_samples);
- std::swap(m_buffer, temp.m_buffer);
- std::swap(m_duration, temp.m_duration);
- std::swap(m_sounds, temp.m_sounds); // swap sounds too, so that they are detached when temp is destroyed
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundBuffer::initialize(priv::SoundFile& file)
-{
- // Retrieve the sound parameters
- std::size_t sampleCount = file.getSampleCount();
- unsigned int channelCount = file.getChannelCount();
- unsigned int sampleRate = file.getSampleRate();
-
- // Read the samples from the provided file
- m_samples.resize(sampleCount);
- if (file.read(&m_samples[0], sampleCount) == sampleCount)
- {
- // Update the internal buffer with the new samples
- return update(channelCount, sampleRate);
- }
- else
- {
- return false;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundBuffer::update(unsigned int channelCount, unsigned int sampleRate)
-{
- // Check parameters
- if (!channelCount || !sampleRate || m_samples.empty())
- return false;
-
- // Find the good format according to the number of channels
- ALenum format = priv::AudioDevice::getFormatFromChannelCount(channelCount);
-
- // Check if the format is valid
- if (format == 0)
- {
- err() << "Failed to load sound buffer (unsupported number of channels: " << channelCount << ")" << std::endl;
- return false;
- }
-
- // Fill the buffer
- ALsizei size = static_cast<ALsizei>(m_samples.size()) * sizeof(Int16);
- alCheck(alBufferData(m_buffer, format, &m_samples[0], size, sampleRate));
-
- // Compute the duration
- m_duration = milliseconds(1000 * m_samples.size() / sampleRate / channelCount);
-
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundBuffer::attachSound(Sound* sound) const
-{
- m_sounds.insert(sound);
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundBuffer::detachSound(Sound* sound) const
-{
- m_sounds.erase(sound);
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/SoundBuffer.hpp>
+#include <SFML/Audio/SoundFile.hpp>
+#include <SFML/Audio/Sound.hpp>
+#include <SFML/Audio/AudioDevice.hpp>
+#include <SFML/Audio/ALCheck.hpp>
+#include <SFML/System/Err.hpp>
+#include <memory>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+SoundBuffer::SoundBuffer() :
+m_buffer (0),
+m_duration()
+{
+ priv::ensureALInit();
+
+ // Create the buffer
+ alCheck(alGenBuffers(1, &m_buffer));
+}
+
+
+////////////////////////////////////////////////////////////
+SoundBuffer::SoundBuffer(const SoundBuffer& copy) :
+m_buffer (0),
+m_samples (copy.m_samples),
+m_duration(copy.m_duration),
+m_sounds () // don't copy the attached sounds
+{
+ // Create the buffer
+ alCheck(alGenBuffers(1, &m_buffer));
+
+ // Update the internal buffer with the new samples
+ update(copy.getChannelCount(), copy.getSampleRate());
+}
+
+
+////////////////////////////////////////////////////////////
+SoundBuffer::~SoundBuffer()
+{
+ // First detach the buffer from the sounds that use it (to avoid OpenAL errors)
+ for (SoundList::const_iterator it = m_sounds.begin(); it != m_sounds.end(); ++it)
+ (*it)->resetBuffer();
+
+ // Destroy the buffer
+ if (m_buffer)
+ alCheck(alDeleteBuffers(1, &m_buffer));
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundBuffer::loadFromFile(const std::string& filename)
+{
+ priv::SoundFile file;
+ if (file.openRead(filename))
+ return initialize(file);
+ else
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundBuffer::loadFromMemory(const void* data, std::size_t sizeInBytes)
+{
+ priv::SoundFile file;
+ if (file.openRead(data, sizeInBytes))
+ return initialize(file);
+ else
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundBuffer::loadFromStream(InputStream& stream)
+{
+ priv::SoundFile file;
+ if (file.openRead(stream))
+ return initialize(file);
+ else
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundBuffer::loadFromSamples(const Int16* samples, std::size_t sampleCount, unsigned int channelCount, unsigned int sampleRate)
+{
+ if (samples && sampleCount && channelCount && sampleRate)
+ {
+ // Copy the new audio samples
+ m_samples.assign(samples, samples + sampleCount);
+
+ // Update the internal buffer with the new samples
+ return update(channelCount, sampleRate);
+ }
+ else
+ {
+ // Error...
+ err() << "Failed to load sound buffer from samples ("
+ << "array: " << samples << ", "
+ << "count: " << sampleCount << ", "
+ << "channels: " << channelCount << ", "
+ << "samplerate: " << sampleRate << ")"
+ << std::endl;
+
+ return false;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundBuffer::saveToFile(const std::string& filename) const
+{
+ // Create the sound file in write mode
+ priv::SoundFile file;
+ if (file.openWrite(filename, getChannelCount(), getSampleRate()))
+ {
+ // Write the samples to the opened file
+ file.write(&m_samples[0], m_samples.size());
+
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+const Int16* SoundBuffer::getSamples() const
+{
+ return m_samples.empty() ? NULL : &m_samples[0];
+}
+
+
+////////////////////////////////////////////////////////////
+std::size_t SoundBuffer::getSampleCount() const
+{
+ return m_samples.size();
+}
+
+
+////////////////////////////////////////////////////////////
+unsigned int SoundBuffer::getSampleRate() const
+{
+ ALint sampleRate;
+ alCheck(alGetBufferi(m_buffer, AL_FREQUENCY, &sampleRate));
+
+ return sampleRate;
+}
+
+
+////////////////////////////////////////////////////////////
+unsigned int SoundBuffer::getChannelCount() const
+{
+ ALint channelCount;
+ alCheck(alGetBufferi(m_buffer, AL_CHANNELS, &channelCount));
+
+ return channelCount;
+}
+
+
+////////////////////////////////////////////////////////////
+Time SoundBuffer::getDuration() const
+{
+ return m_duration;
+}
+
+
+////////////////////////////////////////////////////////////
+SoundBuffer& SoundBuffer::operator =(const SoundBuffer& right)
+{
+ SoundBuffer temp(right);
+
+ std::swap(m_samples, temp.m_samples);
+ std::swap(m_buffer, temp.m_buffer);
+ std::swap(m_duration, temp.m_duration);
+ std::swap(m_sounds, temp.m_sounds); // swap sounds too, so that they are detached when temp is destroyed
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundBuffer::initialize(priv::SoundFile& file)
+{
+ // Retrieve the sound parameters
+ std::size_t sampleCount = file.getSampleCount();
+ unsigned int channelCount = file.getChannelCount();
+ unsigned int sampleRate = file.getSampleRate();
+
+ // Read the samples from the provided file
+ m_samples.resize(sampleCount);
+ if (file.read(&m_samples[0], sampleCount) == sampleCount)
+ {
+ // Update the internal buffer with the new samples
+ return update(channelCount, sampleRate);
+ }
+ else
+ {
+ return false;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundBuffer::update(unsigned int channelCount, unsigned int sampleRate)
+{
+ // Check parameters
+ if (!channelCount || !sampleRate || m_samples.empty())
+ return false;
+
+ // Find the good format according to the number of channels
+ ALenum format = priv::AudioDevice::getFormatFromChannelCount(channelCount);
+
+ // Check if the format is valid
+ if (format == 0)
+ {
+ err() << "Failed to load sound buffer (unsupported number of channels: " << channelCount << ")" << std::endl;
+ return false;
+ }
+
+ // First make a copy of the list of sounds so we can reattach later
+ SoundList sounds(m_sounds);
+
+ // Detach the buffer from the sounds that use it (to avoid OpenAL errors)
+ for (SoundList::const_iterator it = sounds.begin(); it != sounds.end(); ++it)
+ (*it)->resetBuffer();
+
+ // Fill the buffer
+ ALsizei size = static_cast<ALsizei>(m_samples.size()) * sizeof(Int16);
+ alCheck(alBufferData(m_buffer, format, &m_samples[0], size, sampleRate));
+
+ // Compute the duration
+ m_duration = seconds(static_cast<float>(m_samples.size()) / sampleRate / channelCount);
+
+ // Now reattach the buffer to the sounds that use it
+ for (SoundList::const_iterator it = sounds.begin(); it != sounds.end(); ++it)
+ (*it)->setBuffer(*this);
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundBuffer::attachSound(Sound* sound) const
+{
+ m_sounds.insert(sound);
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundBuffer::detachSound(Sound* sound) const
+{
+ m_sounds.erase(sound);
+}
+
+} // namespace sf
diff --git a/src/SFML/Audio/SoundBufferRecorder.cpp b/src/SFML/Audio/SoundBufferRecorder.cpp
index a8b2993..11724b1 100644
--- a/src/SFML/Audio/SoundBufferRecorder.cpp
+++ b/src/SFML/Audio/SoundBufferRecorder.cpp
@@ -1,68 +1,68 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Audio/SoundBufferRecorder.hpp>
-#include <algorithm>
-#include <iterator>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-bool SoundBufferRecorder::onStart()
-{
- m_samples.clear();
- m_buffer = SoundBuffer();
-
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundBufferRecorder::onProcessSamples(const Int16* samples, std::size_t sampleCount)
-{
- std::copy(samples, samples + sampleCount, std::back_inserter(m_samples));
-
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundBufferRecorder::onStop()
-{
- if (!m_samples.empty())
- m_buffer.loadFromSamples(&m_samples[0], m_samples.size(), 1, getSampleRate());
-}
-
-
-////////////////////////////////////////////////////////////
-const SoundBuffer& SoundBufferRecorder::getBuffer() const
-{
- return m_buffer;
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/SoundBufferRecorder.hpp>
+#include <algorithm>
+#include <iterator>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+bool SoundBufferRecorder::onStart()
+{
+ m_samples.clear();
+ m_buffer = SoundBuffer();
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundBufferRecorder::onProcessSamples(const Int16* samples, std::size_t sampleCount)
+{
+ std::copy(samples, samples + sampleCount, std::back_inserter(m_samples));
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundBufferRecorder::onStop()
+{
+ if (!m_samples.empty())
+ m_buffer.loadFromSamples(&m_samples[0], m_samples.size(), 1, getSampleRate());
+}
+
+
+////////////////////////////////////////////////////////////
+const SoundBuffer& SoundBufferRecorder::getBuffer() const
+{
+ return m_buffer;
+}
+
+} // namespace sf
diff --git a/src/SFML/Audio/SoundFile.cpp b/src/SFML/Audio/SoundFile.cpp
index 91db819..7ca5f82 100644
--- a/src/SFML/Audio/SoundFile.cpp
+++ b/src/SFML/Audio/SoundFile.cpp
@@ -1,425 +1,451 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Audio/SoundFile.hpp>
-#include <SFML/System/InputStream.hpp>
-#include <SFML/System/Err.hpp>
-#include <cstring>
-#include <cctype>
-
-
-namespace
-{
- // Convert a string to lower case
- std::string toLower(std::string str)
- {
- for (std::string::iterator i = str.begin(); i != str.end(); ++i)
- *i = static_cast<char>(std::tolower(*i));
- return str;
- }
-}
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-SoundFile::SoundFile() :
-m_file (NULL),
-m_sampleCount (0),
-m_channelCount(0),
-m_sampleRate (0)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-SoundFile::~SoundFile()
-{
- if (m_file)
- sf_close(m_file);
-}
-
-
-////////////////////////////////////////////////////////////
-std::size_t SoundFile::getSampleCount() const
-{
- return m_sampleCount;
-}
-
-
-////////////////////////////////////////////////////////////
-unsigned int SoundFile::getChannelCount() const
-{
- return m_channelCount;
-}
-
-
-////////////////////////////////////////////////////////////
-unsigned int SoundFile::getSampleRate() const
-{
- return m_sampleRate;
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundFile::openRead(const std::string& filename)
-{
- // If the file is already opened, first close it
- if (m_file)
- sf_close(m_file);
-
- // Open the sound file
- SF_INFO fileInfo;
- fileInfo.format = 0;
- m_file = sf_open(filename.c_str(), SFM_READ, &fileInfo);
- if (!m_file)
- {
- err() << "Failed to open sound file \"" << filename << "\" (" << sf_strerror(m_file) << ")" << std::endl;
- return false;
- }
-
- // Initialize the internal state from the loaded information
- initialize(fileInfo);
-
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundFile::openRead(const void* data, std::size_t sizeInBytes)
-{
- // If the file is already opened, first close it
- if (m_file)
- sf_close(m_file);
-
- // Prepare the memory I/O structure
- SF_VIRTUAL_IO io;
- io.get_filelen = &Memory::getLength;
- io.read = &Memory::read;
- io.seek = &Memory::seek;
- io.tell = &Memory::tell;
-
- // Initialize the memory data
- m_memory.begin = static_cast<const char*>(data);
- m_memory.current = m_memory.begin;
- m_memory.size = sizeInBytes;
-
- // Open the sound file
- SF_INFO fileInfo;
- fileInfo.format = 0;
- m_file = sf_open_virtual(&io, SFM_READ, &fileInfo, &m_memory);
- if (!m_file)
- {
- err() << "Failed to open sound file from memory (" << sf_strerror(m_file) << ")" << std::endl;
- return false;
- }
-
- // Initialize the internal state from the loaded information
- initialize(fileInfo);
-
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundFile::openRead(InputStream& stream)
-{
- // If the file is already opened, first close it
- if (m_file)
- sf_close(m_file);
-
- // Prepare the memory I/O structure
- SF_VIRTUAL_IO io;
- io.get_filelen = &Stream::getLength;
- io.read = &Stream::read;
- io.seek = &Stream::seek;
- io.tell = &Stream::tell;
-
- // Initialize the stream data
- m_stream.source = &stream;
- m_stream.size = stream.getSize();
-
- // Make sure that the stream's reading position is at the beginning
- stream.seek(0);
-
- // Open the sound file
- SF_INFO fileInfo;
- fileInfo.format = 0;
- m_file = sf_open_virtual(&io, SFM_READ, &fileInfo, &m_stream);
- if (!m_file)
- {
- err() << "Failed to open sound file from stream (" << sf_strerror(m_file) << ")" << std::endl;
- return false;
- }
-
- // Initialize the internal state from the loaded information
- initialize(fileInfo);
-
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundFile::openWrite(const std::string& filename, unsigned int channelCount, unsigned int sampleRate)
-{
- // If the file is already opened, first close it
- if (m_file)
- sf_close(m_file);
-
- // Find the right format according to the file extension
- int format = getFormatFromFilename(filename);
- if (format == -1)
- {
- // Error : unrecognized extension
- err() << "Failed to create sound file \"" << filename << "\" (unknown format)" << std::endl;
- return false;
- }
-
- // Fill the sound infos with parameters
- SF_INFO fileInfos;
- fileInfos.channels = channelCount;
- fileInfos.samplerate = sampleRate;
- fileInfos.format = format | (format == SF_FORMAT_OGG ? SF_FORMAT_VORBIS : SF_FORMAT_PCM_16);
-
- // Open the sound file for writing
- m_file = sf_open(filename.c_str(), SFM_WRITE, &fileInfos);
- if (!m_file)
- {
- err() << "Failed to create sound file \"" << filename << "\" (" << sf_strerror(m_file) << ")" << std::endl;
- return false;
- }
-
- // Set the sound parameters
- m_channelCount = channelCount;
- m_sampleRate = sampleRate;
- m_sampleCount = 0;
-
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-std::size_t SoundFile::read(Int16* data, std::size_t sampleCount)
-{
- if (m_file && data && sampleCount)
- return static_cast<std::size_t>(sf_read_short(m_file, data, sampleCount));
- else
- return 0;
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundFile::write(const Int16* data, std::size_t sampleCount)
-{
- if (m_file && data && sampleCount)
- {
- // Write small chunks instead of everything at once,
- // to avoid a stack overflow in libsndfile (happens only with OGG format)
- while (sampleCount > 0)
- {
- std::size_t count = sampleCount > 10000 ? 10000 : sampleCount;
- sf_write_short(m_file, data, count);
- data += count;
- sampleCount -= count;
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundFile::seek(Time timeOffset)
-{
- if (m_file)
- {
- sf_count_t frameOffset = static_cast<sf_count_t>(timeOffset.asSeconds() * m_sampleRate);
- sf_seek(m_file, frameOffset, SEEK_SET);
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundFile::initialize(SF_INFO fileInfo)
-{
- // Save the sound properties
- m_channelCount = fileInfo.channels;
- m_sampleRate = fileInfo.samplerate;
- m_sampleCount = static_cast<std::size_t>(fileInfo.frames) * fileInfo.channels;
-
- // Enable scaling for Vorbis files (float samples)
- // @todo enable when it's faster (it currently has to iterate over the *whole* music)
- //if (fileInfo.format & SF_FORMAT_VORBIS)
- // sf_command(m_file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE);
-}
-
-
-////////////////////////////////////////////////////////////
-int SoundFile::getFormatFromFilename(const std::string& filename)
-{
- // Extract the extension
- std::string ext = "wav";
- std::string::size_type pos = filename.find_last_of(".");
- if (pos != std::string::npos)
- ext = filename.substr(pos + 1);
-
- // Match every supported extension with its format constant
- if (toLower(ext) == "wav" ) return SF_FORMAT_WAV;
- if (toLower(ext) == "aif" ) return SF_FORMAT_AIFF;
- if (toLower(ext) == "aiff" ) return SF_FORMAT_AIFF;
- if (toLower(ext) == "au" ) return SF_FORMAT_AU;
- if (toLower(ext) == "raw" ) return SF_FORMAT_RAW;
- if (toLower(ext) == "paf" ) return SF_FORMAT_PAF;
- if (toLower(ext) == "svx" ) return SF_FORMAT_SVX;
- if (toLower(ext) == "nist" ) return SF_FORMAT_NIST;
- if (toLower(ext) == "voc" ) return SF_FORMAT_VOC;
- if (toLower(ext) == "sf" ) return SF_FORMAT_IRCAM;
- if (toLower(ext) == "w64" ) return SF_FORMAT_W64;
- if (toLower(ext) == "mat4" ) return SF_FORMAT_MAT4;
- if (toLower(ext) == "mat5" ) return SF_FORMAT_MAT5;
- if (toLower(ext) == "pvf" ) return SF_FORMAT_PVF;
- if (toLower(ext) == "xi" ) return SF_FORMAT_XI;
- if (toLower(ext) == "htk" ) return SF_FORMAT_HTK;
- if (toLower(ext) == "sds" ) return SF_FORMAT_SDS;
- if (toLower(ext) == "avr" ) return SF_FORMAT_AVR;
- if (toLower(ext) == "sd2" ) return SF_FORMAT_SD2;
- if (toLower(ext) == "flac" ) return SF_FORMAT_FLAC;
- if (toLower(ext) == "caf" ) return SF_FORMAT_CAF;
- if (toLower(ext) == "wve" ) return SF_FORMAT_WVE;
- if (toLower(ext) == "ogg" ) return SF_FORMAT_OGG;
- if (toLower(ext) == "mpc2k") return SF_FORMAT_MPC2K;
- if (toLower(ext) == "rf64" ) return SF_FORMAT_RF64;
-
- return -1;
-}
-
-
-////////////////////////////////////////////////////////////
-sf_count_t SoundFile::Memory::getLength(void* user)
-{
- Memory* memory = static_cast<Memory*>(user);
- return memory->size;
-}
-
-
-////////////////////////////////////////////////////////////
-sf_count_t SoundFile::Memory::read(void* ptr, sf_count_t count, void* user)
-{
- Memory* memory = static_cast<Memory*>(user);
-
- sf_count_t position = tell(user);
- if (position + count >= memory->size)
- count = memory->size - position;
-
- std::memcpy(ptr, memory->current, static_cast<std::size_t>(count));
- memory->current += count;
- return count;
-}
-
-
-////////////////////////////////////////////////////////////
-sf_count_t SoundFile::Memory::seek(sf_count_t offset, int whence, void* user)
-{
- Memory* memory = static_cast<Memory*>(user);
- sf_count_t position = 0;
- switch (whence)
- {
- case SEEK_SET : position = offset; break;
- case SEEK_CUR : position = memory->current - memory->begin + offset; break;
- case SEEK_END : position = memory->size - offset; break;
- default : position = 0; break;
- }
-
- if (position >= memory->size)
- position = memory->size - 1;
- else if (position < 0)
- position = 0;
-
- memory->current = memory->begin + position;
- return position;
-}
-
-
-////////////////////////////////////////////////////////////
-sf_count_t SoundFile::Memory::tell(void* user)
-{
- Memory* memory = static_cast<Memory*>(user);
- return memory->current - memory->begin;
-}
-
-
-////////////////////////////////////////////////////////////
-sf_count_t SoundFile::Stream::getLength(void* userData)
-{
- Stream* stream = static_cast<Stream*>(userData);
- return stream->size;
-}
-
-
-////////////////////////////////////////////////////////////
-sf_count_t SoundFile::Stream::read(void* ptr, sf_count_t count, void* userData)
-{
- Stream* stream = static_cast<Stream*>(userData);
- Int64 position = stream->source->tell();
- if (position != -1)
- {
- if (count > stream->size - position)
- count = stream->size - position;
- return stream->source->read(reinterpret_cast<char*>(ptr), count);
- }
- else
- {
- return -1;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-sf_count_t SoundFile::Stream::seek(sf_count_t offset, int whence, void* userData)
-{
- Stream* stream = static_cast<Stream*>(userData);
- switch (whence)
- {
- case SEEK_SET : return stream->source->seek(offset);
- case SEEK_CUR : return stream->source->seek(stream->source->tell() + offset);
- case SEEK_END : return stream->source->seek(stream->size - offset);
- default : return stream->source->seek(0);
- }
-}
-
-
-////////////////////////////////////////////////////////////
-sf_count_t SoundFile::Stream::tell(void* userData)
-{
- Stream* stream = static_cast<Stream*>(userData);
- return stream->source->tell();
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/SoundFile.hpp>
+#ifdef SFML_SYSTEM_ANDROID
+ #include <SFML/System/Android/ResourceStream.hpp>
+#endif
+#include <SFML/System/InputStream.hpp>
+#include <SFML/System/Err.hpp>
+#include <cstring>
+#include <cctype>
+
+
+namespace
+{
+ // Convert a string to lower case
+ std::string toLower(std::string str)
+ {
+ for (std::string::iterator i = str.begin(); i != str.end(); ++i)
+ *i = static_cast<char>(std::tolower(*i));
+ return str;
+ }
+}
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+SoundFile::SoundFile() :
+m_file (NULL),
+m_sampleCount (0),
+m_channelCount(0),
+m_sampleRate (0)
+{
+ #ifdef SFML_SYSTEM_ANDROID
+
+ m_resourceStream = NULL;
+
+ #endif
+}
+
+
+////////////////////////////////////////////////////////////
+SoundFile::~SoundFile()
+{
+ if (m_file)
+ sf_close(m_file);
+
+ #ifdef SFML_SYSTEM_ANDROID
+
+ if (m_resourceStream)
+ delete (priv::ResourceStream*)m_resourceStream;
+
+ #endif
+}
+
+
+////////////////////////////////////////////////////////////
+std::size_t SoundFile::getSampleCount() const
+{
+ return m_sampleCount;
+}
+
+
+////////////////////////////////////////////////////////////
+unsigned int SoundFile::getChannelCount() const
+{
+ return m_channelCount;
+}
+
+
+////////////////////////////////////////////////////////////
+unsigned int SoundFile::getSampleRate() const
+{
+ return m_sampleRate;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundFile::openRead(const std::string& filename)
+{
+ #ifndef SFML_SYSTEM_ANDROID
+
+ // If the file is already opened, first close it
+ if (m_file)
+ sf_close(m_file);
+
+ // Open the sound file
+ SF_INFO fileInfo;
+ fileInfo.format = 0;
+ m_file = sf_open(filename.c_str(), SFM_READ, &fileInfo);
+ if (!m_file)
+ {
+ err() << "Failed to open sound file \"" << filename << "\" (" << sf_strerror(m_file) << ")" << std::endl;
+ return false;
+ }
+
+ // Initialize the internal state from the loaded information
+ initialize(fileInfo);
+
+ return true;
+
+ #else
+
+ if (m_resourceStream)
+ delete (priv::ResourceStream*)m_resourceStream;
+
+ m_resourceStream = new priv::ResourceStream(filename);
+ return openRead(*(priv::ResourceStream*)m_resourceStream);
+
+ #endif
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundFile::openRead(const void* data, std::size_t sizeInBytes)
+{
+ // If the file is already opened, first close it
+ if (m_file)
+ sf_close(m_file);
+
+ // Prepare the memory I/O structure
+ SF_VIRTUAL_IO io;
+ io.get_filelen = &Memory::getLength;
+ io.read = &Memory::read;
+ io.seek = &Memory::seek;
+ io.tell = &Memory::tell;
+
+ // Initialize the memory data
+ m_memory.begin = static_cast<const char*>(data);
+ m_memory.current = m_memory.begin;
+ m_memory.size = sizeInBytes;
+
+ // Open the sound file
+ SF_INFO fileInfo;
+ fileInfo.format = 0;
+ m_file = sf_open_virtual(&io, SFM_READ, &fileInfo, &m_memory);
+ if (!m_file)
+ {
+ err() << "Failed to open sound file from memory (" << sf_strerror(m_file) << ")" << std::endl;
+ return false;
+ }
+
+ // Initialize the internal state from the loaded information
+ initialize(fileInfo);
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundFile::openRead(InputStream& stream)
+{
+ // If the file is already opened, first close it
+ if (m_file)
+ sf_close(m_file);
+
+ // Prepare the memory I/O structure
+ SF_VIRTUAL_IO io;
+ io.get_filelen = &Stream::getLength;
+ io.read = &Stream::read;
+ io.seek = &Stream::seek;
+ io.tell = &Stream::tell;
+
+ // Initialize the stream data
+ m_stream.source = &stream;
+ m_stream.size = stream.getSize();
+
+ // Make sure that the stream's reading position is at the beginning
+ stream.seek(0);
+
+ // Open the sound file
+ SF_INFO fileInfo;
+ fileInfo.format = 0;
+ m_file = sf_open_virtual(&io, SFM_READ, &fileInfo, &m_stream);
+ if (!m_file)
+ {
+ err() << "Failed to open sound file from stream (" << sf_strerror(m_file) << ")" << std::endl;
+ return false;
+ }
+
+ // Initialize the internal state from the loaded information
+ initialize(fileInfo);
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundFile::openWrite(const std::string& filename, unsigned int channelCount, unsigned int sampleRate)
+{
+ // If the file is already opened, first close it
+ if (m_file)
+ sf_close(m_file);
+
+ // Find the right format according to the file extension
+ int format = getFormatFromFilename(filename);
+ if (format == -1)
+ {
+ // Error: unrecognized extension
+ err() << "Failed to create sound file \"" << filename << "\" (unknown format)" << std::endl;
+ return false;
+ }
+
+ // Fill the sound infos with parameters
+ SF_INFO fileInfos;
+ fileInfos.channels = channelCount;
+ fileInfos.samplerate = sampleRate;
+ fileInfos.format = format | (format == SF_FORMAT_OGG ? SF_FORMAT_VORBIS : SF_FORMAT_PCM_16);
+
+ // Open the sound file for writing
+ m_file = sf_open(filename.c_str(), SFM_WRITE, &fileInfos);
+ if (!m_file)
+ {
+ err() << "Failed to create sound file \"" << filename << "\" (" << sf_strerror(m_file) << ")" << std::endl;
+ return false;
+ }
+
+ // Set the sound parameters
+ m_channelCount = channelCount;
+ m_sampleRate = sampleRate;
+ m_sampleCount = 0;
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+std::size_t SoundFile::read(Int16* data, std::size_t sampleCount)
+{
+ if (m_file && data && sampleCount)
+ return static_cast<std::size_t>(sf_read_short(m_file, data, sampleCount));
+ else
+ return 0;
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundFile::write(const Int16* data, std::size_t sampleCount)
+{
+ if (m_file && data && sampleCount)
+ {
+ // Write small chunks instead of everything at once,
+ // to avoid a stack overflow in libsndfile (happens only with OGG format)
+ while (sampleCount > 0)
+ {
+ std::size_t count = sampleCount > 10000 ? 10000 : sampleCount;
+ sf_write_short(m_file, data, count);
+ data += count;
+ sampleCount -= count;
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundFile::seek(Time timeOffset)
+{
+ if (m_file)
+ {
+ sf_count_t frameOffset = static_cast<sf_count_t>(timeOffset.asSeconds() * m_sampleRate);
+ sf_seek(m_file, frameOffset, SEEK_SET);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundFile::initialize(SF_INFO fileInfo)
+{
+ // Save the sound properties
+ m_channelCount = fileInfo.channels;
+ m_sampleRate = fileInfo.samplerate;
+ m_sampleCount = static_cast<std::size_t>(fileInfo.frames) * fileInfo.channels;
+
+ // Enable scaling for Vorbis files (float samples)
+ // @todo enable when it's faster (it currently has to iterate over the *whole* music)
+ //if (fileInfo.format & SF_FORMAT_VORBIS)
+ // sf_command(m_file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE);
+}
+
+
+////////////////////////////////////////////////////////////
+int SoundFile::getFormatFromFilename(const std::string& filename)
+{
+ // Extract the extension
+ std::string ext = "wav";
+ std::string::size_type pos = filename.find_last_of(".");
+ if (pos != std::string::npos)
+ ext = toLower(filename.substr(pos + 1));
+
+ // Match every supported extension with its format constant
+ if (ext == "wav" ) return SF_FORMAT_WAV;
+ if (ext == "aif" ) return SF_FORMAT_AIFF;
+ if (ext == "aiff" ) return SF_FORMAT_AIFF;
+ if (ext == "au" ) return SF_FORMAT_AU;
+ if (ext == "raw" ) return SF_FORMAT_RAW;
+ if (ext == "paf" ) return SF_FORMAT_PAF;
+ if (ext == "svx" ) return SF_FORMAT_SVX;
+ if (ext == "nist" ) return SF_FORMAT_NIST;
+ if (ext == "voc" ) return SF_FORMAT_VOC;
+ if (ext == "sf" ) return SF_FORMAT_IRCAM;
+ if (ext == "w64" ) return SF_FORMAT_W64;
+ if (ext == "mat4" ) return SF_FORMAT_MAT4;
+ if (ext == "mat5" ) return SF_FORMAT_MAT5;
+ if (ext == "pvf" ) return SF_FORMAT_PVF;
+ if (ext == "xi" ) return SF_FORMAT_XI;
+ if (ext == "htk" ) return SF_FORMAT_HTK;
+ if (ext == "sds" ) return SF_FORMAT_SDS;
+ if (ext == "avr" ) return SF_FORMAT_AVR;
+ if (ext == "sd2" ) return SF_FORMAT_SD2;
+ if (ext == "flac" ) return SF_FORMAT_FLAC;
+ if (ext == "caf" ) return SF_FORMAT_CAF;
+ if (ext == "wve" ) return SF_FORMAT_WVE;
+ if (ext == "ogg" ) return SF_FORMAT_OGG;
+ if (ext == "mpc2k") return SF_FORMAT_MPC2K;
+ if (ext == "rf64" ) return SF_FORMAT_RF64;
+
+ return -1;
+}
+
+
+////////////////////////////////////////////////////////////
+sf_count_t SoundFile::Memory::getLength(void* user)
+{
+ Memory* memory = static_cast<Memory*>(user);
+ return memory->size;
+}
+
+
+////////////////////////////////////////////////////////////
+sf_count_t SoundFile::Memory::read(void* ptr, sf_count_t count, void* user)
+{
+ Memory* memory = static_cast<Memory*>(user);
+
+ sf_count_t position = tell(user);
+ if (position + count >= memory->size)
+ count = memory->size - position;
+
+ std::memcpy(ptr, memory->current, static_cast<std::size_t>(count));
+ memory->current += count;
+ return count;
+}
+
+
+////////////////////////////////////////////////////////////
+sf_count_t SoundFile::Memory::seek(sf_count_t offset, int whence, void* user)
+{
+ Memory* memory = static_cast<Memory*>(user);
+ sf_count_t position = 0;
+ switch (whence)
+ {
+ case SEEK_SET: position = offset; break;
+ case SEEK_CUR: position = memory->current - memory->begin + offset; break;
+ case SEEK_END: position = memory->size - offset; break;
+ default: position = 0; break;
+ }
+
+ if (position >= memory->size)
+ position = memory->size - 1;
+ else if (position < 0)
+ position = 0;
+
+ memory->current = memory->begin + position;
+ return position;
+}
+
+
+////////////////////////////////////////////////////////////
+sf_count_t SoundFile::Memory::tell(void* user)
+{
+ Memory* memory = static_cast<Memory*>(user);
+ return memory->current - memory->begin;
+}
+
+
+////////////////////////////////////////////////////////////
+sf_count_t SoundFile::Stream::getLength(void* userData)
+{
+ Stream* stream = static_cast<Stream*>(userData);
+ return stream->size;
+}
+
+
+////////////////////////////////////////////////////////////
+sf_count_t SoundFile::Stream::read(void* ptr, sf_count_t count, void* userData)
+{
+ Stream* stream = static_cast<Stream*>(userData);
+ Int64 position = stream->source->tell();
+ if (position != -1)
+ {
+ if (count > stream->size - position)
+ count = stream->size - position;
+ return stream->source->read(reinterpret_cast<char*>(ptr), count);
+ }
+ else
+ {
+ return -1;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+sf_count_t SoundFile::Stream::seek(sf_count_t offset, int whence, void* userData)
+{
+ Stream* stream = static_cast<Stream*>(userData);
+ switch (whence)
+ {
+ case SEEK_SET: return stream->source->seek(offset);
+ case SEEK_CUR: return stream->source->seek(stream->source->tell() + offset);
+ case SEEK_END: return stream->source->seek(stream->size - offset);
+ default: return stream->source->seek(0);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+sf_count_t SoundFile::Stream::tell(void* userData)
+{
+ Stream* stream = static_cast<Stream*>(userData);
+ return stream->source->tell();
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Audio/SoundFile.hpp b/src/SFML/Audio/SoundFile.hpp
index 105a951..a04a0ff 100644
--- a/src/SFML/Audio/SoundFile.hpp
+++ b/src/SFML/Audio/SoundFile.hpp
@@ -1,228 +1,231 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_SOUNDFILE_HPP
-#define SFML_SOUNDFILE_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/NonCopyable.hpp>
-#include <SFML/System/Time.hpp>
-#include <sndfile.h>
-#include <string>
-
-
-namespace sf
-{
-class InputStream;
-
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief Provide read and write access to sound files
-///
-////////////////////////////////////////////////////////////
-class SoundFile : NonCopyable
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Default constructor
- ///
- ////////////////////////////////////////////////////////////
- SoundFile();
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor
- ///
- ////////////////////////////////////////////////////////////
- ~SoundFile();
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the total number of audio samples in the file
- ///
- /// \return Number of samples
- ///
- ////////////////////////////////////////////////////////////
- std::size_t getSampleCount() const;
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the number of channels used by the sound
- ///
- /// \return Number of channels (1 = mono, 2 = stereo)
- ///
- ////////////////////////////////////////////////////////////
- unsigned int getChannelCount() const;
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the sample rate of the sound
- ///
- /// \return Sample rate, in samples per second
- ///
- ////////////////////////////////////////////////////////////
- unsigned int getSampleRate() const;
-
- ////////////////////////////////////////////////////////////
- /// \brief Open a sound file for reading
- ///
- /// \param filename Path of the sound file to load
- ///
- /// \return True if the file was successfully opened
- ///
- ////////////////////////////////////////////////////////////
- bool openRead(const std::string& filename);
-
- ////////////////////////////////////////////////////////////
- /// \brief Open a sound file in memory for reading
- ///
- /// \param data Pointer to the file data in memory
- /// \param sizeInBytes Size of the data to load, in bytes
- ///
- /// \return True if the file was successfully opened
- ///
- ////////////////////////////////////////////////////////////
- bool openRead(const void* data, std::size_t sizeInBytes);
-
- ////////////////////////////////////////////////////////////
- /// \brief Open a sound file from a custom stream for reading
- ///
- /// \param stream Source stream to read from
- ///
- /// \return True if the file was successfully opened
- ///
- ////////////////////////////////////////////////////////////
- bool openRead(InputStream& stream);
-
- ////////////////////////////////////////////////////////////
- /// \brief a the sound file for writing
- ///
- /// \param filename Path of the sound file to write
- /// \param channelCount Number of channels in the sound
- /// \param sampleRate Sample rate of the sound
- ///
- /// \return True if the file was successfully opened
- ///
- ////////////////////////////////////////////////////////////
- bool openWrite(const std::string& filename, unsigned int channelCount, unsigned int sampleRate);
-
- ////////////////////////////////////////////////////////////
- /// \brief Read audio samples from the loaded sound
- ///
- /// \param data Pointer to the sample array to fill
- /// \param sampleCount Number of samples to read
- ///
- /// \return Number of samples actually read (may be less than \a sampleCount)
- ///
- ////////////////////////////////////////////////////////////
- std::size_t read(Int16* data, std::size_t sampleCount);
-
- ////////////////////////////////////////////////////////////
- /// \brief Write audio samples to the file
- ///
- /// \param data Pointer to the sample array to write
- /// \param sampleCount Number of samples to write
- ///
- ////////////////////////////////////////////////////////////
- void write(const Int16* data, std::size_t sampleCount);
-
- ////////////////////////////////////////////////////////////
- /// \brief Change the current read position in the file
- ///
- /// \param timeOffset New playing position, from the beginning of the file
- ///
- ////////////////////////////////////////////////////////////
- void seek(Time timeOffset);
-
-private :
-
- ////////////////////////////////////////////////////////////
- /// \brief Initialize the internal state of the sound file
- ///
- /// This function is called by all the openRead functions.
- ///
- /// \param fileInfo Information about the loaded sound file
- ///
- ////////////////////////////////////////////////////////////
- void initialize(SF_INFO fileInfo);
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the internal format of an audio file according to
- /// its filename extension
- ///
- /// \param filename Filename to check
- ///
- /// \return Internal format matching the filename (-1 if no match)
- ///
- ////////////////////////////////////////////////////////////
- static int getFormatFromFilename(const std::string& filename);
-
- ////////////////////////////////////////////////////////////
- /// \brief Data and callbacks for opening from memory
- ///
- ////////////////////////////////////////////////////////////
- struct Memory
- {
- const char* begin;
- const char* current;
- sf_count_t size;
-
- static sf_count_t getLength(void* user);
- static sf_count_t read(void* ptr, sf_count_t count, void* user);
- static sf_count_t seek(sf_count_t offset, int whence, void* user);
- static sf_count_t tell(void* user);
- };
-
- ////////////////////////////////////////////////////////////
- /// \brief Data and callbacks for opening from stream
- ///
- ////////////////////////////////////////////////////////////
- struct Stream
- {
- InputStream* source;
- Int64 size;
-
- static sf_count_t getLength(void* user);
- static sf_count_t read(void* ptr, sf_count_t count, void* user);
- static sf_count_t seek(sf_count_t offset, int whence, void* user);
- static sf_count_t tell(void* user);
- };
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- SNDFILE* m_file; ///< File descriptor
- Memory m_memory; ///< Memory reading info
- Stream m_stream; ///< Stream reading info
- std::size_t m_sampleCount; ///< Total number of samples in the file
- unsigned int m_channelCount; ///< Number of channels used by the sound
- unsigned int m_sampleRate; ///< Number of samples per second
-};
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_SOUNDFILE_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SOUNDFILE_HPP
+#define SFML_SOUNDFILE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/NonCopyable.hpp>
+#include <SFML/System/Time.hpp>
+#include <sndfile.h>
+#include <string>
+
+
+namespace sf
+{
+class InputStream;
+
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Provide read and write access to sound files
+///
+////////////////////////////////////////////////////////////
+class SoundFile : NonCopyable
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ SoundFile();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~SoundFile();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the total number of audio samples in the file
+ ///
+ /// \return Number of samples
+ ///
+ ////////////////////////////////////////////////////////////
+ std::size_t getSampleCount() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the number of channels used by the sound
+ ///
+ /// \return Number of channels (1 = mono, 2 = stereo)
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int getChannelCount() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the sample rate of the sound
+ ///
+ /// \return Sample rate, in samples per second
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int getSampleRate() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open a sound file for reading
+ ///
+ /// \param filename Path of the sound file to load
+ ///
+ /// \return True if the file was successfully opened
+ ///
+ ////////////////////////////////////////////////////////////
+ bool openRead(const std::string& filename);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open a sound file in memory for reading
+ ///
+ /// \param data Pointer to the file data in memory
+ /// \param sizeInBytes Size of the data to load, in bytes
+ ///
+ /// \return True if the file was successfully opened
+ ///
+ ////////////////////////////////////////////////////////////
+ bool openRead(const void* data, std::size_t sizeInBytes);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open a sound file from a custom stream for reading
+ ///
+ /// \param stream Source stream to read from
+ ///
+ /// \return True if the file was successfully opened
+ ///
+ ////////////////////////////////////////////////////////////
+ bool openRead(InputStream& stream);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief a the sound file for writing
+ ///
+ /// \param filename Path of the sound file to write
+ /// \param channelCount Number of channels in the sound
+ /// \param sampleRate Sample rate of the sound
+ ///
+ /// \return True if the file was successfully opened
+ ///
+ ////////////////////////////////////////////////////////////
+ bool openWrite(const std::string& filename, unsigned int channelCount, unsigned int sampleRate);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Read audio samples from the loaded sound
+ ///
+ /// \param data Pointer to the sample array to fill
+ /// \param sampleCount Number of samples to read
+ ///
+ /// \return Number of samples actually read (may be less than \a sampleCount)
+ ///
+ ////////////////////////////////////////////////////////////
+ std::size_t read(Int16* data, std::size_t sampleCount);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Write audio samples to the file
+ ///
+ /// \param data Pointer to the sample array to write
+ /// \param sampleCount Number of samples to write
+ ///
+ ////////////////////////////////////////////////////////////
+ void write(const Int16* data, std::size_t sampleCount);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the current read position in the file
+ ///
+ /// \param timeOffset New playing position, from the beginning of the file
+ ///
+ ////////////////////////////////////////////////////////////
+ void seek(Time timeOffset);
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Initialize the internal state of the sound file
+ ///
+ /// This function is called by all the openRead functions.
+ ///
+ /// \param fileInfo Information about the loaded sound file
+ ///
+ ////////////////////////////////////////////////////////////
+ void initialize(SF_INFO fileInfo);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the internal format of an audio file according to
+ /// its filename extension
+ ///
+ /// \param filename Filename to check
+ ///
+ /// \return Internal format matching the filename (-1 if no match)
+ ///
+ ////////////////////////////////////////////////////////////
+ static int getFormatFromFilename(const std::string& filename);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Data and callbacks for opening from memory
+ ///
+ ////////////////////////////////////////////////////////////
+ struct Memory
+ {
+ const char* begin;
+ const char* current;
+ sf_count_t size;
+
+ static sf_count_t getLength(void* user);
+ static sf_count_t read(void* ptr, sf_count_t count, void* user);
+ static sf_count_t seek(sf_count_t offset, int whence, void* user);
+ static sf_count_t tell(void* user);
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Data and callbacks for opening from stream
+ ///
+ ////////////////////////////////////////////////////////////
+ struct Stream
+ {
+ InputStream* source;
+ Int64 size;
+
+ static sf_count_t getLength(void* user);
+ static sf_count_t read(void* ptr, sf_count_t count, void* user);
+ static sf_count_t seek(sf_count_t offset, int whence, void* user);
+ static sf_count_t tell(void* user);
+ };
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ SNDFILE* m_file; ///< File descriptor
+ Memory m_memory; ///< Memory reading info
+ Stream m_stream; ///< Stream reading info
+ std::size_t m_sampleCount; ///< Total number of samples in the file
+ unsigned int m_channelCount; ///< Number of channels used by the sound
+ unsigned int m_sampleRate; ///< Number of samples per second
+ #ifdef SFML_SYSTEM_ANDROID
+ void* m_resourceStream; ///< Asset file streamer (if loaded from file)
+ #endif
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_SOUNDFILE_HPP
diff --git a/src/SFML/Audio/SoundRecorder.cpp b/src/SFML/Audio/SoundRecorder.cpp
index bf7b03f..51e7ef9 100644
--- a/src/SFML/Audio/SoundRecorder.cpp
+++ b/src/SFML/Audio/SoundRecorder.cpp
@@ -1,203 +1,290 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Audio/SoundRecorder.hpp>
-#include <SFML/Audio/AudioDevice.hpp>
-#include <SFML/Audio/ALCheck.hpp>
-#include <SFML/System/Sleep.hpp>
-#include <SFML/System/Err.hpp>
-
-#ifdef _MSC_VER
- #pragma warning(disable : 4355) // 'this' used in base member initializer list
-#endif
-
-
-namespace
-{
- ALCdevice* captureDevice = NULL;
-}
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-SoundRecorder::SoundRecorder() :
-m_thread (&SoundRecorder::record, this),
-m_sampleRate (0),
-m_isCapturing(false)
-{
- priv::ensureALInit();
-}
-
-
-////////////////////////////////////////////////////////////
-SoundRecorder::~SoundRecorder()
-{
- // Nothing to do
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundRecorder::start(unsigned int sampleRate)
-{
- // Check if the device can do audio capture
- if (!isAvailable())
- {
- err() << "Failed to start capture : your system cannot capture audio data (call SoundRecorder::IsAvailable to check it)" << std::endl;
- return;
- }
-
- // Check that another capture is not already running
- if (captureDevice)
- {
- err() << "Trying to start audio capture, but another capture is already running" << std::endl;
- return;
- }
-
- // Open the capture device for capturing 16 bits mono samples
- captureDevice = alcCaptureOpenDevice(NULL, sampleRate, AL_FORMAT_MONO16, sampleRate);
- if (!captureDevice)
- {
- err() << "Failed to open the audio capture device" << std::endl;
- return;
- }
-
- // Clear the array of samples
- m_samples.clear();
-
- // Store the sample rate
- m_sampleRate = sampleRate;
-
- // Notify derived class
- if (onStart())
- {
- // Start the capture
- alcCaptureStart(captureDevice);
-
- // Start the capture in a new thread, to avoid blocking the main thread
- m_isCapturing = true;
- m_thread.launch();
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundRecorder::stop()
-{
- // Stop the capturing thread
- m_isCapturing = false;
- m_thread.wait();
-}
-
-
-////////////////////////////////////////////////////////////
-unsigned int SoundRecorder::getSampleRate() const
-{
- return m_sampleRate;
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundRecorder::isAvailable()
-{
- return (priv::AudioDevice::isExtensionSupported("ALC_EXT_CAPTURE") != AL_FALSE) ||
- (priv::AudioDevice::isExtensionSupported("ALC_EXT_capture") != AL_FALSE); // "bug" in Mac OS X 10.5 and 10.6
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundRecorder::onStart()
-{
- // Nothing to do
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundRecorder::onStop()
-{
- // Nothing to do
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundRecorder::record()
-{
- while (m_isCapturing)
- {
- // Process available samples
- processCapturedSamples();
-
- // Don't bother the CPU while waiting for more captured data
- sleep(milliseconds(100));
- }
-
- // Capture is finished : clean up everything
- cleanup();
-
- // Notify derived class
- onStop();
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundRecorder::processCapturedSamples()
-{
- // Get the number of samples available
- ALCint samplesAvailable;
- alcGetIntegerv(captureDevice, ALC_CAPTURE_SAMPLES, 1, &samplesAvailable);
-
- if (samplesAvailable > 0)
- {
- // Get the recorded samples
- m_samples.resize(samplesAvailable);
- alcCaptureSamples(captureDevice, &m_samples[0], samplesAvailable);
-
- // Forward them to the derived class
- if (!onProcessSamples(&m_samples[0], m_samples.size()))
- {
- // The user wants to stop the capture
- m_isCapturing = false;
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundRecorder::cleanup()
-{
- // Stop the capture
- alcCaptureStop(captureDevice);
-
- // Get the samples left in the buffer
- processCapturedSamples();
-
- // Close the device
- alcCaptureCloseDevice(captureDevice);
- captureDevice = NULL;
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/SoundRecorder.hpp>
+#include <SFML/Audio/AudioDevice.hpp>
+#include <SFML/Audio/ALCheck.hpp>
+#include <SFML/System/Sleep.hpp>
+#include <SFML/System/Err.hpp>
+#include <cstring>
+
+#ifdef _MSC_VER
+ #pragma warning(disable: 4355) // 'this' used in base member initializer list
+#endif
+
+
+namespace
+{
+ ALCdevice* captureDevice = NULL;
+}
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+SoundRecorder::SoundRecorder() :
+m_thread (&SoundRecorder::record, this),
+m_sampleRate (0),
+m_processingInterval(milliseconds(100)),
+m_isCapturing (false)
+{
+ priv::ensureALInit();
+
+ // Set the device name to the default device
+ m_deviceName = getDefaultDevice();
+}
+
+
+////////////////////////////////////////////////////////////
+SoundRecorder::~SoundRecorder()
+{
+ // Nothing to do
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundRecorder::start(unsigned int sampleRate)
+{
+ // Check if the device can do audio capture
+ if (!isAvailable())
+ {
+ err() << "Failed to start capture: your system cannot capture audio data (call SoundRecorder::isAvailable to check it)" << std::endl;
+ return false;
+ }
+
+ // Check that another capture is not already running
+ if (captureDevice)
+ {
+ err() << "Trying to start audio capture, but another capture is already running" << std::endl;
+ return false;
+ }
+
+ // Open the capture device for capturing 16 bits mono samples
+ captureDevice = alcCaptureOpenDevice(m_deviceName.c_str(), sampleRate, AL_FORMAT_MONO16, sampleRate);
+ if (!captureDevice)
+ {
+ err() << "Failed to open the audio capture device with the name: " << m_deviceName << std::endl;
+ return false;
+ }
+
+ // Clear the array of samples
+ m_samples.clear();
+
+ // Store the sample rate
+ m_sampleRate = sampleRate;
+
+ // Notify derived class
+ if (onStart())
+ {
+ // Start the capture
+ alcCaptureStart(captureDevice);
+
+ // Start the capture in a new thread, to avoid blocking the main thread
+ m_isCapturing = true;
+ m_thread.launch();
+
+ return true;
+ }
+
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundRecorder::stop()
+{
+ // Stop the capturing thread
+ m_isCapturing = false;
+ m_thread.wait();
+
+ // Notify derived class
+ onStop();
+}
+
+
+////////////////////////////////////////////////////////////
+unsigned int SoundRecorder::getSampleRate() const
+{
+ return m_sampleRate;
+}
+
+
+////////////////////////////////////////////////////////////
+std::vector<std::string> SoundRecorder::getAvailableDevices()
+{
+ std::vector<std::string> deviceNameList;
+
+ const ALchar *deviceList = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
+ if (deviceList)
+ {
+ while (*deviceList)
+ {
+ deviceNameList.push_back(deviceList);
+ deviceList += std::strlen(deviceList) + 1;
+ }
+ }
+
+ return deviceNameList;
+}
+
+
+////////////////////////////////////////////////////////////
+std::string SoundRecorder::getDefaultDevice()
+{
+ return alcGetString(NULL, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER);
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundRecorder::setDevice(const std::string& name)
+{
+ // Store the device name
+ if (name.empty())
+ m_deviceName = getDefaultDevice();
+ else
+ m_deviceName = name;
+
+ if (m_isCapturing)
+ {
+ // Stop the capturing thread
+ m_isCapturing = false;
+ m_thread.wait();
+
+ // Open the requested capture device for capturing 16 bits mono samples
+ captureDevice = alcCaptureOpenDevice(name.c_str(), m_sampleRate, AL_FORMAT_MONO16, m_sampleRate);
+ if (!captureDevice)
+ {
+ // Notify derived class
+ onStop();
+
+ err() << "Failed to open the audio capture device with the name: " << m_deviceName << std::endl;
+ return false;
+ }
+
+ // Start the capture
+ alcCaptureStart(captureDevice);
+
+ // Start the capture in a new thread, to avoid blocking the main thread
+ m_isCapturing = true;
+ m_thread.launch();
+ }
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+const std::string& SoundRecorder::getDevice() const
+{
+ return m_deviceName;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundRecorder::isAvailable()
+{
+ return (priv::AudioDevice::isExtensionSupported("ALC_EXT_CAPTURE") != AL_FALSE) ||
+ (priv::AudioDevice::isExtensionSupported("ALC_EXT_capture") != AL_FALSE); // "bug" in Mac OS X 10.5 and 10.6
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundRecorder::setProcessingInterval(sf::Time interval)
+{
+ m_processingInterval = interval;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundRecorder::onStart()
+{
+ // Nothing to do
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundRecorder::onStop()
+{
+ // Nothing to do
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundRecorder::record()
+{
+ while (m_isCapturing)
+ {
+ // Process available samples
+ processCapturedSamples();
+
+ // Don't bother the CPU while waiting for more captured data
+ sleep(m_processingInterval);
+ }
+
+ // Capture is finished: clean up everything
+ cleanup();
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundRecorder::processCapturedSamples()
+{
+ // Get the number of samples available
+ ALCint samplesAvailable;
+ alcGetIntegerv(captureDevice, ALC_CAPTURE_SAMPLES, 1, &samplesAvailable);
+
+ if (samplesAvailable > 0)
+ {
+ // Get the recorded samples
+ m_samples.resize(samplesAvailable);
+ alcCaptureSamples(captureDevice, &m_samples[0], samplesAvailable);
+
+ // Forward them to the derived class
+ if (!onProcessSamples(&m_samples[0], m_samples.size()))
+ {
+ // The user wants to stop the capture
+ m_isCapturing = false;
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundRecorder::cleanup()
+{
+ // Stop the capture
+ alcCaptureStop(captureDevice);
+
+ // Get the samples left in the buffer
+ processCapturedSamples();
+
+ // Close the device
+ alcCaptureCloseDevice(captureDevice);
+ captureDevice = NULL;
+}
+
+} // namespace sf
diff --git a/src/SFML/Audio/SoundSource.cpp b/src/SFML/Audio/SoundSource.cpp
index c5a6524..3129b2e 100644
--- a/src/SFML/Audio/SoundSource.cpp
+++ b/src/SFML/Audio/SoundSource.cpp
@@ -1,194 +1,194 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Audio/SoundSource.hpp>
-#include <SFML/Audio/ALCheck.hpp>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-SoundSource::SoundSource()
-{
- priv::ensureALInit();
-
- alCheck(alGenSources(1, &m_source));
- alCheck(alSourcei(m_source, AL_BUFFER, 0));
-}
-
-
-////////////////////////////////////////////////////////////
-SoundSource::SoundSource(const SoundSource& copy)
-{
- priv::ensureALInit();
-
- alCheck(alGenSources(1, &m_source));
- alCheck(alSourcei(m_source, AL_BUFFER, 0));
-
- setPitch(copy.getPitch());
- setVolume(copy.getVolume());
- setPosition(copy.getPosition());
- setRelativeToListener(copy.isRelativeToListener());
- setMinDistance(copy.getMinDistance());
- setAttenuation(copy.getAttenuation());
-}
-
-
-////////////////////////////////////////////////////////////
-SoundSource::~SoundSource()
-{
- alCheck(alSourcei(m_source, AL_BUFFER, 0));
- alCheck(alDeleteSources(1, &m_source));
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundSource::setPitch(float pitch)
-{
- alCheck(alSourcef(m_source, AL_PITCH, pitch));
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundSource::setVolume(float volume)
-{
- alCheck(alSourcef(m_source, AL_GAIN, volume * 0.01f));
-}
-
-////////////////////////////////////////////////////////////
-void SoundSource::setPosition(float x, float y, float z)
-{
- alCheck(alSource3f(m_source, AL_POSITION, x, y, z));
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundSource::setPosition(const Vector3f& position)
-{
- setPosition(position.x, position.y, position.z);
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundSource::setRelativeToListener(bool relative)
-{
- alCheck(alSourcei(m_source, AL_SOURCE_RELATIVE, relative));
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundSource::setMinDistance(float distance)
-{
- alCheck(alSourcef(m_source, AL_REFERENCE_DISTANCE, distance));
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundSource::setAttenuation(float attenuation)
-{
- alCheck(alSourcef(m_source, AL_ROLLOFF_FACTOR, attenuation));
-}
-
-
-////////////////////////////////////////////////////////////
-float SoundSource::getPitch() const
-{
- ALfloat pitch;
- alCheck(alGetSourcef(m_source, AL_PITCH, &pitch));
-
- return pitch;
-}
-
-
-////////////////////////////////////////////////////////////
-float SoundSource::getVolume() const
-{
- ALfloat gain;
- alCheck(alGetSourcef(m_source, AL_GAIN, &gain));
-
- return gain * 100.f;
-}
-
-
-////////////////////////////////////////////////////////////
-Vector3f SoundSource::getPosition() const
-{
- Vector3f position;
- alCheck(alGetSource3f(m_source, AL_POSITION, &position.x, &position.y, &position.z));
-
- return position;
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundSource::isRelativeToListener() const
-{
- ALint relative;
- alCheck(alGetSourcei(m_source, AL_SOURCE_RELATIVE, &relative));
-
- return relative != 0;
-}
-
-
-////////////////////////////////////////////////////////////
-float SoundSource::getMinDistance() const
-{
- ALfloat distance;
- alCheck(alGetSourcef(m_source, AL_REFERENCE_DISTANCE, &distance));
-
- return distance;
-}
-
-
-////////////////////////////////////////////////////////////
-float SoundSource::getAttenuation() const
-{
- ALfloat attenuation;
- alCheck(alGetSourcef(m_source, AL_ROLLOFF_FACTOR, &attenuation));
-
- return attenuation;
-}
-
-
-////////////////////////////////////////////////////////////
-SoundSource::Status SoundSource::getStatus() const
-{
- ALint status;
- alCheck(alGetSourcei(m_source, AL_SOURCE_STATE, &status));
-
- switch (status)
- {
- case AL_INITIAL :
- case AL_STOPPED : return Stopped;
- case AL_PAUSED : return Paused;
- case AL_PLAYING : return Playing;
- }
-
- return Stopped;
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/SoundSource.hpp>
+#include <SFML/Audio/ALCheck.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+SoundSource::SoundSource()
+{
+ priv::ensureALInit();
+
+ alCheck(alGenSources(1, &m_source));
+ alCheck(alSourcei(m_source, AL_BUFFER, 0));
+}
+
+
+////////////////////////////////////////////////////////////
+SoundSource::SoundSource(const SoundSource& copy)
+{
+ priv::ensureALInit();
+
+ alCheck(alGenSources(1, &m_source));
+ alCheck(alSourcei(m_source, AL_BUFFER, 0));
+
+ setPitch(copy.getPitch());
+ setVolume(copy.getVolume());
+ setPosition(copy.getPosition());
+ setRelativeToListener(copy.isRelativeToListener());
+ setMinDistance(copy.getMinDistance());
+ setAttenuation(copy.getAttenuation());
+}
+
+
+////////////////////////////////////////////////////////////
+SoundSource::~SoundSource()
+{
+ alCheck(alSourcei(m_source, AL_BUFFER, 0));
+ alCheck(alDeleteSources(1, &m_source));
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundSource::setPitch(float pitch)
+{
+ alCheck(alSourcef(m_source, AL_PITCH, pitch));
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundSource::setVolume(float volume)
+{
+ alCheck(alSourcef(m_source, AL_GAIN, volume * 0.01f));
+}
+
+////////////////////////////////////////////////////////////
+void SoundSource::setPosition(float x, float y, float z)
+{
+ alCheck(alSource3f(m_source, AL_POSITION, x, y, z));
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundSource::setPosition(const Vector3f& position)
+{
+ setPosition(position.x, position.y, position.z);
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundSource::setRelativeToListener(bool relative)
+{
+ alCheck(alSourcei(m_source, AL_SOURCE_RELATIVE, relative));
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundSource::setMinDistance(float distance)
+{
+ alCheck(alSourcef(m_source, AL_REFERENCE_DISTANCE, distance));
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundSource::setAttenuation(float attenuation)
+{
+ alCheck(alSourcef(m_source, AL_ROLLOFF_FACTOR, attenuation));
+}
+
+
+////////////////////////////////////////////////////////////
+float SoundSource::getPitch() const
+{
+ ALfloat pitch;
+ alCheck(alGetSourcef(m_source, AL_PITCH, &pitch));
+
+ return pitch;
+}
+
+
+////////////////////////////////////////////////////////////
+float SoundSource::getVolume() const
+{
+ ALfloat gain;
+ alCheck(alGetSourcef(m_source, AL_GAIN, &gain));
+
+ return gain * 100.f;
+}
+
+
+////////////////////////////////////////////////////////////
+Vector3f SoundSource::getPosition() const
+{
+ Vector3f position;
+ alCheck(alGetSource3f(m_source, AL_POSITION, &position.x, &position.y, &position.z));
+
+ return position;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundSource::isRelativeToListener() const
+{
+ ALint relative;
+ alCheck(alGetSourcei(m_source, AL_SOURCE_RELATIVE, &relative));
+
+ return relative != 0;
+}
+
+
+////////////////////////////////////////////////////////////
+float SoundSource::getMinDistance() const
+{
+ ALfloat distance;
+ alCheck(alGetSourcef(m_source, AL_REFERENCE_DISTANCE, &distance));
+
+ return distance;
+}
+
+
+////////////////////////////////////////////////////////////
+float SoundSource::getAttenuation() const
+{
+ ALfloat attenuation;
+ alCheck(alGetSourcef(m_source, AL_ROLLOFF_FACTOR, &attenuation));
+
+ return attenuation;
+}
+
+
+////////////////////////////////////////////////////////////
+SoundSource::Status SoundSource::getStatus() const
+{
+ ALint status;
+ alCheck(alGetSourcei(m_source, AL_SOURCE_STATE, &status));
+
+ switch (status)
+ {
+ case AL_INITIAL:
+ case AL_STOPPED: return Stopped;
+ case AL_PAUSED: return Paused;
+ case AL_PLAYING: return Playing;
+ }
+
+ return Stopped;
+}
+
+} // namespace sf
diff --git a/src/SFML/Audio/SoundStream.cpp b/src/SFML/Audio/SoundStream.cpp
index 31df188..8321889 100644
--- a/src/SFML/Audio/SoundStream.cpp
+++ b/src/SFML/Audio/SoundStream.cpp
@@ -1,365 +1,469 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Audio/SoundStream.hpp>
-#include <SFML/Audio/AudioDevice.hpp>
-#include <SFML/Audio/ALCheck.hpp>
-#include <SFML/System/Sleep.hpp>
-#include <SFML/System/Err.hpp>
-
-#ifdef _MSC_VER
- #pragma warning(disable : 4355) // 'this' used in base member initializer list
-#endif
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-SoundStream::SoundStream() :
-m_thread (&SoundStream::streamData, this),
-m_isStreaming (false),
-m_channelCount (0),
-m_sampleRate (0),
-m_format (0),
-m_loop (false),
-m_samplesProcessed(0)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-SoundStream::~SoundStream()
-{
- // Stop the sound if it was playing
- stop();
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundStream::initialize(unsigned int channelCount, unsigned int sampleRate)
-{
- m_channelCount = channelCount;
- m_sampleRate = sampleRate;
-
- // Deduce the format from the number of channels
- m_format = priv::AudioDevice::getFormatFromChannelCount(channelCount);
-
- // Check if the format is valid
- if (m_format == 0)
- {
- m_channelCount = 0;
- m_sampleRate = 0;
- err() << "Unsupported number of channels (" << m_channelCount << ")" << std::endl;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundStream::play()
-{
- // Check if the sound parameters have been set
- if (m_format == 0)
- {
- err() << "Failed to play audio stream: sound parameters have not been initialized (call Initialize first)" << std::endl;
- return;
- }
-
- // If the sound is already playing (probably paused), just resume it
- if (m_isStreaming)
- {
- alCheck(alSourcePlay(m_source));
- return;
- }
-
- // Move to the beginning
- onSeek(Time::Zero);
-
- // Start updating the stream in a separate thread to avoid blocking the application
- m_samplesProcessed = 0;
- m_isStreaming = true;
- m_thread.launch();
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundStream::pause()
-{
- alCheck(alSourcePause(m_source));
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundStream::stop()
-{
- // Wait for the thread to terminate
- m_isStreaming = false;
- m_thread.wait();
-}
-
-
-////////////////////////////////////////////////////////////
-unsigned int SoundStream::getChannelCount() const
-{
- return m_channelCount;
-}
-
-
-////////////////////////////////////////////////////////////
-unsigned int SoundStream::getSampleRate() const
-{
- return m_sampleRate;
-}
-
-
-////////////////////////////////////////////////////////////
-SoundStream::Status SoundStream::getStatus() const
-{
- Status status = SoundSource::getStatus();
-
- // To compensate for the lag between play() and alSourceplay()
- if ((status == Stopped) && m_isStreaming)
- status = Playing;
-
- return status;
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundStream::setPlayingOffset(Time timeOffset)
-{
- // Stop the stream
- stop();
-
- // Let the derived class update the current position
- onSeek(timeOffset);
-
- // Restart streaming
- m_samplesProcessed = static_cast<Uint64>(timeOffset.asSeconds() * m_sampleRate * m_channelCount);
- m_isStreaming = true;
- m_thread.launch();
-}
-
-
-////////////////////////////////////////////////////////////
-Time SoundStream::getPlayingOffset() const
-{
- if (m_sampleRate && m_channelCount)
- {
- ALfloat secs = 0.f;
- alCheck(alGetSourcef(m_source, AL_SEC_OFFSET, &secs));
-
- return seconds(secs + static_cast<float>(m_samplesProcessed) / m_sampleRate / m_channelCount);
- }
- else
- {
- return Time::Zero;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundStream::setLoop(bool loop)
-{
- m_loop = loop;
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundStream::getLoop() const
-{
- return m_loop;
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundStream::streamData()
-{
- // Create the buffers
- alCheck(alGenBuffers(BufferCount, m_buffers));
- for (int i = 0; i < BufferCount; ++i)
- m_endBuffers[i] = false;
-
- // Fill the queue
- bool requestStop = fillQueue();
-
- // Play the sound
- alCheck(alSourcePlay(m_source));
-
- while (m_isStreaming)
- {
- // The stream has been interrupted!
- if (SoundSource::getStatus() == Stopped)
- {
- if (!requestStop)
- {
- // Just continue
- alCheck(alSourcePlay(m_source));
- }
- else
- {
- // End streaming
- m_isStreaming = false;
- }
- }
-
- // Get the number of buffers that have been processed (ie. ready for reuse)
- ALint nbProcessed = 0;
- alCheck(alGetSourcei(m_source, AL_BUFFERS_PROCESSED, &nbProcessed));
-
- while (nbProcessed--)
- {
- // Pop the first unused buffer from the queue
- ALuint buffer;
- alCheck(alSourceUnqueueBuffers(m_source, 1, &buffer));
-
- // Find its number
- unsigned int bufferNum = 0;
- for (int i = 0; i < BufferCount; ++i)
- if (m_buffers[i] == buffer)
- {
- bufferNum = i;
- break;
- }
-
- // Retrieve its size and add it to the samples count
- if (m_endBuffers[bufferNum])
- {
- // This was the last buffer: reset the sample count
- m_samplesProcessed = 0;
- m_endBuffers[bufferNum] = false;
- }
- else
- {
- ALint size, bits;
- alCheck(alGetBufferi(buffer, AL_SIZE, &size));
- alCheck(alGetBufferi(buffer, AL_BITS, &bits));
- m_samplesProcessed += size / (bits / 8);
- }
-
- // Fill it and push it back into the playing queue
- if (!requestStop)
- {
- if (fillAndPushBuffer(bufferNum))
- requestStop = true;
- }
- }
-
- // Leave some time for the other threads if the stream is still playing
- if (SoundSource::getStatus() != Stopped)
- sleep(milliseconds(10));
- }
-
- // Stop the playback
- alCheck(alSourceStop(m_source));
-
- // Unqueue any buffer left in the queue
- clearQueue();
-
- // Delete the buffers
- alCheck(alSourcei(m_source, AL_BUFFER, 0));
- alCheck(alDeleteBuffers(BufferCount, m_buffers));
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundStream::fillAndPushBuffer(unsigned int bufferNum)
-{
- bool requestStop = false;
-
- // Acquire audio data
- Chunk data = {NULL, 0};
- if (!onGetData(data))
- {
- // Mark the buffer as the last one (so that we know when to reset the playing position)
- m_endBuffers[bufferNum] = true;
-
- // Check if the stream must loop or stop
- if (m_loop)
- {
- // Return to the beginning of the stream source
- onSeek(Time::Zero);
-
- // If we previously had no data, try to fill the buffer once again
- if (!data.samples || (data.sampleCount == 0))
- {
- return fillAndPushBuffer(bufferNum);
- }
- }
- else
- {
- // Not looping: request stop
- requestStop = true;
- }
- }
-
- // Fill the buffer if some data was returned
- if (data.samples && data.sampleCount)
- {
- unsigned int buffer = m_buffers[bufferNum];
-
- // Fill the buffer
- ALsizei size = static_cast<ALsizei>(data.sampleCount) * sizeof(Int16);
- alCheck(alBufferData(buffer, m_format, data.samples, size, m_sampleRate));
-
- // Push it into the sound queue
- alCheck(alSourceQueueBuffers(m_source, 1, &buffer));
- }
-
- return requestStop;
-}
-
-
-////////////////////////////////////////////////////////////
-bool SoundStream::fillQueue()
-{
- // Fill and enqueue all the available buffers
- bool requestStop = false;
- for (int i = 0; (i < BufferCount) && !requestStop; ++i)
- {
- if (fillAndPushBuffer(i))
- requestStop = true;
- }
-
- return requestStop;
-}
-
-
-////////////////////////////////////////////////////////////
-void SoundStream::clearQueue()
-{
- // Get the number of buffers still in the queue
- ALint nbQueued;
- alCheck(alGetSourcei(m_source, AL_BUFFERS_QUEUED, &nbQueued));
-
- // Unqueue them all
- ALuint buffer;
- for (ALint i = 0; i < nbQueued; ++i)
- alCheck(alSourceUnqueueBuffers(m_source, 1, &buffer));
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/SoundStream.hpp>
+#include <SFML/Audio/AudioDevice.hpp>
+#include <SFML/Audio/ALCheck.hpp>
+#include <SFML/System/Sleep.hpp>
+#include <SFML/System/Err.hpp>
+#include <SFML/System/Lock.hpp>
+
+#ifdef _MSC_VER
+ #pragma warning(disable: 4355) // 'this' used in base member initializer list
+#endif
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+SoundStream::SoundStream() :
+m_thread (&SoundStream::streamData, this),
+m_threadMutex (),
+m_threadStartState(Stopped),
+m_isStreaming (false),
+m_channelCount (0),
+m_sampleRate (0),
+m_format (0),
+m_loop (false),
+m_samplesProcessed(0)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+SoundStream::~SoundStream()
+{
+ // Stop the sound if it was playing
+
+ // Request the thread to terminate
+ {
+ Lock lock(m_threadMutex);
+ m_isStreaming = false;
+ }
+
+ // Wait for the thread to terminate
+ m_thread.wait();
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundStream::initialize(unsigned int channelCount, unsigned int sampleRate)
+{
+ m_channelCount = channelCount;
+ m_sampleRate = sampleRate;
+
+ // Deduce the format from the number of channels
+ m_format = priv::AudioDevice::getFormatFromChannelCount(channelCount);
+
+ // Check if the format is valid
+ if (m_format == 0)
+ {
+ m_channelCount = 0;
+ m_sampleRate = 0;
+ err() << "Unsupported number of channels (" << m_channelCount << ")" << std::endl;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundStream::play()
+{
+ // Check if the sound parameters have been set
+ if (m_format == 0)
+ {
+ err() << "Failed to play audio stream: sound parameters have not been initialized (call initialize() first)" << std::endl;
+ return;
+ }
+
+ bool isStreaming = false;
+ Status threadStartState = Stopped;
+
+ {
+ Lock lock(m_threadMutex);
+
+ isStreaming = m_isStreaming;
+ threadStartState = m_threadStartState;
+ }
+
+
+ if (isStreaming && (threadStartState == Paused))
+ {
+ // If the sound is paused, resume it
+ Lock lock(m_threadMutex);
+ m_threadStartState = Playing;
+ alCheck(alSourcePlay(m_source));
+ return;
+ }
+ else if (isStreaming && (threadStartState == Playing))
+ {
+ // If the sound is playing, stop it and continue as if it was stopped
+ stop();
+ }
+
+ // Move to the beginning
+ onSeek(Time::Zero);
+
+ // Start updating the stream in a separate thread to avoid blocking the application
+ m_samplesProcessed = 0;
+ m_isStreaming = true;
+ m_threadStartState = Playing;
+ m_thread.launch();
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundStream::pause()
+{
+ // Handle pause() being called before the thread has started
+ {
+ Lock lock(m_threadMutex);
+
+ if (!m_isStreaming)
+ return;
+
+ m_threadStartState = Paused;
+ }
+
+ alCheck(alSourcePause(m_source));
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundStream::stop()
+{
+ // Request the thread to terminate
+ {
+ Lock lock(m_threadMutex);
+ m_isStreaming = false;
+ }
+
+ // Wait for the thread to terminate
+ m_thread.wait();
+
+ // Move to the beginning
+ onSeek(Time::Zero);
+
+ // Reset the playing position
+ m_samplesProcessed = 0;
+}
+
+
+////////////////////////////////////////////////////////////
+unsigned int SoundStream::getChannelCount() const
+{
+ return m_channelCount;
+}
+
+
+////////////////////////////////////////////////////////////
+unsigned int SoundStream::getSampleRate() const
+{
+ return m_sampleRate;
+}
+
+
+////////////////////////////////////////////////////////////
+SoundStream::Status SoundStream::getStatus() const
+{
+ Status status = SoundSource::getStatus();
+
+ // To compensate for the lag between play() and alSourceplay()
+ if (status == Stopped)
+ {
+ Lock lock(m_threadMutex);
+
+ if (m_isStreaming)
+ status = m_threadStartState;
+ }
+
+ return status;
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundStream::setPlayingOffset(Time timeOffset)
+{
+ // Get old playing status
+ Status oldStatus = getStatus();
+
+ // Stop the stream
+ stop();
+
+ // Let the derived class update the current position
+ onSeek(timeOffset);
+
+ // Restart streaming
+ m_samplesProcessed = static_cast<Uint64>(timeOffset.asSeconds() * m_sampleRate * m_channelCount);
+
+ if (oldStatus == Stopped)
+ return;
+
+ m_isStreaming = true;
+ m_threadStartState = oldStatus;
+ m_thread.launch();
+}
+
+
+////////////////////////////////////////////////////////////
+Time SoundStream::getPlayingOffset() const
+{
+ if (m_sampleRate && m_channelCount)
+ {
+ ALfloat secs = 0.f;
+ alCheck(alGetSourcef(m_source, AL_SEC_OFFSET, &secs));
+
+ return seconds(secs + static_cast<float>(m_samplesProcessed) / m_sampleRate / m_channelCount);
+ }
+ else
+ {
+ return Time::Zero;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundStream::setLoop(bool loop)
+{
+ m_loop = loop;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundStream::getLoop() const
+{
+ return m_loop;
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundStream::streamData()
+{
+ bool requestStop = false;
+
+ {
+ Lock lock(m_threadMutex);
+
+ // Check if the thread was launched Stopped
+ if (m_threadStartState == Stopped)
+ {
+ m_isStreaming = false;
+ return;
+ }
+
+ // Create the buffers
+ alCheck(alGenBuffers(BufferCount, m_buffers));
+ for (int i = 0; i < BufferCount; ++i)
+ m_endBuffers[i] = false;
+
+ // Fill the queue
+ requestStop = fillQueue();
+
+ // Play the sound
+ alCheck(alSourcePlay(m_source));
+
+ // Check if the thread was launched Paused
+ if (m_threadStartState == Paused)
+ alCheck(alSourcePause(m_source));
+ }
+
+ for (;;)
+ {
+ {
+ Lock lock(m_threadMutex);
+ if (!m_isStreaming)
+ break;
+ }
+
+ // The stream has been interrupted!
+ if (SoundSource::getStatus() == Stopped)
+ {
+ if (!requestStop)
+ {
+ // Just continue
+ alCheck(alSourcePlay(m_source));
+ }
+ else
+ {
+ // End streaming
+ Lock lock(m_threadMutex);
+ m_isStreaming = false;
+ }
+ }
+
+ // Get the number of buffers that have been processed (i.e. ready for reuse)
+ ALint nbProcessed = 0;
+ alCheck(alGetSourcei(m_source, AL_BUFFERS_PROCESSED, &nbProcessed));
+
+ while (nbProcessed--)
+ {
+ // Pop the first unused buffer from the queue
+ ALuint buffer;
+ alCheck(alSourceUnqueueBuffers(m_source, 1, &buffer));
+
+ // Find its number
+ unsigned int bufferNum = 0;
+ for (int i = 0; i < BufferCount; ++i)
+ if (m_buffers[i] == buffer)
+ {
+ bufferNum = i;
+ break;
+ }
+
+ // Retrieve its size and add it to the samples count
+ if (m_endBuffers[bufferNum])
+ {
+ // This was the last buffer: reset the sample count
+ m_samplesProcessed = 0;
+ m_endBuffers[bufferNum] = false;
+ }
+ else
+ {
+ ALint size, bits;
+ alCheck(alGetBufferi(buffer, AL_SIZE, &size));
+ alCheck(alGetBufferi(buffer, AL_BITS, &bits));
+
+ // Bits can be 0 if the format or parameters are corrupt, avoid division by zero
+ if (bits == 0)
+ {
+ err() << "Bits in sound stream are 0: make sure that the audio format is not corrupt "
+ << "and initialize() has been called correctly" << std::endl;
+
+ // Abort streaming (exit main loop)
+ Lock lock(m_threadMutex);
+ m_isStreaming = false;
+ requestStop = true;
+ break;
+ }
+ else
+ {
+ m_samplesProcessed += size / (bits / 8);
+ }
+ }
+
+ // Fill it and push it back into the playing queue
+ if (!requestStop)
+ {
+ if (fillAndPushBuffer(bufferNum))
+ requestStop = true;
+ }
+ }
+
+ // Leave some time for the other threads if the stream is still playing
+ if (SoundSource::getStatus() != Stopped)
+ sleep(milliseconds(10));
+ }
+
+ // Stop the playback
+ alCheck(alSourceStop(m_source));
+
+ // Dequeue any buffer left in the queue
+ clearQueue();
+
+ // Delete the buffers
+ alCheck(alSourcei(m_source, AL_BUFFER, 0));
+ alCheck(alDeleteBuffers(BufferCount, m_buffers));
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundStream::fillAndPushBuffer(unsigned int bufferNum)
+{
+ bool requestStop = false;
+
+ // Acquire audio data
+ Chunk data = {NULL, 0};
+ if (!onGetData(data))
+ {
+ // Mark the buffer as the last one (so that we know when to reset the playing position)
+ m_endBuffers[bufferNum] = true;
+
+ // Check if the stream must loop or stop
+ if (m_loop)
+ {
+ // Return to the beginning of the stream source
+ onSeek(Time::Zero);
+
+ // If we previously had no data, try to fill the buffer once again
+ if (!data.samples || (data.sampleCount == 0))
+ {
+ return fillAndPushBuffer(bufferNum);
+ }
+ }
+ else
+ {
+ // Not looping: request stop
+ requestStop = true;
+ }
+ }
+
+ // Fill the buffer if some data was returned
+ if (data.samples && data.sampleCount)
+ {
+ unsigned int buffer = m_buffers[bufferNum];
+
+ // Fill the buffer
+ ALsizei size = static_cast<ALsizei>(data.sampleCount) * sizeof(Int16);
+ alCheck(alBufferData(buffer, m_format, data.samples, size, m_sampleRate));
+
+ // Push it into the sound queue
+ alCheck(alSourceQueueBuffers(m_source, 1, &buffer));
+ }
+
+ return requestStop;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundStream::fillQueue()
+{
+ // Fill and enqueue all the available buffers
+ bool requestStop = false;
+ for (int i = 0; (i < BufferCount) && !requestStop; ++i)
+ {
+ if (fillAndPushBuffer(i))
+ requestStop = true;
+ }
+
+ return requestStop;
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundStream::clearQueue()
+{
+ // Get the number of buffers still in the queue
+ ALint nbQueued;
+ alCheck(alGetSourcei(m_source, AL_BUFFERS_QUEUED, &nbQueued));
+
+ // Dequeue them all
+ ALuint buffer;
+ for (ALint i = 0; i < nbQueued; ++i)
+ alCheck(alSourceUnqueueBuffers(m_source, 1, &buffer));
+}
+
+} // namespace sf
diff --git a/src/SFML/CMakeLists.txt b/src/SFML/CMakeLists.txt
index a3fb4d9..1bbfc7f 100644
--- a/src/SFML/CMakeLists.txt
+++ b/src/SFML/CMakeLists.txt
@@ -1,45 +1,53 @@
-
-# include the SFML specific macros
-include(${PROJECT_SOURCE_DIR}/cmake/Macros.cmake)
-
-# let CMake know about our additional libraries paths (on Windows and OS X)
-if (WINDOWS)
- set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers")
- if(COMPILER_GCC)
- if(ARCH_32BITS)
- set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-mingw/x86")
- set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/bin/x86")
- elseif(ARCH_64BITS)
- set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-mingw/x64")
- set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/bin/x64")
- endif()
- elseif(COMPILER_MSVC)
- if(ARCH_32BITS)
- set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-msvc/x86")
- elseif(ARCH_64BITS)
- set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-msvc/x64")
- endif()
- endif()
-elseif(MACOSX)
- set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers")
- set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-osx/lib/")
-endif()
-
-# add the SFML sources path
-include_directories(${PROJECT_SOURCE_DIR}/src)
-
-# define the path of our additional CMake modules
-set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules/")
-
-# set the output directory for SFML libraries
-set(LIBRARY_OUTPUT_PATH "${PROJECT_BINARY_DIR}/lib")
-
-# add the modules subdirectories
-add_subdirectory(System)
-add_subdirectory(Window)
-add_subdirectory(Network)
-add_subdirectory(Graphics)
-add_subdirectory(Audio)
-if(WINDOWS)
- add_subdirectory(Main)
-endif()
+
+# include the SFML specific macros
+include(${PROJECT_SOURCE_DIR}/cmake/Macros.cmake)
+
+# let CMake know about our additional libraries paths
+if (SFML_OS_WINDOWS)
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers")
+ if(SFML_COMPILER_GCC)
+ if(ARCH_32BITS)
+ set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-mingw/x86")
+ set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/bin/x86")
+ elseif(ARCH_64BITS)
+ set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-mingw/x64")
+ set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/bin/x64")
+ endif()
+ elseif(SFML_COMPILER_MSVC)
+ if(ARCH_32BITS)
+ set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-msvc/x86")
+ elseif(ARCH_64BITS)
+ set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-msvc/x64")
+ endif()
+ endif()
+elseif(SFML_OS_MACOSX)
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers")
+ set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-osx/lib/")
+elseif(SFML_OS_IOS)
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers")
+ set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-ios/")
+elseif(SFML_OS_ANDROID)
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers")
+ set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-android/${ANDROID_ABI}")
+endif()
+
+# add the SFML sources path
+include_directories(${PROJECT_SOURCE_DIR}/src)
+
+# define the path of our additional CMake modules
+set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules/")
+
+# set the output directory for SFML libraries
+set(LIBRARY_OUTPUT_PATH "${PROJECT_BINARY_DIR}/lib")
+
+# add the modules subdirectories
+add_subdirectory(System)
+if(SFML_OS_WINDOWS OR SFML_OS_ANDROID OR SFML_OS_IOS)
+ add_subdirectory(Main)
+endif()
+add_subdirectory(Window)
+add_subdirectory(Network)
+add_subdirectory(Graphics)
+if(NOT SFML_OS_IOS)
+ add_subdirectory(Audio)
+endif()
diff --git a/src/SFML/Graphics/BlendMode.cpp b/src/SFML/Graphics/BlendMode.cpp
new file mode 100644
index 0000000..3d392f4
--- /dev/null
+++ b/src/SFML/Graphics/BlendMode.cpp
@@ -0,0 +1,103 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/BlendMode.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+// Commonly used blending modes
+////////////////////////////////////////////////////////////
+const BlendMode BlendAlpha(BlendMode::SrcAlpha, BlendMode::OneMinusSrcAlpha, BlendMode::Add,
+ BlendMode::One, BlendMode::OneMinusSrcAlpha, BlendMode::Add);
+const BlendMode BlendAdd(BlendMode::SrcAlpha, BlendMode::One, BlendMode::Add,
+ BlendMode::One, BlendMode::One, BlendMode::Add);
+const BlendMode BlendMultiply(BlendMode::DstColor, BlendMode::Zero);
+const BlendMode BlendNone(BlendMode::One, BlendMode::Zero);
+
+
+////////////////////////////////////////////////////////////
+BlendMode::BlendMode() :
+colorSrcFactor(BlendMode::SrcAlpha),
+colorDstFactor(BlendMode::OneMinusSrcAlpha),
+colorEquation (BlendMode::Add),
+alphaSrcFactor(BlendMode::One),
+alphaDstFactor(BlendMode::OneMinusSrcAlpha),
+alphaEquation (BlendMode::Add)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+BlendMode::BlendMode(Factor sourceFactor, Factor destinationFactor, Equation blendEquation) :
+colorSrcFactor(sourceFactor),
+colorDstFactor(destinationFactor),
+colorEquation (blendEquation),
+alphaSrcFactor(sourceFactor),
+alphaDstFactor(destinationFactor),
+alphaEquation (blendEquation)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+BlendMode::BlendMode(Factor colorSourceFactor, Factor colorDestinationFactor,
+ Equation colorBlendEquation, Factor alphaSourceFactor,
+ Factor alphaDestinationFactor, Equation alphaBlendEquation) :
+colorSrcFactor(colorSourceFactor),
+colorDstFactor(colorDestinationFactor),
+colorEquation (colorBlendEquation),
+alphaSrcFactor(alphaSourceFactor),
+alphaDstFactor(alphaDestinationFactor),
+alphaEquation (alphaBlendEquation)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator ==(const BlendMode& left, const BlendMode& right)
+{
+ return (left.colorSrcFactor == right.colorSrcFactor) &&
+ (left.colorDstFactor == right.colorDstFactor) &&
+ (left.colorEquation == right.colorEquation) &&
+ (left.alphaSrcFactor == right.alphaSrcFactor) &&
+ (left.alphaDstFactor == right.alphaDstFactor) &&
+ (left.alphaEquation == right.alphaEquation);
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator !=(const BlendMode& left, const BlendMode& right)
+{
+ return !(left == right);
+}
+
+} // namespace sf
diff --git a/src/SFML/Graphics/CMakeLists.txt b/src/SFML/Graphics/CMakeLists.txt
index ba74b71..81a730e 100644
--- a/src/SFML/Graphics/CMakeLists.txt
+++ b/src/SFML/Graphics/CMakeLists.txt
@@ -1,135 +1,168 @@
-
-set(INCROOT ${PROJECT_SOURCE_DIR}/include/SFML/Graphics)
-set(SRCROOT ${PROJECT_SOURCE_DIR}/src/SFML/Graphics)
-
-# all source files
-set(SRC
- ${INCROOT}/BlendMode.hpp
- ${SRCROOT}/Color.cpp
- ${INCROOT}/Color.hpp
- ${INCROOT}/Export.hpp
- ${SRCROOT}/Font.cpp
- ${INCROOT}/Font.hpp
- ${INCROOT}/Glyph.hpp
- ${SRCROOT}/GLCheck.cpp
- ${SRCROOT}/GLCheck.hpp
- ${SRCROOT}/Image.cpp
- ${INCROOT}/Image.hpp
- ${SRCROOT}/ImageLoader.cpp
- ${SRCROOT}/ImageLoader.hpp
- ${INCROOT}/PrimitiveType.hpp
- ${INCROOT}/Rect.hpp
- ${INCROOT}/Rect.inl
- ${SRCROOT}/RenderStates.cpp
- ${INCROOT}/RenderStates.hpp
- ${SRCROOT}/RenderTexture.cpp
- ${INCROOT}/RenderTexture.hpp
- ${SRCROOT}/RenderTarget.cpp
- ${INCROOT}/RenderTarget.hpp
- ${SRCROOT}/RenderWindow.cpp
- ${INCROOT}/RenderWindow.hpp
- ${SRCROOT}/Shader.cpp
- ${INCROOT}/Shader.hpp
- ${SRCROOT}/Texture.cpp
- ${INCROOT}/Texture.hpp
- ${SRCROOT}/TextureSaver.cpp
- ${SRCROOT}/TextureSaver.hpp
- ${SRCROOT}/Transform.cpp
- ${INCROOT}/Transform.hpp
- ${SRCROOT}/Transformable.cpp
- ${INCROOT}/Transformable.hpp
- ${SRCROOT}/View.cpp
- ${INCROOT}/View.hpp
- ${SRCROOT}/Vertex.cpp
- ${INCROOT}/Vertex.hpp
-)
-source_group("" FILES ${SRC})
-
-# drawables sources
-set(DRAWABLES_SRC
- ${INCROOT}/Drawable.hpp
- ${SRCROOT}/Shape.cpp
- ${INCROOT}/Shape.hpp
- ${SRCROOT}/CircleShape.cpp
- ${INCROOT}/CircleShape.hpp
- ${SRCROOT}/RectangleShape.cpp
- ${INCROOT}/RectangleShape.hpp
- ${SRCROOT}/ConvexShape.cpp
- ${INCROOT}/ConvexShape.hpp
- ${SRCROOT}/Sprite.cpp
- ${INCROOT}/Sprite.hpp
- ${SRCROOT}/Text.cpp
- ${INCROOT}/Text.hpp
- ${SRCROOT}/VertexArray.cpp
- ${INCROOT}/VertexArray.hpp
-)
-source_group("drawables" FILES ${DRAWABLES_SRC})
-
-# render-texture sources
-set(RENDER_TEXTURE_SRC
- ${SRCROOT}/RenderTextureImpl.cpp
- ${SRCROOT}/RenderTextureImpl.hpp
- ${SRCROOT}/RenderTextureImplFBO.cpp
- ${SRCROOT}/RenderTextureImplFBO.hpp
- ${SRCROOT}/RenderTextureImplDefault.cpp
- ${SRCROOT}/RenderTextureImplDefault.hpp
-)
-source_group("render texture" FILES ${RENDER_TEXTURE_SRC})
-
-# stb_image sources
-set(STB_SRC
- ${SRCROOT}/stb_image/stb_image.h
- ${SRCROOT}/stb_image/stb_image_write.h
-)
-source_group("stb_image" FILES ${STB_SRC})
-
-# let CMake know about our additional graphics libraries paths (on Windows and OSX)
-if(WINDOWS OR MACOSX)
- set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/jpeg")
+
+set(INCROOT ${PROJECT_SOURCE_DIR}/include/SFML/Graphics)
+set(SRCROOT ${PROJECT_SOURCE_DIR}/src/SFML/Graphics)
+
+# all source files
+set(SRC
+ ${SRCROOT}/BlendMode.cpp
+ ${INCROOT}/BlendMode.hpp
+ ${SRCROOT}/Color.cpp
+ ${INCROOT}/Color.hpp
+ ${INCROOT}/Export.hpp
+ ${SRCROOT}/Font.cpp
+ ${INCROOT}/Font.hpp
+ ${INCROOT}/Glyph.hpp
+ ${SRCROOT}/GLCheck.cpp
+ ${SRCROOT}/GLCheck.hpp
+ ${SRCROOT}/GLExtensions.hpp
+ ${SRCROOT}/GLExtensions.cpp
+ ${SRCROOT}/Image.cpp
+ ${INCROOT}/Image.hpp
+ ${SRCROOT}/ImageLoader.cpp
+ ${SRCROOT}/ImageLoader.hpp
+ ${INCROOT}/PrimitiveType.hpp
+ ${INCROOT}/Rect.hpp
+ ${INCROOT}/Rect.inl
+ ${SRCROOT}/RenderStates.cpp
+ ${INCROOT}/RenderStates.hpp
+ ${SRCROOT}/RenderTexture.cpp
+ ${INCROOT}/RenderTexture.hpp
+ ${SRCROOT}/RenderTarget.cpp
+ ${INCROOT}/RenderTarget.hpp
+ ${SRCROOT}/RenderWindow.cpp
+ ${INCROOT}/RenderWindow.hpp
+ ${SRCROOT}/Shader.cpp
+ ${INCROOT}/Shader.hpp
+ ${SRCROOT}/Texture.cpp
+ ${INCROOT}/Texture.hpp
+ ${SRCROOT}/TextureSaver.cpp
+ ${SRCROOT}/TextureSaver.hpp
+ ${SRCROOT}/Transform.cpp
+ ${INCROOT}/Transform.hpp
+ ${SRCROOT}/Transformable.cpp
+ ${INCROOT}/Transformable.hpp
+ ${SRCROOT}/View.cpp
+ ${INCROOT}/View.hpp
+ ${SRCROOT}/Vertex.cpp
+ ${INCROOT}/Vertex.hpp
+)
+source_group("" FILES ${SRC})
+
+# drawables sources
+set(DRAWABLES_SRC
+ ${INCROOT}/Drawable.hpp
+ ${SRCROOT}/Shape.cpp
+ ${INCROOT}/Shape.hpp
+ ${SRCROOT}/CircleShape.cpp
+ ${INCROOT}/CircleShape.hpp
+ ${SRCROOT}/RectangleShape.cpp
+ ${INCROOT}/RectangleShape.hpp
+ ${SRCROOT}/ConvexShape.cpp
+ ${INCROOT}/ConvexShape.hpp
+ ${SRCROOT}/Sprite.cpp
+ ${INCROOT}/Sprite.hpp
+ ${SRCROOT}/Text.cpp
+ ${INCROOT}/Text.hpp
+ ${SRCROOT}/VertexArray.cpp
+ ${INCROOT}/VertexArray.hpp
+)
+source_group("drawables" FILES ${DRAWABLES_SRC})
+
+# render-texture sources
+set(RENDER_TEXTURE_SRC
+ ${SRCROOT}/RenderTextureImpl.cpp
+ ${SRCROOT}/RenderTextureImpl.hpp
+ ${SRCROOT}/RenderTextureImplFBO.cpp
+ ${SRCROOT}/RenderTextureImplFBO.hpp
+ ${SRCROOT}/RenderTextureImplDefault.cpp
+ ${SRCROOT}/RenderTextureImplDefault.hpp
+)
+source_group("render texture" FILES ${RENDER_TEXTURE_SRC})
+
+# stb_image sources
+set(STB_SRC
+ ${SRCROOT}/stb_image/stb_image.h
+ ${SRCROOT}/stb_image/stb_image_write.h
+)
+source_group("stb_image" FILES ${STB_SRC})
+
+# let CMake know about our additional graphics libraries paths (on Windows and OSX)
+if(SFML_OS_WINDOWS OR SFML_OS_MACOSX)
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/jpeg")
endif()
-if(WINDOWS)
- set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/libfreetype/windows")
- set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/libfreetype/windows/freetype")
-elseif(MACOSX)
- set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/libfreetype/osx")
- set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/libfreetype/osx/freetype2")
+# let CMake know about our additional graphics libraries paths
+if(SFML_OS_WINDOWS)
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/libfreetype/windows")
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/libfreetype/windows/freetype")
+elseif(SFML_OS_MACOSX)
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/libfreetype/osx")
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/libfreetype/osx/freetype2")
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-osx/Frameworks")
-endif()
-
-# find external libraries
-find_package(OpenGL REQUIRED)
-find_package(Freetype REQUIRED)
-find_package(GLEW REQUIRED)
-find_package(JPEG REQUIRED)
-if(LINUX)
- find_package(X11 REQUIRED)
-endif()
-
-# add include paths of external libraries
-include_directories(${FREETYPE_INCLUDE_DIRS} ${GLEW_INCLUDE_PATH} ${JPEG_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
-
-# build the list of libraries to link
-# GL and X11 are only needed for shared build, as they are already linked by sfml-window
-set(GRAPHICS_EXT_LIBS ${FREETYPE_LIBRARY} ${GLEW_LIBRARY} ${JPEG_LIBRARY})
-if(BUILD_SHARED_LIBS)
- set(GRAPHICS_EXT_LIBS ${GRAPHICS_EXT_LIBS} ${OPENGL_gl_LIBRARY})
- if(LINUX)
- set(GRAPHICS_EXT_LIBS ${GRAPHICS_EXT_LIBS} ${X11_LIBRARIES})
- endif()
-endif()
-
-# add preprocessor symbols
-add_definitions(-DGLEW_STATIC -DSTBI_FAILURE_USERMSG)
-
-# ImageLoader.cpp must be compiled with the -fno-strict-aliasing
-# when gcc is used; otherwise saving PNGs may crash in stb_image_write
-if(COMPILER_GCC)
- set_source_files_properties(${SRCROOT}/ImageLoader.cpp PROPERTIES COMPILE_FLAGS -fno-strict-aliasing)
-endif()
-
-# define the sfml-graphics target
-sfml_add_library(sfml-graphics
- SOURCES ${SRC} ${DRAWABLES_SRC} ${RENDER_TEXTURE_SRC} ${STB_SRC}
- DEPENDS sfml-window sfml-system
- EXTERNAL_LIBS ${GRAPHICS_EXT_LIBS})
+elseif(SFML_OS_IOS)
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/jpeg")
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/libfreetype/ios")
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/libfreetype/ios/freetype2")
+elseif(SFML_OS_ANDROID)
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/jpeg")
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/libfreetype/android")
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/libfreetype/android/freetype")
+endif()
+
+# find external libraries
+if(NOT SFML_OPENGL_ES)
+ find_package(OpenGL REQUIRED)
+ find_package(GLEW REQUIRED)
+ if(SFML_OS_LINUX)
+ find_package(X11 REQUIRED)
+ endif()
+ include_directories(${FREETYPE_INCLUDE_DIRS} ${GLEW_INCLUDE_PATH} ${JPEG_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
+endif()
+if(SFML_OPENGL_ES AND SFML_OS_LINUX)
+ find_package(EGL REQUIRED)
+ find_package(GLES REQUIRED)
+ include_directories(${EGL_INCLUDE_DIR} ${GLES_INCLUDE_DIR})
+endif()
+if(SFML_OS_ANDROID)
+ find_host_package(JPEG REQUIRED)
+ find_host_package(Freetype REQUIRED)
+else()
+ find_package(JPEG REQUIRED)
+ find_package(Freetype REQUIRED)
+endif()
+include_directories(${FREETYPE_INCLUDE_DIRS} ${JPEG_INCLUDE_DIR})
+
+# build the list of external libraries to link
+if(NOT SFML_OPENGL_ES)
+ list(APPEND GRAPHICS_EXT_LIBS ${GLEW_LIBRARY} ${OPENGL_gl_LIBRARY})
+ if(SFML_OS_LINUX)
+ list(APPEND GRAPHICS_EXT_LIBS ${X11_LIBRARIES})
+ endif()
+endif()
+if(SFML_OPENGL_ES AND SFML_OS_LINUX)
+ list(APPEND GRAPHICS_EXT_LIBS ${EGL_LIBRARY} ${GLES_LIBRARY})
+endif()
+if(SFML_OS_IOS)
+ list(APPEND GRAPHICS_EXT_LIBS "-framework OpenGLES")
+elseif(SFML_OS_ANDROID)
+ list(APPEND GRAPHICS_EXT_LIBS -lz)
+endif()
+list(APPEND GRAPHICS_EXT_LIBS ${FREETYPE_LIBRARY} ${JPEG_LIBRARY})
+
+# add preprocessor symbols
+if(NOT SFML_OPENGL_ES)
+ add_definitions(-DGLEW_STATIC)
+endif()
+add_definitions(-DSTBI_FAILURE_USERMSG)
+
+# ImageLoader.cpp must be compiled with the -fno-strict-aliasing
+# when gcc is used; otherwise saving PNGs may crash in stb_image_write
+if(SFML_COMPILER_GCC)
+ set_source_files_properties(${SRCROOT}/ImageLoader.cpp PROPERTIES COMPILE_FLAGS -fno-strict-aliasing)
+endif()
+
+# define the sfml-graphics target
+sfml_add_library(sfml-graphics
+ SOURCES ${SRC} ${DRAWABLES_SRC} ${RENDER_TEXTURE_SRC} ${STB_SRC}
+ DEPENDS sfml-window sfml-system
+ EXTERNAL_LIBS ${GRAPHICS_EXT_LIBS})
diff --git a/src/SFML/Graphics/CircleShape.cpp b/src/SFML/Graphics/CircleShape.cpp
index 23e9e77..355a007 100644
--- a/src/SFML/Graphics/CircleShape.cpp
+++ b/src/SFML/Graphics/CircleShape.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
diff --git a/src/SFML/Graphics/Color.cpp b/src/SFML/Graphics/Color.cpp
index d016a9d..00d215a 100644
--- a/src/SFML/Graphics/Color.cpp
+++ b/src/SFML/Graphics/Color.cpp
@@ -1,120 +1,137 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Graphics/Color.hpp>
-#include <algorithm>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-// Static member data
-////////////////////////////////////////////////////////////
-const Color Color::Black(0, 0, 0);
-const Color Color::White(255, 255, 255);
-const Color Color::Red(255, 0, 0);
-const Color Color::Green(0, 255, 0);
-const Color Color::Blue(0, 0, 255);
-const Color Color::Yellow(255, 255, 0);
-const Color Color::Magenta(255, 0, 255);
-const Color Color::Cyan(0, 255, 255);
-const Color Color::Transparent(0, 0, 0, 0);
-
-
-////////////////////////////////////////////////////////////
-Color::Color() :
-r(0),
-g(0),
-b(0),
-a(255)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-Color::Color(Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha) :
-r(red),
-g(green),
-b(blue),
-a(alpha)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator ==(const Color& left, const Color& right)
-{
- return (left.r == right.r) &&
- (left.g == right.g) &&
- (left.b == right.b) &&
- (left.a == right.a);
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator !=(const Color& left, const Color& right)
-{
- return !(left == right);
-}
-
-
-////////////////////////////////////////////////////////////
-Color operator +(const Color& left, const Color& right)
-{
- return Color(static_cast<Uint8>(std::min(left.r + right.r, 255)),
- static_cast<Uint8>(std::min(left.g + right.g, 255)),
- static_cast<Uint8>(std::min(left.b + right.b, 255)),
- static_cast<Uint8>(std::min(left.a + right.a, 255)));
-}
-
-
-////////////////////////////////////////////////////////////
-Color operator *(const Color& left, const Color& right)
-{
- return Color(static_cast<Uint8>(left.r * right.r / 255),
- static_cast<Uint8>(left.g * right.g / 255),
- static_cast<Uint8>(left.b * right.b / 255),
- static_cast<Uint8>(left.a * right.a / 255));
-}
-
-
-////////////////////////////////////////////////////////////
-Color& operator +=(Color& left, const Color& right)
-{
- return left = left + right;
-}
-
-
-////////////////////////////////////////////////////////////
-Color& operator *=(Color& left, const Color& right)
-{
- return left = left * right;
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/Color.hpp>
+#include <algorithm>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+// Static member data
+////////////////////////////////////////////////////////////
+const Color Color::Black(0, 0, 0);
+const Color Color::White(255, 255, 255);
+const Color Color::Red(255, 0, 0);
+const Color Color::Green(0, 255, 0);
+const Color Color::Blue(0, 0, 255);
+const Color Color::Yellow(255, 255, 0);
+const Color Color::Magenta(255, 0, 255);
+const Color Color::Cyan(0, 255, 255);
+const Color Color::Transparent(0, 0, 0, 0);
+
+
+////////////////////////////////////////////////////////////
+Color::Color() :
+r(0),
+g(0),
+b(0),
+a(255)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+Color::Color(Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha) :
+r(red),
+g(green),
+b(blue),
+a(alpha)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator ==(const Color& left, const Color& right)
+{
+ return (left.r == right.r) &&
+ (left.g == right.g) &&
+ (left.b == right.b) &&
+ (left.a == right.a);
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator !=(const Color& left, const Color& right)
+{
+ return !(left == right);
+}
+
+
+////////////////////////////////////////////////////////////
+Color operator +(const Color& left, const Color& right)
+{
+ return Color(Uint8(std::min(int(left.r) + right.r, 255)),
+ Uint8(std::min(int(left.g) + right.g, 255)),
+ Uint8(std::min(int(left.b) + right.b, 255)),
+ Uint8(std::min(int(left.a) + right.a, 255)));
+}
+
+
+////////////////////////////////////////////////////////////
+Color operator -(const Color& left, const Color& right)
+{
+ return Color(Uint8(std::max(int(left.r) - right.r, 0)),
+ Uint8(std::max(int(left.g) - right.g, 0)),
+ Uint8(std::max(int(left.b) - right.b, 0)),
+ Uint8(std::max(int(left.a) - right.a, 0)));
+}
+
+
+////////////////////////////////////////////////////////////
+Color operator *(const Color& left, const Color& right)
+{
+ return Color(Uint8(int(left.r) * right.r / 255),
+ Uint8(int(left.g) * right.g / 255),
+ Uint8(int(left.b) * right.b / 255),
+ Uint8(int(left.a) * right.a / 255));
+}
+
+
+////////////////////////////////////////////////////////////
+Color& operator +=(Color& left, const Color& right)
+{
+ return left = left + right;
+}
+
+
+////////////////////////////////////////////////////////////
+Color& operator -=(Color& left, const Color& right)
+{
+ return left = left - right;
+}
+
+
+////////////////////////////////////////////////////////////
+Color& operator *=(Color& left, const Color& right)
+{
+ return left = left * right;
+}
+
+} // namespace sf
diff --git a/src/SFML/Graphics/ConvexShape.cpp b/src/SFML/Graphics/ConvexShape.cpp
index a5ad0e5..73bf234 100644
--- a/src/SFML/Graphics/ConvexShape.cpp
+++ b/src/SFML/Graphics/ConvexShape.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
diff --git a/src/SFML/Graphics/Font.cpp b/src/SFML/Graphics/Font.cpp
index 8afe57e..e54be40 100644
--- a/src/SFML/Graphics/Font.cpp
+++ b/src/SFML/Graphics/Font.cpp
@@ -1,599 +1,719 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Graphics/Font.hpp>
-#include <SFML/Graphics/GLCheck.hpp>
-#include <SFML/System/InputStream.hpp>
-#include <SFML/System/Err.hpp>
-#include <ft2build.h>
-#include FT_FREETYPE_H
-#include FT_GLYPH_H
-#include FT_OUTLINE_H
-#include FT_BITMAP_H
-#include <cstdlib>
-#include <cstring>
-
-
-namespace
-{
- // FreeType callbacks that operate on a sf::InputStream
- unsigned long read(FT_Stream rec, unsigned long offset, unsigned char* buffer, unsigned long count)
- {
- sf::InputStream* stream = static_cast<sf::InputStream*>(rec->descriptor.pointer);
- if (static_cast<unsigned long>(stream->seek(offset)) == offset)
- {
- if (count > 0)
- return static_cast<unsigned long>(stream->read(reinterpret_cast<char*>(buffer), count));
- else
- return 0;
- }
- else
- return count > 0 ? 0 : 1; // error code is 0 if we're reading, or nonzero if we're seeking
- }
- void close(FT_Stream)
- {
- }
-}
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-Font::Font() :
-m_library (NULL),
-m_face (NULL),
-m_streamRec(NULL),
-m_refCount (NULL)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-Font::Font(const Font& copy) :
-m_library (copy.m_library),
-m_face (copy.m_face),
-m_streamRec (copy.m_streamRec),
-m_refCount (copy.m_refCount),
-m_pages (copy.m_pages),
-m_pixelBuffer(copy.m_pixelBuffer)
-{
- // Note: as FreeType doesn't provide functions for copying/cloning,
- // we must share all the FreeType pointers
-
- if (m_refCount)
- (*m_refCount)++;
-}
-
-
-////////////////////////////////////////////////////////////
-Font::~Font()
-{
- cleanup();
-}
-
-
-////////////////////////////////////////////////////////////
-bool Font::loadFromFile(const std::string& filename)
-{
- // Cleanup the previous resources
- cleanup();
- m_refCount = new int(1);
-
- // Initialize FreeType
- // Note: we initialize FreeType for every font instance in order to avoid having a single
- // global manager that would create a lot of issues regarding creation and destruction order.
- FT_Library library;
- if (FT_Init_FreeType(&library) != 0)
- {
- err() << "Failed to load font \"" << filename << "\" (failed to initialize FreeType)" << std::endl;
- return false;
- }
- m_library = library;
-
- // Load the new font face from the specified file
- FT_Face face;
- if (FT_New_Face(static_cast<FT_Library>(m_library), filename.c_str(), 0, &face) != 0)
- {
- err() << "Failed to load font \"" << filename << "\" (failed to create the font face)" << std::endl;
- return false;
- }
-
- // Select the unicode character map
- if (FT_Select_Charmap(face, FT_ENCODING_UNICODE) != 0)
- {
- err() << "Failed to load font \"" << filename << "\" (failed to set the Unicode character set)" << std::endl;
- return false;
- }
-
- // Store the loaded font in our ugly void* :)
- m_face = face;
-
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-bool Font::loadFromMemory(const void* data, std::size_t sizeInBytes)
-{
- // Cleanup the previous resources
- cleanup();
- m_refCount = new int(1);
-
- // Initialize FreeType
- // Note: we initialize FreeType for every font instance in order to avoid having a single
- // global manager that would create a lot of issues regarding creation and destruction order.
- FT_Library library;
- if (FT_Init_FreeType(&library) != 0)
- {
- err() << "Failed to load font from memory (failed to initialize FreeType)" << std::endl;
- return false;
- }
- m_library = library;
-
- // Load the new font face from the specified file
- FT_Face face;
- if (FT_New_Memory_Face(static_cast<FT_Library>(m_library), reinterpret_cast<const FT_Byte*>(data), static_cast<FT_Long>(sizeInBytes), 0, &face) != 0)
- {
- err() << "Failed to load font from memory (failed to create the font face)" << std::endl;
- return false;
- }
-
- // Select the unicode character map
- if (FT_Select_Charmap(face, FT_ENCODING_UNICODE) != 0)
- {
- err() << "Failed to load font from memory (failed to set the Unicode character set)" << std::endl;
- return false;
- }
-
- // Store the loaded font in our ugly void* :)
- m_face = face;
-
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-bool Font::loadFromStream(InputStream& stream)
-{
- // Cleanup the previous resources
- cleanup();
- m_refCount = new int(1);
-
- // Initialize FreeType
- // Note: we initialize FreeType for every font instance in order to avoid having a single
- // global manager that would create a lot of issues regarding creation and destruction order.
- FT_Library library;
- if (FT_Init_FreeType(&library) != 0)
- {
- err() << "Failed to load font from stream (failed to initialize FreeType)" << std::endl;
- return false;
- }
- m_library = library;
-
- // Make sure that the stream's reading position is at the beginning
- stream.seek(0);
-
- // Prepare a wrapper for our stream, that we'll pass to FreeType callbacks
- FT_StreamRec* rec = new FT_StreamRec;
- std::memset(rec, 0, sizeof(*rec));
- rec->base = NULL;
- rec->size = static_cast<unsigned long>(stream.getSize());
- rec->pos = 0;
- rec->descriptor.pointer = &stream;
- rec->read = &read;
- rec->close = &close;
-
- // Setup the FreeType callbacks that will read our stream
- FT_Open_Args args;
- args.flags = FT_OPEN_STREAM;
- args.stream = rec;
- args.driver = 0;
-
- // Load the new font face from the specified stream
- FT_Face face;
- if (FT_Open_Face(static_cast<FT_Library>(m_library), &args, 0, &face) != 0)
- {
- err() << "Failed to load font from stream (failed to create the font face)" << std::endl;
- return false;
- }
-
- // Select the unicode character map
- if (FT_Select_Charmap(face, FT_ENCODING_UNICODE) != 0)
- {
- err() << "Failed to load font from stream (failed to set the Unicode character set)" << std::endl;
- return false;
- }
-
- // Store the loaded font in our ugly void* :)
- m_face = face;
- m_streamRec = rec;
-
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-const Glyph& Font::getGlyph(Uint32 codePoint, unsigned int characterSize, bool bold) const
-{
- // Get the page corresponding to the character size
- GlyphTable& glyphs = m_pages[characterSize].glyphs;
-
- // Build the key by combining the code point and the bold flag
- Uint32 key = ((bold ? 1 : 0) << 31) | codePoint;
-
- // Search the glyph into the cache
- GlyphTable::const_iterator it = glyphs.find(key);
- if (it != glyphs.end())
- {
- // Found: just return it
- return it->second;
- }
- else
- {
- // Not found: we have to load it
- Glyph glyph = loadGlyph(codePoint, characterSize, bold);
- return glyphs.insert(std::make_pair(key, glyph)).first->second;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-int Font::getKerning(Uint32 first, Uint32 second, unsigned int characterSize) const
-{
- // Special case where first or second is 0 (null character)
- if (first == 0 || second == 0)
- return 0;
-
- FT_Face face = static_cast<FT_Face>(m_face);
-
- if (face && FT_HAS_KERNING(face) && setCurrentSize(characterSize))
- {
- // Convert the characters to indices
- FT_UInt index1 = FT_Get_Char_Index(face, first);
- FT_UInt index2 = FT_Get_Char_Index(face, second);
-
- // Get the kerning vector
- FT_Vector kerning;
- FT_Get_Kerning(face, index1, index2, FT_KERNING_DEFAULT, &kerning);
-
- // Return the X advance
- return kerning.x >> 6;
- }
- else
- {
- // Invalid font, or no kerning
- return 0;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-int Font::getLineSpacing(unsigned int characterSize) const
-{
- FT_Face face = static_cast<FT_Face>(m_face);
-
- if (face && setCurrentSize(characterSize))
- {
- return (face->size->metrics.height >> 6);
- }
- else
- {
- return 0;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-const Texture& Font::getTexture(unsigned int characterSize) const
-{
- return m_pages[characterSize].texture;
-}
-
-
-////////////////////////////////////////////////////////////
-Font& Font::operator =(const Font& right)
-{
- Font temp(right);
-
- std::swap(m_library, temp.m_library);
- std::swap(m_face, temp.m_face);
- std::swap(m_pages, temp.m_pages);
- std::swap(m_pixelBuffer, temp.m_pixelBuffer);
- std::swap(m_refCount, temp.m_refCount);
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-void Font::cleanup()
-{
- // Check if we must destroy the FreeType pointers
- if (m_refCount)
- {
- // Decrease the reference counter
- (*m_refCount)--;
-
- // Free the resources only if we are the last owner
- if (*m_refCount == 0)
- {
- // Delete the reference counter
- delete m_refCount;
-
- // Destroy the font face
- if (m_face)
- FT_Done_Face(static_cast<FT_Face>(m_face));
-
- // Destroy the stream rec instance, if any (must be done after FT_Done_Face!)
- if (m_streamRec)
- delete static_cast<FT_StreamRec*>(m_streamRec);
-
- // Close the library
- if (m_library)
- FT_Done_FreeType(static_cast<FT_Library>(m_library));
- }
- }
-
- // Reset members
- m_library = NULL;
- m_face = NULL;
- m_streamRec = NULL;
- m_refCount = NULL;
- m_pages.clear();
- m_pixelBuffer.clear();
-}
-
-
-////////////////////////////////////////////////////////////
-Glyph Font::loadGlyph(Uint32 codePoint, unsigned int characterSize, bool bold) const
-{
- // The glyph to return
- Glyph glyph;
-
- // First, transform our ugly void* to a FT_Face
- FT_Face face = static_cast<FT_Face>(m_face);
- if (!face)
- return glyph;
-
- // Set the character size
- if (!setCurrentSize(characterSize))
- return glyph;
-
- // Load the glyph corresponding to the code point
- if (FT_Load_Char(face, codePoint, FT_LOAD_TARGET_NORMAL) != 0)
- return glyph;
-
- // Retrieve the glyph
- FT_Glyph glyphDesc;
- if (FT_Get_Glyph(face->glyph, &glyphDesc) != 0)
- return glyph;
-
- // Apply bold if necessary -- first technique using outline (highest quality)
- FT_Pos weight = 1 << 6;
- bool outline = (glyphDesc->format == FT_GLYPH_FORMAT_OUTLINE);
- if (bold && outline)
- {
- FT_OutlineGlyph outlineGlyph = (FT_OutlineGlyph)glyphDesc;
- FT_Outline_Embolden(&outlineGlyph->outline, weight);
- }
-
- // Convert the glyph to a bitmap (i.e. rasterize it)
- FT_Glyph_To_Bitmap(&glyphDesc, FT_RENDER_MODE_NORMAL, 0, 1);
- FT_BitmapGlyph bitmapGlyph = (FT_BitmapGlyph)glyphDesc;
- FT_Bitmap& bitmap = bitmapGlyph->bitmap;
-
- // Apply bold if necessary -- fallback technique using bitmap (lower quality)
- if (bold && !outline)
- {
- FT_Bitmap_Embolden(static_cast<FT_Library>(m_library), &bitmap, weight, weight);
- }
-
- // Compute the glyph's advance offset
- glyph.advance = glyphDesc->advance.x >> 16;
- if (bold)
- glyph.advance += weight >> 6;
-
- int width = bitmap.width;
- int height = bitmap.rows;
- if ((width > 0) && (height > 0))
- {
- // Leave a small padding around characters, so that filtering doesn't
- // pollute them with pixels from neighbours
- const unsigned int padding = 1;
-
- // Get the glyphs page corresponding to the character size
- Page& page = m_pages[characterSize];
-
- // Find a good position for the new glyph into the texture
- glyph.textureRect = findGlyphRect(page, width + 2 * padding, height + 2 * padding);
-
- // Compute the glyph's bounding box
- glyph.bounds.left = bitmapGlyph->left - padding;
- glyph.bounds.top = -bitmapGlyph->top - padding;
- glyph.bounds.width = width + 2 * padding;
- glyph.bounds.height = height + 2 * padding;
-
- // Extract the glyph's pixels from the bitmap
- m_pixelBuffer.resize(width * height * 4, 255);
- const Uint8* pixels = bitmap.buffer;
- if (bitmap.pixel_mode == FT_PIXEL_MODE_MONO)
- {
- // Pixels are 1 bit monochrome values
- for (int y = 0; y < height; ++y)
- {
- for (int x = 0; x < width; ++x)
- {
- // The color channels remain white, just fill the alpha channel
- std::size_t index = (x + y * width) * 4 + 3;
- m_pixelBuffer[index] = ((pixels[x / 8]) & (1 << (7 - (x % 8)))) ? 255 : 0;
- }
- pixels += bitmap.pitch;
- }
- }
- else
- {
- // Pixels are 8 bits gray levels
- for (int y = 0; y < height; ++y)
- {
- for (int x = 0; x < width; ++x)
- {
- // The color channels remain white, just fill the alpha channel
- std::size_t index = (x + y * width) * 4 + 3;
- m_pixelBuffer[index] = pixels[x];
- }
- pixels += bitmap.pitch;
- }
- }
-
- // Write the pixels to the texture
- unsigned int x = glyph.textureRect.left + padding;
- unsigned int y = glyph.textureRect.top + padding;
- unsigned int w = glyph.textureRect.width - 2 * padding;
- unsigned int h = glyph.textureRect.height - 2 * padding;
- page.texture.update(&m_pixelBuffer[0], w, h, x, y);
- }
-
- // Delete the FT glyph
- FT_Done_Glyph(glyphDesc);
-
- // Force an OpenGL flush, so that the font's texture will appear updated
- // in all contexts immediately (solves problems in multi-threaded apps)
- glCheck(glFlush());
-
- // Done :)
- return glyph;
-}
-
-
-////////////////////////////////////////////////////////////
-IntRect Font::findGlyphRect(Page& page, unsigned int width, unsigned int height) const
-{
- // Find the line that fits well the glyph
- Row* row = NULL;
- float bestRatio = 0;
- for (std::vector<Row>::iterator it = page.rows.begin(); it != page.rows.end() && !row; ++it)
- {
- float ratio = static_cast<float>(height) / it->height;
-
- // Ignore rows that are either too small or too high
- if ((ratio < 0.7f) || (ratio > 1.f))
- continue;
-
- // Check if there's enough horizontal space left in the row
- if (width > page.texture.getSize().x - it->width)
- continue;
-
- // Make sure that this new row is the best found so far
- if (ratio < bestRatio)
- continue;
-
- // The current row passed all the tests: we can select it
- row = &*it;
- bestRatio = ratio;
- }
-
- // If we didn't find a matching row, create a new one (10% taller than the glyph)
- if (!row)
- {
- int rowHeight = height + height / 10;
- while (page.nextRow + rowHeight >= page.texture.getSize().y)
- {
- // Not enough space: resize the texture if possible
- unsigned int textureWidth = page.texture.getSize().x;
- unsigned int textureHeight = page.texture.getSize().y;
- if ((textureWidth * 2 <= Texture::getMaximumSize()) && (textureHeight * 2 <= Texture::getMaximumSize()))
- {
- // Make the texture 2 times bigger
- Image newImage;
- newImage.create(textureWidth * 2, textureHeight * 2, Color(255, 255, 255, 0));
- newImage.copy(page.texture.copyToImage(), 0, 0);
- page.texture.loadFromImage(newImage);
- }
- else
- {
- // Oops, we've reached the maximum texture size...
- err() << "Failed to add a new character to the font: the maximum texture size has been reached" << std::endl;
- return IntRect(0, 0, 2, 2);
- }
- }
-
- // We can now create the new row
- page.rows.push_back(Row(page.nextRow, rowHeight));
- page.nextRow += rowHeight;
- row = &page.rows.back();
- }
-
- // Find the glyph's rectangle on the selected row
- IntRect rect(row->width, row->top, width, height);
-
- // Update the row informations
- row->width += width;
-
- return rect;
-}
-
-
-////////////////////////////////////////////////////////////
-bool Font::setCurrentSize(unsigned int characterSize) const
-{
- // FT_Set_Pixel_Sizes is an expensive function, so we must call it
- // only when necessary to avoid killing performances
-
- FT_Face face = static_cast<FT_Face>(m_face);
- FT_UShort currentSize = face->size->metrics.x_ppem;
-
- if (currentSize != characterSize)
- {
- return FT_Set_Pixel_Sizes(face, 0, characterSize) == 0;
- }
- else
- {
- return true;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-Font::Page::Page() :
-nextRow(3)
-{
- // Make sure that the texture is initialized by default
- sf::Image image;
- image.create(128, 128, Color(255, 255, 255, 0));
-
- // Reserve a 2x2 white square for texturing underlines
- for (int x = 0; x < 2; ++x)
- for (int y = 0; y < 2; ++y)
- image.setPixel(x, y, Color(255, 255, 255, 255));
-
- // Create the texture
- texture.loadFromImage(image);
- texture.setSmooth(true);
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/Font.hpp>
+#include <SFML/Graphics/GLCheck.hpp>
+#ifdef SFML_SYSTEM_ANDROID
+ #include <SFML/System/Android/ResourceStream.hpp>
+#endif
+#include <SFML/System/InputStream.hpp>
+#include <SFML/System/Err.hpp>
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include FT_GLYPH_H
+#include FT_OUTLINE_H
+#include FT_BITMAP_H
+#include <cstdlib>
+#include <cstring>
+
+
+namespace
+{
+ // FreeType callbacks that operate on a sf::InputStream
+ unsigned long read(FT_Stream rec, unsigned long offset, unsigned char* buffer, unsigned long count)
+ {
+ sf::InputStream* stream = static_cast<sf::InputStream*>(rec->descriptor.pointer);
+ if (static_cast<unsigned long>(stream->seek(offset)) == offset)
+ {
+ if (count > 0)
+ return static_cast<unsigned long>(stream->read(reinterpret_cast<char*>(buffer), count));
+ else
+ return 0;
+ }
+ else
+ return count > 0 ? 0 : 1; // error code is 0 if we're reading, or nonzero if we're seeking
+ }
+ void close(FT_Stream)
+ {
+ }
+}
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Font::Font() :
+m_library (NULL),
+m_face (NULL),
+m_streamRec(NULL),
+m_refCount (NULL),
+m_info ()
+{
+ #ifdef SFML_SYSTEM_ANDROID
+ m_stream = NULL;
+ #endif
+}
+
+
+////////////////////////////////////////////////////////////
+Font::Font(const Font& copy) :
+m_library (copy.m_library),
+m_face (copy.m_face),
+m_streamRec (copy.m_streamRec),
+m_refCount (copy.m_refCount),
+m_info (copy.m_info),
+m_pages (copy.m_pages),
+m_pixelBuffer(copy.m_pixelBuffer)
+{
+ #ifdef SFML_SYSTEM_ANDROID
+ m_stream = NULL;
+ #endif
+
+ // Note: as FreeType doesn't provide functions for copying/cloning,
+ // we must share all the FreeType pointers
+
+ if (m_refCount)
+ (*m_refCount)++;
+}
+
+
+////////////////////////////////////////////////////////////
+Font::~Font()
+{
+ cleanup();
+
+ #ifdef SFML_SYSTEM_ANDROID
+
+ if (m_stream)
+ delete (priv::ResourceStream*)m_stream;
+
+ #endif
+}
+
+
+////////////////////////////////////////////////////////////
+bool Font::loadFromFile(const std::string& filename)
+{
+ #ifndef SFML_SYSTEM_ANDROID
+
+ // Cleanup the previous resources
+ cleanup();
+ m_refCount = new int(1);
+
+ // Initialize FreeType
+ // Note: we initialize FreeType for every font instance in order to avoid having a single
+ // global manager that would create a lot of issues regarding creation and destruction order.
+ FT_Library library;
+ if (FT_Init_FreeType(&library) != 0)
+ {
+ err() << "Failed to load font \"" << filename << "\" (failed to initialize FreeType)" << std::endl;
+ return false;
+ }
+ m_library = library;
+
+ // Load the new font face from the specified file
+ FT_Face face;
+ if (FT_New_Face(static_cast<FT_Library>(m_library), filename.c_str(), 0, &face) != 0)
+ {
+ err() << "Failed to load font \"" << filename << "\" (failed to create the font face)" << std::endl;
+ return false;
+ }
+
+ // Select the unicode character map
+ if (FT_Select_Charmap(face, FT_ENCODING_UNICODE) != 0)
+ {
+ err() << "Failed to load font \"" << filename << "\" (failed to set the Unicode character set)" << std::endl;
+ FT_Done_Face(face);
+ return false;
+ }
+
+ // Store the loaded font in our ugly void* :)
+ m_face = face;
+
+ // Store the font information
+ m_info.family = face->family_name ? face->family_name : std::string();
+
+ return true;
+
+ #else
+
+ if (m_stream)
+ delete (priv::ResourceStream*)m_stream;
+
+ m_stream = new priv::ResourceStream(filename);
+ return loadFromStream(*(priv::ResourceStream*)m_stream);
+
+ #endif
+}
+
+
+////////////////////////////////////////////////////////////
+bool Font::loadFromMemory(const void* data, std::size_t sizeInBytes)
+{
+ // Cleanup the previous resources
+ cleanup();
+ m_refCount = new int(1);
+
+ // Initialize FreeType
+ // Note: we initialize FreeType for every font instance in order to avoid having a single
+ // global manager that would create a lot of issues regarding creation and destruction order.
+ FT_Library library;
+ if (FT_Init_FreeType(&library) != 0)
+ {
+ err() << "Failed to load font from memory (failed to initialize FreeType)" << std::endl;
+ return false;
+ }
+ m_library = library;
+
+ // Load the new font face from the specified file
+ FT_Face face;
+ if (FT_New_Memory_Face(static_cast<FT_Library>(m_library), reinterpret_cast<const FT_Byte*>(data), static_cast<FT_Long>(sizeInBytes), 0, &face) != 0)
+ {
+ err() << "Failed to load font from memory (failed to create the font face)" << std::endl;
+ return false;
+ }
+
+ // Select the Unicode character map
+ if (FT_Select_Charmap(face, FT_ENCODING_UNICODE) != 0)
+ {
+ err() << "Failed to load font from memory (failed to set the Unicode character set)" << std::endl;
+ FT_Done_Face(face);
+ return false;
+ }
+
+ // Store the loaded font in our ugly void* :)
+ m_face = face;
+
+ // Store the font information
+ m_info.family = face->family_name ? face->family_name : std::string();
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Font::loadFromStream(InputStream& stream)
+{
+ // Cleanup the previous resources
+ cleanup();
+ m_refCount = new int(1);
+
+ // Initialize FreeType
+ // Note: we initialize FreeType for every font instance in order to avoid having a single
+ // global manager that would create a lot of issues regarding creation and destruction order.
+ FT_Library library;
+ if (FT_Init_FreeType(&library) != 0)
+ {
+ err() << "Failed to load font from stream (failed to initialize FreeType)" << std::endl;
+ return false;
+ }
+ m_library = library;
+
+ // Make sure that the stream's reading position is at the beginning
+ stream.seek(0);
+
+ // Prepare a wrapper for our stream, that we'll pass to FreeType callbacks
+ FT_StreamRec* rec = new FT_StreamRec;
+ std::memset(rec, 0, sizeof(*rec));
+ rec->base = NULL;
+ rec->size = static_cast<unsigned long>(stream.getSize());
+ rec->pos = 0;
+ rec->descriptor.pointer = &stream;
+ rec->read = &read;
+ rec->close = &close;
+
+ // Setup the FreeType callbacks that will read our stream
+ FT_Open_Args args;
+ args.flags = FT_OPEN_STREAM;
+ args.stream = rec;
+ args.driver = 0;
+
+ // Load the new font face from the specified stream
+ FT_Face face;
+ if (FT_Open_Face(static_cast<FT_Library>(m_library), &args, 0, &face) != 0)
+ {
+ err() << "Failed to load font from stream (failed to create the font face)" << std::endl;
+ delete rec;
+ return false;
+ }
+
+ // Select the Unicode character map
+ if (FT_Select_Charmap(face, FT_ENCODING_UNICODE) != 0)
+ {
+ err() << "Failed to load font from stream (failed to set the Unicode character set)" << std::endl;
+ FT_Done_Face(face);
+ delete rec;
+ return false;
+ }
+
+ // Store the loaded font in our ugly void* :)
+ m_face = face;
+ m_streamRec = rec;
+
+ // Store the font information
+ m_info.family = face->family_name ? face->family_name : std::string();
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+const Font::Info& Font::getInfo() const
+{
+ return m_info;
+}
+
+
+////////////////////////////////////////////////////////////
+const Glyph& Font::getGlyph(Uint32 codePoint, unsigned int characterSize, bool bold) const
+{
+ // Get the page corresponding to the character size
+ GlyphTable& glyphs = m_pages[characterSize].glyphs;
+
+ // Build the key by combining the code point and the bold flag
+ Uint32 key = ((bold ? 1 : 0) << 31) | codePoint;
+
+ // Search the glyph into the cache
+ GlyphTable::const_iterator it = glyphs.find(key);
+ if (it != glyphs.end())
+ {
+ // Found: just return it
+ return it->second;
+ }
+ else
+ {
+ // Not found: we have to load it
+ Glyph glyph = loadGlyph(codePoint, characterSize, bold);
+ return glyphs.insert(std::make_pair(key, glyph)).first->second;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+float Font::getKerning(Uint32 first, Uint32 second, unsigned int characterSize) const
+{
+ // Special case where first or second is 0 (null character)
+ if (first == 0 || second == 0)
+ return 0.f;
+
+ FT_Face face = static_cast<FT_Face>(m_face);
+
+ if (face && FT_HAS_KERNING(face) && setCurrentSize(characterSize))
+ {
+ // Convert the characters to indices
+ FT_UInt index1 = FT_Get_Char_Index(face, first);
+ FT_UInt index2 = FT_Get_Char_Index(face, second);
+
+ // Get the kerning vector
+ FT_Vector kerning;
+ FT_Get_Kerning(face, index1, index2, FT_KERNING_DEFAULT, &kerning);
+
+ // X advance is already in pixels for bitmap fonts
+ if (!FT_IS_SCALABLE(face))
+ return static_cast<float>(kerning.x);
+
+ // Return the X advance
+ return static_cast<float>(kerning.x) / static_cast<float>(1 << 6);
+ }
+ else
+ {
+ // Invalid font, or no kerning
+ return 0.f;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+float Font::getLineSpacing(unsigned int characterSize) const
+{
+ FT_Face face = static_cast<FT_Face>(m_face);
+
+ if (face && setCurrentSize(characterSize))
+ {
+ return static_cast<float>(face->size->metrics.height) / static_cast<float>(1 << 6);
+ }
+ else
+ {
+ return 0.f;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+float Font::getUnderlinePosition(unsigned int characterSize) const
+{
+ FT_Face face = static_cast<FT_Face>(m_face);
+
+ if (face && setCurrentSize(characterSize))
+ {
+ // Return a fixed position if font is a bitmap font
+ if (!FT_IS_SCALABLE(face))
+ return characterSize / 10.f;
+
+ return -static_cast<float>(FT_MulFix(face->underline_position, face->size->metrics.y_scale)) / static_cast<float>(1 << 6);
+ }
+ else
+ {
+ return 0.f;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+float Font::getUnderlineThickness(unsigned int characterSize) const
+{
+ FT_Face face = static_cast<FT_Face>(m_face);
+
+ if (face && setCurrentSize(characterSize))
+ {
+ // Return a fixed thickness if font is a bitmap font
+ if (!FT_IS_SCALABLE(face))
+ return characterSize / 14.f;
+
+ return static_cast<float>(FT_MulFix(face->underline_thickness, face->size->metrics.y_scale)) / static_cast<float>(1 << 6);
+ }
+ else
+ {
+ return 0.f;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+const Texture& Font::getTexture(unsigned int characterSize) const
+{
+ return m_pages[characterSize].texture;
+}
+
+
+////////////////////////////////////////////////////////////
+Font& Font::operator =(const Font& right)
+{
+ Font temp(right);
+
+ std::swap(m_library, temp.m_library);
+ std::swap(m_face, temp.m_face);
+ std::swap(m_streamRec, temp.m_streamRec);
+ std::swap(m_refCount, temp.m_refCount);
+ std::swap(m_info, temp.m_info);
+ std::swap(m_pages, temp.m_pages);
+ std::swap(m_pixelBuffer, temp.m_pixelBuffer);
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+void Font::cleanup()
+{
+ // Check if we must destroy the FreeType pointers
+ if (m_refCount)
+ {
+ // Decrease the reference counter
+ (*m_refCount)--;
+
+ // Free the resources only if we are the last owner
+ if (*m_refCount == 0)
+ {
+ // Delete the reference counter
+ delete m_refCount;
+
+ // Destroy the font face
+ if (m_face)
+ FT_Done_Face(static_cast<FT_Face>(m_face));
+
+ // Destroy the stream rec instance, if any (must be done after FT_Done_Face!)
+ if (m_streamRec)
+ delete static_cast<FT_StreamRec*>(m_streamRec);
+
+ // Close the library
+ if (m_library)
+ FT_Done_FreeType(static_cast<FT_Library>(m_library));
+ }
+ }
+
+ // Reset members
+ m_library = NULL;
+ m_face = NULL;
+ m_streamRec = NULL;
+ m_refCount = NULL;
+ m_pages.clear();
+ m_pixelBuffer.clear();
+}
+
+
+////////////////////////////////////////////////////////////
+Glyph Font::loadGlyph(Uint32 codePoint, unsigned int characterSize, bool bold) const
+{
+ // The glyph to return
+ Glyph glyph;
+
+ // First, transform our ugly void* to a FT_Face
+ FT_Face face = static_cast<FT_Face>(m_face);
+ if (!face)
+ return glyph;
+
+ // Set the character size
+ if (!setCurrentSize(characterSize))
+ return glyph;
+
+ // Load the glyph corresponding to the code point
+ if (FT_Load_Char(face, codePoint, FT_LOAD_TARGET_NORMAL | FT_LOAD_FORCE_AUTOHINT) != 0)
+ return glyph;
+
+ // Retrieve the glyph
+ FT_Glyph glyphDesc;
+ if (FT_Get_Glyph(face->glyph, &glyphDesc) != 0)
+ return glyph;
+
+ // Apply bold if necessary -- first technique using outline (highest quality)
+ FT_Pos weight = 1 << 6;
+ bool outline = (glyphDesc->format == FT_GLYPH_FORMAT_OUTLINE);
+ if (bold && outline)
+ {
+ FT_OutlineGlyph outlineGlyph = (FT_OutlineGlyph)glyphDesc;
+ FT_Outline_Embolden(&outlineGlyph->outline, weight);
+ }
+
+ // Convert the glyph to a bitmap (i.e. rasterize it)
+ FT_Glyph_To_Bitmap(&glyphDesc, FT_RENDER_MODE_NORMAL, 0, 1);
+ FT_Bitmap& bitmap = reinterpret_cast<FT_BitmapGlyph>(glyphDesc)->bitmap;
+
+ // Apply bold if necessary -- fallback technique using bitmap (lower quality)
+ if (bold && !outline)
+ {
+ FT_Bitmap_Embolden(static_cast<FT_Library>(m_library), &bitmap, weight, weight);
+ }
+
+ // Compute the glyph's advance offset
+ glyph.advance = static_cast<float>(face->glyph->metrics.horiAdvance) / static_cast<float>(1 << 6);
+ if (bold)
+ glyph.advance += static_cast<float>(weight) / static_cast<float>(1 << 6);
+
+ int width = bitmap.width;
+ int height = bitmap.rows;
+
+ if ((width > 0) && (height > 0))
+ {
+ // Leave a small padding around characters, so that filtering doesn't
+ // pollute them with pixels from neighbors
+ const unsigned int padding = 1;
+
+ // Get the glyphs page corresponding to the character size
+ Page& page = m_pages[characterSize];
+
+ // Find a good position for the new glyph into the texture
+ glyph.textureRect = findGlyphRect(page, width + 2 * padding, height + 2 * padding);
+
+ // Make sure the texture data is positioned in the center
+ // of the allocated texture rectangle
+ glyph.textureRect.left += padding;
+ glyph.textureRect.top += padding;
+ glyph.textureRect.width -= 2 * padding;
+ glyph.textureRect.height -= 2 * padding;
+
+ // Compute the glyph's bounding box
+ glyph.bounds.left = static_cast<float>(face->glyph->metrics.horiBearingX) / static_cast<float>(1 << 6);
+ glyph.bounds.top = -static_cast<float>(face->glyph->metrics.horiBearingY) / static_cast<float>(1 << 6);
+ glyph.bounds.width = static_cast<float>(face->glyph->metrics.width) / static_cast<float>(1 << 6);
+ glyph.bounds.height = static_cast<float>(face->glyph->metrics.height) / static_cast<float>(1 << 6);
+
+ // Extract the glyph's pixels from the bitmap
+ m_pixelBuffer.resize(width * height * 4, 255);
+ const Uint8* pixels = bitmap.buffer;
+ if (bitmap.pixel_mode == FT_PIXEL_MODE_MONO)
+ {
+ // Pixels are 1 bit monochrome values
+ for (int y = 0; y < height; ++y)
+ {
+ for (int x = 0; x < width; ++x)
+ {
+ // The color channels remain white, just fill the alpha channel
+ std::size_t index = (x + y * width) * 4 + 3;
+ m_pixelBuffer[index] = ((pixels[x / 8]) & (1 << (7 - (x % 8)))) ? 255 : 0;
+ }
+ pixels += bitmap.pitch;
+ }
+ }
+ else
+ {
+ // Pixels are 8 bits gray levels
+ for (int y = 0; y < height; ++y)
+ {
+ for (int x = 0; x < width; ++x)
+ {
+ // The color channels remain white, just fill the alpha channel
+ std::size_t index = (x + y * width) * 4 + 3;
+ m_pixelBuffer[index] = pixels[x];
+ }
+ pixels += bitmap.pitch;
+ }
+ }
+
+ // Write the pixels to the texture
+ unsigned int x = glyph.textureRect.left;
+ unsigned int y = glyph.textureRect.top;
+ unsigned int w = glyph.textureRect.width;
+ unsigned int h = glyph.textureRect.height;
+ page.texture.update(&m_pixelBuffer[0], w, h, x, y);
+ }
+
+ // Delete the FT glyph
+ FT_Done_Glyph(glyphDesc);
+
+ // Force an OpenGL flush, so that the font's texture will appear updated
+ // in all contexts immediately (solves problems in multi-threaded apps)
+ glCheck(glFlush());
+
+ // Done :)
+ return glyph;
+}
+
+
+////////////////////////////////////////////////////////////
+IntRect Font::findGlyphRect(Page& page, unsigned int width, unsigned int height) const
+{
+ // Find the line that fits well the glyph
+ Row* row = NULL;
+ float bestRatio = 0;
+ for (std::vector<Row>::iterator it = page.rows.begin(); it != page.rows.end() && !row; ++it)
+ {
+ float ratio = static_cast<float>(height) / it->height;
+
+ // Ignore rows that are either too small or too high
+ if ((ratio < 0.7f) || (ratio > 1.f))
+ continue;
+
+ // Check if there's enough horizontal space left in the row
+ if (width > page.texture.getSize().x - it->width)
+ continue;
+
+ // Make sure that this new row is the best found so far
+ if (ratio < bestRatio)
+ continue;
+
+ // The current row passed all the tests: we can select it
+ row = &*it;
+ bestRatio = ratio;
+ }
+
+ // If we didn't find a matching row, create a new one (10% taller than the glyph)
+ if (!row)
+ {
+ int rowHeight = height + height / 10;
+ while ((page.nextRow + rowHeight >= page.texture.getSize().y) || (width >= page.texture.getSize().x))
+ {
+ // Not enough space: resize the texture if possible
+ unsigned int textureWidth = page.texture.getSize().x;
+ unsigned int textureHeight = page.texture.getSize().y;
+ if ((textureWidth * 2 <= Texture::getMaximumSize()) && (textureHeight * 2 <= Texture::getMaximumSize()))
+ {
+ // Make the texture 2 times bigger
+ Image newImage;
+ newImage.create(textureWidth * 2, textureHeight * 2, Color(255, 255, 255, 0));
+ newImage.copy(page.texture.copyToImage(), 0, 0);
+ page.texture.loadFromImage(newImage);
+ }
+ else
+ {
+ // Oops, we've reached the maximum texture size...
+ err() << "Failed to add a new character to the font: the maximum texture size has been reached" << std::endl;
+ return IntRect(0, 0, 2, 2);
+ }
+ }
+
+ // We can now create the new row
+ page.rows.push_back(Row(page.nextRow, rowHeight));
+ page.nextRow += rowHeight;
+ row = &page.rows.back();
+ }
+
+ // Find the glyph's rectangle on the selected row
+ IntRect rect(row->width, row->top, width, height);
+
+ // Update the row informations
+ row->width += width;
+
+ return rect;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Font::setCurrentSize(unsigned int characterSize) const
+{
+ // FT_Set_Pixel_Sizes is an expensive function, so we must call it
+ // only when necessary to avoid killing performances
+
+ FT_Face face = static_cast<FT_Face>(m_face);
+ FT_UShort currentSize = face->size->metrics.x_ppem;
+
+ if (currentSize != characterSize)
+ {
+ FT_Error result = FT_Set_Pixel_Sizes(face, 0, characterSize);
+
+ if (result == FT_Err_Invalid_Pixel_Size)
+ {
+ // In the case of bitmap fonts, resizing can
+ // fail if the requested size is not available
+ if (!FT_IS_SCALABLE(face))
+ {
+ err() << "Failed to set bitmap font size to " << characterSize << std::endl;
+ err() << "Available sizes are: ";
+ for (int i = 0; i < face->num_fixed_sizes; ++i)
+ err() << face->available_sizes[i].height << " ";
+ err() << std::endl;
+ }
+ }
+
+ return result == FT_Err_Ok;
+ }
+ else
+ {
+ return true;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+Font::Page::Page() :
+nextRow(3)
+{
+ // Make sure that the texture is initialized by default
+ sf::Image image;
+ image.create(128, 128, Color(255, 255, 255, 0));
+
+ // Reserve a 2x2 white square for texturing underlines
+ for (int x = 0; x < 2; ++x)
+ for (int y = 0; y < 2; ++y)
+ image.setPixel(x, y, Color(255, 255, 255, 255));
+
+ // Create the texture
+ texture.loadFromImage(image);
+ texture.setSmooth(true);
+}
+
+} // namespace sf
diff --git a/src/SFML/Graphics/GLCheck.cpp b/src/SFML/Graphics/GLCheck.cpp
index 4743c8a..0e8f6de 100644
--- a/src/SFML/Graphics/GLCheck.cpp
+++ b/src/SFML/Graphics/GLCheck.cpp
@@ -1,130 +1,112 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Graphics/GLCheck.hpp>
-#include <SFML/System/Err.hpp>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-void glCheckError(const char* file, unsigned int line)
-{
- // Get the last error
- GLenum errorCode = glGetError();
-
- if (errorCode != GL_NO_ERROR)
- {
- std::string fileString(file);
- std::string error = "unknown error";
- std::string description = "no description";
-
- // Decode the error code
- switch (errorCode)
- {
- case GL_INVALID_ENUM :
- {
- error = "GL_INVALID_ENUM";
- description = "an unacceptable value has been specified for an enumerated argument";
- break;
- }
-
- case GL_INVALID_VALUE :
- {
- error = "GL_INVALID_VALUE";
- description = "a numeric argument is out of range";
- break;
- }
-
- case GL_INVALID_OPERATION :
- {
- error = "GL_INVALID_OPERATION";
- description = "the specified operation is not allowed in the current state";
- break;
- }
-
- case GL_STACK_OVERFLOW :
- {
- error = "GL_STACK_OVERFLOW";
- description = "this command would cause a stack overflow";
- break;
- }
-
- case GL_STACK_UNDERFLOW :
- {
- error = "GL_STACK_UNDERFLOW";
- description = "this command would cause a stack underflow";
- break;
- }
-
- case GL_OUT_OF_MEMORY :
- {
- error = "GL_OUT_OF_MEMORY";
- description = "there is not enough memory left to execute the command";
- break;
- }
-
- case GL_INVALID_FRAMEBUFFER_OPERATION_EXT :
- {
- error = "GL_INVALID_FRAMEBUFFER_OPERATION_EXT";
- description = "the object bound to FRAMEBUFFER_BINDING_EXT is not \"framebuffer complete\"";
- break;
- }
- }
-
- // Log the error
- err() << "An internal OpenGL call failed in "
- << fileString.substr(fileString.find_last_of("\\/") + 1) << " (" << line << ") : "
- << error << ", " << description
- << std::endl;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void ensureGlewInit()
-{
- static bool initialized = false;
- if (!initialized)
- {
- GLenum status = glewInit();
- if (status == GLEW_OK)
- {
- initialized = true;
- }
- else
- {
- err() << "Failed to initialize GLEW, " << glewGetErrorString(status) << std::endl;
- }
- }
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/GLCheck.hpp>
+#include <SFML/System/Err.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+void glCheckError(const char* file, unsigned int line)
+{
+ // Get the last error
+ GLenum errorCode = glGetError();
+
+ if (errorCode != GL_NO_ERROR)
+ {
+ std::string fileString(file);
+ std::string error = "unknown error";
+ std::string description = "no description";
+
+ // Decode the error code
+ switch (errorCode)
+ {
+ case GL_INVALID_ENUM:
+ {
+ error = "GL_INVALID_ENUM";
+ description = "an unacceptable value has been specified for an enumerated argument";
+ break;
+ }
+
+ case GL_INVALID_VALUE:
+ {
+ error = "GL_INVALID_VALUE";
+ description = "a numeric argument is out of range";
+ break;
+ }
+
+ case GL_INVALID_OPERATION:
+ {
+ error = "GL_INVALID_OPERATION";
+ description = "the specified operation is not allowed in the current state";
+ break;
+ }
+
+ case GL_STACK_OVERFLOW:
+ {
+ error = "GL_STACK_OVERFLOW";
+ description = "this command would cause a stack overflow";
+ break;
+ }
+
+ case GL_STACK_UNDERFLOW:
+ {
+ error = "GL_STACK_UNDERFLOW";
+ description = "this command would cause a stack underflow";
+ break;
+ }
+
+ case GL_OUT_OF_MEMORY:
+ {
+ error = "GL_OUT_OF_MEMORY";
+ description = "there is not enough memory left to execute the command";
+ break;
+ }
+
+ case GLEXT_GL_INVALID_FRAMEBUFFER_OPERATION:
+ {
+ error = "GL_INVALID_FRAMEBUFFER_OPERATION";
+ description = "the object bound to FRAMEBUFFER_BINDING is not \"framebuffer complete\"";
+ break;
+ }
+ }
+
+ // Log the error
+ err() << "An internal OpenGL call failed in "
+ << fileString.substr(fileString.find_last_of("\\/") + 1) << " (" << line << ") : "
+ << error << ", " << description
+ << std::endl;
+ }
+}
+
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Graphics/GLCheck.hpp b/src/SFML/Graphics/GLCheck.hpp
index 72e505e..23ee4d0 100644
--- a/src/SFML/Graphics/GLCheck.hpp
+++ b/src/SFML/Graphics/GLCheck.hpp
@@ -1,75 +1,69 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_GLCHECK_HPP
-#define SFML_GLCHECK_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Config.hpp>
-#include <GL/glew.h>
-#include <string>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// Let's define a macro to quickly check every OpenGL API calls
-////////////////////////////////////////////////////////////
-#ifdef SFML_DEBUG
-
- // In debug mode, perform a test on every OpenGL call
- #define glCheck(call) ((call), sf::priv::glCheckError(__FILE__, __LINE__))
-
-#else
-
- // Else, we don't add any overhead
- #define glCheck(call) (call)
-
-#endif
-
-////////////////////////////////////////////////////////////
-/// \brief Check the last OpenGL error
-///
-/// \param file Source file where the call is located
-/// \param line Line number of the source file where the call is located
-///
-////////////////////////////////////////////////////////////
-void glCheckError(const char* file, unsigned int line);
-
-////////////////////////////////////////////////////////////
-/// \brief Make sure that GLEW is initialized
-///
-////////////////////////////////////////////////////////////
-void ensureGlewInit();
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_GLCHECK_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_GLCHECK_HPP
+#define SFML_GLCHECK_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <SFML/Graphics/GLExtensions.hpp>
+#include <string>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// Let's define a macro to quickly check every OpenGL API calls
+////////////////////////////////////////////////////////////
+#ifdef SFML_DEBUG
+
+ // In debug mode, perform a test on every OpenGL call
+ #define glCheck(x) x; sf::priv::glCheckError(__FILE__, __LINE__);
+
+#else
+
+ // Else, we don't add any overhead
+ #define glCheck(call) (call)
+
+#endif
+
+////////////////////////////////////////////////////////////
+/// \brief Check the last OpenGL error
+///
+/// \param file Source file where the call is located
+/// \param line Line number of the source file where the call is located
+///
+////////////////////////////////////////////////////////////
+void glCheckError(const char* file, unsigned int line);
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_GLCHECK_HPP
diff --git a/src/SFML/Main/SFML_Main.cpp b/src/SFML/Graphics/GLExtensions.cpp
index b4d04a3..d3caf6c 100644
--- a/src/SFML/Main/SFML_Main.cpp
+++ b/src/SFML/Graphics/GLExtensions.cpp
@@ -1,44 +1,58 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////
-// Windows specific : defines the WinMain entry function,
-// so that developers can use the standard main function
-// even in a Win32 Application project, and keep a portable code
-////////////////////////////////////////////////////////////
-
-
-#if defined(_WIN32)
-
- #include <windows.h>
-
- extern int main(int argc, char* argv[]);
-
- int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, INT)
- {
- return main(__argc, __argv);
- }
-
-#endif // _WIN32
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/GLExtensions.hpp>
+#include <SFML/System/Err.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+void ensureExtensionsInit()
+{
+#if !defined(SFML_OPENGL_ES)
+ static bool initialized = false;
+ if (!initialized)
+ {
+ GLenum status = glewInit();
+ if (status == GLEW_OK)
+ {
+ initialized = true;
+ }
+ else
+ {
+ err() << "Failed to initialize GLEW, " << glewGetErrorString(status) << std::endl;
+ }
+ }
+#endif
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Graphics/GLExtensions.hpp b/src/SFML/Graphics/GLExtensions.hpp
new file mode 100644
index 0000000..ae97741
--- /dev/null
+++ b/src/SFML/Graphics/GLExtensions.hpp
@@ -0,0 +1,130 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_GLEXTENSIONS_HPP
+#define SFML_GLEXTENSIONS_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+
+#ifdef SFML_OPENGL_ES
+
+ #include <SFML/OpenGL.hpp>
+
+#ifdef SFML_SYSTEM_ANDROID
+ // Hack to make transparency working on some Android devices
+ #define GLEXT_blend_func_separate false
+ #define GLEXT_blend_equation_separate false
+#else
+ #define GLEXT_blend_func_separate GL_OES_blend_func_separate
+ #define GLEXT_blend_equation_separate GL_OES_blend_equation_separate
+#endif
+ #define GLEXT_glBlendFuncSeparate glBlendFuncSeparateOES
+ #define GLEXT_glBlendEquationSeparate glBlendEquationSeparateOES
+ #define GLEXT_framebuffer_object GL_OES_framebuffer_object
+ #define GLEXT_glGenFramebuffers glGenFramebuffersOES
+ #define GLEXT_glGenRenderbuffers glGenRenderbuffersOES
+ #define GLEXT_glBindFramebuffer glBindFramebufferOES
+ #define GLEXT_glBindRenderbuffer glBindRenderbufferOES
+ #define GLEXT_glDeleteFramebuffers glDeleteFramebuffersOES
+ #define GLEXT_glDeleteRenderbuffers glDeleteRenderbuffersOES
+ #define GLEXT_glRenderbufferStorage glRenderbufferStorageOES
+ #define GLEXT_glFramebufferRenderbuffer glFramebufferRenderbufferOES
+ #define GLEXT_glFramebufferTexture2D glFramebufferTexture2DOES
+ #define GLEXT_glCheckFramebufferStatus glCheckFramebufferStatusOES
+ #define GLEXT_GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
+ #define GLEXT_GL_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING_OES
+ #define GLEXT_GL_RENDERBUFFER GL_RENDERBUFFER_OES
+ #define GLEXT_GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_OES
+ #define GLEXT_GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_OES
+ #define GLEXT_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_OES
+ #define GLEXT_GL_DEPTH_COMPONENT GL_DEPTH_COMPONENT16_OES
+ #define GLEXT_GL_INVALID_FRAMEBUFFER_OPERATION GL_INVALID_FRAMEBUFFER_OPERATION_OES
+ #define GLEXT_texture_non_power_of_two false
+ #define GLEXT_multitexture true
+ #define GLEXT_glClientActiveTexture glClientActiveTexture
+ #define GLEXT_glActiveTexture glActiveTexture
+ #define GLEXT_GL_TEXTURE0 GL_TEXTURE0
+ #define GLEXT_glBlendEquation glBlendEquationOES
+ #define GLEXT_GL_FUNC_ADD GL_FUNC_ADD_OES
+ #define GLEXT_GL_FUNC_SUBTRACT GL_FUNC_SUBTRACT_OES
+
+#else
+
+ #include <GL/glew.h>
+ #include <SFML/OpenGL.hpp>
+
+ #define GLEXT_blend_func_separate GLEW_EXT_blend_func_separate
+ #define GLEXT_blend_equation_separate GLEW_EXT_blend_equation_separate
+ #define GLEXT_glBlendFuncSeparate glBlendFuncSeparateEXT
+ #define GLEXT_glBlendEquationSeparate glBlendEquationSeparateEXT
+ #define GLEXT_framebuffer_object GLEW_EXT_framebuffer_object
+ #define GLEXT_glGenFramebuffers glGenFramebuffersEXT
+ #define GLEXT_glGenRenderbuffers glGenRenderbuffersEXT
+ #define GLEXT_glBindFramebuffer glBindFramebufferEXT
+ #define GLEXT_glBindRenderbuffer glBindRenderbufferEXT
+ #define GLEXT_glDeleteFramebuffers glDeleteFramebuffersEXT
+ #define GLEXT_glDeleteRenderbuffers glDeleteRenderbuffersEXT
+ #define GLEXT_glRenderbufferStorage glRenderbufferStorageEXT
+ #define GLEXT_glFramebufferRenderbuffer glFramebufferRenderbufferEXT
+ #define GLEXT_glFramebufferTexture2D glFramebufferTexture2DEXT
+ #define GLEXT_glCheckFramebufferStatus glCheckFramebufferStatusEXT
+ #define GLEXT_GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT
+ #define GLEXT_GL_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING_EXT
+ #define GLEXT_GL_RENDERBUFFER GL_RENDERBUFFER_EXT
+ #define GLEXT_GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
+ #define GLEXT_GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_EXT
+ #define GLEXT_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_EXT
+ #define GLEXT_GL_DEPTH_COMPONENT GL_DEPTH_COMPONENT
+ #define GLEXT_GL_INVALID_FRAMEBUFFER_OPERATION GL_INVALID_FRAMEBUFFER_OPERATION_EXT
+ #define GLEXT_texture_non_power_of_two GLEW_ARB_texture_non_power_of_two
+ #define GLEXT_multitexture GLEW_ARB_multitexture
+ #define GLEXT_glClientActiveTexture glClientActiveTextureARB
+ #define GLEXT_glActiveTexture glActiveTextureARB
+ #define GLEXT_GL_TEXTURE0 GL_TEXTURE0_ARB
+ #define GLEXT_glBlendEquation glBlendEquation
+ #define GLEXT_GL_FUNC_ADD GL_FUNC_ADD
+ #define GLEXT_GL_FUNC_SUBTRACT GL_FUNC_SUBTRACT
+
+#endif
+
+namespace sf
+{
+namespace priv
+{
+
+////////////////////////////////////////////////////////////
+/// \brief Make sure that extensions are initialized
+///
+////////////////////////////////////////////////////////////
+void ensureExtensionsInit();
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_GLEXTENSIONS_HPP
diff --git a/src/SFML/Graphics/Image.cpp b/src/SFML/Graphics/Image.cpp
index 50f49ba..7cc45e0 100644
--- a/src/SFML/Graphics/Image.cpp
+++ b/src/SFML/Graphics/Image.cpp
@@ -1,313 +1,344 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Graphics/Image.hpp>
-#include <SFML/Graphics/ImageLoader.hpp>
-#include <SFML/System/Err.hpp>
-#include <algorithm>
-#include <cstring>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-Image::Image() :
-m_size(0, 0)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-void Image::create(unsigned int width, unsigned int height, const Color& color)
-{
- if (width && height)
- {
- // Assign the new size
- m_size.x = width;
- m_size.y = height;
-
- // Resize the pixel buffer
- m_pixels.resize(width * height * 4);
-
- // Fill it with the specified color
- Uint8* ptr = &m_pixels[0];
- Uint8* end = ptr + m_pixels.size();
- while (ptr < end)
- {
- *ptr++ = color.r;
- *ptr++ = color.g;
- *ptr++ = color.b;
- *ptr++ = color.a;
- }
- }
- else
- {
- // Create an empty image
- m_size.x = 0;
- m_size.y = 0;
- m_pixels.clear();
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Image::create(unsigned int width, unsigned int height, const Uint8* pixels)
-{
- if (pixels && width && height)
- {
- // Assign the new size
- m_size.x = width;
- m_size.y = height;
-
- // Copy the pixels
- std::size_t size = width * height * 4;
- m_pixels.resize(size);
- std::memcpy(&m_pixels[0], pixels, size); // faster than vector::assign
- }
- else
- {
- // Create an empty image
- m_size.x = 0;
- m_size.y = 0;
- m_pixels.clear();
- }
-}
-
-
-////////////////////////////////////////////////////////////
-bool Image::loadFromFile(const std::string& filename)
-{
- return priv::ImageLoader::getInstance().loadImageFromFile(filename, m_pixels, m_size);
-}
-
-
-////////////////////////////////////////////////////////////
-bool Image::loadFromMemory(const void* data, std::size_t size)
-{
- return priv::ImageLoader::getInstance().loadImageFromMemory(data, size, m_pixels, m_size);
-}
-
-
-////////////////////////////////////////////////////////////
-bool Image::loadFromStream(InputStream& stream)
-{
- return priv::ImageLoader::getInstance().loadImageFromStream(stream, m_pixels, m_size);
-}
-
-
-////////////////////////////////////////////////////////////
-bool Image::saveToFile(const std::string& filename) const
-{
- return priv::ImageLoader::getInstance().saveImageToFile(filename, m_pixels, m_size);
-}
-
-
-////////////////////////////////////////////////////////////
-Vector2u Image::getSize() const
-{
- return m_size;
-}
-
-
-////////////////////////////////////////////////////////////
-void Image::createMaskFromColor(const Color& color, Uint8 alpha)
-{
- // Make sure that the image is not empty
- if (!m_pixels.empty())
- {
- // Replace the alpha of the pixels that match the transparent color
- Uint8* ptr = &m_pixels[0];
- Uint8* end = ptr + m_pixels.size();
- while (ptr < end)
- {
- if ((ptr[0] == color.r) && (ptr[1] == color.g) && (ptr[2] == color.b) && (ptr[3] == color.a))
- ptr[3] = alpha;
- ptr += 4;
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Image::copy(const Image& source, unsigned int destX, unsigned int destY, const IntRect& sourceRect, bool applyAlpha)
-{
- // Make sure that both images are valid
- if ((source.m_size.x == 0) || (source.m_size.y == 0) || (m_size.x == 0) || (m_size.y == 0))
- return;
-
- // Adjust the source rectangle
- IntRect srcRect = sourceRect;
- if (srcRect.width == 0 || (srcRect.height == 0))
- {
- srcRect.left = 0;
- srcRect.top = 0;
- srcRect.width = source.m_size.x;
- srcRect.height = source.m_size.y;
- }
- else
- {
- if (srcRect.left < 0) srcRect.left = 0;
- if (srcRect.top < 0) srcRect.top = 0;
- if (srcRect.width > static_cast<int>(source.m_size.x)) srcRect.width = source.m_size.x;
- if (srcRect.height > static_cast<int>(source.m_size.y)) srcRect.height = source.m_size.y;
- }
-
- // Then find the valid bounds of the destination rectangle
- int width = srcRect.width;
- int height = srcRect.height;
- if (destX + width > m_size.x) width = m_size.x - destX;
- if (destY + height > m_size.y) height = m_size.y - destY;
-
- // Make sure the destination area is valid
- if ((width <= 0) || (height <= 0))
- return;
-
- // Precompute as much as possible
- int pitch = width * 4;
- int rows = height;
- int srcStride = source.m_size.x * 4;
- int dstStride = m_size.x * 4;
- const Uint8* srcPixels = &source.m_pixels[0] + (srcRect.left + srcRect.top * source.m_size.x) * 4;
- Uint8* dstPixels = &m_pixels[0] + (destX + destY * m_size.x) * 4;
-
- // Copy the pixels
- if (applyAlpha)
- {
- // Interpolation using alpha values, pixel by pixel (slower)
- for (int i = 0; i < rows; ++i)
- {
- for (int j = 0; j < width; ++j)
- {
- // Get a direct pointer to the components of the current pixel
- const Uint8* src = srcPixels + j * 4;
- Uint8* dst = dstPixels + j * 4;
-
- // Interpolate RGBA components using the alpha value of the source pixel
- Uint8 alpha = src[3];
- dst[0] = (src[0] * alpha + dst[0] * (255 - alpha)) / 255;
- dst[1] = (src[1] * alpha + dst[1] * (255 - alpha)) / 255;
- dst[2] = (src[2] * alpha + dst[2] * (255 - alpha)) / 255;
- dst[3] = alpha + dst[3] * (255 - alpha) / 255;
- }
-
- srcPixels += srcStride;
- dstPixels += dstStride;
- }
- }
- else
- {
- // Optimized copy ignoring alpha values, row by row (faster)
- for (int i = 0; i < rows; ++i)
- {
- std::memcpy(dstPixels, srcPixels, pitch);
- srcPixels += srcStride;
- dstPixels += dstStride;
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Image::setPixel(unsigned int x, unsigned int y, const Color& color)
-{
- Uint8* pixel = &m_pixels[(x + y * m_size.x) * 4];
- *pixel++ = color.r;
- *pixel++ = color.g;
- *pixel++ = color.b;
- *pixel++ = color.a;
-}
-
-
-////////////////////////////////////////////////////////////
-Color Image::getPixel(unsigned int x, unsigned int y) const
-{
- const Uint8* pixel = &m_pixels[(x + y * m_size.x) * 4];
- return Color(pixel[0], pixel[1], pixel[2], pixel[3]);
-}
-
-
-////////////////////////////////////////////////////////////
-const Uint8* Image::getPixelsPtr() const
-{
- if (!m_pixels.empty())
- {
- return &m_pixels[0];
- }
- else
- {
- err() << "Trying to access the pixels of an empty image" << std::endl;
- return NULL;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Image::flipHorizontally()
-{
- if (!m_pixels.empty())
- {
- std::vector<Uint8> before = m_pixels;
- for (unsigned int y = 0; y < m_size.y; ++y)
- {
- const Uint8* source = &before[y * m_size.x * 4];
- Uint8* dest = &m_pixels[(y + 1) * m_size.x * 4 - 4];
- for (unsigned int x = 0; x < m_size.x; ++x)
- {
- dest[0] = source[0];
- dest[1] = source[1];
- dest[2] = source[2];
- dest[3] = source[3];
-
- source += 4;
- dest -= 4;
- }
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Image::flipVertically()
-{
- if (!m_pixels.empty())
- {
- std::vector<Uint8> before = m_pixels;
- const Uint8* source = &before[m_size.x * (m_size.y - 1) * 4];
- Uint8* dest = &m_pixels[0];
- std::size_t rowSize = m_size.x * 4;
-
- for (unsigned int y = 0; y < m_size.y; ++y)
- {
- std::memcpy(dest, source, rowSize);
- source -= rowSize;
- dest += rowSize;
- }
- }
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/Image.hpp>
+#include <SFML/Graphics/ImageLoader.hpp>
+#include <SFML/System/Err.hpp>
+#ifdef SFML_SYSTEM_ANDROID
+ #include <SFML/System/Android/ResourceStream.hpp>
+#endif
+#include <algorithm>
+#include <cstring>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Image::Image() :
+m_size(0, 0)
+{
+ #ifdef SFML_SYSTEM_ANDROID
+
+ m_stream = NULL;
+
+ #endif
+}
+
+
+////////////////////////////////////////////////////////////
+Image::~Image()
+{
+ #ifdef SFML_SYSTEM_ANDROID
+
+ if (m_stream)
+ delete (priv::ResourceStream*)m_stream;
+
+ #endif
+}
+
+
+////////////////////////////////////////////////////////////
+void Image::create(unsigned int width, unsigned int height, const Color& color)
+{
+ if (width && height)
+ {
+ // Assign the new size
+ m_size.x = width;
+ m_size.y = height;
+
+ // Resize the pixel buffer
+ m_pixels.resize(width * height * 4);
+
+ // Fill it with the specified color
+ Uint8* ptr = &m_pixels[0];
+ Uint8* end = ptr + m_pixels.size();
+ while (ptr < end)
+ {
+ *ptr++ = color.r;
+ *ptr++ = color.g;
+ *ptr++ = color.b;
+ *ptr++ = color.a;
+ }
+ }
+ else
+ {
+ // Create an empty image
+ m_size.x = 0;
+ m_size.y = 0;
+ m_pixels.clear();
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Image::create(unsigned int width, unsigned int height, const Uint8* pixels)
+{
+ if (pixels && width && height)
+ {
+ // Assign the new size
+ m_size.x = width;
+ m_size.y = height;
+
+ // Copy the pixels
+ std::size_t size = width * height * 4;
+ m_pixels.resize(size);
+ std::memcpy(&m_pixels[0], pixels, size); // faster than vector::assign
+ }
+ else
+ {
+ // Create an empty image
+ m_size.x = 0;
+ m_size.y = 0;
+ m_pixels.clear();
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+bool Image::loadFromFile(const std::string& filename)
+{
+ #ifndef SFML_SYSTEM_ANDROID
+
+ return priv::ImageLoader::getInstance().loadImageFromFile(filename, m_pixels, m_size);
+
+ #else
+
+ if (m_stream)
+ delete (priv::ResourceStream*)m_stream;
+
+ m_stream = new priv::ResourceStream(filename);
+ return loadFromStream(*(priv::ResourceStream*)m_stream);
+
+ #endif
+}
+
+
+////////////////////////////////////////////////////////////
+bool Image::loadFromMemory(const void* data, std::size_t size)
+{
+ return priv::ImageLoader::getInstance().loadImageFromMemory(data, size, m_pixels, m_size);
+}
+
+
+////////////////////////////////////////////////////////////
+bool Image::loadFromStream(InputStream& stream)
+{
+ return priv::ImageLoader::getInstance().loadImageFromStream(stream, m_pixels, m_size);
+}
+
+
+////////////////////////////////////////////////////////////
+bool Image::saveToFile(const std::string& filename) const
+{
+ return priv::ImageLoader::getInstance().saveImageToFile(filename, m_pixels, m_size);
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2u Image::getSize() const
+{
+ return m_size;
+}
+
+
+////////////////////////////////////////////////////////////
+void Image::createMaskFromColor(const Color& color, Uint8 alpha)
+{
+ // Make sure that the image is not empty
+ if (!m_pixels.empty())
+ {
+ // Replace the alpha of the pixels that match the transparent color
+ Uint8* ptr = &m_pixels[0];
+ Uint8* end = ptr + m_pixels.size();
+ while (ptr < end)
+ {
+ if ((ptr[0] == color.r) && (ptr[1] == color.g) && (ptr[2] == color.b) && (ptr[3] == color.a))
+ ptr[3] = alpha;
+ ptr += 4;
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Image::copy(const Image& source, unsigned int destX, unsigned int destY, const IntRect& sourceRect, bool applyAlpha)
+{
+ // Make sure that both images are valid
+ if ((source.m_size.x == 0) || (source.m_size.y == 0) || (m_size.x == 0) || (m_size.y == 0))
+ return;
+
+ // Adjust the source rectangle
+ IntRect srcRect = sourceRect;
+ if (srcRect.width == 0 || (srcRect.height == 0))
+ {
+ srcRect.left = 0;
+ srcRect.top = 0;
+ srcRect.width = source.m_size.x;
+ srcRect.height = source.m_size.y;
+ }
+ else
+ {
+ if (srcRect.left < 0) srcRect.left = 0;
+ if (srcRect.top < 0) srcRect.top = 0;
+ if (srcRect.width > static_cast<int>(source.m_size.x)) srcRect.width = source.m_size.x;
+ if (srcRect.height > static_cast<int>(source.m_size.y)) srcRect.height = source.m_size.y;
+ }
+
+ // Then find the valid bounds of the destination rectangle
+ int width = srcRect.width;
+ int height = srcRect.height;
+ if (destX + width > m_size.x) width = m_size.x - destX;
+ if (destY + height > m_size.y) height = m_size.y - destY;
+
+ // Make sure the destination area is valid
+ if ((width <= 0) || (height <= 0))
+ return;
+
+ // Precompute as much as possible
+ int pitch = width * 4;
+ int rows = height;
+ int srcStride = source.m_size.x * 4;
+ int dstStride = m_size.x * 4;
+ const Uint8* srcPixels = &source.m_pixels[0] + (srcRect.left + srcRect.top * source.m_size.x) * 4;
+ Uint8* dstPixels = &m_pixels[0] + (destX + destY * m_size.x) * 4;
+
+ // Copy the pixels
+ if (applyAlpha)
+ {
+ // Interpolation using alpha values, pixel by pixel (slower)
+ for (int i = 0; i < rows; ++i)
+ {
+ for (int j = 0; j < width; ++j)
+ {
+ // Get a direct pointer to the components of the current pixel
+ const Uint8* src = srcPixels + j * 4;
+ Uint8* dst = dstPixels + j * 4;
+
+ // Interpolate RGBA components using the alpha value of the source pixel
+ Uint8 alpha = src[3];
+ dst[0] = (src[0] * alpha + dst[0] * (255 - alpha)) / 255;
+ dst[1] = (src[1] * alpha + dst[1] * (255 - alpha)) / 255;
+ dst[2] = (src[2] * alpha + dst[2] * (255 - alpha)) / 255;
+ dst[3] = alpha + dst[3] * (255 - alpha) / 255;
+ }
+
+ srcPixels += srcStride;
+ dstPixels += dstStride;
+ }
+ }
+ else
+ {
+ // Optimized copy ignoring alpha values, row by row (faster)
+ for (int i = 0; i < rows; ++i)
+ {
+ std::memcpy(dstPixels, srcPixels, pitch);
+ srcPixels += srcStride;
+ dstPixels += dstStride;
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Image::setPixel(unsigned int x, unsigned int y, const Color& color)
+{
+ Uint8* pixel = &m_pixels[(x + y * m_size.x) * 4];
+ *pixel++ = color.r;
+ *pixel++ = color.g;
+ *pixel++ = color.b;
+ *pixel++ = color.a;
+}
+
+
+////////////////////////////////////////////////////////////
+Color Image::getPixel(unsigned int x, unsigned int y) const
+{
+ const Uint8* pixel = &m_pixels[(x + y * m_size.x) * 4];
+ return Color(pixel[0], pixel[1], pixel[2], pixel[3]);
+}
+
+
+////////////////////////////////////////////////////////////
+const Uint8* Image::getPixelsPtr() const
+{
+ if (!m_pixels.empty())
+ {
+ return &m_pixels[0];
+ }
+ else
+ {
+ err() << "Trying to access the pixels of an empty image" << std::endl;
+ return NULL;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Image::flipHorizontally()
+{
+ if (!m_pixels.empty())
+ {
+ std::size_t rowSize = m_size.x * 4;
+
+ for (std::size_t y = 0; y < m_size.y; ++y)
+ {
+ std::vector<Uint8>::iterator left = m_pixels.begin() + y * rowSize;
+ std::vector<Uint8>::iterator right = m_pixels.begin() + (y + 1) * rowSize - 4;
+
+ for (std::size_t x = 0; x < m_size.x / 2; ++x)
+ {
+ std::swap_ranges(left, left + 4, right);
+
+ left += 4;
+ right -= 4;
+ }
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Image::flipVertically()
+{
+ if (!m_pixels.empty())
+ {
+ std::size_t rowSize = m_size.x * 4;
+
+ std::vector<Uint8>::iterator top = m_pixels.begin();
+ std::vector<Uint8>::iterator bottom = m_pixels.end() - rowSize;
+
+ for (std::size_t y = 0; y < m_size.y / 2; ++y)
+ {
+ std::swap_ranges(top, top + rowSize, bottom);
+
+ top += rowSize;
+ bottom -= rowSize;
+ }
+ }
+}
+
+} // namespace sf
diff --git a/src/SFML/Graphics/ImageLoader.cpp b/src/SFML/Graphics/ImageLoader.cpp
index 340c5c8..be6aecf 100644
--- a/src/SFML/Graphics/ImageLoader.cpp
+++ b/src/SFML/Graphics/ImageLoader.cpp
@@ -1,321 +1,321 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Graphics/ImageLoader.hpp>
-#include <SFML/System/InputStream.hpp>
-#include <SFML/System/Err.hpp>
-#include <SFML/Graphics/stb_image/stb_image.h>
-#define STB_IMAGE_WRITE_IMPLEMENTATION
-#include <SFML/Graphics/stb_image/stb_image_write.h>
-extern "C"
-{
- #include <jpeglib.h>
- #include <jerror.h>
-}
-#include <cctype>
-
-
-namespace
-{
- // Convert a string to lower case
- std::string toLower(std::string str)
- {
- for (std::string::iterator i = str.begin(); i != str.end(); ++i)
- *i = static_cast<char>(std::tolower(*i));
- return str;
- }
-
- // stb_image callbacks that operate on a sf::InputStream
- int read(void* user, char* data, int size)
- {
- sf::InputStream* stream = static_cast<sf::InputStream*>(user);
- return static_cast<int>(stream->read(data, size));
- }
- void skip(void* user, unsigned int size)
- {
- sf::InputStream* stream = static_cast<sf::InputStream*>(user);
- stream->seek(stream->tell() + size);
- }
- int eof(void* user)
- {
- sf::InputStream* stream = static_cast<sf::InputStream*>(user);
- return stream->tell() >= stream->getSize();
- }
-}
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-ImageLoader& ImageLoader::getInstance()
-{
- static ImageLoader Instance;
-
- return Instance;
-}
-
-
-////////////////////////////////////////////////////////////
-ImageLoader::ImageLoader()
-{
- // Nothing to do
-}
-
-
-////////////////////////////////////////////////////////////
-ImageLoader::~ImageLoader()
-{
- // Nothing to do
-}
-
-
-////////////////////////////////////////////////////////////
-bool ImageLoader::loadImageFromFile(const std::string& filename, std::vector<Uint8>& pixels, Vector2u& size)
-{
- // Clear the array (just in case)
- pixels.clear();
-
- // Load the image and get a pointer to the pixels in memory
- int width, height, channels;
- unsigned char* ptr = stbi_load(filename.c_str(), &width, &height, &channels, STBI_rgb_alpha);
-
- if (ptr && width && height)
- {
- // Assign the image properties
- size.x = width;
- size.y = height;
-
- // Copy the loaded pixels to the pixel buffer
- pixels.resize(width * height * 4);
- memcpy(&pixels[0], ptr, pixels.size());
-
- // Free the loaded pixels (they are now in our own pixel buffer)
- stbi_image_free(ptr);
-
- return true;
- }
- else
- {
- // Error, failed to load the image
- err() << "Failed to load image \"" << filename << "\". Reason : " << stbi_failure_reason() << std::endl;
-
- return false;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-bool ImageLoader::loadImageFromMemory(const void* data, std::size_t dataSize, std::vector<Uint8>& pixels, Vector2u& size)
-{
- // Check input parameters
- if (data && dataSize)
- {
- // Clear the array (just in case)
- pixels.clear();
-
- // Load the image and get a pointer to the pixels in memory
- int width, height, channels;
- const unsigned char* buffer = static_cast<const unsigned char*>(data);
- unsigned char* ptr = stbi_load_from_memory(buffer, static_cast<int>(dataSize), &width, &height, &channels, STBI_rgb_alpha);
-
- if (ptr && width && height)
- {
- // Assign the image properties
- size.x = width;
- size.y = height;
-
- // Copy the loaded pixels to the pixel buffer
- pixels.resize(width * height * 4);
- memcpy(&pixels[0], ptr, pixels.size());
-
- // Free the loaded pixels (they are now in our own pixel buffer)
- stbi_image_free(ptr);
-
- return true;
- }
- else
- {
- // Error, failed to load the image
- err() << "Failed to load image from memory. Reason : " << stbi_failure_reason() << std::endl;
-
- return false;
- }
- }
- else
- {
- err() << "Failed to load image from memory, no data provided" << std::endl;
- return false;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-bool ImageLoader::loadImageFromStream(InputStream& stream, std::vector<Uint8>& pixels, Vector2u& size)
-{
- // Clear the array (just in case)
- pixels.clear();
-
- // Make sure that the stream's reading position is at the beginning
- stream.seek(0);
-
- // Setup the stb_image callbacks
- stbi_io_callbacks callbacks;
- callbacks.read = &read;
- callbacks.skip = &skip;
- callbacks.eof = &eof;
-
- // Load the image and get a pointer to the pixels in memory
- int width, height, channels;
- unsigned char* ptr = stbi_load_from_callbacks(&callbacks, &stream, &width, &height, &channels, STBI_rgb_alpha);
-
- if (ptr && width && height)
- {
- // Assign the image properties
- size.x = width;
- size.y = height;
-
- // Copy the loaded pixels to the pixel buffer
- pixels.resize(width * height * 4);
- memcpy(&pixels[0], ptr, pixels.size());
-
- // Free the loaded pixels (they are now in our own pixel buffer)
- stbi_image_free(ptr);
-
- return true;
- }
- else
- {
- // Error, failed to load the image
- err() << "Failed to load image from stream. Reason : " << stbi_failure_reason() << std::endl;
-
- return false;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-bool ImageLoader::saveImageToFile(const std::string& filename, const std::vector<Uint8>& pixels, const Vector2u& size)
-{
- // Make sure the image is not empty
- if (!pixels.empty() && (size.x > 0) && (size.y > 0))
- {
- // Deduce the image type from its extension
- if (filename.size() > 3)
- {
- // Extract the extension
- std::string extension = filename.substr(filename.size() - 3);
-
- if (toLower(extension) == "bmp")
- {
- // BMP format
- if (stbi_write_bmp(filename.c_str(), size.x, size.y, 4, &pixels[0]))
- return true;
- }
- else if (toLower(extension) == "tga")
- {
- // TGA format
- if (stbi_write_tga(filename.c_str(), size.x, size.y, 4, &pixels[0]))
- return true;
- }
- else if(toLower(extension) == "png")
- {
- // PNG format
- if (stbi_write_png(filename.c_str(), size.x, size.y, 4, &pixels[0], 0))
- return true;
- }
- else if (toLower(extension) == "jpg")
- {
- // JPG format
- if (writeJpg(filename, pixels, size.x, size.y))
- return true;
- }
- }
- }
-
- err() << "Failed to save image \"" << filename << "\"" << std::endl;
- return false;
-}
-
-
-////////////////////////////////////////////////////////////
-bool ImageLoader::writeJpg(const std::string& filename, const std::vector<Uint8>& pixels, unsigned int width, unsigned int height)
-{
- // Open the file to write in
- FILE* file = fopen(filename.c_str(), "wb");
- if (!file)
- return false;
-
- // Initialize the error handler
- jpeg_compress_struct compressInfos;
- jpeg_error_mgr errorManager;
- compressInfos.err = jpeg_std_error(&errorManager);
-
- // Initialize all the writing and compression infos
- jpeg_create_compress(&compressInfos);
- compressInfos.image_width = width;
- compressInfos.image_height = height;
- compressInfos.input_components = 3;
- compressInfos.in_color_space = JCS_RGB;
- jpeg_stdio_dest(&compressInfos, file);
- jpeg_set_defaults(&compressInfos);
- jpeg_set_quality(&compressInfos, 90, TRUE);
-
- // Get rid of the aplha channel
- std::vector<Uint8> buffer(width * height * 3);
- for (std::size_t i = 0; i < width * height; ++i)
- {
- buffer[i * 3 + 0] = pixels[i * 4 + 0];
- buffer[i * 3 + 1] = pixels[i * 4 + 1];
- buffer[i * 3 + 2] = pixels[i * 4 + 2];
- }
- Uint8* ptr = &buffer[0];
-
- // Start compression
- jpeg_start_compress(&compressInfos, TRUE);
-
- // Write each row of the image
- while (compressInfos.next_scanline < compressInfos.image_height)
- {
- JSAMPROW rawPointer = ptr + (compressInfos.next_scanline * width * 3);
- jpeg_write_scanlines(&compressInfos, &rawPointer, 1);
- }
-
- // Finish compression
- jpeg_finish_compress(&compressInfos);
- jpeg_destroy_compress(&compressInfos);
-
- // Close the file
- fclose(file);
-
- return true;
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/ImageLoader.hpp>
+#include <SFML/System/InputStream.hpp>
+#include <SFML/System/Err.hpp>
+#include <SFML/Graphics/stb_image/stb_image.h>
+#define STB_IMAGE_WRITE_IMPLEMENTATION
+#include <SFML/Graphics/stb_image/stb_image_write.h>
+extern "C"
+{
+ #include <jpeglib.h>
+ #include <jerror.h>
+}
+#include <cctype>
+
+
+namespace
+{
+ // Convert a string to lower case
+ std::string toLower(std::string str)
+ {
+ for (std::string::iterator i = str.begin(); i != str.end(); ++i)
+ *i = static_cast<char>(std::tolower(*i));
+ return str;
+ }
+
+ // stb_image callbacks that operate on a sf::InputStream
+ int read(void* user, char* data, int size)
+ {
+ sf::InputStream* stream = static_cast<sf::InputStream*>(user);
+ return static_cast<int>(stream->read(data, size));
+ }
+ void skip(void* user, unsigned int size)
+ {
+ sf::InputStream* stream = static_cast<sf::InputStream*>(user);
+ stream->seek(stream->tell() + size);
+ }
+ int eof(void* user)
+ {
+ sf::InputStream* stream = static_cast<sf::InputStream*>(user);
+ return stream->tell() >= stream->getSize();
+ }
+}
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+ImageLoader& ImageLoader::getInstance()
+{
+ static ImageLoader Instance;
+
+ return Instance;
+}
+
+
+////////////////////////////////////////////////////////////
+ImageLoader::ImageLoader()
+{
+ // Nothing to do
+}
+
+
+////////////////////////////////////////////////////////////
+ImageLoader::~ImageLoader()
+{
+ // Nothing to do
+}
+
+
+////////////////////////////////////////////////////////////
+bool ImageLoader::loadImageFromFile(const std::string& filename, std::vector<Uint8>& pixels, Vector2u& size)
+{
+ // Clear the array (just in case)
+ pixels.clear();
+
+ // Load the image and get a pointer to the pixels in memory
+ int width, height, channels;
+ unsigned char* ptr = stbi_load(filename.c_str(), &width, &height, &channels, STBI_rgb_alpha);
+
+ if (ptr && width && height)
+ {
+ // Assign the image properties
+ size.x = width;
+ size.y = height;
+
+ // Copy the loaded pixels to the pixel buffer
+ pixels.resize(width * height * 4);
+ memcpy(&pixels[0], ptr, pixels.size());
+
+ // Free the loaded pixels (they are now in our own pixel buffer)
+ stbi_image_free(ptr);
+
+ return true;
+ }
+ else
+ {
+ // Error, failed to load the image
+ err() << "Failed to load image \"" << filename << "\". Reason: " << stbi_failure_reason() << std::endl;
+
+ return false;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+bool ImageLoader::loadImageFromMemory(const void* data, std::size_t dataSize, std::vector<Uint8>& pixels, Vector2u& size)
+{
+ // Check input parameters
+ if (data && dataSize)
+ {
+ // Clear the array (just in case)
+ pixels.clear();
+
+ // Load the image and get a pointer to the pixels in memory
+ int width, height, channels;
+ const unsigned char* buffer = static_cast<const unsigned char*>(data);
+ unsigned char* ptr = stbi_load_from_memory(buffer, static_cast<int>(dataSize), &width, &height, &channels, STBI_rgb_alpha);
+
+ if (ptr && width && height)
+ {
+ // Assign the image properties
+ size.x = width;
+ size.y = height;
+
+ // Copy the loaded pixels to the pixel buffer
+ pixels.resize(width * height * 4);
+ memcpy(&pixels[0], ptr, pixels.size());
+
+ // Free the loaded pixels (they are now in our own pixel buffer)
+ stbi_image_free(ptr);
+
+ return true;
+ }
+ else
+ {
+ // Error, failed to load the image
+ err() << "Failed to load image from memory. Reason: " << stbi_failure_reason() << std::endl;
+
+ return false;
+ }
+ }
+ else
+ {
+ err() << "Failed to load image from memory, no data provided" << std::endl;
+ return false;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+bool ImageLoader::loadImageFromStream(InputStream& stream, std::vector<Uint8>& pixels, Vector2u& size)
+{
+ // Clear the array (just in case)
+ pixels.clear();
+
+ // Make sure that the stream's reading position is at the beginning
+ stream.seek(0);
+
+ // Setup the stb_image callbacks
+ stbi_io_callbacks callbacks;
+ callbacks.read = &read;
+ callbacks.skip = &skip;
+ callbacks.eof = &eof;
+
+ // Load the image and get a pointer to the pixels in memory
+ int width, height, channels;
+ unsigned char* ptr = stbi_load_from_callbacks(&callbacks, &stream, &width, &height, &channels, STBI_rgb_alpha);
+
+ if (ptr && width && height)
+ {
+ // Assign the image properties
+ size.x = width;
+ size.y = height;
+
+ // Copy the loaded pixels to the pixel buffer
+ pixels.resize(width * height * 4);
+ memcpy(&pixels[0], ptr, pixels.size());
+
+ // Free the loaded pixels (they are now in our own pixel buffer)
+ stbi_image_free(ptr);
+
+ return true;
+ }
+ else
+ {
+ // Error, failed to load the image
+ err() << "Failed to load image from stream. Reason: " << stbi_failure_reason() << std::endl;
+
+ return false;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+bool ImageLoader::saveImageToFile(const std::string& filename, const std::vector<Uint8>& pixels, const Vector2u& size)
+{
+ // Make sure the image is not empty
+ if (!pixels.empty() && (size.x > 0) && (size.y > 0))
+ {
+ // Deduce the image type from its extension
+ if (filename.size() > 3)
+ {
+ // Extract the extension
+ std::string extension = toLower(filename.substr(filename.size() - 3));
+
+ if (extension == "bmp")
+ {
+ // BMP format
+ if (stbi_write_bmp(filename.c_str(), size.x, size.y, 4, &pixels[0]))
+ return true;
+ }
+ else if (extension == "tga")
+ {
+ // TGA format
+ if (stbi_write_tga(filename.c_str(), size.x, size.y, 4, &pixels[0]))
+ return true;
+ }
+ else if (extension == "png")
+ {
+ // PNG format
+ if (stbi_write_png(filename.c_str(), size.x, size.y, 4, &pixels[0], 0))
+ return true;
+ }
+ else if (extension == "jpg")
+ {
+ // JPG format
+ if (writeJpg(filename, pixels, size.x, size.y))
+ return true;
+ }
+ }
+ }
+
+ err() << "Failed to save image \"" << filename << "\"" << std::endl;
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+bool ImageLoader::writeJpg(const std::string& filename, const std::vector<Uint8>& pixels, unsigned int width, unsigned int height)
+{
+ // Open the file to write in
+ FILE* file = fopen(filename.c_str(), "wb");
+ if (!file)
+ return false;
+
+ // Initialize the error handler
+ jpeg_compress_struct compressInfos;
+ jpeg_error_mgr errorManager;
+ compressInfos.err = jpeg_std_error(&errorManager);
+
+ // Initialize all the writing and compression infos
+ jpeg_create_compress(&compressInfos);
+ compressInfos.image_width = width;
+ compressInfos.image_height = height;
+ compressInfos.input_components = 3;
+ compressInfos.in_color_space = JCS_RGB;
+ jpeg_stdio_dest(&compressInfos, file);
+ jpeg_set_defaults(&compressInfos);
+ jpeg_set_quality(&compressInfos, 90, TRUE);
+
+ // Get rid of the alpha channel
+ std::vector<Uint8> buffer(width * height * 3);
+ for (std::size_t i = 0; i < width * height; ++i)
+ {
+ buffer[i * 3 + 0] = pixels[i * 4 + 0];
+ buffer[i * 3 + 1] = pixels[i * 4 + 1];
+ buffer[i * 3 + 2] = pixels[i * 4 + 2];
+ }
+ Uint8* ptr = &buffer[0];
+
+ // Start compression
+ jpeg_start_compress(&compressInfos, TRUE);
+
+ // Write each row of the image
+ while (compressInfos.next_scanline < compressInfos.image_height)
+ {
+ JSAMPROW rawPointer = ptr + (compressInfos.next_scanline * width * 3);
+ jpeg_write_scanlines(&compressInfos, &rawPointer, 1);
+ }
+
+ // Finish compression
+ jpeg_finish_compress(&compressInfos);
+ jpeg_destroy_compress(&compressInfos);
+
+ // Close the file
+ fclose(file);
+
+ return true;
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Graphics/ImageLoader.hpp b/src/SFML/Graphics/ImageLoader.hpp
index 08f652b..8d1b71d 100644
--- a/src/SFML/Graphics/ImageLoader.hpp
+++ b/src/SFML/Graphics/ImageLoader.hpp
@@ -1,141 +1,141 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_IMAGELOADER_HPP
-#define SFML_IMAGELOADER_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/NonCopyable.hpp>
-#include <SFML/System/Vector2.hpp>
-#include <string>
-#include <vector>
-
-
-namespace sf
-{
-class InputStream;
-
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief Load/save image files
-///
-////////////////////////////////////////////////////////////
-class ImageLoader : NonCopyable
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the unique instance of the class
- ///
- /// \return Reference to the ImageLoader instance
- ///
- ////////////////////////////////////////////////////////////
- static ImageLoader& getInstance();
-
- ////////////////////////////////////////////////////////////
- /// \brief Load an image from a file on disk
- ///
- /// \param filename Path of image file to load
- /// \param pixels Array of pixels to fill with loaded image
- /// \param size Size of loaded image, in pixels
- ///
- /// \return True if loading was successful
- ///
- ////////////////////////////////////////////////////////////
- bool loadImageFromFile(const std::string& filename, std::vector<Uint8>& pixels, Vector2u& size);
-
- ////////////////////////////////////////////////////////////
- /// \brief Load an image from a file in memory
- ///
- /// \param data Pointer to the file data in memory
- /// \param dataSize Size of the data to load, in bytes
- /// \param pixels Array of pixels to fill with loaded image
- /// \param size Size of loaded image, in pixels
- ///
- /// \return True if loading was successful
- ///
- ////////////////////////////////////////////////////////////
- bool loadImageFromMemory(const void* data, std::size_t dataSize, std::vector<Uint8>& pixels, Vector2u& size);
-
- ////////////////////////////////////////////////////////////
- /// \brief Load an image from a custom stream
- ///
- /// \param stream Source stream to read from
- /// \param pixels Array of pixels to fill with loaded image
- /// \param size Size of loaded image, in pixels
- ///
- /// \return True if loading was successful
- ///
- ////////////////////////////////////////////////////////////
- bool loadImageFromStream(InputStream& stream, std::vector<Uint8>& pixels, Vector2u& size);
-
- ////////////////////////////////////////////////////////////
- /// \bref Save an array of pixels as an image file
- ///
- /// \param filename Path of image file to save
- /// \param pixels Array of pixels to save to image
- /// \param size Size of image to save, in pixels
- ///
- /// \return True if saving was successful
- ///
- ////////////////////////////////////////////////////////////
- bool saveImageToFile(const std::string& filename, const std::vector<Uint8>& pixels, const Vector2u& size);
-
-private :
-
- ////////////////////////////////////////////////////////////
- /// \brief Default constructor
- ///
- ////////////////////////////////////////////////////////////
- ImageLoader();
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor
- ///
- ////////////////////////////////////////////////////////////
- ~ImageLoader();
-
- ////////////////////////////////////////////////////////////
- /// \brief Save an image file in JPEG format
- ///
- /// \param filename Path of image file to save
- /// \param pixels Array of pixels to save to image
- /// \param width Width of image to save, in pixels
- /// \param height Height of image to save, in pixels
- ///
- /// \return True if saving was successful
- ///
- ////////////////////////////////////////////////////////////
- bool writeJpg(const std::string& filename, const std::vector<Uint8>& pixels, unsigned int width, unsigned int height);
-};
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_IMAGELOADER_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_IMAGELOADER_HPP
+#define SFML_IMAGELOADER_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/NonCopyable.hpp>
+#include <SFML/System/Vector2.hpp>
+#include <string>
+#include <vector>
+
+
+namespace sf
+{
+class InputStream;
+
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Load/save image files
+///
+////////////////////////////////////////////////////////////
+class ImageLoader : NonCopyable
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the unique instance of the class
+ ///
+ /// \return Reference to the ImageLoader instance
+ ///
+ ////////////////////////////////////////////////////////////
+ static ImageLoader& getInstance();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Load an image from a file on disk
+ ///
+ /// \param filename Path of image file to load
+ /// \param pixels Array of pixels to fill with loaded image
+ /// \param size Size of loaded image, in pixels
+ ///
+ /// \return True if loading was successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool loadImageFromFile(const std::string& filename, std::vector<Uint8>& pixels, Vector2u& size);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Load an image from a file in memory
+ ///
+ /// \param data Pointer to the file data in memory
+ /// \param dataSize Size of the data to load, in bytes
+ /// \param pixels Array of pixels to fill with loaded image
+ /// \param size Size of loaded image, in pixels
+ ///
+ /// \return True if loading was successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool loadImageFromMemory(const void* data, std::size_t dataSize, std::vector<Uint8>& pixels, Vector2u& size);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Load an image from a custom stream
+ ///
+ /// \param stream Source stream to read from
+ /// \param pixels Array of pixels to fill with loaded image
+ /// \param size Size of loaded image, in pixels
+ ///
+ /// \return True if loading was successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool loadImageFromStream(InputStream& stream, std::vector<Uint8>& pixels, Vector2u& size);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Save an array of pixels as an image file
+ ///
+ /// \param filename Path of image file to save
+ /// \param pixels Array of pixels to save to image
+ /// \param size Size of image to save, in pixels
+ ///
+ /// \return True if saving was successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool saveImageToFile(const std::string& filename, const std::vector<Uint8>& pixels, const Vector2u& size);
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ImageLoader();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~ImageLoader();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Save an image file in JPEG format
+ ///
+ /// \param filename Path of image file to save
+ /// \param pixels Array of pixels to save to image
+ /// \param width Width of image to save, in pixels
+ /// \param height Height of image to save, in pixels
+ ///
+ /// \return True if saving was successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool writeJpg(const std::string& filename, const std::vector<Uint8>& pixels, unsigned int width, unsigned int height);
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_IMAGELOADER_HPP
diff --git a/src/SFML/Graphics/RectangleShape.cpp b/src/SFML/Graphics/RectangleShape.cpp
index 39154c0..be04abd 100644
--- a/src/SFML/Graphics/RectangleShape.cpp
+++ b/src/SFML/Graphics/RectangleShape.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
diff --git a/src/SFML/Graphics/RenderStates.cpp b/src/SFML/Graphics/RenderStates.cpp
index 95ca8c1..093d902 100644
--- a/src/SFML/Graphics/RenderStates.cpp
+++ b/src/SFML/Graphics/RenderStates.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -32,7 +32,11 @@
namespace sf
{
////////////////////////////////////////////////////////////
-const RenderStates RenderStates::Default;
+// We cannot use the default constructor here, because it accesses BlendAlpha, which is also global (and dynamically
+// initialized). Initialization order of global objects in different translation units is not defined.
+const RenderStates RenderStates::Default(BlendMode(
+ BlendMode::SrcAlpha, BlendMode::OneMinusSrcAlpha, BlendMode::Add,
+ BlendMode::One, BlendMode::OneMinusSrcAlpha, BlendMode::Add));
////////////////////////////////////////////////////////////
@@ -56,7 +60,7 @@ shader (NULL)
////////////////////////////////////////////////////////////
-RenderStates::RenderStates(BlendMode theBlendMode) :
+RenderStates::RenderStates(const BlendMode& theBlendMode) :
blendMode(theBlendMode),
transform(),
texture (NULL),
@@ -86,7 +90,7 @@ shader (theShader)
////////////////////////////////////////////////////////////
-RenderStates::RenderStates(BlendMode theBlendMode, const Transform& theTransform,
+RenderStates::RenderStates(const BlendMode& theBlendMode, const Transform& theTransform,
const Texture* theTexture, const Shader* theShader) :
blendMode(theBlendMode),
transform(theTransform),
diff --git a/src/SFML/Graphics/RenderTarget.cpp b/src/SFML/Graphics/RenderTarget.cpp
index a2316cf..cfc7ba6 100644
--- a/src/SFML/Graphics/RenderTarget.cpp
+++ b/src/SFML/Graphics/RenderTarget.cpp
@@ -1,455 +1,514 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Graphics/RenderTarget.hpp>
-#include <SFML/Graphics/Drawable.hpp>
-#include <SFML/Graphics/Shader.hpp>
-#include <SFML/Graphics/Texture.hpp>
-#include <SFML/Graphics/VertexArray.hpp>
-#include <SFML/Graphics/GLCheck.hpp>
-#include <SFML/System/Err.hpp>
-#include <iostream>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-RenderTarget::RenderTarget() :
-m_defaultView(),
-m_view (),
-m_cache ()
-{
- m_cache.glStatesSet = false;
-}
-
-
-////////////////////////////////////////////////////////////
-RenderTarget::~RenderTarget()
-{
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderTarget::clear(const Color& color)
-{
- if (activate(true))
- {
- glCheck(glClearColor(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f));
- glCheck(glClear(GL_COLOR_BUFFER_BIT));
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderTarget::setView(const View& view)
-{
- m_view = view;
- m_cache.viewChanged = true;
-}
-
-
-////////////////////////////////////////////////////////////
-const View& RenderTarget::getView() const
-{
- return m_view;
-}
-
-
-////////////////////////////////////////////////////////////
-const View& RenderTarget::getDefaultView() const
-{
- return m_defaultView;
-}
-
-
-////////////////////////////////////////////////////////////
-IntRect RenderTarget::getViewport(const View& view) const
-{
- float width = static_cast<float>(getSize().x);
- float height = static_cast<float>(getSize().y);
- const FloatRect& viewport = view.getViewport();
-
- return IntRect(static_cast<int>(0.5f + width * viewport.left),
- static_cast<int>(0.5f + height * viewport.top),
- static_cast<int>(width * viewport.width),
- static_cast<int>(height * viewport.height));
-}
-
-
-////////////////////////////////////////////////////////////
-Vector2f RenderTarget::mapPixelToCoords(const Vector2i& point) const
-{
- return mapPixelToCoords(point, getView());
-}
-
-
-////////////////////////////////////////////////////////////
-Vector2f RenderTarget::mapPixelToCoords(const Vector2i& point, const View& view) const
-{
- // First, convert from viewport coordinates to homogeneous coordinates
- Vector2f normalized;
- IntRect viewport = getViewport(view);
- normalized.x = -1.f + 2.f * (point.x - viewport.left) / viewport.width;
- normalized.y = 1.f - 2.f * (point.y - viewport.top) / viewport.height;
-
- // Then transform by the inverse of the view matrix
- return view.getInverseTransform().transformPoint(normalized);
-}
-
-////////////////////////////////////////////////////////////
-Vector2i RenderTarget::mapCoordsToPixel(const Vector2f& point) const
-{
- return mapCoordsToPixel(point, getView());
-}
-
-////////////////////////////////////////////////////////////
-Vector2i RenderTarget::mapCoordsToPixel(const Vector2f& point, const View& view) const
-{
- // First, transform the point by the view matrix
- Vector2f normalized = view.getTransform().transformPoint(point);
-
- // Then convert to viewport coordinates
- Vector2i pixel;
- IntRect viewport = getViewport(view);
- pixel.x = static_cast<int>(( normalized.x + 1.f) / 2.f * viewport.width + viewport.left);
- pixel.y = static_cast<int>((-normalized.y + 1.f) / 2.f * viewport.height + viewport.top);
-
- return pixel;
-}
-
-////////////////////////////////////////////////////////////
-void RenderTarget::draw(const Drawable& drawable, const RenderStates& states)
-{
- drawable.draw(*this, states);
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderTarget::draw(const Vertex* vertices, unsigned int vertexCount,
- PrimitiveType type, const RenderStates& states)
-{
- // Nothing to draw?
- if (!vertices || (vertexCount == 0))
- return;
-
- if (activate(true))
- {
- // First set the persistent OpenGL states if it's the very first call
- if (!m_cache.glStatesSet)
- resetGLStates();
-
- // Check if the vertex count is low enough so that we can pre-transform them
- bool useVertexCache = (vertexCount <= StatesCache::VertexCacheSize);
- if (useVertexCache)
- {
- // Pre-transform the vertices and store them into the vertex cache
- for (unsigned int i = 0; i < vertexCount; ++i)
- {
- Vertex& vertex = m_cache.vertexCache[i];
- vertex.position = states.transform * vertices[i].position;
- vertex.color = vertices[i].color;
- vertex.texCoords = vertices[i].texCoords;
- }
-
- // Since vertices are transformed, we must use an identity transform to render them
- if (!m_cache.useVertexCache)
- applyTransform(Transform::Identity);
- }
- else
- {
- applyTransform(states.transform);
- }
-
- // Apply the view
- if (m_cache.viewChanged)
- applyCurrentView();
-
- // Apply the blend mode
- if (states.blendMode != m_cache.lastBlendMode)
- applyBlendMode(states.blendMode);
-
- // Apply the texture
- Uint64 textureId = states.texture ? states.texture->m_cacheId : 0;
- if (textureId != m_cache.lastTextureId)
- applyTexture(states.texture);
-
- // Apply the shader
- if (states.shader)
- applyShader(states.shader);
-
- // If we pre-transform the vertices, we must use our internal vertex cache
- if (useVertexCache)
- {
- // ... and if we already used it previously, we don't need to set the pointers again
- if (!m_cache.useVertexCache)
- vertices = m_cache.vertexCache;
- else
- vertices = NULL;
- }
-
- // Setup the pointers to the vertices' components
- if (vertices)
- {
- const char* data = reinterpret_cast<const char*>(vertices);
- glCheck(glVertexPointer(2, GL_FLOAT, sizeof(Vertex), data + 0));
- glCheck(glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Vertex), data + 8));
- glCheck(glTexCoordPointer(2, GL_FLOAT, sizeof(Vertex), data + 12));
- }
-
- // Find the OpenGL primitive type
- static const GLenum modes[] = {GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_TRIANGLES,
- GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_QUADS};
- GLenum mode = modes[type];
-
- // Draw the primitives
- glCheck(glDrawArrays(mode, 0, vertexCount));
-
- // Unbind the shader, if any
- if (states.shader)
- applyShader(NULL);
-
- // Update the cache
- m_cache.useVertexCache = useVertexCache;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderTarget::pushGLStates()
-{
- if (activate(true))
- {
-#ifdef SFML_DEBUG
- // make sure that the user didn't leave an unchecked OpenGL error
- GLenum error = glGetError();
- if (error != GL_NO_ERROR)
- {
- err() << "OpenGL error (" << error << ") detected in user code, "
- << "you should check for errors with glGetError()"
- << std::endl;
- }
-#endif
-
- glCheck(glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS));
- glCheck(glPushAttrib(GL_ALL_ATTRIB_BITS));
- glCheck(glMatrixMode(GL_MODELVIEW));
- glCheck(glPushMatrix());
- glCheck(glMatrixMode(GL_PROJECTION));
- glCheck(glPushMatrix());
- glCheck(glMatrixMode(GL_TEXTURE));
- glCheck(glPushMatrix());
- }
-
- resetGLStates();
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderTarget::popGLStates()
-{
- if (activate(true))
- {
- glCheck(glMatrixMode(GL_PROJECTION));
- glCheck(glPopMatrix());
- glCheck(glMatrixMode(GL_MODELVIEW));
- glCheck(glPopMatrix());
- glCheck(glMatrixMode(GL_TEXTURE));
- glCheck(glPopMatrix());
- glCheck(glPopClientAttrib());
- glCheck(glPopAttrib());
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderTarget::resetGLStates()
-{
- if (activate(true))
- {
- // Make sure that GLEW is initialized
- priv::ensureGlewInit();
-
- // Define the default OpenGL states
- glCheck(glDisable(GL_CULL_FACE));
- glCheck(glDisable(GL_LIGHTING));
- glCheck(glDisable(GL_DEPTH_TEST));
- glCheck(glDisable(GL_ALPHA_TEST));
- glCheck(glEnable(GL_TEXTURE_2D));
- glCheck(glEnable(GL_BLEND));
- glCheck(glMatrixMode(GL_MODELVIEW));
- glCheck(glEnableClientState(GL_VERTEX_ARRAY));
- glCheck(glEnableClientState(GL_COLOR_ARRAY));
- glCheck(glEnableClientState(GL_TEXTURE_COORD_ARRAY));
- m_cache.glStatesSet = true;
-
- // Apply the default SFML states
- applyBlendMode(BlendAlpha);
- applyTransform(Transform::Identity);
- applyTexture(NULL);
- if (Shader::isAvailable())
- applyShader(NULL);
- m_cache.useVertexCache = false;
-
- // Set the default view
- setView(getView());
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderTarget::initialize()
-{
- // Setup the default and current views
- m_defaultView.reset(FloatRect(0, 0, static_cast<float>(getSize().x), static_cast<float>(getSize().y)));
- m_view = m_defaultView;
-
- // Set GL states only on first draw, so that we don't pollute user's states
- m_cache.glStatesSet = false;
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderTarget::applyCurrentView()
-{
- // Set the viewport
- IntRect viewport = getViewport(m_view);
- int top = getSize().y - (viewport.top + viewport.height);
- glCheck(glViewport(viewport.left, top, viewport.width, viewport.height));
-
- // Set the projection matrix
- glCheck(glMatrixMode(GL_PROJECTION));
- glCheck(glLoadMatrixf(m_view.getTransform().getMatrix()));
-
- // Go back to model-view mode
- glCheck(glMatrixMode(GL_MODELVIEW));
-
- m_cache.viewChanged = false;
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderTarget::applyBlendMode(BlendMode mode)
-{
- switch (mode)
- {
- // glBlendFuncSeparateEXT is used when available to avoid an incorrect alpha value when the target
- // is a RenderTexture -- in this case the alpha value must be written directly to the target buffer
-
- // Alpha blending
- default :
- case BlendAlpha :
- if (GLEW_EXT_blend_func_separate)
- glCheck(glBlendFuncSeparateEXT(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA));
- else
- glCheck(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
- break;
-
- // Additive blending
- case BlendAdd :
- if (GLEW_EXT_blend_func_separate)
- glCheck(glBlendFuncSeparateEXT(GL_SRC_ALPHA, GL_ONE, GL_ONE, GL_ONE));
- else
- glCheck(glBlendFunc(GL_SRC_ALPHA, GL_ONE));
- break;
-
- // Multiplicative blending
- case BlendMultiply :
- glCheck(glBlendFunc(GL_DST_COLOR, GL_ZERO));
- break;
-
- // No blending
- case BlendNone :
- glCheck(glBlendFunc(GL_ONE, GL_ZERO));
- break;
- }
-
- m_cache.lastBlendMode = mode;
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderTarget::applyTransform(const Transform& transform)
-{
- // No need to call glMatrixMode(GL_MODELVIEW), it is always the
- // current mode (for optimization purpose, since it's the most used)
- glCheck(glLoadMatrixf(transform.getMatrix()));
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderTarget::applyTexture(const Texture* texture)
-{
- Texture::bind(texture, Texture::Pixels);
-
- m_cache.lastTextureId = texture ? texture->m_cacheId : 0;
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderTarget::applyShader(const Shader* shader)
-{
- Shader::bind(shader);
-}
-
-} // namespace sf
-
-
-////////////////////////////////////////////////////////////
-// Render states caching strategies
-//
-// * View
-// If SetView was called since last draw, the projection
-// matrix is updated. We don't need more, the view doesn't
-// change frequently.
-//
-// * Transform
-// The transform matrix is usually expensive because each
-// entity will most likely use a different transform. This can
-// lead, in worst case, to changing it every 4 vertices.
-// To avoid that, when the vertex count is low enough, we
-// pre-transform them and therefore use an identity transform
-// to render them.
-//
-// * Blending mode
-// It's a simple integral value, so we can easily check
-// whether the value to apply is the same as before or not.
-//
-// * Texture
-// Storing the pointer or OpenGL ID of the last used texture
-// is not enough; if the sf::Texture instance is destroyed,
-// both the pointer and the OpenGL ID might be recycled in
-// a new texture instance. We need to use our own unique
-// identifier system to ensure consistent caching.
-//
-// * Shader
-// Shaders are very hard to optimize, because they have
-// parameters that can be hard (if not impossible) to track,
-// like matrices or textures. The only optimization that we
-// do is that we avoid setting a null shader if there was
-// already none for the previous draw.
-//
-////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/RenderTarget.hpp>
+#include <SFML/Graphics/Drawable.hpp>
+#include <SFML/Graphics/Shader.hpp>
+#include <SFML/Graphics/Texture.hpp>
+#include <SFML/Graphics/VertexArray.hpp>
+#include <SFML/Graphics/GLCheck.hpp>
+#include <SFML/System/Err.hpp>
+#include <iostream>
+
+
+namespace
+{
+ // Convert an sf::BlendMode::Factor constant to the corresponding OpenGL constant.
+ sf::Uint32 factorToGlConstant(sf::BlendMode::Factor blendFactor)
+ {
+ switch (blendFactor)
+ {
+ default:
+ case sf::BlendMode::Zero: return GL_ZERO;
+ case sf::BlendMode::One: return GL_ONE;
+ case sf::BlendMode::SrcColor: return GL_SRC_COLOR;
+ case sf::BlendMode::OneMinusSrcColor: return GL_ONE_MINUS_SRC_COLOR;
+ case sf::BlendMode::DstColor: return GL_DST_COLOR;
+ case sf::BlendMode::OneMinusDstColor: return GL_ONE_MINUS_DST_COLOR;
+ case sf::BlendMode::SrcAlpha: return GL_SRC_ALPHA;
+ case sf::BlendMode::OneMinusSrcAlpha: return GL_ONE_MINUS_SRC_ALPHA;
+ case sf::BlendMode::DstAlpha: return GL_DST_ALPHA;
+ case sf::BlendMode::OneMinusDstAlpha: return GL_ONE_MINUS_DST_ALPHA;
+ }
+ }
+
+
+ // Convert an sf::BlendMode::BlendEquation constant to the corresponding OpenGL constant.
+ sf::Uint32 equationToGlConstant(sf::BlendMode::Equation blendEquation)
+ {
+ switch (blendEquation)
+ {
+ default:
+ case sf::BlendMode::Add: return GLEXT_GL_FUNC_ADD;
+ case sf::BlendMode::Subtract: return GLEXT_GL_FUNC_SUBTRACT;
+ }
+ }
+}
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+RenderTarget::RenderTarget() :
+m_defaultView(),
+m_view (),
+m_cache ()
+{
+ m_cache.glStatesSet = false;
+}
+
+
+////////////////////////////////////////////////////////////
+RenderTarget::~RenderTarget()
+{
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderTarget::clear(const Color& color)
+{
+ if (activate(true))
+ {
+ // Unbind texture to fix RenderTexture preventing clear
+ applyTexture(NULL);
+
+ glCheck(glClearColor(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f));
+ glCheck(glClear(GL_COLOR_BUFFER_BIT));
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderTarget::setView(const View& view)
+{
+ m_view = view;
+ m_cache.viewChanged = true;
+}
+
+
+////////////////////////////////////////////////////////////
+const View& RenderTarget::getView() const
+{
+ return m_view;
+}
+
+
+////////////////////////////////////////////////////////////
+const View& RenderTarget::getDefaultView() const
+{
+ return m_defaultView;
+}
+
+
+////////////////////////////////////////////////////////////
+IntRect RenderTarget::getViewport(const View& view) const
+{
+ float width = static_cast<float>(getSize().x);
+ float height = static_cast<float>(getSize().y);
+ const FloatRect& viewport = view.getViewport();
+
+ return IntRect(static_cast<int>(0.5f + width * viewport.left),
+ static_cast<int>(0.5f + height * viewport.top),
+ static_cast<int>(0.5f + width * viewport.width),
+ static_cast<int>(0.5f + height * viewport.height));
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2f RenderTarget::mapPixelToCoords(const Vector2i& point) const
+{
+ return mapPixelToCoords(point, getView());
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2f RenderTarget::mapPixelToCoords(const Vector2i& point, const View& view) const
+{
+ // First, convert from viewport coordinates to homogeneous coordinates
+ Vector2f normalized;
+ IntRect viewport = getViewport(view);
+ normalized.x = -1.f + 2.f * (point.x - viewport.left) / viewport.width;
+ normalized.y = 1.f - 2.f * (point.y - viewport.top) / viewport.height;
+
+ // Then transform by the inverse of the view matrix
+ return view.getInverseTransform().transformPoint(normalized);
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i RenderTarget::mapCoordsToPixel(const Vector2f& point) const
+{
+ return mapCoordsToPixel(point, getView());
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i RenderTarget::mapCoordsToPixel(const Vector2f& point, const View& view) const
+{
+ // First, transform the point by the view matrix
+ Vector2f normalized = view.getTransform().transformPoint(point);
+
+ // Then convert to viewport coordinates
+ Vector2i pixel;
+ IntRect viewport = getViewport(view);
+ pixel.x = static_cast<int>(( normalized.x + 1.f) / 2.f * viewport.width + viewport.left);
+ pixel.y = static_cast<int>((-normalized.y + 1.f) / 2.f * viewport.height + viewport.top);
+
+ return pixel;
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderTarget::draw(const Drawable& drawable, const RenderStates& states)
+{
+ drawable.draw(*this, states);
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderTarget::draw(const Vertex* vertices, unsigned int vertexCount,
+ PrimitiveType type, const RenderStates& states)
+{
+ // Nothing to draw?
+ if (!vertices || (vertexCount == 0))
+ return;
+
+ // GL_QUADS is unavailable on OpenGL ES
+ #ifdef SFML_OPENGL_ES
+ if (type == Quads)
+ {
+ err() << "sf::Quads primitive type is not supported on OpenGL ES platforms, drawing skipped" << std::endl;
+ return;
+ }
+ #define GL_QUADS 0
+ #endif
+
+ if (activate(true))
+ {
+ // First set the persistent OpenGL states if it's the very first call
+ if (!m_cache.glStatesSet)
+ resetGLStates();
+
+ // Check if the vertex count is low enough so that we can pre-transform them
+ bool useVertexCache = (vertexCount <= StatesCache::VertexCacheSize);
+ if (useVertexCache)
+ {
+ // Pre-transform the vertices and store them into the vertex cache
+ for (unsigned int i = 0; i < vertexCount; ++i)
+ {
+ Vertex& vertex = m_cache.vertexCache[i];
+ vertex.position = states.transform * vertices[i].position;
+ vertex.color = vertices[i].color;
+ vertex.texCoords = vertices[i].texCoords;
+ }
+
+ // Since vertices are transformed, we must use an identity transform to render them
+ if (!m_cache.useVertexCache)
+ applyTransform(Transform::Identity);
+ }
+ else
+ {
+ applyTransform(states.transform);
+ }
+
+ // Apply the view
+ if (m_cache.viewChanged)
+ applyCurrentView();
+
+ // Apply the blend mode
+ if (states.blendMode != m_cache.lastBlendMode)
+ applyBlendMode(states.blendMode);
+
+ // Apply the texture
+ Uint64 textureId = states.texture ? states.texture->m_cacheId : 0;
+ if (textureId != m_cache.lastTextureId)
+ applyTexture(states.texture);
+
+ // Apply the shader
+ if (states.shader)
+ applyShader(states.shader);
+
+ // If we pre-transform the vertices, we must use our internal vertex cache
+ if (useVertexCache)
+ {
+ // ... and if we already used it previously, we don't need to set the pointers again
+ if (!m_cache.useVertexCache)
+ vertices = m_cache.vertexCache;
+ else
+ vertices = NULL;
+ }
+
+ // Setup the pointers to the vertices' components
+ if (vertices)
+ {
+ const char* data = reinterpret_cast<const char*>(vertices);
+ glCheck(glVertexPointer(2, GL_FLOAT, sizeof(Vertex), data + 0));
+ glCheck(glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Vertex), data + 8));
+ glCheck(glTexCoordPointer(2, GL_FLOAT, sizeof(Vertex), data + 12));
+ }
+
+ // Find the OpenGL primitive type
+ static const GLenum modes[] = {GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_TRIANGLES,
+ GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_QUADS};
+ GLenum mode = modes[type];
+
+ // Draw the primitives
+ glCheck(glDrawArrays(mode, 0, vertexCount));
+
+ // Unbind the shader, if any
+ if (states.shader)
+ applyShader(NULL);
+
+ // Update the cache
+ m_cache.useVertexCache = useVertexCache;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderTarget::pushGLStates()
+{
+ if (activate(true))
+ {
+ #ifdef SFML_DEBUG
+ // make sure that the user didn't leave an unchecked OpenGL error
+ GLenum error = glGetError();
+ if (error != GL_NO_ERROR)
+ {
+ err() << "OpenGL error (" << error << ") detected in user code, "
+ << "you should check for errors with glGetError()"
+ << std::endl;
+ }
+ #endif
+
+ #ifndef SFML_OPENGL_ES
+ glCheck(glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS));
+ glCheck(glPushAttrib(GL_ALL_ATTRIB_BITS));
+ #endif
+ glCheck(glMatrixMode(GL_MODELVIEW));
+ glCheck(glPushMatrix());
+ glCheck(glMatrixMode(GL_PROJECTION));
+ glCheck(glPushMatrix());
+ glCheck(glMatrixMode(GL_TEXTURE));
+ glCheck(glPushMatrix());
+ }
+
+ resetGLStates();
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderTarget::popGLStates()
+{
+ if (activate(true))
+ {
+ glCheck(glMatrixMode(GL_PROJECTION));
+ glCheck(glPopMatrix());
+ glCheck(glMatrixMode(GL_MODELVIEW));
+ glCheck(glPopMatrix());
+ glCheck(glMatrixMode(GL_TEXTURE));
+ glCheck(glPopMatrix());
+ #ifndef SFML_OPENGL_ES
+ glCheck(glPopClientAttrib());
+ glCheck(glPopAttrib());
+ #endif
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderTarget::resetGLStates()
+{
+ // Check here to make sure a context change does not happen after activate(true)
+ bool shaderAvailable = Shader::isAvailable();
+
+ if (activate(true))
+ {
+ // Make sure that extensions are initialized
+ priv::ensureExtensionsInit();
+
+ // Make sure that the texture unit which is active is the number 0
+ if (GLEXT_multitexture)
+ {
+ glCheck(GLEXT_glClientActiveTexture(GLEXT_GL_TEXTURE0));
+ glCheck(GLEXT_glActiveTexture(GLEXT_GL_TEXTURE0));
+ }
+
+ // Define the default OpenGL states
+ glCheck(glDisable(GL_CULL_FACE));
+ glCheck(glDisable(GL_LIGHTING));
+ glCheck(glDisable(GL_DEPTH_TEST));
+ glCheck(glDisable(GL_ALPHA_TEST));
+ glCheck(glEnable(GL_TEXTURE_2D));
+ glCheck(glEnable(GL_BLEND));
+ glCheck(glMatrixMode(GL_MODELVIEW));
+ glCheck(glEnableClientState(GL_VERTEX_ARRAY));
+ glCheck(glEnableClientState(GL_COLOR_ARRAY));
+ glCheck(glEnableClientState(GL_TEXTURE_COORD_ARRAY));
+ m_cache.glStatesSet = true;
+
+ // Apply the default SFML states
+ applyBlendMode(BlendAlpha);
+ applyTransform(Transform::Identity);
+ applyTexture(NULL);
+ if (shaderAvailable)
+ applyShader(NULL);
+
+ m_cache.useVertexCache = false;
+
+ // Set the default view
+ setView(getView());
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderTarget::initialize()
+{
+ // Setup the default and current views
+ m_defaultView.reset(FloatRect(0, 0, static_cast<float>(getSize().x), static_cast<float>(getSize().y)));
+ m_view = m_defaultView;
+
+ // Set GL states only on first draw, so that we don't pollute user's states
+ m_cache.glStatesSet = false;
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderTarget::applyCurrentView()
+{
+ // Set the viewport
+ IntRect viewport = getViewport(m_view);
+ int top = getSize().y - (viewport.top + viewport.height);
+ glCheck(glViewport(viewport.left, top, viewport.width, viewport.height));
+
+ // Set the projection matrix
+ glCheck(glMatrixMode(GL_PROJECTION));
+ glCheck(glLoadMatrixf(m_view.getTransform().getMatrix()));
+
+ // Go back to model-view mode
+ glCheck(glMatrixMode(GL_MODELVIEW));
+
+ m_cache.viewChanged = false;
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderTarget::applyBlendMode(const BlendMode& mode)
+{
+ // Apply the blend mode, falling back to the non-separate versions if necessary
+ if (GLEXT_blend_func_separate)
+ {
+ glCheck(GLEXT_glBlendFuncSeparate(
+ factorToGlConstant(mode.colorSrcFactor), factorToGlConstant(mode.colorDstFactor),
+ factorToGlConstant(mode.alphaSrcFactor), factorToGlConstant(mode.alphaDstFactor)));
+ }
+ else
+ {
+ glCheck(glBlendFunc(
+ factorToGlConstant(mode.colorSrcFactor),
+ factorToGlConstant(mode.colorDstFactor)));
+ }
+
+ if (GLEXT_blend_equation_separate)
+ {
+ glCheck(GLEXT_glBlendEquationSeparate(
+ equationToGlConstant(mode.colorEquation),
+ equationToGlConstant(mode.alphaEquation)));
+ }
+ else
+ {
+ glCheck(GLEXT_glBlendEquation(equationToGlConstant(mode.colorEquation)));
+ }
+
+ m_cache.lastBlendMode = mode;
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderTarget::applyTransform(const Transform& transform)
+{
+ // No need to call glMatrixMode(GL_MODELVIEW), it is always the
+ // current mode (for optimization purpose, since it's the most used)
+ glCheck(glLoadMatrixf(transform.getMatrix()));
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderTarget::applyTexture(const Texture* texture)
+{
+ Texture::bind(texture, Texture::Pixels);
+
+ m_cache.lastTextureId = texture ? texture->m_cacheId : 0;
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderTarget::applyShader(const Shader* shader)
+{
+ Shader::bind(shader);
+}
+
+} // namespace sf
+
+
+////////////////////////////////////////////////////////////
+// Render states caching strategies
+//
+// * View
+// If SetView was called since last draw, the projection
+// matrix is updated. We don't need more, the view doesn't
+// change frequently.
+//
+// * Transform
+// The transform matrix is usually expensive because each
+// entity will most likely use a different transform. This can
+// lead, in worst case, to changing it every 4 vertices.
+// To avoid that, when the vertex count is low enough, we
+// pre-transform them and therefore use an identity transform
+// to render them.
+//
+// * Blending mode
+// Since it overloads the == operator, we can easily check
+// whether any of the 6 blending components changed and,
+// thus, whether we need to update the blend mode.
+//
+// * Texture
+// Storing the pointer or OpenGL ID of the last used texture
+// is not enough; if the sf::Texture instance is destroyed,
+// both the pointer and the OpenGL ID might be recycled in
+// a new texture instance. We need to use our own unique
+// identifier system to ensure consistent caching.
+//
+// * Shader
+// Shaders are very hard to optimize, because they have
+// parameters that can be hard (if not impossible) to track,
+// like matrices or textures. The only optimization that we
+// do is that we avoid setting a null shader if there was
+// already none for the previous draw.
+//
+////////////////////////////////////////////////////////////
diff --git a/src/SFML/Graphics/RenderTexture.cpp b/src/SFML/Graphics/RenderTexture.cpp
index 845b0b6..e3669e3 100644
--- a/src/SFML/Graphics/RenderTexture.cpp
+++ b/src/SFML/Graphics/RenderTexture.cpp
@@ -1,155 +1,155 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Graphics/RenderTexture.hpp>
-#include <SFML/Graphics/RenderTextureImplFBO.hpp>
-#include <SFML/Graphics/RenderTextureImplDefault.hpp>
-#include <SFML/System/Err.hpp>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-RenderTexture::RenderTexture() :
-m_impl(NULL)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-RenderTexture::~RenderTexture()
-{
- delete m_impl;
-}
-
-
-////////////////////////////////////////////////////////////
-bool RenderTexture::create(unsigned int width, unsigned int height, bool depthBuffer)
-{
- // Create the texture
- if (!m_texture.create(width, height))
- {
- err() << "Impossible to create render texture (failed to create the target texture)" << std::endl;
- return false;
- }
-
- // We disable smoothing by default for render textures
- setSmooth(false);
-
- // Create the implementation
- delete m_impl;
- if (priv::RenderTextureImplFBO::isAvailable())
- {
- // Use frame-buffer object (FBO)
- m_impl = new priv::RenderTextureImplFBO;
- }
- else
- {
- // Use default implementation
- m_impl = new priv::RenderTextureImplDefault;
- }
-
- // Initialize the render texture
- if (!m_impl->create(width, height, m_texture.m_texture, depthBuffer))
- return false;
-
- // We can now initialize the render target part
- RenderTarget::initialize();
-
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderTexture::setSmooth(bool smooth)
-{
- m_texture.setSmooth(smooth);
-}
-
-
-////////////////////////////////////////////////////////////
-bool RenderTexture::isSmooth() const
-{
- return m_texture.isSmooth();
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderTexture::setRepeated(bool repeated)
-{
- m_texture.setRepeated(repeated);
-}
-
-
-////////////////////////////////////////////////////////////
-bool RenderTexture::isRepeated() const
-{
- return m_texture.isRepeated();
-}
-
-
-////////////////////////////////////////////////////////////
-bool RenderTexture::setActive(bool active)
-{
- return m_impl && m_impl->activate(active);
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderTexture::display()
-{
- // Update the target texture
- if (setActive(true))
- {
- m_impl->updateTexture(m_texture.m_texture);
- m_texture.m_pixelsFlipped = true;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-Vector2u RenderTexture::getSize() const
-{
- return m_texture.getSize();
-}
-
-
-////////////////////////////////////////////////////////////
-const Texture& RenderTexture::getTexture() const
-{
- return m_texture;
-}
-
-
-////////////////////////////////////////////////////////////
-bool RenderTexture::activate(bool active)
-{
- return setActive(active);
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/RenderTexture.hpp>
+#include <SFML/Graphics/RenderTextureImplFBO.hpp>
+#include <SFML/Graphics/RenderTextureImplDefault.hpp>
+#include <SFML/System/Err.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+RenderTexture::RenderTexture() :
+m_impl(NULL)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+RenderTexture::~RenderTexture()
+{
+ delete m_impl;
+}
+
+
+////////////////////////////////////////////////////////////
+bool RenderTexture::create(unsigned int width, unsigned int height, bool depthBuffer)
+{
+ // Create the texture
+ if (!m_texture.create(width, height))
+ {
+ err() << "Impossible to create render texture (failed to create the target texture)" << std::endl;
+ return false;
+ }
+
+ // We disable smoothing by default for render textures
+ setSmooth(false);
+
+ // Create the implementation
+ delete m_impl;
+ if (priv::RenderTextureImplFBO::isAvailable())
+ {
+ // Use frame-buffer object (FBO)
+ m_impl = new priv::RenderTextureImplFBO;
+ }
+ else
+ {
+ // Use default implementation
+ m_impl = new priv::RenderTextureImplDefault;
+ }
+
+ // Initialize the render texture
+ if (!m_impl->create(width, height, m_texture.m_texture, depthBuffer))
+ return false;
+
+ // We can now initialize the render target part
+ RenderTarget::initialize();
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderTexture::setSmooth(bool smooth)
+{
+ m_texture.setSmooth(smooth);
+}
+
+
+////////////////////////////////////////////////////////////
+bool RenderTexture::isSmooth() const
+{
+ return m_texture.isSmooth();
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderTexture::setRepeated(bool repeated)
+{
+ m_texture.setRepeated(repeated);
+}
+
+
+////////////////////////////////////////////////////////////
+bool RenderTexture::isRepeated() const
+{
+ return m_texture.isRepeated();
+}
+
+
+////////////////////////////////////////////////////////////
+bool RenderTexture::setActive(bool active)
+{
+ return m_impl && m_impl->activate(active);
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderTexture::display()
+{
+ // Update the target texture
+ if (setActive(true))
+ {
+ m_impl->updateTexture(m_texture.m_texture);
+ m_texture.m_pixelsFlipped = true;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2u RenderTexture::getSize() const
+{
+ return m_texture.getSize();
+}
+
+
+////////////////////////////////////////////////////////////
+const Texture& RenderTexture::getTexture() const
+{
+ return m_texture;
+}
+
+
+////////////////////////////////////////////////////////////
+bool RenderTexture::activate(bool active)
+{
+ return setActive(active);
+}
+
+} // namespace sf
diff --git a/src/SFML/Graphics/RenderTextureImpl.cpp b/src/SFML/Graphics/RenderTextureImpl.cpp
index cf26dbe..d57c03b 100644
--- a/src/SFML/Graphics/RenderTextureImpl.cpp
+++ b/src/SFML/Graphics/RenderTextureImpl.cpp
@@ -1,43 +1,43 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Graphics/RenderTextureImpl.hpp>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-RenderTextureImpl::~RenderTextureImpl()
-{
- // Nothing to do
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/RenderTextureImpl.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+RenderTextureImpl::~RenderTextureImpl()
+{
+ // Nothing to do
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Graphics/RenderTextureImpl.hpp b/src/SFML/Graphics/RenderTextureImpl.hpp
index f9402c4..dec8152 100644
--- a/src/SFML/Graphics/RenderTextureImpl.hpp
+++ b/src/SFML/Graphics/RenderTextureImpl.hpp
@@ -1,89 +1,89 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_RENDERTEXTUREIMPL_HPP
-#define SFML_RENDERTEXTUREIMPL_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/NonCopyable.hpp>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief Abstract base class for render-texture implementations
-///
-////////////////////////////////////////////////////////////
-class RenderTextureImpl : NonCopyable
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor
- ///
- ////////////////////////////////////////////////////////////
- virtual ~RenderTextureImpl();
-
- ////////////////////////////////////////////////////////////
- /// \brief Create the render texture implementation
- ///
- /// \param width Width of the texture to render to
- /// \param height Height of the texture to render to
- /// \param textureId OpenGL identifier of the target texture
- /// \param depthBuffer Is a depth buffer requested?
- ///
- /// \return True if creation has been successful
- ///
- ////////////////////////////////////////////////////////////
- virtual bool create(unsigned int width, unsigned int height, unsigned int textureId, bool depthBuffer) = 0;
-
- ////////////////////////////////////////////////////////////
- /// \brief Activate or deactivate the render texture for rendering
- ///
- /// \param active True to activate, false to deactivate
- ///
- /// \return True on success, false on failure
- ///
- ////////////////////////////////////////////////////////////
- virtual bool activate(bool active) = 0;
-
- ////////////////////////////////////////////////////////////
- /// \brief Update the pixels of the target texture
- ///
- /// \param textureId OpenGL identifier of the target texture
- ///
- ////////////////////////////////////////////////////////////
- virtual void updateTexture(unsigned int textureId) = 0;
-};
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_RENDERTEXTUREIMPL_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_RENDERTEXTUREIMPL_HPP
+#define SFML_RENDERTEXTUREIMPL_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/NonCopyable.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Abstract base class for render-texture implementations
+///
+////////////////////////////////////////////////////////////
+class RenderTextureImpl : NonCopyable
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~RenderTextureImpl();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create the render texture implementation
+ ///
+ /// \param width Width of the texture to render to
+ /// \param height Height of the texture to render to
+ /// \param textureId OpenGL identifier of the target texture
+ /// \param depthBuffer Is a depth buffer requested?
+ ///
+ /// \return True if creation has been successful
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool create(unsigned int width, unsigned int height, unsigned int textureId, bool depthBuffer) = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Activate or deactivate the render texture for rendering
+ ///
+ /// \param active True to activate, false to deactivate
+ ///
+ /// \return True on success, false on failure
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool activate(bool active) = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Update the pixels of the target texture
+ ///
+ /// \param textureId OpenGL identifier of the target texture
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void updateTexture(unsigned int textureId) = 0;
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_RENDERTEXTUREIMPL_HPP
diff --git a/src/SFML/Graphics/RenderTextureImplDefault.cpp b/src/SFML/Graphics/RenderTextureImplDefault.cpp
index aeb6dc0..80a15cc 100644
--- a/src/SFML/Graphics/RenderTextureImplDefault.cpp
+++ b/src/SFML/Graphics/RenderTextureImplDefault.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
diff --git a/src/SFML/Graphics/RenderTextureImplDefault.hpp b/src/SFML/Graphics/RenderTextureImplDefault.hpp
index 8e321f6..c801fe1 100644
--- a/src/SFML/Graphics/RenderTextureImplDefault.hpp
+++ b/src/SFML/Graphics/RenderTextureImplDefault.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -39,12 +39,12 @@ namespace priv
{
////////////////////////////////////////////////////////////
/// \brief Default specialization of RenderTextureImpl,
-/// using a in-memory context
+/// using an in-memory context
///
////////////////////////////////////////////////////////////
class RenderTextureImplDefault : public RenderTextureImpl, GlResource
{
-public :
+public:
////////////////////////////////////////////////////////////
/// \brief Default constructor
@@ -58,7 +58,7 @@ public :
////////////////////////////////////////////////////////////
~RenderTextureImplDefault();
-private :
+private:
////////////////////////////////////////////////////////////
/// \brief Create the render texture implementation
diff --git a/src/SFML/Graphics/RenderTextureImplFBO.cpp b/src/SFML/Graphics/RenderTextureImplFBO.cpp
index 0e92e0e..dca0240 100644
--- a/src/SFML/Graphics/RenderTextureImplFBO.cpp
+++ b/src/SFML/Graphics/RenderTextureImplFBO.cpp
@@ -1,146 +1,147 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Graphics/RenderTextureImplFBO.hpp>
-#include <SFML/Graphics/Texture.hpp>
-#include <SFML/Graphics/GLCheck.hpp>
-#include <SFML/System/Err.hpp>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-RenderTextureImplFBO::RenderTextureImplFBO() :
-m_frameBuffer(0),
-m_depthBuffer(0)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-RenderTextureImplFBO::~RenderTextureImplFBO()
-{
- ensureGlContext();
-
- // Destroy the depth buffer
- if (m_depthBuffer)
- {
- GLuint depthBuffer = static_cast<GLuint>(m_depthBuffer);
- glCheck(glDeleteRenderbuffersEXT(1, &depthBuffer));
- }
-
- // Destroy the frame buffer
- if (m_frameBuffer)
- {
- GLuint frameBuffer = static_cast<GLuint>(m_frameBuffer);
- glCheck(glDeleteFramebuffersEXT(1, &frameBuffer));
- }
-
- // Delete the context
- delete m_context;
-}
-
-
-////////////////////////////////////////////////////////////
-bool RenderTextureImplFBO::isAvailable()
-{
- ensureGlContext();
-
- // Make sure that GLEW is initialized
- priv::ensureGlewInit();
-
- return GLEW_EXT_framebuffer_object != 0;
-}
-
-
-////////////////////////////////////////////////////////////
-bool RenderTextureImplFBO::create(unsigned int width, unsigned int height, unsigned int textureId, bool depthBuffer)
-{
- // Create the context
- m_context = new Context;
-
- // Create the framebuffer object
- GLuint frameBuffer = 0;
- glCheck(glGenFramebuffersEXT(1, &frameBuffer));
- m_frameBuffer = static_cast<unsigned int>(frameBuffer);
- if (!m_frameBuffer)
- {
- err() << "Impossible to create render texture (failed to create the frame buffer object)" << std::endl;
- return false;
- }
- glCheck(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_frameBuffer));
-
- // Create the depth buffer if requested
- if (depthBuffer)
- {
- GLuint depth = 0;
- glCheck(glGenRenderbuffersEXT(1, &depth));
- m_depthBuffer = static_cast<unsigned int>(depth);
- if (!m_depthBuffer)
- {
- err() << "Impossible to create render texture (failed to create the attached depth buffer)" << std::endl;
- return false;
- }
- glCheck(glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_depthBuffer));
- glCheck(glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, width, height));
- glCheck(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_depthBuffer));
- }
-
- // Link the texture to the frame buffer
- glCheck(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, textureId, 0));
-
- // A final check, just to be sure...
- if (glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) != GL_FRAMEBUFFER_COMPLETE_EXT)
- {
- glCheck(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0));
- err() << "Impossible to create render texture (failed to link the target texture to the frame buffer)" << std::endl;
- return false;
- }
-
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-bool RenderTextureImplFBO::activate(bool active)
-{
- return m_context->setActive(active);
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderTextureImplFBO::updateTexture(unsigned int)
-{
- glFlush();
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/RenderTextureImplFBO.hpp>
+#include <SFML/Graphics/Texture.hpp>
+#include <SFML/Graphics/GLCheck.hpp>
+#include <SFML/System/Err.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+RenderTextureImplFBO::RenderTextureImplFBO() :
+m_frameBuffer(0),
+m_depthBuffer(0)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+RenderTextureImplFBO::~RenderTextureImplFBO()
+{
+ ensureGlContext();
+
+ // Destroy the depth buffer
+ if (m_depthBuffer)
+ {
+ GLuint depthBuffer = static_cast<GLuint>(m_depthBuffer);
+ glCheck(GLEXT_glDeleteRenderbuffers(1, &depthBuffer));
+ }
+
+ // Destroy the frame buffer
+ if (m_frameBuffer)
+ {
+ GLuint frameBuffer = static_cast<GLuint>(m_frameBuffer);
+ glCheck(GLEXT_glDeleteFramebuffers(1, &frameBuffer));
+ }
+
+ // Delete the context
+ delete m_context;
+}
+
+
+////////////////////////////////////////////////////////////
+bool RenderTextureImplFBO::isAvailable()
+{
+ ensureGlContext();
+
+ // Make sure that extensions are initialized
+ priv::ensureExtensionsInit();
+
+ return GLEXT_framebuffer_object != 0;
+}
+
+
+////////////////////////////////////////////////////////////
+bool RenderTextureImplFBO::create(unsigned int width, unsigned int height, unsigned int textureId, bool depthBuffer)
+{
+ // Create the context
+ m_context = new Context;
+
+ // Create the framebuffer object
+ GLuint frameBuffer = 0;
+ glCheck(GLEXT_glGenFramebuffers(1, &frameBuffer));
+ m_frameBuffer = static_cast<unsigned int>(frameBuffer);
+ if (!m_frameBuffer)
+ {
+ err() << "Impossible to create render texture (failed to create the frame buffer object)" << std::endl;
+ return false;
+ }
+ glCheck(GLEXT_glBindFramebuffer(GLEXT_GL_FRAMEBUFFER, m_frameBuffer));
+
+ // Create the depth buffer if requested
+ if (depthBuffer)
+ {
+ GLuint depth = 0;
+ glCheck(GLEXT_glGenRenderbuffers(1, &depth));
+ m_depthBuffer = static_cast<unsigned int>(depth);
+ if (!m_depthBuffer)
+ {
+ err() << "Impossible to create render texture (failed to create the attached depth buffer)" << std::endl;
+ return false;
+ }
+ glCheck(GLEXT_glBindRenderbuffer(GLEXT_GL_RENDERBUFFER, m_depthBuffer));
+ glCheck(GLEXT_glRenderbufferStorage(GLEXT_GL_RENDERBUFFER, GLEXT_GL_DEPTH_COMPONENT, width, height));
+ glCheck(GLEXT_glFramebufferRenderbuffer(GLEXT_GL_FRAMEBUFFER, GLEXT_GL_DEPTH_ATTACHMENT, GLEXT_GL_RENDERBUFFER, m_depthBuffer));
+ }
+
+ // Link the texture to the frame buffer
+ glCheck(GLEXT_glFramebufferTexture2D(GLEXT_GL_FRAMEBUFFER, GLEXT_GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureId, 0));
+
+ // A final check, just to be sure...
+ GLenum status = glCheck(GLEXT_glCheckFramebufferStatus(GLEXT_GL_FRAMEBUFFER));
+ if (status != GLEXT_GL_FRAMEBUFFER_COMPLETE)
+ {
+ glCheck(GLEXT_glBindFramebuffer(GLEXT_GL_FRAMEBUFFER, 0));
+ err() << "Impossible to create render texture (failed to link the target texture to the frame buffer)" << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+bool RenderTextureImplFBO::activate(bool active)
+{
+ return m_context->setActive(active);
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderTextureImplFBO::updateTexture(unsigned int)
+{
+ glCheck(glFlush());
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Graphics/RenderTextureImplFBO.hpp b/src/SFML/Graphics/RenderTextureImplFBO.hpp
index 200a834..831876c 100644
--- a/src/SFML/Graphics/RenderTextureImplFBO.hpp
+++ b/src/SFML/Graphics/RenderTextureImplFBO.hpp
@@ -1,115 +1,115 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_RENDERTEXTUREIMPLFBO_HPP
-#define SFML_RENDERTEXTUREIMPLFBO_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Graphics/RenderTextureImpl.hpp>
-#include <SFML/Window/Context.hpp>
-#include <SFML/Window/GlResource.hpp>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief Specialization of RenderTextureImpl using the
-/// FrameBuffer Object OpenGL extension
-///
-////////////////////////////////////////////////////////////
-class RenderTextureImplFBO : public RenderTextureImpl, GlResource
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Default constructor
- ///
- ////////////////////////////////////////////////////////////
- RenderTextureImplFBO();
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor
- ///
- ////////////////////////////////////////////////////////////
- ~RenderTextureImplFBO();
-
- ////////////////////////////////////////////////////////////
- /// \brief Check whether the system supports FBOs or not
- ///
- /// \return True if FBO render textures are supported
- ///
- ////////////////////////////////////////////////////////////
- static bool isAvailable();
-
-private :
-
- ////////////////////////////////////////////////////////////
- /// \brief Create the render texture implementation
- ///
- /// \param width Width of the texture to render to
- /// \param height Height of the texture to render to
- /// \param textureId OpenGL identifier of the target texture
- /// \param depthBuffer Is a depth buffer requested?
- ///
- /// \return True if creation has been successful
- ///
- ////////////////////////////////////////////////////////////
- virtual bool create(unsigned int width, unsigned int height, unsigned int textureId, bool depthBuffer);
-
- ////////////////////////////////////////////////////////////
- /// \brief Activate or deactivate the render texture for rendering
- ///
- /// \param active True to activate, false to deactivate
- ///
- /// \return True on success, false on failure
- ///
- ////////////////////////////////////////////////////////////
- virtual bool activate(bool active);
-
- ////////////////////////////////////////////////////////////
- /// \brief Update the pixels of the target texture
- ///
- /// \param textureId OpenGL identifier of the target texture
- ///
- ////////////////////////////////////////////////////////////
- virtual void updateTexture(unsigned textureId);
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- Context* m_context; ///< Needs a separate OpenGL context for not messing up the other ones
- unsigned int m_frameBuffer; ///< OpenGL frame buffer object
- unsigned int m_depthBuffer; ///< Optional depth buffer attached to the frame buffer
-};
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_RENDERTEXTUREIMPLFBO_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_RENDERTEXTUREIMPLFBO_HPP
+#define SFML_RENDERTEXTUREIMPLFBO_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/RenderTextureImpl.hpp>
+#include <SFML/Window/Context.hpp>
+#include <SFML/Window/GlResource.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Specialization of RenderTextureImpl using the
+/// FrameBuffer Object OpenGL extension
+///
+////////////////////////////////////////////////////////////
+class RenderTextureImplFBO : public RenderTextureImpl, GlResource
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ RenderTextureImplFBO();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~RenderTextureImplFBO();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check whether the system supports FBOs or not
+ ///
+ /// \return True if FBO render textures are supported
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isAvailable();
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create the render texture implementation
+ ///
+ /// \param width Width of the texture to render to
+ /// \param height Height of the texture to render to
+ /// \param textureId OpenGL identifier of the target texture
+ /// \param depthBuffer Is a depth buffer requested?
+ ///
+ /// \return True if creation has been successful
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool create(unsigned int width, unsigned int height, unsigned int textureId, bool depthBuffer);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Activate or deactivate the render texture for rendering
+ ///
+ /// \param active True to activate, false to deactivate
+ ///
+ /// \return True on success, false on failure
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool activate(bool active);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Update the pixels of the target texture
+ ///
+ /// \param textureId OpenGL identifier of the target texture
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void updateTexture(unsigned textureId);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ Context* m_context; ///< Needs a separate OpenGL context for not messing up the other ones
+ unsigned int m_frameBuffer; ///< OpenGL frame buffer object
+ unsigned int m_depthBuffer; ///< Optional depth buffer attached to the frame buffer
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_RENDERTEXTUREIMPLFBO_HPP
diff --git a/src/SFML/Graphics/RenderWindow.cpp b/src/SFML/Graphics/RenderWindow.cpp
index de9babf..ac7ce7d 100644
--- a/src/SFML/Graphics/RenderWindow.cpp
+++ b/src/SFML/Graphics/RenderWindow.cpp
@@ -1,117 +1,117 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Graphics/RenderWindow.hpp>
-#include <SFML/Graphics/GLCheck.hpp>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-RenderWindow::RenderWindow()
-{
- // Nothing to do
-}
-
-
-////////////////////////////////////////////////////////////
-RenderWindow::RenderWindow(VideoMode mode, const String& title, Uint32 style, const ContextSettings& settings)
-{
- // Don't call the base class constructor because it contains virtual function calls
- create(mode, title, style, settings);
-}
-
-
-////////////////////////////////////////////////////////////
-RenderWindow::RenderWindow(WindowHandle handle, const ContextSettings& settings)
-{
- // Don't call the base class constructor because it contains virtual function calls
- create(handle, settings);
-}
-
-
-////////////////////////////////////////////////////////////
-RenderWindow::~RenderWindow()
-{
- // Nothing to do
-}
-
-
-////////////////////////////////////////////////////////////
-bool RenderWindow::activate(bool active)
-{
- return setActive(active);
-}
-
-
-////////////////////////////////////////////////////////////
-Vector2u RenderWindow::getSize() const
-{
- return Window::getSize();
-}
-
-
-////////////////////////////////////////////////////////////
-Image RenderWindow::capture() const
-{
- Image image;
- if (setActive())
- {
- int width = static_cast<int>(getSize().x);
- int height = static_cast<int>(getSize().y);
-
- // copy rows one by one and flip them (OpenGL's origin is bottom while SFML's origin is top)
- std::vector<Uint8> pixels(width * height * 4);
- for (int i = 0; i < height; ++i)
- {
- Uint8* ptr = &pixels[i * width * 4];
- glCheck(glReadPixels(0, height - i - 1, width, 1, GL_RGBA, GL_UNSIGNED_BYTE, ptr));
- }
-
- image.create(width, height, &pixels[0]);
- }
-
- return image;
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderWindow::onCreate()
-{
- // Just initialize the render target part
- RenderTarget::initialize();
-}
-
-
-////////////////////////////////////////////////////////////
-void RenderWindow::onResize()
-{
- // Update the current view (recompute the viewport, which is stored in relative coordinates)
- setView(getView());
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/RenderWindow.hpp>
+#include <SFML/Graphics/GLCheck.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+RenderWindow::RenderWindow()
+{
+ // Nothing to do
+}
+
+
+////////////////////////////////////////////////////////////
+RenderWindow::RenderWindow(VideoMode mode, const String& title, Uint32 style, const ContextSettings& settings)
+{
+ // Don't call the base class constructor because it contains virtual function calls
+ create(mode, title, style, settings);
+}
+
+
+////////////////////////////////////////////////////////////
+RenderWindow::RenderWindow(WindowHandle handle, const ContextSettings& settings)
+{
+ // Don't call the base class constructor because it contains virtual function calls
+ create(handle, settings);
+}
+
+
+////////////////////////////////////////////////////////////
+RenderWindow::~RenderWindow()
+{
+ // Nothing to do
+}
+
+
+////////////////////////////////////////////////////////////
+bool RenderWindow::activate(bool active)
+{
+ return setActive(active);
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2u RenderWindow::getSize() const
+{
+ return Window::getSize();
+}
+
+
+////////////////////////////////////////////////////////////
+Image RenderWindow::capture() const
+{
+ Image image;
+ if (setActive())
+ {
+ int width = static_cast<int>(getSize().x);
+ int height = static_cast<int>(getSize().y);
+
+ // copy rows one by one and flip them (OpenGL's origin is bottom while SFML's origin is top)
+ std::vector<Uint8> pixels(width * height * 4);
+ for (int i = 0; i < height; ++i)
+ {
+ Uint8* ptr = &pixels[i * width * 4];
+ glCheck(glReadPixels(0, height - i - 1, width, 1, GL_RGBA, GL_UNSIGNED_BYTE, ptr));
+ }
+
+ image.create(width, height, &pixels[0]);
+ }
+
+ return image;
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderWindow::onCreate()
+{
+ // Just initialize the render target part
+ RenderTarget::initialize();
+}
+
+
+////////////////////////////////////////////////////////////
+void RenderWindow::onResize()
+{
+ // Update the current view (recompute the viewport, which is stored in relative coordinates)
+ setView(getView());
+}
+
+} // namespace sf
diff --git a/src/SFML/Graphics/Shader.cpp b/src/SFML/Graphics/Shader.cpp
index eb292b7..1cf7648 100644
--- a/src/SFML/Graphics/Shader.cpp
+++ b/src/SFML/Graphics/Shader.cpp
@@ -1,593 +1,786 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Graphics/Shader.hpp>
-#include <SFML/Graphics/Texture.hpp>
-#include <SFML/Graphics/GLCheck.hpp>
-#include <SFML/System/InputStream.hpp>
-#include <SFML/System/Err.hpp>
-#include <fstream>
-#include <vector>
-
-
-namespace
-{
- // Retrieve the maximum number of texture units available
- GLint getMaxTextureUnits()
- {
- GLint maxUnits;
- glCheck(glGetIntegerv(GL_MAX_TEXTURE_COORDS_ARB, &maxUnits));
- return maxUnits;
- }
-
- // Read the contents of a file into an array of char
- bool getFileContents(const std::string& filename, std::vector<char>& buffer)
- {
- std::ifstream file(filename.c_str(), std::ios_base::binary);
- if (file)
- {
- file.seekg(0, std::ios_base::end);
- std::streamsize size = file.tellg();
- if (size > 0)
- {
- file.seekg(0, std::ios_base::beg);
- buffer.resize(static_cast<std::size_t>(size));
- file.read(&buffer[0], size);
- }
- buffer.push_back('\0');
- return true;
- }
- else
- {
- return false;
- }
- }
-
- // Read the contents of a stream into an array of char
- bool getStreamContents(sf::InputStream& stream, std::vector<char>& buffer)
- {
- bool success = true;
- sf::Int64 size = stream.getSize();
- if (size > 0)
- {
- buffer.resize(static_cast<std::size_t>(size));
- stream.seek(0);
- sf::Int64 read = stream.read(&buffer[0], size);
- success = (read == size);
- }
- buffer.push_back('\0');
- return success;
- }
-}
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-Shader::CurrentTextureType Shader::CurrentTexture;
-
-
-////////////////////////////////////////////////////////////
-Shader::Shader() :
-m_shaderProgram (0),
-m_currentTexture(-1),
-m_textures (),
-m_params ()
-{
-}
-
-
-////////////////////////////////////////////////////////////
-Shader::~Shader()
-{
- ensureGlContext();
-
- // Destroy effect program
- if (m_shaderProgram)
- glCheck(glDeleteObjectARB(m_shaderProgram));
-}
-
-
-////////////////////////////////////////////////////////////
-bool Shader::loadFromFile(const std::string& filename, Type type)
-{
- // Read the file
- std::vector<char> shader;
- if (!getFileContents(filename, shader))
- {
- err() << "Failed to open shader file \"" << filename << "\"" << std::endl;
- return false;
- }
-
- // Compile the shader program
- if (type == Vertex)
- return compile(&shader[0], NULL);
- else
- return compile(NULL, &shader[0]);
-}
-
-
-////////////////////////////////////////////////////////////
-bool Shader::loadFromFile(const std::string& vertexShaderFilename, const std::string& fragmentShaderFilename)
-{
- // Read the vertex shader file
- std::vector<char> vertexShader;
- if (!getFileContents(vertexShaderFilename, vertexShader))
- {
- err() << "Failed to open vertex shader file \"" << vertexShaderFilename << "\"" << std::endl;
- return false;
- }
-
- // Read the fragment shader file
- std::vector<char> fragmentShader;
- if (!getFileContents(fragmentShaderFilename, fragmentShader))
- {
- err() << "Failed to open fragment shader file \"" << fragmentShaderFilename << "\"" << std::endl;
- return false;
- }
-
- // Compile the shader program
- return compile(&vertexShader[0], &fragmentShader[0]);
-}
-
-
-////////////////////////////////////////////////////////////
-bool Shader::loadFromMemory(const std::string& shader, Type type)
-{
- // Compile the shader program
- if (type == Vertex)
- return compile(shader.c_str(), NULL);
- else
- return compile(NULL, shader.c_str());
-}
-
-
-////////////////////////////////////////////////////////////
-bool Shader::loadFromMemory(const std::string& vertexShader, const std::string& fragmentShader)
-{
- // Compile the shader program
- return compile(vertexShader.c_str(), fragmentShader.c_str());
-}
-
-
-////////////////////////////////////////////////////////////
-bool Shader::loadFromStream(InputStream& stream, Type type)
-{
- // Read the shader code from the stream
- std::vector<char> shader;
- if (!getStreamContents(stream, shader))
- {
- err() << "Failed to read shader from stream" << std::endl;
- return false;
- }
-
- // Compile the shader program
- if (type == Vertex)
- return compile(&shader[0], NULL);
- else
- return compile(NULL, &shader[0]);
-}
-
-
-////////////////////////////////////////////////////////////
-bool Shader::loadFromStream(InputStream& vertexShaderStream, InputStream& fragmentShaderStream)
-{
- // Read the vertex shader code from the stream
- std::vector<char> vertexShader;
- if (!getStreamContents(vertexShaderStream, vertexShader))
- {
- err() << "Failed to read vertex shader from stream" << std::endl;
- return false;
- }
-
- // Read the fragment shader code from the stream
- std::vector<char> fragmentShader;
- if (!getStreamContents(fragmentShaderStream, fragmentShader))
- {
- err() << "Failed to read fragment shader from stream" << std::endl;
- return false;
- }
-
- // Compile the shader program
- return compile(&vertexShader[0], &fragmentShader[0]);
-}
-
-
-////////////////////////////////////////////////////////////
-void Shader::setParameter(const std::string& name, float x)
-{
- if (m_shaderProgram)
- {
- ensureGlContext();
-
- // Enable program
- GLhandleARB program = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);
- glCheck(glUseProgramObjectARB(m_shaderProgram));
-
- // Get parameter location and assign it new values
- GLint location = getParamLocation(name);
- if (location != -1)
- glCheck(glUniform1fARB(location, x));
-
- // Disable program
- glCheck(glUseProgramObjectARB(program));
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Shader::setParameter(const std::string& name, float x, float y)
-{
- if (m_shaderProgram)
- {
- ensureGlContext();
-
- // Enable program
- GLhandleARB program = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);
- glCheck(glUseProgramObjectARB(m_shaderProgram));
-
- // Get parameter location and assign it new values
- GLint location = getParamLocation(name);
- if (location != -1)
- glCheck(glUniform2fARB(location, x, y));
-
- // Disable program
- glCheck(glUseProgramObjectARB(program));
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Shader::setParameter(const std::string& name, float x, float y, float z)
-{
- if (m_shaderProgram)
- {
- ensureGlContext();
-
- // Enable program
- GLhandleARB program = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);
- glCheck(glUseProgramObjectARB(m_shaderProgram));
-
- // Get parameter location and assign it new values
- GLint location = getParamLocation(name);
- if (location != -1)
- glCheck(glUniform3fARB(location, x, y, z));
-
- // Disable program
- glCheck(glUseProgramObjectARB(program));
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Shader::setParameter(const std::string& name, float x, float y, float z, float w)
-{
- if (m_shaderProgram)
- {
- ensureGlContext();
-
- // Enable program
- GLhandleARB program = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);
- glCheck(glUseProgramObjectARB(m_shaderProgram));
-
- // Get parameter location and assign it new values
- GLint location = getParamLocation(name);
- if (location != -1)
- glCheck(glUniform4fARB(location, x, y, z, w));
-
- // Disable program
- glCheck(glUseProgramObjectARB(program));
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Shader::setParameter(const std::string& name, const Vector2f& v)
-{
- setParameter(name, v.x, v.y);
-}
-
-
-////////////////////////////////////////////////////////////
-void Shader::setParameter(const std::string& name, const Vector3f& v)
-{
- setParameter(name, v.x, v.y, v.z);
-}
-
-
-////////////////////////////////////////////////////////////
-void Shader::setParameter(const std::string& name, const Color& color)
-{
- setParameter(name, color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f);
-}
-
-
-////////////////////////////////////////////////////////////
-void Shader::setParameter(const std::string& name, const sf::Transform& transform)
-{
- if (m_shaderProgram)
- {
- ensureGlContext();
-
- // Enable program
- GLhandleARB program = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);
- glCheck(glUseProgramObjectARB(m_shaderProgram));
-
- // Get parameter location and assign it new values
- GLint location = getParamLocation(name);
- if (location != -1)
- glCheck(glUniformMatrix4fvARB(location, 1, GL_FALSE, transform.getMatrix()));
-
- // Disable program
- glCheck(glUseProgramObjectARB(program));
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Shader::setParameter(const std::string& name, const Texture& texture)
-{
- if (m_shaderProgram)
- {
- ensureGlContext();
-
- // Find the location of the variable in the shader
- int location = getParamLocation(name);
- if (location != -1)
- {
- // Store the location -> texture mapping
- TextureTable::iterator it = m_textures.find(location);
- if (it == m_textures.end())
- {
- // New entry, make sure there are enough texture units
- static const GLint maxUnits = getMaxTextureUnits();
- if (m_textures.size() + 1 >= static_cast<std::size_t>(maxUnits))
- {
- err() << "Impossible to use texture \"" << name << "\" for shader: all available texture units are used" << std::endl;
- return;
- }
-
- m_textures[location] = &texture;
- }
- else
- {
- // Location already used, just replace the texture
- it->second = &texture;
- }
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Shader::setParameter(const std::string& name, CurrentTextureType)
-{
- if (m_shaderProgram)
- {
- ensureGlContext();
-
- // Find the location of the variable in the shader
- m_currentTexture = getParamLocation(name);
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Shader::bind(const Shader* shader)
-{
- ensureGlContext();
-
- if (shader && shader->m_shaderProgram)
- {
- // Enable the program
- glCheck(glUseProgramObjectARB(shader->m_shaderProgram));
-
- // Bind the textures
- shader->bindTextures();
-
- // Bind the current texture
- if (shader->m_currentTexture != -1)
- glCheck(glUniform1iARB(shader->m_currentTexture, 0));
- }
- else
- {
- // Bind no shader
- glCheck(glUseProgramObjectARB(0));
- }
-}
-
-
-////////////////////////////////////////////////////////////
-bool Shader::isAvailable()
-{
- ensureGlContext();
-
- // Make sure that GLEW is initialized
- priv::ensureGlewInit();
-
- return GLEW_ARB_shading_language_100 &&
- GLEW_ARB_shader_objects &&
- GLEW_ARB_vertex_shader &&
- GLEW_ARB_fragment_shader;
-}
-
-
-////////////////////////////////////////////////////////////
-bool Shader::compile(const char* vertexShaderCode, const char* fragmentShaderCode)
-{
- ensureGlContext();
-
- // First make sure that we can use shaders
- if (!isAvailable())
- {
- err() << "Failed to create a shader: your system doesn't support shaders "
- << "(you should test Shader::isAvailable() before trying to use the Shader class)" << std::endl;
- return false;
- }
-
- // Destroy the shader if it was already created
- if (m_shaderProgram)
- glCheck(glDeleteObjectARB(m_shaderProgram));
-
- // Reset the internal state
- m_currentTexture = -1;
- m_textures.clear();
- m_params.clear();
-
- // Create the program
- m_shaderProgram = glCreateProgramObjectARB();
-
- // Create the vertex shader if needed
- if (vertexShaderCode)
- {
- // Create and compile the shader
- GLhandleARB vertexShader = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
- glCheck(glShaderSourceARB(vertexShader, 1, &vertexShaderCode, NULL));
- glCheck(glCompileShaderARB(vertexShader));
-
- // Check the compile log
- GLint success;
- glCheck(glGetObjectParameterivARB(vertexShader, GL_OBJECT_COMPILE_STATUS_ARB, &success));
- if (success == GL_FALSE)
- {
- char log[1024];
- glCheck(glGetInfoLogARB(vertexShader, sizeof(log), 0, log));
- err() << "Failed to compile vertex shader:" << std::endl
- << log << std::endl;
- glCheck(glDeleteObjectARB(vertexShader));
- glCheck(glDeleteObjectARB(m_shaderProgram));
- m_shaderProgram = 0;
- return false;
- }
-
- // Attach the shader to the program, and delete it (not needed anymore)
- glCheck(glAttachObjectARB(m_shaderProgram, vertexShader));
- glCheck(glDeleteObjectARB(vertexShader));
- }
-
- // Create the fragment shader if needed
- if (fragmentShaderCode)
- {
- // Create and compile the shader
- GLhandleARB fragmentShader = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
- glCheck(glShaderSourceARB(fragmentShader, 1, &fragmentShaderCode, NULL));
- glCheck(glCompileShaderARB(fragmentShader));
-
- // Check the compile log
- GLint success;
- glCheck(glGetObjectParameterivARB(fragmentShader, GL_OBJECT_COMPILE_STATUS_ARB, &success));
- if (success == GL_FALSE)
- {
- char log[1024];
- glCheck(glGetInfoLogARB(fragmentShader, sizeof(log), 0, log));
- err() << "Failed to compile fragment shader:" << std::endl
- << log << std::endl;
- glCheck(glDeleteObjectARB(fragmentShader));
- glCheck(glDeleteObjectARB(m_shaderProgram));
- m_shaderProgram = 0;
- return false;
- }
-
- // Attach the shader to the program, and delete it (not needed anymore)
- glCheck(glAttachObjectARB(m_shaderProgram, fragmentShader));
- glCheck(glDeleteObjectARB(fragmentShader));
- }
-
- // Link the program
- glCheck(glLinkProgramARB(m_shaderProgram));
-
- // Check the link log
- GLint success;
- glCheck(glGetObjectParameterivARB(m_shaderProgram, GL_OBJECT_LINK_STATUS_ARB, &success));
- if (success == GL_FALSE)
- {
- char log[1024];
- glCheck(glGetInfoLogARB(m_shaderProgram, sizeof(log), 0, log));
- err() << "Failed to link shader:" << std::endl
- << log << std::endl;
- glCheck(glDeleteObjectARB(m_shaderProgram));
- m_shaderProgram = 0;
- return false;
- }
-
- // Force an OpenGL flush, so that the shader will appear updated
- // in all contexts immediately (solves problems in multi-threaded apps)
- glCheck(glFlush());
-
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-void Shader::bindTextures() const
-{
- TextureTable::const_iterator it = m_textures.begin();
- for (std::size_t i = 0; i < m_textures.size(); ++i)
- {
- GLint index = static_cast<GLsizei>(i + 1);
- glCheck(glUniform1iARB(it->first, index));
- glCheck(glActiveTextureARB(GL_TEXTURE0_ARB + index));
- Texture::bind(it->second);
- ++it;
- }
-
- // Make sure that the texture unit which is left active is the number 0
- glCheck(glActiveTextureARB(GL_TEXTURE0_ARB));
-}
-
-
-////////////////////////////////////////////////////////////
-int Shader::getParamLocation(const std::string& name)
-{
- // Check the cache
- ParamTable::const_iterator it = m_params.find(name);
- if (it != m_params.end())
- {
- // Already in cache, return it
- return it->second;
- }
- else
- {
- // Not in cache, request the location from OpenGL
- int location = glGetUniformLocationARB(m_shaderProgram, name.c_str());
- if (location != -1)
- {
- // Location found: add it to the cache
- m_params.insert(std::make_pair(name, location));
- }
- else
- {
- // Error: location not found
- err() << "Parameter \"" << name << "\" not found in shader" << std::endl;
- }
-
- return location;
- }
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/Shader.hpp>
+#include <SFML/Graphics/Texture.hpp>
+#include <SFML/Graphics/GLCheck.hpp>
+#include <SFML/Window/Context.hpp>
+#include <SFML/System/InputStream.hpp>
+#include <SFML/System/Mutex.hpp>
+#include <SFML/System/Lock.hpp>
+#include <SFML/System/Err.hpp>
+#include <fstream>
+#include <vector>
+
+
+#ifndef SFML_OPENGL_ES
+
+namespace
+{
+ sf::Mutex mutex;
+
+ GLint checkMaxTextureUnits()
+ {
+ GLint maxUnits = 0;
+
+ glCheck(glGetIntegerv(GL_MAX_TEXTURE_COORDS_ARB, &maxUnits));
+
+ return maxUnits;
+ }
+
+ // Retrieve the maximum number of texture units available
+ GLint getMaxTextureUnits()
+ {
+ // TODO: Remove this lock when it becomes unnecessary in C++11
+ sf::Lock lock(mutex);
+
+ static GLint maxUnits = checkMaxTextureUnits();
+
+ return maxUnits;
+ }
+
+ // Read the contents of a file into an array of char
+ bool getFileContents(const std::string& filename, std::vector<char>& buffer)
+ {
+ std::ifstream file(filename.c_str(), std::ios_base::binary);
+ if (file)
+ {
+ file.seekg(0, std::ios_base::end);
+ std::streamsize size = file.tellg();
+ if (size > 0)
+ {
+ file.seekg(0, std::ios_base::beg);
+ buffer.resize(static_cast<std::size_t>(size));
+ file.read(&buffer[0], size);
+ }
+ buffer.push_back('\0');
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ // Read the contents of a stream into an array of char
+ bool getStreamContents(sf::InputStream& stream, std::vector<char>& buffer)
+ {
+ bool success = true;
+ sf::Int64 size = stream.getSize();
+ if (size > 0)
+ {
+ buffer.resize(static_cast<std::size_t>(size));
+ stream.seek(0);
+ sf::Int64 read = stream.read(&buffer[0], size);
+ success = (read == size);
+ }
+ buffer.push_back('\0');
+ return success;
+ }
+
+ bool checkShadersAvailable()
+ {
+ // Create a temporary context in case the user checks
+ // before a GlResource is created, thus initializing
+ // the shared context
+ sf::Context context;
+
+ // Make sure that extensions are initialized
+ sf::priv::ensureExtensionsInit();
+
+ bool available = GLEW_ARB_shading_language_100 &&
+ GLEW_ARB_shader_objects &&
+ GLEW_ARB_vertex_shader &&
+ GLEW_ARB_fragment_shader;
+
+ return available;
+ }
+}
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Shader::CurrentTextureType Shader::CurrentTexture;
+
+
+////////////////////////////////////////////////////////////
+Shader::Shader() :
+m_shaderProgram (0),
+m_currentTexture(-1),
+m_textures (),
+m_params ()
+{
+}
+
+
+////////////////////////////////////////////////////////////
+Shader::~Shader()
+{
+ ensureGlContext();
+
+ // Destroy effect program
+ if (m_shaderProgram)
+ glCheck(glDeleteObjectARB(m_shaderProgram));
+}
+
+
+////////////////////////////////////////////////////////////
+bool Shader::loadFromFile(const std::string& filename, Type type)
+{
+ // Read the file
+ std::vector<char> shader;
+ if (!getFileContents(filename, shader))
+ {
+ err() << "Failed to open shader file \"" << filename << "\"" << std::endl;
+ return false;
+ }
+
+ // Compile the shader program
+ if (type == Vertex)
+ return compile(&shader[0], NULL);
+ else
+ return compile(NULL, &shader[0]);
+}
+
+
+////////////////////////////////////////////////////////////
+bool Shader::loadFromFile(const std::string& vertexShaderFilename, const std::string& fragmentShaderFilename)
+{
+ // Read the vertex shader file
+ std::vector<char> vertexShader;
+ if (!getFileContents(vertexShaderFilename, vertexShader))
+ {
+ err() << "Failed to open vertex shader file \"" << vertexShaderFilename << "\"" << std::endl;
+ return false;
+ }
+
+ // Read the fragment shader file
+ std::vector<char> fragmentShader;
+ if (!getFileContents(fragmentShaderFilename, fragmentShader))
+ {
+ err() << "Failed to open fragment shader file \"" << fragmentShaderFilename << "\"" << std::endl;
+ return false;
+ }
+
+ // Compile the shader program
+ return compile(&vertexShader[0], &fragmentShader[0]);
+}
+
+
+////////////////////////////////////////////////////////////
+bool Shader::loadFromMemory(const std::string& shader, Type type)
+{
+ // Compile the shader program
+ if (type == Vertex)
+ return compile(shader.c_str(), NULL);
+ else
+ return compile(NULL, shader.c_str());
+}
+
+
+////////////////////////////////////////////////////////////
+bool Shader::loadFromMemory(const std::string& vertexShader, const std::string& fragmentShader)
+{
+ // Compile the shader program
+ return compile(vertexShader.c_str(), fragmentShader.c_str());
+}
+
+
+////////////////////////////////////////////////////////////
+bool Shader::loadFromStream(InputStream& stream, Type type)
+{
+ // Read the shader code from the stream
+ std::vector<char> shader;
+ if (!getStreamContents(stream, shader))
+ {
+ err() << "Failed to read shader from stream" << std::endl;
+ return false;
+ }
+
+ // Compile the shader program
+ if (type == Vertex)
+ return compile(&shader[0], NULL);
+ else
+ return compile(NULL, &shader[0]);
+}
+
+
+////////////////////////////////////////////////////////////
+bool Shader::loadFromStream(InputStream& vertexShaderStream, InputStream& fragmentShaderStream)
+{
+ // Read the vertex shader code from the stream
+ std::vector<char> vertexShader;
+ if (!getStreamContents(vertexShaderStream, vertexShader))
+ {
+ err() << "Failed to read vertex shader from stream" << std::endl;
+ return false;
+ }
+
+ // Read the fragment shader code from the stream
+ std::vector<char> fragmentShader;
+ if (!getStreamContents(fragmentShaderStream, fragmentShader))
+ {
+ err() << "Failed to read fragment shader from stream" << std::endl;
+ return false;
+ }
+
+ // Compile the shader program
+ return compile(&vertexShader[0], &fragmentShader[0]);
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, float x)
+{
+ if (m_shaderProgram)
+ {
+ ensureGlContext();
+
+ // Enable program
+ GLhandleARB program = glCheck(glGetHandleARB(GL_PROGRAM_OBJECT_ARB));
+ glCheck(glUseProgramObjectARB(m_shaderProgram));
+
+ // Get parameter location and assign it new values
+ GLint location = getParamLocation(name);
+ if (location != -1)
+ {
+ glCheck(glUniform1fARB(location, x));
+ }
+
+ // Disable program
+ glCheck(glUseProgramObjectARB(program));
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, float x, float y)
+{
+ if (m_shaderProgram)
+ {
+ ensureGlContext();
+
+ // Enable program
+ GLhandleARB program = glCheck(glGetHandleARB(GL_PROGRAM_OBJECT_ARB));
+ glCheck(glUseProgramObjectARB(m_shaderProgram));
+
+ // Get parameter location and assign it new values
+ GLint location = getParamLocation(name);
+ if (location != -1)
+ {
+ glCheck(glUniform2fARB(location, x, y));
+ }
+
+ // Disable program
+ glCheck(glUseProgramObjectARB(program));
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, float x, float y, float z)
+{
+ if (m_shaderProgram)
+ {
+ ensureGlContext();
+
+ // Enable program
+ GLhandleARB program = glCheck(glGetHandleARB(GL_PROGRAM_OBJECT_ARB));
+ glCheck(glUseProgramObjectARB(m_shaderProgram));
+
+ // Get parameter location and assign it new values
+ GLint location = getParamLocation(name);
+ if (location != -1)
+ {
+ glCheck(glUniform3fARB(location, x, y, z));
+ }
+
+ // Disable program
+ glCheck(glUseProgramObjectARB(program));
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, float x, float y, float z, float w)
+{
+ if (m_shaderProgram)
+ {
+ ensureGlContext();
+
+ // Enable program
+ GLhandleARB program = glCheck(glGetHandleARB(GL_PROGRAM_OBJECT_ARB));
+ glCheck(glUseProgramObjectARB(m_shaderProgram));
+
+ // Get parameter location and assign it new values
+ GLint location = getParamLocation(name);
+ if (location != -1)
+ {
+ glCheck(glUniform4fARB(location, x, y, z, w));
+ }
+
+ // Disable program
+ glCheck(glUseProgramObjectARB(program));
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, const Vector2f& v)
+{
+ setParameter(name, v.x, v.y);
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, const Vector3f& v)
+{
+ setParameter(name, v.x, v.y, v.z);
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, const Color& color)
+{
+ setParameter(name, color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f);
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, const sf::Transform& transform)
+{
+ if (m_shaderProgram)
+ {
+ ensureGlContext();
+
+ // Enable program
+ GLhandleARB program = glCheck(glGetHandleARB(GL_PROGRAM_OBJECT_ARB));
+ glCheck(glUseProgramObjectARB(m_shaderProgram));
+
+ // Get parameter location and assign it new values
+ GLint location = getParamLocation(name);
+ if (location != -1)
+ {
+ glCheck(glUniformMatrix4fvARB(location, 1, GL_FALSE, transform.getMatrix()));
+ }
+
+ // Disable program
+ glCheck(glUseProgramObjectARB(program));
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, const Texture& texture)
+{
+ if (m_shaderProgram)
+ {
+ ensureGlContext();
+
+ // Find the location of the variable in the shader
+ int location = getParamLocation(name);
+ if (location != -1)
+ {
+ // Store the location -> texture mapping
+ TextureTable::iterator it = m_textures.find(location);
+ if (it == m_textures.end())
+ {
+ // New entry, make sure there are enough texture units
+ GLint maxUnits = getMaxTextureUnits();
+ if (m_textures.size() + 1 >= static_cast<std::size_t>(maxUnits))
+ {
+ err() << "Impossible to use texture \"" << name << "\" for shader: all available texture units are used" << std::endl;
+ return;
+ }
+
+ m_textures[location] = &texture;
+ }
+ else
+ {
+ // Location already used, just replace the texture
+ it->second = &texture;
+ }
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, CurrentTextureType)
+{
+ if (m_shaderProgram)
+ {
+ ensureGlContext();
+
+ // Find the location of the variable in the shader
+ m_currentTexture = getParamLocation(name);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::bind(const Shader* shader)
+{
+ ensureGlContext();
+
+ if (shader && shader->m_shaderProgram)
+ {
+ // Enable the program
+ glCheck(glUseProgramObjectARB(shader->m_shaderProgram));
+
+ // Bind the textures
+ shader->bindTextures();
+
+ // Bind the current texture
+ if (shader->m_currentTexture != -1)
+ glCheck(glUniform1iARB(shader->m_currentTexture, 0));
+ }
+ else
+ {
+ // Bind no shader
+ glCheck(glUseProgramObjectARB(0));
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+bool Shader::isAvailable()
+{
+ // TODO: Remove this lock when it becomes unnecessary in C++11
+ Lock lock(mutex);
+
+ static bool available = checkShadersAvailable();
+
+ return available;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Shader::compile(const char* vertexShaderCode, const char* fragmentShaderCode)
+{
+ ensureGlContext();
+
+ // First make sure that we can use shaders
+ if (!isAvailable())
+ {
+ err() << "Failed to create a shader: your system doesn't support shaders "
+ << "(you should test Shader::isAvailable() before trying to use the Shader class)" << std::endl;
+ return false;
+ }
+
+ // Destroy the shader if it was already created
+ if (m_shaderProgram)
+ glCheck(glDeleteObjectARB(m_shaderProgram));
+
+ // Reset the internal state
+ m_currentTexture = -1;
+ m_textures.clear();
+ m_params.clear();
+
+ // Create the program
+ m_shaderProgram = glCheck(glCreateProgramObjectARB());
+
+ // Create the vertex shader if needed
+ if (vertexShaderCode)
+ {
+ // Create and compile the shader
+ GLhandleARB vertexShader = glCheck(glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB));
+ glCheck(glShaderSourceARB(vertexShader, 1, &vertexShaderCode, NULL));
+ glCheck(glCompileShaderARB(vertexShader));
+
+ // Check the compile log
+ GLint success;
+ glCheck(glGetObjectParameterivARB(vertexShader, GL_OBJECT_COMPILE_STATUS_ARB, &success));
+ if (success == GL_FALSE)
+ {
+ char log[1024];
+ glCheck(glGetInfoLogARB(vertexShader, sizeof(log), 0, log));
+ err() << "Failed to compile vertex shader:" << std::endl
+ << log << std::endl;
+ glCheck(glDeleteObjectARB(vertexShader));
+ glCheck(glDeleteObjectARB(m_shaderProgram));
+ m_shaderProgram = 0;
+ return false;
+ }
+
+ // Attach the shader to the program, and delete it (not needed anymore)
+ glCheck(glAttachObjectARB(m_shaderProgram, vertexShader));
+ glCheck(glDeleteObjectARB(vertexShader));
+ }
+
+ // Create the fragment shader if needed
+ if (fragmentShaderCode)
+ {
+ // Create and compile the shader
+ GLhandleARB fragmentShader = glCheck(glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB));
+ glCheck(glShaderSourceARB(fragmentShader, 1, &fragmentShaderCode, NULL));
+ glCheck(glCompileShaderARB(fragmentShader));
+
+ // Check the compile log
+ GLint success;
+ glCheck(glGetObjectParameterivARB(fragmentShader, GL_OBJECT_COMPILE_STATUS_ARB, &success));
+ if (success == GL_FALSE)
+ {
+ char log[1024];
+ glCheck(glGetInfoLogARB(fragmentShader, sizeof(log), 0, log));
+ err() << "Failed to compile fragment shader:" << std::endl
+ << log << std::endl;
+ glCheck(glDeleteObjectARB(fragmentShader));
+ glCheck(glDeleteObjectARB(m_shaderProgram));
+ m_shaderProgram = 0;
+ return false;
+ }
+
+ // Attach the shader to the program, and delete it (not needed anymore)
+ glCheck(glAttachObjectARB(m_shaderProgram, fragmentShader));
+ glCheck(glDeleteObjectARB(fragmentShader));
+ }
+
+ // Link the program
+ glCheck(glLinkProgramARB(m_shaderProgram));
+
+ // Check the link log
+ GLint success;
+ glCheck(glGetObjectParameterivARB(m_shaderProgram, GL_OBJECT_LINK_STATUS_ARB, &success));
+ if (success == GL_FALSE)
+ {
+ char log[1024];
+ glCheck(glGetInfoLogARB(m_shaderProgram, sizeof(log), 0, log));
+ err() << "Failed to link shader:" << std::endl
+ << log << std::endl;
+ glCheck(glDeleteObjectARB(m_shaderProgram));
+ m_shaderProgram = 0;
+ return false;
+ }
+
+ // Force an OpenGL flush, so that the shader will appear updated
+ // in all contexts immediately (solves problems in multi-threaded apps)
+ glCheck(glFlush());
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::bindTextures() const
+{
+ TextureTable::const_iterator it = m_textures.begin();
+ for (std::size_t i = 0; i < m_textures.size(); ++i)
+ {
+ GLint index = static_cast<GLsizei>(i + 1);
+ glCheck(glUniform1iARB(it->first, index));
+ glCheck(glActiveTextureARB(GL_TEXTURE0_ARB + index));
+ Texture::bind(it->second);
+ ++it;
+ }
+
+ // Make sure that the texture unit which is left active is the number 0
+ glCheck(glActiveTextureARB(GL_TEXTURE0_ARB));
+}
+
+
+////////////////////////////////////////////////////////////
+int Shader::getParamLocation(const std::string& name)
+{
+ // Check the cache
+ ParamTable::const_iterator it = m_params.find(name);
+ if (it != m_params.end())
+ {
+ // Already in cache, return it
+ return it->second;
+ }
+ else
+ {
+ // Not in cache, request the location from OpenGL
+ int location = glGetUniformLocationARB(m_shaderProgram, name.c_str());
+ m_params.insert(std::make_pair(name, location));
+
+ if (location == -1)
+ err() << "Parameter \"" << name << "\" not found in shader" << std::endl;
+
+ return location;
+ }
+}
+
+} // namespace sf
+
+#else // SFML_OPENGL_ES
+
+// OpenGL ES 1 doesn't support GLSL shaders at all, we have to provide an empty implementation
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Shader::CurrentTextureType Shader::CurrentTexture;
+
+
+////////////////////////////////////////////////////////////
+Shader::Shader() :
+m_shaderProgram (0),
+m_currentTexture(-1)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+Shader::~Shader()
+{
+}
+
+
+////////////////////////////////////////////////////////////
+bool Shader::loadFromFile(const std::string& filename, Type type)
+{
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Shader::loadFromFile(const std::string& vertexShaderFilename, const std::string& fragmentShaderFilename)
+{
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Shader::loadFromMemory(const std::string& shader, Type type)
+{
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Shader::loadFromMemory(const std::string& vertexShader, const std::string& fragmentShader)
+{
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Shader::loadFromStream(InputStream& stream, Type type)
+{
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Shader::loadFromStream(InputStream& vertexShaderStream, InputStream& fragmentShaderStream)
+{
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, float x)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, float x, float y)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, float x, float y, float z)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, float x, float y, float z, float w)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, const Vector2f& v)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, const Vector3f& v)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, const Color& color)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, const sf::Transform& transform)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, const Texture& texture)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::setParameter(const std::string& name, CurrentTextureType)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::bind(const Shader* shader)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+bool Shader::isAvailable()
+{
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Shader::compile(const char* vertexShaderCode, const char* fragmentShaderCode)
+{
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+void Shader::bindTextures() const
+{
+}
+
+} // namespace sf
+
+#endif // SFML_OPENGL_ES
diff --git a/src/SFML/Graphics/Shape.cpp b/src/SFML/Graphics/Shape.cpp
index 16524f5..fa73a5f 100644
--- a/src/SFML/Graphics/Shape.cpp
+++ b/src/SFML/Graphics/Shape.cpp
@@ -1,305 +1,305 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Graphics/Shape.hpp>
-#include <SFML/Graphics/RenderTarget.hpp>
-#include <SFML/Graphics/Texture.hpp>
-#include <SFML/System/Err.hpp>
-#include <cmath>
-
-
-namespace
-{
- // Compute the normal of a segment
- sf::Vector2f computeNormal(const sf::Vector2f& p1, const sf::Vector2f& p2)
- {
- sf::Vector2f normal(p1.y - p2.y, p2.x - p1.x);
- float length = std::sqrt(normal.x * normal.x + normal.y * normal.y);
- if (length != 0.f)
- normal /= length;
- return normal;
- }
-
- // Compute the dot product of two vectors
- float dotProduct(const sf::Vector2f& p1, const sf::Vector2f& p2)
- {
- return p1.x * p2.x + p1.y * p2.y;
- }
-}
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-Shape::~Shape()
-{
-}
-
-
-////////////////////////////////////////////////////////////
-void Shape::setTexture(const Texture* texture, bool resetRect)
-{
- if (texture)
- {
- // Recompute the texture area if requested, or if there was no texture & rect before
- if (resetRect || (!m_texture && (m_textureRect == sf::IntRect())))
- setTextureRect(IntRect(0, 0, texture->getSize().x, texture->getSize().y));
- }
-
- // Assign the new texture
- m_texture = texture;
-}
-
-
-////////////////////////////////////////////////////////////
-const Texture* Shape::getTexture() const
-{
- return m_texture;
-}
-
-
-////////////////////////////////////////////////////////////
-void Shape::setTextureRect(const IntRect& rect)
-{
- m_textureRect = rect;
- updateTexCoords();
-}
-
-
-////////////////////////////////////////////////////////////
-const IntRect& Shape::getTextureRect() const
-{
- return m_textureRect;
-}
-
-
-////////////////////////////////////////////////////////////
-void Shape::setFillColor(const Color& color)
-{
- m_fillColor = color;
- updateFillColors();
-}
-
-
-////////////////////////////////////////////////////////////
-const Color& Shape::getFillColor() const
-{
- return m_fillColor;
-}
-
-
-////////////////////////////////////////////////////////////
-void Shape::setOutlineColor(const Color& color)
-{
- m_outlineColor = color;
- updateOutlineColors();
-}
-
-
-////////////////////////////////////////////////////////////
-const Color& Shape::getOutlineColor() const
-{
- return m_outlineColor;
-}
-
-
-////////////////////////////////////////////////////////////
-void Shape::setOutlineThickness(float thickness)
-{
- m_outlineThickness = thickness;
- update(); // recompute everything because the whole shape must be offset
-}
-
-
-////////////////////////////////////////////////////////////
-float Shape::getOutlineThickness() const
-{
- return m_outlineThickness;
-}
-
-
-////////////////////////////////////////////////////////////
-FloatRect Shape::getLocalBounds() const
-{
- return m_bounds;
-}
-
-
-////////////////////////////////////////////////////////////
-FloatRect Shape::getGlobalBounds() const
-{
- return getTransform().transformRect(getLocalBounds());
-}
-
-
-////////////////////////////////////////////////////////////
-Shape::Shape() :
-m_texture (NULL),
-m_textureRect (),
-m_fillColor (255, 255, 255),
-m_outlineColor (255, 255, 255),
-m_outlineThickness(0),
-m_vertices (TrianglesFan),
-m_outlineVertices (TrianglesStrip),
-m_insideBounds (),
-m_bounds ()
-{
-}
-
-
-////////////////////////////////////////////////////////////
-void Shape::update()
-{
- // Get the total number of points of the shape
- unsigned int count = getPointCount();
- if (count < 3)
- {
- m_vertices.resize(0);
- m_outlineVertices.resize(0);
- return;
- }
-
- m_vertices.resize(count + 2); // + 2 for center and repeated first point
-
- // Position
- for (unsigned int i = 0; i < count; ++i)
- m_vertices[i + 1].position = getPoint(i);
- m_vertices[count + 1].position = m_vertices[1].position;
-
- // Update the bounding rectangle
- m_vertices[0] = m_vertices[1]; // so that the result of getBounds() is correct
- m_insideBounds = m_vertices.getBounds();
-
- // Compute the center and make it the first vertex
- m_vertices[0].position.x = m_insideBounds.left + m_insideBounds.width / 2;
- m_vertices[0].position.y = m_insideBounds.top + m_insideBounds.height / 2;
-
- // Color
- updateFillColors();
-
- // Texture coordinates
- updateTexCoords();
-
- // Outline
- updateOutline();
-}
-
-
-////////////////////////////////////////////////////////////
-void Shape::draw(RenderTarget& target, RenderStates states) const
-{
- states.transform *= getTransform();
-
- // Render the inside
- states.texture = m_texture;
- target.draw(m_vertices, states);
-
- // Render the outline
- if (m_outlineThickness != 0)
- {
- states.texture = NULL;
- target.draw(m_outlineVertices, states);
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Shape::updateFillColors()
-{
- for (unsigned int i = 0; i < m_vertices.getVertexCount(); ++i)
- m_vertices[i].color = m_fillColor;
-}
-
-
-////////////////////////////////////////////////////////////
-void Shape::updateTexCoords()
-{
- for (unsigned int i = 0; i < m_vertices.getVertexCount(); ++i)
- {
- float xratio = (m_vertices[i].position.x - m_insideBounds.left) / m_insideBounds.width;
- float yratio = (m_vertices[i].position.y - m_insideBounds.top) / m_insideBounds.height;
- m_vertices[i].texCoords.x = m_textureRect.left + m_textureRect.width * xratio;
- m_vertices[i].texCoords.y = m_textureRect.top + m_textureRect.height * yratio;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Shape::updateOutline()
-{
- unsigned int count = m_vertices.getVertexCount() - 2;
- m_outlineVertices.resize((count + 1) * 2);
-
- for (unsigned int i = 0; i < count; ++i)
- {
- unsigned int index = i + 1;
-
- // Get the two segments shared by the current point
- Vector2f p0 = (i == 0) ? m_vertices[count].position : m_vertices[index - 1].position;
- Vector2f p1 = m_vertices[index].position;
- Vector2f p2 = m_vertices[index + 1].position;
-
- // Compute their normal
- Vector2f n1 = computeNormal(p0, p1);
- Vector2f n2 = computeNormal(p1, p2);
-
- // Make sure that the normals point towards the outside of the shape
- // (this depends on the order in which the points were defined)
- if (dotProduct(n1, m_vertices[0].position - p1) > 0)
- n1 = -n1;
- if (dotProduct(n2, m_vertices[0].position - p1) > 0)
- n2 = -n2;
-
- // Combine them to get the extrusion direction
- float factor = 1.f + (n1.x * n2.x + n1.y * n2.y);
- Vector2f normal = (n1 + n2) / factor;
-
- // Update the outline points
- m_outlineVertices[i * 2 + 0].position = p1;
- m_outlineVertices[i * 2 + 1].position = p1 + normal * m_outlineThickness;
- }
-
- // Duplicate the first point at the end, to close the outline
- m_outlineVertices[count * 2 + 0].position = m_outlineVertices[0].position;
- m_outlineVertices[count * 2 + 1].position = m_outlineVertices[1].position;
-
- // Update outline colors
- updateOutlineColors();
-
- // Update the shape's bounds
- m_bounds = m_outlineVertices.getBounds();
-}
-
-
-////////////////////////////////////////////////////////////
-void Shape::updateOutlineColors()
-{
- for (unsigned int i = 0; i < m_outlineVertices.getVertexCount(); ++i)
- m_outlineVertices[i].color = m_outlineColor;
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/Shape.hpp>
+#include <SFML/Graphics/RenderTarget.hpp>
+#include <SFML/Graphics/Texture.hpp>
+#include <SFML/System/Err.hpp>
+#include <cmath>
+
+
+namespace
+{
+ // Compute the normal of a segment
+ sf::Vector2f computeNormal(const sf::Vector2f& p1, const sf::Vector2f& p2)
+ {
+ sf::Vector2f normal(p1.y - p2.y, p2.x - p1.x);
+ float length = std::sqrt(normal.x * normal.x + normal.y * normal.y);
+ if (length != 0.f)
+ normal /= length;
+ return normal;
+ }
+
+ // Compute the dot product of two vectors
+ float dotProduct(const sf::Vector2f& p1, const sf::Vector2f& p2)
+ {
+ return p1.x * p2.x + p1.y * p2.y;
+ }
+}
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Shape::~Shape()
+{
+}
+
+
+////////////////////////////////////////////////////////////
+void Shape::setTexture(const Texture* texture, bool resetRect)
+{
+ if (texture)
+ {
+ // Recompute the texture area if requested, or if there was no texture & rect before
+ if (resetRect || (!m_texture && (m_textureRect == sf::IntRect())))
+ setTextureRect(IntRect(0, 0, texture->getSize().x, texture->getSize().y));
+ }
+
+ // Assign the new texture
+ m_texture = texture;
+}
+
+
+////////////////////////////////////////////////////////////
+const Texture* Shape::getTexture() const
+{
+ return m_texture;
+}
+
+
+////////////////////////////////////////////////////////////
+void Shape::setTextureRect(const IntRect& rect)
+{
+ m_textureRect = rect;
+ updateTexCoords();
+}
+
+
+////////////////////////////////////////////////////////////
+const IntRect& Shape::getTextureRect() const
+{
+ return m_textureRect;
+}
+
+
+////////////////////////////////////////////////////////////
+void Shape::setFillColor(const Color& color)
+{
+ m_fillColor = color;
+ updateFillColors();
+}
+
+
+////////////////////////////////////////////////////////////
+const Color& Shape::getFillColor() const
+{
+ return m_fillColor;
+}
+
+
+////////////////////////////////////////////////////////////
+void Shape::setOutlineColor(const Color& color)
+{
+ m_outlineColor = color;
+ updateOutlineColors();
+}
+
+
+////////////////////////////////////////////////////////////
+const Color& Shape::getOutlineColor() const
+{
+ return m_outlineColor;
+}
+
+
+////////////////////////////////////////////////////////////
+void Shape::setOutlineThickness(float thickness)
+{
+ m_outlineThickness = thickness;
+ update(); // recompute everything because the whole shape must be offset
+}
+
+
+////////////////////////////////////////////////////////////
+float Shape::getOutlineThickness() const
+{
+ return m_outlineThickness;
+}
+
+
+////////////////////////////////////////////////////////////
+FloatRect Shape::getLocalBounds() const
+{
+ return m_bounds;
+}
+
+
+////////////////////////////////////////////////////////////
+FloatRect Shape::getGlobalBounds() const
+{
+ return getTransform().transformRect(getLocalBounds());
+}
+
+
+////////////////////////////////////////////////////////////
+Shape::Shape() :
+m_texture (NULL),
+m_textureRect (),
+m_fillColor (255, 255, 255),
+m_outlineColor (255, 255, 255),
+m_outlineThickness(0),
+m_vertices (TrianglesFan),
+m_outlineVertices (TrianglesStrip),
+m_insideBounds (),
+m_bounds ()
+{
+}
+
+
+////////////////////////////////////////////////////////////
+void Shape::update()
+{
+ // Get the total number of points of the shape
+ unsigned int count = getPointCount();
+ if (count < 3)
+ {
+ m_vertices.resize(0);
+ m_outlineVertices.resize(0);
+ return;
+ }
+
+ m_vertices.resize(count + 2); // + 2 for center and repeated first point
+
+ // Position
+ for (unsigned int i = 0; i < count; ++i)
+ m_vertices[i + 1].position = getPoint(i);
+ m_vertices[count + 1].position = m_vertices[1].position;
+
+ // Update the bounding rectangle
+ m_vertices[0] = m_vertices[1]; // so that the result of getBounds() is correct
+ m_insideBounds = m_vertices.getBounds();
+
+ // Compute the center and make it the first vertex
+ m_vertices[0].position.x = m_insideBounds.left + m_insideBounds.width / 2;
+ m_vertices[0].position.y = m_insideBounds.top + m_insideBounds.height / 2;
+
+ // Color
+ updateFillColors();
+
+ // Texture coordinates
+ updateTexCoords();
+
+ // Outline
+ updateOutline();
+}
+
+
+////////////////////////////////////////////////////////////
+void Shape::draw(RenderTarget& target, RenderStates states) const
+{
+ states.transform *= getTransform();
+
+ // Render the inside
+ states.texture = m_texture;
+ target.draw(m_vertices, states);
+
+ // Render the outline
+ if (m_outlineThickness != 0)
+ {
+ states.texture = NULL;
+ target.draw(m_outlineVertices, states);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Shape::updateFillColors()
+{
+ for (unsigned int i = 0; i < m_vertices.getVertexCount(); ++i)
+ m_vertices[i].color = m_fillColor;
+}
+
+
+////////////////////////////////////////////////////////////
+void Shape::updateTexCoords()
+{
+ for (unsigned int i = 0; i < m_vertices.getVertexCount(); ++i)
+ {
+ float xratio = m_insideBounds.width > 0 ? (m_vertices[i].position.x - m_insideBounds.left) / m_insideBounds.width : 0;
+ float yratio = m_insideBounds.height > 0 ? (m_vertices[i].position.y - m_insideBounds.top) / m_insideBounds.height : 0;
+ m_vertices[i].texCoords.x = m_textureRect.left + m_textureRect.width * xratio;
+ m_vertices[i].texCoords.y = m_textureRect.top + m_textureRect.height * yratio;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Shape::updateOutline()
+{
+ unsigned int count = m_vertices.getVertexCount() - 2;
+ m_outlineVertices.resize((count + 1) * 2);
+
+ for (unsigned int i = 0; i < count; ++i)
+ {
+ unsigned int index = i + 1;
+
+ // Get the two segments shared by the current point
+ Vector2f p0 = (i == 0) ? m_vertices[count].position : m_vertices[index - 1].position;
+ Vector2f p1 = m_vertices[index].position;
+ Vector2f p2 = m_vertices[index + 1].position;
+
+ // Compute their normal
+ Vector2f n1 = computeNormal(p0, p1);
+ Vector2f n2 = computeNormal(p1, p2);
+
+ // Make sure that the normals point towards the outside of the shape
+ // (this depends on the order in which the points were defined)
+ if (dotProduct(n1, m_vertices[0].position - p1) > 0)
+ n1 = -n1;
+ if (dotProduct(n2, m_vertices[0].position - p1) > 0)
+ n2 = -n2;
+
+ // Combine them to get the extrusion direction
+ float factor = 1.f + (n1.x * n2.x + n1.y * n2.y);
+ Vector2f normal = (n1 + n2) / factor;
+
+ // Update the outline points
+ m_outlineVertices[i * 2 + 0].position = p1;
+ m_outlineVertices[i * 2 + 1].position = p1 + normal * m_outlineThickness;
+ }
+
+ // Duplicate the first point at the end, to close the outline
+ m_outlineVertices[count * 2 + 0].position = m_outlineVertices[0].position;
+ m_outlineVertices[count * 2 + 1].position = m_outlineVertices[1].position;
+
+ // Update outline colors
+ updateOutlineColors();
+
+ // Update the shape's bounds
+ m_bounds = m_outlineVertices.getBounds();
+}
+
+
+////////////////////////////////////////////////////////////
+void Shape::updateOutlineColors()
+{
+ for (unsigned int i = 0; i < m_outlineVertices.getVertexCount(); ++i)
+ m_outlineVertices[i].color = m_outlineColor;
+}
+
+} // namespace sf
diff --git a/src/SFML/Graphics/Sprite.cpp b/src/SFML/Graphics/Sprite.cpp
index d5df41e..eeb82e8 100644
--- a/src/SFML/Graphics/Sprite.cpp
+++ b/src/SFML/Graphics/Sprite.cpp
@@ -1,174 +1,174 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Graphics/Sprite.hpp>
-#include <SFML/Graphics/Texture.hpp>
-#include <SFML/Graphics/RenderTarget.hpp>
-#include <cstdlib>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-Sprite::Sprite() :
-m_texture (NULL),
-m_textureRect()
-{
-}
-
-
-////////////////////////////////////////////////////////////
-Sprite::Sprite(const Texture& texture) :
-m_texture (NULL),
-m_textureRect()
-{
- setTexture(texture);
-}
-
-
-////////////////////////////////////////////////////////////
-Sprite::Sprite(const Texture& texture, const IntRect& rectangle) :
-m_texture (NULL),
-m_textureRect()
-{
- setTexture(texture);
- setTextureRect(rectangle);
-}
-
-
-////////////////////////////////////////////////////////////
-void Sprite::setTexture(const Texture& texture, bool resetRect)
-{
- // Recompute the texture area if requested, or if there was no valid texture & rect before
- if (resetRect || (!m_texture && (m_textureRect == sf::IntRect())))
- setTextureRect(IntRect(0, 0, texture.getSize().x, texture.getSize().y));
-
- // Assign the new texture
- m_texture = &texture;
-}
-
-
-////////////////////////////////////////////////////////////
-void Sprite::setTextureRect(const IntRect& rectangle)
-{
- if (rectangle != m_textureRect)
- {
- m_textureRect = rectangle;
- updatePositions();
- updateTexCoords();
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Sprite::setColor(const Color& color)
-{
- // Update the vertices' color
- m_vertices[0].color = color;
- m_vertices[1].color = color;
- m_vertices[2].color = color;
- m_vertices[3].color = color;
-}
-
-
-////////////////////////////////////////////////////////////
-const Texture* Sprite::getTexture() const
-{
- return m_texture;
-}
-
-
-////////////////////////////////////////////////////////////
-const IntRect& Sprite::getTextureRect() const
-{
- return m_textureRect;
-}
-
-
-////////////////////////////////////////////////////////////
-const Color& Sprite::getColor() const
-{
- return m_vertices[0].color;
-}
-
-
-////////////////////////////////////////////////////////////
-FloatRect Sprite::getLocalBounds() const
-{
- float width = static_cast<float>(std::abs(m_textureRect.width));
- float height = static_cast<float>(std::abs(m_textureRect.height));
-
- return FloatRect(0.f, 0.f, width, height);
-}
-
-
-////////////////////////////////////////////////////////////
-FloatRect Sprite::getGlobalBounds() const
-{
- return getTransform().transformRect(getLocalBounds());
-}
-
-
-////////////////////////////////////////////////////////////
-void Sprite::draw(RenderTarget& target, RenderStates states) const
-{
- if (m_texture)
- {
- states.transform *= getTransform();
- states.texture = m_texture;
- target.draw(m_vertices, 4, Quads, states);
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Sprite::updatePositions()
-{
- FloatRect bounds = getLocalBounds();
-
- m_vertices[0].position = Vector2f(0, 0);
- m_vertices[1].position = Vector2f(0, bounds.height);
- m_vertices[2].position = Vector2f(bounds.width, bounds.height);
- m_vertices[3].position = Vector2f(bounds.width, 0);
-}
-
-
-////////////////////////////////////////////////////////////
-void Sprite::updateTexCoords()
-{
- float left = static_cast<float>(m_textureRect.left);
- float right = left + m_textureRect.width;
- float top = static_cast<float>(m_textureRect.top);
- float bottom = top + m_textureRect.height;
-
- m_vertices[0].texCoords = Vector2f(left, top);
- m_vertices[1].texCoords = Vector2f(left, bottom);
- m_vertices[2].texCoords = Vector2f(right, bottom);
- m_vertices[3].texCoords = Vector2f(right, top);
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/Sprite.hpp>
+#include <SFML/Graphics/Texture.hpp>
+#include <SFML/Graphics/RenderTarget.hpp>
+#include <cstdlib>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Sprite::Sprite() :
+m_texture (NULL),
+m_textureRect()
+{
+}
+
+
+////////////////////////////////////////////////////////////
+Sprite::Sprite(const Texture& texture) :
+m_texture (NULL),
+m_textureRect()
+{
+ setTexture(texture);
+}
+
+
+////////////////////////////////////////////////////////////
+Sprite::Sprite(const Texture& texture, const IntRect& rectangle) :
+m_texture (NULL),
+m_textureRect()
+{
+ setTexture(texture);
+ setTextureRect(rectangle);
+}
+
+
+////////////////////////////////////////////////////////////
+void Sprite::setTexture(const Texture& texture, bool resetRect)
+{
+ // Recompute the texture area if requested, or if there was no valid texture & rect before
+ if (resetRect || (!m_texture && (m_textureRect == sf::IntRect())))
+ setTextureRect(IntRect(0, 0, texture.getSize().x, texture.getSize().y));
+
+ // Assign the new texture
+ m_texture = &texture;
+}
+
+
+////////////////////////////////////////////////////////////
+void Sprite::setTextureRect(const IntRect& rectangle)
+{
+ if (rectangle != m_textureRect)
+ {
+ m_textureRect = rectangle;
+ updatePositions();
+ updateTexCoords();
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Sprite::setColor(const Color& color)
+{
+ // Update the vertices' color
+ m_vertices[0].color = color;
+ m_vertices[1].color = color;
+ m_vertices[2].color = color;
+ m_vertices[3].color = color;
+}
+
+
+////////////////////////////////////////////////////////////
+const Texture* Sprite::getTexture() const
+{
+ return m_texture;
+}
+
+
+////////////////////////////////////////////////////////////
+const IntRect& Sprite::getTextureRect() const
+{
+ return m_textureRect;
+}
+
+
+////////////////////////////////////////////////////////////
+const Color& Sprite::getColor() const
+{
+ return m_vertices[0].color;
+}
+
+
+////////////////////////////////////////////////////////////
+FloatRect Sprite::getLocalBounds() const
+{
+ float width = static_cast<float>(std::abs(m_textureRect.width));
+ float height = static_cast<float>(std::abs(m_textureRect.height));
+
+ return FloatRect(0.f, 0.f, width, height);
+}
+
+
+////////////////////////////////////////////////////////////
+FloatRect Sprite::getGlobalBounds() const
+{
+ return getTransform().transformRect(getLocalBounds());
+}
+
+
+////////////////////////////////////////////////////////////
+void Sprite::draw(RenderTarget& target, RenderStates states) const
+{
+ if (m_texture)
+ {
+ states.transform *= getTransform();
+ states.texture = m_texture;
+ target.draw(m_vertices, 4, TrianglesStrip, states);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Sprite::updatePositions()
+{
+ FloatRect bounds = getLocalBounds();
+
+ m_vertices[0].position = Vector2f(0, 0);
+ m_vertices[1].position = Vector2f(0, bounds.height);
+ m_vertices[2].position = Vector2f(bounds.width, 0);
+ m_vertices[3].position = Vector2f(bounds.width, bounds.height);
+}
+
+
+////////////////////////////////////////////////////////////
+void Sprite::updateTexCoords()
+{
+ float left = static_cast<float>(m_textureRect.left);
+ float right = left + m_textureRect.width;
+ float top = static_cast<float>(m_textureRect.top);
+ float bottom = top + m_textureRect.height;
+
+ m_vertices[0].texCoords = Vector2f(left, top);
+ m_vertices[1].texCoords = Vector2f(left, bottom);
+ m_vertices[2].texCoords = Vector2f(right, top);
+ m_vertices[3].texCoords = Vector2f(right, bottom);
+}
+
+} // namespace sf
diff --git a/src/SFML/Graphics/Text.cpp b/src/SFML/Graphics/Text.cpp
index ec64822..5a83e3b 100644
--- a/src/SFML/Graphics/Text.cpp
+++ b/src/SFML/Graphics/Text.cpp
@@ -1,346 +1,411 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Graphics/Text.hpp>
-#include <SFML/Graphics/Texture.hpp>
-#include <SFML/Graphics/RenderTarget.hpp>
-#include <cassert>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-Text::Text() :
-m_string (),
-m_font (NULL),
-m_characterSize(30),
-m_style (Regular),
-m_color (255, 255, 255),
-m_vertices (Quads),
-m_bounds ()
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-Text::Text(const String& string, const Font& font, unsigned int characterSize) :
-m_string (string),
-m_font (&font),
-m_characterSize(characterSize),
-m_style (Regular),
-m_color (255, 255, 255),
-m_vertices (Quads),
-m_bounds ()
-{
- updateGeometry();
-}
-
-
-////////////////////////////////////////////////////////////
-void Text::setString(const String& string)
-{
- m_string = string;
- updateGeometry();
-}
-
-
-////////////////////////////////////////////////////////////
-void Text::setFont(const Font& font)
-{
- if (m_font != &font)
- {
- m_font = &font;
- updateGeometry();
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Text::setCharacterSize(unsigned int size)
-{
- if (m_characterSize != size)
- {
- m_characterSize = size;
- updateGeometry();
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Text::setStyle(Uint32 style)
-{
- if (m_style != style)
- {
- m_style = style;
- updateGeometry();
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Text::setColor(const Color& color)
-{
- if (color != m_color)
- {
- m_color = color;
- for (unsigned int i = 0; i < m_vertices.getVertexCount(); ++i)
- m_vertices[i].color = m_color;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-const String& Text::getString() const
-{
- return m_string;
-}
-
-
-////////////////////////////////////////////////////////////
-const Font* Text::getFont() const
-{
- return m_font;
-}
-
-
-////////////////////////////////////////////////////////////
-unsigned int Text::getCharacterSize() const
-{
- return m_characterSize;
-}
-
-
-////////////////////////////////////////////////////////////
-Uint32 Text::getStyle() const
-{
- return m_style;
-}
-
-
-////////////////////////////////////////////////////////////
-const Color& Text::getColor() const
-{
- return m_color;
-}
-
-
-////////////////////////////////////////////////////////////
-Vector2f Text::findCharacterPos(std::size_t index) const
-{
- // Make sure that we have a valid font
- if (!m_font)
- return Vector2f();
-
- // Adjust the index if it's out of range
- if (index > m_string.getSize())
- index = m_string.getSize();
-
- // Precompute the variables needed by the algorithm
- bool bold = (m_style & Bold) != 0;
- float hspace = static_cast<float>(m_font->getGlyph(L' ', m_characterSize, bold).advance);
- float vspace = static_cast<float>(m_font->getLineSpacing(m_characterSize));
-
- // Compute the position
- Vector2f position;
- Uint32 prevChar = 0;
- for (std::size_t i = 0; i < index; ++i)
- {
- Uint32 curChar = m_string[i];
-
- // Apply the kerning offset
- position.x += static_cast<float>(m_font->getKerning(prevChar, curChar, m_characterSize));
- prevChar = curChar;
-
- // Handle special characters
- switch (curChar)
- {
- case L' ' : position.x += hspace; continue;
- case L'\t' : position.x += hspace * 4; continue;
- case L'\n' : position.y += vspace; position.x = 0; continue;
- case L'\v' : position.y += vspace * 4; continue;
- }
-
- // For regular characters, add the advance offset of the glyph
- position.x += static_cast<float>(m_font->getGlyph(curChar, m_characterSize, bold).advance);
- }
-
- // Transform the position to global coordinates
- position = getTransform().transformPoint(position);
-
- return position;
-}
-
-
-////////////////////////////////////////////////////////////
-FloatRect Text::getLocalBounds() const
-{
- return m_bounds;
-}
-
-
-////////////////////////////////////////////////////////////
-FloatRect Text::getGlobalBounds() const
-{
- return getTransform().transformRect(getLocalBounds());
-}
-
-
-////////////////////////////////////////////////////////////
-void Text::draw(RenderTarget& target, RenderStates states) const
-{
- if (m_font)
- {
- states.transform *= getTransform();
- states.texture = &m_font->getTexture(m_characterSize);
- target.draw(m_vertices, states);
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Text::updateGeometry()
-{
- // Clear the previous geometry
- m_vertices.clear();
- m_bounds = FloatRect();
-
- // No font: nothing to draw
- if (!m_font)
- return;
-
- // No text: nothing to draw
- if (m_string.isEmpty())
- return;
-
- // Compute values related to the text style
- bool bold = (m_style & Bold) != 0;
- bool underlined = (m_style & Underlined) != 0;
- float italic = (m_style & Italic) ? 0.208f : 0.f; // 12 degrees
- float underlineOffset = m_characterSize * 0.1f;
- float underlineThickness = m_characterSize * (bold ? 0.1f : 0.07f);
-
- // Precompute the variables needed by the algorithm
- float hspace = static_cast<float>(m_font->getGlyph(L' ', m_characterSize, bold).advance);
- float vspace = static_cast<float>(m_font->getLineSpacing(m_characterSize));
- float x = 0.f;
- float y = static_cast<float>(m_characterSize);
-
- // Create one quad for each character
- float minY = static_cast<float>(m_characterSize);
- Uint32 prevChar = 0;
- for (std::size_t i = 0; i < m_string.getSize(); ++i)
- {
- Uint32 curChar = m_string[i];
-
- // Apply the kerning offset
- x += static_cast<float>(m_font->getKerning(prevChar, curChar, m_characterSize));
- prevChar = curChar;
-
- // If we're using the underlined style and there's a new line, draw a line
- if (underlined && (curChar == L'\n'))
- {
- float top = y + underlineOffset;
- float bottom = top + underlineThickness;
-
- m_vertices.append(Vertex(Vector2f(0, top), m_color, Vector2f(1, 1)));
- m_vertices.append(Vertex(Vector2f(x, top), m_color, Vector2f(1, 1)));
- m_vertices.append(Vertex(Vector2f(x, bottom), m_color, Vector2f(1, 1)));
- m_vertices.append(Vertex(Vector2f(0, bottom), m_color, Vector2f(1, 1)));
- }
-
- // Handle special characters
- switch (curChar)
- {
- case L' ' :
- x += hspace;
- continue;
-
- case L'\t' :
- x += hspace * 4;
- continue;
-
- case L'\n' :
- if (x > m_bounds.width)
- m_bounds.width = x;
- y += vspace;
- x = 0;
- continue;
-
- case L'\v' :
- y += vspace * 4;
- continue;
- }
-
- // Extract the current glyph's description
- const Glyph& glyph = m_font->getGlyph(curChar, m_characterSize, bold);
-
- int left = glyph.bounds.left;
- int top = glyph.bounds.top;
- int right = glyph.bounds.left + glyph.bounds.width;
- int bottom = glyph.bounds.top + glyph.bounds.height;
-
- float u1 = static_cast<float>(glyph.textureRect.left);
- float v1 = static_cast<float>(glyph.textureRect.top);
- float u2 = static_cast<float>(glyph.textureRect.left + glyph.textureRect.width);
- float v2 = static_cast<float>(glyph.textureRect.top + glyph.textureRect.height);
-
- // Add a quad for the current character
- m_vertices.append(Vertex(Vector2f(x + left - italic * top, y + top), m_color, Vector2f(u1, v1)));
- m_vertices.append(Vertex(Vector2f(x + right - italic * top, y + top), m_color, Vector2f(u2, v1)));
- m_vertices.append(Vertex(Vector2f(x + right - italic * bottom, y + bottom), m_color, Vector2f(u2, v2)));
- m_vertices.append(Vertex(Vector2f(x + left - italic * bottom, y + bottom), m_color, Vector2f(u1, v2)));
-
- // Advance to the next character
- x += glyph.advance;
-
- // Update the minimum Y coordinate
- if (y + top < minY)
- minY = y + top;
- }
-
- // If we're using the underlined style, add the last line
- if (underlined)
- {
- float top = y + underlineOffset;
- float bottom = top + underlineThickness;
-
- m_vertices.append(Vertex(Vector2f(0, top), m_color, Vector2f(1, 1)));
- m_vertices.append(Vertex(Vector2f(x, top), m_color, Vector2f(1, 1)));
- m_vertices.append(Vertex(Vector2f(x, bottom), m_color, Vector2f(1, 1)));
- m_vertices.append(Vertex(Vector2f(0, bottom), m_color, Vector2f(1, 1)));
- }
-
- // Update the bounding rectangle
- m_bounds.left = 0;
- m_bounds.top = minY;
- if (x > m_bounds.width)
- m_bounds.width = x;
- m_bounds.height = y - minY;
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/Text.hpp>
+#include <SFML/Graphics/Texture.hpp>
+#include <SFML/Graphics/RenderTarget.hpp>
+#include <cmath>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Text::Text() :
+m_string (),
+m_font (NULL),
+m_characterSize (30),
+m_style (Regular),
+m_color (255, 255, 255),
+m_vertices (Triangles),
+m_bounds (),
+m_geometryNeedUpdate(false)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+Text::Text(const String& string, const Font& font, unsigned int characterSize) :
+m_string (string),
+m_font (&font),
+m_characterSize (characterSize),
+m_style (Regular),
+m_color (255, 255, 255),
+m_vertices (Triangles),
+m_bounds (),
+m_geometryNeedUpdate(true)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+void Text::setString(const String& string)
+{
+ if (m_string != string)
+ {
+ m_string = string;
+ m_geometryNeedUpdate = true;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Text::setFont(const Font& font)
+{
+ if (m_font != &font)
+ {
+ m_font = &font;
+ m_geometryNeedUpdate = true;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Text::setCharacterSize(unsigned int size)
+{
+ if (m_characterSize != size)
+ {
+ m_characterSize = size;
+ m_geometryNeedUpdate = true;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Text::setStyle(Uint32 style)
+{
+ if (m_style != style)
+ {
+ m_style = style;
+ m_geometryNeedUpdate = true;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Text::setColor(const Color& color)
+{
+ if (color != m_color)
+ {
+ m_color = color;
+
+ // Change vertex colors directly, no need to update whole geometry
+ // (if geometry is updated anyway, we can skip this step)
+ if (!m_geometryNeedUpdate)
+ {
+ for (unsigned int i = 0; i < m_vertices.getVertexCount(); ++i)
+ m_vertices[i].color = m_color;
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+const String& Text::getString() const
+{
+ return m_string;
+}
+
+
+////////////////////////////////////////////////////////////
+const Font* Text::getFont() const
+{
+ return m_font;
+}
+
+
+////////////////////////////////////////////////////////////
+unsigned int Text::getCharacterSize() const
+{
+ return m_characterSize;
+}
+
+
+////////////////////////////////////////////////////////////
+Uint32 Text::getStyle() const
+{
+ return m_style;
+}
+
+
+////////////////////////////////////////////////////////////
+const Color& Text::getColor() const
+{
+ return m_color;
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2f Text::findCharacterPos(std::size_t index) const
+{
+ // Make sure that we have a valid font
+ if (!m_font)
+ return Vector2f();
+
+ // Adjust the index if it's out of range
+ if (index > m_string.getSize())
+ index = m_string.getSize();
+
+ // Precompute the variables needed by the algorithm
+ bool bold = (m_style & Bold) != 0;
+ float hspace = static_cast<float>(m_font->getGlyph(L' ', m_characterSize, bold).advance);
+ float vspace = static_cast<float>(m_font->getLineSpacing(m_characterSize));
+
+ // Compute the position
+ Vector2f position;
+ Uint32 prevChar = 0;
+ for (std::size_t i = 0; i < index; ++i)
+ {
+ Uint32 curChar = m_string[i];
+
+ // Apply the kerning offset
+ position.x += static_cast<float>(m_font->getKerning(prevChar, curChar, m_characterSize));
+ prevChar = curChar;
+
+ // Handle special characters
+ switch (curChar)
+ {
+ case ' ': position.x += hspace; continue;
+ case '\t': position.x += hspace * 4; continue;
+ case '\n': position.y += vspace; position.x = 0; continue;
+ }
+
+ // For regular characters, add the advance offset of the glyph
+ position.x += static_cast<float>(m_font->getGlyph(curChar, m_characterSize, bold).advance);
+ }
+
+ // Transform the position to global coordinates
+ position = getTransform().transformPoint(position);
+
+ return position;
+}
+
+
+////////////////////////////////////////////////////////////
+FloatRect Text::getLocalBounds() const
+{
+ ensureGeometryUpdate();
+
+ return m_bounds;
+}
+
+
+////////////////////////////////////////////////////////////
+FloatRect Text::getGlobalBounds() const
+{
+ return getTransform().transformRect(getLocalBounds());
+}
+
+
+////////////////////////////////////////////////////////////
+void Text::draw(RenderTarget& target, RenderStates states) const
+{
+ if (m_font)
+ {
+ ensureGeometryUpdate();
+
+ states.transform *= getTransform();
+ states.texture = &m_font->getTexture(m_characterSize);
+ target.draw(m_vertices, states);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Text::ensureGeometryUpdate() const
+{
+ // Do nothing, if geometry has not changed
+ if (!m_geometryNeedUpdate)
+ return;
+
+ // Mark geometry as updated
+ m_geometryNeedUpdate = false;
+
+ // Clear the previous geometry
+ m_vertices.clear();
+ m_bounds = FloatRect();
+
+ // No font: nothing to draw
+ if (!m_font)
+ return;
+
+ // No text: nothing to draw
+ if (m_string.isEmpty())
+ return;
+
+ // Compute values related to the text style
+ bool bold = (m_style & Bold) != 0;
+ bool underlined = (m_style & Underlined) != 0;
+ bool strikeThrough = (m_style & StrikeThrough) != 0;
+ float italic = (m_style & Italic) ? 0.208f : 0.f; // 12 degrees
+ float underlineOffset = m_font->getUnderlinePosition(m_characterSize);
+ float underlineThickness = m_font->getUnderlineThickness(m_characterSize);
+
+ // Compute the location of the strike through dynamically
+ // We use the center point of the lowercase 'x' glyph as the reference
+ // We reuse the underline thickness as the thickness of the strike through as well
+ FloatRect xBounds = m_font->getGlyph(L'x', m_characterSize, bold).bounds;
+ float strikeThroughOffset = xBounds.top + xBounds.height / 2.f;
+
+ // Precompute the variables needed by the algorithm
+ float hspace = static_cast<float>(m_font->getGlyph(L' ', m_characterSize, bold).advance);
+ float vspace = static_cast<float>(m_font->getLineSpacing(m_characterSize));
+ float x = 0.f;
+ float y = static_cast<float>(m_characterSize);
+
+ // Create one quad for each character
+ float minX = static_cast<float>(m_characterSize);
+ float minY = static_cast<float>(m_characterSize);
+ float maxX = 0.f;
+ float maxY = 0.f;
+ Uint32 prevChar = 0;
+ for (std::size_t i = 0; i < m_string.getSize(); ++i)
+ {
+ Uint32 curChar = m_string[i];
+
+ // Apply the kerning offset
+ x += static_cast<float>(m_font->getKerning(prevChar, curChar, m_characterSize));
+ prevChar = curChar;
+
+ // If we're using the underlined style and there's a new line, draw a line
+ if (underlined && (curChar == L'\n'))
+ {
+ float top = std::floor(y + underlineOffset - (underlineThickness / 2) + 0.5f);
+ float bottom = top + std::floor(underlineThickness + 0.5f);
+
+ m_vertices.append(Vertex(Vector2f(0, top), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(x, top), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(0, bottom), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(0, bottom), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(x, top), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(x, bottom), m_color, Vector2f(1, 1)));
+ }
+
+ // If we're using the strike through style and there's a new line, draw a line across all characters
+ if (strikeThrough && (curChar == L'\n'))
+ {
+ float top = std::floor(y + strikeThroughOffset - (underlineThickness / 2) + 0.5f);
+ float bottom = top + std::floor(underlineThickness + 0.5f);
+
+ m_vertices.append(Vertex(Vector2f(0, top), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(x, top), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(0, bottom), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(0, bottom), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(x, top), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(x, bottom), m_color, Vector2f(1, 1)));
+ }
+
+ // Handle special characters
+ if ((curChar == ' ') || (curChar == '\t') || (curChar == '\n'))
+ {
+ // Update the current bounds (min coordinates)
+ minX = std::min(minX, x);
+ minY = std::min(minY, y);
+
+ switch (curChar)
+ {
+ case ' ': x += hspace; break;
+ case '\t': x += hspace * 4; break;
+ case '\n': y += vspace; x = 0; break;
+ }
+
+ // Update the current bounds (max coordinates)
+ maxX = std::max(maxX, x);
+ maxY = std::max(maxY, y);
+
+ // Next glyph, no need to create a quad for whitespace
+ continue;
+ }
+
+ // Extract the current glyph's description
+ const Glyph& glyph = m_font->getGlyph(curChar, m_characterSize, bold);
+
+ float left = glyph.bounds.left;
+ float top = glyph.bounds.top;
+ float right = glyph.bounds.left + glyph.bounds.width;
+ float bottom = glyph.bounds.top + glyph.bounds.height;
+
+ float u1 = static_cast<float>(glyph.textureRect.left);
+ float v1 = static_cast<float>(glyph.textureRect.top);
+ float u2 = static_cast<float>(glyph.textureRect.left + glyph.textureRect.width);
+ float v2 = static_cast<float>(glyph.textureRect.top + glyph.textureRect.height);
+
+ // Add a quad for the current character
+ m_vertices.append(Vertex(Vector2f(x + left - italic * top, y + top), m_color, Vector2f(u1, v1)));
+ m_vertices.append(Vertex(Vector2f(x + right - italic * top, y + top), m_color, Vector2f(u2, v1)));
+ m_vertices.append(Vertex(Vector2f(x + left - italic * bottom, y + bottom), m_color, Vector2f(u1, v2)));
+ m_vertices.append(Vertex(Vector2f(x + left - italic * bottom, y + bottom), m_color, Vector2f(u1, v2)));
+ m_vertices.append(Vertex(Vector2f(x + right - italic * top, y + top), m_color, Vector2f(u2, v1)));
+ m_vertices.append(Vertex(Vector2f(x + right - italic * bottom, y + bottom), m_color, Vector2f(u2, v2)));
+
+ // Update the current bounds
+ minX = std::min(minX, x + left - italic * bottom);
+ maxX = std::max(maxX, x + right - italic * top);
+ minY = std::min(minY, y + top);
+ maxY = std::max(maxY, y + bottom);
+
+ // Advance to the next character
+ x += glyph.advance;
+ }
+
+ // If we're using the underlined style, add the last line
+ if (underlined)
+ {
+ float top = std::floor(y + underlineOffset - (underlineThickness / 2) + 0.5f);
+ float bottom = top + std::floor(underlineThickness + 0.5f);
+
+ m_vertices.append(Vertex(Vector2f(0, top), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(x, top), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(0, bottom), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(0, bottom), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(x, top), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(x, bottom), m_color, Vector2f(1, 1)));
+ }
+
+ // If we're using the strike through style, add the last line across all characters
+ if (strikeThrough)
+ {
+ float top = std::floor(y + strikeThroughOffset - (underlineThickness / 2) + 0.5f);
+ float bottom = top + std::floor(underlineThickness + 0.5f);
+
+ m_vertices.append(Vertex(Vector2f(0, top), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(x, top), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(0, bottom), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(0, bottom), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(x, top), m_color, Vector2f(1, 1)));
+ m_vertices.append(Vertex(Vector2f(x, bottom), m_color, Vector2f(1, 1)));
+ }
+
+ // Update the bounding rectangle
+ m_bounds.left = minX;
+ m_bounds.top = minY;
+ m_bounds.width = maxX - minX;
+ m_bounds.height = maxY - minY;
+}
+
+} // namespace sf
diff --git a/src/SFML/Graphics/Texture.cpp b/src/SFML/Graphics/Texture.cpp
index 7b5fdb2..81387c7 100644
--- a/src/SFML/Graphics/Texture.cpp
+++ b/src/SFML/Graphics/Texture.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -29,6 +29,7 @@
#include <SFML/Graphics/Image.hpp>
#include <SFML/Graphics/GLCheck.hpp>
#include <SFML/Graphics/TextureSaver.hpp>
+#include <SFML/Window/Context.hpp>
#include <SFML/Window/Window.hpp>
#include <SFML/System/Mutex.hpp>
#include <SFML/System/Lock.hpp>
@@ -39,16 +40,31 @@
namespace
{
+ sf::Mutex mutex;
+
// Thread-safe unique identifier generator,
// is used for states cache (see RenderTarget)
sf::Uint64 getUniqueId()
{
+ sf::Lock lock(mutex);
+
static sf::Uint64 id = 1; // start at 1, zero is "no texture"
- static sf::Mutex mutex;
- sf::Lock lock(mutex);
return id++;
}
+
+ unsigned int checkMaximumTextureSize()
+ {
+ // Create a temporary context in case the user queries
+ // the size before a GlResource is created, thus
+ // initializing the shared context
+ sf::Context context;
+
+ GLint size;
+ glCheck(glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size));
+
+ return static_cast<unsigned int>(size);
+ }
}
@@ -142,7 +158,7 @@ bool Texture::create(unsigned int width, unsigned int height)
// Initialize the texture
glCheck(glBindTexture(GL_TEXTURE_2D, m_texture));
- glCheck(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, m_actualSize.x, m_actualSize.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL));
+ glCheck(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_actualSize.x, m_actualSize.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL));
glCheck(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, m_isRepeated ? GL_REPEAT : GL_CLAMP_TO_EDGE));
glCheck(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, m_isRepeated ? GL_REPEAT : GL_CLAMP_TO_EDGE));
glCheck(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, m_isSmooth ? GL_LINEAR : GL_NEAREST));
@@ -266,6 +282,27 @@ Image Texture::copyToImage() const
// Create an array of pixels
std::vector<Uint8> pixels(m_size.x * m_size.y * 4);
+#ifdef SFML_OPENGL_ES
+
+ // OpenGL ES doesn't have the glGetTexImage function, the only way to read
+ // from a texture is to bind it to a FBO and use glReadPixels
+ GLuint frameBuffer = 0;
+ glCheck(GLEXT_glGenFramebuffers(1, &frameBuffer));
+ if (frameBuffer)
+ {
+ GLint previousFrameBuffer;
+ glCheck(glGetIntegerv(GLEXT_GL_FRAMEBUFFER_BINDING, &previousFrameBuffer));
+
+ glCheck(GLEXT_glBindFramebuffer(GLEXT_GL_FRAMEBUFFER, frameBuffer));
+ glCheck(GLEXT_glFramebufferTexture2D(GLEXT_GL_FRAMEBUFFER, GLEXT_GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_texture, 0));
+ glCheck(glReadPixels(0, 0, m_size.x, m_size.y, GL_RGBA, GL_UNSIGNED_BYTE, &pixels[0]));
+ glCheck(GLEXT_glDeleteFramebuffers(1, &frameBuffer));
+
+ glCheck(GLEXT_glBindFramebuffer(GLEXT_GL_FRAMEBUFFER, previousFrameBuffer));
+ }
+
+#else
+
if ((m_size == m_actualSize) && !m_pixelsFlipped)
{
// Texture is not padded nor flipped, we can use a direct copy
@@ -302,6 +339,8 @@ Image Texture::copyToImage() const
}
}
+#endif // SFML_OPENGL_ES
+
// Create the image
Image image;
image.create(m_size.x, m_size.y, &pixels[0]);
@@ -470,7 +509,7 @@ void Texture::bind(const Texture* texture, CoordinateType coordinateType)
if (texture->m_pixelsFlipped)
{
matrix[5] = -matrix[5];
- matrix[13] = static_cast<float>(texture->m_size.y / texture->m_actualSize.y);
+ matrix[13] = static_cast<float>(texture->m_size.y) / texture->m_actualSize.y;
}
// Load the matrix
@@ -485,6 +524,13 @@ void Texture::bind(const Texture* texture, CoordinateType coordinateType)
{
// Bind no texture
glCheck(glBindTexture(GL_TEXTURE_2D, 0));
+
+ // Reset the texture matrix
+ glCheck(glMatrixMode(GL_TEXTURE));
+ glCheck(glLoadIdentity());
+
+ // Go back to model-view mode (sf::RenderTarget relies on it)
+ glCheck(glMatrixMode(GL_MODELVIEW));
}
}
@@ -492,12 +538,12 @@ void Texture::bind(const Texture* texture, CoordinateType coordinateType)
////////////////////////////////////////////////////////////
unsigned int Texture::getMaximumSize()
{
- ensureGlContext();
+ // TODO: Remove this lock when it becomes unnecessary in C++11
+ Lock lock(mutex);
- GLint size;
- glCheck(glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size));
+ static unsigned int size = checkMaximumTextureSize();
- return static_cast<unsigned int>(size);
+ return size;
}
@@ -523,10 +569,10 @@ unsigned int Texture::getValidSize(unsigned int size)
{
ensureGlContext();
- // Make sure that GLEW is initialized
- priv::ensureGlewInit();
+ // Make sure that extensions are initialized
+ priv::ensureExtensionsInit();
- if (GLEW_ARB_texture_non_power_of_two)
+ if (GLEXT_texture_non_power_of_two)
{
// If hardware supports NPOT textures, then just return the unmodified size
return size;
diff --git a/src/SFML/Graphics/TextureSaver.cpp b/src/SFML/Graphics/TextureSaver.cpp
index 1037fd3..c0e0197 100644
--- a/src/SFML/Graphics/TextureSaver.cpp
+++ b/src/SFML/Graphics/TextureSaver.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
diff --git a/src/SFML/Graphics/TextureSaver.hpp b/src/SFML/Graphics/TextureSaver.hpp
index 1c23d04..2880e19 100644
--- a/src/SFML/Graphics/TextureSaver.hpp
+++ b/src/SFML/Graphics/TextureSaver.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -41,7 +41,7 @@ namespace priv
////////////////////////////////////////////////////////////
class TextureSaver
{
-public :
+public:
////////////////////////////////////////////////////////////
/// \brief Default constructor
@@ -59,7 +59,7 @@ public :
////////////////////////////////////////////////////////////
~TextureSaver();
-private :
+private:
////////////////////////////////////////////////////////////
// Member data
diff --git a/src/SFML/Graphics/Transform.cpp b/src/SFML/Graphics/Transform.cpp
index 6da0b51..487072a 100644
--- a/src/SFML/Graphics/Transform.cpp
+++ b/src/SFML/Graphics/Transform.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
diff --git a/src/SFML/Graphics/Transformable.cpp b/src/SFML/Graphics/Transformable.cpp
index e2a830a..726bc36 100644
--- a/src/SFML/Graphics/Transformable.cpp
+++ b/src/SFML/Graphics/Transformable.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
diff --git a/src/SFML/Graphics/Vertex.cpp b/src/SFML/Graphics/Vertex.cpp
index b17a23f..8733a0f 100644
--- a/src/SFML/Graphics/Vertex.cpp
+++ b/src/SFML/Graphics/Vertex.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
diff --git a/src/SFML/Graphics/VertexArray.cpp b/src/SFML/Graphics/VertexArray.cpp
index 0c8503d..743cc3e 100644
--- a/src/SFML/Graphics/VertexArray.cpp
+++ b/src/SFML/Graphics/VertexArray.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
diff --git a/src/SFML/Graphics/View.cpp b/src/SFML/Graphics/View.cpp
index 9524246..ba9f673 100644
--- a/src/SFML/Graphics/View.cpp
+++ b/src/SFML/Graphics/View.cpp
@@ -1,240 +1,240 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Graphics/View.hpp>
-#include <cmath>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-View::View() :
-m_center (),
-m_size (),
-m_rotation (0),
-m_viewport (0, 0, 1, 1),
-m_transformUpdated (false),
-m_invTransformUpdated(false)
-{
- reset(FloatRect(0, 0, 1000, 1000));
-}
-
-
-////////////////////////////////////////////////////////////
-View::View(const FloatRect& rectangle) :
-m_center (),
-m_size (),
-m_rotation (0),
-m_viewport (0, 0, 1, 1),
-m_transformUpdated (false),
-m_invTransformUpdated(false)
-{
- reset(rectangle);
-}
-
-
-////////////////////////////////////////////////////////////
-View::View(const Vector2f& center, const Vector2f& size) :
-m_center (center),
-m_size (size),
-m_rotation (0),
-m_viewport (0, 0, 1, 1),
-m_transformUpdated (false),
-m_invTransformUpdated(false)
-{
-
-}
-
-////////////////////////////////////////////////////////////
-void View::setCenter(float x, float y)
-{
- m_center.x = x;
- m_center.y = y;
-
- m_transformUpdated = false;
- m_invTransformUpdated = false;
-}
-
-
-////////////////////////////////////////////////////////////
-void View::setCenter(const Vector2f& center)
-{
- setCenter(center.x, center.y);
-}
-
-
-////////////////////////////////////////////////////////////
-void View::setSize(float width, float height)
-{
- m_size.x = width;
- m_size.y = height;
-
- m_transformUpdated = false;
- m_invTransformUpdated = false;
-}
-
-
-////////////////////////////////////////////////////////////
-void View::setSize(const Vector2f& size)
-{
- setSize(size.x, size.y);
-}
-
-
-////////////////////////////////////////////////////////////
-void View::setRotation(float angle)
-{
- m_rotation = static_cast<float>(fmod(angle, 360));
- if (m_rotation < 0)
- m_rotation += 360.f;
-
- m_transformUpdated = false;
- m_invTransformUpdated = false;
-}
-
-
-////////////////////////////////////////////////////////////
-void View::setViewport(const FloatRect& viewport)
-{
- m_viewport = viewport;
-}
-
-
-////////////////////////////////////////////////////////////
-void View::reset(const FloatRect& rectangle)
-{
- m_center.x = rectangle.left + rectangle.width / 2.f;
- m_center.y = rectangle.top + rectangle.height / 2.f;
- m_size.x = rectangle.width;
- m_size.y = rectangle.height;
- m_rotation = 0;
-
- m_transformUpdated = false;
- m_invTransformUpdated = false;
-}
-
-
-////////////////////////////////////////////////////////////
-const Vector2f& View::getCenter() const
-{
- return m_center;
-}
-
-
-////////////////////////////////////////////////////////////
-const Vector2f& View::getSize() const
-{
- return m_size;
-}
-
-
-////////////////////////////////////////////////////////////
-float View::getRotation() const
-{
- return m_rotation;
-}
-
-
-////////////////////////////////////////////////////////////
-const FloatRect& View::getViewport() const
-{
- return m_viewport;
-}
-
-
-////////////////////////////////////////////////////////////
-void View::move(float offsetX, float offsetY)
-{
- setCenter(m_center.x + offsetX, m_center.y + offsetY);
-}
-
-
-////////////////////////////////////////////////////////////
-void View::move(const Vector2f& offset)
-{
- setCenter(m_center + offset);
-}
-
-
-////////////////////////////////////////////////////////////
-void View::rotate(float angle)
-{
- setRotation(m_rotation + angle);
-}
-
-
-////////////////////////////////////////////////////////////
-void View::zoom(float factor)
-{
- setSize(m_size.x * factor, m_size.y * factor);
-}
-
-
-////////////////////////////////////////////////////////////
-const Transform& View::getTransform() const
-{
- // Recompute the matrix if needed
- if (!m_transformUpdated)
- {
- // Rotation components
- float angle = m_rotation * 3.141592654f / 180.f;
- float cosine = static_cast<float>(std::cos(angle));
- float sine = static_cast<float>(std::sin(angle));
- float tx = -m_center.x * cosine - m_center.y * sine + m_center.x;
- float ty = m_center.x * sine - m_center.y * cosine + m_center.y;
-
- // Projection components
- float a = 2.f / m_size.x;
- float b = -2.f / m_size.y;
- float c = -a * m_center.x;
- float d = -b * m_center.y;
-
- // Rebuild the projection matrix
- m_transform = Transform( a * cosine, a * sine, a * tx + c,
- -b * sine, b * cosine, b * ty + d,
- 0.f, 0.f, 1.f);
- m_transformUpdated = true;
- }
-
- return m_transform;
-}
-
-
-////////////////////////////////////////////////////////////
-const Transform& View::getInverseTransform() const
-{
- // Recompute the matrix if needed
- if (!m_invTransformUpdated)
- {
- m_inverseTransform = getTransform().getInverse();
- m_invTransformUpdated = true;
- }
-
- return m_inverseTransform;
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/View.hpp>
+#include <cmath>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+View::View() :
+m_center (),
+m_size (),
+m_rotation (0),
+m_viewport (0, 0, 1, 1),
+m_transformUpdated (false),
+m_invTransformUpdated(false)
+{
+ reset(FloatRect(0, 0, 1000, 1000));
+}
+
+
+////////////////////////////////////////////////////////////
+View::View(const FloatRect& rectangle) :
+m_center (),
+m_size (),
+m_rotation (0),
+m_viewport (0, 0, 1, 1),
+m_transformUpdated (false),
+m_invTransformUpdated(false)
+{
+ reset(rectangle);
+}
+
+
+////////////////////////////////////////////////////////////
+View::View(const Vector2f& center, const Vector2f& size) :
+m_center (center),
+m_size (size),
+m_rotation (0),
+m_viewport (0, 0, 1, 1),
+m_transformUpdated (false),
+m_invTransformUpdated(false)
+{
+
+}
+
+////////////////////////////////////////////////////////////
+void View::setCenter(float x, float y)
+{
+ m_center.x = x;
+ m_center.y = y;
+
+ m_transformUpdated = false;
+ m_invTransformUpdated = false;
+}
+
+
+////////////////////////////////////////////////////////////
+void View::setCenter(const Vector2f& center)
+{
+ setCenter(center.x, center.y);
+}
+
+
+////////////////////////////////////////////////////////////
+void View::setSize(float width, float height)
+{
+ m_size.x = width;
+ m_size.y = height;
+
+ m_transformUpdated = false;
+ m_invTransformUpdated = false;
+}
+
+
+////////////////////////////////////////////////////////////
+void View::setSize(const Vector2f& size)
+{
+ setSize(size.x, size.y);
+}
+
+
+////////////////////////////////////////////////////////////
+void View::setRotation(float angle)
+{
+ m_rotation = static_cast<float>(fmod(angle, 360));
+ if (m_rotation < 0)
+ m_rotation += 360.f;
+
+ m_transformUpdated = false;
+ m_invTransformUpdated = false;
+}
+
+
+////////////////////////////////////////////////////////////
+void View::setViewport(const FloatRect& viewport)
+{
+ m_viewport = viewport;
+}
+
+
+////////////////////////////////////////////////////////////
+void View::reset(const FloatRect& rectangle)
+{
+ m_center.x = rectangle.left + rectangle.width / 2.f;
+ m_center.y = rectangle.top + rectangle.height / 2.f;
+ m_size.x = rectangle.width;
+ m_size.y = rectangle.height;
+ m_rotation = 0;
+
+ m_transformUpdated = false;
+ m_invTransformUpdated = false;
+}
+
+
+////////////////////////////////////////////////////////////
+const Vector2f& View::getCenter() const
+{
+ return m_center;
+}
+
+
+////////////////////////////////////////////////////////////
+const Vector2f& View::getSize() const
+{
+ return m_size;
+}
+
+
+////////////////////////////////////////////////////////////
+float View::getRotation() const
+{
+ return m_rotation;
+}
+
+
+////////////////////////////////////////////////////////////
+const FloatRect& View::getViewport() const
+{
+ return m_viewport;
+}
+
+
+////////////////////////////////////////////////////////////
+void View::move(float offsetX, float offsetY)
+{
+ setCenter(m_center.x + offsetX, m_center.y + offsetY);
+}
+
+
+////////////////////////////////////////////////////////////
+void View::move(const Vector2f& offset)
+{
+ setCenter(m_center + offset);
+}
+
+
+////////////////////////////////////////////////////////////
+void View::rotate(float angle)
+{
+ setRotation(m_rotation + angle);
+}
+
+
+////////////////////////////////////////////////////////////
+void View::zoom(float factor)
+{
+ setSize(m_size.x * factor, m_size.y * factor);
+}
+
+
+////////////////////////////////////////////////////////////
+const Transform& View::getTransform() const
+{
+ // Recompute the matrix if needed
+ if (!m_transformUpdated)
+ {
+ // Rotation components
+ float angle = m_rotation * 3.141592654f / 180.f;
+ float cosine = static_cast<float>(std::cos(angle));
+ float sine = static_cast<float>(std::sin(angle));
+ float tx = -m_center.x * cosine - m_center.y * sine + m_center.x;
+ float ty = m_center.x * sine - m_center.y * cosine + m_center.y;
+
+ // Projection components
+ float a = 2.f / m_size.x;
+ float b = -2.f / m_size.y;
+ float c = -a * m_center.x;
+ float d = -b * m_center.y;
+
+ // Rebuild the projection matrix
+ m_transform = Transform( a * cosine, a * sine, a * tx + c,
+ -b * sine, b * cosine, b * ty + d,
+ 0.f, 0.f, 1.f);
+ m_transformUpdated = true;
+ }
+
+ return m_transform;
+}
+
+
+////////////////////////////////////////////////////////////
+const Transform& View::getInverseTransform() const
+{
+ // Recompute the matrix if needed
+ if (!m_invTransformUpdated)
+ {
+ m_inverseTransform = getTransform().getInverse();
+ m_invTransformUpdated = true;
+ }
+
+ return m_inverseTransform;
+}
+
+} // namespace sf
diff --git a/src/SFML/Main/CMakeLists.txt b/src/SFML/Main/CMakeLists.txt
index 2a3575e..ac006c3 100644
--- a/src/SFML/Main/CMakeLists.txt
+++ b/src/SFML/Main/CMakeLists.txt
@@ -1,21 +1,37 @@
-
-# sources
-set(SRC
- ${PROJECT_SOURCE_DIR}/src/SFML/Main/SFML_Main.cpp
-)
-source_group("" FILES ${SRC})
-
-# define the sfml-main target
-add_library(sfml-main STATIC ${SRC})
-
-# set the debug suffix
-set_target_properties(sfml-main PROPERTIES DEBUG_POSTFIX -d)
-
-# insert the major version number in the output filename
-set_target_properties(sfml-main PROPERTIES OUTPUT_NAME "sfml-main")
-
-# set the target's folder (for IDEs that support it, e.g. Visual Studio)
-set_target_properties(sfml-main PROPERTIES FOLDER "SFML")
-
-# setup the install rule
-install(TARGETS sfml-main ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT devel)
+
+set(INCROOT ${PROJECT_SOURCE_DIR}/include/SFML/Main)
+set(SRCROOT ${PROJECT_SOURCE_DIR}/src/SFML/Main)
+
+# sources
+if(SFML_OS_WINDOWS)
+ set(SRC ${SRC} ${SRCROOT}/MainWin32.cpp)
+elseif(SFML_OS_IOS)
+ set(SRC ${SRC} ${SRCROOT}/MainiOS.mm)
+elseif(SFML_OS_ANDROID)
+ set(SRC ${SRC} ${SRCROOT}/MainAndroid.cpp)
+else()
+ return()
+endif()
+source_group("" FILES ${SRC})
+
+# define the sfml-main target
+add_library(sfml-main STATIC ${SRC})
+
+# set the debug suffix
+set_target_properties(sfml-main PROPERTIES DEBUG_POSTFIX -d)
+
+# insert the major version number in the output filename
+set_target_properties(sfml-main PROPERTIES OUTPUT_NAME "sfml-main")
+
+# set the target's folder (for IDEs that support it, e.g. Visual Studio)
+set_target_properties(sfml-main PROPERTIES FOLDER "SFML")
+
+# setup the install rule
+install(TARGETS sfml-main ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT devel)
+
+# because of a current limitation on Android (which prevents one library
+# from depending on shared libraries), we need a boostrap activity which
+# will load our shared libraries manually
+if(SFML_OS_ANDROID)
+ sfml_add_library(sfml-activity SOURCES ${PROJECT_SOURCE_DIR}/src/SFML/Main/SFMLActivity.cpp)
+endif()
diff --git a/src/SFML/Main/MainAndroid.cpp b/src/SFML/Main/MainAndroid.cpp
new file mode 100644
index 0000000..5dfb6f5
--- /dev/null
+++ b/src/SFML/Main/MainAndroid.cpp
@@ -0,0 +1,512 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+// Android specific: we define the ANativeActivity_onCreate
+// entry point, handling all the native activity stuff, then
+// we call the user defined (and portable) main function in
+// an external thread so developers can keep a portable code
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+
+#ifdef SFML_SYSTEM_ANDROID
+
+#include <SFML/System/Android/Activity.hpp>
+#include <SFML/System/Sleep.hpp>
+#include <SFML/System/Thread.hpp>
+#include <SFML/System/Lock.hpp>
+#include <SFML/System/Err.hpp>
+#include <android/window.h>
+#include <android/native_activity.h>
+
+
+extern int main(int argc, char *argv[]);
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+ActivityStates* retrieveStates(ANativeActivity* activity)
+{
+ // Hide the ugly cast we find in each callback function
+ return (ActivityStates*)activity->instance;
+}
+
+
+////////////////////////////////////////////////////////////
+static void initializeMain(ActivityStates* states)
+{
+ // Protect from concurrent access
+ Lock lock(states->mutex);
+
+ // Prepare and share the looper to be read later
+ ALooper* looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS);
+ states->looper = looper;
+
+ // Get the default configuration
+ states->config = AConfiguration_new();
+ AConfiguration_fromAssetManager(states->config, states->activity->assetManager);
+}
+
+
+////////////////////////////////////////////////////////////
+static void terminateMain(ActivityStates* states)
+{
+ // Protect from concurrent access
+ Lock lock(states->mutex);
+
+ // The main thread has finished, we must explicitly ask the activity to finish
+ states->mainOver = true;
+ ANativeActivity_finish(states->activity);
+}
+
+
+////////////////////////////////////////////////////////////
+void* main(ActivityStates* states)
+{
+ // Initialize the thread before giving the hand
+ initializeMain(states);
+
+ sleep(seconds(0.5));
+ ::main(0, NULL);
+
+ // Terminate properly the main thread and wait until it's done
+ terminateMain(states);
+
+ {
+ Lock lock(states->mutex);
+
+ states->terminated = true;
+ }
+
+ return NULL;
+}
+
+} // namespace priv
+} // namespace sf
+
+
+////////////////////////////////////////////////////////////
+void goToFullscreenMode(ANativeActivity* activity)
+{
+ // Hide the status bar
+ ANativeActivity_setWindowFlags(activity, AWINDOW_FLAG_FULLSCREEN,
+ AWINDOW_FLAG_FULLSCREEN);
+
+ // Hide the navigation bar
+ JavaVM* lJavaVM = activity->vm;
+ JNIEnv* lJNIEnv = activity->env;
+
+ jobject objectActivity = activity->clazz;
+ jclass classActivity = lJNIEnv->GetObjectClass(objectActivity);
+
+ jmethodID methodGetWindow = lJNIEnv->GetMethodID(classActivity, "getWindow", "()Landroid/view/Window;");
+ jobject objectWindow = lJNIEnv->CallObjectMethod(objectActivity, methodGetWindow);
+
+ jclass classWindow = lJNIEnv->FindClass("android/view/Window");
+ jmethodID methodGetDecorView = lJNIEnv->GetMethodID(classWindow, "getDecorView", "()Landroid/view/View;");
+ jobject objectDecorView = lJNIEnv->CallObjectMethod(objectWindow, methodGetDecorView);
+
+ jclass classView = lJNIEnv->FindClass("android/view/View");
+
+ jfieldID FieldSYSTEM_UI_FLAG_LOW_PROFILE = lJNIEnv->GetStaticFieldID(classView, "SYSTEM_UI_FLAG_LOW_PROFILE", "I");
+ jint SYSTEM_UI_FLAG_LOW_PROFILE = lJNIEnv->GetStaticIntField(classView, FieldSYSTEM_UI_FLAG_LOW_PROFILE);
+
+ jfieldID FieldSYSTEM_UI_FLAG_FULLSCREEN = lJNIEnv->GetStaticFieldID(classView, "SYSTEM_UI_FLAG_FULLSCREEN", "I");
+ jint SYSTEM_UI_FLAG_FULLSCREEN = lJNIEnv->GetStaticIntField(classView, FieldSYSTEM_UI_FLAG_FULLSCREEN);
+
+ //jfieldID FieldSYSTEM_UI_FLAG_IMMERSIVE_STICKY = lJNIEnv->GetStaticFieldID(classView, "SYSTEM_UI_FLAG_IMMERSIVE_STICKY", "I");
+ //jint SYSTEM_UI_FLAG_IMMERSIVE_STICKY = lJNIEnv->GetStaticIntField(classView, FieldSYSTEM_UI_FLAG_IMMERSIVE_STICKY);
+
+ jmethodID methodsetSystemUiVisibility = lJNIEnv->GetMethodID(classView, "setSystemUiVisibility", "(I)V");
+ lJNIEnv->CallVoidMethod(objectDecorView, methodsetSystemUiVisibility, SYSTEM_UI_FLAG_LOW_PROFILE | SYSTEM_UI_FLAG_FULLSCREEN | 0x00001000);
+}
+
+////////////////////////////////////////////////////////////
+
+void getScreenSizeInPixels(ANativeActivity* activity, int* width, int* height)
+{
+ // Perform the following Java code:
+ //
+ // DisplayMetrics dm = new DisplayMetrics();
+ // getWindowManager().getDefaultDisplay().getMetrics(dm);
+
+ JavaVM* lJavaVM = activity->vm;
+ JNIEnv* lJNIEnv = activity->env;
+
+ jobject objectActivity = activity->clazz;
+ jclass classActivity = lJNIEnv->GetObjectClass(objectActivity);
+
+ jclass classDisplayMetrics = lJNIEnv->FindClass("android/util/DisplayMetrics");
+ jmethodID initDisplayMetrics = lJNIEnv->GetMethodID(classDisplayMetrics, "<init>", "()V");
+ jobject objectDisplayMetrics = lJNIEnv->NewObject(classDisplayMetrics, initDisplayMetrics);
+
+ jmethodID methodGetWindowManager = lJNIEnv->GetMethodID(classActivity, "getWindowManager", "()Landroid/view/WindowManager;");
+ jobject objectWindowManager = lJNIEnv->CallObjectMethod(objectActivity, methodGetWindowManager);
+
+ jclass classWindowManager = lJNIEnv->FindClass("android/view/WindowManager");
+ jmethodID methodGetDefaultDisplay = lJNIEnv->GetMethodID(classWindowManager, "getDefaultDisplay", "()Landroid/view/Display;");
+ jobject objectDisplay = lJNIEnv->CallObjectMethod(objectWindowManager, methodGetDefaultDisplay);
+
+ jclass classDisplay = lJNIEnv->FindClass("android/view/Display");
+ jmethodID methodGetMetrics = lJNIEnv->GetMethodID(classDisplay, "getMetrics", "(Landroid/util/DisplayMetrics;)V");
+ lJNIEnv->CallVoidMethod(objectDisplay, methodGetMetrics, objectDisplayMetrics);
+
+ jfieldID fieldWidthPixels = lJNIEnv->GetFieldID(classDisplayMetrics, "widthPixels", "I");
+ jfieldID fieldHeightPixels = lJNIEnv->GetFieldID(classDisplayMetrics, "heightPixels", "I");
+
+ *width = lJNIEnv->GetIntField(objectDisplayMetrics, fieldWidthPixels);
+ *height = lJNIEnv->GetIntField(objectDisplayMetrics, fieldHeightPixels);
+}
+
+
+////////////////////////////////////////////////////////////
+static void onStart(ANativeActivity* activity)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+static void onResume(ANativeActivity* activity)
+{
+ // Retrieve our activity states from the activity instance
+ sf::priv::ActivityStates* states = sf::priv::retrieveStates(activity);
+ sf::Lock lock(states->mutex);
+
+ if (states->fullscreen)
+ goToFullscreenMode(activity);
+
+ // Send an event to warn people the activity has been resumed
+ sf::Event event;
+ event.type = sf::Event::MouseEntered;
+
+ states->forwardEvent(event);
+}
+
+
+////////////////////////////////////////////////////////////
+static void onPause(ANativeActivity* activity)
+{
+ // Retrieve our activity states from the activity instance
+ sf::priv::ActivityStates* states = sf::priv::retrieveStates(activity);
+ sf::Lock lock(states->mutex);
+
+ // Send an event to warn people the activity has been paused
+ sf::Event event;
+ event.type = sf::Event::MouseLeft;
+
+ states->forwardEvent(event);
+}
+
+
+////////////////////////////////////////////////////////////
+static void onStop(ANativeActivity* activity)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+static void onDestroy(ANativeActivity* activity)
+{
+ // Retrieve our activity states from the activity instance
+ sf::priv::ActivityStates* states = sf::priv::retrieveStates(activity);
+
+ // Send an event to warn people the activity is being destroyed
+ {
+ sf::Lock lock(states->mutex);
+
+ // If the main thread hasn't yet finished, send the event and wait for
+ // it to finish.
+ if (!states->mainOver)
+ {
+ sf::Event event;
+ event.type = sf::Event::Closed;
+
+ states->forwardEvent(event);
+ }
+ }
+
+ // Wait for the main thread to be terminated
+ states->mutex.lock();
+
+ while (!states->terminated)
+ {
+ states->mutex.unlock();
+ sf::sleep(sf::milliseconds(20));
+ states->mutex.lock();
+ }
+
+ states->mutex.unlock();
+
+ // Terminate EGL display
+ eglTerminate(states->display);
+
+ // Delete our allocated states
+ delete states;
+
+ // Reset the activity pointer for all modules
+ sf::priv::getActivity(NULL, true);
+
+ // The application should now terminate
+}
+
+
+////////////////////////////////////////////////////////////
+static void onNativeWindowCreated(ANativeActivity* activity, ANativeWindow* window)
+{
+ sf::priv::ActivityStates* states = sf::priv::retrieveStates(activity);
+ sf::Lock lock(states->mutex);
+
+ // Update the activity states
+ states->window = window;
+
+ // Notify SFML mechanism
+ sf::Event event;
+ event.type = sf::Event::GainedFocus;
+ states->forwardEvent(event);
+
+ // Wait for the event to be taken into account by SFML
+ states->updated = false;
+ while(!states->updated)
+ {
+ states->mutex.unlock();
+ sf::sleep(sf::milliseconds(10));
+ states->mutex.lock();
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+static void onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* window)
+{
+ sf::priv::ActivityStates* states = sf::priv::retrieveStates(activity);
+ sf::Lock lock(states->mutex);
+
+ // Update the activity states
+ states->window = NULL;
+
+ // Notify SFML mechanism
+ sf::Event event;
+ event.type = sf::Event::LostFocus;
+ states->forwardEvent(event);
+
+ // Wait for the event to be taken into account by SFML
+ states->updated = false;
+ while(!states->updated)
+ {
+ states->mutex.unlock();
+ sf::sleep(sf::milliseconds(10));
+ states->mutex.lock();
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+static void onNativeWindowRedrawNeeded(ANativeActivity* activity, ANativeWindow* window)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+static void onNativeWindowResized(ANativeActivity* activity, ANativeWindow* window)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+static void onInputQueueCreated(ANativeActivity* activity, AInputQueue* queue)
+{
+ // Retrieve our activity states from the activity instance
+ sf::priv::ActivityStates* states = sf::priv::retrieveStates(activity);
+
+ // Attach the input queue
+ {
+ sf::Lock lock(states->mutex);
+
+ AInputQueue_attachLooper(queue, states->looper, 1, states->processEvent, NULL);
+ states->inputQueue = queue;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+static void onInputQueueDestroyed(ANativeActivity* activity, AInputQueue* queue)
+{
+ // Retrieve our activity states from the activity instance
+ sf::priv::ActivityStates* states = sf::priv::retrieveStates(activity);
+
+ // Detach the input queue
+ {
+ sf::Lock lock(states->mutex);
+
+ states->inputQueue = NULL;
+ AInputQueue_detachLooper(queue);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+static void onWindowFocusChanged(ANativeActivity* activity, int focused)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+static void onContentRectChanged(ANativeActivity* activity, const ARect* rect)
+{
+ // Retrieve our activity states from the activity instance
+ sf::priv::ActivityStates* states = sf::priv::retrieveStates(activity);
+ sf::Lock lock(states->mutex);
+
+ // Send an event to warn people about the window move/resize
+ sf::Event event;
+ event.type = sf::Event::Resized;
+ event.size.width = ANativeWindow_getWidth(states->window);
+ event.size.height = ANativeWindow_getHeight(states->window);
+
+ states->forwardEvent(event);
+}
+
+
+////////////////////////////////////////////////////////////
+static void onConfigurationChanged(ANativeActivity* activity)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+static void* onSaveInstanceState(ANativeActivity* activity, size_t* outLen)
+{
+ *outLen = 0;
+
+ return NULL;
+}
+
+
+////////////////////////////////////////////////////////////
+static void onLowMemory(ANativeActivity* activity)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+void ANativeActivity_onCreate(ANativeActivity* activity, void* savedState, size_t savedStateSize)
+{
+ // Create an activity states (will keep us in the know, about events we care)
+ sf::priv::ActivityStates* states = NULL;
+ states = new sf::priv::ActivityStates;
+
+ // Initialize the states value
+ states->activity = NULL;
+ states->window = NULL;
+ states->looper = NULL;
+ states->inputQueue = NULL;
+ states->config = NULL;
+
+ for (unsigned int i = 0; i < sf::Mouse::ButtonCount; i++)
+ states->isButtonPressed[i] = false;
+
+ states->display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+
+ if (savedState != NULL)
+ {
+ states->savedState = malloc(savedStateSize);
+ states->savedStateSize = savedStateSize;
+ memcpy(states->savedState, savedState, savedStateSize);
+ }
+
+ states->mainOver = false;
+
+ states->initialized = false;
+ states->terminated = false;
+
+ // Share it across the SFML modules
+ sf::priv::getActivity(states, true);
+
+ // These functions will update the activity states and therefore, will allow
+ // SFML to be kept in the know
+ activity->callbacks->onStart = onStart;
+ activity->callbacks->onResume = onResume;
+ activity->callbacks->onPause = onPause;
+ activity->callbacks->onStop = onStop;
+ activity->callbacks->onDestroy = onDestroy;
+
+ activity->callbacks->onNativeWindowCreated = onNativeWindowCreated;
+ activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed;
+ activity->callbacks->onNativeWindowRedrawNeeded = onNativeWindowRedrawNeeded;
+ activity->callbacks->onNativeWindowResized = onNativeWindowResized;
+
+ activity->callbacks->onInputQueueCreated = onInputQueueCreated;
+ activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed;
+
+ activity->callbacks->onWindowFocusChanged = onWindowFocusChanged;
+ activity->callbacks->onContentRectChanged = onContentRectChanged;
+ activity->callbacks->onConfigurationChanged = onConfigurationChanged;
+
+ activity->callbacks->onSaveInstanceState = onSaveInstanceState;
+ activity->callbacks->onLowMemory = onLowMemory;
+
+ // Share this activity with the callback functions
+ states->activity = activity;
+
+ // Keep the screen turned on and bright
+ ANativeActivity_setWindowFlags(activity, AWINDOW_FLAG_KEEP_SCREEN_ON,
+ AWINDOW_FLAG_KEEP_SCREEN_ON);
+
+ // Initialize the display
+ eglInitialize(states->display, NULL, NULL);
+
+ getScreenSizeInPixels(activity, &states->screenSize.x, &states->screenSize.y);
+
+ // Redirect error messages to logcat
+ sf::err().rdbuf(&states->logcat);
+
+ // Launch the main thread
+ sf::Thread* thread = new sf::Thread(sf::priv::main, states);
+ thread->launch();
+
+ // Wait for the main thread to be initialized
+ states->mutex.lock();
+
+ while (!states->initialized)
+ {
+ states->mutex.unlock();
+ sf::sleep(sf::milliseconds(20));
+ states->mutex.lock();
+ }
+
+ states->mutex.unlock();
+
+ // Share this state with the callback functions
+ activity->instance = states;
+}
+
+#endif // SFML_SYSTEM_ANDROID
diff --git a/src/SFML/Main/MainWin32.cpp b/src/SFML/Main/MainWin32.cpp
new file mode 100644
index 0000000..25a6247
--- /dev/null
+++ b/src/SFML/Main/MainWin32.cpp
@@ -0,0 +1,54 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+// Windows specific: we define the WinMain entry point,
+// so that developers can use the standard main function
+// even in a Win32 Application project, and thus keep a
+// portable code
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+
+#ifdef SFML_SYSTEM_WINDOWS
+
+#include <windows.h>
+
+
+extern int main(int argc, char* argv[]);
+
+////////////////////////////////////////////////////////////
+int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, INT)
+{
+ return main(__argc, __argv);
+}
+
+#endif // SFML_SYSTEM_WINDOWS
+
diff --git a/src/SFML/Main/MainiOS.mm b/src/SFML/Main/MainiOS.mm
new file mode 100644
index 0000000..ec07810
--- /dev/null
+++ b/src/SFML/Main/MainiOS.mm
@@ -0,0 +1,63 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+// iOS specific: SFML needs to hook the main function, to
+// launch the iOS application (event loop), and then call the
+// user main from inside it.
+//
+// Our strategy is to rename the user main to 'sfmlMain' with
+// a macro (see Main.hpp), and call this modified main ourselves.
+//
+// Note that half of this trick (the sfmlMain placeholders and
+// the application delegate) is defined sfml-window; see there
+// for the full implementation.
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+
+#ifdef SFML_SYSTEM_IOS
+
+#include <UIKit/UIKit.h>
+
+
+////////////////////////////////////////////////////////////
+int main(int argc, char** argv)
+{
+ // Note: we intentionally drop command line arguments,
+ // there's no such thing as a command line on an iOS device :)
+
+ // Important: "SFAppDelegate" must always match the name of the
+ // application delegate class defined in sfml-window
+
+ return UIApplicationMain(argc, argv, nil, @"SFAppDelegate");
+}
+
+#endif // SFML_SYSTEM_IOS
diff --git a/src/SFML/Main/SFMLActivity.cpp b/src/SFML/Main/SFMLActivity.cpp
new file mode 100644
index 0000000..549303d
--- /dev/null
+++ b/src/SFML/Main/SFMLActivity.cpp
@@ -0,0 +1,193 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#include <SFML/Config.hpp>
+#include <string>
+#include <android/native_activity.h>
+#include <android/log.h>
+#include <dlfcn.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <jni.h>
+
+#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_INFO, "sfml-activity", __VA_ARGS__))
+
+namespace {
+ typedef void (*activityOnCreatePointer)(ANativeActivity*, void*, size_t);
+}
+
+std::string getLibraryName(JNIEnv* lJNIEnv, jobject& objectActivityInfo)
+{
+ // This function reads the value of meta-data "sfml.app.lib_name"
+ // found in the Android Manifest file and returns it. It performs the
+ // following Java code using the JNI interface:
+ //
+ // ai.metaData.getString("sfml.app.lib_name");
+
+ // Get metaData instance from the ActivityInfo object
+ jclass classActivityInfo = lJNIEnv->FindClass("android/content/pm/ActivityInfo");
+ jfieldID fieldMetaData = lJNIEnv->GetFieldID(classActivityInfo, "metaData", "Landroid/os/Bundle;");
+ jobject objectMetaData = lJNIEnv->GetObjectField(objectActivityInfo, fieldMetaData);
+
+ // Create a java string object containing "sfml.app.lib_name"
+ jobject objectName = lJNIEnv->NewStringUTF("sfml.app.lib_name");
+
+ // Get the value of meta-data named "sfml.app.lib_name"
+ jclass classBundle = lJNIEnv->FindClass("android/os/Bundle");
+ jmethodID methodGetString = lJNIEnv->GetMethodID(classBundle, "getString", "(Ljava/lang/String;)Ljava/lang/String;");
+ jstring valueString = (jstring)lJNIEnv->CallObjectMethod(objectMetaData, methodGetString, objectName);
+
+ // No meta-data "sfml.app.lib_name" was found so we abord and inform the user
+ if (valueString == NULL)
+ {
+ LOGE("No meta-data 'sfml.app.lib_name' found in AndroidManifest.xml file");
+ exit(1);
+ }
+
+ // Convert the application name to a C++ string and return it
+ const jsize applicationNameLength = lJNIEnv->GetStringUTFLength(valueString);
+ const char* applicationName = lJNIEnv->GetStringUTFChars(valueString, NULL);
+ std::string ret(applicationName, applicationNameLength);
+ lJNIEnv->ReleaseStringUTFChars(valueString, applicationName);
+
+ return ret;
+}
+
+void* loadLibrary(const char* libraryName, JNIEnv* lJNIEnv, jobject& ObjectActivityInfo)
+{
+ // Find out the absolute path of the library
+ jclass ClassActivityInfo = lJNIEnv->FindClass("android/content/pm/ActivityInfo");
+ jfieldID FieldApplicationInfo = lJNIEnv->GetFieldID(ClassActivityInfo, "applicationInfo", "Landroid/content/pm/ApplicationInfo;");
+ jobject ObjectApplicationInfo = lJNIEnv->GetObjectField(ObjectActivityInfo, FieldApplicationInfo);
+
+ jclass ClassApplicationInfo = lJNIEnv->FindClass("android/content/pm/ApplicationInfo");
+ jfieldID FieldNativeLibraryDir = lJNIEnv->GetFieldID(ClassApplicationInfo, "nativeLibraryDir", "Ljava/lang/String;");
+
+ jobject ObjectDirPath = lJNIEnv->GetObjectField(ObjectApplicationInfo, FieldNativeLibraryDir);
+
+ jclass ClassSystem = lJNIEnv->FindClass("java/lang/System");
+ jmethodID StaticMethodMapLibraryName = lJNIEnv->GetStaticMethodID(ClassSystem, "mapLibraryName", "(Ljava/lang/String;)Ljava/lang/String;");
+
+ jstring LibNameObject = lJNIEnv->NewStringUTF(libraryName);
+ jobject ObjectName = lJNIEnv->CallStaticObjectMethod(ClassSystem, StaticMethodMapLibraryName, LibNameObject);
+
+ jclass ClassFile = lJNIEnv->FindClass("java/io/File");
+ jmethodID FileConstructor = lJNIEnv->GetMethodID(ClassFile, "<init>", "(Ljava/lang/String;Ljava/lang/String;)V");
+ jobject ObjectFile = lJNIEnv->NewObject(ClassFile, FileConstructor, ObjectDirPath, ObjectName);
+
+ // Get the library absolute path and convert it
+ jmethodID MethodGetPath = lJNIEnv->GetMethodID(ClassFile, "getPath", "()Ljava/lang/String;");
+ jstring javaLibraryPath = static_cast<jstring>(lJNIEnv->CallObjectMethod(ObjectFile, MethodGetPath));
+ const char* libraryPath = lJNIEnv->GetStringUTFChars(javaLibraryPath, NULL);
+
+ // Manually load the library
+ void * handle = dlopen(libraryPath, RTLD_NOW | RTLD_GLOBAL);
+ if (!handle)
+ {
+ LOGE("dlopen(\"%s\"): %s", libraryPath, dlerror());
+ exit(1);
+ }
+
+ // Release the Java string
+ lJNIEnv->ReleaseStringUTFChars(javaLibraryPath, libraryPath);
+
+ return handle;
+}
+
+void ANativeActivity_onCreate(ANativeActivity* activity, void* savedState, size_t savedStateSize)
+{
+ // Before we can load a library, we need to find out its location. As
+ // we're powerless here in C/C++, we need the JNI interface to communicate
+ // with the attached Java virtual machine and perform some Java calls in
+ // order to retrieve the absolute path of our libraries.
+ //
+ // Here's the snippet of Java code it performs:
+ // --------------------------------------------
+ // ai = getPackageManager().getActivityInfo(getIntent().getComponent(), PackageManager.GET_META_DATA);
+ // File libraryFile = new File(ai.applicationInfo.nativeLibraryDir, System.mapLibraryName(libname));
+ // String path = libraryFile.getPath();
+ //
+ // With libname being the library name such as "jpeg".
+
+ // Retrieve JNI environment and JVM instance
+ JavaVM* lJavaVM = activity->vm;
+ JNIEnv* lJNIEnv = activity->env;
+
+ // Retrieve the NativeActivity
+ jobject ObjectNativeActivity = activity->clazz;
+ jclass ClassNativeActivity = lJNIEnv->GetObjectClass(ObjectNativeActivity);
+
+ // Retrieve the ActivityInfo
+ jmethodID MethodGetPackageManager = lJNIEnv->GetMethodID(ClassNativeActivity, "getPackageManager", "()Landroid/content/pm/PackageManager;");
+ jobject ObjectPackageManager = lJNIEnv->CallObjectMethod(ObjectNativeActivity, MethodGetPackageManager);
+
+ jmethodID MethodGetIndent = lJNIEnv->GetMethodID(ClassNativeActivity, "getIntent", "()Landroid/content/Intent;");
+ jobject ObjectIntent = lJNIEnv->CallObjectMethod(ObjectNativeActivity, MethodGetIndent);
+
+ jclass ClassIntent = lJNIEnv->FindClass("android/content/Intent");
+ jmethodID MethodGetComponent = lJNIEnv->GetMethodID(ClassIntent, "getComponent", "()Landroid/content/ComponentName;");
+
+ jobject ObjectComponentName = lJNIEnv->CallObjectMethod(ObjectIntent, MethodGetComponent);
+
+ jclass ClassPackageManager = lJNIEnv->FindClass("android/content/pm/PackageManager");
+
+ jfieldID FieldGET_META_DATA = lJNIEnv->GetStaticFieldID(ClassPackageManager, "GET_META_DATA", "I");
+ jint GET_META_DATA = lJNIEnv->GetStaticIntField(ClassPackageManager, FieldGET_META_DATA);
+
+ jmethodID MethodGetActivityInfo = lJNIEnv->GetMethodID(ClassPackageManager, "getActivityInfo", "(Landroid/content/ComponentName;I)Landroid/content/pm/ActivityInfo;");
+ jobject ObjectActivityInfo = lJNIEnv->CallObjectMethod(ObjectPackageManager, MethodGetActivityInfo, ObjectComponentName, GET_META_DATA);
+
+ // Load our libraries in reverse order
+ loadLibrary("c++_shared", lJNIEnv, ObjectActivityInfo);
+ loadLibrary("sndfile", lJNIEnv, ObjectActivityInfo);
+ loadLibrary("openal", lJNIEnv, ObjectActivityInfo);
+
+#if !defined(SFML_DEBUG)
+ loadLibrary("sfml-system", lJNIEnv, ObjectActivityInfo);
+ loadLibrary("sfml-window", lJNIEnv, ObjectActivityInfo);
+ loadLibrary("sfml-graphics", lJNIEnv, ObjectActivityInfo);
+ loadLibrary("sfml-audio", lJNIEnv, ObjectActivityInfo);
+ loadLibrary("sfml-network", lJNIEnv, ObjectActivityInfo);
+#else
+ loadLibrary("sfml-system-d", lJNIEnv, ObjectActivityInfo);
+ loadLibrary("sfml-window-d", lJNIEnv, ObjectActivityInfo);
+ loadLibrary("sfml-graphics-d", lJNIEnv, ObjectActivityInfo);
+ loadLibrary("sfml-audio-d", lJNIEnv, ObjectActivityInfo);
+ loadLibrary("sfml-network-d", lJNIEnv, ObjectActivityInfo);
+#endif
+
+ std::string libName = getLibraryName(lJNIEnv, ObjectActivityInfo);
+ void* handle = loadLibrary(libName.c_str(), lJNIEnv, ObjectActivityInfo);
+
+ // Call the original ANativeActivity_onCreate function
+ activityOnCreatePointer ANativeActivity_onCreate = (activityOnCreatePointer)dlsym(handle, "ANativeActivity_onCreate");
+
+ if (!ANativeActivity_onCreate)
+ {
+ LOGE("sfml-activity: Undefined symbol ANativeActivity_onCreate");
+ exit(1);
+ }
+
+ ANativeActivity_onCreate(activity, savedState, savedStateSize);
+}
diff --git a/src/SFML/Network/CMakeLists.txt b/src/SFML/Network/CMakeLists.txt
index fdf3966..d1ff757 100644
--- a/src/SFML/Network/CMakeLists.txt
+++ b/src/SFML/Network/CMakeLists.txt
@@ -1,57 +1,57 @@
-
-set(INCROOT ${PROJECT_SOURCE_DIR}/include/SFML/Network)
-set(SRCROOT ${PROJECT_SOURCE_DIR}/src/SFML/Network)
-
-# all source files
-set(SRC
- ${INCROOT}/Export.hpp
- ${SRCROOT}/Ftp.cpp
- ${INCROOT}/Ftp.hpp
- ${SRCROOT}/Http.cpp
- ${INCROOT}/Http.hpp
- ${SRCROOT}/IpAddress.cpp
- ${INCROOT}/IpAddress.hpp
- ${SRCROOT}/Packet.cpp
- ${INCROOT}/Packet.hpp
- ${SRCROOT}/Socket.cpp
- ${INCROOT}/Socket.hpp
- ${SRCROOT}/SocketImpl.hpp
- ${INCROOT}/SocketHandle.hpp
- ${SRCROOT}/SocketSelector.cpp
- ${INCROOT}/SocketSelector.hpp
- ${SRCROOT}/TcpListener.cpp
- ${INCROOT}/TcpListener.hpp
- ${SRCROOT}/TcpSocket.cpp
- ${INCROOT}/TcpSocket.hpp
- ${SRCROOT}/UdpSocket.cpp
- ${INCROOT}/UdpSocket.hpp
-)
-
-# add platform specific sources
-if(WINDOWS)
- set(SRC
- ${SRC}
- ${SRCROOT}/Win32/SocketImpl.cpp
- ${SRCROOT}/Win32/SocketImpl.hpp
- )
-else()
- set(SRC
- ${SRC}
- ${SRCROOT}/Unix/SocketImpl.cpp
- ${SRCROOT}/Unix/SocketImpl.hpp
- )
-endif()
-
-source_group("" FILES ${SRC})
-
-# build the list of external libraries to link
-set(NETWORK_EXT_LIBS)
-if(WINDOWS)
- set(NETWORK_EXT_LIBS ${NETWORK_EXT_LIBS} ws2_32)
-endif()
-
-# define the sfml-network target
-sfml_add_library(sfml-network
- SOURCES ${SRC}
- DEPENDS sfml-system
- EXTERNAL_LIBS ${NETWORK_EXT_LIBS})
+
+set(INCROOT ${PROJECT_SOURCE_DIR}/include/SFML/Network)
+set(SRCROOT ${PROJECT_SOURCE_DIR}/src/SFML/Network)
+
+# all source files
+set(SRC
+ ${INCROOT}/Export.hpp
+ ${SRCROOT}/Ftp.cpp
+ ${INCROOT}/Ftp.hpp
+ ${SRCROOT}/Http.cpp
+ ${INCROOT}/Http.hpp
+ ${SRCROOT}/IpAddress.cpp
+ ${INCROOT}/IpAddress.hpp
+ ${SRCROOT}/Packet.cpp
+ ${INCROOT}/Packet.hpp
+ ${SRCROOT}/Socket.cpp
+ ${INCROOT}/Socket.hpp
+ ${SRCROOT}/SocketImpl.hpp
+ ${INCROOT}/SocketHandle.hpp
+ ${SRCROOT}/SocketSelector.cpp
+ ${INCROOT}/SocketSelector.hpp
+ ${SRCROOT}/TcpListener.cpp
+ ${INCROOT}/TcpListener.hpp
+ ${SRCROOT}/TcpSocket.cpp
+ ${INCROOT}/TcpSocket.hpp
+ ${SRCROOT}/UdpSocket.cpp
+ ${INCROOT}/UdpSocket.hpp
+)
+
+# add platform specific sources
+if(SFML_OS_WINDOWS)
+ set(SRC
+ ${SRC}
+ ${SRCROOT}/Win32/SocketImpl.cpp
+ ${SRCROOT}/Win32/SocketImpl.hpp
+ )
+else()
+ set(SRC
+ ${SRC}
+ ${SRCROOT}/Unix/SocketImpl.cpp
+ ${SRCROOT}/Unix/SocketImpl.hpp
+ )
+endif()
+
+source_group("" FILES ${SRC})
+
+# build the list of external libraries to link
+set(NETWORK_EXT_LIBS)
+if(SFML_OS_WINDOWS)
+ set(NETWORK_EXT_LIBS ${NETWORK_EXT_LIBS} ws2_32)
+endif()
+
+# define the sfml-network target
+sfml_add_library(sfml-network
+ SOURCES ${SRC}
+ DEPENDS sfml-system
+ EXTERNAL_LIBS ${NETWORK_EXT_LIBS})
diff --git a/src/SFML/Network/Ftp.cpp b/src/SFML/Network/Ftp.cpp
index b2fe846..0f4049e 100644
--- a/src/SFML/Network/Ftp.cpp
+++ b/src/SFML/Network/Ftp.cpp
@@ -1,616 +1,640 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Network/Ftp.hpp>
-#include <SFML/Network/IpAddress.hpp>
-#include <algorithm>
-#include <fstream>
-#include <iterator>
-#include <sstream>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-class Ftp::DataChannel : NonCopyable
-{
-public :
-
- ////////////////////////////////////////////////////////////
- DataChannel(Ftp& owner);
-
- ////////////////////////////////////////////////////////////
- Ftp::Response open(Ftp::TransferMode mode);
-
- ////////////////////////////////////////////////////////////
- void send(const std::vector<char>& data);
-
- ////////////////////////////////////////////////////////////
- void receive(std::vector<char>& data);
-
-private :
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- Ftp& m_ftp; ///< Reference to the owner Ftp instance
- TcpSocket m_dataSocket; ///< Socket used for data transfers
-};
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response::Response(Status code, const std::string& message) :
-m_status (code),
-m_message(message)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-bool Ftp::Response::isOk() const
-{
- return m_status < 400;
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response::Status Ftp::Response::getStatus() const
-{
- return m_status;
-}
-
-
-////////////////////////////////////////////////////////////
-const std::string& Ftp::Response::getMessage() const
-{
- return m_message;
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::DirectoryResponse::DirectoryResponse(const Ftp::Response& response) :
-Ftp::Response(response)
-{
- if (isOk())
- {
- // Extract the directory from the server response
- std::string::size_type begin = getMessage().find('"', 0);
- std::string::size_type end = getMessage().find('"', begin + 1);
- m_directory = getMessage().substr(begin + 1, end - begin - 1);
- }
-}
-
-
-////////////////////////////////////////////////////////////
-const std::string& Ftp::DirectoryResponse::getDirectory() const
-{
- return m_directory;
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::ListingResponse::ListingResponse(const Ftp::Response& response, const std::vector<char>& data) :
-Ftp::Response(response)
-{
- if (isOk())
- {
- // Fill the array of strings
- std::string paths(data.begin(), data.end());
- std::string::size_type lastPos = 0;
- for (std::string::size_type pos = paths.find("\r\n"); pos != std::string::npos; pos = paths.find("\r\n", lastPos))
- {
- m_listing.push_back(paths.substr(lastPos, pos - lastPos));
- lastPos = pos + 2;
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////
-const std::vector<std::string>& Ftp::ListingResponse::getListing() const
-{
- return m_listing;
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::~Ftp()
-{
- disconnect();
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response Ftp::connect(const IpAddress& server, unsigned short port, Time timeout)
-{
- // Connect to the server
- if (m_commandSocket.connect(server, port, timeout) != Socket::Done)
- return Response(Response::ConnectionFailed);
-
- // Get the response to the connection
- return getResponse();
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response Ftp::login()
-{
- return login("anonymous", "user@sfml-dev.org");
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response Ftp::login(const std::string& name, const std::string& password)
-{
- Response response = sendCommand("USER", name);
- if (response.isOk())
- response = sendCommand("PASS", password);
-
- return response;
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response Ftp::disconnect()
-{
- // Send the exit command
- Response response = sendCommand("QUIT");
- if (response.isOk())
- m_commandSocket.disconnect();
-
- return response;
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response Ftp::keepAlive()
-{
- return sendCommand("NOOP");
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::DirectoryResponse Ftp::getWorkingDirectory()
-{
- return DirectoryResponse(sendCommand("PWD"));
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::ListingResponse Ftp::getDirectoryListing(const std::string& directory)
-{
- // Open a data channel on default port (20) using ASCII transfer mode
- std::vector<char> directoryData;
- DataChannel data(*this);
- Response response = data.open(Ascii);
- if (response.isOk())
- {
- // Tell the server to send us the listing
- response = sendCommand("NLST", directory);
- if (response.isOk())
- {
- // Receive the listing
- data.receive(directoryData);
-
- // Get the response from the server
- response = getResponse();
- }
- }
-
- return ListingResponse(response, directoryData);
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response Ftp::changeDirectory(const std::string& directory)
-{
- return sendCommand("CWD", directory);
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response Ftp::parentDirectory()
-{
- return sendCommand("CDUP");
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response Ftp::createDirectory(const std::string& name)
-{
- return sendCommand("MKD", name);
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response Ftp::deleteDirectory(const std::string& name)
-{
- return sendCommand("RMD", name);
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response Ftp::renameFile(const std::string& file, const std::string& newName)
-{
- Response response = sendCommand("RNFR", file);
- if (response.isOk())
- response = sendCommand("RNTO", newName);
-
- return response;
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response Ftp::deleteFile(const std::string& name)
-{
- return sendCommand("DELE", name);
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response Ftp::download(const std::string& remoteFile, const std::string& localPath, TransferMode mode)
-{
- // Open a data channel using the given transfer mode
- DataChannel data(*this);
- Response response = data.open(mode);
- if (response.isOk())
- {
- // Tell the server to start the transfer
- response = sendCommand("RETR", remoteFile);
- if (response.isOk())
- {
- // Receive the file data
- std::vector<char> fileData;
- data.receive(fileData);
-
- // Get the response from the server
- response = getResponse();
- if (response.isOk())
- {
- // Extract the filename from the file path
- std::string filename = remoteFile;
- std::string::size_type pos = filename.find_last_of("/\\");
- if (pos != std::string::npos)
- filename = filename.substr(pos + 1);
-
- // Make sure the destination path ends with a slash
- std::string path = localPath;
- if (!path.empty() && (path[path.size() - 1] != '\\') && (path[path.size() - 1] != '/'))
- path += "/";
-
- // Create the file and copy the received data into it
- std::ofstream file((path + filename).c_str(), std::ios_base::binary);
- if (!file)
- return Response(Response::InvalidFile);
-
- if (!fileData.empty())
- file.write(&fileData[0], static_cast<std::streamsize>(fileData.size()));
- }
- }
- }
-
- return response;
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response Ftp::upload(const std::string& localFile, const std::string& remotePath, TransferMode mode)
-{
- // Get the contents of the file to send
- std::ifstream file(localFile.c_str(), std::ios_base::binary);
- if (!file)
- return Response(Response::InvalidFile);
-
- file.seekg(0, std::ios::end);
- std::size_t length = static_cast<std::size_t>(file.tellg());
- file.seekg(0, std::ios::beg);
- std::vector<char> fileData(length);
- if (length > 0)
- file.read(&fileData[0], static_cast<std::streamsize>(length));
-
- // Extract the filename from the file path
- std::string filename = localFile;
- std::string::size_type pos = filename.find_last_of("/\\");
- if (pos != std::string::npos)
- filename = filename.substr(pos + 1);
-
- // Make sure the destination path ends with a slash
- std::string path = remotePath;
- if (!path.empty() && (path[path.size() - 1] != '\\') && (path[path.size() - 1] != '/'))
- path += "/";
-
- // Open a data channel using the given transfer mode
- DataChannel data(*this);
- Response response = data.open(mode);
- if (response.isOk())
- {
- // Tell the server to start the transfer
- response = sendCommand("STOR", path + filename);
- if (response.isOk())
- {
- // Send the file data
- data.send(fileData);
-
- // Get the response from the server
- response = getResponse();
- }
- }
-
- return response;
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response Ftp::sendCommand(const std::string& command, const std::string& parameter)
-{
- // Build the command string
- std::string commandStr;
- if (parameter != "")
- commandStr = command + " " + parameter + "\r\n";
- else
- commandStr = command + "\r\n";
-
- // Send it to the server
- if (m_commandSocket.send(commandStr.c_str(), commandStr.length()) != Socket::Done)
- return Response(Response::ConnectionClosed);
-
- // Get the response
- return getResponse();
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response Ftp::getResponse()
-{
- // We'll use a variable to keep track of the last valid code.
- // It is useful in case of multi-lines responses, because the end of such a response
- // will start by the same code
- unsigned int lastCode = 0;
- bool isInsideMultiline = false;
- std::string message;
-
- for (;;)
- {
- // Receive the response from the server
- char buffer[1024];
- std::size_t length;
- if (m_commandSocket.receive(buffer, sizeof(buffer), length) != Socket::Done)
- return Response(Response::ConnectionClosed);
-
- // There can be several lines inside the received buffer, extract them all
- std::istringstream in(std::string(buffer, length), std::ios_base::binary);
- while (in)
- {
- // Try to extract the code
- unsigned int code;
- if (in >> code)
- {
- // Extract the separator
- char separator;
- in.get(separator);
-
- // The '-' character means a multiline response
- if ((separator == '-') && !isInsideMultiline)
- {
- // Set the multiline flag
- isInsideMultiline = true;
-
- // Keep track of the code
- if (lastCode == 0)
- lastCode = code;
-
- // Extract the line
- std::getline(in, message);
-
- // Remove the ending '\r' (all lines are terminated by "\r\n")
- message.erase(message.length() - 1);
- message = separator + message + "\n";
- }
- else
- {
- // We must make sure that the code is the same, otherwise it means
- // we haven't reached the end of the multiline response
- if ((separator != '-') && ((code == lastCode) || (lastCode == 0)))
- {
- // Clear the multiline flag
- isInsideMultiline = false;
-
- // Extract the line
- std::string line;
- std::getline(in, line);
-
- // Remove the ending '\r' (all lines are terminated by "\r\n")
- line.erase(line.length() - 1);
-
- // Append it to the message
- if (code == lastCode)
- {
- std::ostringstream out;
- out << code << separator << line;
- message += out.str();
- }
- else
- {
- message = separator + line;
- }
-
- // Return the response code and message
- return Response(static_cast<Response::Status>(code), message);
- }
- else
- {
- // The line we just read was actually not a response,
- // only a new part of the current multiline response
-
- // Extract the line
- std::string line;
- std::getline(in, line);
-
- if (!line.empty())
- {
- // Remove the ending '\r' (all lines are terminated by "\r\n")
- line.erase(line.length() - 1);
-
- // Append it to the current message
- std::ostringstream out;
- out << code << separator << line << "\n";
- message += out.str();
- }
- }
- }
- }
- else if (lastCode != 0)
- {
- // It seems we are in the middle of a multiline response
-
- // Clear the error bits of the stream
- in.clear();
-
- // Extract the line
- std::string line;
- std::getline(in, line);
-
- if (!line.empty())
- {
- // Remove the ending '\r' (all lines are terminated by "\r\n")
- line.erase(line.length() - 1);
-
- // Append it to the current message
- message += line + "\n";
- }
- }
- else
- {
- // Error : cannot extract the code, and we are not in a multiline response
- return Response(Response::InvalidResponse);
- }
- }
- }
-
- // We never reach there
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::DataChannel::DataChannel(Ftp& owner) :
-m_ftp(owner)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-Ftp::Response Ftp::DataChannel::open(Ftp::TransferMode mode)
-{
- // Open a data connection in active mode (we connect to the server)
- Ftp::Response response = m_ftp.sendCommand("PASV");
- if (response.isOk())
- {
- // Extract the connection address and port from the response
- std::string::size_type begin = response.getMessage().find_first_of("0123456789");
- if (begin != std::string::npos)
- {
- Uint8 data[6] = {0, 0, 0, 0, 0, 0};
- std::string str = response.getMessage().substr(begin);
- std::size_t index = 0;
- for (int i = 0; i < 6; ++i)
- {
- // Extract the current number
- while (isdigit(str[index]))
- {
- data[i] = data[i] * 10 + (str[index] - '0');
- index++;
- }
-
- // Skip separator
- index++;
- }
-
- // Reconstruct connection port and address
- unsigned short port = data[4] * 256 + data[5];
- IpAddress address(static_cast<Uint8>(data[0]),
- static_cast<Uint8>(data[1]),
- static_cast<Uint8>(data[2]),
- static_cast<Uint8>(data[3]));
-
- // Connect the data channel to the server
- if (m_dataSocket.connect(address, port) == Socket::Done)
- {
- // Translate the transfer mode to the corresponding FTP parameter
- std::string modeStr;
- switch (mode)
- {
- case Ftp::Binary : modeStr = "I"; break;
- case Ftp::Ascii : modeStr = "A"; break;
- case Ftp::Ebcdic : modeStr = "E"; break;
- }
-
- // Set the transfer mode
- response = m_ftp.sendCommand("TYPE", modeStr);
- }
- else
- {
- // Failed to connect to the server
- response = Ftp::Response(Ftp::Response::ConnectionFailed);
- }
- }
- }
-
- return response;
-}
-
-
-////////////////////////////////////////////////////////////
-void Ftp::DataChannel::receive(std::vector<char>& data)
-{
- // Receive data
- data.clear();
- char buffer[1024];
- std::size_t received;
- while (m_dataSocket.receive(buffer, sizeof(buffer), received) == Socket::Done)
- {
- std::copy(buffer, buffer + received, std::back_inserter(data));
- }
-
- // Close the data socket
- m_dataSocket.disconnect();
-}
-
-
-////////////////////////////////////////////////////////////
-void Ftp::DataChannel::send(const std::vector<char>& data)
-{
- // Send data
- if (!data.empty())
- m_dataSocket.send(&data[0], data.size());
-
- // Close the data socket
- m_dataSocket.disconnect();
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Network/Ftp.hpp>
+#include <SFML/Network/IpAddress.hpp>
+#include <SFML/System/Err.hpp>
+#include <algorithm>
+#include <cctype>
+#include <fstream>
+#include <iterator>
+#include <sstream>
+#include <cstdio>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+class Ftp::DataChannel : NonCopyable
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ DataChannel(Ftp& owner);
+
+ ////////////////////////////////////////////////////////////
+ Ftp::Response open(Ftp::TransferMode mode);
+
+ ////////////////////////////////////////////////////////////
+ void send(std::istream& stream);
+
+ ////////////////////////////////////////////////////////////
+ void receive(std::ostream& stream);
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ Ftp& m_ftp; ///< Reference to the owner Ftp instance
+ TcpSocket m_dataSocket; ///< Socket used for data transfers
+};
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response::Response(Status code, const std::string& message) :
+m_status (code),
+m_message(message)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+bool Ftp::Response::isOk() const
+{
+ return m_status < 400;
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response::Status Ftp::Response::getStatus() const
+{
+ return m_status;
+}
+
+
+////////////////////////////////////////////////////////////
+const std::string& Ftp::Response::getMessage() const
+{
+ return m_message;
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::DirectoryResponse::DirectoryResponse(const Ftp::Response& response) :
+Ftp::Response(response)
+{
+ if (isOk())
+ {
+ // Extract the directory from the server response
+ std::string::size_type begin = getMessage().find('"', 0);
+ std::string::size_type end = getMessage().find('"', begin + 1);
+ m_directory = getMessage().substr(begin + 1, end - begin - 1);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+const std::string& Ftp::DirectoryResponse::getDirectory() const
+{
+ return m_directory;
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::ListingResponse::ListingResponse(const Ftp::Response& response, const std::string& data) :
+Ftp::Response(response)
+{
+ if (isOk())
+ {
+ // Fill the array of strings
+ std::string::size_type lastPos = 0;
+ for (std::string::size_type pos = data.find("\r\n"); pos != std::string::npos; pos = data.find("\r\n", lastPos))
+ {
+ m_listing.push_back(data.substr(lastPos, pos - lastPos));
+ lastPos = pos + 2;
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+const std::vector<std::string>& Ftp::ListingResponse::getListing() const
+{
+ return m_listing;
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::~Ftp()
+{
+ disconnect();
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response Ftp::connect(const IpAddress& server, unsigned short port, Time timeout)
+{
+ // Connect to the server
+ if (m_commandSocket.connect(server, port, timeout) != Socket::Done)
+ return Response(Response::ConnectionFailed);
+
+ // Get the response to the connection
+ return getResponse();
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response Ftp::login()
+{
+ return login("anonymous", "user@sfml-dev.org");
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response Ftp::login(const std::string& name, const std::string& password)
+{
+ Response response = sendCommand("USER", name);
+ if (response.isOk())
+ response = sendCommand("PASS", password);
+
+ return response;
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response Ftp::disconnect()
+{
+ // Send the exit command
+ Response response = sendCommand("QUIT");
+ if (response.isOk())
+ m_commandSocket.disconnect();
+
+ return response;
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response Ftp::keepAlive()
+{
+ return sendCommand("NOOP");
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::DirectoryResponse Ftp::getWorkingDirectory()
+{
+ return DirectoryResponse(sendCommand("PWD"));
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::ListingResponse Ftp::getDirectoryListing(const std::string& directory)
+{
+ // Open a data channel on default port (20) using ASCII transfer mode
+ std::ostringstream directoryData;
+ DataChannel data(*this);
+ Response response = data.open(Ascii);
+ if (response.isOk())
+ {
+ // Tell the server to send us the listing
+ response = sendCommand("NLST", directory);
+ if (response.isOk())
+ {
+ // Receive the listing
+ data.receive(directoryData);
+
+ // Get the response from the server
+ response = getResponse();
+ }
+ }
+
+ return ListingResponse(response, directoryData.str());
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response Ftp::changeDirectory(const std::string& directory)
+{
+ return sendCommand("CWD", directory);
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response Ftp::parentDirectory()
+{
+ return sendCommand("CDUP");
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response Ftp::createDirectory(const std::string& name)
+{
+ return sendCommand("MKD", name);
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response Ftp::deleteDirectory(const std::string& name)
+{
+ return sendCommand("RMD", name);
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response Ftp::renameFile(const std::string& file, const std::string& newName)
+{
+ Response response = sendCommand("RNFR", file);
+ if (response.isOk())
+ response = sendCommand("RNTO", newName);
+
+ return response;
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response Ftp::deleteFile(const std::string& name)
+{
+ return sendCommand("DELE", name);
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response Ftp::download(const std::string& remoteFile, const std::string& localPath, TransferMode mode)
+{
+ // Open a data channel using the given transfer mode
+ DataChannel data(*this);
+ Response response = data.open(mode);
+ if (response.isOk())
+ {
+ // Tell the server to start the transfer
+ response = sendCommand("RETR", remoteFile);
+ if (response.isOk())
+ {
+ // Extract the filename from the file path
+ std::string filename = remoteFile;
+ std::string::size_type pos = filename.find_last_of("/\\");
+ if (pos != std::string::npos)
+ filename = filename.substr(pos + 1);
+
+ // Make sure the destination path ends with a slash
+ std::string path = localPath;
+ if (!path.empty() && (path[path.size() - 1] != '\\') && (path[path.size() - 1] != '/'))
+ path += "/";
+
+ // Create the file and truncate it if necessary
+ std::ofstream file((path + filename).c_str(), std::ios_base::binary | std::ios_base::trunc);
+ if (!file)
+ return Response(Response::InvalidFile);
+
+ // Receive the file data
+ data.receive(file);
+
+ // Close the file
+ file.close();
+
+ // Get the response from the server
+ response = getResponse();
+
+ // If the download was unsuccessful, delete the partial file
+ if (!response.isOk())
+ std::remove((path + filename).c_str());
+ }
+ }
+
+ return response;
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response Ftp::upload(const std::string& localFile, const std::string& remotePath, TransferMode mode)
+{
+ // Get the contents of the file to send
+ std::ifstream file(localFile.c_str(), std::ios_base::binary);
+ if (!file)
+ return Response(Response::InvalidFile);
+
+ // Extract the filename from the file path
+ std::string filename = localFile;
+ std::string::size_type pos = filename.find_last_of("/\\");
+ if (pos != std::string::npos)
+ filename = filename.substr(pos + 1);
+
+ // Make sure the destination path ends with a slash
+ std::string path = remotePath;
+ if (!path.empty() && (path[path.size() - 1] != '\\') && (path[path.size() - 1] != '/'))
+ path += "/";
+
+ // Open a data channel using the given transfer mode
+ DataChannel data(*this);
+ Response response = data.open(mode);
+ if (response.isOk())
+ {
+ // Tell the server to start the transfer
+ response = sendCommand("STOR", path + filename);
+ if (response.isOk())
+ {
+ // Send the file data
+ data.send(file);
+
+ // Get the response from the server
+ response = getResponse();
+ }
+ }
+
+ return response;
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response Ftp::sendCommand(const std::string& command, const std::string& parameter)
+{
+ // Build the command string
+ std::string commandStr;
+ if (parameter != "")
+ commandStr = command + " " + parameter + "\r\n";
+ else
+ commandStr = command + "\r\n";
+
+ // Send it to the server
+ if (m_commandSocket.send(commandStr.c_str(), commandStr.length()) != Socket::Done)
+ return Response(Response::ConnectionClosed);
+
+ // Get the response
+ return getResponse();
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response Ftp::getResponse()
+{
+ // We'll use a variable to keep track of the last valid code.
+ // It is useful in case of multi-lines responses, because the end of such a response
+ // will start by the same code
+ unsigned int lastCode = 0;
+ bool isInsideMultiline = false;
+ std::string message;
+
+ for (;;)
+ {
+ // Receive the response from the server
+ char buffer[1024];
+ std::size_t length;
+ if (m_commandSocket.receive(buffer, sizeof(buffer), length) != Socket::Done)
+ return Response(Response::ConnectionClosed);
+
+ // There can be several lines inside the received buffer, extract them all
+ std::istringstream in(std::string(buffer, length), std::ios_base::binary);
+ while (in)
+ {
+ // Try to extract the code
+ unsigned int code;
+ if (in >> code)
+ {
+ // Extract the separator
+ char separator;
+ in.get(separator);
+
+ // The '-' character means a multiline response
+ if ((separator == '-') && !isInsideMultiline)
+ {
+ // Set the multiline flag
+ isInsideMultiline = true;
+
+ // Keep track of the code
+ if (lastCode == 0)
+ lastCode = code;
+
+ // Extract the line
+ std::getline(in, message);
+
+ // Remove the ending '\r' (all lines are terminated by "\r\n")
+ message.erase(message.length() - 1);
+ message = separator + message + "\n";
+ }
+ else
+ {
+ // We must make sure that the code is the same, otherwise it means
+ // we haven't reached the end of the multiline response
+ if ((separator != '-') && ((code == lastCode) || (lastCode == 0)))
+ {
+ // Extract the line
+ std::string line;
+ std::getline(in, line);
+
+ // Remove the ending '\r' (all lines are terminated by "\r\n")
+ line.erase(line.length() - 1);
+
+ // Append it to the message
+ if (code == lastCode)
+ {
+ std::ostringstream out;
+ out << code << separator << line;
+ message += out.str();
+ }
+ else
+ {
+ message = separator + line;
+ }
+
+ // Return the response code and message
+ return Response(static_cast<Response::Status>(code), message);
+ }
+ else
+ {
+ // The line we just read was actually not a response,
+ // only a new part of the current multiline response
+
+ // Extract the line
+ std::string line;
+ std::getline(in, line);
+
+ if (!line.empty())
+ {
+ // Remove the ending '\r' (all lines are terminated by "\r\n")
+ line.erase(line.length() - 1);
+
+ // Append it to the current message
+ std::ostringstream out;
+ out << code << separator << line << "\n";
+ message += out.str();
+ }
+ }
+ }
+ }
+ else if (lastCode != 0)
+ {
+ // It seems we are in the middle of a multiline response
+
+ // Clear the error bits of the stream
+ in.clear();
+
+ // Extract the line
+ std::string line;
+ std::getline(in, line);
+
+ if (!line.empty())
+ {
+ // Remove the ending '\r' (all lines are terminated by "\r\n")
+ line.erase(line.length() - 1);
+
+ // Append it to the current message
+ message += line + "\n";
+ }
+ }
+ else
+ {
+ // Error: cannot extract the code, and we are not in a multiline response
+ return Response(Response::InvalidResponse);
+ }
+ }
+ }
+
+ // We never reach there
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::DataChannel::DataChannel(Ftp& owner) :
+m_ftp(owner)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+Ftp::Response Ftp::DataChannel::open(Ftp::TransferMode mode)
+{
+ // Open a data connection in active mode (we connect to the server)
+ Ftp::Response response = m_ftp.sendCommand("PASV");
+ if (response.isOk())
+ {
+ // Extract the connection address and port from the response
+ std::string::size_type begin = response.getMessage().find_first_of("0123456789");
+ if (begin != std::string::npos)
+ {
+ Uint8 data[6] = {0, 0, 0, 0, 0, 0};
+ std::string str = response.getMessage().substr(begin);
+ std::size_t index = 0;
+ for (int i = 0; i < 6; ++i)
+ {
+ // Extract the current number
+ while (isdigit(str[index]))
+ {
+ data[i] = data[i] * 10 + (str[index] - '0');
+ index++;
+ }
+
+ // Skip separator
+ index++;
+ }
+
+ // Reconstruct connection port and address
+ unsigned short port = data[4] * 256 + data[5];
+ IpAddress address(static_cast<Uint8>(data[0]),
+ static_cast<Uint8>(data[1]),
+ static_cast<Uint8>(data[2]),
+ static_cast<Uint8>(data[3]));
+
+ // Connect the data channel to the server
+ if (m_dataSocket.connect(address, port) == Socket::Done)
+ {
+ // Translate the transfer mode to the corresponding FTP parameter
+ std::string modeStr;
+ switch (mode)
+ {
+ case Ftp::Binary: modeStr = "I"; break;
+ case Ftp::Ascii: modeStr = "A"; break;
+ case Ftp::Ebcdic: modeStr = "E"; break;
+ }
+
+ // Set the transfer mode
+ response = m_ftp.sendCommand("TYPE", modeStr);
+ }
+ else
+ {
+ // Failed to connect to the server
+ response = Ftp::Response(Ftp::Response::ConnectionFailed);
+ }
+ }
+ }
+
+ return response;
+}
+
+
+////////////////////////////////////////////////////////////
+void Ftp::DataChannel::receive(std::ostream& stream)
+{
+ // Receive data
+ char buffer[1024];
+ std::size_t received;
+ while (m_dataSocket.receive(buffer, sizeof(buffer), received) == Socket::Done)
+ {
+ stream.write(buffer, static_cast<std::streamsize>(received));
+
+ if (!stream.good())
+ {
+ err() << "FTP Error: Writing to the file has failed" << std::endl;
+ break;
+ }
+ }
+
+ // Close the data socket
+ m_dataSocket.disconnect();
+}
+
+
+////////////////////////////////////////////////////////////
+void Ftp::DataChannel::send(std::istream& stream)
+{
+ // Send data
+ char buffer[1024];
+ std::size_t count;
+
+ for (;;)
+ {
+ // read some data from the stream
+ stream.read(buffer, sizeof(buffer));
+
+ if (!stream.good() && !stream.eof())
+ {
+ err() << "FTP Error: Reading from the file has failed" << std::endl;
+ break;
+ }
+
+ count = stream.gcount();
+
+ if (count > 0)
+ {
+ // we could read more data from the stream: send them
+ if (m_dataSocket.send(buffer, count) != Socket::Done)
+ break;
+ }
+ else
+ {
+ // no more data: exit the loop
+ break;
+ }
+ }
+
+ // Close the data socket
+ m_dataSocket.disconnect();
+}
+
+} // namespace sf
diff --git a/src/SFML/Network/Http.cpp b/src/SFML/Network/Http.cpp
index 5b7f62c..df3ebb4 100644
--- a/src/SFML/Network/Http.cpp
+++ b/src/SFML/Network/Http.cpp
@@ -1,376 +1,415 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Network/Http.hpp>
-#include <cctype>
-#include <algorithm>
-#include <iterator>
-#include <sstream>
-
-
-namespace
-{
- // Convert a string to lower case
- std::string toLower(std::string str)
- {
- for (std::string::iterator i = str.begin(); i != str.end(); ++i)
- *i = static_cast<char>(std::tolower(*i));
- return str;
- }
-}
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-Http::Request::Request(const std::string& uri, Method method, const std::string& body)
-{
- setMethod(method);
- setUri(uri);
- setHttpVersion(1, 0);
- setBody(body);
-}
-
-
-////////////////////////////////////////////////////////////
-void Http::Request::setField(const std::string& field, const std::string& value)
-{
- m_fields[toLower(field)] = value;
-}
-
-
-////////////////////////////////////////////////////////////
-void Http::Request::setMethod(Http::Request::Method method)
-{
- m_method = method;
-}
-
-
-////////////////////////////////////////////////////////////
-void Http::Request::setUri(const std::string& uri)
-{
- m_uri = uri;
-
- // Make sure it starts with a '/'
- if (m_uri.empty() || (m_uri[0] != '/'))
- m_uri.insert(0, "/");
-}
-
-
-////////////////////////////////////////////////////////////
-void Http::Request::setHttpVersion(unsigned int major, unsigned int minor)
-{
- m_majorVersion = major;
- m_minorVersion = minor;
-}
-
-
-////////////////////////////////////////////////////////////
-void Http::Request::setBody(const std::string& body)
-{
- m_body = body;
-}
-
-
-////////////////////////////////////////////////////////////
-std::string Http::Request::prepare() const
-{
- std::ostringstream out;
-
- // Convert the method to its string representation
- std::string method;
- switch (m_method)
- {
- default :
- case Get : method = "GET"; break;
- case Post : method = "POST"; break;
- case Head : method = "HEAD"; break;
- }
-
- // Write the first line containing the request type
- out << method << " " << m_uri << " ";
- out << "HTTP/" << m_majorVersion << "." << m_minorVersion << "\r\n";
-
- // Write fields
- for (FieldTable::const_iterator i = m_fields.begin(); i != m_fields.end(); ++i)
- {
- out << i->first << ": " << i->second << "\r\n";
- }
-
- // Use an extra \r\n to separate the header from the body
- out << "\r\n";
-
- // Add the body
- out << m_body;
-
- return out.str();
-}
-
-
-////////////////////////////////////////////////////////////
-bool Http::Request::hasField(const std::string& field) const
-{
- return m_fields.find(toLower(field)) != m_fields.end();
-}
-
-
-////////////////////////////////////////////////////////////
-Http::Response::Response() :
-m_status (ConnectionFailed),
-m_majorVersion(0),
-m_minorVersion(0)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-const std::string& Http::Response::getField(const std::string& field) const
-{
- FieldTable::const_iterator it = m_fields.find(toLower(field));
- if (it != m_fields.end())
- {
- return it->second;
- }
- else
- {
- static const std::string empty = "";
- return empty;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-Http::Response::Status Http::Response::getStatus() const
-{
- return m_status;
-}
-
-
-////////////////////////////////////////////////////////////
-unsigned int Http::Response::getMajorHttpVersion() const
-{
- return m_majorVersion;
-}
-
-
-////////////////////////////////////////////////////////////
-unsigned int Http::Response::getMinorHttpVersion() const
-{
- return m_minorVersion;
-}
-
-
-////////////////////////////////////////////////////////////
-const std::string& Http::Response::getBody() const
-{
- return m_body;
-}
-
-
-////////////////////////////////////////////////////////////
-void Http::Response::parse(const std::string& data)
-{
- std::istringstream in(data);
-
- // Extract the HTTP version from the first line
- std::string version;
- if (in >> version)
- {
- if ((version.size() >= 8) && (version[6] == '.') &&
- (toLower(version.substr(0, 5)) == "http/") &&
- isdigit(version[5]) && isdigit(version[7]))
- {
- m_majorVersion = version[5] - '0';
- m_minorVersion = version[7] - '0';
- }
- else
- {
- // Invalid HTTP version
- m_status = InvalidResponse;
- return;
- }
- }
-
- // Extract the status code from the first line
- int status;
- if (in >> status)
- {
- m_status = static_cast<Status>(status);
- }
- else
- {
- // Invalid status code
- m_status = InvalidResponse;
- return;
- }
-
- // Ignore the end of the first line
- in.ignore(10000, '\n');
-
- // Parse the other lines, which contain fields, one by one
- std::string line;
- while (std::getline(in, line) && (line.size() > 2))
- {
- std::string::size_type pos = line.find(": ");
- if (pos != std::string::npos)
- {
- // Extract the field name and its value
- std::string field = line.substr(0, pos);
- std::string value = line.substr(pos + 2);
-
- // Remove any trailing \r
- if (!value.empty() && (*value.rbegin() == '\r'))
- value.erase(value.size() - 1);
-
- // Add the field
- m_fields[toLower(field)] = value;
- }
- }
-
- // Finally extract the body
- m_body.clear();
- std::copy(std::istreambuf_iterator<char>(in), std::istreambuf_iterator<char>(), std::back_inserter(m_body));
-}
-
-
-////////////////////////////////////////////////////////////
-Http::Http() :
-m_host(),
-m_port(0)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-Http::Http(const std::string& host, unsigned short port)
-{
- setHost(host, port);
-}
-
-
-////////////////////////////////////////////////////////////
-void Http::setHost(const std::string& host, unsigned short port)
-{
- // Detect the protocol used
- std::string protocol = toLower(host.substr(0, 8));
- if (protocol.substr(0, 7) == "http://")
- {
- // HTTP protocol
- m_hostName = host.substr(7);
- m_port = (port != 0 ? port : 80);
- }
- else if (protocol == "https://")
- {
- // HTTPS protocol
- m_hostName = host.substr(8);
- m_port = (port != 0 ? port : 443);
- }
- else
- {
- // Undefined protocol - use HTTP
- m_hostName = host;
- m_port = (port != 0 ? port : 80);
- }
-
- // Remove any trailing '/' from the host name
- if (!m_hostName.empty() && (*m_hostName.rbegin() == '/'))
- m_hostName.erase(m_hostName.size() - 1);
-
- m_host = IpAddress(m_hostName);
-}
-
-
-////////////////////////////////////////////////////////////
-Http::Response Http::sendRequest(const Http::Request& request, Time timeout)
-{
- // First make sure that the request is valid -- add missing mandatory fields
- Request toSend(request);
- if (!toSend.hasField("From"))
- {
- toSend.setField("From", "user@sfml-dev.org");
- }
- if (!toSend.hasField("User-Agent"))
- {
- toSend.setField("User-Agent", "libsfml-network/2.x");
- }
- if (!toSend.hasField("Host"))
- {
- toSend.setField("Host", m_hostName);
- }
- if (!toSend.hasField("Content-Length"))
- {
- std::ostringstream out;
- out << toSend.m_body.size();
- toSend.setField("Content-Length", out.str());
- }
- if ((toSend.m_method == Request::Post) && !toSend.hasField("Content-Type"))
- {
- toSend.setField("Content-Type", "application/x-www-form-urlencoded");
- }
- if ((toSend.m_majorVersion * 10 + toSend.m_minorVersion >= 11) && !toSend.hasField("Connection"))
- {
- toSend.setField("Connection", "close");
- }
-
- // Prepare the response
- Response received;
-
- // Connect the socket to the host
- if (m_connection.connect(m_host, m_port, timeout) == Socket::Done)
- {
- // Convert the request to string and send it through the connected socket
- std::string requestStr = toSend.prepare();
-
- if (!requestStr.empty())
- {
- // Send it through the socket
- if (m_connection.send(requestStr.c_str(), requestStr.size()) == Socket::Done)
- {
- // Wait for the server's response
- std::string receivedStr;
- std::size_t size = 0;
- char buffer[1024];
- while (m_connection.receive(buffer, sizeof(buffer), size) == Socket::Done)
- {
- receivedStr.append(buffer, buffer + size);
- }
-
- // Build the Response object from the received data
- received.parse(receivedStr);
- }
- }
-
- // Close the connection
- m_connection.disconnect();
- }
-
- return received;
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Network/Http.hpp>
+#include <SFML/System/Err.hpp>
+#include <cctype>
+#include <algorithm>
+#include <iterator>
+#include <sstream>
+#include <limits>
+
+
+namespace
+{
+ // Convert a string to lower case
+ std::string toLower(std::string str)
+ {
+ for (std::string::iterator i = str.begin(); i != str.end(); ++i)
+ *i = static_cast<char>(std::tolower(*i));
+ return str;
+ }
+}
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Http::Request::Request(const std::string& uri, Method method, const std::string& body)
+{
+ setMethod(method);
+ setUri(uri);
+ setHttpVersion(1, 0);
+ setBody(body);
+}
+
+
+////////////////////////////////////////////////////////////
+void Http::Request::setField(const std::string& field, const std::string& value)
+{
+ m_fields[toLower(field)] = value;
+}
+
+
+////////////////////////////////////////////////////////////
+void Http::Request::setMethod(Http::Request::Method method)
+{
+ m_method = method;
+}
+
+
+////////////////////////////////////////////////////////////
+void Http::Request::setUri(const std::string& uri)
+{
+ m_uri = uri;
+
+ // Make sure it starts with a '/'
+ if (m_uri.empty() || (m_uri[0] != '/'))
+ m_uri.insert(0, "/");
+}
+
+
+////////////////////////////////////////////////////////////
+void Http::Request::setHttpVersion(unsigned int major, unsigned int minor)
+{
+ m_majorVersion = major;
+ m_minorVersion = minor;
+}
+
+
+////////////////////////////////////////////////////////////
+void Http::Request::setBody(const std::string& body)
+{
+ m_body = body;
+}
+
+
+////////////////////////////////////////////////////////////
+std::string Http::Request::prepare() const
+{
+ std::ostringstream out;
+
+ // Convert the method to its string representation
+ std::string method;
+ switch (m_method)
+ {
+ default:
+ case Get: method = "GET"; break;
+ case Post: method = "POST"; break;
+ case Head: method = "HEAD"; break;
+ case Put: method = "PUT"; break;
+ case Delete: method = "DELETE"; break;
+ }
+
+ // Write the first line containing the request type
+ out << method << " " << m_uri << " ";
+ out << "HTTP/" << m_majorVersion << "." << m_minorVersion << "\r\n";
+
+ // Write fields
+ for (FieldTable::const_iterator i = m_fields.begin(); i != m_fields.end(); ++i)
+ {
+ out << i->first << ": " << i->second << "\r\n";
+ }
+
+ // Use an extra \r\n to separate the header from the body
+ out << "\r\n";
+
+ // Add the body
+ out << m_body;
+
+ return out.str();
+}
+
+
+////////////////////////////////////////////////////////////
+bool Http::Request::hasField(const std::string& field) const
+{
+ return m_fields.find(toLower(field)) != m_fields.end();
+}
+
+
+////////////////////////////////////////////////////////////
+Http::Response::Response() :
+m_status (ConnectionFailed),
+m_majorVersion(0),
+m_minorVersion(0)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+const std::string& Http::Response::getField(const std::string& field) const
+{
+ FieldTable::const_iterator it = m_fields.find(toLower(field));
+ if (it != m_fields.end())
+ {
+ return it->second;
+ }
+ else
+ {
+ static const std::string empty = "";
+ return empty;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+Http::Response::Status Http::Response::getStatus() const
+{
+ return m_status;
+}
+
+
+////////////////////////////////////////////////////////////
+unsigned int Http::Response::getMajorHttpVersion() const
+{
+ return m_majorVersion;
+}
+
+
+////////////////////////////////////////////////////////////
+unsigned int Http::Response::getMinorHttpVersion() const
+{
+ return m_minorVersion;
+}
+
+
+////////////////////////////////////////////////////////////
+const std::string& Http::Response::getBody() const
+{
+ return m_body;
+}
+
+
+////////////////////////////////////////////////////////////
+void Http::Response::parse(const std::string& data)
+{
+ std::istringstream in(data);
+
+ // Extract the HTTP version from the first line
+ std::string version;
+ if (in >> version)
+ {
+ if ((version.size() >= 8) && (version[6] == '.') &&
+ (toLower(version.substr(0, 5)) == "http/") &&
+ isdigit(version[5]) && isdigit(version[7]))
+ {
+ m_majorVersion = version[5] - '0';
+ m_minorVersion = version[7] - '0';
+ }
+ else
+ {
+ // Invalid HTTP version
+ m_status = InvalidResponse;
+ return;
+ }
+ }
+
+ // Extract the status code from the first line
+ int status;
+ if (in >> status)
+ {
+ m_status = static_cast<Status>(status);
+ }
+ else
+ {
+ // Invalid status code
+ m_status = InvalidResponse;
+ return;
+ }
+
+ // Ignore the end of the first line
+ in.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
+
+ // Parse the other lines, which contain fields, one by one
+ parseFields(in);
+
+ m_body.clear();
+
+ // Determine whether the transfer is chunked
+ if (toLower(getField("transfer-encoding")) != "chunked")
+ {
+ // Not chunked - just read everything at once
+ std::copy(std::istreambuf_iterator<char>(in), std::istreambuf_iterator<char>(), std::back_inserter(m_body));
+ }
+ else
+ {
+ // Chunked - have to read chunk by chunk
+ std::size_t length;
+
+ // Read all chunks, identified by a chunk-size not being 0
+ while (in >> std::hex >> length)
+ {
+ // Drop the rest of the line (chunk-extension)
+ in.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
+
+ // Copy the actual content data
+ std::istreambuf_iterator<char> it(in);
+ for (std::size_t i = 0; i < length; i++)
+ m_body.push_back(*it++);
+ }
+
+ // Drop the rest of the line (chunk-extension)
+ in.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
+
+ // Read all trailers (if present)
+ parseFields(in);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Http::Response::parseFields(std::istream &in)
+{
+ std::string line;
+ while (std::getline(in, line) && (line.size() > 2))
+ {
+ std::string::size_type pos = line.find(": ");
+ if (pos != std::string::npos)
+ {
+ // Extract the field name and its value
+ std::string field = line.substr(0, pos);
+ std::string value = line.substr(pos + 2);
+
+ // Remove any trailing \r
+ if (!value.empty() && (*value.rbegin() == '\r'))
+ value.erase(value.size() - 1);
+
+ // Add the field
+ m_fields[toLower(field)] = value;
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+Http::Http() :
+m_host(),
+m_port(0)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+Http::Http(const std::string& host, unsigned short port)
+{
+ setHost(host, port);
+}
+
+
+////////////////////////////////////////////////////////////
+void Http::setHost(const std::string& host, unsigned short port)
+{
+ // Check the protocol
+ if (toLower(host.substr(0, 7)) == "http://")
+ {
+ // HTTP protocol
+ m_hostName = host.substr(7);
+ m_port = (port != 0 ? port : 80);
+ }
+ else if (toLower(host.substr(0, 8)) == "https://")
+ {
+ // HTTPS protocol -- unsupported (requires encryption and certificates and stuff...)
+ err() << "HTTPS protocol is not supported by sf::Http" << std::endl;
+ m_hostName = "";
+ m_port = 0;
+ }
+ else
+ {
+ // Undefined protocol - use HTTP
+ m_hostName = host;
+ m_port = (port != 0 ? port : 80);
+ }
+
+ // Remove any trailing '/' from the host name
+ if (!m_hostName.empty() && (*m_hostName.rbegin() == '/'))
+ m_hostName.erase(m_hostName.size() - 1);
+
+ m_host = IpAddress(m_hostName);
+}
+
+
+////////////////////////////////////////////////////////////
+Http::Response Http::sendRequest(const Http::Request& request, Time timeout)
+{
+ // First make sure that the request is valid -- add missing mandatory fields
+ Request toSend(request);
+ if (!toSend.hasField("From"))
+ {
+ toSend.setField("From", "user@sfml-dev.org");
+ }
+ if (!toSend.hasField("User-Agent"))
+ {
+ toSend.setField("User-Agent", "libsfml-network/2.x");
+ }
+ if (!toSend.hasField("Host"))
+ {
+ toSend.setField("Host", m_hostName);
+ }
+ if (!toSend.hasField("Content-Length"))
+ {
+ std::ostringstream out;
+ out << toSend.m_body.size();
+ toSend.setField("Content-Length", out.str());
+ }
+ if ((toSend.m_method == Request::Post) && !toSend.hasField("Content-Type"))
+ {
+ toSend.setField("Content-Type", "application/x-www-form-urlencoded");
+ }
+ if ((toSend.m_majorVersion * 10 + toSend.m_minorVersion >= 11) && !toSend.hasField("Connection"))
+ {
+ toSend.setField("Connection", "close");
+ }
+
+ // Prepare the response
+ Response received;
+
+ // Connect the socket to the host
+ if (m_connection.connect(m_host, m_port, timeout) == Socket::Done)
+ {
+ // Convert the request to string and send it through the connected socket
+ std::string requestStr = toSend.prepare();
+
+ if (!requestStr.empty())
+ {
+ // Send it through the socket
+ if (m_connection.send(requestStr.c_str(), requestStr.size()) == Socket::Done)
+ {
+ // Wait for the server's response
+ std::string receivedStr;
+ std::size_t size = 0;
+ char buffer[1024];
+ while (m_connection.receive(buffer, sizeof(buffer), size) == Socket::Done)
+ {
+ receivedStr.append(buffer, buffer + size);
+ }
+
+ // Build the Response object from the received data
+ received.parse(receivedStr);
+ }
+ }
+
+ // Close the connection
+ m_connection.disconnect();
+ }
+
+ return received;
+}
+
+} // namespace sf
diff --git a/src/SFML/Network/IpAddress.cpp b/src/SFML/Network/IpAddress.cpp
index c4efaba..0459091 100644
--- a/src/SFML/Network/IpAddress.cpp
+++ b/src/SFML/Network/IpAddress.cpp
@@ -1,255 +1,255 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Network/IpAddress.hpp>
-#include <SFML/Network/Http.hpp>
-#include <SFML/Network/SocketImpl.hpp>
-#include <cstring>
-
-
-namespace
-{
- sf::Uint32 resolve(const std::string& address)
- {
- if (address == "255.255.255.255")
- {
- // The broadcast address needs to be handled explicitely,
- // because it is also the value returned by inet_addr on error
- return INADDR_BROADCAST;
- }
- else
- {
- // Try to convert the address as a byte representation ("xxx.xxx.xxx.xxx")
- sf::Uint32 ip = inet_addr(address.c_str());
- if (ip != INADDR_NONE)
- return ip;
-
- // Not a valid address, try to convert it as a host name
- addrinfo hints;
- std::memset(&hints, 0, sizeof(hints));
- hints.ai_family = AF_INET;
- addrinfo* result = NULL;
- if (getaddrinfo(address.c_str(), NULL, &hints, &result) == 0)
- {
- if (result)
- {
- ip = reinterpret_cast<sockaddr_in*>(result->ai_addr)->sin_addr.s_addr;
- freeaddrinfo(result);
- return ip;
- }
- }
-
- // Not a valid address nor a host name
- return 0;
- }
- }
-}
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-const IpAddress IpAddress::None;
-const IpAddress IpAddress::LocalHost(127, 0, 0, 1);
-const IpAddress IpAddress::Broadcast(255, 255, 255, 255);
-
-
-////////////////////////////////////////////////////////////
-IpAddress::IpAddress() :
-m_address(0)
-{
- // We're using 0 (INADDR_ANY) instead of INADDR_NONE to represent the invalid address,
- // because the latter is also the broadcast address (255.255.255.255); it's ok because
- // SFML doesn't publicly use INADDR_ANY (it is always used implicitely)
-}
-
-
-////////////////////////////////////////////////////////////
-IpAddress::IpAddress(const std::string& address) :
-m_address(resolve(address))
-{
-}
-
-
-////////////////////////////////////////////////////////////
-IpAddress::IpAddress(const char* address) :
-m_address(resolve(address))
-{
-}
-
-
-////////////////////////////////////////////////////////////
-IpAddress::IpAddress(Uint8 byte0, Uint8 byte1, Uint8 byte2, Uint8 byte3) :
-m_address(htonl((byte0 << 24) | (byte1 << 16) | (byte2 << 8) | byte3))
-{
-}
-
-
-////////////////////////////////////////////////////////////
-IpAddress::IpAddress(Uint32 address) :
-m_address(htonl(address))
-{
-}
-
-
-////////////////////////////////////////////////////////////
-std::string IpAddress::toString() const
-{
- in_addr address;
- address.s_addr = m_address;
-
- return inet_ntoa(address);
-}
-
-
-////////////////////////////////////////////////////////////
-Uint32 IpAddress::toInteger() const
-{
- return ntohl(m_address);
-}
-
-
-////////////////////////////////////////////////////////////
-IpAddress IpAddress::getLocalAddress()
-{
- // The method here is to connect a UDP socket to anyone (here to localhost),
- // and get the local socket address with the getsockname function.
- // UDP connection will not send anything to the network, so this function won't cause any overhead.
-
- IpAddress localAddress;
-
- // Create the socket
- SocketHandle sock = socket(PF_INET, SOCK_DGRAM, 0);
- if (sock == priv::SocketImpl::invalidSocket())
- return localAddress;
-
- // Connect the socket to localhost on any port
- sockaddr_in address = priv::SocketImpl::createAddress(ntohl(INADDR_LOOPBACK), 0);
- if (connect(sock, reinterpret_cast<sockaddr*>(&address), sizeof(address)) == -1)
- {
- priv::SocketImpl::close(sock);
- return localAddress;
- }
-
- // Get the local address of the socket connection
- priv::SocketImpl::AddrLength size = sizeof(address);
- if (getsockname(sock, reinterpret_cast<sockaddr*>(&address), &size) == -1)
- {
- priv::SocketImpl::close(sock);
- return localAddress;
- }
-
- // Close the socket
- priv::SocketImpl::close(sock);
-
- // Finally build the IP address
- localAddress = IpAddress(ntohl(address.sin_addr.s_addr));
-
- return localAddress;
-}
-
-
-////////////////////////////////////////////////////////////
-IpAddress IpAddress::getPublicAddress(Time timeout)
-{
- // The trick here is more complicated, because the only way
- // to get our public IP address is to get it from a distant computer.
- // Here we get the web page from http://www.sfml-dev.org/ip-provider.php
- // and parse the result to extract our IP address
- // (not very hard: the web page contains only our IP address).
-
- Http server("www.sfml-dev.org");
- Http::Request request("/ip-provider.php", Http::Request::Get);
- Http::Response page = server.sendRequest(request, timeout);
- if (page.getStatus() == Http::Response::Ok)
- return IpAddress(page.getBody());
-
- // Something failed: return an invalid address
- return IpAddress();
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator ==(const IpAddress& left, const IpAddress& right)
-{
- return left.toInteger() == right.toInteger();
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator !=(const IpAddress& left, const IpAddress& right)
-{
- return !(left == right);
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator <(const IpAddress& left, const IpAddress& right)
-{
- return left.toInteger() < right.toInteger();
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator >(const IpAddress& left, const IpAddress& right)
-{
- return right < left;
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator <=(const IpAddress& left, const IpAddress& right)
-{
- return !(right < left);
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator >=(const IpAddress& left, const IpAddress& right)
-{
- return !(left < right);
-}
-
-
-////////////////////////////////////////////////////////////
-std::istream& operator >>(std::istream& stream, IpAddress& address)
-{
- std::string str;
- stream >> str;
- address = IpAddress(str);
-
- return stream;
-}
-
-
-////////////////////////////////////////////////////////////
-std::ostream& operator <<(std::ostream& stream, const IpAddress& address)
-{
- return stream << address.toString();
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Network/IpAddress.hpp>
+#include <SFML/Network/Http.hpp>
+#include <SFML/Network/SocketImpl.hpp>
+#include <cstring>
+
+
+namespace
+{
+ sf::Uint32 resolve(const std::string& address)
+ {
+ if (address == "255.255.255.255")
+ {
+ // The broadcast address needs to be handled explicitly,
+ // because it is also the value returned by inet_addr on error
+ return INADDR_BROADCAST;
+ }
+ else
+ {
+ // Try to convert the address as a byte representation ("xxx.xxx.xxx.xxx")
+ sf::Uint32 ip = inet_addr(address.c_str());
+ if (ip != INADDR_NONE)
+ return ip;
+
+ // Not a valid address, try to convert it as a host name
+ addrinfo hints;
+ std::memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_INET;
+ addrinfo* result = NULL;
+ if (getaddrinfo(address.c_str(), NULL, &hints, &result) == 0)
+ {
+ if (result)
+ {
+ ip = reinterpret_cast<sockaddr_in*>(result->ai_addr)->sin_addr.s_addr;
+ freeaddrinfo(result);
+ return ip;
+ }
+ }
+
+ // Not a valid address nor a host name
+ return 0;
+ }
+ }
+}
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+const IpAddress IpAddress::None;
+const IpAddress IpAddress::LocalHost(127, 0, 0, 1);
+const IpAddress IpAddress::Broadcast(255, 255, 255, 255);
+
+
+////////////////////////////////////////////////////////////
+IpAddress::IpAddress() :
+m_address(0)
+{
+ // We're using 0 (INADDR_ANY) instead of INADDR_NONE to represent the invalid address,
+ // because the latter is also the broadcast address (255.255.255.255); it's ok because
+ // SFML doesn't publicly use INADDR_ANY (it is always used implicitly)
+}
+
+
+////////////////////////////////////////////////////////////
+IpAddress::IpAddress(const std::string& address) :
+m_address(resolve(address))
+{
+}
+
+
+////////////////////////////////////////////////////////////
+IpAddress::IpAddress(const char* address) :
+m_address(resolve(address))
+{
+}
+
+
+////////////////////////////////////////////////////////////
+IpAddress::IpAddress(Uint8 byte0, Uint8 byte1, Uint8 byte2, Uint8 byte3) :
+m_address(htonl((byte0 << 24) | (byte1 << 16) | (byte2 << 8) | byte3))
+{
+}
+
+
+////////////////////////////////////////////////////////////
+IpAddress::IpAddress(Uint32 address) :
+m_address(htonl(address))
+{
+}
+
+
+////////////////////////////////////////////////////////////
+std::string IpAddress::toString() const
+{
+ in_addr address;
+ address.s_addr = m_address;
+
+ return inet_ntoa(address);
+}
+
+
+////////////////////////////////////////////////////////////
+Uint32 IpAddress::toInteger() const
+{
+ return ntohl(m_address);
+}
+
+
+////////////////////////////////////////////////////////////
+IpAddress IpAddress::getLocalAddress()
+{
+ // The method here is to connect a UDP socket to anyone (here to localhost),
+ // and get the local socket address with the getsockname function.
+ // UDP connection will not send anything to the network, so this function won't cause any overhead.
+
+ IpAddress localAddress;
+
+ // Create the socket
+ SocketHandle sock = socket(PF_INET, SOCK_DGRAM, 0);
+ if (sock == priv::SocketImpl::invalidSocket())
+ return localAddress;
+
+ // Connect the socket to localhost on any port
+ sockaddr_in address = priv::SocketImpl::createAddress(ntohl(INADDR_LOOPBACK), 9);
+ if (connect(sock, reinterpret_cast<sockaddr*>(&address), sizeof(address)) == -1)
+ {
+ priv::SocketImpl::close(sock);
+ return localAddress;
+ }
+
+ // Get the local address of the socket connection
+ priv::SocketImpl::AddrLength size = sizeof(address);
+ if (getsockname(sock, reinterpret_cast<sockaddr*>(&address), &size) == -1)
+ {
+ priv::SocketImpl::close(sock);
+ return localAddress;
+ }
+
+ // Close the socket
+ priv::SocketImpl::close(sock);
+
+ // Finally build the IP address
+ localAddress = IpAddress(ntohl(address.sin_addr.s_addr));
+
+ return localAddress;
+}
+
+
+////////////////////////////////////////////////////////////
+IpAddress IpAddress::getPublicAddress(Time timeout)
+{
+ // The trick here is more complicated, because the only way
+ // to get our public IP address is to get it from a distant computer.
+ // Here we get the web page from http://www.sfml-dev.org/ip-provider.php
+ // and parse the result to extract our IP address
+ // (not very hard: the web page contains only our IP address).
+
+ Http server("www.sfml-dev.org");
+ Http::Request request("/ip-provider.php", Http::Request::Get);
+ Http::Response page = server.sendRequest(request, timeout);
+ if (page.getStatus() == Http::Response::Ok)
+ return IpAddress(page.getBody());
+
+ // Something failed: return an invalid address
+ return IpAddress();
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator ==(const IpAddress& left, const IpAddress& right)
+{
+ return left.toInteger() == right.toInteger();
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator !=(const IpAddress& left, const IpAddress& right)
+{
+ return !(left == right);
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator <(const IpAddress& left, const IpAddress& right)
+{
+ return left.toInteger() < right.toInteger();
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator >(const IpAddress& left, const IpAddress& right)
+{
+ return right < left;
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator <=(const IpAddress& left, const IpAddress& right)
+{
+ return !(right < left);
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator >=(const IpAddress& left, const IpAddress& right)
+{
+ return !(left < right);
+}
+
+
+////////////////////////////////////////////////////////////
+std::istream& operator >>(std::istream& stream, IpAddress& address)
+{
+ std::string str;
+ stream >> str;
+ address = IpAddress(str);
+
+ return stream;
+}
+
+
+////////////////////////////////////////////////////////////
+std::ostream& operator <<(std::ostream& stream, const IpAddress& address)
+{
+ return stream << address.toString();
+}
+
+} // namespace sf
diff --git a/src/SFML/Network/Packet.cpp b/src/SFML/Network/Packet.cpp
index 053fa4e..31fe259 100644
--- a/src/SFML/Network/Packet.cpp
+++ b/src/SFML/Network/Packet.cpp
@@ -1,507 +1,595 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Network/Packet.hpp>
-#include <SFML/Network/SocketImpl.hpp>
-#include <SFML/System/String.hpp>
-#include <cstring>
-#include <cwchar>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-Packet::Packet() :
-m_readPos(0),
-m_isValid(true)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-Packet::~Packet()
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-void Packet::append(const void* data, std::size_t sizeInBytes)
-{
- if (data && (sizeInBytes > 0))
- {
- std::size_t start = m_data.size();
- m_data.resize(start + sizeInBytes);
- std::memcpy(&m_data[start], data, sizeInBytes);
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Packet::clear()
-{
- m_data.clear();
- m_readPos = 0;
- m_isValid = true;
-}
-
-
-////////////////////////////////////////////////////////////
-const void* Packet::getData() const
-{
- return !m_data.empty() ? &m_data[0] : NULL;
-}
-
-
-////////////////////////////////////////////////////////////
-std::size_t Packet::getDataSize() const
-{
- return m_data.size();
-}
-
-
-////////////////////////////////////////////////////////////
-bool Packet::endOfPacket() const
-{
- return m_readPos >= m_data.size();
-}
-
-
-////////////////////////////////////////////////////////////
-Packet::operator BoolType() const
-{
- return m_isValid ? &Packet::checkSize : NULL;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator >>(bool& data)
-{
- Uint8 value;
- if (*this >> value)
- data = (value != 0);
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator >>(Int8& data)
-{
- if (checkSize(sizeof(data)))
- {
- data = *reinterpret_cast<const Int8*>(&m_data[m_readPos]);
- m_readPos += sizeof(data);
- }
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator >>(Uint8& data)
-{
- if (checkSize(sizeof(data)))
- {
- data = *reinterpret_cast<const Uint8*>(&m_data[m_readPos]);
- m_readPos += sizeof(data);
- }
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator >>(Int16& data)
-{
- if (checkSize(sizeof(data)))
- {
- data = ntohs(*reinterpret_cast<const Int16*>(&m_data[m_readPos]));
- m_readPos += sizeof(data);
- }
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator >>(Uint16& data)
-{
- if (checkSize(sizeof(data)))
- {
- data = ntohs(*reinterpret_cast<const Uint16*>(&m_data[m_readPos]));
- m_readPos += sizeof(data);
- }
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator >>(Int32& data)
-{
- if (checkSize(sizeof(data)))
- {
- data = ntohl(*reinterpret_cast<const Int32*>(&m_data[m_readPos]));
- m_readPos += sizeof(data);
- }
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator >>(Uint32& data)
-{
- if (checkSize(sizeof(data)))
- {
- data = ntohl(*reinterpret_cast<const Uint32*>(&m_data[m_readPos]));
- m_readPos += sizeof(data);
- }
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator >>(float& data)
-{
- if (checkSize(sizeof(data)))
- {
- data = *reinterpret_cast<const float*>(&m_data[m_readPos]);
- m_readPos += sizeof(data);
- }
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator >>(double& data)
-{
- if (checkSize(sizeof(data)))
- {
- data = *reinterpret_cast<const double*>(&m_data[m_readPos]);
- m_readPos += sizeof(data);
- }
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator >>(char* data)
-{
- // First extract string length
- Uint32 length = 0;
- *this >> length;
-
- if ((length > 0) && checkSize(length))
- {
- // Then extract characters
- std::memcpy(data, &m_data[m_readPos], length);
- data[length] = '\0';
-
- // Update reading position
- m_readPos += length;
- }
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator >>(std::string& data)
-{
- // First extract string length
- Uint32 length = 0;
- *this >> length;
-
- data.clear();
- if ((length > 0) && checkSize(length))
- {
- // Then extract characters
- data.assign(&m_data[m_readPos], length);
-
- // Update reading position
- m_readPos += length;
- }
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator >>(wchar_t* data)
-{
- // First extract string length
- Uint32 length = 0;
- *this >> length;
-
- if ((length > 0) && checkSize(length * sizeof(Uint32)))
- {
- // Then extract characters
- for (Uint32 i = 0; i < length; ++i)
- {
- Uint32 character = 0;
- *this >> character;
- data[i] = static_cast<wchar_t>(character);
- }
- data[length] = L'\0';
- }
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator >>(std::wstring& data)
-{
- // First extract string length
- Uint32 length = 0;
- *this >> length;
-
- data.clear();
- if ((length > 0) && checkSize(length * sizeof(Uint32)))
- {
- // Then extract characters
- for (Uint32 i = 0; i < length; ++i)
- {
- Uint32 character = 0;
- *this >> character;
- data += static_cast<wchar_t>(character);
- }
- }
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator >>(String& data)
-{
- // First extract the string length
- Uint32 length = 0;
- *this >> length;
-
- data.clear();
- if ((length > 0) && checkSize(length * sizeof(Uint32)))
- {
- // Then extract characters
- for (Uint32 i = 0; i < length; ++i)
- {
- Uint32 character = 0;
- *this >> character;
- data += character;
- }
- }
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator <<(bool data)
-{
- *this << static_cast<Uint8>(data);
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator <<(Int8 data)
-{
- append(&data, sizeof(data));
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator <<(Uint8 data)
-{
- append(&data, sizeof(data));
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator <<(Int16 data)
-{
- Int16 toWrite = htons(data);
- append(&toWrite, sizeof(toWrite));
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator <<(Uint16 data)
-{
- Uint16 toWrite = htons(data);
- append(&toWrite, sizeof(toWrite));
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator <<(Int32 data)
-{
- Int32 toWrite = htonl(data);
- append(&toWrite, sizeof(toWrite));
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator <<(Uint32 data)
-{
- Uint32 toWrite = htonl(data);
- append(&toWrite, sizeof(toWrite));
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator <<(float data)
-{
- append(&data, sizeof(data));
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator <<(double data)
-{
- append(&data, sizeof(data));
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator <<(const char* data)
-{
- // First insert string length
- Uint32 length = std::strlen(data);
- *this << length;
-
- // Then insert characters
- append(data, length * sizeof(char));
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator <<(const std::string& data)
-{
- // First insert string length
- Uint32 length = static_cast<Uint32>(data.size());
- *this << length;
-
- // Then insert characters
- if (length > 0)
- append(data.c_str(), length * sizeof(std::string::value_type));
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator <<(const wchar_t* data)
-{
- // First insert string length
- Uint32 length = std::wcslen(data);
- *this << length;
-
- // Then insert characters
- for (const wchar_t* c = data; *c != L'\0'; ++c)
- *this << static_cast<Uint32>(*c);
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator <<(const std::wstring& data)
-{
- // First insert string length
- Uint32 length = static_cast<Uint32>(data.size());
- *this << length;
-
- // Then insert characters
- if (length > 0)
- {
- for (std::wstring::const_iterator c = data.begin(); c != data.end(); ++c)
- *this << static_cast<Uint32>(*c);
- }
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Packet& Packet::operator <<(const String& data)
-{
- // First insert the string length
- Uint32 length = static_cast<Uint32>(data.getSize());
- *this << length;
-
- // Then insert characters
- if (length > 0)
- {
- for (String::ConstIterator c = data.begin(); c != data.end(); ++c)
- *this << *c;
- }
-
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-bool Packet::checkSize(std::size_t size)
-{
- m_isValid = m_isValid && (m_readPos + size <= m_data.size());
-
- return m_isValid;
-}
-
-
-////////////////////////////////////////////////////////////
-const void* Packet::onSend(std::size_t& size)
-{
- size = getDataSize();
- return getData();
-}
-
-
-////////////////////////////////////////////////////////////
-void Packet::onReceive(const void* data, std::size_t size)
-{
- append(data, size);
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Network/Packet.hpp>
+#include <SFML/Network/SocketImpl.hpp>
+#include <SFML/System/String.hpp>
+#include <cstring>
+#include <cwchar>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Packet::Packet() :
+m_readPos(0),
+m_isValid(true)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+Packet::~Packet()
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+void Packet::append(const void* data, std::size_t sizeInBytes)
+{
+ if (data && (sizeInBytes > 0))
+ {
+ std::size_t start = m_data.size();
+ m_data.resize(start + sizeInBytes);
+ std::memcpy(&m_data[start], data, sizeInBytes);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Packet::clear()
+{
+ m_data.clear();
+ m_readPos = 0;
+ m_isValid = true;
+}
+
+
+////////////////////////////////////////////////////////////
+const void* Packet::getData() const
+{
+ return !m_data.empty() ? &m_data[0] : NULL;
+}
+
+
+////////////////////////////////////////////////////////////
+std::size_t Packet::getDataSize() const
+{
+ return m_data.size();
+}
+
+
+////////////////////////////////////////////////////////////
+bool Packet::endOfPacket() const
+{
+ return m_readPos >= m_data.size();
+}
+
+
+////////////////////////////////////////////////////////////
+Packet::operator BoolType() const
+{
+ return m_isValid ? &Packet::checkSize : NULL;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator >>(bool& data)
+{
+ Uint8 value;
+ if (*this >> value)
+ data = (value != 0);
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator >>(Int8& data)
+{
+ if (checkSize(sizeof(data)))
+ {
+ data = *reinterpret_cast<const Int8*>(&m_data[m_readPos]);
+ m_readPos += sizeof(data);
+ }
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator >>(Uint8& data)
+{
+ if (checkSize(sizeof(data)))
+ {
+ data = *reinterpret_cast<const Uint8*>(&m_data[m_readPos]);
+ m_readPos += sizeof(data);
+ }
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator >>(Int16& data)
+{
+ if (checkSize(sizeof(data)))
+ {
+ data = ntohs(*reinterpret_cast<const Int16*>(&m_data[m_readPos]));
+ m_readPos += sizeof(data);
+ }
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator >>(Uint16& data)
+{
+ if (checkSize(sizeof(data)))
+ {
+ data = ntohs(*reinterpret_cast<const Uint16*>(&m_data[m_readPos]));
+ m_readPos += sizeof(data);
+ }
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator >>(Int32& data)
+{
+ if (checkSize(sizeof(data)))
+ {
+ data = ntohl(*reinterpret_cast<const Int32*>(&m_data[m_readPos]));
+ m_readPos += sizeof(data);
+ }
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator >>(Uint32& data)
+{
+ if (checkSize(sizeof(data)))
+ {
+ data = ntohl(*reinterpret_cast<const Uint32*>(&m_data[m_readPos]));
+ m_readPos += sizeof(data);
+ }
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator >>(Int64& data)
+{
+ if (checkSize(sizeof(data)))
+ {
+ // Since ntohll is not available everywhere, we have to convert
+ // to network byte order (big endian) manually
+ const Uint8* bytes = reinterpret_cast<const Uint8*>(&m_data[m_readPos]);
+ data = (static_cast<Int64>(bytes[0]) << 56) |
+ (static_cast<Int64>(bytes[1]) << 48) |
+ (static_cast<Int64>(bytes[2]) << 40) |
+ (static_cast<Int64>(bytes[3]) << 32) |
+ (static_cast<Int64>(bytes[4]) << 24) |
+ (static_cast<Int64>(bytes[5]) << 16) |
+ (static_cast<Int64>(bytes[6]) << 8) |
+ (static_cast<Int64>(bytes[7]) );
+ m_readPos += sizeof(data);
+ }
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator >>(Uint64& data)
+{
+ if (checkSize(sizeof(data)))
+ {
+ // Since ntohll is not available everywhere, we have to convert
+ // to network byte order (big endian) manually
+ const Uint8* bytes = reinterpret_cast<const Uint8*>(&m_data[m_readPos]);
+ data = (static_cast<Uint64>(bytes[0]) << 56) |
+ (static_cast<Uint64>(bytes[1]) << 48) |
+ (static_cast<Uint64>(bytes[2]) << 40) |
+ (static_cast<Uint64>(bytes[3]) << 32) |
+ (static_cast<Uint64>(bytes[4]) << 24) |
+ (static_cast<Uint64>(bytes[5]) << 16) |
+ (static_cast<Uint64>(bytes[6]) << 8) |
+ (static_cast<Uint64>(bytes[7]) );
+ m_readPos += sizeof(data);
+ }
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator >>(float& data)
+{
+ if (checkSize(sizeof(data)))
+ {
+ data = *reinterpret_cast<const float*>(&m_data[m_readPos]);
+ m_readPos += sizeof(data);
+ }
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator >>(double& data)
+{
+ if (checkSize(sizeof(data)))
+ {
+ data = *reinterpret_cast<const double*>(&m_data[m_readPos]);
+ m_readPos += sizeof(data);
+ }
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator >>(char* data)
+{
+ // First extract string length
+ Uint32 length = 0;
+ *this >> length;
+
+ if ((length > 0) && checkSize(length))
+ {
+ // Then extract characters
+ std::memcpy(data, &m_data[m_readPos], length);
+ data[length] = '\0';
+
+ // Update reading position
+ m_readPos += length;
+ }
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator >>(std::string& data)
+{
+ // First extract string length
+ Uint32 length = 0;
+ *this >> length;
+
+ data.clear();
+ if ((length > 0) && checkSize(length))
+ {
+ // Then extract characters
+ data.assign(&m_data[m_readPos], length);
+
+ // Update reading position
+ m_readPos += length;
+ }
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator >>(wchar_t* data)
+{
+ // First extract string length
+ Uint32 length = 0;
+ *this >> length;
+
+ if ((length > 0) && checkSize(length * sizeof(Uint32)))
+ {
+ // Then extract characters
+ for (Uint32 i = 0; i < length; ++i)
+ {
+ Uint32 character = 0;
+ *this >> character;
+ data[i] = static_cast<wchar_t>(character);
+ }
+ data[length] = L'\0';
+ }
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator >>(std::wstring& data)
+{
+ // First extract string length
+ Uint32 length = 0;
+ *this >> length;
+
+ data.clear();
+ if ((length > 0) && checkSize(length * sizeof(Uint32)))
+ {
+ // Then extract characters
+ for (Uint32 i = 0; i < length; ++i)
+ {
+ Uint32 character = 0;
+ *this >> character;
+ data += static_cast<wchar_t>(character);
+ }
+ }
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator >>(String& data)
+{
+ // First extract the string length
+ Uint32 length = 0;
+ *this >> length;
+
+ data.clear();
+ if ((length > 0) && checkSize(length * sizeof(Uint32)))
+ {
+ // Then extract characters
+ for (Uint32 i = 0; i < length; ++i)
+ {
+ Uint32 character = 0;
+ *this >> character;
+ data += character;
+ }
+ }
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator <<(bool data)
+{
+ *this << static_cast<Uint8>(data);
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator <<(Int8 data)
+{
+ append(&data, sizeof(data));
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator <<(Uint8 data)
+{
+ append(&data, sizeof(data));
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator <<(Int16 data)
+{
+ Int16 toWrite = htons(data);
+ append(&toWrite, sizeof(toWrite));
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator <<(Uint16 data)
+{
+ Uint16 toWrite = htons(data);
+ append(&toWrite, sizeof(toWrite));
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator <<(Int32 data)
+{
+ Int32 toWrite = htonl(data);
+ append(&toWrite, sizeof(toWrite));
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator <<(Uint32 data)
+{
+ Uint32 toWrite = htonl(data);
+ append(&toWrite, sizeof(toWrite));
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator <<(Int64 data)
+{
+ // Since htonll is not available everywhere, we have to convert
+ // to network byte order (big endian) manually
+ Uint8 toWrite[] =
+ {
+ static_cast<Uint8>((data >> 56) & 0xFF),
+ static_cast<Uint8>((data >> 48) & 0xFF),
+ static_cast<Uint8>((data >> 40) & 0xFF),
+ static_cast<Uint8>((data >> 32) & 0xFF),
+ static_cast<Uint8>((data >> 24) & 0xFF),
+ static_cast<Uint8>((data >> 16) & 0xFF),
+ static_cast<Uint8>((data >> 8) & 0xFF),
+ static_cast<Uint8>((data ) & 0xFF)
+ };
+ append(&toWrite, sizeof(toWrite));
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator <<(Uint64 data)
+{
+ // Since htonll is not available everywhere, we have to convert
+ // to network byte order (big endian) manually
+ Uint8 toWrite[] =
+ {
+ static_cast<Uint8>((data >> 56) & 0xFF),
+ static_cast<Uint8>((data >> 48) & 0xFF),
+ static_cast<Uint8>((data >> 40) & 0xFF),
+ static_cast<Uint8>((data >> 32) & 0xFF),
+ static_cast<Uint8>((data >> 24) & 0xFF),
+ static_cast<Uint8>((data >> 16) & 0xFF),
+ static_cast<Uint8>((data >> 8) & 0xFF),
+ static_cast<Uint8>((data ) & 0xFF)
+ };
+ append(&toWrite, sizeof(toWrite));
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator <<(float data)
+{
+ append(&data, sizeof(data));
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator <<(double data)
+{
+ append(&data, sizeof(data));
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator <<(const char* data)
+{
+ // First insert string length
+ Uint32 length = static_cast<Uint32>(std::strlen(data));
+ *this << length;
+
+ // Then insert characters
+ append(data, length * sizeof(char));
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator <<(const std::string& data)
+{
+ // First insert string length
+ Uint32 length = static_cast<Uint32>(data.size());
+ *this << length;
+
+ // Then insert characters
+ if (length > 0)
+ append(data.c_str(), length * sizeof(std::string::value_type));
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator <<(const wchar_t* data)
+{
+ // First insert string length
+ Uint32 length = static_cast<Uint32>(std::wcslen(data));
+ *this << length;
+
+ // Then insert characters
+ for (const wchar_t* c = data; *c != L'\0'; ++c)
+ *this << static_cast<Uint32>(*c);
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator <<(const std::wstring& data)
+{
+ // First insert string length
+ Uint32 length = static_cast<Uint32>(data.size());
+ *this << length;
+
+ // Then insert characters
+ if (length > 0)
+ {
+ for (std::wstring::const_iterator c = data.begin(); c != data.end(); ++c)
+ *this << static_cast<Uint32>(*c);
+ }
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Packet& Packet::operator <<(const String& data)
+{
+ // First insert the string length
+ Uint32 length = static_cast<Uint32>(data.getSize());
+ *this << length;
+
+ // Then insert characters
+ if (length > 0)
+ {
+ for (String::ConstIterator c = data.begin(); c != data.end(); ++c)
+ *this << *c;
+ }
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Packet::checkSize(std::size_t size)
+{
+ m_isValid = m_isValid && (m_readPos + size <= m_data.size());
+
+ return m_isValid;
+}
+
+
+////////////////////////////////////////////////////////////
+const void* Packet::onSend(std::size_t& size)
+{
+ size = getDataSize();
+ return getData();
+}
+
+
+////////////////////////////////////////////////////////////
+void Packet::onReceive(const void* data, std::size_t size)
+{
+ append(data, size);
+}
+
+} // namespace sf
diff --git a/src/SFML/Network/Socket.cpp b/src/SFML/Network/Socket.cpp
index 3e8489f..a74aa10 100644
--- a/src/SFML/Network/Socket.cpp
+++ b/src/SFML/Network/Socket.cpp
@@ -1,144 +1,144 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Network/Socket.hpp>
-#include <SFML/Network/SocketImpl.hpp>
-#include <SFML/System/Err.hpp>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-Socket::Socket(Type type) :
-m_type (type),
-m_socket (priv::SocketImpl::invalidSocket()),
-m_isBlocking(true)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-Socket::~Socket()
-{
- // Close the socket before it gets destructed
- close();
-}
-
-
-////////////////////////////////////////////////////////////
-void Socket::setBlocking(bool blocking)
-{
- // Apply if the socket is already created
- if (m_socket != priv::SocketImpl::invalidSocket())
- priv::SocketImpl::setBlocking(m_socket, blocking);
-
- m_isBlocking = blocking;
-}
-
-
-////////////////////////////////////////////////////////////
-bool Socket::isBlocking() const
-{
- return m_isBlocking;
-}
-
-
-////////////////////////////////////////////////////////////
-SocketHandle Socket::getHandle() const
-{
- return m_socket;
-}
-
-
-////////////////////////////////////////////////////////////
-void Socket::create()
-{
- // Don't create the socket if it already exists
- if (m_socket == priv::SocketImpl::invalidSocket())
- {
- SocketHandle handle = socket(PF_INET, m_type == Tcp ? SOCK_STREAM : SOCK_DGRAM, 0);
- create(handle);
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Socket::create(SocketHandle handle)
-{
- // Don't create the socket if it already exists
- if (m_socket == priv::SocketImpl::invalidSocket())
- {
- // Assign the new handle
- m_socket = handle;
-
- // Set the current blocking state
- setBlocking(m_isBlocking);
-
- if (m_type == Tcp)
- {
- // Disable the Nagle algorithm (ie. removes buffering of TCP packets)
- int yes = 1;
- if (setsockopt(m_socket, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<char*>(&yes), sizeof(yes)) == -1)
- {
- err() << "Failed to set socket option \"TCP_NODELAY\" ; "
- << "all your TCP packets will be buffered" << std::endl;
- }
-
- // On Mac OS X, disable the SIGPIPE signal on disconnection
- #ifdef SFML_SYSTEM_MACOS
- if (setsockopt(m_socket, SOL_SOCKET, SO_NOSIGPIPE, reinterpret_cast<char*>(&yes), sizeof(yes)) == -1)
- {
- err() << "Failed to set socket option \"SO_NOSIGPIPE\"" << std::endl;
- }
- #endif
- }
- else
- {
- // Enable broadcast by default for UDP sockets
- int yes = 1;
- if (setsockopt(m_socket, SOL_SOCKET, SO_BROADCAST, reinterpret_cast<char*>(&yes), sizeof(yes)) == -1)
- {
- err() << "Failed to enable broadcast on UDP socket" << std::endl;
- }
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Socket::close()
-{
- // Close the socket
- if (m_socket != priv::SocketImpl::invalidSocket())
- {
- priv::SocketImpl::close(m_socket);
- m_socket = priv::SocketImpl::invalidSocket();
- }
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Network/Socket.hpp>
+#include <SFML/Network/SocketImpl.hpp>
+#include <SFML/System/Err.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Socket::Socket(Type type) :
+m_type (type),
+m_socket (priv::SocketImpl::invalidSocket()),
+m_isBlocking(true)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+Socket::~Socket()
+{
+ // Close the socket before it gets destructed
+ close();
+}
+
+
+////////////////////////////////////////////////////////////
+void Socket::setBlocking(bool blocking)
+{
+ // Apply if the socket is already created
+ if (m_socket != priv::SocketImpl::invalidSocket())
+ priv::SocketImpl::setBlocking(m_socket, blocking);
+
+ m_isBlocking = blocking;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Socket::isBlocking() const
+{
+ return m_isBlocking;
+}
+
+
+////////////////////////////////////////////////////////////
+SocketHandle Socket::getHandle() const
+{
+ return m_socket;
+}
+
+
+////////////////////////////////////////////////////////////
+void Socket::create()
+{
+ // Don't create the socket if it already exists
+ if (m_socket == priv::SocketImpl::invalidSocket())
+ {
+ SocketHandle handle = socket(PF_INET, m_type == Tcp ? SOCK_STREAM : SOCK_DGRAM, 0);
+ create(handle);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Socket::create(SocketHandle handle)
+{
+ // Don't create the socket if it already exists
+ if (m_socket == priv::SocketImpl::invalidSocket())
+ {
+ // Assign the new handle
+ m_socket = handle;
+
+ // Set the current blocking state
+ setBlocking(m_isBlocking);
+
+ if (m_type == Tcp)
+ {
+ // Disable the Nagle algorithm (i.e. removes buffering of TCP packets)
+ int yes = 1;
+ if (setsockopt(m_socket, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<char*>(&yes), sizeof(yes)) == -1)
+ {
+ err() << "Failed to set socket option \"TCP_NODELAY\" ; "
+ << "all your TCP packets will be buffered" << std::endl;
+ }
+
+ // On Mac OS X, disable the SIGPIPE signal on disconnection
+ #ifdef SFML_SYSTEM_MACOS
+ if (setsockopt(m_socket, SOL_SOCKET, SO_NOSIGPIPE, reinterpret_cast<char*>(&yes), sizeof(yes)) == -1)
+ {
+ err() << "Failed to set socket option \"SO_NOSIGPIPE\"" << std::endl;
+ }
+ #endif
+ }
+ else
+ {
+ // Enable broadcast by default for UDP sockets
+ int yes = 1;
+ if (setsockopt(m_socket, SOL_SOCKET, SO_BROADCAST, reinterpret_cast<char*>(&yes), sizeof(yes)) == -1)
+ {
+ err() << "Failed to enable broadcast on UDP socket" << std::endl;
+ }
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Socket::close()
+{
+ // Close the socket
+ if (m_socket != priv::SocketImpl::invalidSocket())
+ {
+ priv::SocketImpl::close(m_socket);
+ m_socket = priv::SocketImpl::invalidSocket();
+ }
+}
+
+} // namespace sf
diff --git a/src/SFML/Network/SocketImpl.hpp b/src/SFML/Network/SocketImpl.hpp
index 163489d..fbe45bc 100644
--- a/src/SFML/Network/SocketImpl.hpp
+++ b/src/SFML/Network/SocketImpl.hpp
@@ -1,39 +1,39 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Config.hpp>
-
-
-#if defined(SFML_SYSTEM_WINDOWS)
-
- #include <SFML/Network/Win32/SocketImpl.hpp>
-
-#else
-
- #include <SFML/Network/Unix/SocketImpl.hpp>
-
-#endif
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+
+
+#if defined(SFML_SYSTEM_WINDOWS)
+
+ #include <SFML/Network/Win32/SocketImpl.hpp>
+
+#else
+
+ #include <SFML/Network/Unix/SocketImpl.hpp>
+
+#endif
diff --git a/src/SFML/Network/SocketSelector.cpp b/src/SFML/Network/SocketSelector.cpp
index b6df372..8b521bb 100644
--- a/src/SFML/Network/SocketSelector.cpp
+++ b/src/SFML/Network/SocketSelector.cpp
@@ -1,141 +1,205 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Network/SocketSelector.hpp>
-#include <SFML/Network/Socket.hpp>
-#include <SFML/Network/SocketImpl.hpp>
-#include <SFML/System/Err.hpp>
-#include <utility>
-
-#ifdef _MSC_VER
- #pragma warning(disable : 4127) // "conditional expression is constant" generated by the FD_SET macro
-#endif
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-struct SocketSelector::SocketSelectorImpl
-{
- fd_set AllSockets; ///< Set containing all the sockets handles
- fd_set SocketsReady; ///< Set containing handles of the sockets that are ready
- int MaxSocket; ///< Maximum socket handle
-};
-
-
-////////////////////////////////////////////////////////////
-SocketSelector::SocketSelector() :
-m_impl(new SocketSelectorImpl)
-{
- clear();
-}
-
-
-////////////////////////////////////////////////////////////
-SocketSelector::SocketSelector(const SocketSelector& copy) :
-m_impl(new SocketSelectorImpl(*copy.m_impl))
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-SocketSelector::~SocketSelector()
-{
- delete m_impl;
-}
-
-
-////////////////////////////////////////////////////////////
-void SocketSelector::add(Socket& socket)
-{
- SocketHandle handle = socket.getHandle();
- if (handle != priv::SocketImpl::invalidSocket())
- {
- FD_SET(handle, &m_impl->AllSockets);
-
- int size = static_cast<int>(handle);
- if (size > m_impl->MaxSocket)
- m_impl->MaxSocket = size;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void SocketSelector::remove(Socket& socket)
-{
- FD_CLR(socket.getHandle(), &m_impl->AllSockets);
- FD_CLR(socket.getHandle(), &m_impl->SocketsReady);
-}
-
-
-////////////////////////////////////////////////////////////
-void SocketSelector::clear()
-{
- FD_ZERO(&m_impl->AllSockets);
- FD_ZERO(&m_impl->SocketsReady);
-
- m_impl->MaxSocket = 0;
-}
-
-
-////////////////////////////////////////////////////////////
-bool SocketSelector::wait(Time timeout)
-{
- // Setup the timeout
- timeval time;
- time.tv_sec = static_cast<long>(timeout.asMicroseconds() / 1000000);
- time.tv_usec = static_cast<long>(timeout.asMicroseconds() % 1000000);
-
- // Initialize the set that will contain the sockets that are ready
- m_impl->SocketsReady = m_impl->AllSockets;
-
- // Wait until one of the sockets is ready for reading, or timeout is reached
- int count = select(m_impl->MaxSocket + 1, &m_impl->SocketsReady, NULL, NULL, timeout != Time::Zero ? &time : NULL);
-
- return count > 0;
-}
-
-
-////////////////////////////////////////////////////////////
-bool SocketSelector::isReady(Socket& socket) const
-{
- return FD_ISSET(socket.getHandle(), &m_impl->SocketsReady) != 0;
-}
-
-
-////////////////////////////////////////////////////////////
-SocketSelector& SocketSelector::operator =(const SocketSelector& right)
-{
- SocketSelector temp(right);
-
- std::swap(m_impl, temp.m_impl);
-
- return *this;
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Network/SocketSelector.hpp>
+#include <SFML/Network/Socket.hpp>
+#include <SFML/Network/SocketImpl.hpp>
+#include <SFML/System/Err.hpp>
+#include <algorithm>
+#include <utility>
+
+#ifdef _MSC_VER
+ #pragma warning(disable: 4127) // "conditional expression is constant" generated by the FD_SET macro
+#endif
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+struct SocketSelector::SocketSelectorImpl
+{
+ fd_set allSockets; ///< Set containing all the sockets handles
+ fd_set socketsReady; ///< Set containing handles of the sockets that are ready
+ int maxSocket; ///< Maximum socket handle
+ int socketCount; ///< Number of socket handles
+};
+
+
+////////////////////////////////////////////////////////////
+SocketSelector::SocketSelector() :
+m_impl(new SocketSelectorImpl)
+{
+ clear();
+}
+
+
+////////////////////////////////////////////////////////////
+SocketSelector::SocketSelector(const SocketSelector& copy) :
+m_impl(new SocketSelectorImpl(*copy.m_impl))
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+SocketSelector::~SocketSelector()
+{
+ delete m_impl;
+}
+
+
+////////////////////////////////////////////////////////////
+void SocketSelector::add(Socket& socket)
+{
+ SocketHandle handle = socket.getHandle();
+ if (handle != priv::SocketImpl::invalidSocket())
+ {
+
+#if defined(SFML_SYSTEM_WINDOWS)
+
+ if (m_impl->socketCount >= FD_SETSIZE)
+ {
+ err() << "The socket can't be added to the selector because the "
+ << "selector is full. This is a limitation of your operating "
+ << "system's FD_SETSIZE setting.";
+ return;
+ }
+
+ if (FD_ISSET(handle, &m_impl->allSockets))
+ return;
+
+ m_impl->socketCount++;
+
+#else
+
+ if (handle >= FD_SETSIZE)
+ {
+ err() << "The socket can't be added to the selector because its "
+ << "ID is too high. This is a limitation of your operating "
+ << "system's FD_SETSIZE setting.";
+ return;
+ }
+
+ // SocketHandle is an int in POSIX
+ m_impl->maxSocket = std::max(m_impl->maxSocket, handle);
+
+#endif
+
+ FD_SET(handle, &m_impl->allSockets);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void SocketSelector::remove(Socket& socket)
+{
+ SocketHandle handle = socket.getHandle();
+ if (handle != priv::SocketImpl::invalidSocket())
+ {
+
+#if defined(SFML_SYSTEM_WINDOWS)
+
+ if (!FD_ISSET(handle, &m_impl->allSockets))
+ return;
+
+ m_impl->socketCount--;
+
+#else
+
+ if (handle >= FD_SETSIZE)
+ return;
+
+#endif
+
+ FD_CLR(handle, &m_impl->allSockets);
+ FD_CLR(handle, &m_impl->socketsReady);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void SocketSelector::clear()
+{
+ FD_ZERO(&m_impl->allSockets);
+ FD_ZERO(&m_impl->socketsReady);
+
+ m_impl->maxSocket = 0;
+ m_impl->socketCount = 0;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SocketSelector::wait(Time timeout)
+{
+ // Setup the timeout
+ timeval time;
+ time.tv_sec = static_cast<long>(timeout.asMicroseconds() / 1000000);
+ time.tv_usec = static_cast<long>(timeout.asMicroseconds() % 1000000);
+
+ // Initialize the set that will contain the sockets that are ready
+ m_impl->socketsReady = m_impl->allSockets;
+
+ // Wait until one of the sockets is ready for reading, or timeout is reached
+ // The first parameter is ignored on Windows
+ int count = select(m_impl->maxSocket + 1, &m_impl->socketsReady, NULL, NULL, timeout != Time::Zero ? &time : NULL);
+
+ return count > 0;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SocketSelector::isReady(Socket& socket) const
+{
+ SocketHandle handle = socket.getHandle();
+ if (handle != priv::SocketImpl::invalidSocket())
+ {
+
+#if !defined(SFML_SYSTEM_WINDOWS)
+
+ if (handle >= FD_SETSIZE)
+ return false;
+
+#endif
+
+ return FD_ISSET(handle, &m_impl->socketsReady) != 0;
+ }
+
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+SocketSelector& SocketSelector::operator =(const SocketSelector& right)
+{
+ SocketSelector temp(right);
+
+ std::swap(m_impl, temp.m_impl);
+
+ return *this;
+}
+
+} // namespace sf
diff --git a/src/SFML/Network/TcpListener.cpp b/src/SFML/Network/TcpListener.cpp
index 6c101dc..78f7f43 100644
--- a/src/SFML/Network/TcpListener.cpp
+++ b/src/SFML/Network/TcpListener.cpp
@@ -1,124 +1,124 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Network/TcpListener.hpp>
-#include <SFML/Network/TcpSocket.hpp>
-#include <SFML/Network/SocketImpl.hpp>
-#include <SFML/System/Err.hpp>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-TcpListener::TcpListener() :
-Socket(Tcp)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-unsigned short TcpListener::getLocalPort() const
-{
- if (getHandle() != priv::SocketImpl::invalidSocket())
- {
- // Retrieve informations about the local end of the socket
- sockaddr_in address;
- priv::SocketImpl::AddrLength size = sizeof(address);
- if (getsockname(getHandle(), reinterpret_cast<sockaddr*>(&address), &size) != -1)
- {
- return ntohs(address.sin_port);
- }
- }
-
- // We failed to retrieve the port
- return 0;
-}
-
-
-////////////////////////////////////////////////////////////
-Socket::Status TcpListener::listen(unsigned short port)
-{
- // Create the internal socket if it doesn't exist
- create();
-
- // Bind the socket to the specified port
- sockaddr_in address = priv::SocketImpl::createAddress(INADDR_ANY, port);
- if (bind(getHandle(), reinterpret_cast<sockaddr*>(&address), sizeof(address)) == -1)
- {
- // Not likely to happen, but...
- err() << "Failed to bind listener socket to port " << port << std::endl;
- return Error;
- }
-
- // Listen to the bound port
- if (::listen(getHandle(), 0) == -1)
- {
- // Oops, socket is deaf
- err() << "Failed to listen to port " << port << std::endl;
- return Error;
- }
-
- return Done;
-}
-
-
-////////////////////////////////////////////////////////////
-void TcpListener::close()
-{
- // Simply close the socket
- Socket::close();
-}
-
-
-////////////////////////////////////////////////////////////
-Socket::Status TcpListener::accept(TcpSocket& socket)
-{
- // Make sure that we're listening
- if (getHandle() == priv::SocketImpl::invalidSocket())
- {
- err() << "Failed to accept a new connection, the socket is not listening" << std::endl;
- return Error;
- }
-
- // Accept a new connection
- sockaddr_in address;
- priv::SocketImpl::AddrLength length = sizeof(address);
- SocketHandle remote = ::accept(getHandle(), reinterpret_cast<sockaddr*>(&address), &length);
-
- // Check for errors
- if (remote == priv::SocketImpl::invalidSocket())
- return priv::SocketImpl::getErrorStatus();
-
- // Initialize the new connected socket
- socket.close();
- socket.create(remote);
-
- return Done;
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Network/TcpListener.hpp>
+#include <SFML/Network/TcpSocket.hpp>
+#include <SFML/Network/SocketImpl.hpp>
+#include <SFML/System/Err.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+TcpListener::TcpListener() :
+Socket(Tcp)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+unsigned short TcpListener::getLocalPort() const
+{
+ if (getHandle() != priv::SocketImpl::invalidSocket())
+ {
+ // Retrieve informations about the local end of the socket
+ sockaddr_in address;
+ priv::SocketImpl::AddrLength size = sizeof(address);
+ if (getsockname(getHandle(), reinterpret_cast<sockaddr*>(&address), &size) != -1)
+ {
+ return ntohs(address.sin_port);
+ }
+ }
+
+ // We failed to retrieve the port
+ return 0;
+}
+
+
+////////////////////////////////////////////////////////////
+Socket::Status TcpListener::listen(unsigned short port)
+{
+ // Create the internal socket if it doesn't exist
+ create();
+
+ // Bind the socket to the specified port
+ sockaddr_in address = priv::SocketImpl::createAddress(INADDR_ANY, port);
+ if (bind(getHandle(), reinterpret_cast<sockaddr*>(&address), sizeof(address)) == -1)
+ {
+ // Not likely to happen, but...
+ err() << "Failed to bind listener socket to port " << port << std::endl;
+ return Error;
+ }
+
+ // Listen to the bound port
+ if (::listen(getHandle(), 0) == -1)
+ {
+ // Oops, socket is deaf
+ err() << "Failed to listen to port " << port << std::endl;
+ return Error;
+ }
+
+ return Done;
+}
+
+
+////////////////////////////////////////////////////////////
+void TcpListener::close()
+{
+ // Simply close the socket
+ Socket::close();
+}
+
+
+////////////////////////////////////////////////////////////
+Socket::Status TcpListener::accept(TcpSocket& socket)
+{
+ // Make sure that we're listening
+ if (getHandle() == priv::SocketImpl::invalidSocket())
+ {
+ err() << "Failed to accept a new connection, the socket is not listening" << std::endl;
+ return Error;
+ }
+
+ // Accept a new connection
+ sockaddr_in address;
+ priv::SocketImpl::AddrLength length = sizeof(address);
+ SocketHandle remote = ::accept(getHandle(), reinterpret_cast<sockaddr*>(&address), &length);
+
+ // Check for errors
+ if (remote == priv::SocketImpl::invalidSocket())
+ return priv::SocketImpl::getErrorStatus();
+
+ // Initialize the new connected socket
+ socket.close();
+ socket.create(remote);
+
+ return Done;
+}
+
+} // namespace sf
diff --git a/src/SFML/Network/TcpSocket.cpp b/src/SFML/Network/TcpSocket.cpp
index c7eb6ec..ac6d6b9 100644
--- a/src/SFML/Network/TcpSocket.cpp
+++ b/src/SFML/Network/TcpSocket.cpp
@@ -1,381 +1,382 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Network/TcpSocket.hpp>
-#include <SFML/Network/IpAddress.hpp>
-#include <SFML/Network/Packet.hpp>
-#include <SFML/Network/SocketImpl.hpp>
-#include <SFML/System/Err.hpp>
-#include <algorithm>
-#include <cstring>
-
-#ifdef _MSC_VER
- #pragma warning(disable : 4127) // "conditional expression is constant" generated by the FD_SET macro
-#endif
-
-
-namespace
-{
- // Define the low-level send/receive flags, which depend on the OS
- #ifdef SFML_SYSTEM_LINUX
- const int flags = MSG_NOSIGNAL;
- #else
- const int flags = 0;
- #endif
-}
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-TcpSocket::TcpSocket() :
-Socket(Tcp)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-unsigned short TcpSocket::getLocalPort() const
-{
- if (getHandle() != priv::SocketImpl::invalidSocket())
- {
- // Retrieve informations about the local end of the socket
- sockaddr_in address;
- priv::SocketImpl::AddrLength size = sizeof(address);
- if (getsockname(getHandle(), reinterpret_cast<sockaddr*>(&address), &size) != -1)
- {
- return ntohs(address.sin_port);
- }
- }
-
- // We failed to retrieve the port
- return 0;
-}
-
-
-////////////////////////////////////////////////////////////
-IpAddress TcpSocket::getRemoteAddress() const
-{
- if (getHandle() != priv::SocketImpl::invalidSocket())
- {
- // Retrieve informations about the remote end of the socket
- sockaddr_in address;
- priv::SocketImpl::AddrLength size = sizeof(address);
- if (getpeername(getHandle(), reinterpret_cast<sockaddr*>(&address), &size) != -1)
- {
- return IpAddress(ntohl(address.sin_addr.s_addr));
- }
- }
-
- // We failed to retrieve the address
- return IpAddress::None;
-}
-
-
-////////////////////////////////////////////////////////////
-unsigned short TcpSocket::getRemotePort() const
-{
- if (getHandle() != priv::SocketImpl::invalidSocket())
- {
- // Retrieve informations about the remote end of the socket
- sockaddr_in address;
- priv::SocketImpl::AddrLength size = sizeof(address);
- if (getpeername(getHandle(), reinterpret_cast<sockaddr*>(&address), &size) != -1)
- {
- return ntohs(address.sin_port);
- }
- }
-
- // We failed to retrieve the port
- return 0;
-}
-
-
-////////////////////////////////////////////////////////////
-Socket::Status TcpSocket::connect(const IpAddress& remoteAddress, unsigned short remotePort, Time timeout)
-{
- // Create the internal socket if it doesn't exist
- create();
-
- // Create the remote address
- sockaddr_in address = priv::SocketImpl::createAddress(remoteAddress.toInteger(), remotePort);
-
- if (timeout <= Time::Zero)
- {
- // ----- We're not using a timeout: just try to connect -----
-
- // Connect the socket
- if (::connect(getHandle(), reinterpret_cast<sockaddr*>(&address), sizeof(address)) == -1)
- return priv::SocketImpl::getErrorStatus();
-
- // Connection succeeded
- return Done;
- }
- else
- {
- // ----- We're using a timeout: we'll need a few tricks to make it work -----
-
- // Save the previous blocking state
- bool blocking = isBlocking();
-
- // Switch to non-blocking to enable our connection timeout
- if (blocking)
- setBlocking(false);
-
- // Try to connect to the remote address
- if (::connect(getHandle(), reinterpret_cast<sockaddr*>(&address), sizeof(address)) >= 0)
- {
- // We got instantly connected! (it may no happen a lot...)
- return Done;
- }
-
- // Get the error status
- Status status = priv::SocketImpl::getErrorStatus();
-
- // If we were in non-blocking mode, return immediatly
- if (!blocking)
- return status;
-
- // Otherwise, wait until something happens to our socket (success, timeout or error)
- if (status == Socket::NotReady)
- {
- // Setup the selector
- fd_set selector;
- FD_ZERO(&selector);
- FD_SET(getHandle(), &selector);
-
- // Setup the timeout
- timeval time;
- time.tv_sec = static_cast<long>(timeout.asMicroseconds() / 1000000);
- time.tv_usec = static_cast<long>(timeout.asMicroseconds() % 1000000);
-
- // Wait for something to write on our socket (which means that the connection request has returned)
- if (select(static_cast<int>(getHandle() + 1), NULL, &selector, NULL, &time) > 0)
- {
- // At this point the connection may have been either accepted or refused.
- // To know whether it's a success or a failure, we must check the address of the connected peer
- if (getRemoteAddress() != sf::IpAddress::None)
- {
- // Connection accepted
- status = Done;
- }
- else
- {
- // Connection refused
- status = priv::SocketImpl::getErrorStatus();
- }
- }
- else
- {
- // Failed to connect before timeout is over
- status = priv::SocketImpl::getErrorStatus();
- }
- }
-
- // Switch back to blocking mode
- setBlocking(true);
-
- return status;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void TcpSocket::disconnect()
-{
- // Close the socket
- close();
-
- // Reset the pending packet data
- m_pendingPacket = PendingPacket();
-}
-
-
-////////////////////////////////////////////////////////////
-Socket::Status TcpSocket::send(const void* data, std::size_t size)
-{
- // Check the parameters
- if (!data || (size == 0))
- {
- err() << "Cannot send data over the network (no data to send)" << std::endl;
- return Error;
- }
-
- // Loop until every byte has been sent
- int sent = 0;
- int sizeToSend = static_cast<int>(size);
- for (int length = 0; length < sizeToSend; length += sent)
- {
- // Send a chunk of data
- sent = ::send(getHandle(), static_cast<const char*>(data) + length, sizeToSend - length, flags);
-
- // Check for errors
- if (sent < 0)
- return priv::SocketImpl::getErrorStatus();
- }
-
- return Done;
-}
-
-
-////////////////////////////////////////////////////////////
-Socket::Status TcpSocket::receive(void* data, std::size_t size, std::size_t& received)
-{
- // First clear the variables to fill
- received = 0;
-
- // Check the destination buffer
- if (!data)
- {
- err() << "Cannot receive data from the network (the destination buffer is invalid)" << std::endl;
- return Error;
- }
-
- // Receive a chunk of bytes
- int sizeReceived = recv(getHandle(), static_cast<char*>(data), static_cast<int>(size), flags);
-
- // Check the number of bytes received
- if (sizeReceived > 0)
- {
- received = static_cast<std::size_t>(sizeReceived);
- return Done;
- }
- else if (sizeReceived == 0)
- {
- return Socket::Disconnected;
- }
- else
- {
- return priv::SocketImpl::getErrorStatus();
- }
-}
-
-
-////////////////////////////////////////////////////////////
-Socket::Status TcpSocket::send(Packet& packet)
-{
- // TCP is a stream protocol, it doesn't preserve messages boundaries.
- // This means that we have to send the packet size first, so that the
- // receiver knows the actual end of the packet in the data stream.
-
- // We allocate an extra memory block so that the size can be sent
- // together with the data in a single call. This may seem inefficient,
- // but it is actually required to avoid partial send, which could cause
- // data corruption on the receiving end.
-
- // Get the data to send from the packet
- std::size_t size = 0;
- const void* data = packet.onSend(size);
-
- // First convert the packet size to network byte order
- Uint32 packetSize = htonl(static_cast<Uint32>(size));
-
- // Allocate memory for the data block to send
- std::vector<char> blockToSend(sizeof(packetSize) + size);
-
- // Copy the packet size and data into the block to send
- std::memcpy(&blockToSend[0], &packetSize, sizeof(packetSize));
- if (size > 0)
- std::memcpy(&blockToSend[0] + sizeof(packetSize), data, size);
-
- // Send the data block
- return send(&blockToSend[0], blockToSend.size());
-}
-
-
-////////////////////////////////////////////////////////////
-Socket::Status TcpSocket::receive(Packet& packet)
-{
- // First clear the variables to fill
- packet.clear();
-
- // We start by getting the size of the incoming packet
- Uint32 packetSize = 0;
- std::size_t received = 0;
- if (m_pendingPacket.SizeReceived < sizeof(m_pendingPacket.Size))
- {
- // Loop until we've received the entire size of the packet
- // (even a 4 byte variable may be received in more than one call)
- while (m_pendingPacket.SizeReceived < sizeof(m_pendingPacket.Size))
- {
- char* data = reinterpret_cast<char*>(&m_pendingPacket.Size) + m_pendingPacket.SizeReceived;
- Status status = receive(data, sizeof(m_pendingPacket.Size) - m_pendingPacket.SizeReceived, received);
- m_pendingPacket.SizeReceived += received;
-
- if (status != Done)
- return status;
- }
-
- // The packet size has been fully received
- packetSize = ntohl(m_pendingPacket.Size);
- }
- else
- {
- // The packet size has already been received in a previous call
- packetSize = ntohl(m_pendingPacket.Size);
- }
-
- // Loop until we receive all the packet data
- char buffer[1024];
- while (m_pendingPacket.Data.size() < packetSize)
- {
- // Receive a chunk of data
- std::size_t sizeToGet = std::min(static_cast<std::size_t>(packetSize - m_pendingPacket.Data.size()), sizeof(buffer));
- Status status = receive(buffer, sizeToGet, received);
- if (status != Done)
- return status;
-
- // Append it into the packet
- if (received > 0)
- {
- m_pendingPacket.Data.resize(m_pendingPacket.Data.size() + received);
- char* begin = &m_pendingPacket.Data[0] + m_pendingPacket.Data.size() - received;
- std::memcpy(begin, buffer, received);
- }
- }
-
- // We have received all the packet data: we can copy it to the user packet
- if (!m_pendingPacket.Data.empty())
- packet.onReceive(&m_pendingPacket.Data[0], m_pendingPacket.Data.size());
-
- // Clear the pending packet data
- m_pendingPacket = PendingPacket();
-
- return Done;
-}
-
-
-////////////////////////////////////////////////////////////
-TcpSocket::PendingPacket::PendingPacket() :
-Size (0),
-SizeReceived(0),
-Data ()
-{
-
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Network/TcpSocket.hpp>
+#include <SFML/Network/IpAddress.hpp>
+#include <SFML/Network/Packet.hpp>
+#include <SFML/Network/SocketImpl.hpp>
+#include <SFML/System/Err.hpp>
+#include <algorithm>
+#include <cstring>
+
+#ifdef _MSC_VER
+ #pragma warning(disable: 4127) // "conditional expression is constant" generated by the FD_SET macro
+#endif
+
+
+namespace
+{
+ // Define the low-level send/receive flags, which depend on the OS
+ #ifdef SFML_SYSTEM_LINUX
+ const int flags = MSG_NOSIGNAL;
+ #else
+ const int flags = 0;
+ #endif
+}
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+TcpSocket::TcpSocket() :
+Socket(Tcp)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+unsigned short TcpSocket::getLocalPort() const
+{
+ if (getHandle() != priv::SocketImpl::invalidSocket())
+ {
+ // Retrieve informations about the local end of the socket
+ sockaddr_in address;
+ priv::SocketImpl::AddrLength size = sizeof(address);
+ if (getsockname(getHandle(), reinterpret_cast<sockaddr*>(&address), &size) != -1)
+ {
+ return ntohs(address.sin_port);
+ }
+ }
+
+ // We failed to retrieve the port
+ return 0;
+}
+
+
+////////////////////////////////////////////////////////////
+IpAddress TcpSocket::getRemoteAddress() const
+{
+ if (getHandle() != priv::SocketImpl::invalidSocket())
+ {
+ // Retrieve informations about the remote end of the socket
+ sockaddr_in address;
+ priv::SocketImpl::AddrLength size = sizeof(address);
+ if (getpeername(getHandle(), reinterpret_cast<sockaddr*>(&address), &size) != -1)
+ {
+ return IpAddress(ntohl(address.sin_addr.s_addr));
+ }
+ }
+
+ // We failed to retrieve the address
+ return IpAddress::None;
+}
+
+
+////////////////////////////////////////////////////////////
+unsigned short TcpSocket::getRemotePort() const
+{
+ if (getHandle() != priv::SocketImpl::invalidSocket())
+ {
+ // Retrieve informations about the remote end of the socket
+ sockaddr_in address;
+ priv::SocketImpl::AddrLength size = sizeof(address);
+ if (getpeername(getHandle(), reinterpret_cast<sockaddr*>(&address), &size) != -1)
+ {
+ return ntohs(address.sin_port);
+ }
+ }
+
+ // We failed to retrieve the port
+ return 0;
+}
+
+
+////////////////////////////////////////////////////////////
+Socket::Status TcpSocket::connect(const IpAddress& remoteAddress, unsigned short remotePort, Time timeout)
+{
+ // Create the internal socket if it doesn't exist
+ create();
+
+ // Create the remote address
+ sockaddr_in address = priv::SocketImpl::createAddress(remoteAddress.toInteger(), remotePort);
+
+ if (timeout <= Time::Zero)
+ {
+ // ----- We're not using a timeout: just try to connect -----
+
+ // Connect the socket
+ if (::connect(getHandle(), reinterpret_cast<sockaddr*>(&address), sizeof(address)) == -1)
+ return priv::SocketImpl::getErrorStatus();
+
+ // Connection succeeded
+ return Done;
+ }
+ else
+ {
+ // ----- We're using a timeout: we'll need a few tricks to make it work -----
+
+ // Save the previous blocking state
+ bool blocking = isBlocking();
+
+ // Switch to non-blocking to enable our connection timeout
+ if (blocking)
+ setBlocking(false);
+
+ // Try to connect to the remote address
+ if (::connect(getHandle(), reinterpret_cast<sockaddr*>(&address), sizeof(address)) >= 0)
+ {
+ // We got instantly connected! (it may no happen a lot...)
+ setBlocking(blocking);
+ return Done;
+ }
+
+ // Get the error status
+ Status status = priv::SocketImpl::getErrorStatus();
+
+ // If we were in non-blocking mode, return immediately
+ if (!blocking)
+ return status;
+
+ // Otherwise, wait until something happens to our socket (success, timeout or error)
+ if (status == Socket::NotReady)
+ {
+ // Setup the selector
+ fd_set selector;
+ FD_ZERO(&selector);
+ FD_SET(getHandle(), &selector);
+
+ // Setup the timeout
+ timeval time;
+ time.tv_sec = static_cast<long>(timeout.asMicroseconds() / 1000000);
+ time.tv_usec = static_cast<long>(timeout.asMicroseconds() % 1000000);
+
+ // Wait for something to write on our socket (which means that the connection request has returned)
+ if (select(static_cast<int>(getHandle() + 1), NULL, &selector, NULL, &time) > 0)
+ {
+ // At this point the connection may have been either accepted or refused.
+ // To know whether it's a success or a failure, we must check the address of the connected peer
+ if (getRemoteAddress() != sf::IpAddress::None)
+ {
+ // Connection accepted
+ status = Done;
+ }
+ else
+ {
+ // Connection refused
+ status = priv::SocketImpl::getErrorStatus();
+ }
+ }
+ else
+ {
+ // Failed to connect before timeout is over
+ status = priv::SocketImpl::getErrorStatus();
+ }
+ }
+
+ // Switch back to blocking mode
+ setBlocking(true);
+
+ return status;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void TcpSocket::disconnect()
+{
+ // Close the socket
+ close();
+
+ // Reset the pending packet data
+ m_pendingPacket = PendingPacket();
+}
+
+
+////////////////////////////////////////////////////////////
+Socket::Status TcpSocket::send(const void* data, std::size_t size)
+{
+ // Check the parameters
+ if (!data || (size == 0))
+ {
+ err() << "Cannot send data over the network (no data to send)" << std::endl;
+ return Error;
+ }
+
+ // Loop until every byte has been sent
+ int sent = 0;
+ int sizeToSend = static_cast<int>(size);
+ for (int length = 0; length < sizeToSend; length += sent)
+ {
+ // Send a chunk of data
+ sent = ::send(getHandle(), static_cast<const char*>(data) + length, sizeToSend - length, flags);
+
+ // Check for errors
+ if (sent < 0)
+ return priv::SocketImpl::getErrorStatus();
+ }
+
+ return Done;
+}
+
+
+////////////////////////////////////////////////////////////
+Socket::Status TcpSocket::receive(void* data, std::size_t size, std::size_t& received)
+{
+ // First clear the variables to fill
+ received = 0;
+
+ // Check the destination buffer
+ if (!data)
+ {
+ err() << "Cannot receive data from the network (the destination buffer is invalid)" << std::endl;
+ return Error;
+ }
+
+ // Receive a chunk of bytes
+ int sizeReceived = recv(getHandle(), static_cast<char*>(data), static_cast<int>(size), flags);
+
+ // Check the number of bytes received
+ if (sizeReceived > 0)
+ {
+ received = static_cast<std::size_t>(sizeReceived);
+ return Done;
+ }
+ else if (sizeReceived == 0)
+ {
+ return Socket::Disconnected;
+ }
+ else
+ {
+ return priv::SocketImpl::getErrorStatus();
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+Socket::Status TcpSocket::send(Packet& packet)
+{
+ // TCP is a stream protocol, it doesn't preserve messages boundaries.
+ // This means that we have to send the packet size first, so that the
+ // receiver knows the actual end of the packet in the data stream.
+
+ // We allocate an extra memory block so that the size can be sent
+ // together with the data in a single call. This may seem inefficient,
+ // but it is actually required to avoid partial send, which could cause
+ // data corruption on the receiving end.
+
+ // Get the data to send from the packet
+ std::size_t size = 0;
+ const void* data = packet.onSend(size);
+
+ // First convert the packet size to network byte order
+ Uint32 packetSize = htonl(static_cast<Uint32>(size));
+
+ // Allocate memory for the data block to send
+ std::vector<char> blockToSend(sizeof(packetSize) + size);
+
+ // Copy the packet size and data into the block to send
+ std::memcpy(&blockToSend[0], &packetSize, sizeof(packetSize));
+ if (size > 0)
+ std::memcpy(&blockToSend[0] + sizeof(packetSize), data, size);
+
+ // Send the data block
+ return send(&blockToSend[0], blockToSend.size());
+}
+
+
+////////////////////////////////////////////////////////////
+Socket::Status TcpSocket::receive(Packet& packet)
+{
+ // First clear the variables to fill
+ packet.clear();
+
+ // We start by getting the size of the incoming packet
+ Uint32 packetSize = 0;
+ std::size_t received = 0;
+ if (m_pendingPacket.SizeReceived < sizeof(m_pendingPacket.Size))
+ {
+ // Loop until we've received the entire size of the packet
+ // (even a 4 byte variable may be received in more than one call)
+ while (m_pendingPacket.SizeReceived < sizeof(m_pendingPacket.Size))
+ {
+ char* data = reinterpret_cast<char*>(&m_pendingPacket.Size) + m_pendingPacket.SizeReceived;
+ Status status = receive(data, sizeof(m_pendingPacket.Size) - m_pendingPacket.SizeReceived, received);
+ m_pendingPacket.SizeReceived += received;
+
+ if (status != Done)
+ return status;
+ }
+
+ // The packet size has been fully received
+ packetSize = ntohl(m_pendingPacket.Size);
+ }
+ else
+ {
+ // The packet size has already been received in a previous call
+ packetSize = ntohl(m_pendingPacket.Size);
+ }
+
+ // Loop until we receive all the packet data
+ char buffer[1024];
+ while (m_pendingPacket.Data.size() < packetSize)
+ {
+ // Receive a chunk of data
+ std::size_t sizeToGet = std::min(static_cast<std::size_t>(packetSize - m_pendingPacket.Data.size()), sizeof(buffer));
+ Status status = receive(buffer, sizeToGet, received);
+ if (status != Done)
+ return status;
+
+ // Append it into the packet
+ if (received > 0)
+ {
+ m_pendingPacket.Data.resize(m_pendingPacket.Data.size() + received);
+ char* begin = &m_pendingPacket.Data[0] + m_pendingPacket.Data.size() - received;
+ std::memcpy(begin, buffer, received);
+ }
+ }
+
+ // We have received all the packet data: we can copy it to the user packet
+ if (!m_pendingPacket.Data.empty())
+ packet.onReceive(&m_pendingPacket.Data[0], m_pendingPacket.Data.size());
+
+ // Clear the pending packet data
+ m_pendingPacket = PendingPacket();
+
+ return Done;
+}
+
+
+////////////////////////////////////////////////////////////
+TcpSocket::PendingPacket::PendingPacket() :
+Size (0),
+SizeReceived(0),
+Data ()
+{
+
+}
+
+} // namespace sf
diff --git a/src/SFML/Network/UdpSocket.cpp b/src/SFML/Network/UdpSocket.cpp
index 78e4b99..af56f5d 100644
--- a/src/SFML/Network/UdpSocket.cpp
+++ b/src/SFML/Network/UdpSocket.cpp
@@ -1,193 +1,193 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Network/UdpSocket.hpp>
-#include <SFML/Network/IpAddress.hpp>
-#include <SFML/Network/Packet.hpp>
-#include <SFML/Network/SocketImpl.hpp>
-#include <SFML/System/Err.hpp>
-#include <algorithm>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-UdpSocket::UdpSocket() :
-Socket (Udp),
-m_buffer(MaxDatagramSize)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-unsigned short UdpSocket::getLocalPort() const
-{
- if (getHandle() != priv::SocketImpl::invalidSocket())
- {
- // Retrieve informations about the local end of the socket
- sockaddr_in address;
- priv::SocketImpl::AddrLength size = sizeof(address);
- if (getsockname(getHandle(), reinterpret_cast<sockaddr*>(&address), &size) != -1)
- {
- return ntohs(address.sin_port);
- }
- }
-
- // We failed to retrieve the port
- return 0;
-}
-
-
-////////////////////////////////////////////////////////////
-Socket::Status UdpSocket::bind(unsigned short port)
-{
- // Create the internal socket if it doesn't exist
- create();
-
- // Bind the socket
- sockaddr_in address = priv::SocketImpl::createAddress(INADDR_ANY, port);
- if (::bind(getHandle(), reinterpret_cast<sockaddr*>(&address), sizeof(address)) == -1)
- {
- err() << "Failed to bind socket to port " << port << std::endl;
- return Error;
- }
-
- return Done;
-}
-
-
-////////////////////////////////////////////////////////////
-void UdpSocket::unbind()
-{
- // Simply close the socket
- close();
-}
-
-
-////////////////////////////////////////////////////////////
-Socket::Status UdpSocket::send(const void* data, std::size_t size, const IpAddress& remoteAddress, unsigned short remotePort)
-{
- // Create the internal socket if it doesn't exist
- create();
-
- // Make sure that all the data will fit in one datagram
- if (size > MaxDatagramSize)
- {
- err() << "Cannot send data over the network "
- << "(the number of bytes to send is greater than sf::UdpSocket::MaxDatagramSize)" << std::endl;
- return Error;
- }
-
- // Build the target address
- sockaddr_in address = priv::SocketImpl::createAddress(remoteAddress.toInteger(), remotePort);
-
- // Send the data (unlike TCP, all the data is always sent in one call)
- int sent = sendto(getHandle(), static_cast<const char*>(data), static_cast<int>(size), 0, reinterpret_cast<sockaddr*>(&address), sizeof(address));
-
- // Check for errors
- if (sent < 0)
- return priv::SocketImpl::getErrorStatus();
-
- return Done;
-}
-
-
-////////////////////////////////////////////////////////////
-Socket::Status UdpSocket::receive(void* data, std::size_t size, std::size_t& received, IpAddress& remoteAddress, unsigned short& remotePort)
-{
- // First clear the variables to fill
- received = 0;
- remoteAddress = IpAddress();
- remotePort = 0;
-
- // Check the destination buffer
- if (!data)
- {
- err() << "Cannot receive data from the network (the destination buffer is invalid)" << std::endl;
- return Error;
- }
-
- // Data that will be filled with the other computer's address
- sockaddr_in address = priv::SocketImpl::createAddress(INADDR_ANY, 0);
-
- // Receive a chunk of bytes
- priv::SocketImpl::AddrLength addressSize = sizeof(address);
- int sizeReceived = recvfrom(getHandle(), static_cast<char*>(data), static_cast<int>(size), 0, reinterpret_cast<sockaddr*>(&address), &addressSize);
-
- // Check for errors
- if (sizeReceived < 0)
- return priv::SocketImpl::getErrorStatus();
-
- // Fill the sender informations
- received = static_cast<std::size_t>(sizeReceived);
- remoteAddress = IpAddress(ntohl(address.sin_addr.s_addr));
- remotePort = ntohs(address.sin_port);
-
- return Done;
-}
-
-
-////////////////////////////////////////////////////////////
-Socket::Status UdpSocket::send(Packet& packet, const IpAddress& remoteAddress, unsigned short remotePort)
-{
- // UDP is a datagram-oriented protocol (as opposed to TCP which is a stream protocol).
- // Sending one datagram is almost safe: it may be lost but if it's received, then its data
- // is guaranteed to be ok. However, splitting a packet into multiple datagrams would be highly
- // unreliable, since datagrams may be reordered, dropped or mixed between different sources.
- // That's why SFML imposes a limit on packet size so that they can be sent in a single datagram.
- // This also removes the overhead associated to packets -- there's no size to send in addition
- // to the packet's data.
-
- // Get the data to send from the packet
- std::size_t size = 0;
- const void* data = packet.onSend(size);
-
- // Send it
- return send(data, size, remoteAddress, remotePort);
-}
-
-
-////////////////////////////////////////////////////////////
-Socket::Status UdpSocket::receive(Packet& packet, IpAddress& remoteAddress, unsigned short& remotePort)
-{
- // See the detailed comment in send(Packet) above.
-
- // Receive the datagram
- std::size_t received = 0;
- Status status = receive(&m_buffer[0], m_buffer.size(), received, remoteAddress, remotePort);
-
- // If we received valid data, we can copy it to the user packet
- packet.clear();
- if ((status == Done) && (received > 0))
- packet.onReceive(&m_buffer[0], received);
-
- return status;
-}
-
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Network/UdpSocket.hpp>
+#include <SFML/Network/IpAddress.hpp>
+#include <SFML/Network/Packet.hpp>
+#include <SFML/Network/SocketImpl.hpp>
+#include <SFML/System/Err.hpp>
+#include <algorithm>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+UdpSocket::UdpSocket() :
+Socket (Udp),
+m_buffer(MaxDatagramSize)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+unsigned short UdpSocket::getLocalPort() const
+{
+ if (getHandle() != priv::SocketImpl::invalidSocket())
+ {
+ // Retrieve informations about the local end of the socket
+ sockaddr_in address;
+ priv::SocketImpl::AddrLength size = sizeof(address);
+ if (getsockname(getHandle(), reinterpret_cast<sockaddr*>(&address), &size) != -1)
+ {
+ return ntohs(address.sin_port);
+ }
+ }
+
+ // We failed to retrieve the port
+ return 0;
+}
+
+
+////////////////////////////////////////////////////////////
+Socket::Status UdpSocket::bind(unsigned short port)
+{
+ // Create the internal socket if it doesn't exist
+ create();
+
+ // Bind the socket
+ sockaddr_in address = priv::SocketImpl::createAddress(INADDR_ANY, port);
+ if (::bind(getHandle(), reinterpret_cast<sockaddr*>(&address), sizeof(address)) == -1)
+ {
+ err() << "Failed to bind socket to port " << port << std::endl;
+ return Error;
+ }
+
+ return Done;
+}
+
+
+////////////////////////////////////////////////////////////
+void UdpSocket::unbind()
+{
+ // Simply close the socket
+ close();
+}
+
+
+////////////////////////////////////////////////////////////
+Socket::Status UdpSocket::send(const void* data, std::size_t size, const IpAddress& remoteAddress, unsigned short remotePort)
+{
+ // Create the internal socket if it doesn't exist
+ create();
+
+ // Make sure that all the data will fit in one datagram
+ if (size > MaxDatagramSize)
+ {
+ err() << "Cannot send data over the network "
+ << "(the number of bytes to send is greater than sf::UdpSocket::MaxDatagramSize)" << std::endl;
+ return Error;
+ }
+
+ // Build the target address
+ sockaddr_in address = priv::SocketImpl::createAddress(remoteAddress.toInteger(), remotePort);
+
+ // Send the data (unlike TCP, all the data is always sent in one call)
+ int sent = sendto(getHandle(), static_cast<const char*>(data), static_cast<int>(size), 0, reinterpret_cast<sockaddr*>(&address), sizeof(address));
+
+ // Check for errors
+ if (sent < 0)
+ return priv::SocketImpl::getErrorStatus();
+
+ return Done;
+}
+
+
+////////////////////////////////////////////////////////////
+Socket::Status UdpSocket::receive(void* data, std::size_t size, std::size_t& received, IpAddress& remoteAddress, unsigned short& remotePort)
+{
+ // First clear the variables to fill
+ received = 0;
+ remoteAddress = IpAddress();
+ remotePort = 0;
+
+ // Check the destination buffer
+ if (!data)
+ {
+ err() << "Cannot receive data from the network (the destination buffer is invalid)" << std::endl;
+ return Error;
+ }
+
+ // Data that will be filled with the other computer's address
+ sockaddr_in address = priv::SocketImpl::createAddress(INADDR_ANY, 0);
+
+ // Receive a chunk of bytes
+ priv::SocketImpl::AddrLength addressSize = sizeof(address);
+ int sizeReceived = recvfrom(getHandle(), static_cast<char*>(data), static_cast<int>(size), 0, reinterpret_cast<sockaddr*>(&address), &addressSize);
+
+ // Check for errors
+ if (sizeReceived < 0)
+ return priv::SocketImpl::getErrorStatus();
+
+ // Fill the sender informations
+ received = static_cast<std::size_t>(sizeReceived);
+ remoteAddress = IpAddress(ntohl(address.sin_addr.s_addr));
+ remotePort = ntohs(address.sin_port);
+
+ return Done;
+}
+
+
+////////////////////////////////////////////////////////////
+Socket::Status UdpSocket::send(Packet& packet, const IpAddress& remoteAddress, unsigned short remotePort)
+{
+ // UDP is a datagram-oriented protocol (as opposed to TCP which is a stream protocol).
+ // Sending one datagram is almost safe: it may be lost but if it's received, then its data
+ // is guaranteed to be ok. However, splitting a packet into multiple datagrams would be highly
+ // unreliable, since datagrams may be reordered, dropped or mixed between different sources.
+ // That's why SFML imposes a limit on packet size so that they can be sent in a single datagram.
+ // This also removes the overhead associated to packets -- there's no size to send in addition
+ // to the packet's data.
+
+ // Get the data to send from the packet
+ std::size_t size = 0;
+ const void* data = packet.onSend(size);
+
+ // Send it
+ return send(data, size, remoteAddress, remotePort);
+}
+
+
+////////////////////////////////////////////////////////////
+Socket::Status UdpSocket::receive(Packet& packet, IpAddress& remoteAddress, unsigned short& remotePort)
+{
+ // See the detailed comment in send(Packet) above.
+
+ // Receive the datagram
+ std::size_t received = 0;
+ Status status = receive(&m_buffer[0], m_buffer.size(), received, remoteAddress, remotePort);
+
+ // If we received valid data, we can copy it to the user packet
+ packet.clear();
+ if ((status == Done) && (received > 0))
+ packet.onReceive(&m_buffer[0], received);
+
+ return status;
+}
+
+
+} // namespace sf
diff --git a/src/SFML/Network/Unix/SocketImpl.cpp b/src/SFML/Network/Unix/SocketImpl.cpp
index 4a6b508..a36e617 100644
--- a/src/SFML/Network/Unix/SocketImpl.cpp
+++ b/src/SFML/Network/Unix/SocketImpl.cpp
@@ -1,100 +1,104 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Network/Unix/SocketImpl.hpp>
-#include <errno.h>
-#include <fcntl.h>
-#include <cstring>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-sockaddr_in SocketImpl::createAddress(Uint32 address, unsigned short port)
-{
- sockaddr_in addr;
- std::memset(addr.sin_zero, 0, sizeof(addr.sin_zero));
- addr.sin_addr.s_addr = htonl(address);
- addr.sin_family = AF_INET;
- addr.sin_port = htons(port);
-
- return addr;
-}
-
-
-////////////////////////////////////////////////////////////
-SocketHandle SocketImpl::invalidSocket()
-{
- return -1;
-}
-
-
-////////////////////////////////////////////////////////////
-void SocketImpl::close(SocketHandle sock)
-{
- ::close(sock);
-}
-
-
-////////////////////////////////////////////////////////////
-void SocketImpl::setBlocking(SocketHandle sock, bool block)
-{
- int status = fcntl(sock, F_GETFL);
- if (block)
- fcntl(sock, F_SETFL, status & ~O_NONBLOCK);
- else
- fcntl(sock, F_SETFL, status | O_NONBLOCK);
-}
-
-
-////////////////////////////////////////////////////////////
-Socket::Status SocketImpl::getErrorStatus()
-{
- // The followings are sometimes equal to EWOULDBLOCK,
- // so we have to make a special case for them in order
- // to avoid having double values in the switch case
- if ((errno == EAGAIN) || (errno == EINPROGRESS))
- return Socket::NotReady;
-
- switch (errno)
- {
- case EWOULDBLOCK : return Socket::NotReady;
- case ECONNABORTED : return Socket::Disconnected;
- case ECONNRESET : return Socket::Disconnected;
- case ETIMEDOUT : return Socket::Disconnected;
- case ENETRESET : return Socket::Disconnected;
- case ENOTCONN : return Socket::Disconnected;
- case EPIPE : return Socket::Disconnected;
- default : return Socket::Error;
- }
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Network/Unix/SocketImpl.hpp>
+#include <errno.h>
+#include <fcntl.h>
+#include <cstring>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+sockaddr_in SocketImpl::createAddress(Uint32 address, unsigned short port)
+{
+ sockaddr_in addr;
+ std::memset(&addr, 0, sizeof(addr));
+ addr.sin_addr.s_addr = htonl(address);
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(port);
+
+#if defined(SFML_SYSTEM_MACOS)
+ addr.sin_len = sizeof(addr);
+#endif
+
+ return addr;
+}
+
+
+////////////////////////////////////////////////////////////
+SocketHandle SocketImpl::invalidSocket()
+{
+ return -1;
+}
+
+
+////////////////////////////////////////////////////////////
+void SocketImpl::close(SocketHandle sock)
+{
+ ::close(sock);
+}
+
+
+////////////////////////////////////////////////////////////
+void SocketImpl::setBlocking(SocketHandle sock, bool block)
+{
+ int status = fcntl(sock, F_GETFL);
+ if (block)
+ fcntl(sock, F_SETFL, status & ~O_NONBLOCK);
+ else
+ fcntl(sock, F_SETFL, status | O_NONBLOCK);
+}
+
+
+////////////////////////////////////////////////////////////
+Socket::Status SocketImpl::getErrorStatus()
+{
+ // The followings are sometimes equal to EWOULDBLOCK,
+ // so we have to make a special case for them in order
+ // to avoid having double values in the switch case
+ if ((errno == EAGAIN) || (errno == EINPROGRESS))
+ return Socket::NotReady;
+
+ switch (errno)
+ {
+ case EWOULDBLOCK: return Socket::NotReady;
+ case ECONNABORTED: return Socket::Disconnected;
+ case ECONNRESET: return Socket::Disconnected;
+ case ETIMEDOUT: return Socket::Disconnected;
+ case ENETRESET: return Socket::Disconnected;
+ case ENOTCONN: return Socket::Disconnected;
+ case EPIPE: return Socket::Disconnected;
+ default: return Socket::Error;
+ }
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Network/Unix/SocketImpl.hpp b/src/SFML/Network/Unix/SocketImpl.hpp
index fde4bea..8a3f29f 100644
--- a/src/SFML/Network/Unix/SocketImpl.hpp
+++ b/src/SFML/Network/Unix/SocketImpl.hpp
@@ -1,109 +1,109 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_SOCKETIMPL_HPP
-#define SFML_SOCKETIMPL_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Network/Socket.hpp>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <unistd.h>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief Helper class implementing all the non-portable
-/// socket stuff; this is the Unix version
-///
-////////////////////////////////////////////////////////////
-class SocketImpl
-{
-public :
-
- ////////////////////////////////////////////////////////////
- // Types
- ////////////////////////////////////////////////////////////
- typedef socklen_t AddrLength;
-
- ////////////////////////////////////////////////////////////
- /// \brief Create an internal sockaddr_in address
- ///
- /// \param address Target address
- /// \param port Target port
- ///
- /// \return sockaddr_in ready to be used by socket functions
- ///
- ////////////////////////////////////////////////////////////
- static sockaddr_in createAddress(Uint32 address, unsigned short port);
-
- ////////////////////////////////////////////////////////////
- /// \brief Return the value of the invalid socket
- ///
- /// \return Special value of the invalid socket
- ///
- ////////////////////////////////////////////////////////////
- static SocketHandle invalidSocket();
-
- ////////////////////////////////////////////////////////////
- /// \brief Close and destroy a socket
- ///
- /// \param sock Handle of the socket to close
- ///
- ////////////////////////////////////////////////////////////
- static void close(SocketHandle sock);
-
- ////////////////////////////////////////////////////////////
- /// \brief Set a socket as blocking or non-blocking
- ///
- /// \param sock Handle of the socket
- /// \param block New blocking state of the socket
- ///
- ////////////////////////////////////////////////////////////
- static void setBlocking(SocketHandle sock, bool block);
-
- ////////////////////////////////////////////////////////////
- /// Get the last socket error status
- ///
- /// \return Status corresponding to the last socket error
- ///
- ////////////////////////////////////////////////////////////
- static Socket::Status getErrorStatus();
-};
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_SOCKETIMPL_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SOCKETIMPL_HPP
+#define SFML_SOCKETIMPL_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Network/Socket.hpp>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <unistd.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Helper class implementing all the non-portable
+/// socket stuff; this is the Unix version
+///
+////////////////////////////////////////////////////////////
+class SocketImpl
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ // Types
+ ////////////////////////////////////////////////////////////
+ typedef socklen_t AddrLength;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create an internal sockaddr_in address
+ ///
+ /// \param address Target address
+ /// \param port Target port
+ ///
+ /// \return sockaddr_in ready to be used by socket functions
+ ///
+ ////////////////////////////////////////////////////////////
+ static sockaddr_in createAddress(Uint32 address, unsigned short port);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Return the value of the invalid socket
+ ///
+ /// \return Special value of the invalid socket
+ ///
+ ////////////////////////////////////////////////////////////
+ static SocketHandle invalidSocket();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Close and destroy a socket
+ ///
+ /// \param sock Handle of the socket to close
+ ///
+ ////////////////////////////////////////////////////////////
+ static void close(SocketHandle sock);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Set a socket as blocking or non-blocking
+ ///
+ /// \param sock Handle of the socket
+ /// \param block New blocking state of the socket
+ ///
+ ////////////////////////////////////////////////////////////
+ static void setBlocking(SocketHandle sock, bool block);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the last socket error status
+ ///
+ /// \return Status corresponding to the last socket error
+ ///
+ ////////////////////////////////////////////////////////////
+ static Socket::Status getErrorStatus();
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_SOCKETIMPL_HPP
diff --git a/src/SFML/Network/Win32/SocketImpl.cpp b/src/SFML/Network/Win32/SocketImpl.cpp
index a3c26b7..3fc6bb2 100644
--- a/src/SFML/Network/Win32/SocketImpl.cpp
+++ b/src/SFML/Network/Win32/SocketImpl.cpp
@@ -1,112 +1,112 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Network/Win32/SocketImpl.hpp>
-#include <cstring>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-sockaddr_in SocketImpl::createAddress(Uint32 address, unsigned short port)
-{
- sockaddr_in addr;
- std::memset(addr.sin_zero, 0, sizeof(addr.sin_zero));
- addr.sin_addr.s_addr = htonl(address);
- addr.sin_family = AF_INET;
- addr.sin_port = htons(port);
-
- return addr;
-}
-
-
-////////////////////////////////////////////////////////////
-SocketHandle SocketImpl::invalidSocket()
-{
- return INVALID_SOCKET;
-}
-
-
-////////////////////////////////////////////////////////////
-void SocketImpl::close(SocketHandle sock)
-{
- closesocket(sock);
-}
-
-
-////////////////////////////////////////////////////////////
-void SocketImpl::setBlocking(SocketHandle sock, bool block)
-{
- u_long blocking = block ? 0 : 1;
- ioctlsocket(sock, FIONBIO, &blocking);
-}
-
-
-////////////////////////////////////////////////////////////
-Socket::Status SocketImpl::getErrorStatus()
-{
- switch (WSAGetLastError())
- {
- case WSAEWOULDBLOCK : return Socket::NotReady;
- case WSAEALREADY : return Socket::NotReady;
- case WSAECONNABORTED : return Socket::Disconnected;
- case WSAECONNRESET : return Socket::Disconnected;
- case WSAETIMEDOUT : return Socket::Disconnected;
- case WSAENETRESET : return Socket::Disconnected;
- case WSAENOTCONN : return Socket::Disconnected;
- case WSAEISCONN : return Socket::Done; // when connecting a non-blocking socket
- default : return Socket::Error;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-// Windows needs some initialization and cleanup to get
-// sockets working properly... so let's create a class that will
-// do it automatically
-////////////////////////////////////////////////////////////
-struct SocketInitializer
-{
- SocketInitializer()
- {
- WSADATA init;
- WSAStartup(MAKEWORD(2, 2), &init);
- }
-
- ~SocketInitializer()
- {
- WSACleanup();
- }
-};
-
-SocketInitializer globalInitializer;
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Network/Win32/SocketImpl.hpp>
+#include <cstring>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+sockaddr_in SocketImpl::createAddress(Uint32 address, unsigned short port)
+{
+ sockaddr_in addr;
+ std::memset(&addr, 0, sizeof(addr));
+ addr.sin_addr.s_addr = htonl(address);
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(port);
+
+ return addr;
+}
+
+
+////////////////////////////////////////////////////////////
+SocketHandle SocketImpl::invalidSocket()
+{
+ return INVALID_SOCKET;
+}
+
+
+////////////////////////////////////////////////////////////
+void SocketImpl::close(SocketHandle sock)
+{
+ closesocket(sock);
+}
+
+
+////////////////////////////////////////////////////////////
+void SocketImpl::setBlocking(SocketHandle sock, bool block)
+{
+ u_long blocking = block ? 0 : 1;
+ ioctlsocket(sock, FIONBIO, &blocking);
+}
+
+
+////////////////////////////////////////////////////////////
+Socket::Status SocketImpl::getErrorStatus()
+{
+ switch (WSAGetLastError())
+ {
+ case WSAEWOULDBLOCK: return Socket::NotReady;
+ case WSAEALREADY: return Socket::NotReady;
+ case WSAECONNABORTED: return Socket::Disconnected;
+ case WSAECONNRESET: return Socket::Disconnected;
+ case WSAETIMEDOUT: return Socket::Disconnected;
+ case WSAENETRESET: return Socket::Disconnected;
+ case WSAENOTCONN: return Socket::Disconnected;
+ case WSAEISCONN: return Socket::Done; // when connecting a non-blocking socket
+ default: return Socket::Error;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+// Windows needs some initialization and cleanup to get
+// sockets working properly... so let's create a class that will
+// do it automatically
+////////////////////////////////////////////////////////////
+struct SocketInitializer
+{
+ SocketInitializer()
+ {
+ WSADATA init;
+ WSAStartup(MAKEWORD(2, 2), &init);
+ }
+
+ ~SocketInitializer()
+ {
+ WSACleanup();
+ }
+};
+
+SocketInitializer globalInitializer;
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Network/Win32/SocketImpl.hpp b/src/SFML/Network/Win32/SocketImpl.hpp
index b575869..8178c7c 100644
--- a/src/SFML/Network/Win32/SocketImpl.hpp
+++ b/src/SFML/Network/Win32/SocketImpl.hpp
@@ -1,112 +1,112 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_SOCKETIMPL_HPP
-#define SFML_SOCKETIMPL_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#ifdef _WIN32_WINDOWS
- #undef _WIN32_WINDOWS
-#endif
-#ifdef _WIN32_WINNT
- #undef _WIN32_WINNT
-#endif
-#define _WIN32_WINDOWS 0x0501
-#define _WIN32_WINNT 0x0501
-#include <SFML/Network/Socket.hpp>
-#include <winsock2.h>
-#include <ws2tcpip.h>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief Helper class implementing all the non-portable
-/// socket stuff; this is the Windows version
-///
-////////////////////////////////////////////////////////////
-class SocketImpl
-{
-public :
-
- ////////////////////////////////////////////////////////////
- // Types
- ////////////////////////////////////////////////////////////
- typedef int AddrLength;
-
- ////////////////////////////////////////////////////////////
- /// \brief Create an internal sockaddr_in address
- ///
- /// \param address Target address
- /// \param port Target port
- ///
- /// \return sockaddr_in ready to be used by socket functions
- ///
- ////////////////////////////////////////////////////////////
- static sockaddr_in createAddress(Uint32 address, unsigned short port);
-
- ////////////////////////////////////////////////////////////
- /// \brief Return the value of the invalid socket
- ///
- /// \return Special value of the invalid socket
- ///
- ////////////////////////////////////////////////////////////
- static SocketHandle invalidSocket();
-
- ////////////////////////////////////////////////////////////
- /// \brief Close and destroy a socket
- ///
- /// \param sock Handle of the socket to close
- ///
- ////////////////////////////////////////////////////////////
- static void close(SocketHandle sock);
-
- ////////////////////////////////////////////////////////////
- /// \brief Set a socket as blocking or non-blocking
- ///
- /// \param sock Handle of the socket
- /// \param block New blocking state of the socket
- ///
- ////////////////////////////////////////////////////////////
- static void setBlocking(SocketHandle sock, bool block);
-
- ////////////////////////////////////////////////////////////
- /// Get the last socket error status
- ///
- /// \return Status corresponding to the last socket error
- ///
- ////////////////////////////////////////////////////////////
- static Socket::Status getErrorStatus();
-};
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_SOCKETIMPL_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SOCKETIMPL_HPP
+#define SFML_SOCKETIMPL_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#ifdef _WIN32_WINDOWS
+ #undef _WIN32_WINDOWS
+#endif
+#ifdef _WIN32_WINNT
+ #undef _WIN32_WINNT
+#endif
+#define _WIN32_WINDOWS 0x0501
+#define _WIN32_WINNT 0x0501
+#include <SFML/Network/Socket.hpp>
+#include <winsock2.h>
+#include <ws2tcpip.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Helper class implementing all the non-portable
+/// socket stuff; this is the Windows version
+///
+////////////////////////////////////////////////////////////
+class SocketImpl
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ // Types
+ ////////////////////////////////////////////////////////////
+ typedef int AddrLength;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create an internal sockaddr_in address
+ ///
+ /// \param address Target address
+ /// \param port Target port
+ ///
+ /// \return sockaddr_in ready to be used by socket functions
+ ///
+ ////////////////////////////////////////////////////////////
+ static sockaddr_in createAddress(Uint32 address, unsigned short port);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Return the value of the invalid socket
+ ///
+ /// \return Special value of the invalid socket
+ ///
+ ////////////////////////////////////////////////////////////
+ static SocketHandle invalidSocket();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Close and destroy a socket
+ ///
+ /// \param sock Handle of the socket to close
+ ///
+ ////////////////////////////////////////////////////////////
+ static void close(SocketHandle sock);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Set a socket as blocking or non-blocking
+ ///
+ /// \param sock Handle of the socket
+ /// \param block New blocking state of the socket
+ ///
+ ////////////////////////////////////////////////////////////
+ static void setBlocking(SocketHandle sock, bool block);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the last socket error status
+ ///
+ /// \return Status corresponding to the last socket error
+ ///
+ ////////////////////////////////////////////////////////////
+ static Socket::Status getErrorStatus();
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_SOCKETIMPL_HPP
diff --git a/src/SFML/System/Android/Activity.cpp b/src/SFML/System/Android/Activity.cpp
new file mode 100644
index 0000000..b5ba35d
--- /dev/null
+++ b/src/SFML/System/Android/Activity.cpp
@@ -0,0 +1,69 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Android/Activity.hpp>
+#include <android/log.h>
+
+#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_INFO, "sfml-error", __VA_ARGS__))
+
+LogcatStream::LogcatStream() :
+std::streambuf()
+{
+ // Nothing to do
+}
+
+std::streambuf::int_type LogcatStream::overflow (std::streambuf::int_type c)
+{
+ if (c == "\n"[0])
+ {
+ m_message.push_back(c);
+ LOGE(m_message.c_str());
+ m_message.clear();
+ }
+
+ m_message.push_back(c);
+
+ return traits_type::not_eof(c);
+}
+
+namespace sf
+{
+namespace priv
+{
+ActivityStates* getActivity(ActivityStates* initializedStates, bool reset)
+{
+ static ActivityStates* states = NULL;
+
+ if (!states || reset)
+ states = initializedStates;
+
+ return states;
+}
+}
+}
diff --git a/src/SFML/System/Android/Activity.hpp b/src/SFML/System/Android/Activity.hpp
new file mode 100644
index 0000000..bd6bbc9
--- /dev/null
+++ b/src/SFML/System/Android/Activity.hpp
@@ -0,0 +1,101 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_ACTIVITY_HPP
+#define SFML_ACTIVITY_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/Event.hpp>
+#include <SFML/Window/EglContext.hpp>
+#include <SFML/System/Mutex.hpp>
+#include <android/native_activity.h>
+#include <android/configuration.h>
+#include <EGL/egl.h>
+#include <vector>
+#include <map>
+#include <string>
+#include <fstream>
+
+class SFML_SYSTEM_API LogcatStream : public std::streambuf
+{
+public:
+ LogcatStream();
+
+ std::streambuf::int_type overflow (std::streambuf::int_type c);
+
+private:
+ std::string m_message;
+};
+
+namespace sf
+{
+namespace priv
+{
+struct ActivityStates
+{
+ ANativeActivity* activity;
+ ANativeWindow* window;
+
+ ALooper* looper;
+ AInputQueue* inputQueue;
+ AConfiguration* config;
+
+ EGLDisplay display;
+ EglContext* context;
+
+ void* savedState;
+ size_t savedStateSize;
+
+ Mutex mutex;
+
+ void (*forwardEvent)(const Event& event);
+ int (*processEvent)(int fd, int events, void* data);
+
+ std::map<int, Vector2i> touchEvents;
+ Vector2i mousePosition;
+ bool isButtonPressed[Mouse::ButtonCount];
+
+ bool mainOver;
+
+ Vector2i screenSize;
+
+ bool initialized;
+ bool terminated;
+
+ bool fullscreen;
+
+ bool updated;
+
+ LogcatStream logcat;
+};
+
+SFML_SYSTEM_API ActivityStates* getActivity(ActivityStates* initializedStates=NULL, bool reset=false);
+
+} // namespace priv
+} // namespace sf
+
+
+#endif // SFML_ACTIVITY_HPP
diff --git a/src/SFML/System/Android/ResourceStream.cpp b/src/SFML/System/Android/ResourceStream.cpp
new file mode 100644
index 0000000..abfa29e
--- /dev/null
+++ b/src/SFML/System/Android/ResourceStream.cpp
@@ -0,0 +1,85 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Android/ResourceStream.hpp>
+#include <SFML/System/Android/Activity.hpp>
+#include <SFML/System/Lock.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+
+////////////////////////////////////////////////////////////
+ResourceStream::ResourceStream(const std::string& filename) :
+m_file (NULL)
+{
+ ActivityStates* states = getActivity(NULL);
+ Lock(states->mutex);
+ m_file = AAssetManager_open(states->activity->assetManager, filename.c_str(), AASSET_MODE_UNKNOWN);
+}
+
+
+////////////////////////////////////////////////////////////
+ResourceStream::~ResourceStream()
+{
+ AAsset_close(m_file);
+}
+
+
+////////////////////////////////////////////////////////////
+Int64 ResourceStream::read(void *data, Int64 size)
+{
+ return AAsset_read(m_file, data, size);
+}
+
+
+////////////////////////////////////////////////////////////
+Int64 ResourceStream::seek(Int64 position)
+{
+ AAsset_seek(m_file, position, SEEK_SET);
+}
+
+
+////////////////////////////////////////////////////////////
+Int64 ResourceStream::tell()
+{
+ return getSize() - AAsset_getRemainingLength(m_file);
+}
+
+
+////////////////////////////////////////////////////////////
+Int64 ResourceStream::getSize()
+{
+ return AAsset_getLength(m_file);
+}
+
+
+} // namespace priv
+} // namespace sf
diff --git a/src/SFML/System/Android/ResourceStream.hpp b/src/SFML/System/Android/ResourceStream.hpp
new file mode 100644
index 0000000..8f5829b
--- /dev/null
+++ b/src/SFML/System/Android/ResourceStream.hpp
@@ -0,0 +1,113 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_RESOURCESTREAM_HPP
+#define SFML_RESOURCESTREAM_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Export.hpp>
+#include <SFML/System/InputStream.hpp>
+#include <android/asset_manager.h>
+#include <string>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Read from Android asset files
+///
+////////////////////////////////////////////////////////////
+class SFML_SYSTEM_API ResourceStream : public InputStream
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ /// \param filename Filename of the asset
+ ///
+ ////////////////////////////////////////////////////////////
+ ResourceStream(const std::string& filename);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~ResourceStream();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Read data from the asset
+ ///
+ /// \param data Buffer where the asset data is copied
+ /// \param size Number of bytes read
+ ///
+ /// \return The number of bytes actually read, or -1 on error
+ ///
+ ////////////////////////////////////////////////////////////
+ Int64 read(void *data, Int64 size);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the current reading position in the asset file
+ ///
+ /// \param position The position to seek to, from the beginning
+ ///
+ /// \return The position actually sought to, or -1 on error
+ ///
+ ////////////////////////////////////////////////////////////
+ Int64 seek(Int64 position);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current reading position in the asset file
+ ///
+ /// \return The current position, or -1 on error.
+ ///
+ ////////////////////////////////////////////////////////////
+ Int64 tell();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Return the size of the asset file
+ ///
+ /// \return The total number of bytes available in the asset, or -1 on error
+ ///
+ ////////////////////////////////////////////////////////////
+ Int64 getSize();
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ AAsset* m_file; ///< The asset file to read
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_RESOURCESTREAM_HPP
diff --git a/src/SFML/System/CMakeLists.txt b/src/SFML/System/CMakeLists.txt
index 5ef9139..74c95de 100644
--- a/src/SFML/System/CMakeLists.txt
+++ b/src/SFML/System/CMakeLists.txt
@@ -1,83 +1,99 @@
-
-set(INCROOT ${PROJECT_SOURCE_DIR}/include/SFML/System)
-set(SRCROOT ${PROJECT_SOURCE_DIR}/src/SFML/System)
-
-# all source files
-set(SRC
- ${SRCROOT}/Clock.cpp
- ${INCROOT}/Clock.hpp
- ${SRCROOT}/Err.cpp
- ${INCROOT}/Err.hpp
- ${INCROOT}/Export.hpp
- ${INCROOT}/InputStream.hpp
- ${SRCROOT}/Lock.cpp
- ${INCROOT}/Lock.hpp
- ${SRCROOT}/Mutex.cpp
- ${INCROOT}/Mutex.hpp
- ${INCROOT}/NonCopyable.hpp
- ${SRCROOT}/Sleep.cpp
- ${INCROOT}/Sleep.hpp
- ${SRCROOT}/String.cpp
- ${INCROOT}/String.hpp
- ${SRCROOT}/Thread.cpp
- ${INCROOT}/Thread.hpp
- ${INCROOT}/Thread.inl
- ${SRCROOT}/ThreadLocal.cpp
- ${INCROOT}/ThreadLocal.hpp
- ${INCROOT}/ThreadLocalPtr.hpp
- ${INCROOT}/ThreadLocalPtr.inl
- ${SRCROOT}/Time.cpp
- ${INCROOT}/Time.hpp
- ${INCROOT}/Utf.hpp
- ${INCROOT}/Utf.inl
- ${INCROOT}/Vector2.hpp
- ${INCROOT}/Vector2.inl
- ${INCROOT}/Vector3.hpp
- ${INCROOT}/Vector3.inl
-)
-source_group("" FILES ${SRC})
-
-# add platform specific sources
-if(WINDOWS)
- set(PLATFORM_SRC
- ${SRCROOT}/Win32/ClockImpl.cpp
- ${SRCROOT}/Win32/ClockImpl.hpp
- ${SRCROOT}/Win32/MutexImpl.cpp
- ${SRCROOT}/Win32/MutexImpl.hpp
- ${SRCROOT}/Win32/SleepImpl.cpp
- ${SRCROOT}/Win32/SleepImpl.hpp
- ${SRCROOT}/Win32/ThreadImpl.cpp
- ${SRCROOT}/Win32/ThreadImpl.hpp
- ${SRCROOT}/Win32/ThreadLocalImpl.cpp
- ${SRCROOT}/Win32/ThreadLocalImpl.hpp
- )
- source_group("windows" FILES ${PLATFORM_SRC})
-else()
- set(PLATFORM_SRC
- ${SRCROOT}/Unix/ClockImpl.cpp
- ${SRCROOT}/Unix/ClockImpl.hpp
- ${SRCROOT}/Unix/MutexImpl.cpp
- ${SRCROOT}/Unix/MutexImpl.hpp
- ${SRCROOT}/Unix/SleepImpl.cpp
- ${SRCROOT}/Unix/SleepImpl.hpp
- ${SRCROOT}/Unix/ThreadImpl.cpp
- ${SRCROOT}/Unix/ThreadImpl.hpp
- ${SRCROOT}/Unix/ThreadLocalImpl.cpp
- ${SRCROOT}/Unix/ThreadLocalImpl.hpp
- )
- source_group("unix" FILES ${PLATFORM_SRC})
-endif()
-
-# build the list of external libraries to link
-set(SYSTEM_EXT_LIBS)
-if(UNIX)
- set(SYSTEM_EXT_LIBS ${SYSTEM_EXT_LIBS} pthread)
-endif()
-if(LINUX)
- set(SYSTEM_EXT_LIBS ${SYSTEM_EXT_LIBS} rt)
-endif()
-
-# define the sfml-system target
-sfml_add_library(sfml-system
- SOURCES ${SRC} ${PLATFORM_SRC}
- EXTERNAL_LIBS ${SYSTEM_EXT_LIBS})
+
+set(INCROOT ${PROJECT_SOURCE_DIR}/include/SFML/System)
+set(SRCROOT ${PROJECT_SOURCE_DIR}/src/SFML/System)
+
+# all source files
+set(SRC
+ ${SRCROOT}/Clock.cpp
+ ${INCROOT}/Clock.hpp
+ ${SRCROOT}/Err.cpp
+ ${INCROOT}/Err.hpp
+ ${INCROOT}/Export.hpp
+ ${INCROOT}/InputStream.hpp
+ ${SRCROOT}/Lock.cpp
+ ${INCROOT}/Lock.hpp
+ ${SRCROOT}/Mutex.cpp
+ ${INCROOT}/Mutex.hpp
+ ${INCROOT}/NonCopyable.hpp
+ ${SRCROOT}/Sleep.cpp
+ ${INCROOT}/Sleep.hpp
+ ${SRCROOT}/String.cpp
+ ${INCROOT}/String.hpp
+ ${INCROOT}/String.inl
+ ${SRCROOT}/Thread.cpp
+ ${INCROOT}/Thread.hpp
+ ${INCROOT}/Thread.inl
+ ${SRCROOT}/ThreadLocal.cpp
+ ${INCROOT}/ThreadLocal.hpp
+ ${INCROOT}/ThreadLocalPtr.hpp
+ ${INCROOT}/ThreadLocalPtr.inl
+ ${SRCROOT}/Time.cpp
+ ${INCROOT}/Time.hpp
+ ${INCROOT}/Utf.hpp
+ ${INCROOT}/Utf.inl
+ ${INCROOT}/Vector2.hpp
+ ${INCROOT}/Vector2.inl
+ ${INCROOT}/Vector3.hpp
+ ${INCROOT}/Vector3.inl
+)
+source_group("" FILES ${SRC})
+
+# add platform specific sources
+if(SFML_OS_WINDOWS)
+ set(PLATFORM_SRC
+ ${SRCROOT}/Win32/ClockImpl.cpp
+ ${SRCROOT}/Win32/ClockImpl.hpp
+ ${SRCROOT}/Win32/MutexImpl.cpp
+ ${SRCROOT}/Win32/MutexImpl.hpp
+ ${SRCROOT}/Win32/SleepImpl.cpp
+ ${SRCROOT}/Win32/SleepImpl.hpp
+ ${SRCROOT}/Win32/ThreadImpl.cpp
+ ${SRCROOT}/Win32/ThreadImpl.hpp
+ ${SRCROOT}/Win32/ThreadLocalImpl.cpp
+ ${SRCROOT}/Win32/ThreadLocalImpl.hpp
+ )
+ source_group("windows" FILES ${PLATFORM_SRC})
+else()
+ set(PLATFORM_SRC
+ ${SRCROOT}/Unix/ClockImpl.cpp
+ ${SRCROOT}/Unix/ClockImpl.hpp
+ ${SRCROOT}/Unix/MutexImpl.cpp
+ ${SRCROOT}/Unix/MutexImpl.hpp
+ ${SRCROOT}/Unix/SleepImpl.cpp
+ ${SRCROOT}/Unix/SleepImpl.hpp
+ ${SRCROOT}/Unix/ThreadImpl.cpp
+ ${SRCROOT}/Unix/ThreadImpl.hpp
+ ${SRCROOT}/Unix/ThreadLocalImpl.cpp
+ ${SRCROOT}/Unix/ThreadLocalImpl.hpp
+ )
+
+ if(SFML_OS_ANDROID)
+ set(PLATFORM_SRC ${PLATFORM_SRC}
+ ${SRCROOT}/Android/Activity.hpp
+ ${SRCROOT}/Android/Activity.cpp
+ ${SRCROOT}/Android/ResourceStream.cpp
+ ${SRCROOT}/Android/ResourceStream.cpp
+ )
+ endif()
+
+ source_group("unix" FILES ${PLATFORM_SRC})
+endif()
+
+# build the list of external libraries to link
+if(SFML_OS_LINUX OR SFML_OS_FREEBSD OR SFML_OS_MACOSX)
+ list(APPEND SYSTEM_EXT_LIBS pthread)
+endif()
+if(SFML_OS_LINUX)
+ list(APPEND SYSTEM_EXT_LIBS rt)
+endif()
+if(SFML_OS_WINDOWS)
+ list(APPEND SYSTEM_EXT_LIBS winmm)
+endif()
+if(SFML_OS_ANDROID)
+ list(APPEND SYSTEM_EXT_LIBS android log)
+endif()
+
+# define the sfml-system target
+sfml_add_library(sfml-system
+ SOURCES ${SRC} ${PLATFORM_SRC}
+ EXTERNAL_LIBS ${SYSTEM_EXT_LIBS})
diff --git a/src/SFML/System/Clock.cpp b/src/SFML/System/Clock.cpp
index de3c642..d6ccf24 100644
--- a/src/SFML/System/Clock.cpp
+++ b/src/SFML/System/Clock.cpp
@@ -1,63 +1,63 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/Clock.hpp>
-
-#if defined(SFML_SYSTEM_WINDOWS)
- #include <SFML/System/Win32/ClockImpl.hpp>
-#else
- #include <SFML/System/Unix/ClockImpl.hpp>
-#endif
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-Clock::Clock() :
-m_startTime(priv::ClockImpl::getCurrentTime())
-{
-}
-
-
-////////////////////////////////////////////////////////////
-Time Clock::getElapsedTime() const
-{
- return priv::ClockImpl::getCurrentTime() - m_startTime;
-}
-
-
-////////////////////////////////////////////////////////////
-Time Clock::restart()
-{
- Time now = priv::ClockImpl::getCurrentTime();
- Time elapsed = now - m_startTime;
- m_startTime = now;
-
- return elapsed;
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Clock.hpp>
+
+#if defined(SFML_SYSTEM_WINDOWS)
+ #include <SFML/System/Win32/ClockImpl.hpp>
+#else
+ #include <SFML/System/Unix/ClockImpl.hpp>
+#endif
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Clock::Clock() :
+m_startTime(priv::ClockImpl::getCurrentTime())
+{
+}
+
+
+////////////////////////////////////////////////////////////
+Time Clock::getElapsedTime() const
+{
+ return priv::ClockImpl::getCurrentTime() - m_startTime;
+}
+
+
+////////////////////////////////////////////////////////////
+Time Clock::restart()
+{
+ Time now = priv::ClockImpl::getCurrentTime();
+ Time elapsed = now - m_startTime;
+ m_startTime = now;
+
+ return elapsed;
+}
+
+} // namespace sf
diff --git a/src/SFML/System/Err.cpp b/src/SFML/System/Err.cpp
index a1224dd..1a38986 100644
--- a/src/SFML/System/Err.cpp
+++ b/src/SFML/System/Err.cpp
@@ -1,110 +1,110 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/Err.hpp>
-#include <streambuf>
-#include <cstdio>
-
-
-namespace
-{
-// This class will be used as the default streambuf of sf::Err,
-// it outputs to stderr by default (to keep the default behaviour)
-class DefaultErrStreamBuf : public std::streambuf
-{
-public :
-
- DefaultErrStreamBuf()
- {
- // Allocate the write buffer
- static const int size = 64;
- char* buffer = new char[size];
- setp(buffer, buffer + size);
- }
-
- ~DefaultErrStreamBuf()
- {
- // Synchronize
- sync();
-
- // Delete the write buffer
- delete[] pbase();
- }
-
-private :
-
- virtual int overflow(int character)
- {
- if ((character != EOF) && (pptr() != epptr()))
- {
- // Valid character
- return sputc(static_cast<char>(character));
- }
- else if (character != EOF)
- {
- // Not enough space in the buffer: synchronize output and try again
- sync();
- return overflow(character);
- }
- else
- {
- // Invalid character: synchronize output
- return sync();
- }
- }
-
- virtual int sync()
- {
- // Check if there is something into the write buffer
- if (pbase() != pptr())
- {
- // Print the contents of the write buffer into the standard error output
- std::size_t size = static_cast<int>(pptr() - pbase());
- fwrite(pbase(), 1, size, stderr);
-
- // Reset the pointer position to the beginning of the write buffer
- setp(pbase(), epptr());
- }
-
- return 0;
- }
-};
-}
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-std::ostream& err()
-{
- static DefaultErrStreamBuf buffer;
- static std::ostream stream(&buffer);
-
- return stream;
-}
-
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Err.hpp>
+#include <streambuf>
+#include <cstdio>
+
+
+namespace
+{
+// This class will be used as the default streambuf of sf::Err,
+// it outputs to stderr by default (to keep the default behavior)
+class DefaultErrStreamBuf : public std::streambuf
+{
+public:
+
+ DefaultErrStreamBuf()
+ {
+ // Allocate the write buffer
+ static const int size = 64;
+ char* buffer = new char[size];
+ setp(buffer, buffer + size);
+ }
+
+ ~DefaultErrStreamBuf()
+ {
+ // Synchronize
+ sync();
+
+ // Delete the write buffer
+ delete[] pbase();
+ }
+
+private:
+
+ virtual int overflow(int character)
+ {
+ if ((character != EOF) && (pptr() != epptr()))
+ {
+ // Valid character
+ return sputc(static_cast<char>(character));
+ }
+ else if (character != EOF)
+ {
+ // Not enough space in the buffer: synchronize output and try again
+ sync();
+ return overflow(character);
+ }
+ else
+ {
+ // Invalid character: synchronize output
+ return sync();
+ }
+ }
+
+ virtual int sync()
+ {
+ // Check if there is something into the write buffer
+ if (pbase() != pptr())
+ {
+ // Print the contents of the write buffer into the standard error output
+ std::size_t size = static_cast<int>(pptr() - pbase());
+ fwrite(pbase(), 1, size, stderr);
+
+ // Reset the pointer position to the beginning of the write buffer
+ setp(pbase(), epptr());
+ }
+
+ return 0;
+ }
+};
+}
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+std::ostream& err()
+{
+ static DefaultErrStreamBuf buffer;
+ static std::ostream stream(&buffer);
+
+ return stream;
+}
+
+
+} // namespace sf
diff --git a/src/SFML/System/Lock.cpp b/src/SFML/System/Lock.cpp
index 17b1aa2..68a85de 100644
--- a/src/SFML/System/Lock.cpp
+++ b/src/SFML/System/Lock.cpp
@@ -1,48 +1,48 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/Lock.hpp>
-#include <SFML/System/Mutex.hpp>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-Lock::Lock(Mutex& mutex) :
-m_mutex(mutex)
-{
- m_mutex.lock();
-}
-
-
-////////////////////////////////////////////////////////////
-Lock::~Lock()
-{
- m_mutex.unlock();
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Lock.hpp>
+#include <SFML/System/Mutex.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Lock::Lock(Mutex& mutex) :
+m_mutex(mutex)
+{
+ m_mutex.lock();
+}
+
+
+////////////////////////////////////////////////////////////
+Lock::~Lock()
+{
+ m_mutex.unlock();
+}
+
+} // namespace sf
diff --git a/src/SFML/System/Mutex.cpp b/src/SFML/System/Mutex.cpp
index e08e25b..c339004 100644
--- a/src/SFML/System/Mutex.cpp
+++ b/src/SFML/System/Mutex.cpp
@@ -1,66 +1,66 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/Mutex.hpp>
-
-#if defined(SFML_SYSTEM_WINDOWS)
- #include <SFML/System/Win32/MutexImpl.hpp>
-#else
- #include <SFML/System/Unix/MutexImpl.hpp>
-#endif
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-Mutex::Mutex()
-{
- m_mutexImpl = new priv::MutexImpl;
-}
-
-
-////////////////////////////////////////////////////////////
-Mutex::~Mutex()
-{
- delete m_mutexImpl;
-}
-
-
-////////////////////////////////////////////////////////////
-void Mutex::lock()
-{
- m_mutexImpl->lock();
-}
-
-
-////////////////////////////////////////////////////////////
-void Mutex::unlock()
-{
- m_mutexImpl->unlock();
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Mutex.hpp>
+
+#if defined(SFML_SYSTEM_WINDOWS)
+ #include <SFML/System/Win32/MutexImpl.hpp>
+#else
+ #include <SFML/System/Unix/MutexImpl.hpp>
+#endif
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Mutex::Mutex()
+{
+ m_mutexImpl = new priv::MutexImpl;
+}
+
+
+////////////////////////////////////////////////////////////
+Mutex::~Mutex()
+{
+ delete m_mutexImpl;
+}
+
+
+////////////////////////////////////////////////////////////
+void Mutex::lock()
+{
+ m_mutexImpl->lock();
+}
+
+
+////////////////////////////////////////////////////////////
+void Mutex::unlock()
+{
+ m_mutexImpl->unlock();
+}
+
+} // namespace sf
diff --git a/src/SFML/System/Sleep.cpp b/src/SFML/System/Sleep.cpp
index 9415ade..0bd375f 100644
--- a/src/SFML/System/Sleep.cpp
+++ b/src/SFML/System/Sleep.cpp
@@ -1,46 +1,46 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/Sleep.hpp>
-
-#if defined(SFML_SYSTEM_WINDOWS)
- #include <SFML/System/Win32/SleepImpl.hpp>
-#else
- #include <SFML/System/Unix/SleepImpl.hpp>
-#endif
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-void sleep(Time duration)
-{
- if (duration >= Time::Zero)
- priv::sleepImpl(duration);
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Sleep.hpp>
+
+#if defined(SFML_SYSTEM_WINDOWS)
+ #include <SFML/System/Win32/SleepImpl.hpp>
+#else
+ #include <SFML/System/Unix/SleepImpl.hpp>
+#endif
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+void sleep(Time duration)
+{
+ if (duration >= Time::Zero)
+ priv::sleepImpl(duration);
+}
+
+} // namespace sf
diff --git a/src/SFML/System/String.cpp b/src/SFML/System/String.cpp
index b4ee135..f0753dc 100644
--- a/src/SFML/System/String.cpp
+++ b/src/SFML/System/String.cpp
@@ -1,335 +1,400 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/String.hpp>
-#include <SFML/System/Utf.hpp>
-#include <iterator>
-#include <cstring>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-const std::size_t String::InvalidPos = std::basic_string<Uint32>::npos;
-
-
-////////////////////////////////////////////////////////////
-String::String()
-{
-}
-
-
-////////////////////////////////////////////////////////////
-String::String(char ansiChar, const std::locale& locale)
-{
- m_string += Utf32::decodeAnsi(ansiChar, locale);
-}
-
-
-////////////////////////////////////////////////////////////
-String::String(wchar_t wideChar)
-{
- m_string += Utf32::decodeWide(wideChar);
-}
-
-
-////////////////////////////////////////////////////////////
-String::String(Uint32 utf32Char)
-{
- m_string += utf32Char;
-}
-
-
-////////////////////////////////////////////////////////////
-String::String(const char* ansiString, const std::locale& locale)
-{
- if (ansiString)
- {
- std::size_t length = strlen(ansiString);
- if (length > 0)
- {
- m_string.reserve(length + 1);
- Utf32::fromAnsi(ansiString, ansiString + length, std::back_inserter(m_string), locale);
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////
-String::String(const std::string& ansiString, const std::locale& locale)
-{
- m_string.reserve(ansiString.length() + 1);
- Utf32::fromAnsi(ansiString.begin(), ansiString.end(), std::back_inserter(m_string), locale);
-}
-
-
-////////////////////////////////////////////////////////////
-String::String(const wchar_t* wideString)
-{
- if (wideString)
- {
- std::size_t length = std::wcslen(wideString);
- if (length > 0)
- {
- m_string.reserve(length + 1);
- Utf32::fromWide(wideString, wideString + length, std::back_inserter(m_string));
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////
-String::String(const std::wstring& wideString)
-{
- m_string.reserve(wideString.length() + 1);
- Utf32::fromWide(wideString.begin(), wideString.end(), std::back_inserter(m_string));
-}
-
-
-////////////////////////////////////////////////////////////
-String::String(const Uint32* utf32String)
-{
- if (utf32String)
- m_string = utf32String;
-}
-
-
-////////////////////////////////////////////////////////////
-String::String(const std::basic_string<Uint32>& utf32String) :
-m_string(utf32String)
-{
-}
-
-
-////////////////////////////////////////////////////////////
-String::String(const String& copy) :
-m_string(copy.m_string)
-{
-}
-
-
-////////////////////////////////////////////////////////////
-String::operator std::string() const
-{
- return toAnsiString();
-}
-
-
-////////////////////////////////////////////////////////////
-String::operator std::wstring() const
-{
- return toWideString();
-}
-
-
-////////////////////////////////////////////////////////////
-std::string String::toAnsiString(const std::locale& locale) const
-{
- // Prepare the output string
- std::string output;
- output.reserve(m_string.length() + 1);
-
- // Convert
- Utf32::toAnsi(m_string.begin(), m_string.end(), std::back_inserter(output), 0, locale);
-
- return output;
-}
-
-
-////////////////////////////////////////////////////////////
-std::wstring String::toWideString() const
-{
- // Prepare the output string
- std::wstring output;
- output.reserve(m_string.length() + 1);
-
- // Convert
- Utf32::toWide(m_string.begin(), m_string.end(), std::back_inserter(output), 0);
-
- return output;
-}
-
-
-////////////////////////////////////////////////////////////
-String& String::operator =(const String& right)
-{
- m_string = right.m_string;
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-String& String::operator +=(const String& right)
-{
- m_string += right.m_string;
- return *this;
-}
-
-
-////////////////////////////////////////////////////////////
-Uint32 String::operator [](std::size_t index) const
-{
- return m_string[index];
-}
-
-
-////////////////////////////////////////////////////////////
-Uint32& String::operator [](std::size_t index)
-{
- return m_string[index];
-}
-
-
-////////////////////////////////////////////////////////////
-void String::clear()
-{
- m_string.clear();
-}
-
-
-////////////////////////////////////////////////////////////
-std::size_t String::getSize() const
-{
- return m_string.size();
-}
-
-
-////////////////////////////////////////////////////////////
-bool String::isEmpty() const
-{
- return m_string.empty();
-}
-
-
-////////////////////////////////////////////////////////////
-void String::erase(std::size_t position, std::size_t count)
-{
- m_string.erase(position, count);
-}
-
-
-////////////////////////////////////////////////////////////
-void String::insert(std::size_t position, const String& str)
-{
- m_string.insert(position, str.m_string);
-}
-
-
-////////////////////////////////////////////////////////////
-std::size_t String::find(const String& str, std::size_t start) const
-{
- return m_string.find(str.m_string, start);
-}
-
-
-////////////////////////////////////////////////////////////
-const Uint32* String::getData() const
-{
- return m_string.c_str();
-}
-
-
-////////////////////////////////////////////////////////////
-String::Iterator String::begin()
-{
- return m_string.begin();
-}
-
-
-////////////////////////////////////////////////////////////
-String::ConstIterator String::begin() const
-{
- return m_string.begin();
-}
-
-
-////////////////////////////////////////////////////////////
-String::Iterator String::end()
-{
- return m_string.end();
-}
-
-
-////////////////////////////////////////////////////////////
-String::ConstIterator String::end() const
-{
- return m_string.end();
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator ==(const String& left, const String& right)
-{
- return left.m_string == right.m_string;
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator !=(const String& left, const String& right)
-{
- return !(left == right);
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator <(const String& left, const String& right)
-{
- return left.m_string < right.m_string;
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator >(const String& left, const String& right)
-{
- return right < left;
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator <=(const String& left, const String& right)
-{
- return !(right < left);
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator >=(const String& left, const String& right)
-{
- return !(left < right);
-}
-
-
-////////////////////////////////////////////////////////////
-String operator +(const String& left, const String& right)
-{
- String string = left;
- string += right;
-
- return string;
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/String.hpp>
+#include <SFML/System/Utf.hpp>
+#include <iterator>
+#include <cstring>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+const std::size_t String::InvalidPos = std::basic_string<Uint32>::npos;
+
+
+////////////////////////////////////////////////////////////
+String::String()
+{
+}
+
+
+////////////////////////////////////////////////////////////
+String::String(char ansiChar, const std::locale& locale)
+{
+ m_string += Utf32::decodeAnsi(ansiChar, locale);
+}
+
+
+////////////////////////////////////////////////////////////
+String::String(wchar_t wideChar)
+{
+ m_string += Utf32::decodeWide(wideChar);
+}
+
+
+////////////////////////////////////////////////////////////
+String::String(Uint32 utf32Char)
+{
+ m_string += utf32Char;
+}
+
+
+////////////////////////////////////////////////////////////
+String::String(const char* ansiString, const std::locale& locale)
+{
+ if (ansiString)
+ {
+ std::size_t length = strlen(ansiString);
+ if (length > 0)
+ {
+ m_string.reserve(length + 1);
+ Utf32::fromAnsi(ansiString, ansiString + length, std::back_inserter(m_string), locale);
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+String::String(const std::string& ansiString, const std::locale& locale)
+{
+ m_string.reserve(ansiString.length() + 1);
+ Utf32::fromAnsi(ansiString.begin(), ansiString.end(), std::back_inserter(m_string), locale);
+}
+
+
+////////////////////////////////////////////////////////////
+String::String(const wchar_t* wideString)
+{
+ if (wideString)
+ {
+ std::size_t length = std::wcslen(wideString);
+ if (length > 0)
+ {
+ m_string.reserve(length + 1);
+ Utf32::fromWide(wideString, wideString + length, std::back_inserter(m_string));
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+String::String(const std::wstring& wideString)
+{
+ m_string.reserve(wideString.length() + 1);
+ Utf32::fromWide(wideString.begin(), wideString.end(), std::back_inserter(m_string));
+}
+
+
+////////////////////////////////////////////////////////////
+String::String(const Uint32* utf32String)
+{
+ if (utf32String)
+ m_string = utf32String;
+}
+
+
+////////////////////////////////////////////////////////////
+String::String(const std::basic_string<Uint32>& utf32String) :
+m_string(utf32String)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+String::String(const String& copy) :
+m_string(copy.m_string)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+String::operator std::string() const
+{
+ return toAnsiString();
+}
+
+
+////////////////////////////////////////////////////////////
+String::operator std::wstring() const
+{
+ return toWideString();
+}
+
+
+////////////////////////////////////////////////////////////
+std::string String::toAnsiString(const std::locale& locale) const
+{
+ // Prepare the output string
+ std::string output;
+ output.reserve(m_string.length() + 1);
+
+ // Convert
+ Utf32::toAnsi(m_string.begin(), m_string.end(), std::back_inserter(output), 0, locale);
+
+ return output;
+}
+
+
+////////////////////////////////////////////////////////////
+std::wstring String::toWideString() const
+{
+ // Prepare the output string
+ std::wstring output;
+ output.reserve(m_string.length() + 1);
+
+ // Convert
+ Utf32::toWide(m_string.begin(), m_string.end(), std::back_inserter(output), 0);
+
+ return output;
+}
+
+
+////////////////////////////////////////////////////////////
+std::basic_string<Uint8> String::toUtf8() const
+{
+ // Prepare the output string
+ std::basic_string<Uint8> output;
+ output.reserve(m_string.length());
+
+ // Convert
+ Utf32::toUtf8(m_string.begin(), m_string.end(), std::back_inserter(output));
+
+ return output;
+}
+
+
+////////////////////////////////////////////////////////////
+std::basic_string<Uint16> String::toUtf16() const
+{
+ // Prepare the output string
+ std::basic_string<Uint16> output;
+ output.reserve(m_string.length());
+
+ // Convert
+ Utf32::toUtf16(m_string.begin(), m_string.end(), std::back_inserter(output));
+
+ return output;
+}
+
+
+////////////////////////////////////////////////////////////
+std::basic_string<Uint32> String::toUtf32() const
+{
+ return m_string;
+}
+
+
+////////////////////////////////////////////////////////////
+String& String::operator =(const String& right)
+{
+ m_string = right.m_string;
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+String& String::operator +=(const String& right)
+{
+ m_string += right.m_string;
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+Uint32 String::operator [](std::size_t index) const
+{
+ return m_string[index];
+}
+
+
+////////////////////////////////////////////////////////////
+Uint32& String::operator [](std::size_t index)
+{
+ return m_string[index];
+}
+
+
+////////////////////////////////////////////////////////////
+void String::clear()
+{
+ m_string.clear();
+}
+
+
+////////////////////////////////////////////////////////////
+std::size_t String::getSize() const
+{
+ return m_string.size();
+}
+
+
+////////////////////////////////////////////////////////////
+bool String::isEmpty() const
+{
+ return m_string.empty();
+}
+
+
+////////////////////////////////////////////////////////////
+void String::erase(std::size_t position, std::size_t count)
+{
+ m_string.erase(position, count);
+}
+
+
+////////////////////////////////////////////////////////////
+void String::insert(std::size_t position, const String& str)
+{
+ m_string.insert(position, str.m_string);
+}
+
+
+////////////////////////////////////////////////////////////
+std::size_t String::find(const String& str, std::size_t start) const
+{
+ return m_string.find(str.m_string, start);
+}
+
+
+////////////////////////////////////////////////////////////
+void String::replace(std::size_t position, std::size_t length, const String& replaceWith)
+{
+ m_string.replace(position, length, replaceWith.m_string);
+}
+
+
+////////////////////////////////////////////////////////////
+void String::replace(const String& searchFor, const String& replaceWith)
+{
+ std::size_t step = replaceWith.getSize();
+ std::size_t len = searchFor.getSize();
+ std::size_t pos = find(searchFor);
+
+ // Replace each occurrence of search
+ while (pos != InvalidPos)
+ {
+ replace(pos, len, replaceWith);
+ pos = find(searchFor, pos + step);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+String String::substring(std::size_t position, std::size_t length) const
+{
+ return m_string.substr(position, length);
+}
+
+
+////////////////////////////////////////////////////////////
+const Uint32* String::getData() const
+{
+ return m_string.c_str();
+}
+
+
+////////////////////////////////////////////////////////////
+String::Iterator String::begin()
+{
+ return m_string.begin();
+}
+
+
+////////////////////////////////////////////////////////////
+String::ConstIterator String::begin() const
+{
+ return m_string.begin();
+}
+
+
+////////////////////////////////////////////////////////////
+String::Iterator String::end()
+{
+ return m_string.end();
+}
+
+
+////////////////////////////////////////////////////////////
+String::ConstIterator String::end() const
+{
+ return m_string.end();
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator ==(const String& left, const String& right)
+{
+ return left.m_string == right.m_string;
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator !=(const String& left, const String& right)
+{
+ return !(left == right);
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator <(const String& left, const String& right)
+{
+ return left.m_string < right.m_string;
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator >(const String& left, const String& right)
+{
+ return right < left;
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator <=(const String& left, const String& right)
+{
+ return !(right < left);
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator >=(const String& left, const String& right)
+{
+ return !(left < right);
+}
+
+
+////////////////////////////////////////////////////////////
+String operator +(const String& left, const String& right)
+{
+ String string = left;
+ string += right;
+
+ return string;
+}
+
+} // namespace sf
diff --git a/src/SFML/System/Thread.cpp b/src/SFML/System/Thread.cpp
index 69bf077..4345802 100644
--- a/src/SFML/System/Thread.cpp
+++ b/src/SFML/System/Thread.cpp
@@ -1,86 +1,86 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/Thread.hpp>
-
-
-#if defined(SFML_SYSTEM_WINDOWS)
- #include <SFML/System/Win32/ThreadImpl.hpp>
-#else
- #include <SFML/System/Unix/ThreadImpl.hpp>
-#endif
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-Thread::~Thread()
-{
- wait();
- delete m_entryPoint;
-}
-
-
-////////////////////////////////////////////////////////////
-void Thread::launch()
-{
- wait();
- m_impl = new priv::ThreadImpl(this);
-}
-
-
-////////////////////////////////////////////////////////////
-void Thread::wait()
-{
- if (m_impl)
- {
- m_impl->wait();
- delete m_impl;
- m_impl = NULL;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Thread::terminate()
-{
- if (m_impl)
- {
- m_impl->terminate();
- delete m_impl;
- m_impl = NULL;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Thread::run()
-{
- m_entryPoint->run();
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Thread.hpp>
+
+
+#if defined(SFML_SYSTEM_WINDOWS)
+ #include <SFML/System/Win32/ThreadImpl.hpp>
+#else
+ #include <SFML/System/Unix/ThreadImpl.hpp>
+#endif
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Thread::~Thread()
+{
+ wait();
+ delete m_entryPoint;
+}
+
+
+////////////////////////////////////////////////////////////
+void Thread::launch()
+{
+ wait();
+ m_impl = new priv::ThreadImpl(this);
+}
+
+
+////////////////////////////////////////////////////////////
+void Thread::wait()
+{
+ if (m_impl)
+ {
+ m_impl->wait();
+ delete m_impl;
+ m_impl = NULL;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Thread::terminate()
+{
+ if (m_impl)
+ {
+ m_impl->terminate();
+ delete m_impl;
+ m_impl = NULL;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Thread::run()
+{
+ m_entryPoint->run();
+}
+
+} // namespace sf
diff --git a/src/SFML/System/ThreadLocal.cpp b/src/SFML/System/ThreadLocal.cpp
index 0d134db..bac8229 100644
--- a/src/SFML/System/ThreadLocal.cpp
+++ b/src/SFML/System/ThreadLocal.cpp
@@ -1,67 +1,67 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/ThreadLocal.hpp>
-
-#if defined(SFML_SYSTEM_WINDOWS)
- #include <SFML/System/Win32/ThreadLocalImpl.hpp>
-#else
- #include <SFML/System/Unix/ThreadLocalImpl.hpp>
-#endif
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-ThreadLocal::ThreadLocal(void* value)
-{
- m_impl = new priv::ThreadLocalImpl;
- setValue(value);
-}
-
-
-////////////////////////////////////////////////////////////
-ThreadLocal::~ThreadLocal()
-{
- delete m_impl;
-}
-
-
-////////////////////////////////////////////////////////////
-void ThreadLocal::setValue(void* value)
-{
- m_impl->setValue(value);
-}
-
-
-////////////////////////////////////////////////////////////
-void* ThreadLocal::getValue() const
-{
- return m_impl->getValue();
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/ThreadLocal.hpp>
+
+#if defined(SFML_SYSTEM_WINDOWS)
+ #include <SFML/System/Win32/ThreadLocalImpl.hpp>
+#else
+ #include <SFML/System/Unix/ThreadLocalImpl.hpp>
+#endif
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+ThreadLocal::ThreadLocal(void* value)
+{
+ m_impl = new priv::ThreadLocalImpl;
+ setValue(value);
+}
+
+
+////////////////////////////////////////////////////////////
+ThreadLocal::~ThreadLocal()
+{
+ delete m_impl;
+}
+
+
+////////////////////////////////////////////////////////////
+void ThreadLocal::setValue(void* value)
+{
+ m_impl->setValue(value);
+}
+
+
+////////////////////////////////////////////////////////////
+void* ThreadLocal::getValue() const
+{
+ return m_impl->getValue();
+}
+
+} // namespace sf
diff --git a/src/SFML/System/Time.cpp b/src/SFML/System/Time.cpp
index 69fd78e..6eeaa30 100644
--- a/src/SFML/System/Time.cpp
+++ b/src/SFML/System/Time.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -236,4 +236,25 @@ Time& operator /=(Time& left, Int64 right)
return left = left / right;
}
+
+////////////////////////////////////////////////////////////
+float operator /(Time left, Time right)
+{
+ return left.asSeconds() / right.asSeconds();
+}
+
+
+////////////////////////////////////////////////////////////
+Time operator %(Time left, Time right)
+{
+ return microseconds(left.asMicroseconds() % right.asMicroseconds());
+}
+
+
+////////////////////////////////////////////////////////////
+Time& operator %=(Time& left, Time right)
+{
+ return left = left % right;
+}
+
} // namespace sf
diff --git a/src/SFML/System/Unix/ClockImpl.cpp b/src/SFML/System/Unix/ClockImpl.cpp
index 813eec4..4ee8ddf 100644
--- a/src/SFML/System/Unix/ClockImpl.cpp
+++ b/src/SFML/System/Unix/ClockImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -26,7 +26,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/System/Unix/ClockImpl.hpp>
-#ifdef SFML_SYSTEM_MACOS
+#if defined(SFML_SYSTEM_MACOS) || defined(SFML_SYSTEM_IOS)
#include <mach/mach_time.h>
#else
#include <time.h>
@@ -40,7 +40,7 @@ namespace priv
////////////////////////////////////////////////////////////
Time ClockImpl::getCurrentTime()
{
-#ifdef SFML_SYSTEM_MACOS
+#if defined(SFML_SYSTEM_MACOS) || defined(SFML_SYSTEM_IOS)
// Mac OS X specific implementation (it doesn't support clock_gettime)
static mach_timebase_info_data_t frequency = {0, 0};
diff --git a/src/SFML/System/Unix/ClockImpl.hpp b/src/SFML/System/Unix/ClockImpl.hpp
index e55f5e9..1420b3e 100644
--- a/src/SFML/System/Unix/ClockImpl.hpp
+++ b/src/SFML/System/Unix/ClockImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -37,12 +37,12 @@ namespace sf
namespace priv
{
////////////////////////////////////////////////////////////
-/// \brief Unix implementaton of sf::Clock
+/// \brief Unix implementation of sf::Clock
///
////////////////////////////////////////////////////////////
class ClockImpl
{
-public :
+public:
////////////////////////////////////////////////////////////
/// \brief Get the current time
diff --git a/src/SFML/System/Unix/MutexImpl.cpp b/src/SFML/System/Unix/MutexImpl.cpp
index 8382dca..235393f 100644
--- a/src/SFML/System/Unix/MutexImpl.cpp
+++ b/src/SFML/System/Unix/MutexImpl.cpp
@@ -1,69 +1,69 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/Unix/MutexImpl.hpp>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-MutexImpl::MutexImpl()
-{
- // Make it recursive to follow the expected behaviour
- pthread_mutexattr_t attributes;
- pthread_mutexattr_init(&attributes);
- pthread_mutexattr_settype(&attributes, PTHREAD_MUTEX_RECURSIVE);
-
- pthread_mutex_init(&m_mutex, &attributes);
-}
-
-
-////////////////////////////////////////////////////////////
-MutexImpl::~MutexImpl()
-{
- pthread_mutex_destroy(&m_mutex);
-}
-
-
-////////////////////////////////////////////////////////////
-void MutexImpl::lock()
-{
- pthread_mutex_lock(&m_mutex);
-}
-
-
-////////////////////////////////////////////////////////////
-void MutexImpl::unlock()
-{
- pthread_mutex_unlock(&m_mutex);
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Unix/MutexImpl.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+MutexImpl::MutexImpl()
+{
+ // Make it recursive to follow the expected behavior
+ pthread_mutexattr_t attributes;
+ pthread_mutexattr_init(&attributes);
+ pthread_mutexattr_settype(&attributes, PTHREAD_MUTEX_RECURSIVE);
+
+ pthread_mutex_init(&m_mutex, &attributes);
+}
+
+
+////////////////////////////////////////////////////////////
+MutexImpl::~MutexImpl()
+{
+ pthread_mutex_destroy(&m_mutex);
+}
+
+
+////////////////////////////////////////////////////////////
+void MutexImpl::lock()
+{
+ pthread_mutex_lock(&m_mutex);
+}
+
+
+////////////////////////////////////////////////////////////
+void MutexImpl::unlock()
+{
+ pthread_mutex_unlock(&m_mutex);
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/System/Unix/MutexImpl.hpp b/src/SFML/System/Unix/MutexImpl.hpp
index b6f728e..03cb32e 100644
--- a/src/SFML/System/Unix/MutexImpl.hpp
+++ b/src/SFML/System/Unix/MutexImpl.hpp
@@ -1,83 +1,83 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_MUTEXIMPL_HPP
-#define SFML_MUTEXIMPL_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/NonCopyable.hpp>
-#include <pthread.h>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief Unix implementation of mutexes
-////////////////////////////////////////////////////////////
-class MutexImpl : NonCopyable
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Default constructor
- ///
- ////////////////////////////////////////////////////////////
- MutexImpl();
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor
- ///
- ////////////////////////////////////////////////////////////
- ~MutexImpl();
-
- ////////////////////////////////////////////////////////////
- /// \brief Lock the mutex
- ///
- ////////////////////////////////////////////////////////////
- void lock();
-
- ////////////////////////////////////////////////////////////
- /// \brief Unlock the mutex
- ///
- ////////////////////////////////////////////////////////////
- void unlock();
-
-private :
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- pthread_mutex_t m_mutex; ///< pthread handle of the mutex
-};
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_MUTEXIMPL_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_MUTEXIMPL_HPP
+#define SFML_MUTEXIMPL_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/NonCopyable.hpp>
+#include <pthread.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Unix implementation of mutexes
+////////////////////////////////////////////////////////////
+class MutexImpl : NonCopyable
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ MutexImpl();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~MutexImpl();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Lock the mutex
+ ///
+ ////////////////////////////////////////////////////////////
+ void lock();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Unlock the mutex
+ ///
+ ////////////////////////////////////////////////////////////
+ void unlock();
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ pthread_mutex_t m_mutex; ///< pthread handle of the mutex
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_MUTEXIMPL_HPP
diff --git a/src/SFML/System/Unix/SleepImpl.cpp b/src/SFML/System/Unix/SleepImpl.cpp
index d817d58..08d00f8 100644
--- a/src/SFML/System/Unix/SleepImpl.cpp
+++ b/src/SFML/System/Unix/SleepImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -26,9 +26,8 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/System/Unix/SleepImpl.hpp>
-#include <pthread.h>
-#include <unistd.h>
-#include <sys/time.h>
+#include <errno.h>
+#include <time.h>
namespace sf
@@ -38,38 +37,21 @@ namespace priv
////////////////////////////////////////////////////////////
void sleepImpl(Time time)
{
- // usleep is not reliable enough (it might block the
- // whole process instead of just the current thread)
- // so we must use pthread_cond_timedwait instead
-
- // this implementation is inspired from Qt
-
Uint64 usecs = time.asMicroseconds();
- // get the current time
- timeval tv;
- gettimeofday(&tv, NULL);
-
- // construct the time limit (current time + time to wait)
+ // Construct the time to wait
timespec ti;
- ti.tv_nsec = (tv.tv_usec + (usecs % 1000000)) * 1000;
- ti.tv_sec = tv.tv_sec + (usecs / 1000000) + (ti.tv_nsec / 1000000000);
- ti.tv_nsec %= 1000000000;
-
- // create a mutex and thread condition
- pthread_mutex_t mutex;
- pthread_mutex_init(&mutex, 0);
- pthread_cond_t condition;
- pthread_cond_init(&condition, 0);
-
- // wait...
- pthread_mutex_lock(&mutex);
- pthread_cond_timedwait(&condition, &mutex, &ti);
- pthread_mutex_unlock(&mutex);
-
- // destroy the mutex and condition
- pthread_cond_destroy(&condition);
- pthread_mutex_destroy(&mutex);
+ ti.tv_nsec = (usecs % 1000000) * 1000;
+ ti.tv_sec = usecs / 1000000;
+
+ // Wait...
+ // If nanosleep returns -1, we check errno. If it is EINTR
+ // nanosleep was interrupted and has set ti to the remaining
+ // duration. We continue sleeping until the complete duration
+ // has passed. We stop sleeping if it was due to an error.
+ while ((nanosleep(&ti, &ti) == -1) && (errno == EINTR))
+ {
+ }
}
} // namespace priv
diff --git a/src/SFML/System/Unix/SleepImpl.hpp b/src/SFML/System/Unix/SleepImpl.hpp
index 02142e4..d0d38bc 100644
--- a/src/SFML/System/Unix/SleepImpl.hpp
+++ b/src/SFML/System/Unix/SleepImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
diff --git a/src/SFML/System/Unix/ThreadImpl.cpp b/src/SFML/System/Unix/ThreadImpl.cpp
index 663fb71..0d94dfa 100644
--- a/src/SFML/System/Unix/ThreadImpl.cpp
+++ b/src/SFML/System/Unix/ThreadImpl.cpp
@@ -1,85 +1,94 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/Unix/ThreadImpl.hpp>
-#include <SFML/System/Thread.hpp>
-#include <iostream>
-#include <cassert>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-ThreadImpl::ThreadImpl(Thread* owner) :
-m_isActive(true)
-{
- m_isActive = pthread_create(&m_thread, NULL, &ThreadImpl::entryPoint, owner) == 0;
-
- if (!m_isActive)
- std::cerr << "Failed to create thread" << std::endl;
-}
-
-
-////////////////////////////////////////////////////////////
-void ThreadImpl::wait()
-{
- if (m_isActive)
- {
- assert(pthread_equal(pthread_self(), m_thread) == 0); // A thread cannot wait for itself!
- pthread_join(m_thread, NULL);
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void ThreadImpl::terminate()
-{
- if (m_isActive)
- pthread_cancel(m_thread);
-}
-
-
-////////////////////////////////////////////////////////////
-void* ThreadImpl::entryPoint(void* userData)
-{
- // The Thread instance is stored in the user data
- Thread* owner = static_cast<Thread*>(userData);
-
- // Tell the thread to handle cancel requests immediatly
- pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
-
- // Forward to the owner
- owner->run();
-
- return NULL;
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Unix/ThreadImpl.hpp>
+#include <SFML/System/Thread.hpp>
+#include <iostream>
+#include <cassert>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+ThreadImpl::ThreadImpl(Thread* owner) :
+m_isActive(true)
+{
+ m_isActive = pthread_create(&m_thread, NULL, &ThreadImpl::entryPoint, owner) == 0;
+
+ if (!m_isActive)
+ std::cerr << "Failed to create thread" << std::endl;
+}
+
+
+////////////////////////////////////////////////////////////
+void ThreadImpl::wait()
+{
+ if (m_isActive)
+ {
+ assert(pthread_equal(pthread_self(), m_thread) == 0); // A thread cannot wait for itself!
+ pthread_join(m_thread, NULL);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void ThreadImpl::terminate()
+{
+ if (m_isActive)
+ {
+ #ifndef SFML_SYSTEM_ANDROID
+ pthread_cancel(m_thread);
+ #else
+ // See http://stackoverflow.com/questions/4610086/pthread-cancel-al
+ pthread_kill(m_thread, SIGUSR1);
+ #endif
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void* ThreadImpl::entryPoint(void* userData)
+{
+ // The Thread instance is stored in the user data
+ Thread* owner = static_cast<Thread*>(userData);
+
+ #ifndef SFML_SYSTEM_ANDROID
+ // Tell the thread to handle cancel requests immediately
+ pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
+ #endif
+
+ // Forward to the owner
+ owner->run();
+
+ return NULL;
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/System/Unix/ThreadImpl.hpp b/src/SFML/System/Unix/ThreadImpl.hpp
index 5bf32d0..d9e7bc9 100644
--- a/src/SFML/System/Unix/ThreadImpl.hpp
+++ b/src/SFML/System/Unix/ThreadImpl.hpp
@@ -1,92 +1,93 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_THREADIMPL_HPP
-#define SFML_THREADIMPL_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/NonCopyable.hpp>
-#include <pthread.h>
-
-
-namespace sf
-{
-class Thread;
-
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief Unix implementation of threads
-////////////////////////////////////////////////////////////
-class ThreadImpl : NonCopyable
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Default constructor, launch the thread
- ///
- /// \param owner The Thread instance to run
- ///
- ////////////////////////////////////////////////////////////
- ThreadImpl(Thread* owner);
-
- ////////////////////////////////////////////////////////////
- /// \brief Wait until the thread finishes
- ///
- ////////////////////////////////////////////////////////////
- void wait();
-
- ////////////////////////////////////////////////////////////
- /// \brief Terminate the thread
- ///
- ////////////////////////////////////////////////////////////
- void terminate();
-
-private :
-
- ////////////////////////////////////////////////////////////
- /// \brief Global entry point for all threads
- ///
- /// \param userData User-defined data (contains the Thread instance)
- ///
- /// \return Os specific error code
- ///
- ////////////////////////////////////////////////////////////
- static void* entryPoint(void* userData);
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- pthread_t m_thread; ///< pthread thread instance
- bool m_isActive; ///< Thread state (active or inactive)
-};
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_THREADIMPL_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_THREADIMPL_HPP
+#define SFML_THREADIMPL_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <SFML/System/NonCopyable.hpp>
+#include <pthread.h>
+
+
+namespace sf
+{
+class Thread;
+
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Unix implementation of threads
+////////////////////////////////////////////////////////////
+class ThreadImpl : NonCopyable
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor, launch the thread
+ ///
+ /// \param owner The Thread instance to run
+ ///
+ ////////////////////////////////////////////////////////////
+ ThreadImpl(Thread* owner);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Wait until the thread finishes
+ ///
+ ////////////////////////////////////////////////////////////
+ void wait();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Terminate the thread
+ ///
+ ////////////////////////////////////////////////////////////
+ void terminate();
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Global entry point for all threads
+ ///
+ /// \param userData User-defined data (contains the Thread instance)
+ ///
+ /// \return Os specific error code
+ ///
+ ////////////////////////////////////////////////////////////
+ static void* entryPoint(void* userData);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ pthread_t m_thread; ///< pthread thread instance
+ bool m_isActive; ///< Thread state (active or inactive)
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_THREADIMPL_HPP
diff --git a/src/SFML/System/Unix/ThreadLocalImpl.cpp b/src/SFML/System/Unix/ThreadLocalImpl.cpp
index 7b2ae6d..5ebb5a0 100644
--- a/src/SFML/System/Unix/ThreadLocalImpl.cpp
+++ b/src/SFML/System/Unix/ThreadLocalImpl.cpp
@@ -1,64 +1,64 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/Unix/ThreadLocalImpl.hpp>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-ThreadLocalImpl::ThreadLocalImpl()
-{
- pthread_key_create(&m_key, NULL);
-}
-
-
-////////////////////////////////////////////////////////////
-ThreadLocalImpl::~ThreadLocalImpl()
-{
- pthread_key_delete(m_key);
-}
-
-
-////////////////////////////////////////////////////////////
-void ThreadLocalImpl::setValue(void* value)
-{
- pthread_setspecific(m_key, value);
-}
-
-
-////////////////////////////////////////////////////////////
-void* ThreadLocalImpl::getValue() const
-{
- return pthread_getspecific(m_key);
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Unix/ThreadLocalImpl.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+ThreadLocalImpl::ThreadLocalImpl()
+{
+ pthread_key_create(&m_key, NULL);
+}
+
+
+////////////////////////////////////////////////////////////
+ThreadLocalImpl::~ThreadLocalImpl()
+{
+ pthread_key_delete(m_key);
+}
+
+
+////////////////////////////////////////////////////////////
+void ThreadLocalImpl::setValue(void* value)
+{
+ pthread_setspecific(m_key, value);
+}
+
+
+////////////////////////////////////////////////////////////
+void* ThreadLocalImpl::getValue() const
+{
+ return pthread_getspecific(m_key);
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/System/Unix/ThreadLocalImpl.hpp b/src/SFML/System/Unix/ThreadLocalImpl.hpp
index 4d547fb..07abdff 100644
--- a/src/SFML/System/Unix/ThreadLocalImpl.hpp
+++ b/src/SFML/System/Unix/ThreadLocalImpl.hpp
@@ -1,87 +1,87 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_THREADLOCALIMPL_HPP
-#define SFML_THREADLOCALIMPL_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/NonCopyable.hpp>
-#include <pthread.h>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief Unix implementation of thread-local storage
-////////////////////////////////////////////////////////////
-class ThreadLocalImpl : NonCopyable
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Default constructor -- allocate the storage
- ///
- ////////////////////////////////////////////////////////////
- ThreadLocalImpl();
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor -- free the storage
- ///
- ////////////////////////////////////////////////////////////
- ~ThreadLocalImpl();
-
- ////////////////////////////////////////////////////////////
- /// \brief Set the thread-specific value of the variable
- ///
- /// \param value Value of the variable for this thread
- ///
- ////////////////////////////////////////////////////////////
- void setValue(void* value);
-
- ////////////////////////////////////////////////////////////
- /// \brief Retrieve the thread-specific value of the variable
- ///
- /// \return Value of the variable for this thread
- ///
- ////////////////////////////////////////////////////////////
- void* getValue() const;
-
-private :
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- pthread_key_t m_key; ///< Index of our thread-local storage slot
-};
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_THREADLOCALIMPL_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_THREADLOCALIMPL_HPP
+#define SFML_THREADLOCALIMPL_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/NonCopyable.hpp>
+#include <pthread.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Unix implementation of thread-local storage
+////////////////////////////////////////////////////////////
+class ThreadLocalImpl : NonCopyable
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor -- allocate the storage
+ ///
+ ////////////////////////////////////////////////////////////
+ ThreadLocalImpl();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor -- free the storage
+ ///
+ ////////////////////////////////////////////////////////////
+ ~ThreadLocalImpl();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Set the thread-specific value of the variable
+ ///
+ /// \param value Value of the variable for this thread
+ ///
+ ////////////////////////////////////////////////////////////
+ void setValue(void* value);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Retrieve the thread-specific value of the variable
+ ///
+ /// \return Value of the variable for this thread
+ ///
+ ////////////////////////////////////////////////////////////
+ void* getValue() const;
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ pthread_key_t m_key; ///< Index of our thread-local storage slot
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_THREADLOCALIMPL_HPP
diff --git a/src/SFML/System/Win32/ClockImpl.cpp b/src/SFML/System/Win32/ClockImpl.cpp
index c3cb711..5b197a4 100644
--- a/src/SFML/System/Win32/ClockImpl.cpp
+++ b/src/SFML/System/Win32/ClockImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -34,7 +34,7 @@ namespace
LARGE_INTEGER getFrequency()
{
LARGE_INTEGER frequency;
- QueryPerformanceFrequency(&frequency);
+ QueryPerformanceFrequency(&frequency);
return frequency;
}
}
diff --git a/src/SFML/System/Win32/ClockImpl.hpp b/src/SFML/System/Win32/ClockImpl.hpp
index d7e3863..f01708a 100644
--- a/src/SFML/System/Win32/ClockImpl.hpp
+++ b/src/SFML/System/Win32/ClockImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -37,12 +37,12 @@ namespace sf
namespace priv
{
////////////////////////////////////////////////////////////
-/// \brief Windows implementaton of sf::Clock
+/// \brief Windows implementation of sf::Clock
///
////////////////////////////////////////////////////////////
class ClockImpl
{
-public :
+public:
////////////////////////////////////////////////////////////
/// \brief Get the current time
diff --git a/src/SFML/System/Win32/MutexImpl.cpp b/src/SFML/System/Win32/MutexImpl.cpp
index 7e7f0c3..f000e8d 100644
--- a/src/SFML/System/Win32/MutexImpl.cpp
+++ b/src/SFML/System/Win32/MutexImpl.cpp
@@ -1,64 +1,64 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/Win32/MutexImpl.hpp>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-MutexImpl::MutexImpl()
-{
- InitializeCriticalSection(&m_mutex);
-}
-
-
-////////////////////////////////////////////////////////////
-MutexImpl::~MutexImpl()
-{
- DeleteCriticalSection(&m_mutex);
-}
-
-
-////////////////////////////////////////////////////////////
-void MutexImpl::lock()
-{
- EnterCriticalSection(&m_mutex);
-}
-
-
-////////////////////////////////////////////////////////////
-void MutexImpl::unlock()
-{
- LeaveCriticalSection(&m_mutex);
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Win32/MutexImpl.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+MutexImpl::MutexImpl()
+{
+ InitializeCriticalSection(&m_mutex);
+}
+
+
+////////////////////////////////////////////////////////////
+MutexImpl::~MutexImpl()
+{
+ DeleteCriticalSection(&m_mutex);
+}
+
+
+////////////////////////////////////////////////////////////
+void MutexImpl::lock()
+{
+ EnterCriticalSection(&m_mutex);
+}
+
+
+////////////////////////////////////////////////////////////
+void MutexImpl::unlock()
+{
+ LeaveCriticalSection(&m_mutex);
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/System/Win32/MutexImpl.hpp b/src/SFML/System/Win32/MutexImpl.hpp
index db78fb1..9604a5b 100644
--- a/src/SFML/System/Win32/MutexImpl.hpp
+++ b/src/SFML/System/Win32/MutexImpl.hpp
@@ -1,83 +1,83 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_MUTEXIMPL_HPP
-#define SFML_MUTEXIMPL_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/NonCopyable.hpp>
-#include <windows.h>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief Windows implementation of mutexes
-////////////////////////////////////////////////////////////
-class MutexImpl : NonCopyable
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Default constructor
- ///
- ////////////////////////////////////////////////////////////
- MutexImpl();
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor
- ///
- ////////////////////////////////////////////////////////////
- ~MutexImpl();
-
- ////////////////////////////////////////////////////////////
- /// \brief Lock the mutex
- ///
- ////////////////////////////////////////////////////////////
- void lock();
-
- ////////////////////////////////////////////////////////////
- /// \brief Unlock the mutex
- ///
- ////////////////////////////////////////////////////////////
- void unlock();
-
-private :
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- CRITICAL_SECTION m_mutex; ///< Win32 handle of the mutex
-};
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_MUTEXIMPL_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_MUTEXIMPL_HPP
+#define SFML_MUTEXIMPL_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/NonCopyable.hpp>
+#include <windows.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Windows implementation of mutexes
+////////////////////////////////////////////////////////////
+class MutexImpl : NonCopyable
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ MutexImpl();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~MutexImpl();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Lock the mutex
+ ///
+ ////////////////////////////////////////////////////////////
+ void lock();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Unlock the mutex
+ ///
+ ////////////////////////////////////////////////////////////
+ void unlock();
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ CRITICAL_SECTION m_mutex; ///< Win32 handle of the mutex
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_MUTEXIMPL_HPP
diff --git a/src/SFML/System/Win32/SleepImpl.cpp b/src/SFML/System/Win32/SleepImpl.cpp
index c3acda6..6f7106f 100644
--- a/src/SFML/System/Win32/SleepImpl.cpp
+++ b/src/SFML/System/Win32/SleepImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -36,7 +36,18 @@ namespace priv
////////////////////////////////////////////////////////////
void sleepImpl(Time time)
{
+ // Get the supported timer resolutions on this system
+ TIMECAPS tc;
+ timeGetDevCaps(&tc, sizeof(TIMECAPS));
+
+ // Set the timer resolution to the minimum for the Sleep call
+ timeBeginPeriod(tc.wPeriodMin);
+
+ // Wait...
::Sleep(time.asMilliseconds());
+
+ // Reset the timer resolution back to the system default
+ timeEndPeriod(tc.wPeriodMin);
}
} // namespace priv
diff --git a/src/SFML/System/Win32/SleepImpl.hpp b/src/SFML/System/Win32/SleepImpl.hpp
index e6f4c99..c0fbe54 100644
--- a/src/SFML/System/Win32/SleepImpl.hpp
+++ b/src/SFML/System/Win32/SleepImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
diff --git a/src/SFML/System/Win32/ThreadImpl.cpp b/src/SFML/System/Win32/ThreadImpl.cpp
index be80ed4..1697702 100644
--- a/src/SFML/System/Win32/ThreadImpl.cpp
+++ b/src/SFML/System/Win32/ThreadImpl.cpp
@@ -1,93 +1,93 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/Win32/ThreadImpl.hpp>
-#include <SFML/System/Thread.hpp>
-#include <SFML/System/Err.hpp>
-#include <cassert>
-#include <process.h>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-ThreadImpl::ThreadImpl(Thread* owner)
-{
- m_thread = reinterpret_cast<HANDLE>(_beginthreadex(NULL, 0, &ThreadImpl::entryPoint, owner, 0, &m_threadId));
-
- if (!m_thread)
- err() << "Failed to create thread" << std::endl;
-}
-
-
-////////////////////////////////////////////////////////////
-ThreadImpl::~ThreadImpl()
-{
- if (m_thread)
- CloseHandle(m_thread);
-}
-
-
-////////////////////////////////////////////////////////////
-void ThreadImpl::wait()
-{
- if (m_thread)
- {
- assert(m_threadId != GetCurrentThreadId()); // A thread cannot wait for itself!
- WaitForSingleObject(m_thread, INFINITE);
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void ThreadImpl::terminate()
-{
- if (m_thread)
- TerminateThread(m_thread, 0);
-}
-
-
-////////////////////////////////////////////////////////////
-unsigned int __stdcall ThreadImpl::entryPoint(void* userData)
-{
- // The Thread instance is stored in the user data
- Thread* owner = static_cast<Thread*>(userData);
-
- // Forward to the owner
- owner->run();
-
- // Optional, but it is cleaner
- _endthreadex(0);
-
- return 0;
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Win32/ThreadImpl.hpp>
+#include <SFML/System/Thread.hpp>
+#include <SFML/System/Err.hpp>
+#include <cassert>
+#include <process.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+ThreadImpl::ThreadImpl(Thread* owner)
+{
+ m_thread = reinterpret_cast<HANDLE>(_beginthreadex(NULL, 0, &ThreadImpl::entryPoint, owner, 0, &m_threadId));
+
+ if (!m_thread)
+ err() << "Failed to create thread" << std::endl;
+}
+
+
+////////////////////////////////////////////////////////////
+ThreadImpl::~ThreadImpl()
+{
+ if (m_thread)
+ CloseHandle(m_thread);
+}
+
+
+////////////////////////////////////////////////////////////
+void ThreadImpl::wait()
+{
+ if (m_thread)
+ {
+ assert(m_threadId != GetCurrentThreadId()); // A thread cannot wait for itself!
+ WaitForSingleObject(m_thread, INFINITE);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void ThreadImpl::terminate()
+{
+ if (m_thread)
+ TerminateThread(m_thread, 0);
+}
+
+
+////////////////////////////////////////////////////////////
+unsigned int __stdcall ThreadImpl::entryPoint(void* userData)
+{
+ // The Thread instance is stored in the user data
+ Thread* owner = static_cast<Thread*>(userData);
+
+ // Forward to the owner
+ owner->run();
+
+ // Optional, but it is cleaner
+ _endthreadex(0);
+
+ return 0;
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/System/Win32/ThreadImpl.hpp b/src/SFML/System/Win32/ThreadImpl.hpp
index 196494f..00df619 100644
--- a/src/SFML/System/Win32/ThreadImpl.hpp
+++ b/src/SFML/System/Win32/ThreadImpl.hpp
@@ -1,98 +1,109 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_THREADIMPL_HPP
-#define SFML_THREADIMPL_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/NonCopyable.hpp>
-#include <windows.h>
-
-
-namespace sf
-{
-class Thread;
-
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief Windows implementation of threads
-////////////////////////////////////////////////////////////
-class ThreadImpl : NonCopyable
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Default constructor, launch the thread
- ///
- /// \param owner The Thread instance to run
- ///
- ////////////////////////////////////////////////////////////
- ThreadImpl(Thread* owner);
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor
- ///
- ////////////////////////////////////////////////////////////
- ~ThreadImpl();
-
- ////////////////////////////////////////////////////////////
- /// \brief Wait until the thread finishes
- ///
- ////////////////////////////////////////////////////////////
- void wait();
-
- ////////////////////////////////////////////////////////////
- /// \brief Terminate the thread
- ///
- ////////////////////////////////////////////////////////////
- void terminate();
-
-private :
-
- ////////////////////////////////////////////////////////////
- /// \brief Global entry point for all threads
- ///
- /// \param userData User-defined data (contains the Thread instance)
- ///
- /// \return OS specific error code
- ///
- ////////////////////////////////////////////////////////////
- static unsigned int __stdcall entryPoint(void* userData);
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- HANDLE m_thread; ///< Win32 thread handle
- unsigned int m_threadId; ///< Win32 thread identifier
-};
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_THREADIMPL_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_THREADIMPL_HPP
+#define SFML_THREADIMPL_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/NonCopyable.hpp>
+#include <windows.h>
+
+// Fix for unaligned stack with clang and GCC on Windows XP 32-bit
+#if defined(SFML_SYSTEM_WINDOWS) && (defined(__clang__) || defined(__GNUC__))
+
+ #define ALIGN_STACK __attribute__((__force_align_arg_pointer__))
+
+#else
+
+ #define ALIGN_STACK
+
+#endif
+
+
+namespace sf
+{
+class Thread;
+
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Windows implementation of threads
+////////////////////////////////////////////////////////////
+class ThreadImpl : NonCopyable
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor, launch the thread
+ ///
+ /// \param owner The Thread instance to run
+ ///
+ ////////////////////////////////////////////////////////////
+ ThreadImpl(Thread* owner);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~ThreadImpl();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Wait until the thread finishes
+ ///
+ ////////////////////////////////////////////////////////////
+ void wait();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Terminate the thread
+ ///
+ ////////////////////////////////////////////////////////////
+ void terminate();
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Global entry point for all threads
+ ///
+ /// \param userData User-defined data (contains the Thread instance)
+ ///
+ /// \return OS specific error code
+ ///
+ ////////////////////////////////////////////////////////////
+ ALIGN_STACK static unsigned int __stdcall entryPoint(void* userData);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ HANDLE m_thread; ///< Win32 thread handle
+ unsigned int m_threadId; ///< Win32 thread identifier
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_THREADIMPL_HPP
diff --git a/src/SFML/System/Win32/ThreadLocalImpl.cpp b/src/SFML/System/Win32/ThreadLocalImpl.cpp
index a4d850e..f617e84 100644
--- a/src/SFML/System/Win32/ThreadLocalImpl.cpp
+++ b/src/SFML/System/Win32/ThreadLocalImpl.cpp
@@ -1,64 +1,64 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/Win32/ThreadLocalImpl.hpp>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-ThreadLocalImpl::ThreadLocalImpl()
-{
- m_index = TlsAlloc();
-}
-
-
-////////////////////////////////////////////////////////////
-ThreadLocalImpl::~ThreadLocalImpl()
-{
- TlsFree(m_index);
-}
-
-
-////////////////////////////////////////////////////////////
-void ThreadLocalImpl::setValue(void* value)
-{
- TlsSetValue(m_index, value);
-}
-
-
-////////////////////////////////////////////////////////////
-void* ThreadLocalImpl::getValue() const
-{
- return TlsGetValue(m_index);
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Win32/ThreadLocalImpl.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+ThreadLocalImpl::ThreadLocalImpl()
+{
+ m_index = TlsAlloc();
+}
+
+
+////////////////////////////////////////////////////////////
+ThreadLocalImpl::~ThreadLocalImpl()
+{
+ TlsFree(m_index);
+}
+
+
+////////////////////////////////////////////////////////////
+void ThreadLocalImpl::setValue(void* value)
+{
+ TlsSetValue(m_index, value);
+}
+
+
+////////////////////////////////////////////////////////////
+void* ThreadLocalImpl::getValue() const
+{
+ return TlsGetValue(m_index);
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/System/Win32/ThreadLocalImpl.hpp b/src/SFML/System/Win32/ThreadLocalImpl.hpp
index d6606f6..83060b1 100644
--- a/src/SFML/System/Win32/ThreadLocalImpl.hpp
+++ b/src/SFML/System/Win32/ThreadLocalImpl.hpp
@@ -1,87 +1,87 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_THREADLOCALIMPL_HPP
-#define SFML_THREADLOCALIMPL_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/System/NonCopyable.hpp>
-#include <windows.h>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief Windows implementation of thread-local storage
-////////////////////////////////////////////////////////////
-class ThreadLocalImpl : NonCopyable
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Default constructor -- allocate the storage
- ///
- ////////////////////////////////////////////////////////////
- ThreadLocalImpl();
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor -- free the storage
- ///
- ////////////////////////////////////////////////////////////
- ~ThreadLocalImpl();
-
- ////////////////////////////////////////////////////////////
- /// \brief Set the thread-specific value of the variable
- ///
- /// \param value Value of the variable for this thread
- ///
- ////////////////////////////////////////////////////////////
- void setValue(void* value);
-
- ////////////////////////////////////////////////////////////
- /// \brief Retrieve the thread-specific value of the variable
- ///
- /// \return Value of the variable for this thread
- ///
- ////////////////////////////////////////////////////////////
- void* getValue() const;
-
-private :
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- DWORD m_index; ///< Index of our thread-local storage slot
-};
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_THREADLOCALIMPL_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_THREADLOCALIMPL_HPP
+#define SFML_THREADLOCALIMPL_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/NonCopyable.hpp>
+#include <windows.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Windows implementation of thread-local storage
+////////////////////////////////////////////////////////////
+class ThreadLocalImpl : NonCopyable
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor -- allocate the storage
+ ///
+ ////////////////////////////////////////////////////////////
+ ThreadLocalImpl();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor -- free the storage
+ ///
+ ////////////////////////////////////////////////////////////
+ ~ThreadLocalImpl();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Set the thread-specific value of the variable
+ ///
+ /// \param value Value of the variable for this thread
+ ///
+ ////////////////////////////////////////////////////////////
+ void setValue(void* value);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Retrieve the thread-specific value of the variable
+ ///
+ /// \return Value of the variable for this thread
+ ///
+ ////////////////////////////////////////////////////////////
+ void* getValue() const;
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ DWORD m_index; ///< Index of our thread-local storage slot
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_THREADLOCALIMPL_HPP
diff --git a/src/SFML/Window/Android/InputImpl.cpp b/src/SFML/Window/Android/InputImpl.cpp
new file mode 100644
index 0000000..920587b
--- /dev/null
+++ b/src/SFML/Window/Android/InputImpl.cpp
@@ -0,0 +1,204 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/Android/InputImpl.hpp>
+#include <SFML/System/Android/Activity.hpp>
+#include <SFML/System/Lock.hpp>
+#include <SFML/System/Err.hpp>
+#include <jni.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+bool InputImpl::isKeyPressed(Keyboard::Key key)
+{
+ // Not applicable
+ return false;
+}
+
+////////////////////////////////////////////////////////////
+void InputImpl::setVirtualKeyboardVisible(bool visible)
+{
+ // todo: Check if the window is active
+
+ ActivityStates* states = getActivity(NULL);
+ Lock lock(states->mutex);
+
+ // Initializes JNI
+ jint lResult;
+ jint lFlags = 0;
+
+ JavaVM* lJavaVM = states->activity->vm;
+ JNIEnv* lJNIEnv = states->activity->env;
+
+ JavaVMAttachArgs lJavaVMAttachArgs;
+ lJavaVMAttachArgs.version = JNI_VERSION_1_6;
+ lJavaVMAttachArgs.name = "NativeThread";
+ lJavaVMAttachArgs.group = NULL;
+
+ lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs);
+
+ if (lResult == JNI_ERR)
+ err() << "Failed to initialize JNI, couldn't switch the keyboard visibility" << std::endl;
+
+ // Retrieves NativeActivity
+ jobject lNativeActivity = states->activity->clazz;
+ jclass ClassNativeActivity = lJNIEnv->GetObjectClass(lNativeActivity);
+
+ // Retrieves Context.INPUT_METHOD_SERVICE
+ jclass ClassContext = lJNIEnv->FindClass("android/content/Context");
+ jfieldID FieldINPUT_METHOD_SERVICE = lJNIEnv->GetStaticFieldID(ClassContext,
+ "INPUT_METHOD_SERVICE", "Ljava/lang/String;");
+ jobject INPUT_METHOD_SERVICE = lJNIEnv->GetStaticObjectField(ClassContext,
+ FieldINPUT_METHOD_SERVICE);
+
+ // Runs getSystemService(Context.INPUT_METHOD_SERVICE)
+ jclass ClassInputMethodManager =
+ lJNIEnv->FindClass("android/view/inputmethod/InputMethodManager");
+ jmethodID MethodGetSystemService = lJNIEnv->GetMethodID(ClassNativeActivity,
+ "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;");
+ jobject lInputMethodManager = lJNIEnv->CallObjectMethod(lNativeActivity,
+ MethodGetSystemService, INPUT_METHOD_SERVICE);
+
+ // Runs getWindow().getDecorView()
+ jmethodID MethodGetWindow = lJNIEnv->GetMethodID(ClassNativeActivity,
+ "getWindow", "()Landroid/view/Window;");
+ jobject lWindow = lJNIEnv->CallObjectMethod(lNativeActivity, MethodGetWindow);
+ jclass ClassWindow = lJNIEnv->FindClass("android/view/Window");
+ jmethodID MethodGetDecorView = lJNIEnv->GetMethodID(ClassWindow,
+ "getDecorView", "()Landroid/view/View;");
+ jobject lDecorView = lJNIEnv->CallObjectMethod(lWindow, MethodGetDecorView);
+
+ if (visible)
+ {
+ // Runs lInputMethodManager.showSoftInput(...)
+ jmethodID MethodShowSoftInput = lJNIEnv->GetMethodID(ClassInputMethodManager,
+ "showSoftInput", "(Landroid/view/View;I)Z");
+ jboolean lResult = lJNIEnv->CallBooleanMethod(lInputMethodManager,
+ MethodShowSoftInput, lDecorView, lFlags);
+ }
+ else
+ {
+ // Runs lWindow.getViewToken()
+ jclass ClassView = lJNIEnv->FindClass("android/view/View");
+ jmethodID MethodGetWindowToken = lJNIEnv->GetMethodID(ClassView,
+ "getWindowToken", "()Landroid/os/IBinder;");
+ jobject lBinder = lJNIEnv->CallObjectMethod(lDecorView,
+ MethodGetWindowToken);
+
+ // lInputMethodManager.hideSoftInput(...)
+ jmethodID MethodHideSoftInput = lJNIEnv->GetMethodID(ClassInputMethodManager,
+ "hideSoftInputFromWindow", "(Landroid/os/IBinder;I)Z");
+ jboolean lRes = lJNIEnv->CallBooleanMethod(lInputMethodManager,
+ MethodHideSoftInput, lBinder, lFlags);
+ }
+
+ // Finished with the JVM
+ lJavaVM->DetachCurrentThread();
+}
+
+////////////////////////////////////////////////////////////
+bool InputImpl::isMouseButtonPressed(Mouse::Button button)
+{
+ ALooper_pollAll(0, NULL, NULL, NULL);
+
+ priv::ActivityStates* states = priv::getActivity(NULL);
+ Lock lock(states->mutex);
+
+ return states->isButtonPressed[button];
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i InputImpl::getMousePosition()
+{
+ ALooper_pollAll(0, NULL, NULL, NULL);
+
+ priv::ActivityStates* states = priv::getActivity(NULL);
+ Lock lock(states->mutex);
+
+ return states->mousePosition;
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i InputImpl::getMousePosition(const Window& relativeTo)
+{
+ return getMousePosition();
+}
+
+
+////////////////////////////////////////////////////////////
+void InputImpl::setMousePosition(const Vector2i& position)
+{
+ // Injecting events is impossible on Android
+}
+
+
+////////////////////////////////////////////////////////////
+void InputImpl::setMousePosition(const Vector2i& position, const Window& relativeTo)
+{
+ setMousePosition(position);
+}
+
+
+////////////////////////////////////////////////////////////
+bool InputImpl::isTouchDown(unsigned int finger)
+{
+ ALooper_pollAll(0, NULL, NULL, NULL);
+
+ priv::ActivityStates* states = priv::getActivity(NULL);
+ Lock lock(states->mutex);
+
+ return states->touchEvents.find(finger) != states->touchEvents.end();
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i InputImpl::getTouchPosition(unsigned int finger)
+{
+ ALooper_pollAll(0, NULL, NULL, NULL);
+
+ priv::ActivityStates* states = priv::getActivity(NULL);
+ Lock lock(states->mutex);
+
+ return states->touchEvents.find(finger)->second;
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i InputImpl::getTouchPosition(unsigned int finger, const Window& relativeTo)
+{
+ return getTouchPosition(finger);
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/Android/InputImpl.hpp b/src/SFML/Window/Android/InputImpl.hpp
new file mode 100644
index 0000000..37167b5
--- /dev/null
+++ b/src/SFML/Window/Android/InputImpl.hpp
@@ -0,0 +1,168 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_INPUTIMPLANDROID_HPP
+#define SFML_INPUTIMPLANDROID_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/Keyboard.hpp>
+#include <SFML/Window/Mouse.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief iOS implementation of inputs (keyboard + mouse)
+///
+////////////////////////////////////////////////////////////
+class InputImpl
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a key is pressed
+ ///
+ /// \param key Key to check
+ ///
+ /// \return True if the key is pressed, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isKeyPressed(Keyboard::Key key);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Show or hide the virtual keyboard
+ ///
+ /// \param visible True to show, false to hide
+ ///
+ ////////////////////////////////////////////////////////////
+ static void setVirtualKeyboardVisible(bool visible);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a mouse button is pressed
+ ///
+ /// \param button Button to check
+ ///
+ /// \return True if the button is pressed, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isMouseButtonPressed(Mouse::Button button);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current position of the mouse in desktop coordinates
+ ///
+ /// This function returns the current position of the mouse
+ /// cursor, in global (desktop) coordinates.
+ ///
+ /// \return Current position of the mouse
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector2i getMousePosition();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current position of the mouse in window coordinates
+ ///
+ /// This function returns the current position of the mouse
+ /// cursor, relative to the given window.
+ /// If no window is used, it returns desktop coordinates.
+ ///
+ /// \param relativeTo Reference window
+ ///
+ /// \return Current position of the mouse
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector2i getMousePosition(const Window& relativeTo);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Set the current position of the mouse in desktop coordinates
+ ///
+ /// This function sets the current position of the mouse
+ /// cursor in global (desktop) coordinates.
+ /// If no window is used, it sets the position in desktop coordinates.
+ ///
+ /// \param position New position of the mouse
+ ///
+ ////////////////////////////////////////////////////////////
+ static void setMousePosition(const Vector2i& position);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Set the current position of the mouse in window coordinates
+ ///
+ /// This function sets the current position of the mouse
+ /// cursor, relative to the given window.
+ /// If no window is used, it sets the position in desktop coordinates.
+ ///
+ /// \param position New position of the mouse
+ /// \param relativeTo Reference window
+ ///
+ ////////////////////////////////////////////////////////////
+ static void setMousePosition(const Vector2i& position, const Window& relativeTo);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a touch event is currently down
+ ///
+ /// \param finger Finger index
+ ///
+ /// \return True if \a finger is currently touching the screen, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isTouchDown(unsigned int finger);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current position of a touch in desktop coordinates
+ ///
+ /// This function returns the current touch position
+ /// in global (desktop) coordinates.
+ ///
+ /// \param finger Finger index
+ ///
+ /// \return Current position of \a finger, or undefined if it's not down
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector2i getTouchPosition(unsigned int finger);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current position of a touch in window coordinates
+ ///
+ /// This function returns the current touch position
+ /// in global (desktop) coordinates.
+ ///
+ /// \param finger Finger index
+ /// \param relativeTo Reference window
+ ///
+ /// \return Current position of \a finger, or undefined if it's not down
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector2i getTouchPosition(unsigned int finger, const Window& relativeTo);
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_INPUTIMPLANDROID_HPP
diff --git a/src/SFML/Window/Android/JoystickImpl.cpp b/src/SFML/Window/Android/JoystickImpl.cpp
new file mode 100644
index 0000000..58dfc82
--- /dev/null
+++ b/src/SFML/Window/Android/JoystickImpl.cpp
@@ -0,0 +1,97 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/JoystickImpl.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+void JoystickImpl::initialize()
+{
+ // To implement
+}
+
+
+
+////////////////////////////////////////////////////////////
+void JoystickImpl::cleanup()
+{
+ // To implement
+}
+
+
+////////////////////////////////////////////////////////////
+bool JoystickImpl::isConnected(unsigned int index)
+{
+ // To implement
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+bool JoystickImpl::open(unsigned int index)
+{
+ // To implement
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+void JoystickImpl::close()
+{
+ // To implement
+}
+
+
+////////////////////////////////////////////////////////////
+JoystickCaps JoystickImpl::getCapabilities() const
+{
+ // To implement
+ return JoystickCaps();
+}
+
+
+////////////////////////////////////////////////////////////
+Joystick::Identification JoystickImpl::getIdentification() const
+{
+ return m_identification;
+}
+
+
+////////////////////////////////////////////////////////////
+JoystickState JoystickImpl::update()
+{
+ // To implement
+ return JoystickState();
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/Android/JoystickImpl.hpp b/src/SFML/Window/Android/JoystickImpl.hpp
new file mode 100644
index 0000000..2fb8cd3
--- /dev/null
+++ b/src/SFML/Window/Android/JoystickImpl.hpp
@@ -0,0 +1,117 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_JOYSTICKIMPLANDROID_HPP
+#define SFML_JOYSTICKIMPLANDROID_HPP
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Android implementation of joysticks
+///
+////////////////////////////////////////////////////////////
+class JoystickImpl
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global initialization of the joystick module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void initialize();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global cleanup of the joystick module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void cleanup();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a joystick is currently connected
+ ///
+ /// \param index Index of the joystick to check
+ ///
+ /// \return True if the joystick is connected, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isConnected(unsigned int index);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open the joystick
+ ///
+ /// \param index Index assigned to the joystick
+ ///
+ /// \return True on success, false on failure
+ ///
+ ////////////////////////////////////////////////////////////
+ bool open(unsigned int index);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Close the joystick
+ ///
+ ////////////////////////////////////////////////////////////
+ void close();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the joystick capabilities
+ ///
+ /// \return Joystick capabilities
+ ///
+ ////////////////////////////////////////////////////////////
+ JoystickCaps getCapabilities() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the joystick identification
+ ///
+ /// \return Joystick identification
+ ///
+ ////////////////////////////////////////////////////////////
+ Joystick::Identification getIdentification() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Update the joystick and get its new state
+ ///
+ /// \return Joystick state
+ ///
+ ////////////////////////////////////////////////////////////
+ JoystickState update();
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ int m_index; ///< Index of the joystick
+ Joystick::Identification m_identification; ///< Joystick identification
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_JOYSTICKIMPLANDROID_HPP
diff --git a/src/SFML/Window/Android/SensorImpl.cpp b/src/SFML/Window/Android/SensorImpl.cpp
new file mode 100644
index 0000000..4e36584
--- /dev/null
+++ b/src/SFML/Window/Android/SensorImpl.cpp
@@ -0,0 +1,214 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/SensorImpl.hpp>
+#include <SFML/System/Time.hpp>
+#include <android/looper.h>
+
+// Define missing constants
+#define ASENSOR_TYPE_GRAVITY 0x00000009
+#define ASENSOR_TYPE_LINEAR_ACCELERATION 0x0000000a
+#define ASENSOR_TYPE_ORIENTATION 0x00000003
+
+namespace
+{
+ ALooper* looper;
+ ASensorManager* sensorManager;
+ ASensorEventQueue* sensorEventQueue;
+ sf::Vector3f sensorData[sf::Sensor::Count];
+}
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+void SensorImpl::initialize()
+{
+ // Get the looper associated with this thread
+ looper = ALooper_forThread();
+
+ // Get the unique sensor manager
+ sensorManager = ASensorManager_getInstance();
+
+ // Create the sensor events queue and attach it to the looper
+ sensorEventQueue = ASensorManager_createEventQueue(sensorManager, looper,
+ 1, &processSensorEvents, NULL);
+}
+
+
+////////////////////////////////////////////////////////////
+void SensorImpl::cleanup()
+{
+ // Detach the sensor events queue from the looper and destroy it
+ ASensorManager_destroyEventQueue(sensorManager, sensorEventQueue);
+}
+
+
+////////////////////////////////////////////////////////////
+bool SensorImpl::isAvailable(Sensor::Type sensor)
+{
+ const ASensor* available = getDefaultSensor(sensor);
+
+ return available? true : false;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SensorImpl::open(Sensor::Type sensor)
+{
+ // Get the default sensor matching the type
+ m_sensor = getDefaultSensor(sensor);
+
+ // Sensor not available, stop here
+ if (!m_sensor)
+ return false;
+
+ // Get the minimum delay allowed between events
+ Time minimumDelay = microseconds(ASensor_getMinDelay(m_sensor));
+
+ // Set the event rate (not to consume too much battery)
+ ASensorEventQueue_setEventRate(sensorEventQueue, m_sensor, minimumDelay.asMicroseconds());
+
+ // Save the index of the sensor
+ m_index = static_cast<unsigned int>(sensor);
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+void SensorImpl::close()
+{
+ // Nothing to do
+}
+
+
+////////////////////////////////////////////////////////////
+Vector3f SensorImpl::update()
+{
+ // Update our sensor data list
+ ALooper_pollAll(0, NULL, NULL, NULL);
+
+ return sensorData[m_index];
+}
+
+
+////////////////////////////////////////////////////////////
+void SensorImpl::setEnabled(bool enabled)
+{
+ if (enabled)
+ ASensorEventQueue_enableSensor(sensorEventQueue, m_sensor);
+ else
+ ASensorEventQueue_disableSensor(sensorEventQueue, m_sensor);
+}
+
+
+////////////////////////////////////////////////////////////
+ASensor const* SensorImpl::getDefaultSensor(Sensor::Type sensor)
+{
+ // Find the Android sensor type
+ static int types[] = {ASENSOR_TYPE_ACCELEROMETER, ASENSOR_TYPE_GYROSCOPE,
+ ASENSOR_TYPE_MAGNETIC_FIELD, ASENSOR_TYPE_GRAVITY, ASENSOR_TYPE_LINEAR_ACCELERATION,
+ ASENSOR_TYPE_ORIENTATION};
+
+ int type = types[sensor];
+
+ // Retrieve the default sensor matching this type
+ return ASensorManager_getDefaultSensor(sensorManager, type);
+}
+
+
+////////////////////////////////////////////////////////////
+int SensorImpl::processSensorEvents(int fd, int events, void* data)
+{
+ ASensorEvent event;
+
+ while (ASensorEventQueue_getEvents(sensorEventQueue, &event, 1) > 0)
+ {
+ unsigned int type = Sensor::Count;
+ Vector3f data;
+
+ switch (event.type)
+ {
+ case ASENSOR_TYPE_ACCELEROMETER:
+ type = Sensor::Accelerometer;
+ data.x = event.acceleration.x;
+ data.y = event.acceleration.y;
+ data.z = event.acceleration.z;
+ break;
+
+ case ASENSOR_TYPE_GYROSCOPE:
+ type = Sensor::Gyroscope;
+ data.x = event.vector.x;
+ data.y = event.vector.y;
+ data.z = event.vector.z;
+ break;
+
+ case ASENSOR_TYPE_MAGNETIC_FIELD:
+ type = Sensor::Magnetometer;
+ data.x = event.magnetic.x;
+ data.y = event.magnetic.y;
+ data.z = event.magnetic.z;
+ break;
+
+ case ASENSOR_TYPE_GRAVITY:
+ type = Sensor::Gravity;
+ data.x = event.vector.x;
+ data.y = event.vector.y;
+ data.z = event.vector.z;
+ break;
+
+ case ASENSOR_TYPE_LINEAR_ACCELERATION:
+ type = Sensor::UserAcceleration;
+ data.x = event.acceleration.x;
+ data.y = event.acceleration.y;
+ data.z = event.acceleration.z;
+ break;
+
+ case ASENSOR_TYPE_ORIENTATION:
+ type = Sensor::Orientation;
+ data.x = event.vector.x;
+ data.y = event.vector.y;
+ data.z = event.vector.z;
+ break;
+ }
+
+ // An unknown sensor event has been detected, we don't know how to process it
+ if (type == Sensor::Count)
+ continue;
+
+ sensorData[type] = data;
+ }
+
+ return 1;
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/Android/SensorImpl.hpp b/src/SFML/Window/Android/SensorImpl.hpp
new file mode 100644
index 0000000..d945c11
--- /dev/null
+++ b/src/SFML/Window/Android/SensorImpl.hpp
@@ -0,0 +1,137 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SENSORIMPLANDROID_HPP
+#define SFML_SENSORIMPLANDROID_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Vector3.hpp>
+#include <android/sensor.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Android implementation of sensors
+///
+////////////////////////////////////////////////////////////
+class SensorImpl
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global initialization of the sensor module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void initialize();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global cleanup of the sensor module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void cleanup();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a sensor is available
+ ///
+ /// \param sensor Sensor to check
+ ///
+ /// \return True if the sensor is available, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isAvailable(Sensor::Type sensor);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open the sensor
+ ///
+ /// \param sensor Type of the sensor
+ ///
+ /// \return True on success, false on failure
+ ///
+ ////////////////////////////////////////////////////////////
+ bool open(Sensor::Type sensor);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Close the sensor
+ ///
+ ////////////////////////////////////////////////////////////
+ void close();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Update the sensor and get its new value
+ ///
+ /// \return Sensor value
+ ///
+ ////////////////////////////////////////////////////////////
+ Vector3f update();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Enable or disable the sensor
+ ///
+ /// \param enabled True to enable, false to disable
+ ///
+ ////////////////////////////////////////////////////////////
+ void setEnabled(bool enabled);
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the default Android sensor matching the sensor type
+ ///
+ /// \param type Type of the sensor
+ ///
+ /// \return The default Android sensor, NULL otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static ASensor const* getDefaultSensor(Sensor::Type sensor);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Process the pending sensor data available and add them to our lists
+ ///
+ /// \param fd File descriptor
+ /// \param events Bitmask of the poll events that were triggered
+ /// \param data Data pointer supplied
+ ///
+ /// \return Whether it should continue (1) or unregister the callback (0)
+ ///
+ ////////////////////////////////////////////////////////////
+ static int processSensorEvents(int fd, int events, void* data);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ const ASensor* m_sensor; ///< Android sensor structure
+ unsigned int m_index; ///< Index of the sensor
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_SENSORIMPLANDROID_HPP
diff --git a/src/SFML/Window/Android/VideoModeImpl.cpp b/src/SFML/Window/Android/VideoModeImpl.cpp
new file mode 100644
index 0000000..d9c171c
--- /dev/null
+++ b/src/SFML/Window/Android/VideoModeImpl.cpp
@@ -0,0 +1,63 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/VideoModeImpl.hpp>
+#include <SFML/System/Android/Activity.hpp>
+#include <SFML/System/Vector2.hpp>
+#include <SFML/System/Sleep.hpp>
+#include <SFML/System/Lock.hpp>
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+std::vector<VideoMode> VideoModeImpl::getFullscreenModes()
+{
+ VideoMode desktop = getDesktopMode();
+
+ // Return both portrait and landscape resolutions
+ std::vector<VideoMode> modes;
+ modes.push_back(desktop);
+ modes.push_back(VideoMode(desktop.height, desktop.width, desktop.bitsPerPixel));
+ return modes;
+}
+
+
+////////////////////////////////////////////////////////////
+VideoMode VideoModeImpl::getDesktopMode()
+{
+ // Get the activity states
+ priv::ActivityStates* states = priv::getActivity(NULL);
+ Lock lock(states->mutex);
+
+ return VideoMode(states->screenSize.x, states->screenSize.y);
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/Android/WindowImplAndroid.cpp b/src/SFML/Window/Android/WindowImplAndroid.cpp
new file mode 100644
index 0000000..2c140b0
--- /dev/null
+++ b/src/SFML/Window/Android/WindowImplAndroid.cpp
@@ -0,0 +1,703 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/WindowStyle.hpp> // important to be included first (conflict with None)
+#include <SFML/Window/Android/WindowImplAndroid.hpp>
+#include <SFML/Window/Event.hpp>
+#include <SFML/System/Lock.hpp>
+#include <SFML/System/Err.hpp>
+#include <android/looper.h>
+
+// Define missing constants
+#define AMOTION_EVENT_ACTION_HOVER_MOVE 0x00000007
+#define AMOTION_EVENT_ACTION_SCROLL 0x00000008
+
+////////////////////////////////////////////////////////////
+// Private data
+////////////////////////////////////////////////////////////
+namespace sf
+{
+namespace priv
+{
+WindowImplAndroid* WindowImplAndroid::singleInstance = NULL;
+
+////////////////////////////////////////////////////////////
+WindowImplAndroid::WindowImplAndroid(WindowHandle handle)
+: m_size(0, 0)
+, m_windowBeingCreated(false)
+, m_windowBeingDestroyed(false)
+, m_hasFocus(false)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+WindowImplAndroid::WindowImplAndroid(VideoMode mode, const String& title, unsigned long style, const ContextSettings& settings)
+: m_size(mode.width, mode.height)
+, m_windowBeingCreated(false)
+, m_windowBeingDestroyed(false)
+, m_hasFocus(false)
+{
+ ActivityStates* states = getActivity(NULL);
+ Lock lock(states->mutex);
+
+ if (style& Style::Fullscreen)
+ states->fullscreen = true;
+
+ WindowImplAndroid::singleInstance = this;
+ states->forwardEvent = forwardEvent;
+
+ // Register process event callback
+ states->processEvent = processEvent;
+
+ states->initialized = true;
+}
+
+
+////////////////////////////////////////////////////////////
+WindowImplAndroid::~WindowImplAndroid()
+{
+}
+
+
+////////////////////////////////////////////////////////////
+WindowHandle WindowImplAndroid::getSystemHandle() const
+{
+ ActivityStates* states = getActivity(NULL);
+ Lock lock(states->mutex);
+
+ return states->window;
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplAndroid::processEvents()
+{
+ // Process incoming OS events
+ ALooper_pollAll(0, NULL, NULL, NULL);
+
+ ActivityStates* states = getActivity(NULL);
+ sf::Lock lock(states->mutex);
+
+ if (m_windowBeingCreated)
+ {
+ states->context->createSurface(states->window);
+ m_windowBeingCreated = false;
+ }
+
+ if (m_windowBeingDestroyed)
+ {
+ states->context->destroySurface();
+ m_windowBeingDestroyed = false;
+ }
+
+ states->updated = true;
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i WindowImplAndroid::getPosition() const
+{
+ // Not applicable
+ return Vector2i(0, 0);
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplAndroid::setPosition(const Vector2i& position)
+{
+ // Not applicable
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2u WindowImplAndroid::getSize() const
+{
+ return m_size;
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplAndroid::setSize(const Vector2u& size)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplAndroid::setTitle(const String& title)
+{
+ // Not applicable
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplAndroid::setIcon(unsigned int width, unsigned int height, const Uint8* pixels)
+{
+ // Not applicable
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplAndroid::setVisible(bool visible)
+{
+ // Not applicable
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplAndroid::setMouseCursorVisible(bool visible)
+{
+ // Not applicable
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplAndroid::setKeyRepeatEnabled(bool enabled)
+{
+ // Not applicable
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplAndroid::requestFocus()
+{
+ // Not applicable
+}
+
+
+////////////////////////////////////////////////////////////
+bool WindowImplAndroid::hasFocus() const
+{
+ return m_hasFocus;
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplAndroid::forwardEvent(const Event& event)
+{
+ ActivityStates* states = getActivity(NULL);
+
+ if (event.type == Event::GainedFocus)
+ {
+ WindowImplAndroid::singleInstance->m_size.x = ANativeWindow_getWidth(states->window);
+ WindowImplAndroid::singleInstance->m_size.y = ANativeWindow_getHeight(states->window);
+ WindowImplAndroid::singleInstance->m_windowBeingCreated = true;
+ WindowImplAndroid::singleInstance->m_hasFocus = true;
+ }
+ else if (event.type == Event::LostFocus)
+ {
+ WindowImplAndroid::singleInstance->m_windowBeingDestroyed = true;
+ WindowImplAndroid::singleInstance->m_hasFocus = false;
+ }
+
+ WindowImplAndroid::singleInstance->pushEvent(event);
+}
+
+
+////////////////////////////////////////////////////////////
+int WindowImplAndroid::processEvent(int fd, int events, void* data)
+{
+ ActivityStates* states = getActivity(NULL);
+ Lock lock(states->mutex);
+
+ AInputEvent* _event = NULL;
+
+ if (AInputQueue_getEvent(states->inputQueue, &_event) >= 0)
+ {
+ if (AInputQueue_preDispatchEvent(states->inputQueue, _event))
+ return 1;
+
+ int32_t handled = 0;
+
+ int32_t type = AInputEvent_getType(_event);
+
+ if (type == AINPUT_EVENT_TYPE_KEY)
+ {
+ int32_t action = AKeyEvent_getAction(_event);
+ int32_t key = AKeyEvent_getKeyCode(_event);
+
+ if ((action == AKEY_EVENT_ACTION_DOWN || action == AKEY_EVENT_ACTION_UP || action == AKEY_EVENT_ACTION_MULTIPLE) &&
+ key != AKEYCODE_VOLUME_UP && key != AKEYCODE_VOLUME_DOWN)
+ {
+ processKeyEvent(_event, states);
+ handled = 1;
+ }
+ }
+ else if (type == AINPUT_EVENT_TYPE_MOTION)
+ {
+ int32_t action = AMotionEvent_getAction(_event);
+
+ switch (action & AMOTION_EVENT_ACTION_MASK)
+ {
+ case AMOTION_EVENT_ACTION_SCROLL:
+ {
+ processScrollEvent(_event, states);
+ handled = 1;
+ break;
+ }
+
+ case AMOTION_EVENT_ACTION_HOVER_MOVE:
+ case AMOTION_EVENT_ACTION_MOVE:
+ {
+ processMotionEvent(_event, states);
+ handled = 1;
+ break;
+ }
+
+ // todo: investigate AMOTION_EVENT_OUTSIDE
+ case AMOTION_EVENT_ACTION_POINTER_DOWN:
+ case AMOTION_EVENT_ACTION_DOWN:
+ {
+ processPointerEvent(true, _event, states);
+ handled = 1;
+ break;
+ }
+
+ case AMOTION_EVENT_ACTION_POINTER_UP:
+ case AMOTION_EVENT_ACTION_UP:
+ case AMOTION_EVENT_ACTION_CANCEL:
+ {
+ processPointerEvent(false, _event, states);
+ handled = 1;
+ break;
+ }
+ }
+
+ }
+
+ AInputQueue_finishEvent(states->inputQueue, _event, handled);
+ }
+
+ return 1;
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates* states)
+{
+ // Prepare the Java virtual machine
+ jint lResult;
+ jint lFlags = 0;
+
+ JavaVM* lJavaVM = states->activity->vm;
+ JNIEnv* lJNIEnv = states->activity->env;
+
+ JavaVMAttachArgs lJavaVMAttachArgs;
+ lJavaVMAttachArgs.version = JNI_VERSION_1_6;
+ lJavaVMAttachArgs.name = "NativeThread";
+ lJavaVMAttachArgs.group = NULL;
+
+ lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs);
+
+ if (lResult == JNI_ERR)
+ err() << "Failed to initialize JNI, couldn't get the Unicode value" << std::endl;
+
+ // Retrieve everything we need to create this MotionEvent in Java
+ jlong downTime = AMotionEvent_getDownTime(_event);
+ jlong eventTime = AMotionEvent_getEventTime(_event);
+ jint action = AMotionEvent_getAction(_event);
+ jfloat x = AMotionEvent_getX(_event, 0);
+ jfloat y = AMotionEvent_getY(_event, 0);
+ jfloat pressure = AMotionEvent_getPressure(_event, 0);
+ jfloat size = AMotionEvent_getSize(_event, 0);
+ jint metaState = AMotionEvent_getMetaState(_event);
+ jfloat xPrecision = AMotionEvent_getXPrecision(_event);
+ jfloat yPrecision = AMotionEvent_getYPrecision(_event);
+ jint deviceId = AInputEvent_getDeviceId(_event);
+ jint edgeFlags = AMotionEvent_getEdgeFlags(_event);
+
+ // Create the MotionEvent object in Java trough its static constructor obtain()
+ jclass ClassMotionEvent = lJNIEnv->FindClass("android/view/MotionEvent");
+ jmethodID StaticMethodObtain = lJNIEnv->GetStaticMethodID(ClassMotionEvent, "obtain", "(JJIFFFFIFFII)Landroid/view/MotionEvent;");
+ jobject ObjectMotionEvent = lJNIEnv->CallStaticObjectMethod(ClassMotionEvent, StaticMethodObtain, downTime, eventTime, action, x, y, pressure, size, metaState, xPrecision, yPrecision, deviceId, edgeFlags);
+
+ // Call its getAxisValue() method to get the delta value of our wheel move event
+ jmethodID MethodGetAxisValue = lJNIEnv->GetMethodID(ClassMotionEvent, "getAxisValue", "(I)F");
+ jfloat delta = lJNIEnv->CallFloatMethod(ObjectMotionEvent, MethodGetAxisValue, 0x00000001);
+
+ // Create and send our mouse wheel event
+ Event event;
+ event.type = Event::MouseWheelMoved;
+ event.mouseWheel.delta = static_cast<double>(delta);
+ event.mouseWheel.x = AMotionEvent_getX(_event, 0);
+ event.mouseWheel.y = AMotionEvent_getY(_event, 0);
+
+ forwardEvent(event);
+
+ // Detach this thread from the JVM
+ lJavaVM->DetachCurrentThread();
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplAndroid::processKeyEvent(AInputEvent* _event, ActivityStates* states)
+{
+ int32_t device = AInputEvent_getSource(_event);
+ int32_t action = AKeyEvent_getAction(_event);
+
+ int32_t key = AKeyEvent_getKeyCode(_event);
+ int32_t metakey = AKeyEvent_getMetaState(_event);
+
+ Event event;
+ event.key.code = androidKeyToSF(key);
+ event.key.alt = metakey & AMETA_ALT_ON;
+ event.key.control = false;
+ event.key.shift = metakey & AMETA_SHIFT_ON;
+
+ switch (action)
+ {
+ case AKEY_EVENT_ACTION_DOWN:
+ event.type = Event::KeyPressed;
+ forwardEvent(event);
+ break;
+ case AKEY_EVENT_ACTION_UP:
+ event.type = Event::KeyReleased;
+ forwardEvent(event);
+
+ if (int unicode = getUnicode(_event))
+ {
+ event.type = Event::TextEntered;
+ event.text.unicode = unicode;
+ forwardEvent(event);
+ }
+ break;
+ case AKEY_EVENT_ACTION_MULTIPLE:
+ // Since complex inputs don't get separate key down/up events
+ // both have to be faked at once
+ event.type = Event::KeyPressed;
+ forwardEvent(event);
+ event.type = Event::KeyReleased;
+ forwardEvent(event);
+
+ // This requires some special treatment, since this might represent
+ // a repetition of key presses or a complete sequence
+ if (key == AKEYCODE_UNKNOWN)
+ {
+ // This is a unique sequence, which is not yet exposed in the NDK
+ // http://code.google.com/p/android/issues/detail?id=33998
+ }
+ else
+ {
+ // This is a repeated sequence
+ if (int unicode = getUnicode(_event))
+ {
+ event.type = Event::TextEntered;
+ event.text.unicode = unicode;
+
+ int32_t repeats = AKeyEvent_getRepeatCount(_event);
+ for (int32_t i = 0; i < repeats; ++i)
+ forwardEvent(event);
+ }
+ }
+ break;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplAndroid::processMotionEvent(AInputEvent* _event, ActivityStates* states)
+{
+ int32_t device = AInputEvent_getSource(_event);
+ int32_t action = AMotionEvent_getAction(_event);
+
+ Event event;
+
+ if (device == AINPUT_SOURCE_MOUSE)
+ event.type = Event::MouseMoved;
+ else if (device == AINPUT_SOURCE_TOUCHSCREEN)
+ event.type = Event::TouchMoved;
+
+ int pointerCount = AMotionEvent_getPointerCount(_event);
+
+ for (int p = 0; p < pointerCount; p++)
+ {
+ int id = AMotionEvent_getPointerId(_event, p);
+
+ float x = AMotionEvent_getX(_event, p);
+ float y = AMotionEvent_getY(_event, p);
+
+ if (device == AINPUT_SOURCE_MOUSE)
+ {
+ event.mouseMove.x = x;
+ event.mouseMove.y = y;
+
+ states->mousePosition = Vector2i(event.mouseMove.x, event.mouseMove.y);
+ }
+ else if (device == AINPUT_SOURCE_TOUCHSCREEN)
+ {
+ if (states->touchEvents[id].x == x && states->touchEvents[id].y == y)
+ continue;
+
+ event.touch.finger = id;
+ event.touch.x = x;
+ event.touch.y = y;
+
+ states->touchEvents[id] = Vector2i(event.touch.x, event.touch.y);
+ }
+
+ forwardEvent(event);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplAndroid::processPointerEvent(bool isDown, AInputEvent* _event, ActivityStates* states)
+{
+ int32_t device = AInputEvent_getSource(_event);
+ int32_t action = AMotionEvent_getAction(_event);
+
+ int index = (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT;
+ int id = AMotionEvent_getPointerId(_event, index);
+
+ float x = AMotionEvent_getX(_event, index);
+ float y = AMotionEvent_getY(_event, index);
+
+ Event event;
+
+ if (isDown)
+ {
+ if (device == AINPUT_SOURCE_MOUSE)
+ {
+ event.type = Event::MouseButtonPressed;
+ event.mouseButton.button = static_cast<Mouse::Button>(id);
+ event.mouseButton.x = x;
+ event.mouseButton.y = y;
+
+ if (id >= 0 && id < Mouse::ButtonCount)
+ states->isButtonPressed[id] = true;
+ }
+ else if (device == AINPUT_SOURCE_TOUCHSCREEN)
+ {
+ event.type = Event::TouchBegan;
+ event.touch.finger = id;
+ event.touch.x = x;
+ event.touch.y = y;
+
+ states->touchEvents[id] = Vector2i(event.touch.x, event.touch.y);
+ }
+ }
+ else
+ {
+ if (device == AINPUT_SOURCE_MOUSE)
+ {
+ event.type = Event::MouseButtonReleased;
+ event.mouseButton.button = static_cast<Mouse::Button>(id);
+ event.mouseButton.x = x;
+ event.mouseButton.y = y;
+
+ if (id >= 0 && id < Mouse::ButtonCount)
+ states->isButtonPressed[id] = false;
+ }
+ else if (device == AINPUT_SOURCE_TOUCHSCREEN)
+ {
+ event.type = Event::TouchEnded;
+ event.touch.finger = id;
+ event.touch.x = x;
+ event.touch.y = y;
+
+ states->touchEvents.erase(id);
+ }
+ }
+
+ forwardEvent(event);
+}
+
+
+////////////////////////////////////////////////////////////
+Keyboard::Key WindowImplAndroid::androidKeyToSF(int32_t key)
+{
+ switch (key)
+ {
+ case AKEYCODE_UNKNOWN:
+ case AKEYCODE_SOFT_LEFT:
+ case AKEYCODE_SOFT_RIGHT:
+ case AKEYCODE_HOME: return Keyboard::Unknown;
+ case AKEYCODE_BACK: return Keyboard::Escape;
+ case AKEYCODE_CALL:
+ case AKEYCODE_ENDCALL: return Keyboard::Unknown;
+ case AKEYCODE_0: return Keyboard::Num0;
+ case AKEYCODE_1: return Keyboard::Num1;
+ case AKEYCODE_2: return Keyboard::Num2;
+ case AKEYCODE_3: return Keyboard::Num3;
+ case AKEYCODE_4: return Keyboard::Num4;
+ case AKEYCODE_5: return Keyboard::Num5;
+ case AKEYCODE_6: return Keyboard::Num6;
+ case AKEYCODE_7: return Keyboard::Num7;
+ case AKEYCODE_8: return Keyboard::Num8;
+ case AKEYCODE_9: return Keyboard::Num9;
+ case AKEYCODE_STAR:
+ case AKEYCODE_POUND:
+ case AKEYCODE_DPAD_UP:
+ case AKEYCODE_DPAD_DOWN:
+ case AKEYCODE_DPAD_LEFT:
+ case AKEYCODE_DPAD_RIGHT:
+ case AKEYCODE_DPAD_CENTER:
+ case AKEYCODE_VOLUME_UP:
+ case AKEYCODE_VOLUME_DOWN:
+ case AKEYCODE_POWER:
+ case AKEYCODE_CAMERA:
+ case AKEYCODE_CLEAR: return Keyboard::Unknown;
+ case AKEYCODE_A: return Keyboard::A;
+ case AKEYCODE_B: return Keyboard::B;
+ case AKEYCODE_C: return Keyboard::C;
+ case AKEYCODE_D: return Keyboard::D;
+ case AKEYCODE_E: return Keyboard::E;
+ case AKEYCODE_F: return Keyboard::F;
+ case AKEYCODE_G: return Keyboard::G;
+ case AKEYCODE_H: return Keyboard::H;
+ case AKEYCODE_I: return Keyboard::I;
+ case AKEYCODE_J: return Keyboard::J;
+ case AKEYCODE_K: return Keyboard::K;
+ case AKEYCODE_L: return Keyboard::L;
+ case AKEYCODE_M: return Keyboard::M;
+ case AKEYCODE_N: return Keyboard::N;
+ case AKEYCODE_O: return Keyboard::O;
+ case AKEYCODE_P: return Keyboard::P;
+ case AKEYCODE_Q: return Keyboard::Q;
+ case AKEYCODE_R: return Keyboard::R;
+ case AKEYCODE_S: return Keyboard::S;
+ case AKEYCODE_T: return Keyboard::T;
+ case AKEYCODE_U: return Keyboard::U;
+ case AKEYCODE_V: return Keyboard::V;
+ case AKEYCODE_W: return Keyboard::W;
+ case AKEYCODE_X: return Keyboard::X;
+ case AKEYCODE_Y: return Keyboard::Y;
+ case AKEYCODE_Z: return Keyboard::Z;
+ case AKEYCODE_COMMA: return Keyboard::Comma;
+ case AKEYCODE_PERIOD: return Keyboard::Period;
+ case AKEYCODE_ALT_LEFT: return Keyboard::LAlt;
+ case AKEYCODE_ALT_RIGHT: return Keyboard::RAlt;
+ case AKEYCODE_SHIFT_LEFT: return Keyboard::LShift;
+ case AKEYCODE_SHIFT_RIGHT: return Keyboard::RShift;
+ case AKEYCODE_TAB: return Keyboard::Tab;
+ case AKEYCODE_SPACE: return Keyboard::Space;
+ case AKEYCODE_SYM:
+ case AKEYCODE_EXPLORER:
+ case AKEYCODE_ENVELOPE: return Keyboard::Unknown;
+ case AKEYCODE_ENTER: return Keyboard::Return;
+ case AKEYCODE_DEL: return Keyboard::Delete;
+ case AKEYCODE_GRAVE: return Keyboard::Tilde;
+ case AKEYCODE_MINUS: return Keyboard::Subtract;
+ case AKEYCODE_EQUALS: return Keyboard::Equal;
+ case AKEYCODE_LEFT_BRACKET: return Keyboard::LBracket;
+ case AKEYCODE_RIGHT_BRACKET: return Keyboard::RBracket;
+ case AKEYCODE_BACKSLASH: return Keyboard::BackSlash;
+ case AKEYCODE_SEMICOLON: return Keyboard::SemiColon;
+ case AKEYCODE_APOSTROPHE: return Keyboard::Quote;
+ case AKEYCODE_SLASH: return Keyboard::Slash;
+ case AKEYCODE_AT:
+ case AKEYCODE_NUM:
+ case AKEYCODE_HEADSETHOOK:
+ case AKEYCODE_FOCUS: // *Camera* focus
+ case AKEYCODE_PLUS:
+ case AKEYCODE_MENU:
+ case AKEYCODE_NOTIFICATION:
+ case AKEYCODE_SEARCH:
+ case AKEYCODE_MEDIA_PLAY_PAUSE:
+ case AKEYCODE_MEDIA_STOP:
+ case AKEYCODE_MEDIA_NEXT:
+ case AKEYCODE_MEDIA_PREVIOUS:
+ case AKEYCODE_MEDIA_REWIND:
+ case AKEYCODE_MEDIA_FAST_FORWARD:
+ case AKEYCODE_MUTE: return Keyboard::Unknown;
+ case AKEYCODE_PAGE_UP: return Keyboard::PageUp;
+ case AKEYCODE_PAGE_DOWN: return Keyboard::PageDown;
+ case AKEYCODE_PICTSYMBOLS:
+ case AKEYCODE_SWITCH_CHARSET:
+ case AKEYCODE_BUTTON_A:
+ case AKEYCODE_BUTTON_B:
+ case AKEYCODE_BUTTON_C:
+ case AKEYCODE_BUTTON_X:
+ case AKEYCODE_BUTTON_Y:
+ case AKEYCODE_BUTTON_Z:
+ case AKEYCODE_BUTTON_L1:
+ case AKEYCODE_BUTTON_R1:
+ case AKEYCODE_BUTTON_L2:
+ case AKEYCODE_BUTTON_R2:
+ case AKEYCODE_BUTTON_THUMBL:
+ case AKEYCODE_BUTTON_THUMBR:
+ case AKEYCODE_BUTTON_START:
+ case AKEYCODE_BUTTON_SELECT:
+ case AKEYCODE_BUTTON_MODE: return Keyboard::Unknown;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+int WindowImplAndroid::getUnicode(AInputEvent* event)
+{
+ // Retrieve activity states
+ ActivityStates* states = getActivity(NULL);
+ Lock lock(states->mutex);
+
+ // Initializes JNI
+ jint lResult;
+ jint lFlags = 0;
+
+ JavaVM* lJavaVM = states->activity->vm;
+ JNIEnv* lJNIEnv = states->activity->env;
+
+ JavaVMAttachArgs lJavaVMAttachArgs;
+ lJavaVMAttachArgs.version = JNI_VERSION_1_6;
+ lJavaVMAttachArgs.name = "NativeThread";
+ lJavaVMAttachArgs.group = NULL;
+
+ lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs);
+
+ if (lResult == JNI_ERR)
+ err() << "Failed to initialize JNI, couldn't get the Unicode value" << std::endl;
+
+ // Retrieve key data from the input event
+ jlong downTime = AKeyEvent_getDownTime(event);
+ jlong eventTime = AKeyEvent_getEventTime(event);
+ jint action = AKeyEvent_getAction(event);
+ jint code = AKeyEvent_getKeyCode(event);
+ jint repeat = AKeyEvent_getRepeatCount(event); // not sure!
+ jint metaState = AKeyEvent_getMetaState(event);
+ jint deviceId = AInputEvent_getDeviceId(event);
+ jint scancode = AKeyEvent_getScanCode(event);
+ jint flags = AKeyEvent_getFlags(event);
+ jint source = AInputEvent_getSource(event);
+
+ // Construct a KeyEvent object from the event data
+ jclass ClassKeyEvent = lJNIEnv->FindClass("android/view/KeyEvent");
+ jmethodID KeyEventConstructor = lJNIEnv->GetMethodID(ClassKeyEvent, "<init>", "(JJIIIIIIII)V");
+ jobject ObjectKeyEvent = lJNIEnv->NewObject(ClassKeyEvent, KeyEventConstructor, downTime, eventTime, action, code, repeat, metaState, deviceId, scancode, flags, source);
+
+ // Call its getUnicodeChar() method to get the Unicode value
+ jmethodID MethodGetUnicode = lJNIEnv->GetMethodID(ClassKeyEvent, "getUnicodeChar", "(I)I");
+ int unicode = lJNIEnv->CallIntMethod(ObjectKeyEvent, MethodGetUnicode, metaState);
+
+ // Detach this thread from the JVM
+ lJavaVM->DetachCurrentThread();
+
+ return unicode;
+}
+
+} // namespace priv
+} // namespace sf
diff --git a/src/SFML/Window/Android/WindowImplAndroid.hpp b/src/SFML/Window/Android/WindowImplAndroid.hpp
new file mode 100644
index 0000000..cdfb521
--- /dev/null
+++ b/src/SFML/Window/Android/WindowImplAndroid.hpp
@@ -0,0 +1,233 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_WINDOWIMPLANDROID_HPP
+#define SFML_WINDOWIMPLANDROID_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/Event.hpp>
+#include <SFML/Window/WindowImpl.hpp>
+#include <SFML/Window/EglContext.hpp>
+#include <SFML/System/Android/Activity.hpp>
+#include <android/input.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Android implementation of WindowImpl
+///
+////////////////////////////////////////////////////////////
+class WindowImplAndroid : public WindowImpl
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Construct the window implementation from an existing control
+ ///
+ /// \param handle Platform-specific handle of the control
+ ///
+ ////////////////////////////////////////////////////////////
+ WindowImplAndroid(WindowHandle handle);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create the window implementation
+ ///
+ /// \param mode Video mode to use
+ /// \param title Title of the window
+ /// \param style Window style (resizable, fixed, or fullscren)
+ /// \param settings Additional settings for the underlying OpenGL context
+ ///
+ ////////////////////////////////////////////////////////////
+ WindowImplAndroid(VideoMode mode, const String& title, unsigned long style, const ContextSettings& settings);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~WindowImplAndroid();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the OS-specific handle of the window
+ ///
+ /// \return Handle of the window
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual WindowHandle getSystemHandle() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the position of the window
+ ///
+ /// \return Position of the window, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Vector2i getPosition() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the position of the window on screen
+ ///
+ /// \param position New position of the window, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setPosition(const Vector2i& position);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the client size of the window
+ ///
+ /// \return Size of the window, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Vector2u getSize() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the size of the rendering region of the window
+ ///
+ /// \param size New size, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setSize(const Vector2u& size);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the title of the window
+ ///
+ /// \param title New title
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setTitle(const String& title);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the window's icon
+ ///
+ /// \param width Icon's width, in pixels
+ /// \param height Icon's height, in pixels
+ /// \param pixels Pointer to the pixels in memory, format must be RGBA 32 bits
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setIcon(unsigned int width, unsigned int height, const Uint8* pixels);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Show or hide the window
+ ///
+ /// \param visible True to show, false to hide
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setVisible(bool visible);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Show or hide the mouse cursor
+ ///
+ /// \param visible True to show, false to hide
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setMouseCursorVisible(bool visible);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Enable or disable automatic key-repeat
+ ///
+ /// \param enabled True to enable, false to disable
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setKeyRepeatEnabled(bool enabled);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Request the current window to be made the active
+ /// foreground window
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void requestFocus();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check whether the window has the input focus
+ ///
+ /// \return True if window has focus, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool hasFocus() const;
+
+ static void forwardEvent(const Event& event);
+ static WindowImplAndroid* singleInstance;
+
+protected:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Process incoming events from the operating system
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void processEvents();
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Process messages from the looper associated with the main thread
+ ///
+ /// \param fd File descriptor
+ /// \param events Bitmask of the poll events that were triggered
+ /// \param data Data pointer supplied
+ ///
+ /// \return Whether it should continue (1) or unregister the callback (0)
+ ///
+ ////////////////////////////////////////////////////////////
+ static int processEvent(int fd, int events, void* data);
+
+ static void processScrollEvent(AInputEvent* _event, ActivityStates* states);
+ static void processKeyEvent(AInputEvent* _event, ActivityStates* states);
+ static void processMotionEvent(AInputEvent* _event, ActivityStates* states);
+ static void processPointerEvent(bool isDown, AInputEvent* event, ActivityStates* states);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert a Android key to SFML key code
+ ///
+ /// \param symbol Android key to convert
+ ///
+ /// \return Corresponding SFML key code
+ ///
+ ////////////////////////////////////////////////////////////
+ static Keyboard::Key androidKeyToSF(int32_t key);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get Unicode decoded from the input event
+ ///
+ /// \param Event Input event
+ ///
+ /// \return The Unicode value
+ ///
+ ////////////////////////////////////////////////////////////
+ static int getUnicode(AInputEvent* event);
+
+ Vector2u m_size;
+ bool m_windowBeingCreated;
+ bool m_windowBeingDestroyed;
+ bool m_hasFocus;
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_WINDOWIMPLANDROID_HPP
diff --git a/src/SFML/Window/CMakeLists.txt b/src/SFML/Window/CMakeLists.txt
index b1d9aca..3046fec 100644
--- a/src/SFML/Window/CMakeLists.txt
+++ b/src/SFML/Window/CMakeLists.txt
@@ -1,132 +1,247 @@
-
-set(INCROOT ${PROJECT_SOURCE_DIR}/include/SFML/Window)
-set(SRCROOT ${PROJECT_SOURCE_DIR}/src/SFML/Window)
-
-# all source files
-set(SRC
- ${SRCROOT}/Context.cpp
- ${INCROOT}/Context.hpp
- ${INCROOT}/Export.hpp
- ${SRCROOT}/GlContext.cpp
- ${SRCROOT}/GlContext.hpp
- ${SRCROOT}/GlResource.cpp
- ${INCROOT}/GlResource.hpp
- ${INCROOT}/ContextSettings.hpp
- ${INCROOT}/Event.hpp
- ${SRCROOT}/InputImpl.hpp
- ${INCROOT}/Joystick.hpp
- ${SRCROOT}/Joystick.cpp
- ${SRCROOT}/JoystickImpl.hpp
- ${SRCROOT}/JoystickManager.cpp
- ${SRCROOT}/JoystickManager.hpp
- ${INCROOT}/Keyboard.hpp
- ${SRCROOT}/Keyboard.cpp
- ${INCROOT}/Mouse.hpp
- ${SRCROOT}/Mouse.cpp
- ${SRCROOT}/VideoMode.cpp
- ${INCROOT}/VideoMode.hpp
- ${SRCROOT}/VideoModeImpl.hpp
- ${SRCROOT}/Window.cpp
- ${INCROOT}/Window.hpp
- ${INCROOT}/WindowHandle.hpp
- ${SRCROOT}/WindowImpl.cpp
- ${SRCROOT}/WindowImpl.hpp
- ${INCROOT}/WindowStyle.hpp
-)
-source_group("" FILES ${SRC})
-
-# add platform specific sources
-if(WINDOWS)
- set(PLATFORM_SRC
- ${SRCROOT}/Win32/WglContext.cpp
- ${SRCROOT}/Win32/WglContext.hpp
- ${SRCROOT}/Win32/InputImpl.cpp
- ${SRCROOT}/Win32/InputImpl.hpp
- ${SRCROOT}/Win32/JoystickImpl.cpp
- ${SRCROOT}/Win32/JoystickImpl.hpp
- ${SRCROOT}/Win32/VideoModeImpl.cpp
- ${SRCROOT}/Win32/WindowImplWin32.cpp
- ${SRCROOT}/Win32/WindowImplWin32.hpp
- )
- source_group("windows" FILES ${PLATFORM_SRC})
-elseif(LINUX)
- set(PLATFORM_SRC
- ${SRCROOT}/Linux/Display.cpp
- ${SRCROOT}/Linux/Display.hpp
- ${SRCROOT}/Linux/GlxContext.cpp
- ${SRCROOT}/Linux/GlxContext.hpp
- ${SRCROOT}/Linux/InputImpl.cpp
- ${SRCROOT}/Linux/InputImpl.hpp
- ${SRCROOT}/Linux/JoystickImpl.cpp
- ${SRCROOT}/Linux/JoystickImpl.hpp
- ${SRCROOT}/Linux/VideoModeImpl.cpp
- ${SRCROOT}/Linux/WindowImplX11.cpp
- ${SRCROOT}/Linux/WindowImplX11.hpp
- )
- source_group("linux" FILES ${PLATFORM_SRC})
-else() # MACOSX
- set(PLATFORM_SRC
- ${SRCROOT}/OSX/cpp_objc_conversion.h
- ${SRCROOT}/OSX/cpp_objc_conversion.mm
- ${SRCROOT}/OSX/cg_sf_conversion.hpp
- ${SRCROOT}/OSX/cg_sf_conversion.cpp
- ${SRCROOT}/OSX/InputImpl.mm
- ${SRCROOT}/OSX/InputImpl.hpp
- ${SRCROOT}/OSX/HIDInputManager.hpp
- ${SRCROOT}/OSX/HIDInputManager.mm
- ${SRCROOT}/OSX/HIDJoystickManager.hpp
- ${SRCROOT}/OSX/HIDJoystickManager.cpp
- ${SRCROOT}/OSX/JoystickImpl.cpp
- ${SRCROOT}/OSX/JoystickImpl.hpp
- ${SRCROOT}/OSX/SFApplication.h
- ${SRCROOT}/OSX/SFApplication.m
- ${SRCROOT}/OSX/SFContext.hpp
- ${SRCROOT}/OSX/SFContext.mm
- ${SRCROOT}/OSX/SFKeyboardModifiersHelper.h
- ${SRCROOT}/OSX/SFKeyboardModifiersHelper.mm
- ${SRCROOT}/OSX/SFOpenGLView.h
+
+set(INCROOT ${PROJECT_SOURCE_DIR}/include/SFML/Window)
+set(SRCROOT ${PROJECT_SOURCE_DIR}/src/SFML/Window)
+
+# all source files
+set(SRC
+ ${SRCROOT}/Context.cpp
+ ${INCROOT}/Context.hpp
+ ${INCROOT}/Export.hpp
+ ${SRCROOT}/GlContext.cpp
+ ${SRCROOT}/GlContext.hpp
+ ${SRCROOT}/GlResource.cpp
+ ${INCROOT}/GlResource.hpp
+ ${INCROOT}/ContextSettings.hpp
+ ${INCROOT}/Event.hpp
+ ${SRCROOT}/InputImpl.hpp
+ ${INCROOT}/Joystick.hpp
+ ${SRCROOT}/Joystick.cpp
+ ${SRCROOT}/JoystickImpl.hpp
+ ${SRCROOT}/JoystickManager.cpp
+ ${SRCROOT}/JoystickManager.hpp
+ ${INCROOT}/Keyboard.hpp
+ ${SRCROOT}/Keyboard.cpp
+ ${INCROOT}/Mouse.hpp
+ ${SRCROOT}/Mouse.cpp
+ ${INCROOT}/Touch.hpp
+ ${SRCROOT}/Touch.cpp
+ ${INCROOT}/Sensor.hpp
+ ${SRCROOT}/Sensor.cpp
+ ${SRCROOT}/SensorImpl.hpp
+ ${SRCROOT}/SensorManager.cpp
+ ${SRCROOT}/SensorManager.hpp
+ ${SRCROOT}/VideoMode.cpp
+ ${INCROOT}/VideoMode.hpp
+ ${SRCROOT}/VideoModeImpl.hpp
+ ${SRCROOT}/Window.cpp
+ ${INCROOT}/Window.hpp
+ ${INCROOT}/WindowHandle.hpp
+ ${SRCROOT}/WindowImpl.cpp
+ ${SRCROOT}/WindowImpl.hpp
+ ${INCROOT}/WindowStyle.hpp
+)
+if(SFML_OPENGL_ES AND NOT SFML_OS_IOS)
+ list(APPEND SRC ${SRCROOT}/EGLCheck.cpp)
+ list(APPEND SRC ${SRCROOT}/EGLCheck.hpp)
+ list(APPEND SRC ${SRCROOT}/EglContext.cpp)
+ list(APPEND SRC ${SRCROOT}/EglContext.hpp)
+endif()
+source_group("" FILES ${SRC})
+
+# add platform specific sources
+if(SFML_OS_WINDOWS)
+ set(PLATFORM_SRC
+ ${SRCROOT}/Win32/WglContext.cpp
+ ${SRCROOT}/Win32/WglContext.hpp
+ ${SRCROOT}/Win32/InputImpl.cpp
+ ${SRCROOT}/Win32/InputImpl.hpp
+ ${SRCROOT}/Win32/JoystickImpl.cpp
+ ${SRCROOT}/Win32/JoystickImpl.hpp
+ ${SRCROOT}/Win32/SensorImpl.hpp
+ ${SRCROOT}/Win32/SensorImpl.cpp
+ ${SRCROOT}/Win32/VideoModeImpl.cpp
+ ${SRCROOT}/Win32/WindowImplWin32.cpp
+ ${SRCROOT}/Win32/WindowImplWin32.hpp
+ )
+ source_group("windows" FILES ${PLATFORM_SRC})
+
+ # make sure that we use the Unicode version of the Win API functions
+ add_definitions(-DUNICODE -D_UNICODE)
+elseif(SFML_OS_LINUX OR SFML_OS_FREEBSD)
+ set(PLATFORM_SRC
+ ${SRCROOT}/Unix/Display.cpp
+ ${SRCROOT}/Unix/Display.hpp
+ ${SRCROOT}/Unix/InputImpl.cpp
+ ${SRCROOT}/Unix/InputImpl.hpp
+ ${SRCROOT}/Unix/SensorImpl.cpp
+ ${SRCROOT}/Unix/SensorImpl.hpp
+ ${SRCROOT}/Unix/VideoModeImpl.cpp
+ ${SRCROOT}/Unix/WindowImplX11.cpp
+ ${SRCROOT}/Unix/WindowImplX11.hpp
+ )
+ if(NOT SFML_OPENGL_ES)
+ set(PLATFORM_SRC
+ ${PLATFORM_SRC}
+ ${SRCROOT}/Unix/GlxContext.cpp
+ ${SRCROOT}/Unix/GlxContext.hpp
+ )
+ endif()
+ if(SFML_OS_LINUX)
+ set(PLATFORM_SRC
+ ${PLATFORM_SRC}
+ ${SRCROOT}/Unix/JoystickImpl.cpp
+ ${SRCROOT}/Unix/JoystickImpl.hpp
+ )
+ elseif(SFML_OS_FREEBSD)
+ set(PLATFORM_SRC
+ ${PLATFORM_SRC}
+ ${SRCROOT}/FreeBSD/JoystickImpl.cpp
+ ${SRCROOT}/FreeBSD/JoystickImpl.hpp
+ )
+ endif()
+ source_group("unix" FILES ${PLATFORM_SRC})
+elseif(SFML_OS_MACOSX)
+ set(PLATFORM_SRC
+ ${SRCROOT}/OSX/cpp_objc_conversion.h
+ ${SRCROOT}/OSX/cpp_objc_conversion.mm
+ ${SRCROOT}/OSX/cg_sf_conversion.hpp
+ ${SRCROOT}/OSX/cg_sf_conversion.cpp
+ ${SRCROOT}/OSX/InputImpl.mm
+ ${SRCROOT}/OSX/InputImpl.hpp
+ ${SRCROOT}/OSX/HIDInputManager.hpp
+ ${SRCROOT}/OSX/HIDInputManager.mm
+ ${SRCROOT}/OSX/HIDJoystickManager.hpp
+ ${SRCROOT}/OSX/HIDJoystickManager.cpp
+ ${SRCROOT}/OSX/JoystickImpl.cpp
+ ${SRCROOT}/OSX/JoystickImpl.hpp
+ ${SRCROOT}/OSX/SensorImpl.cpp
+ ${SRCROOT}/OSX/SensorImpl.hpp
+ ${SRCROOT}/OSX/SFApplication.h
+ ${SRCROOT}/OSX/SFApplication.m
+ ${SRCROOT}/OSX/SFApplicationDelegate.h
+ ${SRCROOT}/OSX/SFApplicationDelegate.m
+ ${SRCROOT}/OSX/SFContext.hpp
+ ${SRCROOT}/OSX/SFContext.mm
+ ${SRCROOT}/OSX/SFKeyboardModifiersHelper.h
+ ${SRCROOT}/OSX/SFKeyboardModifiersHelper.mm
+ ${SRCROOT}/OSX/SFOpenGLView.h
${SRCROOT}/OSX/SFOpenGLView.mm
${SRCROOT}/OSX/SFSilentResponder.h
- ${SRCROOT}/OSX/SFSilentResponder.m
- ${SRCROOT}/OSX/SFWindow.h
- ${SRCROOT}/OSX/SFWindow.m
- ${SRCROOT}/OSX/SFWindowController.h
- ${SRCROOT}/OSX/SFWindowController.mm
- ${SRCROOT}/OSX/SFViewController.h
- ${SRCROOT}/OSX/SFViewController.mm
- ${SRCROOT}/OSX/VideoModeImpl.cpp
- ${SRCROOT}/OSX/WindowImplCocoa.hpp
- ${SRCROOT}/OSX/WindowImplCocoa.mm
- ${SRCROOT}/OSX/WindowImplDelegateProtocol.h
- ${SRCROOT}/OSX/AutoreleasePoolWrapper.h
- ${SRCROOT}/OSX/AutoreleasePoolWrapper.mm
- )
- source_group("mac" FILES ${PLATFORM_SRC})
-endif()
-
-# find external libraries
-find_package(OpenGL REQUIRED)
-include_directories(${OPENGL_INCLUDE_DIR})
-if(LINUX)
- find_package(X11 REQUIRED)
- if(NOT X11_Xrandr_FOUND)
- message(FATAL_ERROR "Xrandr library not found")
- endif()
- include_directories(${X11_INCLUDE_DIR})
-endif()
-
-# build the list of external libraries to link
-set(WINDOW_EXT_LIBS ${OPENGL_gl_LIBRARY})
-if(WINDOWS)
- set(WINDOW_EXT_LIBS ${WINDOW_EXT_LIBS} winmm gdi32)
-elseif(LINUX)
- set(WINDOW_EXT_LIBS ${WINDOW_EXT_LIBS} ${X11_X11_LIB} ${X11_Xrandr_LIB})
-elseif(MACOSX)
- set(WINDOW_EXT_LIBS ${WINDOW_EXT_LIBS} "-framework Foundation -framework AppKit -framework IOKit -framework Carbon")
-endif()
-
-# define the sfml-window target
-sfml_add_library(sfml-window
- SOURCES ${SRC} ${PLATFORM_SRC}
- DEPENDS sfml-system
- EXTERNAL_LIBS ${WINDOW_EXT_LIBS})
+ ${SRCROOT}/OSX/SFSilentResponder.m
+ ${SRCROOT}/OSX/SFWindow.h
+ ${SRCROOT}/OSX/SFWindow.m
+ ${SRCROOT}/OSX/SFWindowController.h
+ ${SRCROOT}/OSX/SFWindowController.mm
+ ${SRCROOT}/OSX/SFViewController.h
+ ${SRCROOT}/OSX/SFViewController.mm
+ ${SRCROOT}/OSX/VideoModeImpl.cpp
+ ${SRCROOT}/OSX/WindowImplCocoa.hpp
+ ${SRCROOT}/OSX/WindowImplCocoa.mm
+ ${SRCROOT}/OSX/WindowImplDelegateProtocol.h
+ ${SRCROOT}/OSX/AutoreleasePoolWrapper.h
+ ${SRCROOT}/OSX/AutoreleasePoolWrapper.mm
+ )
+ source_group("mac" FILES ${PLATFORM_SRC})
+elseif(SFML_OS_IOS)
+ set(PLATFORM_SRC
+ ${SRCROOT}/iOS/EaglContext.mm
+ ${SRCROOT}/iOS/EaglContext.hpp
+ ${SRCROOT}/iOS/InputImpl.mm
+ ${SRCROOT}/iOS/InputImpl.hpp
+ ${SRCROOT}/iOS/JoystickImpl.mm
+ ${SRCROOT}/iOS/JoystickImpl.hpp
+ ${SRCROOT}/iOS/SensorImpl.mm
+ ${SRCROOT}/iOS/SensorImpl.hpp
+ ${SRCROOT}/iOS/VideoModeImpl.mm
+ ${SRCROOT}/iOS/WindowImplUIKit.hpp
+ ${SRCROOT}/iOS/WindowImplUIKit.mm
+ ${SRCROOT}/iOS/ObjCType.hpp
+ ${SRCROOT}/iOS/SFAppDelegate.hpp
+ ${SRCROOT}/iOS/SFAppDelegate.mm
+ ${SRCROOT}/iOS/SFView.hpp
+ ${SRCROOT}/iOS/SFView.mm
+ ${SRCROOT}/iOS/SFViewController.hpp
+ ${SRCROOT}/iOS/SFViewController.mm
+ ${SRCROOT}/iOS/SFMain.hpp
+ ${SRCROOT}/iOS/SFMain.mm
+ )
+ source_group("ios" FILES ${PLATFORM_SRC})
+elseif(SFML_OS_ANDROID)
+ set(PLATFORM_SRC
+ ${SRCROOT}/Android/WindowImplAndroid.hpp
+ ${SRCROOT}/Android/WindowImplAndroid.cpp
+ ${SRCROOT}/Android/VideoModeImpl.cpp
+ ${SRCROOT}/Android/InputImpl.hpp
+ ${SRCROOT}/Android/InputImpl.cpp
+ ${SRCROOT}/Android/JoystickImpl.hpp
+ ${SRCROOT}/Android/JoystickImpl.cpp
+ ${SRCROOT}/Android/SensorImpl.hpp
+ ${SRCROOT}/Android/SensorImpl.cpp
+ )
+ source_group("android" FILES ${PLATFORM_SRC})
+endif()
+
+# find external libraries
+if(SFML_OS_LINUX OR SFML_OS_FREEBSD)
+ find_package(X11 REQUIRED)
+ if(NOT X11_Xrandr_FOUND)
+ message(FATAL_ERROR "Xrandr library not found")
+ endif()
+ include_directories(${X11_INCLUDE_DIR})
+endif()
+if(NOT SFML_OPENGL_ES)
+ find_package(OpenGL REQUIRED)
+ include_directories(${OPENGL_INCLUDE_DIR})
+ if(SFML_OS_LINUX OR SFML_OS_FREEBSD)
+ find_package(X11 REQUIRED)
+ if(NOT X11_Xrandr_FOUND)
+ message(FATAL_ERROR "Xrandr library not found")
+ endif()
+ include_directories(${X11_INCLUDE_DIR})
+ endif()
+endif()
+if(SFML_OPENGL_ES AND SFML_OS_LINUX)
+ find_package(EGL REQUIRED)
+ find_package(GLES REQUIRED)
+ include_directories(${EGL_INCLUDE_DIR} ${GLES_INCLUDE_DIR})
+endif()
+if(SFML_OS_LINUX)
+ find_package(UDev REQUIRED)
+ if(NOT UDEV_FOUND)
+ message(FATAL_ERROR "udev library not found")
+ endif()
+ include_directories(${UDEV_INCLUDE_DIR})
+endif()
+
+
+# build the list of external libraries to link
+if(SFML_OS_WINDOWS)
+ list(APPEND WINDOW_EXT_LIBS winmm gdi32)
+elseif(SFML_OS_LINUX)
+ list(APPEND WINDOW_EXT_LIBS ${X11_X11_LIB} ${X11_Xrandr_LIB} ${UDEV_LIBRARIES})
+elseif(SFML_OS_FREEBSD)
+ list(APPEND WINDOW_EXT_LIBS ${X11_X11_LIB} ${X11_Xrandr_LIB} usbhid)
+elseif(SFML_OS_MACOSX)
+ list(APPEND WINDOW_EXT_LIBS "-framework Foundation -framework AppKit -framework IOKit -framework Carbon")
+elseif(SFML_OS_IOS)
+ list(APPEND WINDOW_EXT_LIBS "-framework Foundation -framework UIKit -framework CoreGraphics -framework QuartzCore -framework CoreMotion")
+elseif(SFML_OS_ANDROID)
+ list(APPEND WINDOW_EXT_LIBS "-landroid")
+endif()
+if(SFML_OPENGL_ES)
+ if(SFML_OS_LINUX)
+ list(APPEND WINDOW_EXT_LIBS ${EGL_LIBRARY} ${GLES_LIBRARY})
+ elseif(SFML_OS_IOS)
+ list(APPEND WINDOW_EXT_LIBS "-framework OpenGLES")
+ elseif(SFML_OS_ANDROID)
+ list(APPEND WINDOW_EXT_LIBS "-lEGL -lGLESv1_CM")
+ endif()
+else()
+ list(APPEND WINDOW_EXT_LIBS ${OPENGL_gl_LIBRARY})
+endif()
+
+# define the sfml-window target
+sfml_add_library(sfml-window
+ SOURCES ${SRC} ${PLATFORM_SRC}
+ DEPENDS sfml-system
+ EXTERNAL_LIBS ${WINDOW_EXT_LIBS})
diff --git a/src/SFML/Window/Context.cpp b/src/SFML/Window/Context.cpp
index 6b6bb6b..fc6cb55 100644
--- a/src/SFML/Window/Context.cpp
+++ b/src/SFML/Window/Context.cpp
@@ -1,63 +1,63 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Window/Context.hpp>
-#include <SFML/Window/GlContext.hpp>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-Context::Context()
-{
- m_context = priv::GlContext::create();
- setActive(true);
-}
-
-
-////////////////////////////////////////////////////////////
-Context::~Context()
-{
- delete m_context;
-}
-
-
-////////////////////////////////////////////////////////////
-bool Context::setActive(bool active)
-{
- return m_context->setActive(active);
-}
-
-
-////////////////////////////////////////////////////////////
-Context::Context(const ContextSettings& settings, unsigned int width, unsigned int height)
-{
- m_context = priv::GlContext::create(settings, width, height);
- setActive(true);
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/Context.hpp>
+#include <SFML/Window/GlContext.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Context::Context()
+{
+ m_context = priv::GlContext::create();
+ setActive(true);
+}
+
+
+////////////////////////////////////////////////////////////
+Context::~Context()
+{
+ delete m_context;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Context::setActive(bool active)
+{
+ return m_context->setActive(active);
+}
+
+
+////////////////////////////////////////////////////////////
+Context::Context(const ContextSettings& settings, unsigned int width, unsigned int height)
+{
+ m_context = priv::GlContext::create(settings, width, height);
+ setActive(true);
+}
+
+} // namespace sf
diff --git a/src/SFML/Window/EGLCheck.cpp b/src/SFML/Window/EGLCheck.cpp
new file mode 100644
index 0000000..dabf54e
--- /dev/null
+++ b/src/SFML/Window/EGLCheck.cpp
@@ -0,0 +1,161 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/EGLCheck.hpp>
+#include <SFML/System/Err.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+void eglCheckError(const char* file, unsigned int line)
+{
+ // Obtain information about the success or failure of the most recent EGL
+ // function called in the current thread
+ EGLint errorCode = eglGetError();
+
+ if (errorCode != EGL_SUCCESS)
+ {
+ std::string fileString(file);
+ std::string error = "unknown error";
+ std::string description = "no description";
+
+ // Decode the error code returned
+ switch (errorCode)
+ {
+ case EGL_NOT_INITIALIZED:
+ {
+ error = "EGL_NOT_INITIALIZED";
+ description = "EGL is not initialized, or could not be initialized, for the specified display";
+ break;
+ }
+
+ case EGL_BAD_ACCESS:
+ {
+ error = "EGL_BAD_ACCESS";
+ description = "EGL cannot access a requested resource (for example, a context is bound in another thread)";
+ break;
+ }
+
+ case EGL_BAD_ALLOC:
+ {
+ error = "EGL_BAD_ALLOC";
+ description = "EGL failed to allocate resources for the requested operation";
+ break;
+ }
+ case EGL_BAD_ATTRIBUTE:
+ {
+ error = "EGL_BAD_ATTRIBUTE";
+ description = "an unrecognized attribute or attribute value was passed in an attribute list";
+ break;
+ }
+
+ case EGL_BAD_CONTEXT:
+ {
+ error = "EGL_BAD_CONTEXT";
+ description = "an EGLContext argument does not name a valid EGLContext";
+ break;
+ }
+
+ case EGL_BAD_CONFIG:
+ {
+ error = "EGL_BAD_CONFIG";
+ description = "an EGLConfig argument does not name a valid EGLConfig";
+ break;
+ }
+
+ case EGL_BAD_CURRENT_SURFACE:
+ {
+ error = "EGL_BAD_CURRENT_SURFACE";
+ description = "the current surface of the calling thread is a window, pbuffer, or pixmap that is no longer valid";
+ break;
+ }
+
+ case EGL_BAD_DISPLAY:
+ {
+ error = "EGL_BAD_DISPLAY";
+ description = "an EGLDisplay argument does not name a valid EGLDisplay; or, EGL is not initialized on the specified EGLDisplay";
+ break;
+ }
+
+
+ case EGL_BAD_SURFACE:
+ {
+ error = "EGL_BAD_SURFACE";
+ description = "an EGLSurface argument does not name a valid surface (window, pbuffer, or pixmap) configured for rendering";
+ break;
+ }
+
+ case EGL_BAD_MATCH:
+ {
+ error = "EGL_BAD_MATCH";
+ description = "arguments are inconsistent; for example, an otherwise valid context requires buffers (e.g. depth or stencil) not allocated by an otherwise valid surface";
+ break;
+ }
+
+ case EGL_BAD_PARAMETER:
+ {
+ error = "EGL_BAD_PARAMETER";
+ description = "one or more argument values are invalid";
+ break;
+ }
+
+ case EGL_BAD_NATIVE_PIXMAP:
+ {
+ error = "EGL_BAD_NATIVE_PIXMAP";
+ description = "an EGLNativePixmapType argument does not refer to a valid native pixmap";
+ break;
+ }
+
+ case EGL_BAD_NATIVE_WINDOW:
+ {
+ error = "EGL_BAD_NATIVE_WINDOW";
+ description = "an EGLNativeWindowType argument does not refer to a valid native window";
+ break;
+ }
+
+ case EGL_CONTEXT_LOST:
+ {
+ error = "EGL_CONTEXT_LOST";
+ description = "a power management event has occurred. The application must destroy all contexts and reinitialize client API state and objects to continue rendering";
+ break;
+ }
+ }
+
+ // Log the error
+ err() << "An internal EGL call failed in "
+ << fileString.substr(fileString.find_last_of("\\/") + 1) << " (" << line << ") : "
+ << error << ", " << description
+ << std::endl;
+ }
+}
+
+} // namespace priv
+} // namespace sf
diff --git a/src/SFML/Window/EGLCheck.hpp b/src/SFML/Window/EGLCheck.hpp
new file mode 100644
index 0000000..317d9a8
--- /dev/null
+++ b/src/SFML/Window/EGLCheck.hpp
@@ -0,0 +1,68 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_EGLCHECK_HPP
+#define SFML_EGLCHECK_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <EGL/egl.h>
+#include <string>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// Let's define a macro to quickly check every EGL API call
+////////////////////////////////////////////////////////////
+#ifdef SFML_DEBUG
+
+ //// In debug mode, perform a test on every EGL call
+ #define eglCheck(x) x; sf::priv::eglCheckError(__FILE__, __LINE__);
+
+#else
+
+ // Else, we don't add any overhead
+ #define eglCheck(x) (x)
+
+#endif
+
+////////////////////////////////////////////////////////////
+/// \brief Check the last EGL error
+///
+/// \param file Source file where the call is located
+/// \param line Line number of the source file where the call is located
+///
+////////////////////////////////////////////////////////////
+void eglCheckError(const char* file, unsigned int line);
+
+} // namespace priv
+} // namespace sf
+
+
+#endif // SFML_EGLCHECK_HPP
diff --git a/src/SFML/Window/EglContext.cpp b/src/SFML/Window/EglContext.cpp
new file mode 100644
index 0000000..b4182dd
--- /dev/null
+++ b/src/SFML/Window/EglContext.cpp
@@ -0,0 +1,307 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/EglContext.hpp>
+#include <SFML/Window/WindowImpl.hpp>
+#include <SFML/OpenGL.hpp>
+#include <SFML/System/Err.hpp>
+#include <SFML/System/Sleep.hpp>
+#include <SFML/System/Mutex.hpp>
+#include <SFML/System/Lock.hpp>
+#ifdef SFML_SYSTEM_ANDROID
+ #include <SFML/System/Android/Activity.hpp>
+#endif
+#ifdef SFML_SYSTEM_LINUX
+ #include <X11/Xlib.h>
+#endif
+
+namespace
+{
+ EGLDisplay getInitializedDisplay()
+ {
+#if defined(SFML_SYSTEM_LINUX)
+
+ static EGLDisplay display = EGL_NO_DISPLAY;
+
+ if (display == EGL_NO_DISPLAY)
+ {
+ display = eglCheck(eglGetDisplay(EGL_DEFAULT_DISPLAY));
+ eglCheck(eglInitialize(display, NULL, NULL));
+ }
+
+ return display;
+
+#elif defined(SFML_SYSTEM_ANDROID)
+
+ // On Android, its native activity handles this for us
+ sf::priv::ActivityStates* states = sf::priv::getActivity(NULL);
+ sf::Lock lock(states->mutex);
+
+ return states->display;
+
+#endif
+ }
+}
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+EglContext::EglContext(EglContext* shared) :
+m_display (EGL_NO_DISPLAY),
+m_context (EGL_NO_CONTEXT),
+m_surface (EGL_NO_SURFACE),
+m_config (NULL)
+{
+ // Get the initialized EGL display
+ m_display = getInitializedDisplay();
+
+ // Get the best EGL config matching the default video settings
+ m_config = getBestConfig(m_display, VideoMode::getDesktopMode().bitsPerPixel, ContextSettings());
+
+ // Note: The EGL specs say that attrib_list can be NULL when passed to eglCreatePbufferSurface,
+ // but this is resulting in a segfault. Bug in Android?
+ EGLint attrib_list[] = {
+ EGL_WIDTH, 1,
+ EGL_HEIGHT,1,
+ EGL_NONE
+ };
+
+ m_surface = eglCheck(eglCreatePbufferSurface(m_display, m_config, attrib_list));
+
+ // Create EGL context
+ createContext(shared);
+}
+
+
+////////////////////////////////////////////////////////////
+EglContext::EglContext(EglContext* shared, const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel) :
+m_display (EGL_NO_DISPLAY),
+m_context (EGL_NO_CONTEXT),
+m_surface (EGL_NO_SURFACE),
+m_config (NULL)
+{
+#ifdef SFML_SYSTEM_ANDROID
+
+ // On Android, we must save the created context
+ ActivityStates* states = getActivity(NULL);
+ Lock lock(states->mutex);
+
+ states->context = this;
+
+#endif
+
+ // Get the initialized EGL display
+ m_display = getInitializedDisplay();
+
+ // Get the best EGL config matching the requested video settings
+ m_config = getBestConfig(m_display, bitsPerPixel, settings);
+
+ // Create EGL context
+ createContext(shared);
+
+#if !defined(SFML_SYSTEM_ANDROID)
+ // Create EGL surface (except on Android because the window is created
+ // asynchronously, its activity manager will call it for us)
+ createSurface((EGLNativeWindowType)owner->getSystemHandle());
+#endif
+}
+
+
+////////////////////////////////////////////////////////////
+EglContext::EglContext(EglContext* shared, const ContextSettings& settings, unsigned int width, unsigned int height) :
+m_display (EGL_NO_DISPLAY),
+m_context (EGL_NO_CONTEXT),
+m_surface (EGL_NO_SURFACE),
+m_config (NULL)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+EglContext::~EglContext()
+{
+ // Deactivate the current context
+ EGLContext currentContext = eglCheck(eglGetCurrentContext());
+
+ if (currentContext == m_context)
+ {
+ eglCheck(eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT));
+ }
+
+ // Destroy context
+ if (m_context != EGL_NO_CONTEXT)
+ {
+ eglCheck(eglDestroyContext(m_display, m_context));
+ }
+
+ // Destroy surface
+ if (m_surface != EGL_NO_SURFACE)
+ {
+ eglCheck(eglDestroySurface(m_display, m_surface));
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+bool EglContext::makeCurrent()
+{
+ return m_surface != EGL_NO_SURFACE && eglCheck(eglMakeCurrent(m_display, m_surface, m_surface, m_context));
+}
+
+
+////////////////////////////////////////////////////////////
+void EglContext::display()
+{
+ if (m_surface != EGL_NO_SURFACE)
+ eglCheck(eglSwapBuffers(m_display, m_surface));
+}
+
+
+////////////////////////////////////////////////////////////
+void EglContext::setVerticalSyncEnabled(bool enabled)
+{
+ eglCheck(eglSwapInterval(m_display, enabled ? 1 : 0));
+}
+
+
+////////////////////////////////////////////////////////////
+void EglContext::createContext(EglContext* shared)
+{
+ const EGLint contextVersion[] = {
+ EGL_CONTEXT_CLIENT_VERSION, 1,
+ EGL_NONE
+ };
+
+ EGLContext toShared;
+
+ if (shared)
+ toShared = shared->m_context;
+ else
+ toShared = EGL_NO_CONTEXT;
+
+ // Create EGL context
+ m_context = eglCheck(eglCreateContext(m_display, m_config, toShared, contextVersion));
+}
+
+
+////////////////////////////////////////////////////////////
+void EglContext::createSurface(EGLNativeWindowType window)
+{
+ m_surface = eglCheck(eglCreateWindowSurface(m_display, m_config, window, NULL));
+}
+
+
+////////////////////////////////////////////////////////////
+void EglContext::destroySurface()
+{
+ eglCheck(eglDestroySurface(m_display, m_surface));
+ m_surface = EGL_NO_SURFACE;
+
+ // Ensure that this context is no longer active since our surface is now destroyed
+ setActive(false);
+}
+
+
+////////////////////////////////////////////////////////////
+EGLConfig EglContext::getBestConfig(EGLDisplay display, unsigned int bitsPerPixel, const ContextSettings& settings)
+{
+ // Set our video settings constraint
+ const EGLint attributes[] = {
+ EGL_BUFFER_SIZE, bitsPerPixel,
+ EGL_DEPTH_SIZE, settings.depthBits,
+ EGL_STENCIL_SIZE, settings.stencilBits,
+ EGL_SAMPLE_BUFFERS, settings.antialiasingLevel,
+ EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PBUFFER_BIT,
+ EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT,
+ EGL_NONE
+ };
+
+ EGLint configCount;
+ EGLConfig configs[1];
+
+ // Ask EGL for the best config matching our video settings
+ eglCheck(eglChooseConfig(display, attributes, configs, 1, &configCount));
+
+ return configs[0];
+}
+
+
+#ifdef SFML_SYSTEM_LINUX
+////////////////////////////////////////////////////////////
+XVisualInfo EglContext::selectBestVisual(::Display* XDisplay, unsigned int bitsPerPixel, const ContextSettings& settings)
+{
+ // Get the initialized EGL display
+ EGLDisplay display = getInitializedDisplay();
+
+ // Get the best EGL config matching the default video settings
+ EGLConfig config = getBestConfig(display, bitsPerPixel, settings);
+
+ // Retrieve the visual id associated with this EGL config
+ EGLint nativeVisualId;
+
+ eglCheck(eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &nativeVisualId));
+
+ if (nativeVisualId == 0)
+ {
+ // Should never happen...
+ err() << "No EGL visual found. You should check your graphics driver" << std::endl;
+
+ return XVisualInfo();
+ }
+
+ XVisualInfo vTemplate;
+ vTemplate.visualid = static_cast<VisualID>(nativeVisualId);
+
+ // Get X11 visuals compatible with this EGL config
+ XVisualInfo *availableVisuals, bestVisual;
+ int visualCount = 0;
+
+ availableVisuals = XGetVisualInfo(XDisplay, VisualIDMask, &vTemplate, &visualCount);
+
+ if (visualCount == 0)
+ {
+ // Can't happen...
+ err() << "No X11 visual found. Bug in your EGL implementation ?" << std::endl;
+
+ return XVisualInfo();
+ }
+
+ // Pick up the best one
+ bestVisual = availableVisuals[0];
+ XFree(availableVisuals);
+
+ return bestVisual;
+}
+#endif
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/EglContext.hpp b/src/SFML/Window/EglContext.hpp
new file mode 100644
index 0000000..50b366e
--- /dev/null
+++ b/src/SFML/Window/EglContext.hpp
@@ -0,0 +1,183 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_EGLCONTEXT_HPP
+#define SFML_EGLCONTEXT_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/VideoMode.hpp>
+#include <SFML/Window/ContextSettings.hpp>
+#include <SFML/Window/EGLCheck.hpp>
+#include <SFML/Window/GlContext.hpp>
+#include <SFML/OpenGL.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+class EglContext : public GlContext
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create a new context, not associated to a window
+ ///
+ /// \param shared Context to share the new one with (can be NULL)
+ ///
+ ////////////////////////////////////////////////////////////
+ EglContext(EglContext* shared);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create a new context attached to a window
+ ///
+ /// \param shared Context to share the new one with
+ /// \param settings Creation parameters
+ /// \param owner Pointer to the owner window
+ /// \param bitsPerPixel Pixel depth, in bits per pixel
+ ///
+ ////////////////////////////////////////////////////////////
+ EglContext(EglContext* shared, const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create a new context that embeds its own rendering target
+ ///
+ /// \param shared Context to share the new one with
+ /// \param settings Creation parameters
+ /// \param width Back buffer width, in pixels
+ /// \param height Back buffer height, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ EglContext(EglContext* shared, const ContextSettings& settings, unsigned int width, unsigned int height);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~EglContext();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Activate the context as the current target
+ /// for rendering
+ ///
+ /// \return True on success, false if any error happened
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool makeCurrent();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Display what has been rendered to the context so far
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void display();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Enable or disable vertical synchronization
+ ///
+ /// Activating vertical synchronization will limit the number
+ /// of frames displayed to the refresh rate of the monitor.
+ /// This can avoid some visual artifacts, and limit the framerate
+ /// to a good value (but not constant across different computers).
+ ///
+ /// \param enabled: True to enable v-sync, false to deactivate
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setVerticalSyncEnabled(bool enabled);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create the context
+ ///
+ /// \param shared Context to share the new one with (can be NULL)
+ /// \param bitsPerPixel Pixel depth, in bits per pixel
+ /// \param settings Creation parameters
+ ///
+ ////////////////////////////////////////////////////////////
+ void createContext(EglContext* shared);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create the EGL surface
+ ///
+ /// This function must be called when the activity (re)start, or
+ /// when the orientation change.
+ ///
+ /// \param window: The native window type
+ ///
+ ////////////////////////////////////////////////////////////
+ void createSurface(EGLNativeWindowType window);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destroy the EGL surface
+ ///
+ /// This function must be called when the activity is stopped, or
+ /// when the orientation change.
+ ///
+ ////////////////////////////////////////////////////////////
+ void destroySurface();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the best EGL visual for a given set of video settings
+ ///
+ /// \param display EGL display
+ /// \param bitsPerPixel Pixel depth, in bits per pixel
+ /// \param settings Requested context settings
+ ///
+ /// \return The best EGL config
+ ///
+ ////////////////////////////////////////////////////////////
+ static EGLConfig getBestConfig(EGLDisplay display, unsigned int bitsPerPixel, const ContextSettings& settings);
+
+#ifdef SFML_SYSTEM_LINUX
+ ////////////////////////////////////////////////////////////
+ /// \brief Select the best EGL visual for a given set of settings
+ ///
+ /// \param display X display
+ /// \param bitsPerPixel Pixel depth, in bits per pixel
+ /// \param settings Requested context settings
+ ///
+ /// \return The best visual
+ ///
+ ////////////////////////////////////////////////////////////
+ static XVisualInfo selectBestVisual(::Display* display, unsigned int bitsPerPixel, const ContextSettings& settings);
+#endif
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ EGLDisplay m_display; ///< The internal EGL display
+ EGLContext m_context; ///< The internal EGL context
+ EGLSurface m_surface; ///< The internal EGL surface
+ EGLConfig m_config; ///< The internal EGL config
+
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_EGLCONTEXT_HPP
diff --git a/src/SFML/Window/FreeBSD/JoystickImpl.cpp b/src/SFML/Window/FreeBSD/JoystickImpl.cpp
new file mode 100644
index 0000000..c7392a8
--- /dev/null
+++ b/src/SFML/Window/FreeBSD/JoystickImpl.cpp
@@ -0,0 +1,346 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// 2013-2013 David Demelier (demelier.david@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/JoystickImpl.hpp>
+#include <SFML/System/Err.hpp>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <cstring>
+#include <map>
+#include <string>
+#include <utility>
+
+////////////////////////////////////////////////////////////
+/// \brief This file implements FreeBSD driver joystick
+///
+/// It has been tested on a Saitek gamepad with 12 buttons,
+/// 2 analog axis and one hat.
+///
+/// Note: old joy(4) drivers are not supported and no one use that
+/// anymore.
+////////////////////////////////////////////////////////////
+
+
+namespace
+{
+ std::map<unsigned int, std::string> plugged;
+ std::map<int, std::pair<int, int> > hatValueMap;
+
+ bool isJoystick(const char *name)
+ {
+ int file = ::open(name, O_RDONLY | O_NONBLOCK);
+
+ if (file < 0)
+ return false;
+
+ report_desc_t desc = hid_get_report_desc(file);
+
+ if (!desc)
+ {
+ ::close(file);
+ return false;
+ }
+
+ int id = hid_get_report_id(file);
+ hid_data_t data = hid_start_parse(desc, 1 << hid_input, id);
+
+ if (!data)
+ {
+ hid_dispose_report_desc(desc);
+ ::close(file);
+ return false;
+ }
+
+ hid_item_t item;
+
+ // Assume it isn't
+ bool result = false;
+
+ while (hid_get_item(data, &item) > 0)
+ {
+ if ((item.kind == hid_collection) && (HID_PAGE(item.usage) == HUP_GENERIC_DESKTOP))
+ {
+ if ((HID_USAGE(item.usage) == HUG_JOYSTICK) || (HID_USAGE(item.usage) == HUG_GAME_PAD))
+ {
+ result = true;
+ }
+ }
+ }
+
+ hid_end_parse(data);
+ hid_dispose_report_desc(desc);
+ ::close(file);
+
+ return result;
+ }
+
+ void updatePluggedList()
+ {
+ /*
+ * Devices /dev/uhid<x> are shared between joystick and any other
+ * human interface device. We need to iterate over all found devices
+ * and check if they are joysticks. The index of JoystickImpl::open
+ * does not match the /dev/uhid<index> device!
+ */
+ DIR* directory = opendir("/dev");
+
+ if (directory)
+ {
+ int joystickCount = 0;
+ struct dirent* directoryEntry = readdir(directory);
+
+ while (directoryEntry && joystickCount < sf::Joystick::Count)
+ {
+ if (!std::strncmp(directoryEntry->d_name, "uhid", 4))
+ {
+ std::string name("/dev/");
+ name += directoryEntry->d_name;
+
+ if (isJoystick(name.c_str()))
+ plugged[joystickCount++] = name;
+ }
+
+ directoryEntry = readdir(directory);
+ }
+
+ closedir(directory);
+ }
+ }
+
+ int usageToAxis(int usage)
+ {
+ switch (usage)
+ {
+ case HUG_X: return sf::Joystick::X;
+ case HUG_Y: return sf::Joystick::Y;
+ case HUG_Z: return sf::Joystick::Z;
+ case HUG_RZ: return sf::Joystick::R;
+ case HUG_RX: return sf::Joystick::U;
+ case HUG_RY: return sf::Joystick::V;
+ default: return -1;
+ }
+ }
+
+ void hatValueToSfml(int value, sf::priv::JoystickState& state)
+ {
+ state.axes[sf::Joystick::PovX] = hatValueMap[value].first;
+ state.axes[sf::Joystick::PovY] = hatValueMap[value].second;
+ }
+}
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+void JoystickImpl::initialize()
+{
+ hid_init(NULL);
+
+ // Do an initial scan
+ updatePluggedList();
+
+ // Map of hat values
+ hatValueMap[0] = std::make_pair( 0, 0); // center
+
+ hatValueMap[1] = std::make_pair( 0, -100); // top
+ hatValueMap[3] = std::make_pair( 100, 0); // right
+ hatValueMap[5] = std::make_pair( 0, 100); // bottom
+ hatValueMap[7] = std::make_pair(-100, 0); // left
+
+ hatValueMap[2] = std::make_pair( 100, -100); // top-right
+ hatValueMap[4] = std::make_pair( 100, 100); // bottom-right
+ hatValueMap[6] = std::make_pair(-100, 100); // bottom-left
+ hatValueMap[8] = std::make_pair(-100, -100); // top-left
+}
+
+
+////////////////////////////////////////////////////////////
+void JoystickImpl::cleanup()
+{
+}
+
+
+////////////////////////////////////////////////////////////
+bool JoystickImpl::isConnected(unsigned int index)
+{
+ return plugged.find(index) != plugged.end();
+}
+
+
+////////////////////////////////////////////////////////////
+bool JoystickImpl::open(unsigned int index)
+{
+ if (isConnected(index))
+ {
+ // Open the joystick's file descriptor (read-only and non-blocking)
+ m_file = ::open(plugged[index].c_str(), O_RDONLY | O_NONBLOCK);
+ if (m_file >= 0)
+ {
+ // Reset the joystick state
+ m_state = JoystickState();
+
+ // Get the report descriptor
+ m_desc = hid_get_report_desc(m_file);
+ if (!m_desc)
+ {
+ ::close(m_file);
+ return false;
+ }
+
+ // And the id
+ m_id = hid_get_report_id(m_file);
+
+ // Then allocate a buffer for data retrieval
+ m_length = hid_report_size(m_desc, hid_input, m_id);
+ m_buffer.resize(m_length);
+
+ m_state.connected = true;
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+void JoystickImpl::close()
+{
+ ::close(m_file);
+ hid_dispose_report_desc(m_desc);
+}
+
+
+////////////////////////////////////////////////////////////
+JoystickCaps JoystickImpl::getCapabilities() const
+{
+ JoystickCaps caps;
+ hid_item_t item;
+
+ hid_data_t data = hid_start_parse(m_desc, 1 << hid_input, m_id);
+
+ while (hid_get_item(data, &item))
+ {
+ if (item.kind == hid_input)
+ {
+ int usage = HID_USAGE(item.usage);
+
+ if (usage == HUP_BUTTON)
+ {
+ caps.buttonCount++;
+ break;
+ }
+ else if (usage == HUP_GENERIC_DESKTOP)
+ {
+ int axis = usageToAxis(usage);
+
+ if (usage == HUG_HAT_SWITCH)
+ {
+ caps.axes[Joystick::PovX] = true;
+ caps.axes[Joystick::PovY] = true;
+ }
+ else if (axis != -1)
+ {
+ caps.axes[axis] = true;
+ }
+ }
+ }
+ }
+
+ hid_end_parse(data);
+
+ return caps;
+}
+
+
+////////////////////////////////////////////////////////////
+Joystick::Identification JoystickImpl::getIdentification() const
+{
+ return m_identification;
+}
+
+
+////////////////////////////////////////////////////////////
+JoystickState JoystickImpl::JoystickImpl::update()
+{
+ while (read(m_file, &m_buffer[0], m_length) == m_length)
+ {
+ hid_data_t data = hid_start_parse(m_desc, 1 << hid_input, m_id);
+
+ // No memory?
+ if (!data)
+ continue;
+
+ int buttonIndex = 0;
+ hid_item_t item;
+
+ while (hid_get_item(data, &item))
+ {
+ if (item.kind == hid_input)
+ {
+ int usage = HID_USAGE(item.usage);
+
+ if (usage == HUP_BUTTON)
+ {
+ m_state.buttons[buttonIndex++] = hid_get_data(&m_buffer[0], &item);
+ }
+ else if (usage == HUP_GENERIC_DESKTOP)
+ {
+ int value = hid_get_data(&m_buffer[0], &item);
+ int axis = usageToAxis(usage);
+
+ if (usage == HUG_HAT_SWITCH)
+ {
+ hatValueToSfml(value, m_state);
+ }
+ else if (axis != -1)
+ {
+ int minimum = item.logical_minimum;
+ int maximum = item.logical_maximum;
+
+ value = (value - minimum) * 200 / (maximum - minimum) - 100;
+ m_state.axes[axis] = value;
+ }
+ }
+ }
+ }
+
+ hid_end_parse(data);
+ }
+
+ return m_state;
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/FreeBSD/JoystickImpl.hpp b/src/SFML/Window/FreeBSD/JoystickImpl.hpp
new file mode 100644
index 0000000..106da8c
--- /dev/null
+++ b/src/SFML/Window/FreeBSD/JoystickImpl.hpp
@@ -0,0 +1,129 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_JOYSTICKIMPLFREEBSD_HPP
+#define SFML_JOYSTICKIMPLFREEBSD_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <dev/usb/usbhid.h>
+#include <usbhid.h>
+#include <vector>
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief FreeBSD implementation of joysticks
+///
+/// This code has been tested on FreeBSD 9.1 only.
+////////////////////////////////////////////////////////////
+class JoystickImpl
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global initialization of the joystick module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void initialize();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global cleanup of the joystick module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void cleanup();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a joystick is currently connected
+ ///
+ /// \param index Index of the joystick to check
+ ///
+ /// \return True if the joystick is connected, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isConnected(unsigned int index);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open the joystick
+ ///
+ /// \param index Index assigned to the joystick
+ ///
+ /// \return True on success, false on failure
+ ///
+ ////////////////////////////////////////////////////////////
+ bool open(unsigned int index);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Close the joystick
+ ///
+ ////////////////////////////////////////////////////////////
+ void close();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the joystick capabilities
+ ///
+ /// \return Joystick capabilities
+ ///
+ ////////////////////////////////////////////////////////////
+ JoystickCaps getCapabilities() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the joystick identification
+ ///
+ /// \return Joystick identification
+ ///
+ ////////////////////////////////////////////////////////////
+ Joystick::Identification getIdentification() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Update the joystick and get its new state
+ ///
+ /// \return Joystick state
+ ///
+ ////////////////////////////////////////////////////////////
+ JoystickState update();
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ int m_file; ///< File descriptor of the joystick
+ report_desc_t m_desc; ///< USB report descriptor
+ int m_id; ///< USB id
+ std::vector<char> m_buffer; ///< USB HID buffer
+ int m_length; ///< Buffer length
+ Joystick::Identification m_identification; ///< Joystick identification
+ JoystickState m_state; ///< Current state of the joystick
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_JOYSTICKIMPLFREEBSD_HPP
diff --git a/src/SFML/Window/GlContext.cpp b/src/SFML/Window/GlContext.cpp
index ce4bfec..53e6280 100644
--- a/src/SFML/Window/GlContext.cpp
+++ b/src/SFML/Window/GlContext.cpp
@@ -1,280 +1,300 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Window/GlContext.hpp>
-#include <SFML/System/ThreadLocalPtr.hpp>
-#include <SFML/System/Mutex.hpp>
-#include <SFML/System/Lock.hpp>
-#include <SFML/OpenGL.hpp>
-#include <SFML/Window/glext/glext.h>
-#include <set>
-#include <cstdlib>
-#include <cassert>
-
-
-#if defined(SFML_SYSTEM_WINDOWS)
-
- #include <SFML/Window/Win32/WglContext.hpp>
- typedef sf::priv::WglContext ContextType;
-
-#elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD)
-
- #include <SFML/Window/Linux/GlxContext.hpp>
- typedef sf::priv::GlxContext ContextType;
-
-#elif defined(SFML_SYSTEM_MACOS)
-
- #include <SFML/Window/OSX/SFContext.hpp>
- typedef sf::priv::SFContext ContextType;
-
-#endif
-
-
-namespace
-{
- // This per-thread variable holds the current context for each thread
- sf::ThreadLocalPtr<sf::priv::GlContext> currentContext(NULL);
-
- // The hidden, inactive context that will be shared with all other contexts
- ContextType* sharedContext = NULL;
-
- // Internal contexts
- sf::ThreadLocalPtr<sf::priv::GlContext> internalContext(NULL);
- std::set<sf::priv::GlContext*> internalContexts;
- sf::Mutex internalContextsMutex;
-
- // Check if the internal context of the current thread is valid
- bool hasInternalContext()
- {
- // The internal context can be null...
- if (!internalContext)
- return false;
-
- // ... or non-null but deleted from the list of internal contexts
- sf::Lock lock(internalContextsMutex);
- return internalContexts.find(internalContext) != internalContexts.end();
- }
-
- // Retrieve the internal context for the current thread
- sf::priv::GlContext* getInternalContext()
- {
- if (!hasInternalContext())
- {
- internalContext = sf::priv::GlContext::create();
- sf::Lock lock(internalContextsMutex);
- internalContexts.insert(internalContext);
- }
-
- return internalContext;
- }
-}
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-void GlContext::globalInit()
-{
- // Create the shared context
- sharedContext = new ContextType(NULL);
- sharedContext->initialize();
-
- // This call makes sure that:
- // - the shared context is inactive (it must never be)
- // - another valid context is activated in the current thread
- sharedContext->setActive(false);
-}
-
-
-////////////////////////////////////////////////////////////
-void GlContext::globalCleanup()
-{
- // Destroy the shared context
- delete sharedContext;
- sharedContext = NULL;
-
- // Destroy the internal contexts
- sf::Lock lock(internalContextsMutex);
- for (std::set<GlContext*>::iterator it = internalContexts.begin(); it != internalContexts.end(); ++it)
- delete *it;
- internalContexts.clear();
-}
-
-
-////////////////////////////////////////////////////////////
-void GlContext::ensureContext()
-{
- // If there's no active context on the current thread, activate an internal one
- if (!currentContext)
- getInternalContext()->setActive(true);
-}
-
-
-////////////////////////////////////////////////////////////
-GlContext* GlContext::create()
-{
- GlContext* context = new ContextType(sharedContext);
- context->initialize();
-
- return context;
-}
-
-
-////////////////////////////////////////////////////////////
-GlContext* GlContext::create(const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel)
-{
- // Make sure that there's an active context (context creation may need extensions, and thus a valid context)
- ensureContext();
-
- // Create the context
- GlContext* context = new ContextType(sharedContext, settings, owner, bitsPerPixel);
- context->initialize();
-
- return context;
-}
-
-
-////////////////////////////////////////////////////////////
-GlContext* GlContext::create(const ContextSettings& settings, unsigned int width, unsigned int height)
-{
- // Make sure that there's an active context (context creation may need extensions, and thus a valid context)
- ensureContext();
-
- // Create the context
- GlContext* context = new ContextType(sharedContext, settings, width, height);
- context->initialize();
-
- return context;
-}
-
-
-////////////////////////////////////////////////////////////
-GlContext::~GlContext()
-{
- // Deactivate the context before killing it, unless we're inside Cleanup()
- if (sharedContext)
- setActive(false);
-}
-
-
-////////////////////////////////////////////////////////////
-const ContextSettings& GlContext::getSettings() const
-{
- return m_settings;
-}
-
-
-////////////////////////////////////////////////////////////
-bool GlContext::setActive(bool active)
-{
- if (active)
- {
- if (this != currentContext)
- {
- // Activate the context
- if (makeCurrent())
- {
- // Set it as the new current context for this thread
- currentContext = this;
- return true;
- }
- else
- {
- return false;
- }
- }
- else
- {
- // This context is already the active one on this thread, don't do anything
- return true;
- }
- }
- else
- {
- if (this == currentContext)
- {
- // To deactivate the context, we actually activate another one so that we make
- // sure that there is always an active context for subsequent graphics operations
- return getInternalContext()->setActive(true);
- }
- else
- {
- // This context is not the active one on this thread, don't do anything
- return true;
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////
-GlContext::GlContext()
-{
- // Nothing to do
-}
-
-
-////////////////////////////////////////////////////////////
-int GlContext::evaluateFormat(unsigned int bitsPerPixel, const ContextSettings& settings, int colorBits, int depthBits, int stencilBits, int antialiasing)
-{
- return std::abs(static_cast<int>(bitsPerPixel - colorBits)) +
- std::abs(static_cast<int>(settings.depthBits - depthBits)) +
- std::abs(static_cast<int>(settings.stencilBits - stencilBits)) +
- std::abs(static_cast<int>(settings.antialiasingLevel - antialiasing));
-}
-
-
-////////////////////////////////////////////////////////////
-void GlContext::initialize()
-{
- // Activate the context
- setActive(true);
-
- // Retrieve the context version number
- const GLubyte* version = glGetString(GL_VERSION);
- if (version)
- {
- // The beginning of the returned string is "major.minor" (this is standard)
- m_settings.majorVersion = version[0] - '0';
- m_settings.minorVersion = version[2] - '0';
- }
- else
- {
- // Can't get the version number, assume 2.0
- m_settings.majorVersion = 2;
- m_settings.minorVersion = 0;
- }
-
- // Enable antialiasing if needed
- if (m_settings.antialiasingLevel > 0)
- glEnable(GL_MULTISAMPLE_ARB);
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/GlContext.hpp>
+#include <SFML/System/ThreadLocalPtr.hpp>
+#include <SFML/System/Mutex.hpp>
+#include <SFML/System/Lock.hpp>
+#include <SFML/OpenGL.hpp>
+#include <set>
+#include <cstdlib>
+#ifdef SFML_SYSTEM_IOS
+ #include <OpenGLES/ES1/gl.h>
+#else
+ #include <SFML/Window/glext/glext.h>
+#endif
+
+#if !defined(SFML_OPENGL_ES)
+
+ #if defined(SFML_SYSTEM_WINDOWS)
+
+ #include <SFML/Window/Win32/WglContext.hpp>
+ typedef sf::priv::WglContext ContextType;
+
+ #elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD)
+
+ #include <SFML/Window/Unix/GlxContext.hpp>
+ typedef sf::priv::GlxContext ContextType;
+
+ #elif defined(SFML_SYSTEM_MACOS)
+
+ #include <SFML/Window/OSX/SFContext.hpp>
+ typedef sf::priv::SFContext ContextType;
+
+ #endif
+
+#else
+
+ #if defined(SFML_SYSTEM_IOS)
+
+ #include <SFML/Window/iOS/EaglContext.hpp>
+ typedef sf::priv::EaglContext ContextType;
+
+ #else
+
+ #include <SFML/Window/EglContext.hpp>
+ typedef sf::priv::EglContext ContextType;
+
+ #endif
+
+#endif
+
+
+namespace
+{
+ // This per-thread variable holds the current context for each thread
+ sf::ThreadLocalPtr<sf::priv::GlContext> currentContext(NULL);
+
+ // The hidden, inactive context that will be shared with all other contexts
+ ContextType* sharedContext = NULL;
+
+ // Internal contexts
+ sf::ThreadLocalPtr<sf::priv::GlContext> internalContext(NULL);
+ std::set<sf::priv::GlContext*> internalContexts;
+ sf::Mutex internalContextsMutex;
+
+ // Check if the internal context of the current thread is valid
+ bool hasInternalContext()
+ {
+ // The internal context can be null...
+ if (!internalContext)
+ return false;
+
+ // ... or non-null but deleted from the list of internal contexts
+ sf::Lock lock(internalContextsMutex);
+ return internalContexts.find(internalContext) != internalContexts.end();
+ }
+
+ // Retrieve the internal context for the current thread
+ sf::priv::GlContext* getInternalContext()
+ {
+ if (!hasInternalContext())
+ {
+ internalContext = sf::priv::GlContext::create();
+ sf::Lock lock(internalContextsMutex);
+ internalContexts.insert(internalContext);
+ }
+
+ return internalContext;
+ }
+}
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+void GlContext::globalInit()
+{
+ // Create the shared context
+ sharedContext = new ContextType(NULL);
+ sharedContext->initialize();
+
+ // This call makes sure that:
+ // - the shared context is inactive (it must never be)
+ // - another valid context is activated in the current thread
+ sharedContext->setActive(false);
+}
+
+
+////////////////////////////////////////////////////////////
+void GlContext::globalCleanup()
+{
+ // Destroy the shared context
+ delete sharedContext;
+ sharedContext = NULL;
+
+ // Destroy the internal contexts
+ sf::Lock lock(internalContextsMutex);
+ for (std::set<GlContext*>::iterator it = internalContexts.begin(); it != internalContexts.end(); ++it)
+ delete *it;
+ internalContexts.clear();
+}
+
+
+////////////////////////////////////////////////////////////
+void GlContext::ensureContext()
+{
+ // If there's no active context on the current thread, activate an internal one
+ if (!currentContext)
+ getInternalContext()->setActive(true);
+}
+
+
+////////////////////////////////////////////////////////////
+GlContext* GlContext::create()
+{
+ GlContext* context = new ContextType(sharedContext);
+ context->initialize();
+
+ return context;
+}
+
+
+////////////////////////////////////////////////////////////
+GlContext* GlContext::create(const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel)
+{
+ // Make sure that there's an active context (context creation may need extensions, and thus a valid context)
+ ensureContext();
+
+ // Create the context
+ GlContext* context = new ContextType(sharedContext, settings, owner, bitsPerPixel);
+ context->initialize();
+
+ return context;
+}
+
+
+////////////////////////////////////////////////////////////
+GlContext* GlContext::create(const ContextSettings& settings, unsigned int width, unsigned int height)
+{
+ // Make sure that there's an active context (context creation may need extensions, and thus a valid context)
+ ensureContext();
+
+ // Create the context
+ GlContext* context = new ContextType(sharedContext, settings, width, height);
+ context->initialize();
+
+ return context;
+}
+
+
+////////////////////////////////////////////////////////////
+GlContext::~GlContext()
+{
+ // Deactivate the context before killing it, unless we're inside Cleanup()
+ if (sharedContext)
+ setActive(false);
+}
+
+
+////////////////////////////////////////////////////////////
+const ContextSettings& GlContext::getSettings() const
+{
+ return m_settings;
+}
+
+
+////////////////////////////////////////////////////////////
+bool GlContext::setActive(bool active)
+{
+ if (active)
+ {
+ if (this != currentContext)
+ {
+ // Activate the context
+ if (makeCurrent())
+ {
+ // Set it as the new current context for this thread
+ currentContext = this;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ // This context is already the active one on this thread, don't do anything
+ return true;
+ }
+ }
+ else
+ {
+ if (this == currentContext)
+ {
+ // To deactivate the context, we actually activate another one so that we make
+ // sure that there is always an active context for subsequent graphics operations
+ return getInternalContext()->setActive(true);
+ }
+ else
+ {
+ // This context is not the active one on this thread, don't do anything
+ return true;
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+GlContext::GlContext()
+{
+ // Nothing to do
+}
+
+
+////////////////////////////////////////////////////////////
+int GlContext::evaluateFormat(unsigned int bitsPerPixel, const ContextSettings& settings, int colorBits, int depthBits, int stencilBits, int antialiasing)
+{
+ return std::abs(static_cast<int>(bitsPerPixel - colorBits)) +
+ std::abs(static_cast<int>(settings.depthBits - depthBits)) +
+ std::abs(static_cast<int>(settings.stencilBits - stencilBits)) +
+ std::abs(static_cast<int>(settings.antialiasingLevel - antialiasing));
+}
+
+
+////////////////////////////////////////////////////////////
+void GlContext::initialize()
+{
+ // Activate the context
+ setActive(true);
+
+ // Retrieve the context version number
+ const GLubyte* version = glGetString(GL_VERSION);
+ if (version)
+ {
+ // The beginning of the returned string is "major.minor" (this is standard)
+ m_settings.majorVersion = version[0] - '0';
+ m_settings.minorVersion = version[2] - '0';
+ }
+ else
+ {
+ // Can't get the version number, assume 2.0
+ m_settings.majorVersion = 2;
+ m_settings.minorVersion = 0;
+ }
+
+ // Enable antialiasing if needed
+ if (m_settings.antialiasingLevel > 0)
+ glEnable(GL_MULTISAMPLE);
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/GlContext.hpp b/src/SFML/Window/GlContext.hpp
index 7f8f4c0..9cd588b 100644
--- a/src/SFML/Window/GlContext.hpp
+++ b/src/SFML/Window/GlContext.hpp
@@ -1,234 +1,234 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_GLCONTEXT_HPP
-#define SFML_GLCONTEXT_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Config.hpp>
-#include <SFML/Window/ContextSettings.hpp>
-#include <SFML/System/NonCopyable.hpp>
-
-
-namespace sf
-{
-namespace priv
-{
-class WindowImpl;
-
-////////////////////////////////////////////////////////////
-/// \brief Abstract class representing an OpenGL context
-///
-////////////////////////////////////////////////////////////
-class GlContext : NonCopyable
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Perform the global initialization
- ///
- /// This function is called once, before the very first OpenGL
- /// resource is created. It makes sure that everything is ready
- /// for contexts to work properly.
- /// Note: this function doesn't need to be thread-safe, as it
- /// can be called only once.
- ///
- ////////////////////////////////////////////////////////////
- static void globalInit();
-
- ////////////////////////////////////////////////////////////
- /// \brief Perform the global cleanup
- ///
- /// This function is called after the very last OpenGL resource
- /// is destroyed. It makes sure that everything that was
- /// created by initialize() is properly released.
- /// Note: this function doesn't need to be thread-safe, as it
- /// can be called only once.
- ///
- ////////////////////////////////////////////////////////////
- static void globalCleanup();
-
- ////////////////////////////////////////////////////////////
- /// \brief Ensures that an OpenGL context is active in the current thread
- ///
- ////////////////////////////////////////////////////////////
- static void ensureContext();
-
- ////////////////////////////////////////////////////////////
- /// \brief Create a new context, not associated to a window
- ///
- /// This function automatically chooses the specialized class
- /// to use according to the OS.
- ///
- /// \return Pointer to the created context (don't forget to delete it)
- ///
- ////////////////////////////////////////////////////////////
- static GlContext* create();
-
- ////////////////////////////////////////////////////////////
- /// \brief Create a new context attached to a window
- ///
- /// This function automatically chooses the specialized class
- /// to use according to the OS.
- ///
- /// \param settings Creation parameters
- /// \param owner Pointer to the owner window
- /// \param bitsPerPixel Pixel depth (in bits per pixel)
- ///
- /// \return Pointer to the created context
- ///
- ////////////////////////////////////////////////////////////
- static GlContext* create(const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel);
-
- ////////////////////////////////////////////////////////////
- /// \brief Create a new context that embeds its own rendering target
- ///
- /// This function automatically chooses the specialized class
- /// to use according to the OS.
- ///
- /// \param settings Creation parameters
- /// \param width Back buffer width
- /// \param height Back buffer height
- ///
- /// \return Pointer to the created context
- ///
- ////////////////////////////////////////////////////////////
- static GlContext* create(const ContextSettings& settings, unsigned int width, unsigned int height);
-
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor
- ///
- ////////////////////////////////////////////////////////////
- virtual ~GlContext();
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the settings of the context
- ///
- /// Note that these settings may be different than the ones
- /// passed to the constructor; they are indeed adjusted if the
- /// original settings are not directly supported by the system.
- ///
- /// \return Structure containing the settings
- ///
- ////////////////////////////////////////////////////////////
- const ContextSettings& getSettings() const;
-
- ////////////////////////////////////////////////////////////
- /// \brief Activate or deactivate the context as the current target for rendering
- ///
- /// A context is active only on the current thread, if you want to
- /// make it active on another thread you have to deactivate it
- /// on the previous thread first if it was active.
- /// Only one context can be active on a thread at a time, thus
- /// the context previously active (if any) automatically gets deactivated.
- ///
- /// \param active True to activate, false to deactivate
- ///
- /// \return True if operation was successful, false otherwise
- ///
- ////////////////////////////////////////////////////////////
- bool setActive(bool active);
-
- ////////////////////////////////////////////////////////////
- /// \brief Display what has been rendered to the context so far
- ///
- ////////////////////////////////////////////////////////////
- virtual void display() = 0;
-
- ////////////////////////////////////////////////////////////
- /// \brief Enable or disable vertical synchronization
- ///
- /// Activating vertical synchronization will limit the number
- /// of frames displayed to the refresh rate of the monitor.
- /// This can avoid some visual artifacts, and limit the framerate
- /// to a good value (but not constant across different computers).
- ///
- /// \param enabled True to enable v-sync, false to deactivate
- ///
- ////////////////////////////////////////////////////////////
- virtual void setVerticalSyncEnabled(bool enabled) = 0;
-
-protected :
-
- ////////////////////////////////////////////////////////////
- /// \brief Default constructor
- ///
- /// This constructor is meant for derived classes only.
- ///
- ////////////////////////////////////////////////////////////
- GlContext();
-
- ////////////////////////////////////////////////////////////
- /// \brief Activate the context as the current target
- /// for rendering
- ///
- /// \return True on success, false if any error happened
- ///
- ////////////////////////////////////////////////////////////
- virtual bool makeCurrent() = 0;
-
- ////////////////////////////////////////////////////////////
- /// \brief Evaluate a pixel format configuration
- ///
- /// This functions can be used by implementations that have
- /// several valid formats and want to get the best one.
- /// A score is returned for the given configuration: the
- /// lower the score is, the better the configuration is.
- ///
- /// \param bitsPerPixel Requested pixel depth (bits per pixel)
- /// \param settings Requested additionnal settings
- /// \param colorBits Color bits of the configuration to evaluate
- /// \param depthBits Depth bits of the configuration to evaluate
- /// \param stencilBits Stencil bits of the configuration to evaluate
- /// \param antialiasing Antialiasing level of the configuration to evaluate
- ///
- /// \return Score of the configuration
- ///
- ////////////////////////////////////////////////////////////
- static int evaluateFormat(unsigned int bitsPerPixel, const ContextSettings& settings, int colorBits, int depthBits, int stencilBits, int antialiasing);
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- ContextSettings m_settings; ///< Creation settings of the context
-
-private:
-
- ////////////////////////////////////////////////////////////
- /// \brief Perform various initializations after the context construction
- ///
- ////////////////////////////////////////////////////////////
- void initialize();
-};
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_GLCONTEXT_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_GLCONTEXT_HPP
+#define SFML_GLCONTEXT_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <SFML/Window/ContextSettings.hpp>
+#include <SFML/System/NonCopyable.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+class WindowImpl;
+
+////////////////////////////////////////////////////////////
+/// \brief Abstract class representing an OpenGL context
+///
+////////////////////////////////////////////////////////////
+class GlContext : NonCopyable
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global initialization
+ ///
+ /// This function is called once, before the very first OpenGL
+ /// resource is created. It makes sure that everything is ready
+ /// for contexts to work properly.
+ /// Note: this function doesn't need to be thread-safe, as it
+ /// can be called only once.
+ ///
+ ////////////////////////////////////////////////////////////
+ static void globalInit();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global cleanup
+ ///
+ /// This function is called after the very last OpenGL resource
+ /// is destroyed. It makes sure that everything that was
+ /// created by initialize() is properly released.
+ /// Note: this function doesn't need to be thread-safe, as it
+ /// can be called only once.
+ ///
+ ////////////////////////////////////////////////////////////
+ static void globalCleanup();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Ensures that an OpenGL context is active in the current thread
+ ///
+ ////////////////////////////////////////////////////////////
+ static void ensureContext();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create a new context, not associated to a window
+ ///
+ /// This function automatically chooses the specialized class
+ /// to use according to the OS.
+ ///
+ /// \return Pointer to the created context (don't forget to delete it)
+ ///
+ ////////////////////////////////////////////////////////////
+ static GlContext* create();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create a new context attached to a window
+ ///
+ /// This function automatically chooses the specialized class
+ /// to use according to the OS.
+ ///
+ /// \param settings Creation parameters
+ /// \param owner Pointer to the owner window
+ /// \param bitsPerPixel Pixel depth (in bits per pixel)
+ ///
+ /// \return Pointer to the created context
+ ///
+ ////////////////////////////////////////////////////////////
+ static GlContext* create(const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create a new context that embeds its own rendering target
+ ///
+ /// This function automatically chooses the specialized class
+ /// to use according to the OS.
+ ///
+ /// \param settings Creation parameters
+ /// \param width Back buffer width
+ /// \param height Back buffer height
+ ///
+ /// \return Pointer to the created context
+ ///
+ ////////////////////////////////////////////////////////////
+ static GlContext* create(const ContextSettings& settings, unsigned int width, unsigned int height);
+
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~GlContext();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the settings of the context
+ ///
+ /// Note that these settings may be different than the ones
+ /// passed to the constructor; they are indeed adjusted if the
+ /// original settings are not directly supported by the system.
+ ///
+ /// \return Structure containing the settings
+ ///
+ ////////////////////////////////////////////////////////////
+ const ContextSettings& getSettings() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Activate or deactivate the context as the current target for rendering
+ ///
+ /// A context is active only on the current thread, if you want to
+ /// make it active on another thread you have to deactivate it
+ /// on the previous thread first if it was active.
+ /// Only one context can be active on a thread at a time, thus
+ /// the context previously active (if any) automatically gets deactivated.
+ ///
+ /// \param active True to activate, false to deactivate
+ ///
+ /// \return True if operation was successful, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ bool setActive(bool active);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Display what has been rendered to the context so far
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void display() = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Enable or disable vertical synchronization
+ ///
+ /// Activating vertical synchronization will limit the number
+ /// of frames displayed to the refresh rate of the monitor.
+ /// This can avoid some visual artifacts, and limit the framerate
+ /// to a good value (but not constant across different computers).
+ ///
+ /// \param enabled True to enable v-sync, false to deactivate
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setVerticalSyncEnabled(bool enabled) = 0;
+
+protected:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ /// This constructor is meant for derived classes only.
+ ///
+ ////////////////////////////////////////////////////////////
+ GlContext();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Activate the context as the current target
+ /// for rendering
+ ///
+ /// \return True on success, false if any error happened
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool makeCurrent() = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Evaluate a pixel format configuration
+ ///
+ /// This functions can be used by implementations that have
+ /// several valid formats and want to get the best one.
+ /// A score is returned for the given configuration: the
+ /// lower the score is, the better the configuration is.
+ ///
+ /// \param bitsPerPixel Requested pixel depth (bits per pixel)
+ /// \param settings Requested additional settings
+ /// \param colorBits Color bits of the configuration to evaluate
+ /// \param depthBits Depth bits of the configuration to evaluate
+ /// \param stencilBits Stencil bits of the configuration to evaluate
+ /// \param antialiasing Antialiasing level of the configuration to evaluate
+ ///
+ /// \return Score of the configuration
+ ///
+ ////////////////////////////////////////////////////////////
+ static int evaluateFormat(unsigned int bitsPerPixel, const ContextSettings& settings, int colorBits, int depthBits, int stencilBits, int antialiasing);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ ContextSettings m_settings; ///< Creation settings of the context
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform various initializations after the context construction
+ ///
+ ////////////////////////////////////////////////////////////
+ void initialize();
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_GLCONTEXT_HPP
diff --git a/src/SFML/Window/GlResource.cpp b/src/SFML/Window/GlResource.cpp
index dda11a7..84725f8 100644
--- a/src/SFML/Window/GlResource.cpp
+++ b/src/SFML/Window/GlResource.cpp
@@ -1,85 +1,85 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Window/GlResource.hpp>
-#include <SFML/Window/GlContext.hpp>
-#include <SFML/System/Mutex.hpp>
-#include <SFML/System/Lock.hpp>
-
-
-namespace
-{
- // OpenGL resources counter and its mutex
- unsigned int count = 0;
- sf::Mutex mutex;
-}
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-GlResource::GlResource()
-{
- {
- // Protect from concurrent access
- Lock lock(mutex);
-
- // If this is the very first resource, trigger the global context initialization
- if (count == 0)
- priv::GlContext::globalInit();
-
- // Increment the resources counter
- count++;
- }
-
- // Now make sure that there is an active OpenGL context in the current thread
- priv::GlContext::ensureContext();
-}
-
-
-////////////////////////////////////////////////////////////
-GlResource::~GlResource()
-{
- // Protect from concurrent access
- Lock lock(mutex);
-
- // Decrement the resources counter
- count--;
-
- // If there's no more resource alive, we can trigger the global context cleanup
- if (count == 0)
- priv::GlContext::globalCleanup();
-}
-
-
-////////////////////////////////////////////////////////////
-void GlResource::ensureGlContext()
-{
- priv::GlContext::ensureContext();
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/GlResource.hpp>
+#include <SFML/Window/GlContext.hpp>
+#include <SFML/System/Mutex.hpp>
+#include <SFML/System/Lock.hpp>
+
+
+namespace
+{
+ // OpenGL resources counter and its mutex
+ unsigned int count = 0;
+ sf::Mutex mutex;
+}
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+GlResource::GlResource()
+{
+ {
+ // Protect from concurrent access
+ Lock lock(mutex);
+
+ // If this is the very first resource, trigger the global context initialization
+ if (count == 0)
+ priv::GlContext::globalInit();
+
+ // Increment the resources counter
+ count++;
+ }
+
+ // Now make sure that there is an active OpenGL context in the current thread
+ priv::GlContext::ensureContext();
+}
+
+
+////////////////////////////////////////////////////////////
+GlResource::~GlResource()
+{
+ // Protect from concurrent access
+ Lock lock(mutex);
+
+ // Decrement the resources counter
+ count--;
+
+ // If there's no more resource alive, we can trigger the global context cleanup
+ if (count == 0)
+ priv::GlContext::globalCleanup();
+}
+
+
+////////////////////////////////////////////////////////////
+void GlResource::ensureGlContext()
+{
+ priv::GlContext::ensureContext();
+}
+
+} // namespace sf
diff --git a/src/SFML/Window/InputImpl.hpp b/src/SFML/Window/InputImpl.hpp
index 0e2069d..cf11572 100644
--- a/src/SFML/Window/InputImpl.hpp
+++ b/src/SFML/Window/InputImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -33,9 +33,13 @@
#if defined(SFML_SYSTEM_WINDOWS)
#include <SFML/Window/Win32/InputImpl.hpp>
#elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD)
- #include <SFML/Window/Linux/InputImpl.hpp>
+ #include <SFML/Window/Unix/InputImpl.hpp>
#elif defined(SFML_SYSTEM_MACOS)
#include <SFML/Window/OSX/InputImpl.hpp>
+#elif defined(SFML_SYSTEM_IOS)
+ #include <SFML/Window/iOS/InputImpl.hpp>
+#elif defined(SFML_SYSTEM_ANDROID)
+ #include <SFML/Window/Android/InputImpl.hpp>
#endif
diff --git a/src/SFML/Window/Joystick.cpp b/src/SFML/Window/Joystick.cpp
index e307948..879dd29 100644
--- a/src/SFML/Window/Joystick.cpp
+++ b/src/SFML/Window/Joystick.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -67,9 +67,26 @@ float Joystick::getAxisPosition(unsigned int joystick, Axis axis)
////////////////////////////////////////////////////////////
+Joystick::Identification Joystick::getIdentification(unsigned int joystick)
+{
+ return priv::JoystickManager::getInstance().getIdentification(joystick);
+}
+
+
+////////////////////////////////////////////////////////////
void Joystick::update()
{
return priv::JoystickManager::getInstance().update();
}
+
+////////////////////////////////////////////////////////////
+Joystick::Identification::Identification() :
+name ("No Joystick"),
+vendorId (0),
+productId(0)
+{
+
+}
+
} // namespace sf
diff --git a/src/SFML/Window/JoystickImpl.hpp b/src/SFML/Window/JoystickImpl.hpp
index 1837ab4..3877d63 100644
--- a/src/SFML/Window/JoystickImpl.hpp
+++ b/src/SFML/Window/JoystickImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -30,6 +30,7 @@
////////////////////////////////////////////////////////////
#include <SFML/Config.hpp>
#include <SFML/Window/Joystick.hpp>
+#include <SFML/System/String.hpp>
#include <algorithm>
@@ -38,7 +39,7 @@ namespace sf
namespace priv
{
////////////////////////////////////////////////////////////
-/// \brief Structure holding a joystick's capabilities
+/// \brief Structure holding a joystick's information
///
////////////////////////////////////////////////////////////
struct JoystickCaps
@@ -78,11 +79,29 @@ struct JoystickState
#if defined(SFML_SYSTEM_WINDOWS)
+
#include <SFML/Window/Win32/JoystickImpl.hpp>
-#elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD)
- #include <SFML/Window/Linux/JoystickImpl.hpp>
+
+#elif defined(SFML_SYSTEM_LINUX)
+
+ #include <SFML/Window/Unix/JoystickImpl.hpp>
+
+#elif defined(SFML_SYSTEM_FREEBSD)
+
+ #include <SFML/Window/FreeBSD/JoystickImpl.hpp>
+
#elif defined(SFML_SYSTEM_MACOS)
+
#include <SFML/Window/OSX/JoystickImpl.hpp>
+
+#elif defined(SFML_SYSTEM_IOS)
+
+ #include <SFML/Window/iOS/JoystickImpl.hpp>
+
+#elif defined(SFML_SYSTEM_ANDROID)
+
+ #include <SFML/Window/Android/JoystickImpl.hpp>
+
#endif
diff --git a/src/SFML/Window/JoystickManager.cpp b/src/SFML/Window/JoystickManager.cpp
index 2ddcdfa..1f3b9ec 100644
--- a/src/SFML/Window/JoystickManager.cpp
+++ b/src/SFML/Window/JoystickManager.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -55,6 +55,13 @@ const JoystickState& JoystickManager::getState(unsigned int joystick) const
////////////////////////////////////////////////////////////
+const Joystick::Identification& JoystickManager::getIdentification(unsigned int joystick) const
+{
+ return m_joysticks[joystick].identification;
+}
+
+
+////////////////////////////////////////////////////////////
void JoystickManager::update()
{
for (int i = 0; i < Joystick::Count; ++i)
@@ -70,8 +77,9 @@ void JoystickManager::update()
if (!item.state.connected)
{
item.joystick.close();
- item.capabilities = JoystickCaps();
- item.state = JoystickState();
+ item.capabilities = JoystickCaps();
+ item.state = JoystickState();
+ item.identification = Joystick::Identification();
}
}
else
@@ -81,8 +89,9 @@ void JoystickManager::update()
{
if (item.joystick.open(i))
{
- item.capabilities = item.joystick.getCapabilities();
- item.state = item.joystick.update();
+ item.capabilities = item.joystick.getCapabilities();
+ item.state = item.joystick.update();
+ item.identification = item.joystick.getIdentification();
}
}
}
diff --git a/src/SFML/Window/JoystickManager.hpp b/src/SFML/Window/JoystickManager.hpp
index fda8c22..e0e2492 100644
--- a/src/SFML/Window/JoystickManager.hpp
+++ b/src/SFML/Window/JoystickManager.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -43,7 +43,7 @@ namespace priv
////////////////////////////////////////////////////////////
class JoystickManager : NonCopyable
{
-public :
+public:
////////////////////////////////////////////////////////////
/// \brief Get the global unique instance of the manager
@@ -54,7 +54,7 @@ public :
static JoystickManager& getInstance();
////////////////////////////////////////////////////////////
- /// \brief Get the capabilities of an open joystick
+ /// \brief Get the capabilities for an open joystick
///
/// \param joystick Index of the joystick
///
@@ -74,6 +74,16 @@ public :
const JoystickState& getState(unsigned int joystick) const;
////////////////////////////////////////////////////////////
+ /// \brief Get the identification for an open joystick
+ ///
+ /// \param joystick Index of the joystick
+ ///
+ /// \return Identification for the joystick
+ ///
+ ////////////////////////////////////////////////////////////
+ const Joystick::Identification& getIdentification(unsigned int joystick) const;
+
+ ////////////////////////////////////////////////////////////
/// \brief Update the state of all the joysticks
///
////////////////////////////////////////////////////////////
@@ -99,9 +109,10 @@ private:
////////////////////////////////////////////////////////////
struct Item
{
- JoystickImpl joystick; ///< Joystick implementation
- JoystickState state; ///< The current joystick state
- JoystickCaps capabilities; ///< The joystick capabilities
+ JoystickImpl joystick; ///< Joystick implementation
+ JoystickState state; ///< The current joystick state
+ JoystickCaps capabilities; ///< The joystick capabilities
+ Joystick::Identification identification; ///< The joystick identification
};
////////////////////////////////////////////////////////////
diff --git a/src/SFML/Window/Keyboard.cpp b/src/SFML/Window/Keyboard.cpp
index 0d30f3c..e8afc67 100644
--- a/src/SFML/Window/Keyboard.cpp
+++ b/src/SFML/Window/Keyboard.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -37,4 +37,11 @@ bool Keyboard::isKeyPressed(Key key)
return priv::InputImpl::isKeyPressed(key);
}
+
+////////////////////////////////////////////////////////////
+void Keyboard::setVirtualKeyboardVisible(bool visible)
+{
+ priv::InputImpl::setVirtualKeyboardVisible(visible);
+}
+
} // namespace sf
diff --git a/src/SFML/Window/Linux/JoystickImpl.cpp b/src/SFML/Window/Linux/JoystickImpl.cpp
deleted file mode 100644
index 4db4b91..0000000
--- a/src/SFML/Window/Linux/JoystickImpl.cpp
+++ /dev/null
@@ -1,256 +0,0 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Window/JoystickImpl.hpp>
-#include <SFML/System/Err.hpp>
-#include <sys/inotify.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
-#include <cstdio>
-
-
-namespace
-{
- int notifyFd = -1;
- int inputFd = -1;
- bool plugged[sf::Joystick::Count];
-
- void updatePluggedList()
- {
- for (unsigned int i = 0; i < sf::Joystick::Count; ++i)
- {
- char name[32];
- std::snprintf(name, sizeof(name), "/dev/input/js%u", i);
- struct stat info;
- plugged[i] = (stat(name, &info) == 0);
- }
- }
-
- bool canRead(int descriptor)
- {
- fd_set set;
- FD_ZERO(&set);
- FD_SET(descriptor, &set);
- timeval timeout = {0, 0};
- return select(descriptor + 1, &set, NULL, NULL, &timeout) > 0 &&
- FD_ISSET(notifyFd, &set);
- }
-}
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-void JoystickImpl::initialize()
-{
- // Reset the array of plugged joysticks
- std::fill(plugged, plugged + Joystick::Count, false);
-
- // Create the inotify instance
- notifyFd = inotify_init();
- if (notifyFd < 0)
- {
- err() << "Failed to initialize inotify, joystick connections and disconnections won't be notified" << std::endl;
- return;
- }
-
- // Watch nodes created and deleted in the /dev/input directory
- inputFd = inotify_add_watch(notifyFd, "/dev/input", IN_CREATE | IN_DELETE);
- if (inputFd < 0)
- {
- err() << "Failed to initialize inotify, joystick connections and disconnections won't be notified" << std::endl;
- return;
- }
-
- // Do an initial scan
- updatePluggedList();
-}
-
-
-////////////////////////////////////////////////////////////
-void JoystickImpl::cleanup()
-{
- // Stop watching the /dev/input directory
- if (inputFd >= 0)
- inotify_rm_watch(notifyFd, inputFd);
-
- // Close the inotify file descriptor
- if (inputFd >= 0)
- ::close(notifyFd);
-}
-
-
-////////////////////////////////////////////////////////////
-bool JoystickImpl::isConnected(unsigned int index)
-{
- // First check if new joysticks were added/removed since last update
- if (canRead(notifyFd))
- {
- // Don't bother decomposing and interpreting the filename, just do a full scan
- updatePluggedList();
-
- // Flush all the pending events
- while (canRead(notifyFd))
- {
- char buffer[128];
- read(notifyFd, buffer, sizeof(buffer));
- }
- }
-
- // Then check if the joystick is connected
- return plugged[index];
-}
-
-
-////////////////////////////////////////////////////////////
-bool JoystickImpl::open(unsigned int index)
-{
- if (plugged[index])
- {
- char name[32];
- std::snprintf(name, sizeof(name), "/dev/input/js%u", index);
-
- // Open the joystick's file descriptor (read-only and non-blocking)
- m_file = ::open(name, O_RDONLY | O_NONBLOCK);
- if (m_file >= 0)
- {
- // Retrieve the axes mapping
- ioctl(m_file, JSIOCGAXMAP, m_mapping);
-
- // Reset the joystick state
- m_state = JoystickState();
-
- return true;
- }
- else
- {
- return false;
- }
- }
- else
- {
- return false;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void JoystickImpl::close()
-{
- ::close(m_file);
-}
-
-
-////////////////////////////////////////////////////////////
-JoystickCaps JoystickImpl::getCapabilities() const
-{
- JoystickCaps caps;
-
- // Get the number of buttons
- char buttonCount;
- ioctl(m_file, JSIOCGBUTTONS, &buttonCount);
- caps.buttonCount = buttonCount;
- if (caps.buttonCount > Joystick::ButtonCount)
- caps.buttonCount = Joystick::ButtonCount;
-
- // Get the supported axes
- char axesCount;
- ioctl(m_file, JSIOCGAXES, &axesCount);
- for (int i = 0; i < axesCount; ++i)
- {
- switch (m_mapping[i])
- {
- case ABS_X : caps.axes[Joystick::X] = true; break;
- case ABS_Y : caps.axes[Joystick::Y] = true; break;
- case ABS_Z :
- case ABS_THROTTLE : caps.axes[Joystick::Z] = true; break;
- case ABS_RZ:
- case ABS_RUDDER: caps.axes[Joystick::R] = true; break;
- case ABS_RX : caps.axes[Joystick::U] = true; break;
- case ABS_RY : caps.axes[Joystick::V] = true; break;
- case ABS_HAT0X : caps.axes[Joystick::PovX] = true; break;
- case ABS_HAT0Y : caps.axes[Joystick::PovY] = true; break;
- default : break;
- }
- }
-
- return caps;
-}
-
-
-////////////////////////////////////////////////////////////
-JoystickState JoystickImpl::JoystickImpl::update()
-{
- // pop events from the joystick file
- js_event joyState;
- while (read(m_file, &joyState, sizeof(joyState)) > 0)
- {
- switch (joyState.type & ~JS_EVENT_INIT)
- {
- // An axis was moved
- case JS_EVENT_AXIS :
- {
- float value = joyState.value * 100.f / 32767.f;
- switch (m_mapping[joyState.number])
- {
- case ABS_X : m_state.axes[Joystick::X] = value; break;
- case ABS_Y : m_state.axes[Joystick::Y] = value; break;
- case ABS_Z :
- case ABS_THROTTLE : m_state.axes[Joystick::Z] = value; break;
- case ABS_RZ:
- case ABS_RUDDER: m_state.axes[Joystick::R] = value; break;
- case ABS_RX : m_state.axes[Joystick::U] = value; break;
- case ABS_RY : m_state.axes[Joystick::V] = value; break;
- case ABS_HAT0X : m_state.axes[Joystick::PovX] = value; break;
- case ABS_HAT0Y : m_state.axes[Joystick::PovY] = value; break;
- default : break;
- }
- break;
- }
-
- // A button was pressed
- case JS_EVENT_BUTTON :
- {
- if (joyState.number < Joystick::ButtonCount)
- m_state.buttons[joyState.number] = (joyState.value != 0);
- break;
- }
- }
- }
-
- // Check the connection state of the joystick (read() fails with an error != EGAIN if it's no longer connected)
- m_state.connected = (errno == EAGAIN);
-
- return m_state;
-}
-
-} // namespace priv
-
-} // namespace sf
diff --git a/src/SFML/Window/Mouse.cpp b/src/SFML/Window/Mouse.cpp
index e8b6b0c..d1e88a7 100644
--- a/src/SFML/Window/Mouse.cpp
+++ b/src/SFML/Window/Mouse.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
diff --git a/src/SFML/Window/OSX/AutoreleasePoolWrapper.h b/src/SFML/Window/OSX/AutoreleasePoolWrapper.h
index f357e23..90bc974 100644
--- a/src/SFML/Window/OSX/AutoreleasePoolWrapper.h
+++ b/src/SFML/Window/OSX/AutoreleasePoolWrapper.h
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -24,28 +24,26 @@
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
-/// \brief Ensure at least one autorelease pool is available on this thread.
+/// \brief Ensure at least one autorelease pool is available on this thread
///
-/// Increment a retain count.
-/// See SPECIAL CONSIDERATION in implementation file.
+/// Increment a retain count for *this* thread.
///
-////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////
void retainPool(void);
////////////////////////////////////////////////////////////
-/// \brief Release the pool.
+/// \brief Drain the pool
///
-/// Drain the pool if it is no more needed (retain count is zero).
-/// See SPECIAL CONSIDERATION in implementation file.
+/// The pool retain count should be absolutely positive before calling this function on this thread.
///
-////////////////////////////////////////////////////////////
-void releasePool(void);
+////////////////////////////////////////////////////////////
+void drainCurrentPool(void);
////////////////////////////////////////////////////////////
-/// \brief Drain the pool.
+/// \brief Release the pool.
///
-/// releasePool must be called at least once before drainPool.
+/// Decrease the retain count for *this* thread.
///
-////////////////////////////////////////////////////////////
-void drainPool();
+////////////////////////////////////////////////////////////
+void releasePool(void);
diff --git a/src/SFML/Window/OSX/AutoreleasePoolWrapper.mm b/src/SFML/Window/OSX/AutoreleasePoolWrapper.mm
index 68c709b..89b6ce7 100644
--- a/src/SFML/Window/OSX/AutoreleasePoolWrapper.mm
+++ b/src/SFML/Window/OSX/AutoreleasePoolWrapper.mm
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -26,24 +26,26 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include <SFML/System/ThreadLocalPtr.hpp>
-#include <SFML/System/NonCopyable.hpp>
#include <SFML/System/Err.hpp>
+#include <SFML/System/NonCopyable.hpp>
+#include <SFML/System/ThreadLocalPtr.hpp>
+
+#include <cassert>
-#import <Foundation/Foundation.h>
#import <SFML/Window/OSX/AutoreleasePoolWrapper.h>
+#import <Foundation/Foundation.h>
////////////////////////////////////////////////////////////
-/// Here we manage one and only one pool by thread. This prevents draining one
+/// Here we manage one and only one pool by thread. This prevents draining one
/// pool and making other pools invalid which can lead to a crash on 10.5 and an
/// annoying message on 10.6 (*** attempt to pop an unknown autorelease pool).
///
/// Because NSAutoreleasePool cannot be retain we have to do it ourself.
/// We use an sf::ThreadLocalPtr to have one PoolWrapper in each thread.
///
-/// SPECIAL CONSIDERATION :
-/// =======================
+/// SPECIAL CONSIDERATION:
+/// ======================
/// This implies that if retainPool is called X times in a thread Y then
/// releasePool must be called X times too in the same thread Y.
///
@@ -54,56 +56,61 @@ namespace sf
namespace priv
{
////////////////////////////////////////////////////////////
-/// \brief C++ Wrapper of Obj-C Autorelease Pool.
+/// \brief C++ Wrapper of Obj-C Autorelease Pool
///
////////////////////////////////////////////////////////////
-class PoolWrapper : NonCopyable {
-public :
-
+class PoolWrapper : NonCopyable
+{
+public:
+
////////////////////////////////////////////////////////////
/// \brief Default constructor
///
////////////////////////////////////////////////////////////
PoolWrapper();
-
+
////////////////////////////////////////////////////////////
/// \brief Default destructor
///
+ /// Make sure the pool is drained (if appropriate)
+ ///
////////////////////////////////////////////////////////////
~PoolWrapper();
-
+
////////////////////////////////////////////////////////////
/// \brief Increment retain count and allocate memory if needed
///
////////////////////////////////////////////////////////////
void retain();
-
+
////////////////////////////////////////////////////////////
/// \brief Decrement retain count and releasing memory if needed
///
+ /// \return true if the pool wrapper can be released
+ ///
////////////////////////////////////////////////////////////
- void release();
-
+ bool release();
+
////////////////////////////////////////////////////////////
/// \brief Drain the pool
///
////////////////////////////////////////////////////////////
- void Drain();
-
+ void drain();
+
private:
-
+
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
- int m_count; ///< How many times was the pool retained ?
+ int m_count; ///< How many times was the pool retained?
NSAutoreleasePool* m_pool; ///< Our dedicated pool
};
////////////////////////////////////////////////////////////
-PoolWrapper::PoolWrapper()
-: m_count(0)
-, m_pool(0)
+PoolWrapper::PoolWrapper() :
+m_count(0),
+m_pool(nil)
{
/* Nothing else */
}
@@ -112,72 +119,45 @@ PoolWrapper::PoolWrapper()
////////////////////////////////////////////////////////////
PoolWrapper::~PoolWrapper()
{
-#ifdef SFML_DEBUG
- if (m_count < 0) {
- sf::err() << "~PoolWrapper : m_count is less than zero! "
- "You called releasePool from a thread too many times."
- << std::endl;
- } else if (m_count > 0) {
- sf::err() << "~PoolWrapper : m_count is greater than zero! "
- "You called releasePool from a thread to few times."
- << std::endl;
- } else { // m_count == 0
- sf::err() << "~PoolWrapper is HAPPY!" << std::endl;
- }
-#endif
+ // Make sure everything is drained
+ m_count = 0;
+ drain();
}
////////////////////////////////////////////////////////////
void PoolWrapper::retain()
{
- // Increase counter.
+ // Increase counter
++m_count;
-
- // Allocate pool if required.
- if (m_pool == 0) {
+
+ // Allocate pool if required
+ if (m_pool == nil)
m_pool = [[NSAutoreleasePool alloc] init];
- }
-
-#ifdef SFML_DEBUG
- if (m_count <= 0) {
- sf::err() << "PoolWrapper::retain : m_count <= 0! " << std::endl;
- }
-#endif
}
////////////////////////////////////////////////////////////
-void PoolWrapper::release()
+bool PoolWrapper::release()
{
- // Decrease counter.
+ // Decrease counter
--m_count;
-
- // Drain pool if required.
- if (m_count == 0) {
- Drain();
- }
-
-#ifdef SFML_DEBUG
- if (m_count < 0) {
- sf::err() << "PoolWrapper::release : m_count < 0! " << std::endl;
- }
-#endif
+
+ return m_count == 0;
}
-void PoolWrapper::Drain()
+void PoolWrapper::drain()
{
[m_pool drain];
- m_pool = 0;
-
- if (m_count != 0) {
+ m_pool = nil;
+
+ if (m_count != 0)
m_pool = [[NSAutoreleasePool alloc] init];
- }
}
-
+
} // namespace priv
-
+
} // namespace sf
////////////////////////////////////////////////////////////
@@ -194,46 +174,32 @@ namespace
void retainPool(void)
{
// First, Check that we have a valid PoolWrapper object in our local pool.
- if (localPool == NULL) {
+ if (localPool == NULL)
localPool = new sf::priv::PoolWrapper();
- }
-
+
// Then retains!
localPool->retain();
}
////////////////////////////////////////////////////////////
-void releasePool(void)
+void drainCurrentPool(void)
{
-#ifdef SFML_DEBUG
- if (localPool == NULL) {
- sf::err() << "releasePool : You must call retainPool at least once "
- "in this thread before calling releasePool."
- << std::endl;
- } else {
-#endif
-
- // Releases, that's all.
- localPool->release();
-
-#ifdef SFML_DEBUG
- }
-#endif
+ assert(localPool != NULL);
+ localPool->drain();
}
////////////////////////////////////////////////////////////
-void drainPool()
+void releasePool(void)
{
- if (localPool != NULL) {
- localPool->Drain();
- }
-#ifdef SFML_DEBUG
- else {
- sf::err() << "releasePool must be called at least one before drainPool"
- << std::endl;
+ assert(localPool != NULL);
+
+ // If we're done with the pool, let's release the memory
+ if (localPool->release())
+ {
+ delete localPool;
+ localPool = NULL;
}
-#endif
}
diff --git a/src/SFML/Window/OSX/HIDInputManager.hpp b/src/SFML/Window/OSX/HIDInputManager.hpp
index e6f7229..202f23d 100644
--- a/src/SFML/Window/OSX/HIDInputManager.hpp
+++ b/src/SFML/Window/OSX/HIDInputManager.hpp
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -29,29 +29,32 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include <SFML/System/NonCopyable.hpp>
#include <SFML/Window/JoystickImpl.hpp>
#include <SFML/Window/Keyboard.hpp>
-#include <SFML/Window/Mouse.hpp>
+#include <SFML/System/NonCopyable.hpp>
#include <Carbon/Carbon.h>
-#include <IOKit/hid/IOHIDManager.h>
#include <IOKit/hid/IOHIDDevice.h>
+#include <IOKit/hid/IOHIDManager.h>
#include <vector>
namespace sf
{
namespace priv
{
+
+typedef std::vector<IOHIDElementRef> IOHIDElements;
+
////////////////////////////////////////////////////////////
-/// \brief This class manage as a singleton instance the
-/// keyboard and mouse states. It's only purpose is
-/// to help sf::priv::InputImpl class.
+/// \brief sf::priv::InputImpl helper
+///
+/// This class manage as a singleton instance the keyboard state.
+/// Its purpose is to help sf::priv::InputImpl class.
///
////////////////////////////////////////////////////////////
class HIDInputManager : NonCopyable
{
-public :
-
+public:
+
////////////////////////////////////////////////////////////
/// \brief Get the unique instance of the class
///
@@ -61,7 +64,7 @@ public :
///
////////////////////////////////////////////////////////////
static HIDInputManager& getInstance();
-
+
////////////////////////////////////////////////////////////
/// \brief Check if a key is pressed
///
@@ -71,19 +74,9 @@ public :
///
////////////////////////////////////////////////////////////
bool isKeyPressed(Keyboard::Key key);
-
- ////////////////////////////////////////////////////////////
- /// \brief Check if a mouse button is pressed
- ///
- /// \param button Button to check
- ///
- /// \return True if the button is pressed, false otherwise
- ///
- ////////////////////////////////////////////////////////////
- bool isMouseButtonPressed(Mouse::Button button);
-public :
-
+public:
+
////////////////////////////////////////////////////////////
/// \brief Get the usb location ID of a given device
///
@@ -94,7 +87,7 @@ public :
///
////////////////////////////////////////////////////////////
static long getLocationID(IOHIDDeviceRef device);
-
+
////////////////////////////////////////////////////////////
/// \brief Create a mask (dictionary) for an IOHIDManager
///
@@ -104,7 +97,7 @@ public :
///
////////////////////////////////////////////////////////////
static CFDictionaryRef copyDevicesMask(UInt32 page, UInt32 usage);
-
+
////////////////////////////////////////////////////////////
/// Try to convert a character into a SFML key code.
///
@@ -117,7 +110,7 @@ public :
///
////////////////////////////////////////////////////////////
static Keyboard::Key localizedKeys(UniChar ch);
-
+
////////////////////////////////////////////////////////////
/// Try to convert a virtual keycode into a SFML key code.
///
@@ -126,20 +119,20 @@ public :
////////////////////////////////////////////////////////////
static Keyboard::Key nonLocalizedKeys(UniChar virtualKeycode);
-private :
+private:
////////////////////////////////////////////////////////////
/// \brief Default constructor
///
////////////////////////////////////////////////////////////
HIDInputManager();
-
+
////////////////////////////////////////////////////////////
/// \brief Destructor
///
////////////////////////////////////////////////////////////
~HIDInputManager();
-
+
////////////////////////////////////////////////////////////
/// \brief Initialize the keyboard part of this class
///
@@ -147,15 +140,7 @@ private :
///
////////////////////////////////////////////////////////////
void initializeKeyboard();
-
- ////////////////////////////////////////////////////////////
- /// \brief Initialize the mouse part of this class
- ///
- /// If something went wrong freeUp is called
- ///
- ////////////////////////////////////////////////////////////
- void initializeMouse();
-
+
////////////////////////////////////////////////////////////
/// \brief Load the given keyboard into m_keys
///
@@ -166,18 +151,7 @@ private :
///
////////////////////////////////////////////////////////////
void loadKeyboard(IOHIDDeviceRef keyboard);
-
- ////////////////////////////////////////////////////////////
- /// \brief Load the given mouse into m_buttons
- ///
- /// If the given mouse has no button this function simply
- /// returns. freeUp is _not_ called because this is not fatal.
- ///
- /// \param mouse Mouse to load
- ///
- ////////////////////////////////////////////////////////////
- void loadMouse(IOHIDDeviceRef mouse);
-
+
////////////////////////////////////////////////////////////
/// \brief Load the given key into m_keys
///
@@ -187,17 +161,7 @@ private :
///
////////////////////////////////////////////////////////////
void loadKey(IOHIDElementRef key);
-
- ////////////////////////////////////////////////////////////
- /// \brief Load the given button into m_buttons
- ///
- /// freeUp is _not_ called by this function.
- ///
- /// \param button Button to load
- ///
- ////////////////////////////////////////////////////////////
- void loadButton(IOHIDElementRef button);
-
+
////////////////////////////////////////////////////////////
/// \brief Release all resources
///
@@ -206,9 +170,9 @@ private :
///
////////////////////////////////////////////////////////////
void freeUp();
-
+
////////////////////////////////////////////////////////////
- /// \brief Filter the devices and return them.
+ /// \brief Filter the devices and return them
///
/// freeUp is _not_ called by this function.
///
@@ -218,7 +182,19 @@ private :
///
////////////////////////////////////////////////////////////
CFSetRef copyDevices(UInt32 page, UInt32 usage);
-
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a key is pressed
+ ///
+ /// \param elements HID elements mapping to this key
+ ///
+ /// \return True if the key is pressed, false otherwise
+ ///
+ /// \see isKeyPressed, isMouseButtonPressed
+ ///
+ ////////////////////////////////////////////////////////////
+ bool isPressed(IOHIDElements& elements);
+
////////////////////////////////////////////////////////////
/// \brief Convert a HID key usage to its corresponding virtual code
///
@@ -231,8 +207,8 @@ private :
////////////////////////////////////////////////////////////
static UInt8 usageToVirtualCode(UInt32 usage);
-private :
-
+private:
+
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
@@ -240,11 +216,9 @@ private :
CFDataRef m_layoutData; ///< CFData containing the layout
UCKeyboardLayout* m_layout; ///< Current Keyboard Layout
IOHIDManagerRef m_manager; ///< HID Manager
-
- typedef std::vector<IOHIDElementRef> IOHIDElements;
+
IOHIDElements m_keys[Keyboard::KeyCount]; ///< All the keys on any connected keyboard
- IOHIDElements m_buttons[Mouse::ButtonCount];///< All the buttons on any connected mouse
-
+
////////////////////////////////////////////////////////////
/// m_keys' index corresponds to sf::Keyboard::Key enum.
/// if no key is assigned with key XYZ then m_keys[XYZ].size() == 0.
@@ -252,13 +226,11 @@ private :
/// with the same sf::Keyboard::Key then m_keys[XYZ] contains all these
/// HID keys.
///
- /// m_buttons works the same way.
- ///
////////////////////////////////////////////////////////////
};
} // namespace priv
-
+
} // namespace sf
#endif
diff --git a/src/SFML/Window/OSX/HIDInputManager.mm b/src/SFML/Window/OSX/HIDInputManager.mm
index 9f5b2d2..e4dc9e1 100644
--- a/src/SFML/Window/OSX/HIDInputManager.mm
+++ b/src/SFML/Window/OSX/HIDInputManager.mm
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -45,85 +45,7 @@ HIDInputManager& HIDInputManager::getInstance()
////////////////////////////////////////////////////////////
bool HIDInputManager::isKeyPressed(Keyboard::Key key)
{
- if (!m_isValid) {
- sf::err() << "HIDInputManager is invalid." << std::endl;
- return false;
- }
-
- // state = true if at least one corresponding HID key is pressed
- bool state = false;
-
- for (IOHIDElements::iterator it = m_keys[key].begin(); it != m_keys[key].end(); ++it) {
-
- IOHIDValueRef value = 0;
-
- IOHIDDeviceRef device = IOHIDElementGetDevice(*it);
- IOHIDDeviceGetValue(device, *it, &value);
-
- if (!value) {
-
- // This means some kind of error / deconnection so we remove this
- // element from our keys
-
- CFRelease(*it);
- it = m_keys[key].erase(it);
-
- } else if (IOHIDValueGetIntegerValue(value) == 1) {
-
- // This means the key is pressed
- state = true;
- break; // Stop here
-
- } else {
-
- // This means the key is released
- }
-
- }
-
- return state;
-}
-
-////////////////////////////////////////////////////////////
-bool HIDInputManager::isMouseButtonPressed(Mouse::Button button)
-{
- if (!m_isValid) {
- sf::err() << "HIDInputManager is invalid." << std::endl;
- return false;
- }
-
- // state = true if at least one corresponding HID button is pressed
- bool state = false;
-
- for (IOHIDElements::iterator it = m_buttons[button].begin(); it != m_buttons[button].end(); ++it) {
-
- IOHIDValueRef value = 0;
-
- IOHIDDeviceRef device = IOHIDElementGetDevice(*it);
- IOHIDDeviceGetValue(device, *it, &value);
-
- if (!value) {
-
- // This means some kind of error / deconnection so we remove this
- // element from our buttons
-
- CFRelease(*it);
- it = m_buttons[button].erase(it);
-
- } else if (IOHIDValueGetIntegerValue(value) == 1) {
-
- // This means the button is pressed
- state = true;
- break; // Stop here
-
- } else {
-
- // This means the button is released
- }
-
- }
-
- return state;
+ return isPressed(m_keys[key]);
}
@@ -131,20 +53,18 @@ bool HIDInputManager::isMouseButtonPressed(Mouse::Button button)
long HIDInputManager::getLocationID(IOHIDDeviceRef device)
{
long loc = 0;
-
- // Get a unique ID : its usb location ID
- CFTypeRef typeRef = IOHIDDeviceGetProperty(device,
+
+ // Get a unique ID: its USB location ID
+ CFTypeRef typeRef = IOHIDDeviceGetProperty(device,
CFSTR(kIOHIDLocationIDKey));
- if (!typeRef || CFGetTypeID(typeRef) != CFNumberGetTypeID()) {
+ if (!typeRef || (CFGetTypeID(typeRef) != CFNumberGetTypeID()))
return 0;
- }
-
+
CFNumberRef locRef = (CFNumberRef)typeRef;
-
- if (!CFNumberGetValue(locRef, kCFNumberLongType, &loc)) {
+
+ if (!CFNumberGetValue(locRef, kCFNumberLongType, &loc))
return 0;
- }
-
+
return loc;
}
@@ -153,75 +73,65 @@ long HIDInputManager::getLocationID(IOHIDDeviceRef device)
CFDictionaryRef HIDInputManager::copyDevicesMask(UInt32 page, UInt32 usage)
{
// Create the dictionary.
- CFMutableDictionaryRef dict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2,
+ CFMutableDictionaryRef dict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2,
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
-
+
// Add the page value.
CFNumberRef value = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &page);
CFDictionarySetValue(dict, CFSTR(kIOHIDDeviceUsagePageKey), value);
CFRelease(value);
-
+
// Add the usage value (which is only valid if page value exists).
value = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &usage);
CFDictionarySetValue(dict, CFSTR(kIOHIDDeviceUsageKey), value);
CFRelease(value);
-
+
return dict;
}
////////////////////////////////////////////////////////////
-HIDInputManager::HIDInputManager()
-: m_isValid(true)
-, m_layoutData(0)
-, m_layout(0)
-, m_manager(0)
+HIDInputManager::HIDInputManager() :
+m_isValid(true),
+m_layoutData(0),
+m_layout(0),
+m_manager(0)
{
// Get the current keyboard layout
- TISInputSourceRef tis = TISCopyCurrentKeyboardLayoutInputSource();
- m_layoutData = (CFDataRef)TISGetInputSourceProperty(tis,
+ TISInputSourceRef tis = TISCopyCurrentKeyboardLayoutInputSource();
+ m_layoutData = (CFDataRef)TISGetInputSourceProperty(tis,
kTISPropertyUnicodeKeyLayoutData);
-
- if (m_layoutData == 0) {
+
+ if (m_layoutData == 0)
+ {
sf::err() << "Cannot get the keyboard layout" << std::endl;
freeUp();
return;
}
-
+
// Keep a reference for ourself
CFRetain(m_layoutData);
m_layout = (UCKeyboardLayout *)CFDataGetBytePtr(m_layoutData);
-
+
// The TIS is no more needed
CFRelease(tis);
-
+
// Create an HID Manager reference
m_manager = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone);
// Open the HID Manager reference
IOReturn openStatus = IOHIDManagerOpen(m_manager, kIOHIDOptionsTypeNone);
-
- if (openStatus != kIOReturnSuccess) {
+
+ if (openStatus != kIOReturnSuccess)
+ {
sf::err() << "Error when opening the HID manager" << std::endl;
-
freeUp();
return;
}
-
+
// Initialize the keyboard
initializeKeyboard();
-
- if (!m_isValid) {
- return; // Something went wrong
- }
-
- // Initialize the mouse
- initializeMouse();
-
- if (!m_isValid) {
- return; // Something went wrong
- }
}
@@ -235,146 +145,73 @@ HIDInputManager::~HIDInputManager()
void HIDInputManager::initializeKeyboard()
{
////////////////////////////////////////////////////////////
- // The purpose of this function is to initalize m_keys so we can get
+ // The purpose of this function is to initialize m_keys so we can get
// the associate IOHIDElementRef with a sf::Keyboard::Key in ~constant~ time.
-
+
// Get only keyboards
CFSetRef keyboards = copyDevices(kHIDPage_GenericDesktop, kHIDUsage_GD_Keyboard);
- if (keyboards == NULL) {
+ if (keyboards == NULL)
+ {
freeUp();
return;
}
-
+
CFIndex keyboardCount = CFSetGetCount(keyboards); // >= 1 (asserted by copyDevices)
-
+
// Get an iterable array
CFTypeRef devicesArray[keyboardCount];
CFSetGetValues(keyboards, devicesArray);
-
- for (CFIndex i = 0; i < keyboardCount; ++i) {
-
+
+ for (CFIndex i = 0; i < keyboardCount; ++i)
+ {
IOHIDDeviceRef keyboard = (IOHIDDeviceRef)devicesArray[i];
-
loadKeyboard(keyboard);
}
-
+
// Release unused stuff
CFRelease(keyboards);
-
+
////////////////////////////////////////////////////////////
// At this point m_keys is filled with as many IOHIDElementRef as possible
}
////////////////////////////////////////////////////////////
-void HIDInputManager::initializeMouse()
-{
- ////////////////////////////////////////////////////////////
- // The purpose of this function is to initalize m_buttons so we can get
- // the associate IOHIDElementRef with a sf::Mouse::Button in ~constant~ time.
-
- // Get only mouses
- CFSetRef mouses = copyDevices(kHIDPage_GenericDesktop, kHIDUsage_GD_Mouse);
- if (mouses == NULL) {
- freeUp();
- return;
- }
-
- CFIndex mouseCount = CFSetGetCount(mouses); // >= 1 (asserted by copyDevices)
-
- // Get an iterable array
- CFTypeRef devicesArray[mouseCount];
- CFSetGetValues(mouses, devicesArray);
-
- for (CFIndex i = 0; i < mouseCount; ++i) {
-
- IOHIDDeviceRef mouse = (IOHIDDeviceRef)devicesArray[i];
-
- loadMouse(mouse);
- }
-
- // Release unused stuff
- CFRelease(mouses);
-
- ////////////////////////////////////////////////////////////
- // At this point m_buttons is filled with as many IOHIDElementRef as possible
-}
-
-
-////////////////////////////////////////////////////////////
void HIDInputManager::loadKeyboard(IOHIDDeviceRef keyboard)
{
CFArrayRef keys = IOHIDDeviceCopyMatchingElements(keyboard,
NULL,
kIOHIDOptionsTypeNone);
- if (keys == NULL) {
+ if (keys == NULL)
+ {
sf::err() << "We got a keyboard without any keys (1)" << std::endl;
return;
}
-
- // How many elements are there ?
+
+ // How many elements are there?
CFIndex keysCount = CFArrayGetCount(keys);
-
- if (keysCount == 0) {
+
+ if (keysCount == 0)
+ {
sf::err() << "We got a keyboard without any keys (2)" << std::endl;
CFRelease(keys);
return;
}
-
+
// Go through all connected elements.
- for (CFIndex i = 0; i < keysCount; ++i) {
-
+ for (CFIndex i = 0; i < keysCount; ++i)
+ {
IOHIDElementRef aKey = (IOHIDElementRef) CFArrayGetValueAtIndex(keys, i);
-
+
// Skip non-matching keys elements
- if (IOHIDElementGetUsagePage(aKey) != kHIDPage_KeyboardOrKeypad) {
+ if (IOHIDElementGetUsagePage(aKey) != kHIDPage_KeyboardOrKeypad)
continue;
- }
-
+
loadKey(aKey);
-
}
-
- // Release unused stuff
- CFRelease(keys);
-}
-
-////////////////////////////////////////////////////////////
-void HIDInputManager::loadMouse(IOHIDDeviceRef mouse)
-{
- CFArrayRef buttons = IOHIDDeviceCopyMatchingElements(mouse,
- NULL,
- kIOHIDOptionsTypeNone);
- if (buttons == NULL) {
- sf::err() << "We got a mouse without any buttons (1)" << std::endl;
- return;
- }
-
- // How many elements are there ?
- CFIndex buttonCount = CFArrayGetCount(buttons);
-
- if (buttonCount == 0) {
- sf::err() << "We got a mouse without any buttons (2)" << std::endl;
- CFRelease(buttons);
- return;
- }
-
- // Go through all connected elements.
- for (CFIndex i = 0; i < buttonCount; ++i) {
-
- IOHIDElementRef aButton = (IOHIDElementRef) CFArrayGetValueAtIndex(buttons, i);
-
- // Skip non-matching keys elements
- if (IOHIDElementGetUsagePage(aButton) != kHIDPage_Button) {
- continue;
- }
-
- loadButton(aButton);
- }
-
// Release unused stuff
- CFRelease(buttons);
+ CFRelease(keys);
}
@@ -384,22 +221,21 @@ void HIDInputManager::loadKey(IOHIDElementRef key)
// Get its virtual code
UInt32 usageCode = IOHIDElementGetUsage(key);
UInt8 virtualCode = usageToVirtualCode(usageCode);
-
- if (virtualCode == 0xff) {
+
+ if (virtualCode == 0xff)
return; // no corresponding virtual code -> skip
- }
-
- // Now translate the virtual code to unicode according to
+
+ // Now translate the virtual code to Unicode according to
// the current keyboard layout
-
+
UInt32 deadKeyState = 0;
// Unicode string length is usually less or equal to 4
UniCharCount maxStringLength = 4;
UniCharCount actualStringLength = 0;
UniChar unicodeString[maxStringLength];
-
+
OSStatus error;
-
+
error = UCKeyTranslate(m_layout, // current layout
virtualCode, // our key
kUCKeyActionDown, // or kUCKeyActionUp ?
@@ -410,40 +246,37 @@ void HIDInputManager::loadKey(IOHIDElementRef key)
maxStringLength, // our memory limit
&actualStringLength, // length of what we get
unicodeString); // what we get
-
- if (error == noErr) {
+
+ if (error == noErr)
+ {
// Translation went fine
-
+
// The corresponding SFML key code
Keyboard::Key code = Keyboard::Unknown; // KeyCound means 'none'
-
- // First we look if the key down is from a list of characters
+
+ // First we look if the key down is from a list of characters
// that depend on keyboard localization
- if (actualStringLength > 0) {
+ if (actualStringLength > 0)
code = localizedKeys(unicodeString[0]);
- }
-
+
// The key is not a localized one so we try to find a
// corresponding code through virtual key code
- if (code == Keyboard::Unknown) {
+ if (code == Keyboard::Unknown)
code = nonLocalizedKeys(virtualCode);
- }
-
+
// A code was found, wonderful!
- if (code != Keyboard::Unknown) {
-
- // Ok, everything went fine. Now we have a unique
+ if (code != Keyboard::Unknown)
+ {
+ // Ok, everything went fine. Now we have a unique
// corresponding sf::Keyboard::Key to one IOHIDElementRef
-
m_keys[code].push_back(key);
-
+
// And don't forget to keep the reference alive for our usage
CFRetain(m_keys[code].back());
-
}
-
+
////////////////////////////////////////////////////////////
- // These are known to be unbound :
+ // These are known to be unbound:
// Supposed Virtual | HID | Supposed Key
// ===============================================
// 0x1b | 0x2d | Hyphen
@@ -451,9 +284,9 @@ void HIDInputManager::loadKey(IOHIDElementRef key)
// 0x47 | 0x53 | NumLock
// 0x6e | 0x65 | Application
// 0x4c | 0x77 | Select
-
+
//if (code == Keyboard::Unknown) { // The key is unknown.
- // sf::err() << "This is an unknow key. Virtual key code is 0x"
+ // sf::err() << "This is an unknown key. Virtual key code is 0x"
// << std::hex
// << (UInt32)virtualCode
// << " and HID usage code is 0x"
@@ -462,11 +295,11 @@ void HIDInputManager::loadKey(IOHIDElementRef key)
// << "."
// << std::endl;
//}
-
- } /* if (error == noErr) */
- else {
-
- sf::err() << "Cannot translate the virtual key code, error : "
+
+ } /* if (error == noErr) */
+ else
+ {
+ sf::err() << "Cannot translate the virtual key code, error: "
<< error
<< std::endl;
}
@@ -474,97 +307,105 @@ void HIDInputManager::loadKey(IOHIDElementRef key)
////////////////////////////////////////////////////////////
-void HIDInputManager::loadButton(IOHIDElementRef button)
-{
- // Identify the button
- UInt32 usage = IOHIDElementGetUsage(button);
- Mouse::Button dest = Mouse::ButtonCount;
-
- // Extends kHIDUsage_Button_* enum with :
-#define kHIDUsage_Button_5 0x05
-
- switch (usage) {
- case kHIDUsage_Button_1: dest = Mouse::Left; break;
- case kHIDUsage_Button_2: dest = Mouse::Right; break;
- case kHIDUsage_Button_3: dest = Mouse::Middle; break;
- case kHIDUsage_Button_4: dest = Mouse::XButton1; break;
- case kHIDUsage_Button_5: dest = Mouse::XButton2; break;
- default: dest = Mouse::ButtonCount; break;
- }
-
- if (dest != Mouse::ButtonCount) {
- // We know what kind of button it is!
-
- m_buttons[dest].push_back(button);
-
- // And don't forget to keep the reference alive for our usage
- CFRetain(m_buttons[dest].back());
- }
-}
-
-
-////////////////////////////////////////////////////////////
void HIDInputManager::freeUp()
{
m_isValid = false;
-
- if (m_layoutData != 0) CFRelease(m_layoutData);
- // Do not release m_layout ! It is owned by m_layoutData.
- if (m_manager != 0) CFRelease(m_manager);
-
- for (unsigned int i = 0; i < Keyboard::KeyCount; ++i) {
- for (IOHIDElements::iterator it = m_keys[i].begin(); it != m_keys[i].end(); ++it) {
+
+ if (m_layoutData != 0)
+ CFRelease(m_layoutData);
+ // Do not release m_layout! It is owned by m_layoutData.
+ if (m_manager != 0)
+ CFRelease(m_manager);
+
+ for (unsigned int i = 0; i < Keyboard::KeyCount; ++i)
+ {
+ for (IOHIDElements::iterator it = m_keys[i].begin(); it != m_keys[i].end(); ++it)
CFRelease(*it);
- }
+
m_keys[i].clear();
}
-
- for (unsigned int i = 0; i < Mouse::ButtonCount; ++i) {
- for (IOHIDElements::iterator it = m_buttons[i].begin(); it != m_buttons[i].end(); ++it) {
- CFRelease(*it);
- }
- m_buttons[i].clear();
- }
}
-
-
+
+
////////////////////////////////////////////////////////////
CFSetRef HIDInputManager::copyDevices(UInt32 page, UInt32 usage)
{
// Filter and keep only the requested devices
CFDictionaryRef mask = copyDevicesMask(page, usage);
-
+
IOHIDManagerSetDeviceMatching(m_manager, mask);
-
+
CFRelease(mask);
mask = 0;
-
+
CFSetRef devices = IOHIDManagerCopyDevices(m_manager);
- if (devices == NULL) {
+ if (devices == NULL)
return NULL;
- }
-
- // Is there at least one device ?
+
+ // Is there at least one device?
CFIndex deviceCount = CFSetGetCount(devices);
- if (deviceCount < 1) {
+ if (deviceCount < 1)
+ {
CFRelease(devices);
return NULL;
}
-
+
return devices;
}
+bool HIDInputManager::isPressed(IOHIDElements& elements)
+{
+ if (!m_isValid)
+ {
+ sf::err() << "HIDInputManager is invalid." << std::endl;
+ return false;
+ }
+
+ // state = true if at least one corresponding HID button is pressed
+ bool state = false;
+
+ for (IOHIDElements::iterator it = elements.begin(); it != elements.end(); /* noop */)
+ {
+ IOHIDValueRef value = 0;
+
+ IOHIDDeviceRef device = IOHIDElementGetDevice(*it);
+ IOHIDDeviceGetValue(device, *it, &value);
+
+ if (!value)
+ {
+ // This means some kind of error / disconnection so we remove this
+ // element from our buttons
+ CFRelease(*it);
+ it = elements.erase(it);
+ }
+ else if (IOHIDValueGetIntegerValue(value) == 1)
+ {
+ // This means the button is pressed
+ state = true;
+ break; // Stop here
+ }
+ else
+ {
+ // This means the button is released
+ ++it;
+ }
+ }
+
+ return state;
+}
+
////////////////////////////////////////////////////////////
UInt8 HIDInputManager::usageToVirtualCode(UInt32 usage)
{
// Some usage key doesn't have any corresponding virtual
// code or it was not found (return 0xff).
- switch (usage) {
+ switch (usage)
+ {
case kHIDUsage_KeyboardErrorRollOver: return 0xff;
case kHIDUsage_KeyboardPOSTFail: return 0xff;
case kHIDUsage_KeyboardErrorUndefined: return 0xff;
-
+
case kHIDUsage_KeyboardA: return 0x00;
case kHIDUsage_KeyboardB: return 0x0b;
case kHIDUsage_KeyboardC: return 0x08;
@@ -741,9 +582,9 @@ UInt8 HIDInputManager::usageToVirtualCode(UInt32 usage)
case kHIDUsage_KeyboardClearOrAgain: return 0xff;
case kHIDUsage_KeyboardCrSelOrProps: return 0xff;
case kHIDUsage_KeyboardExSel: return 0xff;
-
+
/* 0xa5-0xdf Reserved */
-
+
case kHIDUsage_KeyboardLeftControl: return 0x3b;
case kHIDUsage_KeyboardLeftShift: return 0x38;
case kHIDUsage_KeyboardLeftAlt: return 0x3a;
@@ -754,95 +595,96 @@ UInt8 HIDInputManager::usageToVirtualCode(UInt32 usage)
case kHIDUsage_KeyboardRightGUI: return 0x36;
/* 0xe8-0xffff Reserved */
-
+
case kHIDUsage_Keyboard_Reserved: return 0xff;
default: return 0xff;
}
}
-
+
////////////////////////////////////////////////////////
Keyboard::Key HIDInputManager::localizedKeys(UniChar ch)
{
- switch (ch) {
+ switch (ch)
+ {
case 'a':
case 'A': return sf::Keyboard::A;
-
+
case 'b':
case 'B': return sf::Keyboard::B;
-
+
case 'c':
case 'C': return sf::Keyboard::C;
-
+
case 'd':
case 'D': return sf::Keyboard::D;
-
+
case 'e':
case 'E': return sf::Keyboard::E;
-
+
case 'f':
case 'F': return sf::Keyboard::F;
-
+
case 'g':
case 'G': return sf::Keyboard::G;
-
+
case 'h':
case 'H': return sf::Keyboard::H;
-
+
case 'i':
case 'I': return sf::Keyboard::I;
-
+
case 'j':
case 'J': return sf::Keyboard::J;
-
+
case 'k':
case 'K': return sf::Keyboard::K;
-
+
case 'l':
case 'L': return sf::Keyboard::L;
-
+
case 'm':
case 'M': return sf::Keyboard::M;
-
+
case 'n':
case 'N': return sf::Keyboard::N;
-
+
case 'o':
case 'O': return sf::Keyboard::O;
-
+
case 'p':
case 'P': return sf::Keyboard::P;
-
+
case 'q':
case 'Q': return sf::Keyboard::Q;
-
+
case 'r':
case 'R': return sf::Keyboard::R;
-
+
case 's':
case 'S': return sf::Keyboard::S;
-
+
case 't':
case 'T': return sf::Keyboard::T;
-
+
case 'u':
case 'U': return sf::Keyboard::U;
-
+
case 'v':
case 'V': return sf::Keyboard::V;
-
+
case 'w':
case 'W': return sf::Keyboard::W;
-
+
case 'x':
case 'X': return sf::Keyboard::X;
-
+
case 'y':
case 'Y': return sf::Keyboard::Y;
-
+
case 'z':
case 'Z': return sf::Keyboard::Z;
-
+
// The key is not 'localized'.
default: return sf::Keyboard::Unknown;
}
@@ -854,7 +696,8 @@ Keyboard::Key HIDInputManager::nonLocalizedKeys(UniChar virtualKeycode)
{
// (Some) 0x code based on http://forums.macrumors.com/showthread.php?t=780577
// Some sf::Keyboard::Key are present twice.
- switch (virtualKeycode) {
+ switch (virtualKeycode)
+ {
// These cases should not be used but anyway...
case 0x00: return sf::Keyboard::A;
case 0x0b: return sf::Keyboard::B;
@@ -882,7 +725,7 @@ Keyboard::Key HIDInputManager::nonLocalizedKeys(UniChar virtualKeycode)
case 0x07: return sf::Keyboard::X;
case 0x10: return sf::Keyboard::Y;
case 0x06: return sf::Keyboard::Z;
-
+
// These cases should not be used but anyway...
case 0x1d: return sf::Keyboard::Num0;
case 0x12: return sf::Keyboard::Num1;
@@ -894,9 +737,9 @@ Keyboard::Key HIDInputManager::nonLocalizedKeys(UniChar virtualKeycode)
case 0x1a: return sf::Keyboard::Num7;
case 0x1c: return sf::Keyboard::Num8;
case 0x19: return sf::Keyboard::Num9;
-
+
case 0x35: return sf::Keyboard::Escape;
-
+
// Modifier keys : never happen with keyDown/keyUp methods (?)
case 0x3b: return sf::Keyboard::LControl;
case 0x38: return sf::Keyboard::LShift;
@@ -906,10 +749,10 @@ Keyboard::Key HIDInputManager::nonLocalizedKeys(UniChar virtualKeycode)
case 0x3c: return sf::Keyboard::RShift;
case 0x3d: return sf::Keyboard::RAlt;
case 0x36: return sf::Keyboard::RSystem;
-
+
case 0x7f: return sf::Keyboard::Menu;
case NSMenuFunctionKey: return sf::Keyboard::Menu;
-
+
case 0x21: return sf::Keyboard::LBracket;
case 0x1e: return sf::Keyboard::RBracket;
case 0x29: return sf::Keyboard::SemiColon;
@@ -919,7 +762,7 @@ Keyboard::Key HIDInputManager::nonLocalizedKeys(UniChar virtualKeycode)
case 0x27: return sf::Keyboard::Quote;
case 0x2c: return sf::Keyboard::Slash;
case 0x2a: return sf::Keyboard::BackSlash;
-
+
#warning sf::Keyboard::Tilde might be in conflict with some other key.
// 0x0a is for "Non-US Backslash" according to HID Calibrator,
// a sample provided by Apple.
@@ -933,39 +776,39 @@ Keyboard::Key HIDInputManager::nonLocalizedKeys(UniChar virtualKeycode)
case 0x24: /* keyboard */ return sf::Keyboard::Return;
case 0x33: return sf::Keyboard::BackSpace;
case 0x30: return sf::Keyboard::Tab;
-
+
// Duplicates (see next §).
case 0x74: return sf::Keyboard::PageUp;
case 0x79: return sf::Keyboard::PageDown;
case 0x77: return sf::Keyboard::End;
case 0x73: return sf::Keyboard::Home;
-
+
case NSPageUpFunctionKey: return sf::Keyboard::PageUp;
case NSPageDownFunctionKey: return sf::Keyboard::PageDown;
case NSEndFunctionKey: return sf::Keyboard::End;
case NSHomeFunctionKey: return sf::Keyboard::Home;
-
+
case 0x72: return sf::Keyboard::Insert;
case NSInsertFunctionKey: return sf::Keyboard::Insert;
case 0x75: return sf::Keyboard::Delete;
case NSDeleteFunctionKey: return sf::Keyboard::Delete;
-
+
case 0x45: return sf::Keyboard::Add;
case 0x4e: return sf::Keyboard::Subtract;
case 0x43: return sf::Keyboard::Multiply;
case 0x4b: return sf::Keyboard::Divide;
-
+
// Duplicates (see next §).
case 0x7b: return sf::Keyboard::Left;
case 0x7c: return sf::Keyboard::Right;
case 0x7e: return sf::Keyboard::Up;
case 0x7d: return sf::Keyboard::Down;
-
+
case NSLeftArrowFunctionKey: return sf::Keyboard::Left;
case NSRightArrowFunctionKey: return sf::Keyboard::Right;
case NSUpArrowFunctionKey: return sf::Keyboard::Up;
case NSDownArrowFunctionKey: return sf::Keyboard::Down;
-
+
case 0x52: return sf::Keyboard::Numpad0;
case 0x53: return sf::Keyboard::Numpad1;
case 0x54: return sf::Keyboard::Numpad2;
@@ -976,7 +819,7 @@ Keyboard::Key HIDInputManager::nonLocalizedKeys(UniChar virtualKeycode)
case 0x59: return sf::Keyboard::Numpad7;
case 0x5b: return sf::Keyboard::Numpad8;
case 0x5c: return sf::Keyboard::Numpad9;
-
+
// Duplicates (see next §).
case 0x7a: return sf::Keyboard::F1;
case 0x78: return sf::Keyboard::F2;
@@ -993,7 +836,7 @@ Keyboard::Key HIDInputManager::nonLocalizedKeys(UniChar virtualKeycode)
case 0x69: return sf::Keyboard::F13;
case 0x6b: return sf::Keyboard::F14;
case 0x71: return sf::Keyboard::F15;
-
+
case NSF1FunctionKey: return sf::Keyboard::F1;
case NSF2FunctionKey: return sf::Keyboard::F2;
case NSF3FunctionKey: return sf::Keyboard::F3;
@@ -1009,12 +852,12 @@ Keyboard::Key HIDInputManager::nonLocalizedKeys(UniChar virtualKeycode)
case NSF13FunctionKey: return sf::Keyboard::F13;
case NSF14FunctionKey: return sf::Keyboard::F14;
case NSF15FunctionKey: return sf::Keyboard::F15;
-
+
case NSPauseFunctionKey: return sf::Keyboard::Pause;
-
+
#warning keycode 0x1b is not bound to any key.
// This key is ' on CH-FR, ) on FR and - on US layouts.
-
+
// An unknown key.
default: return sf::Keyboard::Unknown;
}
diff --git a/src/SFML/Window/OSX/HIDJoystickManager.cpp b/src/SFML/Window/OSX/HIDJoystickManager.cpp
index b2897a6..4b11152 100644
--- a/src/SFML/Window/OSX/HIDJoystickManager.cpp
+++ b/src/SFML/Window/OSX/HIDJoystickManager.cpp
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -26,8 +26,8 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include <SFML/Window/OSX/HIDJoystickManager.hpp>
#include <SFML/Window/OSX/HIDInputManager.hpp>
+#include <SFML/Window/OSX/HIDJoystickManager.hpp>
////////////////////////////////////////////////////////////
// Private data
@@ -36,7 +36,7 @@ namespace
{
// Using a custom run loop mode solve some issues that appears when SFML
// is used with Cocoa.
- CFStringRef const RunLoopMode = CFSTR("SFML_RUN_LOOP_MODE");
+ const CFStringRef RunLoopMode = CFSTR("SFML_RUN_LOOP_MODE");
}
@@ -69,37 +69,37 @@ CFSetRef HIDJoystickManager::copyJoysticks()
////////////////////////////////////////////////////////////
-HIDJoystickManager::HIDJoystickManager()
-: m_manager(0)
-, m_joystickCount(0)
+HIDJoystickManager::HIDJoystickManager() :
+m_manager(0),
+m_joystickCount(0)
{
m_manager = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone);
-
+
CFDictionaryRef mask0 = HIDInputManager::copyDevicesMask(kHIDPage_GenericDesktop,
kHIDUsage_GD_Joystick);
-
+
CFDictionaryRef mask1 = HIDInputManager::copyDevicesMask(kHIDPage_GenericDesktop,
kHIDUsage_GD_GamePad);
-
+
CFDictionaryRef maskArray[2];
maskArray[0] = mask0;
maskArray[1] = mask1;
-
+
CFArrayRef mask = CFArrayCreate(NULL, (const void**)maskArray, 2, NULL);
-
+
IOHIDManagerSetDeviceMatchingMultiple(m_manager, mask);
CFRelease(mask);
CFRelease(mask1);
CFRelease(mask0);
-
-
+
+
IOHIDManagerRegisterDeviceMatchingCallback(m_manager, pluggedIn, this);
IOHIDManagerRegisterDeviceRemovalCallback(m_manager, pluggedOut, this);
-
- IOHIDManagerScheduleWithRunLoop(m_manager,
- CFRunLoopGetCurrent(),
+
+ IOHIDManagerScheduleWithRunLoop(m_manager,
+ CFRunLoopGetCurrent(),
RunLoopMode);
-
+
IOHIDManagerOpen(m_manager, kIOHIDOptionsTypeNone);
}
@@ -107,13 +107,13 @@ HIDJoystickManager::HIDJoystickManager()
////////////////////////////////////////////////////////////
HIDJoystickManager::~HIDJoystickManager()
{
- IOHIDManagerUnscheduleFromRunLoop(m_manager,
- CFRunLoopGetCurrent(),
+ IOHIDManagerUnscheduleFromRunLoop(m_manager,
+ CFRunLoopGetCurrent(),
RunLoopMode);
-
+
IOHIDManagerRegisterDeviceMatchingCallback(m_manager, NULL, 0);
IOHIDManagerRegisterDeviceRemovalCallback(m_manager, NULL, 0);
-
+
IOHIDManagerClose(m_manager, kIOHIDOptionsTypeNone);
}
@@ -122,15 +122,16 @@ HIDJoystickManager::~HIDJoystickManager()
void HIDJoystickManager::update()
{
SInt32 status = kCFRunLoopRunHandledSource;
-
- while (status == kCFRunLoopRunHandledSource) {
+
+ while (status == kCFRunLoopRunHandledSource)
+ {
status = CFRunLoopRunInMode(RunLoopMode, 0, true);
}
}
////////////////////////////////////////////////////////////
-void HIDJoystickManager::pluggedIn(void * context, IOReturn, void *, IOHIDDeviceRef)
+void HIDJoystickManager::pluggedIn(void* context, IOReturn, void*, IOHIDDeviceRef)
{
HIDJoystickManager* manager = (HIDJoystickManager*)context;
manager->m_joystickCount++;
@@ -138,7 +139,7 @@ void HIDJoystickManager::pluggedIn(void * context, IOReturn, void *, IOHIDDevice
////////////////////////////////////////////////////////////
-void HIDJoystickManager::pluggedOut(void * context, IOReturn, void *, IOHIDDeviceRef)
+void HIDJoystickManager::pluggedOut(void* context, IOReturn, void*, IOHIDDeviceRef)
{
HIDJoystickManager* manager = (HIDJoystickManager*)context;
manager->m_joystickCount--;
diff --git a/src/SFML/Window/OSX/HIDJoystickManager.hpp b/src/SFML/Window/OSX/HIDJoystickManager.hpp
index 1577157..8c49a2b 100644
--- a/src/SFML/Window/OSX/HIDJoystickManager.hpp
+++ b/src/SFML/Window/OSX/HIDJoystickManager.hpp
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -30,23 +30,24 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/System/NonCopyable.hpp>
-#include <IOKit/hid/IOHIDManager.h>
#include <IOKit/hid/IOHIDDevice.h>
+#include <IOKit/hid/IOHIDManager.h>
namespace sf
{
namespace priv
{
////////////////////////////////////////////////////////////
-/// \brief This class manage as a singleton instance the
-/// joysticks. It's only purpose is
-/// to help sf::priv::JoystickImpl class.
+/// \brief sf::priv::InputImpl helper
+///
+/// This class manage as a singleton instance the joysticks.
+/// It's only purpose is to help sf::priv::JoystickImpl class.
///
////////////////////////////////////////////////////////////
class HIDJoystickManager : NonCopyable
{
-public :
-
+public:
+
////////////////////////////////////////////////////////////
/// \brief Get the unique instance of the class
///
@@ -56,63 +57,63 @@ public :
///
////////////////////////////////////////////////////////////
static HIDJoystickManager& getInstance();
-
-public :
-
+
+public:
+
////////////////////////////////////////////////////////////
/// \brief Get the number of currently connected joystick
///
////////////////////////////////////////////////////////////
unsigned int getJoystickCount();
-
+
////////////////////////////////////////////////////////////
- /// \brief Copy the devices assosiated with this HID manager
- ///
+ /// \brief Copy the devices associated with this HID manager
+ ///
/// \return a retained CFSetRef of IOHIDDeviceRef or NULL
///
////////////////////////////////////////////////////////////
CFSetRef copyJoysticks();
-
-private :
-
+
+private:
+
////////////////////////////////////////////////////////////
/// \brief Default constructor
///
////////////////////////////////////////////////////////////
HIDJoystickManager();
-
+
////////////////////////////////////////////////////////////
/// \brief Destructor
///
////////////////////////////////////////////////////////////
~HIDJoystickManager();
-
+
////////////////////////////////////////////////////////////
- /// \brief Make sur all event have been processed in the run loop
+ /// \brief Make sure all event have been processed in the run loop
///
////////////////////////////////////////////////////////////
void update();
-
-private :
-
+
+private:
+
////////////////////////////////////////////////////////////
/// \brief Private "plug-in" callback
- /// \note Only 'context' parametre is used.
+ /// \note Only 'context' parameter is used.
/// \see IOHIDDeviceCallback
///
////////////////////////////////////////////////////////////
- static void pluggedIn(void * context, IOReturn, void *, IOHIDDeviceRef);
-
+ static void pluggedIn(void* context, IOReturn, void*, IOHIDDeviceRef);
+
////////////////////////////////////////////////////////////
/// \brief Private "plug-out" callback
- /// \note Only 'context' parametre is used.
+ /// \note Only 'context' parameter is used.
/// \see IOHIDDeviceCallback
///
////////////////////////////////////////////////////////////
- static void pluggedOut(void * context, IOReturn, void *, IOHIDDeviceRef);
-
-private :
-
+ static void pluggedOut(void* context, IOReturn, void*, IOHIDDeviceRef);
+
+private:
+
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
@@ -122,7 +123,7 @@ private :
} // namespace priv
-
+
} // namespace sf
#endif
diff --git a/src/SFML/Window/OSX/InputImpl.hpp b/src/SFML/Window/OSX/InputImpl.hpp
index c3700ce..20bc14f 100644
--- a/src/SFML/Window/OSX/InputImpl.hpp
+++ b/src/SFML/Window/OSX/InputImpl.hpp
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -43,7 +43,7 @@ namespace priv
////////////////////////////////////////////////////////////
class InputImpl
{
-public :
+public:
////////////////////////////////////////////////////////////
/// \brief Check if a key is pressed
@@ -56,6 +56,14 @@ public :
static bool isKeyPressed(Keyboard::Key key);
////////////////////////////////////////////////////////////
+ /// \brief Show or hide the virtual keyboard
+ ///
+ /// \param visible True to show, false to hide
+ ///
+ ////////////////////////////////////////////////////////////
+ static void setVirtualKeyboardVisible(bool visible);
+
+ ////////////////////////////////////////////////////////////
/// \brief Check if a mouse button is pressed
///
/// \param button Button to check
@@ -114,6 +122,43 @@ public :
///
////////////////////////////////////////////////////////////
static void setMousePosition(const Vector2i& position, const Window& relativeTo);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a touch event is currently down
+ ///
+ /// \param finger Finger index
+ ///
+ /// \return True if \a finger is currently touching the screen, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isTouchDown(unsigned int finger);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current position of a touch in desktop coordinates
+ ///
+ /// This function returns the current touch position
+ /// in global (desktop) coordinates.
+ ///
+ /// \param finger Finger index
+ ///
+ /// \return Current position of \a finger, or undefined if it's not down
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector2i getTouchPosition(unsigned int finger);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current position of a touch in window coordinates
+ ///
+ /// This function returns the current touch position
+ /// in global (desktop) coordinates.
+ ///
+ /// \param finger Finger index
+ /// \param relativeTo Reference window
+ ///
+ /// \return Current position of \a finger, or undefined if it's not down
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector2i getTouchPosition(unsigned int finger, const Window& relativeTo);
};
} // namespace priv
diff --git a/src/SFML/Window/OSX/InputImpl.mm b/src/SFML/Window/OSX/InputImpl.mm
index 37b5faf..b357c4f 100644
--- a/src/SFML/Window/OSX/InputImpl.mm
+++ b/src/SFML/Window/OSX/InputImpl.mm
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -26,20 +26,20 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include <SFML/Window/OSX/InputImpl.hpp>
#include <SFML/Window/VideoMode.hpp>
#include <SFML/Window/Window.hpp>
-#include <SFML/System/Err.hpp>
+#include <SFML/Window/OSX/InputImpl.hpp>
#include <SFML/Window/OSX/HIDInputManager.hpp>
+#include <SFML/System/Err.hpp>
-#import <AppKit/AppKit.h>
#import <SFML/Window/OSX/SFOpenGLView.h>
+#import <AppKit/AppKit.h>
////////////////////////////////////////////////////////////
/// In order to keep track of the keyboard's state and mouse buttons' state
/// we use the HID manager. Mouse position is handled differently.
///
-/// NB : we probably could use
+/// NB: we probably could use
/// NSEvent +addGlobalMonitorForEventsMatchingMask:handler: for mouse only.
///
////////////////////////////////////////////////////////////
@@ -50,56 +50,58 @@ namespace priv
{
////////////////////////////////////////////////////////////
/// \brief Extract the dedicated SFOpenGLView from the SFML window
-///
+///
/// \param window a SFML window
/// \return nil if something went wrong or a SFOpenGLView*.
///
-////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////
SFOpenGLView* getSFOpenGLViewFromSFMLWindow(const Window& window)
{
id nsHandle = (id)window.getSystemHandle();
-
+
// Get our SFOpenGLView from ...
SFOpenGLView* view = nil;
-
- if ([nsHandle isKindOfClass:[NSWindow class]]) {
+
+ if ([nsHandle isKindOfClass:[NSWindow class]])
+ {
// If system handle is a window then from its content view.
view = [nsHandle contentView];
-
+
// Subview doesn't match ?
- if (![view isKindOfClass:[SFOpenGLView class]]) {
- sf::err() << "The content view is not a valid SFOpenGLView"
+ if (![view isKindOfClass:[SFOpenGLView class]])
+ {
+ sf::err() << "The content view is not a valid SFOpenGLView"
<< std::endl;
view = nil;
}
-
- } else if ([nsHandle isKindOfClass:[NSView class]]) {
+
+ }
+ else if ([nsHandle isKindOfClass:[NSView class]])
+ {
// If system handle is a view then from a subview of kind SFOpenGLView.
NSArray* subviews = [nsHandle subviews];
- for (NSView* subview in subviews) {
- if ([subview isKindOfClass:[SFOpenGLView class]]) {
- view = (SFOpenGLView *)subview;
+ for (NSView* subview in subviews)
+ {
+ if ([subview isKindOfClass:[SFOpenGLView class]])
+ {
+ view = (SFOpenGLView*)subview;
break;
}
}
-
+
// No matching subview ?
- if (view == nil) {
+ if (view == nil)
sf::err() << "Cannot find a valid SFOpenGLView subview." << std::endl;
-
- }
-
- } else {
- if (nsHandle != 0) {
+ }
+ else
+ {
+ if (nsHandle != 0)
sf::err() << "The system handle is neither a <NSWindow*> nor <NSView*>"
<< "object. This shouldn't happen."
<< std::endl;
- } else {
- // This probably means the SFML window was previously closed.
- }
-
+ // Else: this probably means the SFML window was previously closed.
}
-
+
return view;
}
@@ -111,9 +113,18 @@ bool InputImpl::isKeyPressed(Keyboard::Key key)
////////////////////////////////////////////////////////////
+void InputImpl::setVirtualKeyboardVisible(bool /*visible*/)
+{
+ // Not applicable
+}
+
+
+////////////////////////////////////////////////////////////
bool InputImpl::isMouseButtonPressed(Mouse::Button button)
{
- return HIDInputManager::getInstance().isMouseButtonPressed(button);
+ NSUInteger state = [NSEvent pressedMouseButtons];
+ NSUInteger flag = 1 << button;
+ return (state & flag) != 0;
}
@@ -124,7 +135,8 @@ Vector2i InputImpl::getMousePosition()
NSPoint pos = [NSEvent mouseLocation];
pos.y = sf::VideoMode::getDesktopMode().height - pos.y;
- return Vector2i(pos.x, pos.y);
+ int scale = [[NSScreen mainScreen] backingScaleFactor];
+ return Vector2i(pos.x, pos.y) * scale;
}
@@ -132,16 +144,16 @@ Vector2i InputImpl::getMousePosition()
Vector2i InputImpl::getMousePosition(const Window& relativeTo)
{
SFOpenGLView* view = getSFOpenGLViewFromSFMLWindow(relativeTo);
-
+
// No view ?
- if (view == nil) {
+ if (view == nil)
return Vector2i();
- }
-
+
// Use -cursorPositionFromEvent: with nil.
NSPoint pos = [view cursorPositionFromEvent:nil];
-
- return Vector2i(pos.x, pos.y);
+
+ int scale = [view displayScaleFactor];
+ return Vector2i(pos.x, pos.y) * scale;
}
@@ -149,13 +161,14 @@ Vector2i InputImpl::getMousePosition(const Window& relativeTo)
void InputImpl::setMousePosition(const Vector2i& position)
{
// Here we don't need to reverse the coordinates.
- CGPoint pos = CGPointMake(position.x, position.y);
-
+ int scale = [[NSScreen mainScreen] backingScaleFactor];
+ CGPoint pos = CGPointMake(position.x / scale, position.y / scale);
+
// Place the cursor.
- CGEventRef event = CGEventCreateMouseEvent(NULL,
- kCGEventMouseMoved,
- pos,
- /*we don't care about this : */0);
+ CGEventRef event = CGEventCreateMouseEvent(NULL,
+ kCGEventMouseMoved,
+ pos,
+ /*we don't care about this: */0);
CGEventPost(kCGHIDEventTap, event);
CFRelease(event);
// This is a workaround to deprecated CGSetLocalEventsSuppressionInterval.
@@ -166,16 +179,40 @@ void InputImpl::setMousePosition(const Vector2i& position)
void InputImpl::setMousePosition(const Vector2i& position, const Window& relativeTo)
{
SFOpenGLView* view = getSFOpenGLViewFromSFMLWindow(relativeTo);
-
+
// No view ?
- if (view == nil) {
+ if (view == nil)
return;
- }
-
+
// Let SFOpenGLView compute the position in global coordinate
- NSPoint p = NSMakePoint(position.x, position.y);
+ int scale = [view displayScaleFactor];
+ NSPoint p = NSMakePoint(position.x / scale, position.y / scale);
p = [view computeGlobalPositionOfRelativePoint:p];
- setMousePosition(sf::Vector2i(p.x, p.y));
+ setMousePosition(sf::Vector2i(p.x, p.y) * scale);
+}
+
+
+////////////////////////////////////////////////////////////
+bool InputImpl::isTouchDown(unsigned int /*finger*/)
+{
+ // Not applicable
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i InputImpl::getTouchPosition(unsigned int /*finger*/)
+{
+ // Not applicable
+ return Vector2i();
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i InputImpl::getTouchPosition(unsigned int /*finger*/, const Window& /*relativeTo*/)
+{
+ // Not applicable
+ return Vector2i();
}
} // namespace priv
diff --git a/src/SFML/Window/OSX/JoystickImpl.cpp b/src/SFML/Window/OSX/JoystickImpl.cpp
index 235ab4d..03e81ee 100644
--- a/src/SFML/Window/OSX/JoystickImpl.cpp
+++ b/src/SFML/Window/OSX/JoystickImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Marco Antognini (antognini.marco@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
@@ -29,6 +29,7 @@
#include <SFML/Window/JoystickImpl.hpp>
#include <SFML/Window/OSX/HIDInputManager.hpp>
#include <SFML/Window/OSX/HIDJoystickManager.hpp>
+#include <SFML/System/Err.hpp>
namespace
@@ -37,6 +38,46 @@ namespace
{
return IOHIDElementGetUsage(b1) < IOHIDElementGetUsage(b2);
}
+
+ // Convert a CFStringRef to std::string
+ std::string stringFromCFString(CFStringRef cfString)
+ {
+ CFIndex length = CFStringGetLength(cfString);
+ std::vector<char> str(length);
+ CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8);
+ CFStringGetCString(cfString, &str[0], maxSize, kCFStringEncodingUTF8);
+ return &str[0];
+ }
+
+ // Get HID device property key as a string
+ std::string getDeviceString(IOHIDDeviceRef ref, CFStringRef prop, unsigned int index)
+ {
+ CFTypeRef typeRef = IOHIDDeviceGetProperty(ref, prop);
+ if (ref && (CFGetTypeID(typeRef) == CFStringGetTypeID()))
+ {
+ CFStringRef str = static_cast<CFStringRef>(typeRef);
+ return stringFromCFString(str);
+ }
+
+ sf::err() << "Unable to read string value for property '" << stringFromCFString(prop) << "' for joystick at index " << index << std::endl;
+ return "Unknown Joystick";
+ }
+
+
+ // Get HID device property key as an unsigned int
+ unsigned int getDeviceUint(IOHIDDeviceRef ref, CFStringRef prop, unsigned int index)
+ {
+ CFTypeRef typeRef = IOHIDDeviceGetProperty(ref, prop);
+ if (ref && (CFGetTypeID(typeRef) == CFNumberGetTypeID()))
+ {
+ SInt32 value;
+ CFNumberGetValue((CFNumberRef)typeRef, kCFNumberSInt32Type, &value);
+ return value;
+ }
+
+ sf::err() << "Unable to read uint value for property '" << stringFromCFString(prop) << "' for joystick at index " << index << std::endl;
+ return 0;
+ }
}
@@ -65,60 +106,63 @@ void JoystickImpl::cleanup()
////////////////////////////////////////////////////////////
bool JoystickImpl::isConnected(unsigned int index)
{
- bool state = false; // Is the index-th joystick connected ?
-
- // First, let's check if the device was previously detected :
-
- if (m_locationIDs[index] != 0) {
+ bool state = false; // Is the index-th joystick connected?
+
+ // First, let's check if the device was previously detected:
+ if (m_locationIDs[index] != 0)
+ {
state = true;
}
-
- // Otherwise, let's check if it is now connected :
- else { // i.e., m_locationIDs[index] == 0
-
+ else
+ {
+ // Otherwise, let's check if it is now connected
+ // i.e., m_locationIDs[index] == 0
+
// if there is more connected joystick to the HID manager than
// opened joystick devices then we find the new one.
-
+
unsigned int openedCount = 0;
- for (unsigned int i(0); i < sf::Joystick::Count; ++i) {
- if (m_locationIDs[i] != 0) openedCount++;
+ for (unsigned int i(0); i < sf::Joystick::Count; ++i)
+ {
+ if (m_locationIDs[i] != 0)
+ openedCount++;
}
-
+
+
unsigned int connectedCount = HIDJoystickManager::getInstance().getJoystickCount();
-
- if (connectedCount > openedCount) {
-
+
+ if (connectedCount > openedCount)
+ {
// Get all devices
CFSetRef devices = HIDJoystickManager::getInstance().copyJoysticks();
-
- if (devices != NULL) {
-
+
+ if (devices != NULL)
+ {
CFIndex size = CFSetGetCount(devices);
-
- if (size > 0) {
-
+ if (size > 0)
+ {
CFTypeRef array[size]; // array of IOHIDDeviceRef
CFSetGetValues(devices, array);
-
+
// If there exists a device d s.t. there is no j s.t.
// m_locationIDs[j] == d's location then we have a new device.
-
- for (CFIndex didx(0); didx < size; ++didx) {
+
+ for (CFIndex didx(0); didx < size; ++didx)
+ {
IOHIDDeviceRef d = (IOHIDDeviceRef)array[didx];
Location dloc = HIDInputManager::getLocationID(d);
-
+
bool foundJ = false;
- for (unsigned int j(0); j < Joystick::Count; ++j) {
- if (m_locationIDs[j] == dloc) {
+ for (unsigned int j(0); j < Joystick::Count; ++j)
+ {
+ if (m_locationIDs[j] == dloc)
+ {
foundJ = true;
break; // no need to loop again
}
}
-
- if (foundJ) {
- // This is a known device
- // Nothing else to do
- } else {
+
+ if (!foundJ) {
// This is a new device
// We set it up for Open(..)
m_locationIDs[index] = dloc;
@@ -126,14 +170,13 @@ bool JoystickImpl::isConnected(unsigned int index)
break; // We stop looking for a new device
}
}
-
}
-
+
CFRelease(devices);
}
}
}
-
+
return state;
}
@@ -143,126 +186,110 @@ bool JoystickImpl::open(unsigned int index)
{
m_index = index;
Location deviceLoc = m_locationIDs[index]; // The device we need to load
-
+
// Get all devices
CFSetRef devices = HIDJoystickManager::getInstance().copyJoysticks();
- if (devices == NULL) {
+ if (devices == NULL)
return false;
- }
-
+
// Get a usable copy of the joysticks devices.
CFIndex joysticksCount = CFSetGetCount(devices);
CFTypeRef devicesArray[joysticksCount];
CFSetGetValues(devices, devicesArray);
-
+
// Get the desired joystick.
IOHIDDeviceRef self = 0;
- for (CFIndex i(0); i < joysticksCount; ++i) {
+ for (CFIndex i(0); i < joysticksCount; ++i)
+ {
IOHIDDeviceRef d = (IOHIDDeviceRef)devicesArray[i];
- if (deviceLoc == HIDInputManager::getLocationID(d)) {
+ if (deviceLoc == HIDInputManager::getLocationID(d))
+ {
self = d;
break; // We found it so we stop looping.
}
}
-
- if (self == 0) {
+
+ if (self == 0)
+ {
// This shouldn't happen!
CFRelease(devices);
return false;
}
-
+
+ m_identification.name = getDeviceString(self, CFSTR(kIOHIDProductKey), m_index);
+ m_identification.vendorId = getDeviceUint(self, CFSTR(kIOHIDVendorIDKey), m_index);
+ m_identification.productId = getDeviceUint(self, CFSTR(kIOHIDProductIDKey), m_index);
+
// Get a list of all elements attached to the device.
- CFArrayRef elements = IOHIDDeviceCopyMatchingElements(self,
- NULL,
- kIOHIDOptionsTypeNone);
-
- if (elements == NULL) {
+ CFArrayRef elements = IOHIDDeviceCopyMatchingElements(self, NULL, kIOHIDOptionsTypeNone);
+
+ if (elements == NULL)
+ {
CFRelease(devices);
return false;
}
-
- // How many elements are there ?
+
+ // How many elements are there?
CFIndex elementsCount = CFArrayGetCount(elements);
-
- if (elementsCount == 0) {
- // What is a joystick with no element ?
+
+ if (elementsCount == 0)
+ {
+ // What is a joystick with no element?
CFRelease(elements);
CFRelease(devices);
return false;
}
-
+
// Go through all connected elements.
- for (int i = 0; i < elementsCount; ++i) {
+ for (int i = 0; i < elementsCount; ++i)
+ {
IOHIDElementRef element = (IOHIDElementRef) CFArrayGetValueAtIndex(elements, i);
-
- switch (IOHIDElementGetType(element)) {
-
+ switch (IOHIDElementGetType(element))
+ {
case kIOHIDElementTypeInput_Misc:
- switch (IOHIDElementGetUsage(element)) {
-
- case kHIDUsage_GD_X:
- m_axis[Joystick::X] = element;
- break;
-
- case kHIDUsage_GD_Y:
- m_axis[Joystick::Y] = element;
- break;
-
- case kHIDUsage_GD_Z:
- m_axis[Joystick::Z] = element;
- break;
-
- case kHIDUsage_GD_Rx:
- m_axis[Joystick::U] = element;
- break;
-
- case kHIDUsage_GD_Ry:
- m_axis[Joystick::V] = element;
- break;
-
- case kHIDUsage_GD_Rz:
- m_axis[Joystick::R] = element;
- break;
-
- // kHIDUsage_GD_Vx, kHIDUsage_GD_Vy, kHIDUsage_GD_Vz are ignored.
+ switch (IOHIDElementGetUsage(element))
+ {
+ case kHIDUsage_GD_X: m_axis[Joystick::X] = element; break;
+ case kHIDUsage_GD_Y: m_axis[Joystick::Y] = element; break;
+ case kHIDUsage_GD_Z: m_axis[Joystick::Z] = element; break;
+ case kHIDUsage_GD_Rx: m_axis[Joystick::U] = element; break;
+ case kHIDUsage_GD_Ry: m_axis[Joystick::V] = element; break;
+ case kHIDUsage_GD_Rz: m_axis[Joystick::R] = element; break;
+ // kHIDUsage_GD_Vx, kHIDUsage_GD_Vy, kHIDUsage_GD_Vz are ignored.
}
break;
-
+
case kIOHIDElementTypeInput_Button:
- if (m_buttons.size() < Joystick::ButtonCount) { // If we have free slot...
+ if (m_buttons.size() < Joystick::ButtonCount) // If we have free slot...
m_buttons.push_back(element); // ...we add this element to the list
- } else {
- // Too many buttons. We ignore this one.
- }
+ // Else: too many buttons. We ignore this one.
break;
-
+
default: // Make compiler happy
break;
}
}
-
+
// Ensure that the buttons will be indexed in the same order as their
// HID Usage (assigned by manufacturer and/or a driver).
std::sort(m_buttons.begin(), m_buttons.end(), JoystickButtonSortPredicate);
-
- // Note : Joy::AxisPovX/Y are not supported (yet).
+
+ // Note: Joy::AxisPovX/Y are not supported (yet).
// Maybe kIOHIDElementTypeInput_Axis is the corresponding type but I can't test.
-
- // Retain all these objets for personal use
- for (ButtonsVector::iterator it(m_buttons.begin()); it != m_buttons.end(); ++it) {
+
+ // Retain all these objects for personal use
+ for (ButtonsVector::iterator it(m_buttons.begin()); it != m_buttons.end(); ++it)
CFRetain(*it);
- }
- for (AxisMap::iterator it(m_axis.begin()); it != m_axis.end(); ++it) {
+ for (AxisMap::iterator it(m_axis.begin()); it != m_axis.end(); ++it)
CFRetain(it->second);
- }
-
- // Note : we didn't retain element in the switch because we might have multiple
+
+ // Note: we didn't retain element in the switch because we might have multiple
// Axis X (for example) and we want to keep only the last one. So to prevent
// leaking we retain objects 'only' now.
-
+
CFRelease(devices);
CFRelease(elements);
-
+
return true;
}
@@ -270,16 +297,14 @@ bool JoystickImpl::open(unsigned int index)
////////////////////////////////////////////////////////////
void JoystickImpl::close()
{
- for (ButtonsVector::iterator it(m_buttons.begin()); it != m_buttons.end(); ++it) {
+ for (ButtonsVector::iterator it(m_buttons.begin()); it != m_buttons.end(); ++it)
CFRelease(*it);
- }
m_buttons.clear();
-
- for (AxisMap::iterator it(m_axis.begin()); it != m_axis.end(); ++it) {
+
+ for (AxisMap::iterator it(m_axis.begin()); it != m_axis.end(); ++it)
CFRelease(it->second);
- }
m_axis.clear();
-
+
// And we unregister this joystick
m_locationIDs[m_index] = 0;
}
@@ -289,96 +314,104 @@ void JoystickImpl::close()
JoystickCaps JoystickImpl::getCapabilities() const
{
JoystickCaps caps;
-
- // Buttons :
+
+ // Buttons:
caps.buttonCount = m_buttons.size();
-
- // Axis :
+
+ // Axis:
for (AxisMap::const_iterator it(m_axis.begin()); it != m_axis.end(); ++it) {
caps.axes[it->first] = true;
}
-
+
return caps;
}
////////////////////////////////////////////////////////////
+Joystick::Identification JoystickImpl::getIdentification() const
+{
+ return m_identification;
+}
+
+
+////////////////////////////////////////////////////////////
JoystickState JoystickImpl::update()
{
static const JoystickState disconnectedState; // return this if joystick was disconnected
JoystickState state; // otherwise return that
state.connected = true;
-
- // Note : free up is done in close() which is called, if required,
- // by the joystick manager. So we don't release buttons nor axes here.
-
+
+ // Note: free up is done in close() which is called, if required,
+ // by the joystick manager. So we don't release buttons nor axes here.
+
// First, let's determine if the joystick is still connected
Location selfLoc = m_locationIDs[m_index];
-
+
// Get all devices
CFSetRef devices = HIDJoystickManager::getInstance().copyJoysticks();
- if (devices == NULL) {
+ if (devices == NULL)
return disconnectedState;
- }
-
+
// Get a usable copy of the joysticks devices.
CFIndex joysticksCount = CFSetGetCount(devices);
CFTypeRef devicesArray[joysticksCount];
CFSetGetValues(devices, devicesArray);
-
+
// Search for it
bool found = false;
- for (CFIndex i(0); i < joysticksCount; ++i) {
+ for (CFIndex i(0); i < joysticksCount; ++i)
+ {
IOHIDDeviceRef d = (IOHIDDeviceRef)devicesArray[i];
- if (selfLoc == HIDInputManager::getLocationID(d)) {
+ if (selfLoc == HIDInputManager::getLocationID(d))
+ {
found = true;
break; // Stop looping
}
}
-
+
// Release unused stuff
CFRelease(devices);
-
- // Was it found ?
- if (found) {
- // Yes, so we can continue.
- } else {
- // No, so we stop here
+
+ // If not found we consider it disconnected
+ if (!found)
return disconnectedState;
- }
-
+
// Update buttons' state
unsigned int i = 0;
- for (ButtonsVector::iterator it(m_buttons.begin()); it != m_buttons.end(); ++it, ++i) {
+ for (ButtonsVector::iterator it(m_buttons.begin()); it != m_buttons.end(); ++it, ++i)
+ {
IOHIDValueRef value = 0;
IOHIDDeviceGetValue(IOHIDElementGetDevice(*it), *it, &value);
-
+
// Check for plug out.
- if (!value) {
- // No value ? Hum... Seems like the joystick is gone
+ if (!value)
+ {
+ // No value? Hum... Seems like the joystick is gone
return disconnectedState;
}
-
+
// 1 means pressed, others mean released
state.buttons[i] = IOHIDValueGetIntegerValue(value) == 1;
}
-
+
// Update axes' state
- for (AxisMap::iterator it = m_axis.begin(); it != m_axis.end(); ++it) {
+ for (AxisMap::iterator it = m_axis.begin(); it != m_axis.end(); ++it)
+ {
IOHIDValueRef value = 0;
IOHIDDeviceGetValue(IOHIDElementGetDevice(it->second), it->second, &value);
-
+
// Check for plug out.
- if (!value) {
- // No value ? Hum... Seems like the joystick is gone
+ if (!value)
+ {
+ // No value? Hum... Seems like the joystick is gone
return disconnectedState;
}
-
+
// We want to bind [physicalMin,physicalMax] to [-100=min,100=max].
//
- // General formula to bind [a,b] to [c,d] with a linear progression :
- //
- // f : [a, b] -> [c, d]
+ // General formula to bind [a,b] to [c,d] with a linear progression:
+ //
+ // f: [a, b] -> [c, d]
// x |-> (x-a)(d-c)/(b-a)+c
//
// This method might not be very accurate (the "0 position" can be
@@ -389,11 +422,10 @@ JoystickState JoystickImpl::update()
double scaledMin = -100;
double scaledMax = 100;
double physicalValue = IOHIDValueGetScaledValue(value, kIOHIDValueScaleTypePhysical);
- float scaledValue = ((physicalValue - physicalMin) * (scaledMax - scaledMin) / (physicalMax - physicalMin)) + scaledMin;
+ float scaledValue = (((physicalValue - physicalMin) * (scaledMax - scaledMin)) / (physicalMax - physicalMin)) + scaledMin;
state.axes[it->first] = scaledValue;
}
-
-
+
return state;
}
diff --git a/src/SFML/Window/OSX/JoystickImpl.hpp b/src/SFML/Window/OSX/JoystickImpl.hpp
index fe1a8fa..88afbdb 100644
--- a/src/SFML/Window/OSX/JoystickImpl.hpp
+++ b/src/SFML/Window/OSX/JoystickImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Marco Antognini (antognini.marco@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
@@ -30,7 +30,10 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window/JoystickImpl.hpp>
+#include <SFML/System/String.hpp>
+#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/hid/IOHIDDevice.h>
+#include <IOKit/hid/IOHIDKeys.h>
#include <map>
#include <vector>
@@ -44,7 +47,7 @@ namespace priv
////////////////////////////////////////////////////////////
class JoystickImpl
{
-public :
+public:
////////////////////////////////////////////////////////////
/// \brief Perform the global initialization of the joystick module
@@ -93,6 +96,14 @@ public :
JoystickCaps getCapabilities() const;
////////////////////////////////////////////////////////////
+ /// \brief Get the joystick identification
+ ///
+ /// \return Joystick identification
+ ///
+ ////////////////////////////////////////////////////////////
+ Joystick::Identification getIdentification() const;
+
+ ////////////////////////////////////////////////////////////
/// \brief Update the joystick and get its new state
///
/// \return Joystick state
@@ -100,7 +111,7 @@ public :
////////////////////////////////////////////////////////////
JoystickState update();
-private :
+private:
////////////////////////////////////////////////////////////
// Member data
@@ -108,13 +119,14 @@ private :
typedef long Location;
typedef std::map<sf::Joystick::Axis, IOHIDElementRef> AxisMap;
typedef std::vector<IOHIDElementRef> ButtonsVector;
-
- AxisMap m_axis; ///< Axis (IOHIDElementRef) connected to the joystick
- ButtonsVector m_buttons; ///< Buttons (IOHIDElementRef) connected to the joystick
- unsigned int m_index; ///< SFML index
-
+
+ AxisMap m_axis; ///< Axis (IOHIDElementRef) connected to the joystick
+ ButtonsVector m_buttons; ///< Buttons (IOHIDElementRef) connected to the joystick
+ unsigned int m_index; ///< SFML index
+ Joystick::Identification m_identification; ///< Joystick identification
+
static Location m_locationIDs[sf::Joystick::Count]; ///< Global Joystick register
- /// For a corresponding SFML index, m_locationIDs is either some usb
+ /// For a corresponding SFML index, m_locationIDs is either some USB
/// location or 0 if there isn't currently a connected joystick device
};
diff --git a/src/SFML/Window/OSX/SFApplication.h b/src/SFML/Window/OSX/SFApplication.h
index 2abbca2..3ef4ef1 100644
--- a/src/SFML/Window/OSX/SFApplication.h
+++ b/src/SFML/Window/OSX/SFApplication.h
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -26,11 +26,11 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
+#import <Foundation/Foundation.h>
////////////////////////////////////////////////////////////
-/// \brief Event processing
+/// \brief Event processing & Menu bar initialization
///
////////////////////////////////////////////////////////////
@interface SFApplication : NSApplication
@@ -44,12 +44,20 @@
////////////////////////////////////////////////////////////
+/// \brief Set up the menu bar and its items
+///
+////////////////////////////////////////////////////////////
++(void)setUpMenuBar;
+
+
+////////////////////////////////////////////////////////////
/// \brief Dispatch events
///
/// This overload of -[NSApplication sendEvent:] is used to
/// fix KeyRelease events when the command key is down.
+///
////////////////////////////////////////////////////////////
--(void)sendEvent:(NSEvent *)anEvent;
+-(void)sendEvent:(NSEvent*)anEvent;
@end
diff --git a/src/SFML/Window/OSX/SFApplication.m b/src/SFML/Window/OSX/SFApplication.m
index a8bd3e4..289c8e8 100644
--- a/src/SFML/Window/OSX/SFApplication.m
+++ b/src/SFML/Window/OSX/SFApplication.m
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -38,22 +38,224 @@
{
[SFApplication sharedApplication]; // Make sure NSApp exists
NSEvent* event = nil;
-
+
while ((event = [NSApp nextEventMatchingMask:NSAnyEventMask
untilDate:[NSDate distantPast]
inMode:NSDefaultRunLoopMode
- dequeue:YES])) // Remove the event from the dequeue
+ dequeue:YES])) // Remove the event from the queue
{
[NSApp sendEvent:event];
}
}
-- (void)sendEvent:(NSEvent *)anEvent
+
+////////////////////////////////////////////////////////
++(void)setUpMenuBar
+{
+ [SFApplication sharedApplication]; // Make sure NSApp exists
+
+ // Set the main menu bar
+ NSMenu* mainMenu = [NSApp mainMenu];
+ if (mainMenu != nil)
+ return;
+ mainMenu = [[[NSMenu alloc] initWithTitle:@""] autorelease];
+ [NSApp setMainMenu:mainMenu];
+
+ // Application Menu (aka Apple Menu)
+ NSMenuItem* appleItem = [mainMenu addItemWithTitle:@"" action:nil keyEquivalent:@""];
+ NSMenu* appleMenu = [[SFApplication newAppleMenu] autorelease];
+ [appleItem setSubmenu:appleMenu];
+
+ // File Menu
+ NSMenuItem* fileItem = [mainMenu addItemWithTitle:@"" action:nil keyEquivalent:@""];
+ NSMenu* fileMenu = [[SFApplication newFileMenu] autorelease];
+ [fileItem setSubmenu:fileMenu];
+
+ // Window menu
+ NSMenuItem* windowItem = [mainMenu addItemWithTitle:@"" action:nil keyEquivalent:@""];
+ NSMenu* windowMenu = [[SFApplication newWindowMenu] autorelease];
+ [windowItem setSubmenu:windowMenu];
+ [NSApp setWindowsMenu:windowMenu];
+}
+
+
+////////////////////////////////////////////////////////
++(NSMenu*)newAppleMenu
+{
+ // Apple menu is as follow:
+ //
+ // AppName >
+ // About AppName
+ // --------------------
+ // Preferences... [greyed]
+ // --------------------
+ // Services >
+ // / default empty menu /
+ // --------------------
+ // Hide AppName ⌘H
+ // Hide Others âŒĨ⌘H
+ // Show All
+ // --------------------
+ // Quit AppName ⌘Q
+
+ NSString* appName = [SFApplication applicationName];
+
+ // APPLE MENU
+ NSMenu* appleMenu = [[NSMenu alloc] initWithTitle:@""];
+
+ // ABOUT
+ [appleMenu addItemWithTitle:[@"About " stringByAppendingString:appName]
+ action:@selector(orderFrontStandardAboutPanel:)
+ keyEquivalent:@""];
+
+ // SEPARATOR
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ // PREFERENCES
+ [appleMenu addItemWithTitle:@"Preferencesâ€Ķ"
+ action:nil
+ keyEquivalent:@""];
+
+ // SEPARATOR
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ // SERVICES
+ NSMenu* serviceMenu = [[[NSMenu alloc] initWithTitle:@""] autorelease];
+ NSMenuItem* serviceItem = [appleMenu addItemWithTitle:@"Services"
+ action:nil
+ keyEquivalent:@""];
+ [serviceItem setSubmenu:serviceMenu];
+ [NSApp setServicesMenu:serviceMenu];
+
+ // SEPARATOR
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ // HIDE
+ [appleMenu addItemWithTitle:[@"Hide " stringByAppendingString:appName]
+ action:@selector(hide:)
+ keyEquivalent:@"h"];
+
+ // HIDE OTHER
+ NSMenuItem* hideOtherItem = [appleMenu addItemWithTitle:@"Hide Others"
+ action:@selector(hideOtherApplications:)
+ keyEquivalent:@"h"];
+ [hideOtherItem setKeyEquivalentModifierMask:(NSAlternateKeyMask | NSCommandKeyMask)];
+
+ // SHOW ALL
+ [appleMenu addItemWithTitle:@"Show All"
+ action:@selector(unhideAllApplications:)
+ keyEquivalent:@""];
+
+ // SEPARATOR
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ // QUIT
+ [appleMenu addItemWithTitle:[@"Quit " stringByAppendingString:appName]
+ action:@selector(terminate:)
+ keyEquivalent:@"q"];
+
+ return appleMenu;
+}
+
+
+////////////////////////////////////////////////////////
++(NSMenu*)newFileMenu
{
- if ([anEvent type] == NSKeyUp) {
- [[[self mainWindow] firstResponder] tryToPerform:@selector(keyUp:)
- with:anEvent];
- } else {
+ // The File menu is as follow:
+ //
+ // File >
+ // Close ⌘W
+
+ // FILE MENU
+ NSMenu* fileMenu = [[NSMenu alloc] initWithTitle:@"File"];
+
+ // CLOSE WINDOW
+ NSMenuItem* closeItem = [[NSMenuItem alloc] initWithTitle:@"Close Window"
+ action:@selector(performClose:)
+ keyEquivalent:@"w"];
+ [fileMenu addItem:closeItem];
+ [closeItem release];
+
+ return fileMenu;
+}
+
+
+////////////////////////////////////////////////////////
++(NSMenu*)newWindowMenu
+{
+ // The Window menu is as follow:
+ //
+ // Window >
+ // Minimize ⌘M
+ // Zoom
+ // --------------------
+ // Bring All to Front
+
+ // WINDOW MENU
+ NSMenu* windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
+
+ // MINIMIZE
+ NSMenuItem* minimizeItem = [[NSMenuItem alloc] initWithTitle:@"Minimize"
+ action:@selector(performMiniaturize:)
+ keyEquivalent:@"m"];
+ [windowMenu addItem:minimizeItem];
+ [minimizeItem release];
+
+ // ZOOM
+ [windowMenu addItemWithTitle:@"Zoom"
+ action:@selector(performZoom:)
+ keyEquivalent:@""];
+
+ // SEPARATOR
+ [windowMenu addItem:[NSMenuItem separatorItem]];
+
+ // BRING ALL TO FRONT
+ [windowMenu addItemWithTitle:@"Bring All to Front"
+ action:@selector(bringAllToFront:)
+ keyEquivalent:@""];
+
+ return windowMenu;
+}
+
+
+////////////////////////////////////////////////////////
++(NSString*)applicationName
+{
+ // First, try localized name
+ NSString* appName = [[[NSBundle mainBundle] localizedInfoDictionary] objectForKey:@"CFBundleDisplayName"];
+
+ // Then, try non-localized name
+ if ((appName == nil) || ([appName length] == 0))
+ appName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];
+
+ // Finally, fallback to the process info
+ if ((appName == nil) || ([appName length] == 0))
+ appName = [[NSProcessInfo processInfo] processName];
+
+ return appName;
+}
+
+
+////////////////////////////////////////////////////////
+-(void)bringAllToFront:(id)sender
+{
+ (void)sender;
+ [[NSApp windows] makeObjectsPerformSelector:@selector(orderFrontRegardless)];
+}
+
+
+////////////////////////////////////////////////////////
+-(void)sendEvent:(NSEvent *)anEvent
+{
+ // Fullscreen windows have a strange behaviour with key up. To make
+ // sure the user gets an event we call (if possible) sfKeyUp on our
+ // custom OpenGL view. See -[SFOpenGLView sfKeyUp:] for more details.
+
+ id firstResponder = [[anEvent window] firstResponder];
+ if (([anEvent type] != NSKeyUp) || (![firstResponder tryToPerform:@selector(sfKeyUp:) with:anEvent]))
+ {
+ // It's either not a key up event or no responder has a sfKeyUp
+ // message implemented.
[super sendEvent:anEvent];
}
}
diff --git a/src/SFML/Window/OSX/SFApplicationDelegate.h b/src/SFML/Window/OSX/SFApplicationDelegate.h
new file mode 100644
index 0000000..ed0fd17
--- /dev/null
+++ b/src/SFML/Window/OSX/SFApplicationDelegate.h
@@ -0,0 +1,53 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#import <AppKit/AppKit.h>
+#import <Foundation/Foundation.h>
+
+
+////////////////////////////////////////////////////////////
+/// \brief Process some application specific events
+///
+////////////////////////////////////////////////////////////
+@interface SFApplicationDelegate : NSObject <NSApplicationDelegate>
+
+////////////////////////////////////////////////////////////
+/// \brief React to a termination notification
+///
+/// Send a close message to all windows and cancel the termination.
+///
+////////////////////////////////////////////////////////////
+-(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender;
+
+////////////////////////////////////////////////////////////
+/// \brief Exit the app when all windows are closed
+///
+////////////////////////////////////////////////////////////
+-(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication;
+
+@end
diff --git a/src/SFML/Window/OSX/SFApplicationDelegate.m b/src/SFML/Window/OSX/SFApplicationDelegate.m
new file mode 100644
index 0000000..c22b720
--- /dev/null
+++ b/src/SFML/Window/OSX/SFApplicationDelegate.m
@@ -0,0 +1,54 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#import <SFML/Window/OSX/SFApplicationDelegate.h>
+
+////////////////////////////////////////////////////////////
+@implementation SFApplicationDelegate
+
+
+////////////////////////////////////////////////////////////
+-(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender
+{
+ (void)sender;
+ // Generate close event for each SFML window
+ [NSApp makeWindowsPerform:@selector(sfClose) inOrder:NO];
+ return NSTerminateCancel;
+}
+
+
+////////////////////////////////////////////////////////////
+-(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication
+{
+ (void)theApplication;
+ return YES;
+}
+
+
+@end
+
diff --git a/src/SFML/Window/OSX/SFContext.hpp b/src/SFML/Window/OSX/SFContext.hpp
index dbab403..67bae16 100644
--- a/src/SFML/Window/OSX/SFContext.hpp
+++ b/src/SFML/Window/OSX/SFContext.hpp
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -72,7 +72,7 @@ public:
///
////////////////////////////////////////////////////////////
SFContext(SFContext* shared);
-
+
////////////////////////////////////////////////////////////
/// \brief Create a new context attached to a window
///
@@ -84,7 +84,7 @@ public:
////////////////////////////////////////////////////////////
SFContext(SFContext* shared, const ContextSettings& settings,
const WindowImpl* owner, unsigned int bitsPerPixel);
-
+
////////////////////////////////////////////////////////////
/// \brief Create a new context that embeds its own rendering target
///
@@ -94,21 +94,21 @@ public:
/// \param height Back buffer height, in pixels
///
////////////////////////////////////////////////////////////
- SFContext(SFContext* shared, const ContextSettings& settings,
+ SFContext(SFContext* shared, const ContextSettings& settings,
unsigned int width, unsigned int height);
-
+
////////////////////////////////////////////////////////////
/// \brief Destructor
///
////////////////////////////////////////////////////////////
~SFContext();
-
+
////////////////////////////////////////////////////////////
/// \brief Display what has been rendered to the context so far
///
////////////////////////////////////////////////////////////
virtual void display();
-
+
////////////////////////////////////////////////////////////
/// \brief Enable or disable vertical synchronization
///
@@ -117,11 +117,11 @@ public:
/// This can avoid some visual artifacts, and limit the framerate
/// to a good value (but not constant across different computers).
///
- /// \param enabled : True to enable v-sync, false to deactivate
+ /// \param enabled True to enable v-sync, false to deactivate
///
////////////////////////////////////////////////////////////
virtual void setVerticalSyncEnabled(bool enabled);
-
+
protected:
////////////////////////////////////////////////////////////
/// \brief Activate the context as the current target
@@ -131,7 +131,7 @@ protected:
///
////////////////////////////////////////////////////////////
virtual bool makeCurrent();
-
+
private:
////////////////////////////////////////////////////////////
/// \brief Create the context
@@ -142,10 +142,10 @@ private:
/// \param settings Creation parameters
///
////////////////////////////////////////////////////////////
- void createContext(SFContext* shared,
- unsigned int bitsPerPixel,
+ void createContext(SFContext* shared,
+ unsigned int bitsPerPixel,
const ContextSettings& settings);
-
+
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
@@ -153,9 +153,9 @@ private:
NSOpenGLViewRef m_view; ///< Only for offscreen context.
NSWindowRef m_window; ///< Only for offscreen context.
};
-
+
} // namespace priv
-
+
} // namespace sf
#endif // SFML_SFCONTEXT_HPP
diff --git a/src/SFML/Window/OSX/SFContext.mm b/src/SFML/Window/OSX/SFContext.mm
index 876e065..9b1cbd1 100644
--- a/src/SFML/Window/OSX/SFContext.mm
+++ b/src/SFML/Window/OSX/SFContext.mm
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -39,51 +39,54 @@ namespace priv
////////////////////////////////////////////////////////////
-SFContext::SFContext(SFContext* shared)
-: m_view(0), m_window(0)
+SFContext::SFContext(SFContext* shared) :
+m_view(0),
+m_window(0)
{
// Ask for a pool.
retainPool();
-
+
// Create the context
createContext(shared,
- VideoMode::getDesktopMode().bitsPerPixel,
+ VideoMode::getDesktopMode().bitsPerPixel,
ContextSettings(0, 0, 0));
}
-
+
////////////////////////////////////////////////////////////
SFContext::SFContext(SFContext* shared, const ContextSettings& settings,
- const WindowImpl* owner, unsigned int bitsPerPixel)
-: m_view(0), m_window(0)
+ const WindowImpl* owner, unsigned int bitsPerPixel) :
+m_view(0),
+m_window(0)
{
// Ask for a pool.
retainPool();
-
+
// Create the context.
createContext(shared, bitsPerPixel, settings);
-
+
// Apply context.
- WindowImplCocoa const * ownerCocoa = static_cast<WindowImplCocoa const *>(owner);
+ const WindowImplCocoa* ownerCocoa = static_cast<const WindowImplCocoa*>(owner);
ownerCocoa->applyContext(m_context);
}
////////////////////////////////////////////////////////////
-SFContext::SFContext(SFContext* shared, const ContextSettings& settings,
- unsigned int width, unsigned int height)
-: m_view(0), m_window(0)
+SFContext::SFContext(SFContext* shared, const ContextSettings& settings,
+ unsigned int width, unsigned int height) :
+m_view(0),
+m_window(0)
{
// Ensure the process is setup in order to create a valid window.
WindowImplCocoa::setUpProcess();
-
+
// Ask for a pool.
retainPool();
-
+
// Create the context.
createContext(shared, VideoMode::getDesktopMode().bitsPerPixel, settings);
-
- // Create a dummy window/view pair (hidden) and asign it our context.
+
+ // Create a dummy window/view pair (hidden) and assign it our context.
m_window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, width, height)
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
@@ -100,10 +103,10 @@ SFContext::~SFContext()
{
[m_context clearDrawable];
[m_context release];
-
+
[m_view release]; // Might be nil but we don't care.
[m_window release]; // Idem.
-
+
releasePool();
}
@@ -126,93 +129,119 @@ void SFContext::display()
////////////////////////////////////////////////////////////
void SFContext::setVerticalSyncEnabled(bool enabled)
{
- // Make compiler happy
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
- typedef int GLint;
-#endif
-
GLint swapInterval = enabled ? 1 : 0;
-
+
[m_context setValues:&swapInterval forParameter:NSOpenGLCPSwapInterval];
}
////////////////////////////////////////////////////////////
void SFContext::createContext(SFContext* shared,
- unsigned int bitsPerPixel,
+ unsigned int bitsPerPixel,
const ContextSettings& settings)
{
- // Choose the attributs of OGL context.
+ // Choose the attributes of OGL context.
std::vector<NSOpenGLPixelFormatAttribute> attrs;
- attrs.reserve(20); // max attributs (estimation).
-
+ attrs.reserve(20); // max attributes (estimation).
+
// These casts are safe. C++ is much more strict than Obj-C.
-
+
attrs.push_back(NSOpenGLPFAClosestPolicy);
attrs.push_back(NSOpenGLPFADoubleBuffer);
-
- if (bitsPerPixel > 24) {
+
+ if (bitsPerPixel > 24)
+ {
attrs.push_back(NSOpenGLPFAAlphaSize);
attrs.push_back((NSOpenGLPixelFormatAttribute)8);
}
-
+
attrs.push_back(NSOpenGLPFADepthSize);
attrs.push_back((NSOpenGLPixelFormatAttribute)settings.depthBits);
-
+
attrs.push_back(NSOpenGLPFAStencilSize);
attrs.push_back((NSOpenGLPixelFormatAttribute)settings.stencilBits);
-
- if (settings.antialiasingLevel > 0) {
- /*
- * Antialiasing techniques are described in the
+
+ if (settings.antialiasingLevel > 0)
+ {
+ /*
+ * Antialiasing techniques are described in the
* "OpenGL Programming Guide for Mac OS X" document.
*
- * According to this document, the specification currently allows
+ * According to this document, the specification currently allows
* only one multisample buffer.
*
* The document also states that software renderers should be avoided
* because antialisaing techniques are very slow with them.
*/
-
+
// Prefer multisampling over supersampling
attrs.push_back(NSOpenGLPFAMultisample);
-
+
// Only one buffer is currently available
attrs.push_back(NSOpenGLPFASampleBuffers);
attrs.push_back((NSOpenGLPixelFormatAttribute)1);
-
+
// Antialiasing level
attrs.push_back(NSOpenGLPFASamples);
attrs.push_back((NSOpenGLPixelFormatAttribute)settings.antialiasingLevel);
-
+
// No software renderer - only hardware renderer
attrs.push_back(NSOpenGLPFAAccelerated);
}
-
+
+ // Support for OpenGL 3.2 on Mac OS X Lion and later:
+ // SFML 2 Graphics module uses some OpenGL features that are deprecated
+ // in OpenGL 3.2 and that are no more available with core context.
+ // Therefore the Graphics module won't work as expected.
+
+ // 2.x are mapped to 2.1 since Apple only support that legacy version.
+ // >=3.0 are mapped to a 3.2 core profile.
+ bool legacy = settings.majorVersion < 3;
+
+ if (legacy)
+ {
+ attrs.push_back(NSOpenGLPFAOpenGLProfile);
+ attrs.push_back(NSOpenGLProfileVersionLegacy);
+ }
+ else
+ {
+ attrs.push_back(NSOpenGLPFAOpenGLProfile);
+ attrs.push_back(NSOpenGLProfileVersion3_2Core);
+ }
+
attrs.push_back((NSOpenGLPixelFormatAttribute)0); // end of array
-
- // Create the pixel pormat.
+
+ // Create the pixel format.
NSOpenGLPixelFormat* pixFmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:&attrs[0]];
-
- if (pixFmt == nil) {
+
+ if (pixFmt == nil)
+ {
sf::err() << "Error. Unable to find a suitable pixel format." << std::endl;
return;
}
-
+
// Use the shared context if one is given.
NSOpenGLContext* sharedContext = shared != NULL ? shared->m_context : nil;
-
+
// Create the context.
m_context = [[NSOpenGLContext alloc] initWithFormat:pixFmt
shareContext:sharedContext];
-
- if (m_context == nil) {
- sf::err() << "Error. Unable to create the context." << std::endl;
+
+ if (m_context == nil)
+ {
+ sf::err() << "Error. Unable to create the context. Retrying without shared context." << std::endl;
+ m_context = [[NSOpenGLContext alloc] initWithFormat:pixFmt
+ shareContext:nil];
+
+ if (m_context == nil)
+ sf::err() << "Error. Unable to create the context." << std::endl;
+ else
+ sf::err() << "Warning. New context created without shared context." << std::endl;
}
-
+
// Free up.
[pixFmt release];
-
+
// Save the settings. (OpenGL version is updated elsewhere.)
m_settings = settings;
}
diff --git a/src/SFML/Window/OSX/SFKeyboardModifiersHelper.h b/src/SFML/Window/OSX/SFKeyboardModifiersHelper.h
index 2020673..8f4ce83 100644
--- a/src/SFML/Window/OSX/SFKeyboardModifiersHelper.h
+++ b/src/SFML/Window/OSX/SFKeyboardModifiersHelper.h
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -44,17 +44,26 @@ namespace sf {
////////////////////////////////////////////////////////////
-/// Set up a SFML key event based on the given modifiers
-/// flags and key code.
-///
+/// \brief Initialize the global state (only if needed)
+///
+/// It needs to be called before any event, e.g. in the window constructor.
+///
+////////////////////////////////////////////////////////////
+void initialiseKeyboardHelper(void);
+
+
+////////////////////////////////////////////////////////////
+/// \brief Set up a SFML key event based on the given modifiers flags and key code
+///
////////////////////////////////////////////////////////////
sf::Event::KeyEvent keyEventWithModifiers(NSUInteger modifiers, sf::Keyboard::Key key);
////////////////////////////////////////////////////////////
-/// Handle the state of modifiers keys and send key
-/// release & pressed events to the requester.
-///
+/// \brief Handle the state of modifiers keys
+///
+/// Send key released & pressed events to the requester.
+///
////////////////////////////////////////////////////////////
void handleModifiersChanged(NSUInteger modifiers, sf::priv::WindowImplCocoa& requester);
diff --git a/src/SFML/Window/OSX/SFKeyboardModifiersHelper.mm b/src/SFML/Window/OSX/SFKeyboardModifiersHelper.mm
index d023079..d788a9e 100644
--- a/src/SFML/Window/OSX/SFKeyboardModifiersHelper.mm
+++ b/src/SFML/Window/OSX/SFKeyboardModifiersHelper.mm
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -78,22 +78,16 @@ static BOOL isStateInitialized = NO;
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
-/// Carefully observe if the key mask is on in the modifiers
+/// \brief Carefully observe if the key mask is on in the modifiers
///
////////////////////////////////////////////////////////////
BOOL isKeyMaskActive(NSUInteger modifiers, NSUInteger mask);
-////////////////////////////////////////////////////////
-/// Init the global state only if needed
-///
////////////////////////////////////////////////////////////
-void ensureModifiersStateIsInitilized();
-
-
-////////////////////////////////////////////////////////////
-/// Handle one modifier key mask, update the key state and
-/// send events to the requester
+/// \brief Handle one modifier key mask
+///
+/// Update the key state and send events to the requester
///
////////////////////////////////////////////////////////////
void processOneModifier(NSUInteger modifiers, NSUInteger mask,
@@ -102,8 +96,9 @@ void processOneModifier(NSUInteger modifiers, NSUInteger mask,
////////////////////////////////////////////////////////////
-/// Handle left & right modifier keys, update the keys state and
-/// send events to the requester
+/// \brief Handle left & right modifier keys
+///
+/// Update the keys state and send events to the requester
///
////////////////////////////////////////////////////////////
void processLeftRightModifiers(NSUInteger modifiers,
@@ -120,6 +115,27 @@ void processLeftRightModifiers(NSUInteger modifiers,
////////////////////////////////////////////////////////
+void initialiseKeyboardHelper(void)
+{
+ if (isStateInitialized) return;
+
+ NSUInteger modifiers = [[NSApp currentEvent] modifierFlags];
+
+ // Load current keyboard state
+ state.leftShiftWasDown = isKeyMaskActive(modifiers, NSLeftShiftKeyMask);
+ state.rightShiftWasDown = isKeyMaskActive(modifiers, NSRightShiftKeyMask);
+ state.leftCommandWasDown = isKeyMaskActive(modifiers, NSLeftCommandKeyMask);
+ state.rightCommandWasDown = isKeyMaskActive(modifiers, NSRightCommandKeyMask);
+ state.leftAlternateWasDown = isKeyMaskActive(modifiers, NSLeftAlternateKeyMask);
+ state.rightAlternateWasDown = isKeyMaskActive(modifiers, NSRightAlternateKeyMask);
+ state.leftControlWasDown = isKeyMaskActive(modifiers, NSLeftControlKeyMask);
+ state.rightControlWasDown = isKeyMaskActive(modifiers, NSRightControlKeyMask);
+
+ isStateInitialized = YES;
+}
+
+
+////////////////////////////////////////////////////////
sf::Event::KeyEvent keyEventWithModifiers(NSUInteger modifiers, sf::Keyboard::Key key)
{
sf::Event::KeyEvent event;
@@ -185,33 +201,10 @@ BOOL isKeyMaskActive(NSUInteger modifiers, NSUInteger mask)
////////////////////////////////////////////////////////
-void ensureModifiersStateIsInitilized()
-{
- if (isStateInitialized) return;
-
- NSUInteger modifiers = [[NSApp currentEvent] modifierFlags];
-
- // Load current keyboard state
- state.leftShiftWasDown = isKeyMaskActive(modifiers, NSLeftShiftKeyMask);
- state.rightShiftWasDown = isKeyMaskActive(modifiers, NSRightShiftKeyMask);
- state.leftCommandWasDown = isKeyMaskActive(modifiers, NSLeftCommandKeyMask);
- state.rightCommandWasDown = isKeyMaskActive(modifiers, NSRightCommandKeyMask);
- state.leftAlternateWasDown = isKeyMaskActive(modifiers, NSLeftAlternateKeyMask);
- state.rightAlternateWasDown = isKeyMaskActive(modifiers, NSRightAlternateKeyMask);
- state.leftControlWasDown = isKeyMaskActive(modifiers, NSLeftControlKeyMask);
- state.rightControlWasDown = isKeyMaskActive(modifiers, NSRightControlKeyMask);
-
- isStateInitialized = YES;
-}
-
-
-////////////////////////////////////////////////////////
void processOneModifier(NSUInteger modifiers, NSUInteger mask,
BOOL& wasDown, sf::Keyboard::Key key,
sf::priv::WindowImplCocoa& requester)
{
- ensureModifiersStateIsInitilized();
-
// Setup a potential event key.
sf::Event::KeyEvent event = keyEventWithModifiers(modifiers, key);
@@ -219,13 +212,13 @@ void processOneModifier(NSUInteger modifiers, NSUInteger mask,
BOOL isDown = isKeyMaskActive(modifiers, mask);
// Check for key pressed event
- if (isDown && !wasDown) {
+ if (isDown && !wasDown)
requester.keyDown(event);
- }
+
// And check for key released event
- else if (!isDown && wasDown) {
+ else if (!isDown && wasDown)
requester.keyUp(event);
- }
+
// else isDown == wasDown, so no change
// Update state
diff --git a/src/SFML/Window/OSX/SFOpenGLView.h b/src/SFML/Window/OSX/SFOpenGLView.h
index 50373cd..d48d6f7 100644
--- a/src/SFML/Window/OSX/SFOpenGLView.h
+++ b/src/SFML/Window/OSX/SFOpenGLView.h
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -43,25 +43,19 @@ namespace sf {
///
/// NSTrackingArea is used to keep track of mouse events. We also
/// need to be able to ignore mouse event when exiting fullscreen.
-/// The SFWindowController should call -[SFOpenGLView exitFullscreen]
-/// and -[SFOpenGLView enterFullscreen] when appropriate.
-///
-/// In order to send correct mouse coordonate to the requester when
-/// the window is in fullscreen we use m_realSize to represent the
-/// back buffer size (see SFWindowController). If 'm_realSize' is
-/// bound to its default value we don't recompute the mouse position
-/// and assume it's correct.
///
/// Modifiers keys (cmd, ctrl, alt, shift) are handled by this class
/// but the actual logic is done in SFKeyboardModifiersHelper.(h|mm).
///
////////////////////////////////////////////////////////////
-@interface SFOpenGLView : NSOpenGLView {
- sf::priv::WindowImplCocoa* m_requester;
- BOOL m_useKeyRepeat;
- BOOL m_mouseIsIn;
- NSTrackingArea* m_trackingArea;
- NSSize m_realSize;
+@interface SFOpenGLView : NSOpenGLView
+{
+ sf::priv::WindowImplCocoa* m_requester; ///< View's requester
+ BOOL m_useKeyRepeat; ///< Key repeat setting
+ BOOL m_mouseIsIn; ///< Mouse positional state
+ NSTrackingArea* m_trackingArea; ///< Mouse tracking area
+ BOOL m_fullscreen; ///< Indicate whether the window is fullscreen or not
+ CGFloat m_scaleFactor; ///< Display scale factor (e.g. 1x for classic display, 2x for retina)
// Hidden text view used to convert key event to actual chars.
// We use a silent responder to prevent sound alerts.
@@ -70,51 +64,81 @@ namespace sf {
}
////////////////////////////////////////////////////////////
-/// Create the SFML opengl view to fit the given area.
-///
+/// \brief Create the SFML OpenGL view
+///
+/// NB: -initWithFrame: is also implemented to default isFullscreen to NO
+/// in case SFOpenGLView is created with the standard message.
+///
+/// To finish the initialization -finishInit should be called too.
+///
+/// \param frameRect dimension of the view
+/// \param isFullscreen fullscreen flag
+///
+/// \return an initialized view
+///
////////////////////////////////////////////////////////////
--(id)initWithFrame:(NSRect)frameRect;
+-(id)initWithFrame:(NSRect)frameRect fullscreen:(BOOL)isFullscreen;
////////////////////////////////////////////////////////////
-/// Handle going in and out of fullscreen mode.
-///
+/// \brief Finish the creation of the SFML OpenGL view
+///
+/// This method should be called after the view was added to a window
+///
////////////////////////////////////////////////////////////
--(void)enterFullscreen;
--(void)exitFullscreen;
+-(void)finishInit;
////////////////////////////////////////////////////////////
-/// Apply the given resquester to the view.
-///
+/// \brief Apply the given requester to the view
+///
+/// \param requester new 'requester' of the view
+///
////////////////////////////////////////////////////////////
--(void)setRequesterTo:(sf::priv::WindowImplCocoa *)requester;
+-(void)setRequesterTo:(sf::priv::WindowImplCocoa*)requester;
////////////////////////////////////////////////////////////
-/// Set the real size of view (it should be the back buffer size).
-/// If not set, or set to its default value NSZeroSize, the view
-/// won't recompute the mouse coordinates before sending them
-/// to the requester.
-///
+/// \brief Compute the position in global coordinate
+///
+/// \param point a point in SFML coordinate
+///
+/// \return the global coordinates of the point
+///
////////////////////////////////////////////////////////////
--(void)setRealSize:(NSSize)newSize;
+-(NSPoint)computeGlobalPositionOfRelativePoint:(NSPoint)point;
////////////////////////////////////////////////////////////
-/// Compute the position in global coordinate
-/// of the given point in SFML coordinate.
-///
+/// \brief Enable key repeat
+///
////////////////////////////////////////////////////////////
--(NSPoint)computeGlobalPositionOfRelativePoint:(NSPoint)point;
+-(void)enableKeyRepeat;
////////////////////////////////////////////////////////////
-/// Adjust key repeat configuration.
-///
+/// \brief Disable key repeat
+///
////////////////////////////////////////////////////////////
--(void)enableKeyRepeat;
-(void)disableKeyRepeat;
////////////////////////////////////////////////////////////
-/// Compute the position of the cursor.
-///
+/// \brief Get the display scale factor
+///
+/// \return e.g. 1.0 for classic display, 2.0 for retina display
+///
+////////////////////////////////////////////////////////////
+-(CGFloat)displayScaleFactor;
+
+////////////////////////////////////////////////////////////
+/// \brief Compute the position of the cursor
+///
+/// \param eventOrNil if nil the cursor position is the current one
+///
+////////////////////////////////////////////////////////////
+-(NSPoint)cursorPositionFromEvent:(NSEvent*)eventOrNil;
+
+////////////////////////////////////////////////////////////
+/// \brief Determine where the mouse is
+///
+/// \return true when the mouse is inside the OpenGL view, false otherwise
+///
////////////////////////////////////////////////////////////
--(NSPoint)cursorPositionFromEvent:(NSEvent *)eventOrNil;
+-(BOOL)isMouseInside;
@end
diff --git a/src/SFML/Window/OSX/SFOpenGLView.mm b/src/SFML/Window/OSX/SFOpenGLView.mm
index b787e48..58298f7 100644
--- a/src/SFML/Window/OSX/SFOpenGLView.mm
+++ b/src/SFML/Window/OSX/SFOpenGLView.mm
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -30,62 +30,96 @@
#include <SFML/Window/OSX/HIDInputManager.hpp> // For localizedKeys and nonLocalizedKeys
#include <SFML/System/Err.hpp>
+#import <SFML/Window/OSX/SFKeyboardModifiersHelper.h>
#import <SFML/Window/OSX/SFOpenGLView.h>
#import <SFML/Window/OSX/SFSilentResponder.h>
-#import <SFML/Window/OSX/SFKeyboardModifiersHelper.h>
////////////////////////////////////////////////////////////
-/// Returns true if `event` represents a representable character.
+/// \brief Check if the event represent some Unicode text
///
/// The event is assumed to be a key down event.
-/// False is returned if the event is either escape or a non text unicode.
+/// False is returned if the event is either escape or a non text Unicode.
+///
+/// \param event a key down event
+///
+/// \return true if event represents a Unicode character, false otherwise
///
////////////////////////////////////////////////////////////
BOOL isValidTextUnicode(NSEvent* event);
////////////////////////////////////////////////////////////
-/// SFOpenGLView class : Privates Methods Declaration
+/// SFOpenGLView class: Privates Methods Declaration
///
////////////////////////////////////////////////////////////
@interface SFOpenGLView ()
////////////////////////////////////////////////////////////
-/// Handle view resized event.
-///
+/// \brief Handle screen changed event
+///
////////////////////////////////////////////////////////////
--(void)frameDidChange:(NSNotification *)notification;
+-(void)updateScaleFactor;
////////////////////////////////////////////////////////////
-/// Establish if the mouse is inside or outside the OpenGL view.
-///
+/// \brief Handle view resized event
+///
////////////////////////////////////////////////////////////
--(BOOL)isMouseInside;
+-(void)viewDidEndLiveResize;
////////////////////////////////////////////////////////////
-/// Update the mouse state (in or out) and fire an event
-/// if its state has changed.
-///
+/// \brief Update the mouse state (in or out)
+///
+/// Fire an event if its state has changed.
+///
////////////////////////////////////////////////////////////
-(void)updateMouseState;
////////////////////////////////////////////////////////////
-/// Convert the NSEvent mouse button type to SFML type.
+/// \brief Callback for focus event
+///
+////////////////////////////////////////////////////////////
+-(void)windowDidBecomeKey:(NSNotification*)notification;
+
+////////////////////////////////////////////////////////////
+/// \brief Callback for unfocus event
+///
+////////////////////////////////////////////////////////////
+-(void)windowDidResignKey:(NSNotification*)notification;
+
+////////////////////////////////////////////////////////////
+/// \brief Handle going in fullscreen mode
+///
+////////////////////////////////////////////////////////////
+-(void)enterFullscreen;
+
+////////////////////////////////////////////////////////////
+/// \brief Handle exiting fullscreen mode
+///
+////////////////////////////////////////////////////////////
+-(void)exitFullscreen;
+
+////////////////////////////////////////////////////////////
+/// \brief Convert the NSEvent mouse button type to SFML type
+///
+/// \param event a mouse button event
+///
+/// \return Left, Right, ..., or ButtonCount if the button is unknown
///
-/// Returns ButtonCount if the button is unknown
-///
////////////////////////////////////////////////////////////
--(sf::Mouse::Button)mouseButtonFromEvent:(NSEvent *)event;
+-(sf::Mouse::Button)mouseButtonFromEvent:(NSEvent*)event;
////////////////////////////////////////////////////////////
-/// Convert a key down/up NSEvent into an SFML key event.
-/// Based on localizedKeys and nonLocalizedKeys function.
+/// \brief Convert a key down/up NSEvent into an SFML key event
+///
+/// The conversion is based on localizedKeys and nonLocalizedKeys functions.
///
-/// Return sf::Keyboard::Unknown as Code if the key is unknown.
+/// \param event a key event
+///
+/// \return sf::Keyboard::Unknown as Code if the key is unknown
///
////////////////////////////////////////////////////////////
-+(sf::Event::KeyEvent)convertNSKeyEventToSFMLEvent:(NSEvent *)anEvent;
++(sf::Event::KeyEvent)convertNSKeyEventToSFMLEvent:(NSEvent*)event;
@end
@@ -97,11 +131,17 @@ BOOL isValidTextUnicode(NSEvent* event);
////////////////////////////////////////////////////////
-(id)initWithFrame:(NSRect)frameRect
{
- if ((self = [super initWithFrame:frameRect])) {
+ return [self initWithFrame:frameRect fullscreen:NO];
+}
+
+////////////////////////////////////////////////////////
+-(id)initWithFrame:(NSRect)frameRect fullscreen:(BOOL)isFullscreen
+{
+ if ((self = [super initWithFrame:frameRect]))
+ {
[self setRequesterTo:0];
[self enableKeyRepeat];
- m_realSize = NSZeroSize;
-
+
// Register for mouse move event
m_mouseIsIn = [self isMouseInside];
NSUInteger opts = (NSTrackingActiveAlways | NSTrackingMouseEnteredAndExited | NSTrackingMouseMoved | NSTrackingEnabledDuringMouseDrag);
@@ -110,99 +150,90 @@ BOOL isValidTextUnicode(NSEvent* event);
owner:self
userInfo:nil];
[self addTrackingArea:m_trackingArea];
-
- // Register for resize event
- NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
- [center addObserver:self
- selector:@selector(frameDidChange:)
- name:NSViewFrameDidChangeNotification
- object:self];
+
+ m_fullscreen = isFullscreen;
+ m_scaleFactor = 1.0; // Default value; it will be updated in finishInit
// Create a hidden text view for parsing key down event properly
m_silentResponder = [[SFSilentResponder alloc] init];
m_hiddenTextView = [[NSTextView alloc] initWithFrame:NSZeroRect];
[m_hiddenTextView setNextResponder:m_silentResponder];
- }
-
- return self;
-}
-
-////////////////////////////////////////////////////////
--(void)enterFullscreen
-{
- // Remove the tracking area first,
- // just to be sure we don't add it twice!
- [self removeTrackingArea:m_trackingArea];
- [self addTrackingArea:m_trackingArea];
+ // Request high resolution on high DPI displays
+ [self setWantsBestResolutionOpenGLSurface:YES];
- // Fire an mouse entered event if needed
- if (!m_mouseIsIn && m_requester != 0) {
- m_requester->mouseMovedIn();
+ // At that point, the view isn't attached to a window. We defer the rest of
+ // the initialization process to later.
}
- // Update status
- m_mouseIsIn = YES;
+ return self;
}
////////////////////////////////////////////////////////
--(void)exitFullscreen
+-(void)finishInit
{
- [self removeTrackingArea:m_trackingArea];
+ // Register for window focus events
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(windowDidBecomeKey:)
+ name:NSWindowDidBecomeKeyNotification
+ object:[self window]];
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(windowDidResignKey:)
+ name:NSWindowDidResignKeyNotification
+ object:[self window]];
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(windowDidResignKey:)
+ name:NSWindowWillCloseNotification
+ object:[self window]];
- // Fire an mouse left event if needed
- if (m_mouseIsIn && m_requester != 0) {
- m_requester->mouseMovedOut();
- }
+ // Register for changed screen and changed screen's profile events
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(updateScaleFactor)
+ name:NSWindowDidChangeScreenNotification
+ object:[self window]];
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(updateScaleFactor)
+ name:NSWindowDidChangeScreenProfileNotification
+ object:[self window]];
- // Update status
- m_mouseIsIn = NO;
+ // Now that we have a window, set up correctly the scale factor
+ [self updateScaleFactor];
}
////////////////////////////////////////////////////////
--(void)setRequesterTo:(sf::priv::WindowImplCocoa *)requester
+-(void)setRequesterTo:(sf::priv::WindowImplCocoa*)requester
{
m_requester = requester;
}
////////////////////////////////////////////////////////
--(void)setRealSize:(NSSize)newSize
+-(NSPoint)convertPointToScreen:(NSPoint)point
{
- m_realSize = newSize;
+ NSRect rect = NSZeroRect;
+ rect.origin = point;
+ rect = [[self window] convertRectToScreen:rect];
+ return rect.origin;
}
////////////////////////////////////////////////////////
-(NSPoint)computeGlobalPositionOfRelativePoint:(NSPoint)point
-{
- // Recompute the mouse pos if required.
- if (!NSEqualSizes(m_realSize, NSZeroSize)) {
- point.x = point.x / m_realSize.width * [self frame].size.width;
- point.y = point.y / m_realSize.height * [self frame].size.height;
- }
-
- // Note : -[NSWindow convertBaseToScreen:] is deprecated on 10.7
- // but the recommended -[NSWindow convertRectToScreen] is not
- // available until 10.7.
- //
- // So we stick with the old one for now.
-
-
+{
// Flip SFML coordinates to match window coordinates
point.y = [self frame].size.height - point.y;
-
+
// Get the position of (x, y) in the coordinate system of the window.
point = [self convertPoint:point toView:self];
point = [self convertPoint:point toView:nil]; // nil means window
-
+
// Convert it to screen coordinates
- point = [[self window] convertBaseToScreen:point];
-
- // Flip screen coodinates to match CGDisplayMoveCursorToPoint referential.
- float const screenHeight = [[[self window] screen] frame].size.height;
+ point = [self convertPointToScreen:point];
+
+ // Flip screen coordinates to match CGDisplayMoveCursorToPoint referential.
+ const float screenHeight = [[[self window] screen] frame].size.height;
point.y = screenHeight - point.y;
return point;
@@ -224,17 +255,45 @@ BOOL isValidTextUnicode(NSEvent* event);
////////////////////////////////////////////////////////
--(void)frameDidChange:(NSNotification *)notification
+-(CGFloat)displayScaleFactor
+{
+ return m_scaleFactor;
+}
+
+
+////////////////////////////////////////////////////////
+-(void)updateScaleFactor
+{
+ NSWindow* window = [self window];
+ NSScreen* screen = window ? [window screen] : [NSScreen mainScreen];
+ m_scaleFactor = [screen backingScaleFactor];
+}
+
+
+////////////////////////////////////////////////////////
+-(void)viewDidEndLiveResize
{
+ // We use viewDidEndLiveResize to notify the user ONCE
+ // only, when the resizing is finished.
+ // In a perfect world we would like to notify the user
+ // in live that the window is being resized. However,
+ // it seems impossible to forward to the user
+ // NSViewFrameDidChangeNotification before the resizing
+ // is done. Several notifications are emitted but they
+ // are all delivered after when the work is done.
+
+ [super viewDidEndLiveResize];
+
// Update mouse internal state.
[self updateMouseState];
-
+
// Update the OGL view to fit the new size.
[self update];
-
+
// Send an event
- if (m_requester == 0) return;
-
+ if (m_requester == 0)
+ return;
+
// The new size
NSSize newSize = [self frame].size;
m_requester->windowResized(newSize.width, newSize.height);
@@ -246,12 +305,8 @@ BOOL isValidTextUnicode(NSEvent* event);
{
NSPoint relativeToWindow = [[self window] mouseLocationOutsideOfEventStream];
NSPoint relativeToView = [self convertPoint:relativeToWindow fromView:nil];
-
- if (NSPointInRect(relativeToView, [self frame])) {
- return YES;
- }
-
- return NO;
+
+ return NSPointInRect(relativeToView, [self bounds]);
}
@@ -260,13 +315,72 @@ BOOL isValidTextUnicode(NSEvent* event);
{
BOOL mouseWasIn = m_mouseIsIn;
m_mouseIsIn = [self isMouseInside];
-
+
+ if (m_requester == 0)
+ return;
+
// Send event if needed.
- if (mouseWasIn && !m_mouseIsIn) {
- [self mouseExited:nil];
- } else if (!mouseWasIn && m_mouseIsIn) {
- [self mouseEntered:nil];
- }
+ if (mouseWasIn && !m_mouseIsIn)
+ m_requester->mouseMovedOut();
+ else if (!mouseWasIn && m_mouseIsIn)
+ m_requester->mouseMovedIn();
+}
+
+
+////////////////////////////////////////////////////////
+-(void)windowDidBecomeKey:(NSNotification*)notification
+{
+ (void)notification;
+
+ if (m_requester)
+ m_requester->windowGainedFocus();
+
+ if (m_fullscreen)
+ [self enterFullscreen];
+}
+
+
+////////////////////////////////////////////////////////
+-(void)windowDidResignKey:(NSNotification*)notification
+{
+ (void)notification;
+
+ if (m_requester)
+ m_requester->windowLostFocus();
+
+ if (m_fullscreen)
+ [self exitFullscreen];
+}
+
+
+////////////////////////////////////////////////////////
+-(void)enterFullscreen
+{
+ // Remove the tracking area first,
+ // just to be sure we don't add it twice!
+ [self removeTrackingArea:m_trackingArea];
+ [self addTrackingArea:m_trackingArea];
+
+ // Fire an mouse entered event if needed
+ if (!m_mouseIsIn && (m_requester != 0))
+ m_requester->mouseMovedIn();
+
+ // Update status
+ m_mouseIsIn = YES;
+}
+
+
+////////////////////////////////////////////////////////
+-(void)exitFullscreen
+{
+ [self removeTrackingArea:m_trackingArea];
+
+ // Fire an mouse left event if needed
+ if (m_mouseIsIn && (m_requester != 0))
+ m_requester->mouseMovedOut();
+
+ // Update status
+ m_mouseIsIn = NO;
}
@@ -277,8 +391,10 @@ BOOL isValidTextUnicode(NSEvent* event);
////////////////////////////////////////////////////////
-(void)dealloc
{
- // Unregister
+ // Unregister for window focus events
[[NSNotificationCenter defaultCenter] removeObserver:self];
+
+ // Unregister
[self removeTrackingArea:m_trackingArea];
// Release attributes
@@ -293,8 +409,8 @@ BOOL isValidTextUnicode(NSEvent* event);
////////////////////////////////////////////////////////
--(BOOL)acceptsFirstResponder
-{
+-(BOOL)acceptsFirstResponder
+{
// Accepts key event.
return YES;
}
@@ -313,128 +429,106 @@ BOOL isValidTextUnicode(NSEvent* event);
////////////////////////////////////////////////////////
--(void)mouseDown:(NSEvent *)theEvent
+-(void)mouseDown:(NSEvent*)theEvent
{
// Forward to...
[self otherMouseDown:theEvent];
-
+
// Transmit to non-SFML responder
[[self nextResponder] mouseDown:theEvent];
}
////////////////////////////////////////////////////////
--(void)mouseUp:(NSEvent *)theEvent
+-(void)mouseUp:(NSEvent*)theEvent
{
// Forward to...
[self otherMouseUp:theEvent];
-
+
// Transmit to non-SFML responder
[[self nextResponder] mouseUp:theEvent];
}
////////////////////////////////////////////////////////
--(void)mouseMoved:(NSEvent *)theEvent
+-(void)mouseMoved:(NSEvent*)theEvent
{
// Forward to...
[self otherMouseDragged:theEvent];
-
+
// Transmit to non-SFML responder
[[self nextResponder] mouseMoved:theEvent];
}
////////////////////////////////////////////////////////
--(void)scrollWheel:(NSEvent *)theEvent
+-(void)scrollWheel:(NSEvent*)theEvent
{
- if (m_requester != 0) {
+ if (m_requester != 0)
+ {
NSPoint loc = [self cursorPositionFromEvent:theEvent];
-
m_requester->mouseWheelScrolledAt([theEvent deltaY], loc.x, loc.y);
}
-
+
// Transmit to non-SFML responder
[[self nextResponder] scrollWheel:theEvent];
}
////////////////////////////////////////////////////////
--(void)mouseEntered:(NSEvent *)theEvent
+-(void)mouseEntered:(NSEvent*)theEvent
{
- // There are two cases when we need to fire an event:
- // a) the event is nil, meaning that the method was
- // called from our code (e.g. updateMouseState)
- // b) the mouse was outside the view.
- BOOL shouldFire = (theEvent == nil || m_mouseIsIn == NO);
-
- // Update status
- m_mouseIsIn = YES;
-
- if (m_requester == 0) return;
-
- // Fire (or not) an event
- if (shouldFire) {
- m_requester->mouseMovedIn();
- }
+ (void)theEvent;
+ [self updateMouseState];
}
////////////////////////////////////////////////////////
--(void)mouseExited:(NSEvent *)theEvent
+-(void)mouseExited:(NSEvent*)theEvent
{
- // Similarly to mouseEntered:
- BOOL shouldFire = (theEvent == nil || m_mouseIsIn == YES);
-
- // Update status
- m_mouseIsIn = NO;
-
- if (m_requester == 0) return;
-
- // Fire (or not) an event
- if (shouldFire) {
- m_requester->mouseMovedOut();
- }
+ (void)theEvent;
+ [self updateMouseState];
}
////////////////////////////////////////////////////////
--(void)rightMouseDown:(NSEvent *)theEvent
+-(void)rightMouseDown:(NSEvent*)theEvent
{
// Forward to...
[self otherMouseDown:theEvent];
-
+
// Transmit to non-SFML responder
[[self nextResponder] rightMouseDown:theEvent];
}
////////////////////////////////////////////////////////
--(void)rightMouseUp:(NSEvent *)theEvent
+-(void)rightMouseUp:(NSEvent*)theEvent
{
// Forward to...
[self otherMouseUp:theEvent];
-
+
// Transmit to non-SFML responder
[[self nextResponder] rightMouseUp:theEvent];
}
////////////////////////////////////////////////////////
--(void)otherMouseDown:(NSEvent *)theEvent
+-(void)otherMouseDown:(NSEvent*)theEvent
{
sf::Mouse::Button button = [self mouseButtonFromEvent:theEvent];
-
- if (m_requester != 0) {
+
+ if (m_requester != 0)
+ {
NSPoint loc = [self cursorPositionFromEvent:theEvent];
-
- if (button != sf::Mouse::ButtonCount) {
+
+ if (button != sf::Mouse::ButtonCount)
m_requester->mouseDownAt(button, loc.x, loc.y);
- }
}
-
+
// If the event is not forwarded by mouseDown or rightMouseDown...
- if (button != sf::Mouse::Left && button != sf::Mouse::Right) {
+ if ((button != sf::Mouse::Left) && (button != sf::Mouse::Right))
+ {
// ... transmit to non-SFML responder
[[self nextResponder] otherMouseDown:theEvent];
}
@@ -442,20 +536,21 @@ BOOL isValidTextUnicode(NSEvent* event);
////////////////////////////////////////////////////////
--(void)otherMouseUp:(NSEvent *)theEvent
+-(void)otherMouseUp:(NSEvent*)theEvent
{
sf::Mouse::Button button = [self mouseButtonFromEvent:theEvent];
-
- if (m_requester != 0) {
+
+ if (m_requester != 0)
+ {
NSPoint loc = [self cursorPositionFromEvent:theEvent];
-
- if (button != sf::Mouse::ButtonCount) {
+
+ if (button != sf::Mouse::ButtonCount)
m_requester->mouseUpAt(button, loc.x, loc.y);
- }
}
-
+
// If the event is not forwarded by mouseUp or rightMouseUp...
- if (button != sf::Mouse::Left && button != sf::Mouse::Right) {
+ if ((button != sf::Mouse::Left) && (button != sf::Mouse::Right))
+ {
// ... transmit to non-SFML responder
[[self nextResponder] otherMouseUp:theEvent];
}
@@ -463,45 +558,46 @@ BOOL isValidTextUnicode(NSEvent* event);
////////////////////////////////////////////////////////
--(void)rightMouseDragged:(NSEvent *)theEvent
+-(void)rightMouseDragged:(NSEvent*)theEvent
{
// Forward to...
[self otherMouseDragged:theEvent];
-
+
// Transmit to non-SFML responder
[[self nextResponder] rightMouseDragged:theEvent];
}
////////////////////////////////////////////////////////
--(void)mouseDragged:(NSEvent *)theEvent
+-(void)mouseDragged:(NSEvent*)theEvent
{
// Forward to...
[self otherMouseDragged:theEvent];
-
+
// Transmit to non-SFML responder
[[self nextResponder] mouseDragged:theEvent];
}
////////////////////////////////////////////////////////
--(void)otherMouseDragged:(NSEvent *)theEvent
+-(void)otherMouseDragged:(NSEvent*)theEvent
{
- if (m_requester != 0) {
+ if (m_requester != 0)
+ {
NSPoint loc = [self cursorPositionFromEvent:theEvent];
// Make sure the point is inside the view.
// (mouseEntered: and mouseExited: are not immediately called
// when the mouse is dragged. That would be too easy!)
[self updateMouseState];
- if (m_mouseIsIn) {
+ if (m_mouseIsIn)
m_requester->mouseMovedAt(loc.x, loc.y);
- }
}
-
+
// If the event is not forwarded by mouseDragged or rightMouseDragged...
sf::Mouse::Button button = [self mouseButtonFromEvent:theEvent];
- if (button != sf::Mouse::Left && button != sf::Mouse::Right) {
+ if ((button != sf::Mouse::Left) && (button != sf::Mouse::Right))
+ {
// ... transmit to non-SFML responder
[[self nextResponder] otherMouseUp:theEvent];
}
@@ -509,35 +605,33 @@ BOOL isValidTextUnicode(NSEvent* event);
////////////////////////////////////////////////////////
--(NSPoint)cursorPositionFromEvent:(NSEvent *)eventOrNil
+-(NSPoint)cursorPositionFromEvent:(NSEvent*)eventOrNil
{
NSPoint loc;
// If no event given then get current mouse pos.
- if (eventOrNil == nil) {
+ if (eventOrNil == nil)
+ {
NSPoint rawPos = [[self window] mouseLocationOutsideOfEventStream];
loc = [self convertPoint:rawPos fromView:nil];
- } else {
+ }
+ else
+ {
loc = [self convertPoint:[eventOrNil locationInWindow] fromView:nil];
}
-
+
// Don't forget to change to SFML coord system.
float h = [self frame].size.height;
loc.y = h - loc.y;
-
- // Recompute the mouse pos if required.
- if (!NSEqualSizes(m_realSize, NSZeroSize)) {
- loc.x = loc.x * m_realSize.width / [self frame].size.width;
- loc.y = loc.y * m_realSize.height / [self frame].size.height;
- }
-
+
return loc;
}
////////////////////////////////////////////////////////
--(sf::Mouse::Button)mouseButtonFromEvent:(NSEvent *)event
+-(sf::Mouse::Button)mouseButtonFromEvent:(NSEvent*)event
{
- switch ([event buttonNumber]) {
+ switch ([event buttonNumber])
+ {
case 0: return sf::Mouse::Left;
case 1: return sf::Mouse::Right;
case 2: return sf::Mouse::Middle;
@@ -553,29 +647,32 @@ BOOL isValidTextUnicode(NSEvent* event);
////////////////////////////////////////////////////////
--(void)keyDown:(NSEvent *)theEvent
+-(void)keyDown:(NSEvent*)theEvent
{
// Transmit to non-SFML responder
[[self nextResponder] keyDown:theEvent];
-
- if (m_requester == 0) return;
-
+
+ if (m_requester == 0)
+ return;
+
// Handle key down event
- if (m_useKeyRepeat || ![theEvent isARepeat]) {
+ if (m_useKeyRepeat || ![theEvent isARepeat])
+ {
sf::Event::KeyEvent key = [SFOpenGLView convertNSKeyEventToSFMLEvent:theEvent];
-
- if (key.code != sf::Keyboard::Unknown) { // The key is recognized.
+
+ if (key.code != sf::Keyboard::Unknown) // The key is recognized.
m_requester->keyDown(key);
- }
}
- // Handle text entred event:
+ // Handle text entered event:
// Ignore event if we don't want repeated keystrokes
- if (m_useKeyRepeat || ![theEvent isARepeat]) {
+ if (m_useKeyRepeat || ![theEvent isARepeat])
+ {
// Ignore escape key and other non text keycode (See NSEvent.h)
// because they produce a sound alert.
- if (isValidTextUnicode(theEvent)) {
+ if (isValidTextUnicode(theEvent))
+ {
// Send the event to the hidden text view for processing
[m_hiddenTextView interpretKeyEvents:[NSArray arrayWithObject:theEvent]];
}
@@ -588,25 +685,27 @@ BOOL isValidTextUnicode(NSEvent* event);
unsigned short keycode = [theEvent keyCode];
// Backspace
- if (keycode == 0x33) {
- // Send the correct unicode value (i.e. 8) instead of 127 (which is 'delete')
+ if (keycode == 0x33)
+ {
+ // Send the correct Unicode value (i.e. 8) instead of 127 (which is 'delete')
m_requester->textEntered(8);
}
// Delete
- else if (keycode == 0x75 || keycode == NSDeleteFunctionKey) {
+ else if ((keycode == 0x75) || (keycode == NSDeleteFunctionKey))
+ {
// Instead of the value 63272 we send 127.
m_requester->textEntered(127);
}
// Otherwise, let's see what our hidden field has computed
- else {
+ else
+ {
NSString* string = [m_hiddenTextView string];
// Send each character to SFML event requester
- for (NSUInteger index = 0; index < [string length]; ++index) {
+ for (NSUInteger index = 0; index < [string length]; ++index)
m_requester->textEntered([string characterAtIndex:index]);
- }
// Empty our hidden cache
[m_hiddenTextView setString:@""];
@@ -616,64 +715,70 @@ BOOL isValidTextUnicode(NSEvent* event);
////////////////////////////////////////////////////////
--(void)keyUp:(NSEvent *)theEvent
+-(void)sfKeyUp:(NSEvent*)theEvent
{
+ // For some mystic reasons, key released events don't work the same way
+ // as key pressed events... We somewhat hijack the event chain of response
+ // in -[SFApplication sendEvent:] and resume this chain with the next
+ // responder.
+ // This is workaround to make sure key released events are fired in
+ // fullscreen window too.
+
// Transmit to non-SFML responder
[[self nextResponder] keyUp:theEvent];
-
- if (m_requester == 0) return;
-
+
+ if (m_requester == 0)
+ return;
+
sf::Event::KeyEvent key = [SFOpenGLView convertNSKeyEventToSFMLEvent:theEvent];
-
- if (key.code != sf::Keyboard::Unknown) { // The key is recognized.
+
+ if (key.code != sf::Keyboard::Unknown) // The key is recognized.
m_requester->keyUp(key);
- }
}
////////////////////////////////////////////////////////
--(void)flagsChanged:(NSEvent *)theEvent
+-(void)flagsChanged:(NSEvent*)theEvent
{
// Transmit to non-SFML responder
[[self nextResponder] flagsChanged:theEvent];
-
- if (m_requester == 0) return;
-
+
+ if (m_requester == 0)
+ return;
+
NSUInteger modifiers = [theEvent modifierFlags];
handleModifiersChanged(modifiers, *m_requester);
}
////////////////////////////////////////////////////////
-+(sf::Event::KeyEvent)convertNSKeyEventToSFMLEvent:(NSEvent *)anEvent
++(sf::Event::KeyEvent)convertNSKeyEventToSFMLEvent:(NSEvent*)event
{
// Key code
sf::Keyboard::Key key = sf::Keyboard::Unknown;
-
+
// First we look if the key down is from a list of characters
// that depend on keyboard localization.
- NSString* string = [anEvent charactersIgnoringModifiers];
- if ([string length] > 0) {
+ NSString* string = [event charactersIgnoringModifiers];
+ if ([string length] > 0)
key = sf::priv::HIDInputManager::localizedKeys([string characterAtIndex:0]);
- }
-
+
// If the key is not a localized one, we try to find a corresponding code
// through virtual key code.
- if (key == sf::Keyboard::Unknown) {
- key = sf::priv::HIDInputManager::nonLocalizedKeys([anEvent keyCode]);
- }
-
+ if (key == sf::Keyboard::Unknown)
+ key = sf::priv::HIDInputManager::nonLocalizedKeys([event keyCode]);
+
//#ifdef SFML_DEBUG // Don't bother the final customers with annoying messages.
// if (key.code == sf::Keyboard::Unknown) { // The key is unknown.
-// sf::err() << "This is an unknow key. Virtual key code is 0x"
+// sf::err() << "This is an unknown key. Virtual key code is 0x"
// << std::hex
-// << [anEvent keyCode]
+// << [event keyCode]
// << "."
// << std::endl;
// }
//#endif
-
- return keyEventWithModifiers([anEvent modifierFlags], key);
+
+ return keyEventWithModifiers([event modifierFlags], key);
}
@end
@@ -683,12 +788,17 @@ BOOL isValidTextUnicode(NSEvent* event);
BOOL isValidTextUnicode(NSEvent* event)
{
- if ([event keyCode] == 0x35) { // Escape
+ if ([event keyCode] == 0x35) // Escape
+ {
return false;
- } else if ([[event characters] length] > 0) {
+ }
+ else if ([[event characters] length] > 0)
+ {
unichar code = [[event characters] characterAtIndex:0];
- return code < 0xF700 || code > 0xF8FF;
- } else {
+ return ((code < 0xF700) || (code > 0xF8FF));
+ }
+ else
+ {
return true;
}
}
diff --git a/src/SFML/Window/OSX/SFSilentResponder.h b/src/SFML/Window/OSX/SFSilentResponder.h
index 0890c92..64de2d7 100644
--- a/src/SFML/Window/OSX/SFSilentResponder.h
+++ b/src/SFML/Window/OSX/SFSilentResponder.h
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -32,6 +32,7 @@
/// \brief Silent Responder used to prevent sound alert with key event
///
/// Mainly used by SFOpenGLView and its hidden text view.
+///
////////////////////////////////////////////////////////////
@interface SFSilentResponder : NSResponder
diff --git a/src/SFML/Window/OSX/SFSilentResponder.m b/src/SFML/Window/OSX/SFSilentResponder.m
index 0fb49f6..5789e44 100644
--- a/src/SFML/Window/OSX/SFSilentResponder.m
+++ b/src/SFML/Window/OSX/SFSilentResponder.m
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -33,6 +33,7 @@
-(void)doCommandBySelector:(SEL)sel
{
// Just do nothing, to prevent sound alerts
+ (void)sel;
}
@end
diff --git a/src/SFML/Window/OSX/SFViewController.h b/src/SFML/Window/OSX/SFViewController.h
index 1a75327..cb2c35e 100644
--- a/src/SFML/Window/OSX/SFViewController.h
+++ b/src/SFML/Window/OSX/SFViewController.h
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -34,16 +34,25 @@
@class SFOpenGLView;
////////////////////////////////////////////////////////////
-/// Implementation of WindowImplDelegateProtocol for view managment.
+/// \brief Implementation of WindowImplDelegateProtocol for view management
///
////////////////////////////////////////////////////////////
-@interface SFViewController : NSObject <WindowImplDelegateProtocol> {
- NSView* m_view;
- SFOpenGLView* m_oglView;
- sf::priv::WindowImplCocoa* m_requester;
+@interface SFViewController : NSObject <WindowImplDelegateProtocol>
+{
+ NSView* m_view; ///< Underlying Cocoa view
+ SFOpenGLView* m_oglView; ///< OpenGL view
+ sf::priv::WindowImplCocoa* m_requester; ///< View's requester
}
--(id)initWithView:(NSView *)view;
+////////////////////////////////////////////////////////////
+/// \brief Initialize the view controller
+///
+/// \param view view to be controlled
+///
+/// \return an initialized view controller
+///
+////////////////////////////////////////////////////////////
+-(id)initWithView:(NSView*)view;
@end
diff --git a/src/SFML/Window/OSX/SFViewController.mm b/src/SFML/Window/OSX/SFViewController.mm
index d9cc4c7..ba2e8a0 100644
--- a/src/SFML/Window/OSX/SFViewController.mm
+++ b/src/SFML/Window/OSX/SFViewController.mm
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -26,55 +26,55 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#import <SFML/Window/OSX/SFViewController.h>
-#import <SFML/Window/OSX/SFOpenGLView.h>
-#import <SFML/Window/OSX/SFApplication.h>
#include <SFML/System/Err.hpp>
#include <SFML/Window/OSX/WindowImplCocoa.hpp>
+#import <SFML/Window/OSX/SFApplication.h>
+#import <SFML/Window/OSX/SFOpenGLView.h>
+#import <SFML/Window/OSX/SFViewController.h>
+
@implementation SFViewController
////////////////////////////////////////////////////////
-(id)initWithView:(NSView *)view
{
- if ((self = [super init])) {
+ if ((self = [super init]))
+ {
m_requester = 0;
-
+
// Retain the view for our own use.
m_view = [view retain];
-
- if (m_view == nil) {
-
- sf::err()
- << "No view was given to initWithWindow:."
- << std::endl;
-
+
+ if (m_view == nil)
+ {
+ sf::err() << "No view was given to initWithWindow:." << std::endl;
return self;
}
-
+
// Create the view.
NSRect frame = [m_view frame];
frame.origin.x = 0;
frame.origin.y = 0;
m_oglView = [[SFOpenGLView alloc] initWithFrame:frame];
-
- if (m_oglView == nil) {
-
- sf::err()
- << "Could not create an instance of NSOpenGLView "
- << "in (SFViewController -initWithView:)."
- << std::endl;
-
+
+ if (m_oglView == nil)
+ {
+ sf::err() << "Could not create an instance of NSOpenGLView "
+ << "in (SFViewController -initWithView:)."
+ << std::endl;
+
return self;
}
-
+
// Set the (OGL) view to the view as its "content" view.
[m_view addSubview:m_oglView];
-
+
[m_oglView setAutoresizingMask:[m_view autoresizingMask]];
+
+ [m_oglView finishInit];
}
-
+
return self;
}
@@ -83,41 +83,41 @@
-(void)dealloc
{
[self closeWindow];
-
+
[m_view release];
[m_oglView release];
-
+
[super dealloc];
}
////////////////////////////////////////////////////////
--(void)setRequesterTo:(sf::priv::WindowImplCocoa *)requester
+-(CGFloat)displayScaleFactor
{
- // Forward to the view.
- [m_oglView setRequesterTo:requester];
- m_requester = requester;
+ return [m_oglView displayScaleFactor];
}
////////////////////////////////////////////////////////
--(sf::WindowHandle)getSystemHandle
+-(void)setRequesterTo:(sf::priv::WindowImplCocoa*)requester
{
- return m_view;
+ // Forward to the view.
+ [m_oglView setRequesterTo:requester];
+ m_requester = requester;
}
////////////////////////////////////////////////////////
--(void)hideMouseCursor
+-(sf::WindowHandle)getSystemHandle
{
- [NSCursor hide];
+ return m_view;
}
////////////////////////////////////////////////////////
--(void)showMouseCursor
+-(BOOL)isMouseInside
{
- [NSCursor unhide];
+ return [m_oglView isMouseInside];
}
@@ -132,7 +132,9 @@
////////////////////////////////////////////////////////.
-(void)setWindowPositionToX:(int)x Y:(int)y
{
- sf::err() << "Cannot move SFML area when SFML is integrated in a NSView. Use the view hanlder directly instead." << std::endl;
+ (void)x;
+ (void)y;
+ sf::err() << "Cannot move SFML area when SFML is integrated in a NSView. Use the view handler directly instead." << std::endl;
}
@@ -150,15 +152,16 @@
[m_view frame].origin.y,
width,
height);
-
+
[m_view setFrame:frame];
[m_oglView setFrame:frame];
}
////////////////////////////////////////////////////////
--(void)changeTitle:(NSString *)title
+-(void)changeTitle:(NSString*)title
{
+ (void)title;
sf::err() << "Cannot change the title of the SFML area when SFML is integrated in a NSView." << std::endl;
}
@@ -185,6 +188,26 @@
////////////////////////////////////////////////////////
+-(void)requestFocus
+{
+ // Note: this doesn't imply that the view will get any event.
+ // The user has to make sure events are forwarded to the view
+ // with the usual responder chain.
+ [[m_view window] makeKeyAndOrderFront:nil];
+
+ // In case the app is not active, make its dock icon bounce for one sec
+ [NSApp requestUserAttention:NSInformationalRequest];
+}
+
+
+////////////////////////////////////////////////////////////
+-(BOOL)hasFocus
+{
+ return [NSApp keyWindow] == [m_view window];
+}
+
+
+////////////////////////////////////////////////////////
-(void)enableKeyRepeat
{
[m_oglView enableKeyRepeat];
@@ -200,9 +223,12 @@
////////////////////////////////////////////////////////
-(void)setIconTo:(unsigned int)width
- by:(unsigned int)height
- with:(sf::Uint8 const *)pixels
+ by:(unsigned int)height
+ with:(const sf::Uint8*)pixels
{
+ (void)width;
+ (void)height;
+ (void)pixels;
sf::err() << "Cannot set an icon when SFML is integrated in a NSView." << std::endl;
}
@@ -211,27 +237,25 @@
-(void)processEvent
{
// If we are not on the main thread we stop here and advice the user.
- if ([NSThread currentThread] != [NSThread mainThread]) {
+ if ([NSThread currentThread] != [NSThread mainThread])
+ {
/*
* See http://lists.apple.com/archives/cocoa-dev/2011/Feb/msg00460.html
* for more information.
*/
- sf::err()
- << "Cannot fetch event from a worker thread. (OS X restriction)"
- << std::endl;
-
+ sf::err() << "Cannot fetch event from a worker thread. (OS X restriction)" << std::endl;
+
return;
}
-
+
// If we don't have a requester we don't fetch event.
- if (m_requester != 0) {
+ if (m_requester != 0)
[SFApplication processEvent];
- }
}
////////////////////////////////////////////////////////
--(void)applyContext:(NSOpenGLContext *)context
+-(void)applyContext:(NSOpenGLContext*)context
{
[m_oglView setOpenGLContext:context];
[context setView:m_oglView];
diff --git a/src/SFML/Window/OSX/SFWindow.h b/src/SFML/Window/OSX/SFWindow.h
index ad823a8..3eecc25 100644
--- a/src/SFML/Window/OSX/SFWindow.h
+++ b/src/SFML/Window/OSX/SFWindow.h
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -29,20 +29,79 @@
#import <AppKit/AppKit.h>
////////////////////////////////////////////////////////////
-/// \brief Here we redefine some methods to allow grabing fullscreen events.
+/// \brief Here we redefine some methods to allow grabbing fullscreen events
///
////////////////////////////////////////////////////////////
-@interface SFWindow : NSWindow {
-
-}
+@interface SFWindow : NSWindow
////////////////////////////////////////////////////////////
-/// These two methods must return YES to grab fullscreen events.
+/// \brief Allow to grab fullscreen events
+///
+/// acceptsFirstResponder and canBecomeKeyWindow messages must
+/// return YES to grab fullscreen events.
+///
/// See http://stackoverflow.com/questions/999464/fullscreen-key-down-actions
-/// for more informations
+///
+/// \return YES
///
////////////////////////////////////////////////////////////
-(BOOL)acceptsFirstResponder;
+
+////////////////////////////////////////////////////////////
+/// \brief Allow to grab fullscreen events
+///
+/// See acceptsFirstResponder documentation above.
+///
+/// \return YES
+///
+////////////////////////////////////////////////////////////
-(BOOL)canBecomeKeyWindow;
+////////////////////////////////////////////////////////////
+/// \brief Prevent system alert
+///
+/// \param theEvent a Cocoa event
+///
+////////////////////////////////////////////////////////////
+-(void)keyDown:(NSEvent*)theEvent;
+
+////////////////////////////////////////////////////////////
+/// \brief This action method simulates the user clicking the close button
+///
+/// Override NSWindow implementation, see implementation for details
+///
+/// \param sender The message’s sender
+///
+////////////////////////////////////////////////////////////
+-(void)performClose:(id)sender;
+
+////////////////////////////////////////////////////////////
+/// \brief Enabling or disabling a specific menu item
+///
+/// \param menuItem An NSMenuItem object that represents the menu item
+///
+/// \return YES to enable menuItem, NO to disable it.
+///
+////////////////////////////////////////////////////////////
+-(BOOL)validateMenuItem:(NSMenuItem*)menuItem;
+
+@end
+
+
+////////////////////////////////////////////////////////////
+/// \brief Extension of NSWindow
+///
+/// Add some extra messages for SFML internal usage.
+///
+////////////////////////////////////////////////////////////
+@interface NSWindow (SFML)
+
+////////////////////////////////////////////////////////////
+/// Proxy for performClose: for the app delegate
+///
+/// \return nil
+///
+////////////////////////////////////////////////////////////
+-(id)sfClose;
+
@end
diff --git a/src/SFML/Window/OSX/SFWindow.m b/src/SFML/Window/OSX/SFWindow.m
index 5f5de20..70e7ee8 100644
--- a/src/SFML/Window/OSX/SFWindow.m
+++ b/src/SFML/Window/OSX/SFWindow.m
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -26,7 +26,7 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#import "SFWindow.h"
+#import <SFML/Window/OSX/SFWindow.h>
@implementation SFWindow
@@ -44,8 +44,9 @@
return YES;
}
+
////////////////////////////////////////////////////////
--(void)keyDown:(NSEvent *)theEvent
+-(void)keyDown:(NSEvent*)theEvent
{
// Do nothing except preventing a system alert each time a key is pressed
//
@@ -53,7 +54,59 @@
// -----------------------
// Consider overriding NSResponder -keyDown: message in a Cocoa view/window
// that contains a SFML rendering area. Doing so will prevent a system
- // alert to be thrown everytime the user presses a key.
+ // alert to be thrown every time the user presses a key.
+ (void)theEvent;
+}
+
+
+////////////////////////////////////////////////////////
+-(void)performClose:(id)sender
+{
+ // From Apple documentation:
+ //
+ // > If the window’s delegate or the window itself implements windowShouldClose:,
+ // > that message is sent with the window as the argument. (Only one such message is sent;
+ // > if both the delegate and the NSWindow object implement the method, only the delegate
+ // > receives the message.) If the windowShouldClose: method returns NO, the window isn’t
+ // > closed. If it returns YES, or if it isn’t implemented, performClose: invokes the
+ // > close method to close the window.
+ // >
+ // > If the window doesn’t have a close button or can’t be closed (for example, if the
+ // > delegate replies NO to a windowShouldClose: message), the system emits the alert sound.
+ //
+ // The last paragraph is problematic for SFML fullscreen window since they don't have
+ // a close button (style is NSBorderlessWindowMask). So we reimplement this function.
+
+ BOOL shouldClose = NO;
+
+ if ([self delegate] && [[self delegate] respondsToSelector:@selector(windowShouldClose:)])
+ shouldClose = [[self delegate] windowShouldClose:sender];
+ // else if ([self respondsToSelector:@selector(windowShouldClose:)])
+ // shouldClose = [self windowShouldClose:sender];
+ // error: no visible @interface for 'SFWindow' declares the selector 'windowShouldClose:'
+
+ if (shouldClose)
+ [self close];
+}
+
+
+////////////////////////////////////////////////////////
+-(BOOL)validateMenuItem:(NSMenuItem*)menuItem
+{
+ return [menuItem action] == @selector(performClose:);
+}
+
+
+@end
+
+
+@implementation NSWindow (SFML)
+
+////////////////////////////////////////////////////////////
+-(id)sfClose
+{
+ [self performClose:nil];
+ return nil;
}
@end
diff --git a/src/SFML/Window/OSX/SFWindowController.h b/src/SFML/Window/OSX/SFWindowController.h
index e96ba95..2ff489b 100644
--- a/src/SFML/Window/OSX/SFWindowController.h
+++ b/src/SFML/Window/OSX/SFWindowController.h
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -26,9 +26,10 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#import <SFML/Window/OSX/WindowImplDelegateProtocol.h>
#include <SFML/Window/VideoMode.hpp>
+#import <SFML/Window/OSX/WindowImplDelegateProtocol.h>
+
////////////////////////////////////////////////////////////
/// Predefine some classes
////////////////////////////////////////////////////////////
@@ -41,39 +42,40 @@ namespace sf {
@class SFOpenGLView;
////////////////////////////////////////////////////////////
-/// Implementation of WindowImplDelegateProtocol for window managment.
-///
-/// Key and mouse events are delegated to its view.
-/// Window events are managed by this class.
+/// \brief Implementation of WindowImplDelegateProtocol for window management
+///
+/// Key, mouse and Window focus events are delegated to its view, SFOpenGLView.
///
/// Used when SFML handle everything and when a NSWindow* is given
/// as handle to WindowImpl.
///
-/// m_fullscreenMode is bind to default video mode if we don't need to change screen size.
-///
////////////////////////////////////////////////////////////
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 // NSWindowDelegate is only define since 10.6
-@interface SFWindowController : NSResponder <WindowImplDelegateProtocol> {
-#else
-@interface SFWindowController : NSResponder <WindowImplDelegateProtocol, NSWindowDelegate> {
-#endif
- NSWindow* m_window;
- SFOpenGLView* m_oglView;
- sf::priv::WindowImplCocoa* m_requester;
- sf::VideoMode* m_fullscreenMode; // Note : C++ ctor/dtor are not called for Obj-C fields.
+@interface SFWindowController : NSResponder <WindowImplDelegateProtocol, NSWindowDelegate>
+{
+ NSWindow* m_window; ///< Underlying Cocoa window to be controlled
+ SFOpenGLView* m_oglView; ///< OpenGL view for rendering
+ sf::priv::WindowImplCocoa* m_requester; ///< Requester
}
////////////////////////////////////////////////////////////
-/// Create the SFML window with an external Cocoa window.
-///
+/// \brief Create the SFML window with an external Cocoa window
+///
+/// \param window Cocoa window to be controlled
+///
+/// \return an initialized controller
+///
////////////////////////////////////////////////////////////
--(id)initWithWindow:(NSWindow *)window;
+-(id)initWithWindow:(NSWindow*)window;
////////////////////////////////////////////////////////////
-/// Create the SFML window "from scratch" (full SFML handling).
-///
+/// \brief Create the SFML window "from scratch" (SFML handle everything)
+///
+/// \param mode Video mode
+/// \param style Window's style, as described by sf::Style
+///
+/// \return an initialized controller
+///
////////////////////////////////////////////////////////////
--(id)initWithMode:(sf::VideoMode const &)mode andStyle:(unsigned long)style;
+-(id)initWithMode:(const sf::VideoMode&)mode andStyle:(unsigned long)style;
@end
diff --git a/src/SFML/Window/OSX/SFWindowController.mm b/src/SFML/Window/OSX/SFWindowController.mm
index 4f68c13..6f34d68 100644
--- a/src/SFML/Window/OSX/SFWindowController.mm
+++ b/src/SFML/Window/OSX/SFWindowController.mm
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -26,34 +26,56 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include <SFML/Window/OSX/WindowImplCocoa.hpp>
#include <SFML/Window/VideoMode.hpp>
#include <SFML/Window/WindowHandle.hpp>
#include <SFML/Window/WindowStyle.hpp>
+#include <SFML/Window/OSX/WindowImplCocoa.hpp>
#include <SFML/System/Err.hpp>
#include <ApplicationServices/ApplicationServices.h>
-#import <SFML/Window/OSX/SFWindowController.h>
#import <SFML/Window/OSX/SFApplication.h>
#import <SFML/Window/OSX/SFOpenGLView.h>
#import <SFML/Window/OSX/SFWindow.h>
+#import <SFML/Window/OSX/SFWindowController.h>
#import <OpenGL/OpenGL.h>
////////////////////////////////////////////////////////////
-/// SFWindowController class : Privates Methods Declaration
+/// SFBlackView is a simple view filled with black, nothing more
+///
+////////////////////////////////////////////////////////////
+@interface SFBlackView : NSView
+@end
+
+@implementation SFBlackView
+
+////////////////////////////////////////////////////////////
+-(void)drawRect:(NSRect)dirtyRect
+{
+ [[NSColor blackColor] setFill];
+ NSRectFill(dirtyRect);
+}
+
+@end
+
+////////////////////////////////////////////////////////////
+/// SFWindowController class: private interface
///
////////////////////////////////////////////////////////////
@interface SFWindowController ()
////////////////////////////////////////////////////////////
-/// Retrieves the screen height.
-///
+/// \brief Retrieves the screen height
+///
+/// \return screen height
+///
////////////////////////////////////////////////////////////
-(float)screenHeight;
////////////////////////////////////////////////////////////
-/// Retrives the title bar height.
-///
+/// \brief Retrieves the title bar height
+///
+/// \return title bar height
+///
////////////////////////////////////////////////////////////
-(float)titlebarHeight;
@@ -65,190 +87,219 @@
#pragma mark SFWindowController's methods
////////////////////////////////////////////////////////
--(id)initWithWindow:(NSWindow *)window
+-(id)initWithWindow:(NSWindow*)window
{
- if ((self = [super init])) {
+ if ((self = [super init]))
+ {
+ m_window = nil;
+ m_oglView = nil;
m_requester = 0;
- m_fullscreenMode = new sf::VideoMode();
-
+
// Retain the window for our own use.
m_window = [window retain];
-
- if (m_window == nil) {
-
- sf::err()
- << "No window was given to initWithWindow:."
- << std::endl;
-
+
+ if (m_window == nil)
+ {
+ sf::err() << "No window was given to -[SFWindowController initWithWindow:]." << std::endl;
return self;
}
-
+
// Create the view.
- m_oglView = [[SFOpenGLView alloc] initWithFrame:[[m_window contentView] frame]];
-
- if (m_oglView == nil) {
-
- sf::err()
- << "Could not create an instance of NSOpenGLView "
- << "in (SFWindowController -initWithWindow:)."
- << std::endl;
-
+ m_oglView = [[SFOpenGLView alloc] initWithFrame:[[m_window contentView] frame]
+ fullscreen:NO];
+
+ if (m_oglView == nil)
+ {
+ sf::err() << "Could not create an instance of NSOpenGLView "
+ << "in -[SFWindowController initWithWindow:]."
+ << std::endl;
return self;
}
-
+
// Set the view to the window as its content view.
[m_window setContentView:m_oglView];
}
-
+
return self;
}
////////////////////////////////////////////////////////
--(id)initWithMode:(sf::VideoMode const &)mode andStyle:(unsigned long)style
+-(id)initWithMode:(const sf::VideoMode&)mode andStyle:(unsigned long)style
{
// If we are not on the main thread we stop here and advice the user.
- if ([NSThread currentThread] != [NSThread mainThread]) {
+ if ([NSThread currentThread] != [NSThread mainThread])
+ {
/*
* See http://lists.apple.com/archives/cocoa-dev/2011/Feb/msg00460.html
* for more information.
*/
- sf::err()
- << "Cannot create a window from a worker thread. (OS X limitation)"
- << std::endl;
-
+ sf::err() << "Cannot create a window from a worker thread. (OS X limitation)" << std::endl;
+
return nil;
}
- if ((self = [super init])) {
+ if ((self = [super init]))
+ {
+ m_window = nil;
+ m_oglView = nil;
m_requester = 0;
- m_fullscreenMode = new sf::VideoMode();
-
- // Create our window size.
- NSRect rect = NSZeroRect;
- if (style & sf::Style::Fullscreen && mode != sf::VideoMode::getDesktopMode()) {
- // We use desktop mode to size the window
- // but we set the back buffer size to 'mode' in applyContext method.
-
- *m_fullscreenMode = mode;
-
- sf::VideoMode dm = sf::VideoMode::getDesktopMode();
- rect = NSMakeRect(0, 0, dm.width, dm.height);
-
- } else { // no fullscreen requested.
- rect = NSMakeRect(0, 0, mode.width, mode.height);
- }
-
- // Convert the SFML window style to Cocoa window style.
- unsigned int nsStyle = NSBorderlessWindowMask;
- if (!(style & sf::Style::Fullscreen)) { // if fullscrean we keep our NSBorderlessWindowMask.
-
- if (style & sf::Style::Titlebar) nsStyle |= NSTitledWindowMask | NSMiniaturizableWindowMask;
-
- if (style & sf::Style::Resize) nsStyle |= NSResizableWindowMask;
-
- if (style & sf::Style::Close) nsStyle |= NSClosableWindowMask;
-
- }
-
- // Create the window.
- m_window = [[SFWindow alloc] initWithContentRect:rect
- styleMask:nsStyle
- backing:NSBackingStoreBuffered
- defer:NO]; // Don't defer it!
- /*
- "YES" produces some "invalid drawable".
- See http://www.cocoabuilder.com/archive/cocoa/152482-nsviews-and-nsopenglcontext-invalid-drawable-error.html
-
- [...]
- As best as I can figure, this is happening because the NSWindow (and
- hence my view) are not visible onscreen yet, and the system doesn't like that.
- [...]
- */
-
- if (m_window == nil) {
- sf::err()
- << "Could not create an instance of NSWindow "
- << "in (SFWindowController -initWithMode:andStyle:)."
- << std::endl;
-
- return self;
- }
-
- // Apply special feature for fullscreen window.
- if (style & sf::Style::Fullscreen) {
- // We place the window above everything else.
- [m_window setOpaque:YES];
- [m_window setHidesOnDeactivate:YES];
- [m_window setLevel:NSMainMenuWindowLevel+1];
-
- // And hide the menu bar
- [NSMenu setMenuBarVisible:NO];
-
- /* ---------------------------
- * | Note for future version |
- * ---------------------------
- *
- * starting with OS 10.6 NSView provides
- * a new method -enterFullScreenMode:withOptions:
- * which could be a good alternative.
- */
- }
- // Center the window to be cool =)
- [m_window center];
-
- // Create the view.
- m_oglView = [[SFOpenGLView alloc] initWithFrame:[[m_window contentView] frame]];
-
- if (m_oglView == nil) {
- sf::err()
- << "Could not create an instance of NSOpenGLView "
- << "in (SFWindowController -initWithMode:andStyle:)."
- << std::endl;
-
- return self;
- }
-
- // If a fullscreen window was requested...
- if (style & sf::Style::Fullscreen) {
- /// ... we tell the OpenGL view
- [m_oglView enterFullscreen];
-
- // ... and if the resolution is not the default one...
- if (mode != sf::VideoMode::getDesktopMode()) {
- // ... we set the "real size" of the view (that is the back buffer size).
- [m_oglView setRealSize:NSMakeSize(m_fullscreenMode->width, m_fullscreenMode->height)];
- }
- }
-
- // Set the view to the window as its content view.
- [m_window setContentView:m_oglView];
-
- // Register for event.
- [m_window setDelegate:self];
- [m_window setAcceptsMouseMovedEvents:YES];
- [m_window setIgnoresMouseEvents:NO];
-
- // And some other things...
- [m_window setAutodisplay:YES];
- [m_window setReleasedWhenClosed:NO];
- } // if super init ok
-
+ if (style & sf::Style::Fullscreen)
+ [self setupFullscreenViewWithMode:mode];
+ else
+ [self setupWindowWithMode:mode andStyle:style];
+
+ [m_oglView finishInit];
+ }
return self;
}
+
+////////////////////////////////////////////////////////
+-(void)setupFullscreenViewWithMode:(const sf::VideoMode&)mode
+{
+ // Create a screen-sized window on the main display
+ sf::VideoMode desktop = sf::VideoMode::getDesktopMode();
+ NSRect windowRect = NSMakeRect(0, 0, desktop.width, desktop.height);
+ m_window = [[SFWindow alloc] initWithContentRect:windowRect
+ styleMask:NSBorderlessWindowMask
+ backing:NSBackingStoreBuffered
+ defer:NO];
+
+ if (m_window == nil)
+ {
+ sf::err() << "Could not create an instance of NSWindow "
+ << "in -[SFWindowController setupFullscreenViewWithMode:]."
+ << std::endl;
+ return;
+ }
+
+ // Set the window level to be above the menu bar
+ [m_window setLevel:NSMainMenuWindowLevel+1];
+
+ // More window configuration...
+ [m_window setOpaque:YES];
+ [m_window setHidesOnDeactivate:YES];
+ [m_window setAutodisplay:YES];
+ [m_window setReleasedWhenClosed:NO]; // We own the class, not AppKit
+
+ // Register for event
+ [m_window setDelegate:self];
+ [m_window setAcceptsMouseMovedEvents:YES];
+ [m_window setIgnoresMouseEvents:NO];
+
+ // Create a master view containing our OpenGL view
+ NSView* masterView = [[[SFBlackView alloc] initWithFrame:windowRect] autorelease];
+
+ if (masterView == nil)
+ {
+ sf::err() << "Could not create an instance of SFBlackView "
+ << "in -[SFWindowController setupFullscreenViewWithMode:]."
+ << std::endl;
+ return;
+ }
+
+ // Create our OpenGL view size and the view
+ CGFloat x = (desktop.width - mode.width) / 2.0;
+ CGFloat y = (desktop.height - mode.height) / 2.0;
+ NSRect oglRect = NSMakeRect(x, y, mode.width, mode.height);
+
+ m_oglView = [[SFOpenGLView alloc] initWithFrame:oglRect
+ fullscreen:YES];
+
+ if (m_oglView == nil)
+ {
+ sf::err() << "Could not create an instance of NSOpenGLView "
+ << "in -[SFWindowController setupFullscreenViewWithMode:]."
+ << std::endl;
+ return;
+ }
+
+ // Populate the window and views
+ [masterView addSubview:m_oglView];
+ [m_window setContentView:masterView];
+}
+
+
+////////////////////////////////////////////////////////
+-(void)setupWindowWithMode:(const sf::VideoMode&)mode andStyle:(unsigned long)style
+{
+ // We know that style & sf::Style::Fullscreen is false.
+
+ // Create our window size.
+ NSRect rect = NSMakeRect(0, 0, mode.width, mode.height);
+
+ // Convert the SFML window style to Cocoa window style.
+ unsigned int nsStyle = NSBorderlessWindowMask;
+ if (style & sf::Style::Titlebar)
+ nsStyle |= NSTitledWindowMask | NSMiniaturizableWindowMask;
+ if (style & sf::Style::Resize)
+ nsStyle |= NSResizableWindowMask;
+ if (style & sf::Style::Close)
+ nsStyle |= NSClosableWindowMask;
+
+ // Create the window.
+ m_window = [[SFWindow alloc] initWithContentRect:rect
+ styleMask:nsStyle
+ backing:NSBackingStoreBuffered
+ defer:NO]; // Don't defer it!
+ /*
+ "YES" produces some "invalid drawable".
+ See http://www.cocoabuilder.com/archive/cocoa/152482-nsviews-and-nsopenglcontext-invalid-drawable-error.html
+
+ [...]
+ As best as I can figure, this is happening because the NSWindow (and
+ hence my view) are not visible on screen yet, and the system doesn't like that.
+ [...]
+ */
+
+ if (m_window == nil)
+ {
+ sf::err() << "Could not create an instance of NSWindow "
+ << "in -[SFWindowController setupWindowWithMode:andStyle:]."
+ << std::endl;
+
+ return;
+ }
+
+ // Create the view.
+ m_oglView = [[SFOpenGLView alloc] initWithFrame:[[m_window contentView] frame]
+ fullscreen:NO];
+
+ if (m_oglView == nil)
+ {
+ sf::err() << "Could not create an instance of NSOpenGLView "
+ << "in -[SFWindowController setupWindowWithMode:andStyle:]."
+ << std::endl;
+
+ return;
+ }
+
+ // Set the view to the window as its content view.
+ [m_window setContentView:m_oglView];
+
+ // Register for event.
+ [m_window setDelegate:self];
+ [m_window setAcceptsMouseMovedEvents:YES];
+ [m_window setIgnoresMouseEvents:NO];
+
+ // And some other things...
+ [m_window center];
+ [m_window setAutodisplay:YES];
+ [m_window setReleasedWhenClosed:NO]; // We own the class, not AppKit
+}
+
+
////////////////////////////////////////////////////////
-(void)dealloc
{
[self closeWindow];
[NSMenu setMenuBarVisible:YES];
-
+
[m_window release];
[m_oglView release];
-
- delete m_fullscreenMode;
-
+
[super dealloc];
}
@@ -258,32 +309,32 @@
////////////////////////////////////////////////////////
--(void)setRequesterTo:(sf::priv::WindowImplCocoa *)requester
+-(CGFloat)displayScaleFactor
{
- // Forward to the view.
- [m_oglView setRequesterTo:requester];
- m_requester = requester;
+ return [m_oglView displayScaleFactor];
}
////////////////////////////////////////////////////////
--(sf::WindowHandle)getSystemHandle
+-(void)setRequesterTo:(sf::priv::WindowImplCocoa*)requester
{
- return m_window;
+ // Forward to the view.
+ [m_oglView setRequesterTo:requester];
+ m_requester = requester;
}
////////////////////////////////////////////////////////
--(void)hideMouseCursor
+-(sf::WindowHandle)getSystemHandle
{
- [NSCursor hide];
+ return m_window;
}
////////////////////////////////////////////////////////
--(void)showMouseCursor
+-(BOOL)isMouseInside
{
- [NSCursor unhide];
+ return [m_oglView isMouseInside];
}
@@ -291,23 +342,23 @@
-(NSPoint)position
{
// First, get the top left corner of the view in its own base system
- NSPoint const origin = [m_oglView frame].origin;
- NSSize const size = [m_oglView frame].size;
- NSPoint const topLeftCornerOfView = NSMakePoint(origin.x, origin.y + size.height);
- NSPoint const positionInView = [m_oglView convertPointToBase:topLeftCornerOfView];
+ const NSPoint origin = [m_oglView frame].origin;
+ const NSSize size = [m_oglView frame].size;
+ const NSPoint topLeftCornerOfView = NSMakePoint(origin.x, origin.y + size.height);
+ const NSPoint positionInView = [m_oglView convertPointToBacking:topLeftCornerOfView];
// Then, convert it to window base system
- NSPoint const positionInWindow = [m_oglView convertPoint:positionInView toView:nil];
+ const NSPoint positionInWindow = [m_oglView convertPoint:positionInView toView:nil];
// here nil denotes the window containing the view
// Next, convert it to the screen base system
- NSPoint const positionInScreen = [[m_oglView window] convertBaseToScreen:positionInWindow];
-
+ const NSPoint positionInScreen = [[m_oglView window] convertBaseToScreen:positionInWindow];
+
// Finally, flip for SFML window coordinate system
// Don't forget to discard the title bar !
- NSPoint const positionInSFML = NSMakePoint(positionInScreen.x,
+ const NSPoint positionInSFML = NSMakePoint(positionInScreen.x,
([self screenHeight] - [self titlebarHeight]) - positionInScreen.y);
-
+
return positionInSFML;
}
@@ -316,10 +367,10 @@
-(void)setWindowPositionToX:(int)x Y:(int)y
{
NSPoint point = NSMakePoint(x, y);
-
+
// Flip for SFML window coordinate system.
point.y = [self screenHeight] - point.y;
-
+
// Place the window.
[m_window setFrameTopLeftPoint:point];
}
@@ -328,29 +379,49 @@
////////////////////////////////////////////////////////
-(NSSize)size
{
- if (*m_fullscreenMode == sf::VideoMode()) {
- return [m_oglView frame].size;
- } else {
- return NSMakeSize(m_fullscreenMode->width, m_fullscreenMode->height);
- }
+ return [m_oglView frame].size;
}
////////////////////////////////////////////////////////
-(void)resizeTo:(unsigned int)width by:(unsigned int)height
{
+ // Before resizing, remove resizable mask to be able to resize
+ // beyond the desktop boundaries.
+ NSUInteger styleMask = [m_window styleMask];
+
+ [m_window setStyleMask:styleMask ^ NSResizableWindowMask];
+
// Add titlebar height.
+ height += [self titlebarHeight];
+
+ // Corner case: don't set the window height bigger than the screen height
+ // or the view will be resized _later_ without generating a resize event.
+ NSRect screenFrame = [[NSScreen mainScreen] visibleFrame];
+ CGFloat maxVisibleHeight = screenFrame.size.height;
+ if (height > maxVisibleHeight)
+ {
+ height = maxVisibleHeight;
+
+ // The size is not the requested one, we fire an event
+ if (m_requester != 0)
+ m_requester->windowResized(width, height - [self titlebarHeight]);
+ }
+
NSRect frame = NSMakeRect([m_window frame].origin.x,
[m_window frame].origin.y,
width,
- height + [self titlebarHeight]);
-
+ height);
+
[m_window setFrame:frame display:YES];
+
+ // And restore the mask
+ [m_window setStyleMask:styleMask];
}
////////////////////////////////////////////////////////
--(void)changeTitle:(NSString *)title
+-(void)changeTitle:(NSString*)title
{
[m_window setTitle:title];
}
@@ -373,6 +444,7 @@
////////////////////////////////////////////////////////
-(void)closeWindow
{
+ [self applyContext:nil];
[m_window close];
[m_window setDelegate:nil];
[self setRequesterTo:0];
@@ -380,6 +452,23 @@
////////////////////////////////////////////////////////
+-(void)requestFocus
+{
+ [m_window makeKeyAndOrderFront:nil];
+
+ // In case the app is not active, make its dock icon bounce for one sec
+ [NSApp requestUserAttention:NSInformationalRequest];
+}
+
+
+////////////////////////////////////////////////////////////
+-(BOOL)hasFocus
+{
+ return [NSApp keyWindow] == m_window;
+}
+
+
+////////////////////////////////////////////////////////
-(void)enableKeyRepeat
{
[m_oglView enableKeyRepeat];
@@ -395,15 +484,15 @@
////////////////////////////////////////////////////////
-(void)setIconTo:(unsigned int)width
- by:(unsigned int)height
- with:(sf::Uint8 const *)pixels
+ by:(unsigned int)height
+ with:(const sf::Uint8*)pixels
{
// Create an empty image representation.
- NSBitmapImageRep* bitmap =
- [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:0 // if 0 : only allocate memory
+ NSBitmapImageRep* bitmap =
+ [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:0 // if 0: only allocate memory
pixelsWide:width
pixelsHigh:height
- bitsPerSample:8 // The number of bits used to specify
+ bitsPerSample:8 // The number of bits used to specify
// one pixel in a single component of the data.
samplesPerPixel:4 // 3 if no alpha, 4 with it
hasAlpha:YES
@@ -411,27 +500,24 @@
colorSpaceName:NSCalibratedRGBColorSpace
bytesPerRow:0 // 0 == determine automatically
bitsPerPixel:0]; // 0 == determine automatically
-
+
// Load data pixels.
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050 // We may need to define NSUInteger.
-#define NSUInteger unsigned int
-#endif
- for (unsigned int y = 0; y < height; ++y) {
- for (unsigned int x = 0; x < width; ++x, pixels+=4) {
+ for (unsigned int y = 0; y < height; ++y)
+ {
+ for (unsigned int x = 0; x < width; ++x, pixels+=4)
+ {
NSUInteger pixel[4] = { pixels[0], pixels[1], pixels[2], pixels[3] };
- [bitmap setPixel:pixel
- atX:x
- y:y];
+ [bitmap setPixel:pixel atX:x y:y];
}
}
-
+
// Create an image from the representation.
NSImage* icon = [[NSImage alloc] initWithSize:NSMakeSize(width, height)];
[icon addRepresentation:bitmap];
-
+
// Set app icon.
[[SFApplication sharedApplication] setApplicationIconImage:icon];
-
+
// Free up.
[icon release];
[bitmap release];
@@ -442,42 +528,28 @@
-(void)processEvent
{
// If we are not on the main thread we stop here and advice the user.
- if ([NSThread currentThread] != [NSThread mainThread]) {
+ if ([NSThread currentThread] != [NSThread mainThread])
+ {
/*
* See http://lists.apple.com/archives/cocoa-dev/2011/Feb/msg00460.html
* for more information.
*/
- sf::err()
- << "Cannot fetch event from a worker thread. (OS X restriction)"
- << std::endl;
-
+ sf::err() << "Cannot fetch event from a worker thread. (OS X restriction)" << std::endl;
+
return;
}
-
+
// If we don't have a requester we don't fetch event.
- if (m_requester != 0) {
+ if (m_requester != 0)
[SFApplication processEvent];
- }
}
////////////////////////////////////////////////////////
--(void)applyContext:(NSOpenGLContext *)context
+-(void)applyContext:(NSOpenGLContext*)context
{
[m_oglView setOpenGLContext:context];
[context setView:m_oglView];
-
- // If fullscreen was requested and the mode used to create the window
- // was not the desktop mode, we change the back buffer size of the
- // context.
- if (*m_fullscreenMode != sf::VideoMode()) {
- CGLContextObj cgcontext = (CGLContextObj)[context CGLContextObj];
-
- GLint dim[2] = {m_fullscreenMode->width, m_fullscreenMode->height};
-
- CGLSetParameter(cgcontext, kCGLCPSurfaceBackingSize, dim);
- CGLEnable(cgcontext, kCGLCESurfaceBackingSize);
- }
}
@@ -488,38 +560,13 @@
////////////////////////////////////////////////////////
-(BOOL)windowShouldClose:(id)sender
{
- if (m_requester == 0) return YES;
-
- m_requester->windowClosed();
- return NO;
-}
+ (void)sender;
+ if (m_requester == 0)
+ return YES;
-////////////////////////////////////////////////////////
--(void)windowDidBecomeKey:(NSNotification *)notification
-{
- // Send event.
- if (m_requester == 0) return;
-
- m_requester->windowGainedFocus();
-
- if (*m_fullscreenMode != sf::VideoMode()) {
- [m_oglView enterFullscreen];
- }
-}
-
-
-////////////////////////////////////////////////////////
--(void)windowDidResignKey:(NSNotification *)notification
-{
- // Send event.
- if (m_requester == 0) return;
-
- m_requester->windowLostFocus();
-
- if (*m_fullscreenMode != sf::VideoMode()) {
- [m_oglView exitFullscreen];
- }
+ m_requester->windowClosed();
+ return NO;
}
@@ -529,8 +576,8 @@
////////////////////////////////////////////////////////
-(float)screenHeight
{
- NSDictionary *deviceDescription = [[m_window screen] deviceDescription];
- NSNumber *screenNumber = [deviceDescription valueForKey:@"NSScreenNumber"];
+ NSDictionary* deviceDescription = [[m_window screen] deviceDescription];
+ NSNumber* screenNumber = [deviceDescription valueForKey:@"NSScreenNumber"];
CGDirectDisplayID screenID = (CGDirectDisplayID)[screenNumber intValue];
CGFloat height = CGDisplayPixelsHigh(screenID);
return height;
diff --git a/src/SFML/Window/OSX/SensorImpl.cpp b/src/SFML/Window/OSX/SensorImpl.cpp
new file mode 100644
index 0000000..be5e439
--- /dev/null
+++ b/src/SFML/Window/OSX/SensorImpl.cpp
@@ -0,0 +1,88 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/SensorImpl.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+void SensorImpl::initialize()
+{
+ // To be implemented
+}
+
+
+////////////////////////////////////////////////////////////
+void SensorImpl::cleanup()
+{
+ // To be implemented
+}
+
+
+////////////////////////////////////////////////////////////
+bool SensorImpl::isAvailable(Sensor::Type /*sensor*/)
+{
+ // To be implemented
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SensorImpl::open(Sensor::Type /*sensor*/)
+{
+ // To be implemented
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+void SensorImpl::close()
+{
+ // To be implemented
+}
+
+
+////////////////////////////////////////////////////////////
+Vector3f SensorImpl::update()
+{
+ // To be implemented
+ return Vector3f(0, 0, 0);
+}
+
+
+////////////////////////////////////////////////////////////
+void SensorImpl::setEnabled(bool /*enabled*/)
+{
+ // To be implemented
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/OSX/SensorImpl.hpp b/src/SFML/Window/OSX/SensorImpl.hpp
new file mode 100644
index 0000000..ea29dd3
--- /dev/null
+++ b/src/SFML/Window/OSX/SensorImpl.hpp
@@ -0,0 +1,101 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SENSORIMPLOSX_HPP
+#define SFML_SENSORIMPLOSX_HPP
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Mac OS X implementation of sensors
+///
+////////////////////////////////////////////////////////////
+class SensorImpl
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global initialization of the sensor module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void initialize();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global cleanup of the sensor module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void cleanup();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a sensor is available
+ ///
+ /// \param sensor Sensor to check
+ ///
+ /// \return True if the sensor is available, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isAvailable(Sensor::Type sensor);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open the sensor
+ ///
+ /// \param sensor Type of the sensor
+ ///
+ /// \return True on success, false on failure
+ ///
+ ////////////////////////////////////////////////////////////
+ bool open(Sensor::Type sensor);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Close the sensor
+ ///
+ ////////////////////////////////////////////////////////////
+ void close();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Update the sensor and get its new value
+ ///
+ /// \return Sensor value
+ ///
+ ////////////////////////////////////////////////////////////
+ Vector3f update();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Enable or disable the sensor
+ ///
+ /// \param enabled True to enable, false to disable
+ ///
+ ////////////////////////////////////////////////////////////
+ void setEnabled(bool enabled);
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_SENSORIMPLOSX_HPP
diff --git a/src/SFML/Window/OSX/VideoModeImpl.cpp b/src/SFML/Window/OSX/VideoModeImpl.cpp
index 1d7b0df..18d550a 100644
--- a/src/SFML/Window/OSX/VideoModeImpl.cpp
+++ b/src/SFML/Window/OSX/VideoModeImpl.cpp
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -34,73 +34,39 @@
namespace sf
{
namespace priv
-{
-////////////////////////////////////////////////////////////
-/// Note :
-/// Starting with 10.6, CGDisplayModeRef and CGDisplayCopyAllDisplayModes
-/// should be used instead of CFDictionaryRef and CGDisplayAvailableModes.
-///
+{
+
////////////////////////////////////////////////////////////
std::vector<VideoMode> VideoModeImpl::getFullscreenModes()
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-
- std::vector<VideoMode> modes;
-
- // Retrieve array of dictionaries representing display modes.
- CFArrayRef displayModes = CGDisplayAvailableModes(CGMainDisplayID());
-
- if (displayModes == NULL) {
- sf::err() << "Couldn't get VideoMode for main display.";
- return modes;
- }
-
- // Loop on each mode and convert it into a sf::VideoMode object.
- CFIndex const modesCount = CFArrayGetCount(displayModes);
- for (CFIndex i = 0; i < modesCount; i++) {
- CFDictionaryRef dictionary = (CFDictionaryRef)CFArrayGetValueAtIndex(displayModes, i);
-
- VideoMode mode = convertCGModeToSFMode(dictionary);
-
- // If not yet listed we add it to our modes array.
- if (std::find(modes.begin(), modes.end(), mode) == modes.end()) {
- modes.push_back(mode);
- }
- }
-
- return modes;
-
-#else // MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
-
std::vector<VideoMode> modes;
-
+
// Retrieve all modes available for main screen only.
CFArrayRef cgmodes = CGDisplayCopyAllDisplayModes(CGMainDisplayID(), NULL);
-
- if (cgmodes == NULL) {
- sf::err() << "Couldn't get VideoMode for main display.";
+
+ if (cgmodes == NULL)
+ {
+ sf::err() << "Couldn't get VideoMode for main display." << std::endl;
return modes;
}
-
+
// Loop on each mode and convert it into a sf::VideoMode object.
- CFIndex const modesCount = CFArrayGetCount(cgmodes);
- for (CFIndex i = 0; i < modesCount; i++) {
+ const CFIndex modesCount = CFArrayGetCount(cgmodes);
+ for (CFIndex i = 0; i < modesCount; i++)
+ {
CGDisplayModeRef cgmode = (CGDisplayModeRef)CFArrayGetValueAtIndex(cgmodes, i);
-
+
VideoMode mode = convertCGModeToSFMode(cgmode);
-
+
// If not yet listed we add it to our modes array.
- if (std::find(modes.begin(), modes.end(), mode) == modes.end()) {
+ if (std::find(modes.begin(), modes.end(), mode) == modes.end())
modes.push_back(mode);
- }
}
-
+
// Clean up memory.
CFRelease(cgmodes);
-
+
return modes;
-
-#endif
}
@@ -108,8 +74,8 @@ std::vector<VideoMode> VideoModeImpl::getFullscreenModes()
VideoMode VideoModeImpl::getDesktopMode()
{
CGDirectDisplayID display = CGMainDisplayID();
- return VideoMode(CGDisplayPixelsWide(display),
- CGDisplayPixelsHigh(display),
+ return VideoMode(CGDisplayPixelsWide(display),
+ CGDisplayPixelsHigh(display),
displayBitsPerPixel(display));
}
diff --git a/src/SFML/Window/OSX/WindowImplCocoa.hpp b/src/SFML/Window/OSX/WindowImplCocoa.hpp
index c0c29c3..4a66d74 100644
--- a/src/SFML/Window/OSX/WindowImplCocoa.hpp
+++ b/src/SFML/Window/OSX/WindowImplCocoa.hpp
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -34,7 +34,7 @@
#include <SFML/System/String.hpp>
////////////////////////////////////////////////////////////
-/// Predefine OBJC classes
+/// Predefine OBJ-C classes
////////////////////////////////////////////////////////////
#ifdef __OBJC__
@@ -63,7 +63,7 @@ namespace priv
////////////////////////////////////////////////////////////
class WindowImplCocoa : public WindowImpl
{
-public :
+public:
////////////////////////////////////////////////////////////
/// \brief Construct the window implementation from an existing control
///
@@ -71,154 +71,154 @@ public :
///
////////////////////////////////////////////////////////////
WindowImplCocoa(WindowHandle handle);
-
+
////////////////////////////////////////////////////////////
/// \brief Create the window implementation
///
/// \param mode Video mode to use
/// \param title Title of the window
- /// \param style Window style (resizable, fixed, or fullscren)
+ /// \param style Window style (resizeable, fixed, or fullscren)
/// \param settings Additional settings for the underlying OpenGL context
///
////////////////////////////////////////////////////////////
WindowImplCocoa(VideoMode mode, const String& title, unsigned long style, const ContextSettings& settings);
-
+
////////////////////////////////////////////////////////////
/// \brief Destructor
///
////////////////////////////////////////////////////////////
~WindowImplCocoa();
-
+
////////////////////////////////////////////////////////////
- /// \brief Window Closed Event – called by the cocoa window object.
+ /// \brief Window Closed Event – called by the cocoa window object
///
/// Send the event to SFML WindowImpl class.
///
////////////////////////////////////////////////////////////
void windowClosed(void);
-
+
////////////////////////////////////////////////////////////
- /// \brief Window Resized Event – called by the cocoa window object.
+ /// \brief Window Resized Event – called by the cocoa window object
///
/// Send the event to SFML WindowImpl class.
///
- /// \param width
- /// \param height
+ /// \param width new width
+ /// \param height new height
///
////////////////////////////////////////////////////////////
void windowResized(unsigned int width, unsigned int height);
-
+
////////////////////////////////////////////////////////////
- /// \brief Window Lost Focus Event – called by the cocoa window object.
+ /// \brief Window Lost Focus Event – called by the cocoa window object
///
/// Send the event to SFML WindowImpl class.
///
////////////////////////////////////////////////////////////
void windowLostFocus(void);
-
+
////////////////////////////////////////////////////////////
- /// \brief Window Get Focus Event – called by the cocoa window object.
+ /// \brief Window Get Focus Event – called by the cocoa window object
///
/// Send the event to SFML WindowImpl class.
///
////////////////////////////////////////////////////////////
void windowGainedFocus(void);
-
+
////////////////////////////////////////////////////////////
- /// \brief Mouse Down Event – called by the cocoa view object.
+ /// \brief Mouse Down Event – called by the cocoa view object
///
/// Send the event to SFML WindowImpl class.
///
- /// \param button
- /// \param x
- /// \param y
+ /// \param button active button
+ /// \param x mouse x position
+ /// \param y mouse y position
///
////////////////////////////////////////////////////////////
void mouseDownAt(Mouse::Button button, int x, int y);
-
+
////////////////////////////////////////////////////////////
- /// \brief Mouse Up Event – called by the cocoa view object.
+ /// \brief Mouse Up Event – called by the cocoa view object
///
/// Send the event to SFML WindowImpl class.
///
- /// \param button
- /// \param x
- /// \param y
+ /// \param button active button
+ /// \param x mouse x position
+ /// \param y mouse y position
///
////////////////////////////////////////////////////////////
void mouseUpAt(Mouse::Button button, int x, int y);
-
+
////////////////////////////////////////////////////////////
- /// \brief Mouse Moved Event – called by the cocoa view object.
+ /// \brief Mouse Moved Event – called by the cocoa view object
///
/// Send the event to SFML WindowImpl class.
///
- /// \param x
- /// \param y
+ /// \param x mouse x position
+ /// \param y mouse y position
///
////////////////////////////////////////////////////////////
void mouseMovedAt(int x, int y);
-
+
////////////////////////////////////////////////////////////
- /// \brief Mouse Wheel Scrolled Event – called by the cocoa view object.
+ /// \brief Mouse Wheel Scrolled Event – called by the cocoa view object
///
/// Send the event to SFML WindowImpl class.
///
- /// \param delta
- /// \param x
- /// \param y
+ /// \param delta scrolling delta
+ /// \param x mouse x position
+ /// \param y mouse y position
///
////////////////////////////////////////////////////////////
void mouseWheelScrolledAt(float delta, int x, int y);
-
+
////////////////////////////////////////////////////////////
- /// \brief Mouse In Event – called by the cocoa view object.
+ /// \brief Mouse In Event – called by the cocoa view object
///
/// Send the event to SFML WindowImpl class.
///
////////////////////////////////////////////////////////////
void mouseMovedIn(void);
-
+
////////////////////////////////////////////////////////////
- /// \brief Mouse Out Event – called by the cocoa view object.
+ /// \brief Mouse Out Event – called by the cocoa view object
///
/// Send the event to SFML WindowImpl class.
///
////////////////////////////////////////////////////////////
void mouseMovedOut(void);
-
+
////////////////////////////////////////////////////////////
- /// \brief Key Down Event – called by the cocoa view object.
+ /// \brief Key Down Event – called by the cocoa view object
///
/// Send the event to SFML WindowImpl class.
///
- /// \param key
+ /// \param key active key
///
////////////////////////////////////////////////////////////
void keyDown(Event::KeyEvent key);
-
+
////////////////////////////////////////////////////////////
- /// \brief Key Up Event – called by the cocoa view object.
+ /// \brief Key Up Event – called by the cocoa view object
///
/// Send the event to SFML WindowImpl class.
///
- /// \param key
+ /// \param key active key
///
////////////////////////////////////////////////////////////
void keyUp(Event::KeyEvent key);
-
+
////////////////////////////////////////////////////////////
- /// \brief Text Entred Event – called by the cocoa view object.
+ /// \brief Text Entred Event – called by the cocoa view object
///
/// Send the event to SFML WindowImpl class.
///
- /// \param charcode Input unicode
+ /// \param charcode Unicode input
///
////////////////////////////////////////////////////////////
void textEntered(unichar charcode);
-
+
////////////////////////////////////////////////////////////
- /// \brief Apply the context to the view.
+ /// \brief Apply the context to the view
///
/// Called by the SFML context object to finalize its creation.
///
@@ -226,16 +226,18 @@ public :
///
////////////////////////////////////////////////////////////
void applyContext(NSOpenGLContextRef context) const;
-
+
////////////////////////////////////////////////////////////
- /// \brief Change the type of the current process to become a full GUI app.
- /// Also ensure NSApp is constructed.
+ /// \brief Change the type of the current process
+ ///
+ /// The type of the process is changed to become a full GUI app.
+ /// Also ensure NSApp is constructed.
///
////////////////////////////////////////////////////////////
static void setUpProcess(void);
-
-public :
-
+
+public:
+
////////////////////////////////////////////////////////////
/// \brief Get the OS-specific handle of the window
///
@@ -243,7 +245,7 @@ public :
///
////////////////////////////////////////////////////////////
virtual WindowHandle getSystemHandle() const;
-
+
////////////////////////////////////////////////////////////
/// \brief Get the position of the window
///
@@ -318,7 +320,22 @@ public :
////////////////////////////////////////////////////////////
virtual void setKeyRepeatEnabled(bool enabled);
-protected :
+ ////////////////////////////////////////////////////////////
+ /// \brief Request the current window to be made the active
+ /// foreground window
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void requestFocus();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check whether the window has the input focus
+ ///
+ /// \return True if window has focus, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool hasFocus() const;
+
+protected:
////////////////////////////////////////////////////////////
/// \brief Process incoming events from the operating system
@@ -326,17 +343,17 @@ protected :
////////////////////////////////////////////////////////////
virtual void processEvents();
-private :
+private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
WindowImplDelegateRef m_delegate; ///< Implementation in Obj-C.
- bool m_showCursor; ///< Is the cursor displayed or hidden ?
+ bool m_showCursor; ///< Is the cursor displayed or hidden?
};
-
+
} // namespace priv
-
+
} // namespace sf
diff --git a/src/SFML/Window/OSX/WindowImplCocoa.mm b/src/SFML/Window/OSX/WindowImplCocoa.mm
index a3bea49..0ddfa78 100644
--- a/src/SFML/Window/OSX/WindowImplCocoa.mm
+++ b/src/SFML/Window/OSX/WindowImplCocoa.mm
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -30,90 +30,210 @@
#include <SFML/System/Err.hpp>
#include <SFML/System/String.hpp>
-#import <SFML/Window/OSX/SFWindowController.h>
-#import <SFML/Window/OSX/SFViewController.h>
-#import <SFML/Window/OSX/cpp_objc_conversion.h>
#import <SFML/Window/OSX/AutoreleasePoolWrapper.h>
+#import <SFML/Window/OSX/cpp_objc_conversion.h>
#import <SFML/Window/OSX/SFApplication.h>
+#import <SFML/Window/OSX/SFApplicationDelegate.h>
+#import <SFML/Window/OSX/SFKeyboardModifiersHelper.h>
+#import <SFML/Window/OSX/SFViewController.h>
+#import <SFML/Window/OSX/SFWindowController.h>
namespace sf
{
namespace priv
{
+////////////////////////////////////////////////////////////
+/// \brief Get the scale factor of the main screen
+///
+////////////////////////////////////////////////////////////
+CGFloat getDefaultScaleFactor()
+{
+ return [[NSScreen mainScreen] backingScaleFactor];
+}
+
+////////////////////////////////////////////////////////////
+/// \brief Scale SFML coordinates to backing coordinates
+///
+/// Use -[NSScreen backingScaleFactor] to find out if the user
+/// has a retina display or not.
+///
+/// \param in SFML coordinates to be converted
+/// \param delegate a object implementing WindowImplDelegateProtocol, or nil for default scale
+///
+////////////////////////////////////////////////////////////
+template <class T>
+void scaleIn(T& in, id<WindowImplDelegateProtocol> delegate)
+{
+ in /= delegate ? [delegate displayScaleFactor] : getDefaultScaleFactor();
+}
+
+template <class T>
+void scaleInWidthHeight(T& in, id<WindowImplDelegateProtocol> delegate)
+{
+ scaleIn(in.width, delegate);
+ scaleIn(in.height, delegate);
+}
+
+template <class T>
+void scaleInXY(T& in, id<WindowImplDelegateProtocol> delegate)
+{
+ scaleIn(in.x, delegate);
+ scaleIn(in.y, delegate);
+}
+
+////////////////////////////////////////////////////////////
+/// \brief Scale backing coordinates to SFML coordinates
+///
+/// Use -[NSScreen backingScaleFactor] to find out if the user
+/// has a retina display or not.
+///
+/// \param out backing coordinates to be converted
+/// \param delegate a object implementing WindowImplDelegateProtocol, or nil for default scale
+///
+////////////////////////////////////////////////////////////
+template <class T>
+void scaleOut(T& out, id<WindowImplDelegateProtocol> delegate)
+{
+ out *= delegate ? [delegate displayScaleFactor] : getDefaultScaleFactor();
+}
+
+template <class T>
+void scaleOutWidthHeight(T& out, id<WindowImplDelegateProtocol> delegate)
+{
+ scaleOut(out.width, delegate);
+ scaleOut(out.height, delegate);
+}
+
+template <class T>
+void scaleOutXY(T& out, id<WindowImplDelegateProtocol> delegate)
+{
+ scaleOut(out.x, delegate);
+ scaleOut(out.y, delegate);
+}
+
+
+////////////////////////////////////////////////////////////
+/// According to Apple's documentation, each invocation of
+/// unhide must be balanced by an invocation of hide in
+/// order for the cursor display to be correct.
+/// So we keep track of those calls ourself.
+////////////////////////////////////////////////////////////
+
+namespace
+{
+ bool isCursorHidden = false; // initially, the cursor is visible
+}
+
+
+////////////////////////////////////////////////////////
+void hideMouseCursor()
+{
+ if (!isCursorHidden)
+ {
+ [NSCursor hide];
+ isCursorHidden = true;
+ }
+}
+
+
+////////////////////////////////////////////////////////
+void showMouseCursor()
+{
+ if (isCursorHidden)
+ {
+ [NSCursor unhide];
+ isCursorHidden = false;
+ }
+}
+
#pragma mark
#pragma mark WindowImplCocoa's ctor/dtor
////////////////////////////////////////////////////////////
-WindowImplCocoa::WindowImplCocoa(WindowHandle handle)
-: m_showCursor(true)
+WindowImplCocoa::WindowImplCocoa(WindowHandle handle) :
+m_showCursor(true)
{
// Ask for a pool.
retainPool();
-
+
// Treat the handle as it real type
id nsHandle = (id)handle;
- if ([nsHandle isKindOfClass:[NSWindow class]]) {
-
+ if ([nsHandle isKindOfClass:[NSWindow class]])
+ {
// We have a window.
m_delegate = [[SFWindowController alloc] initWithWindow:nsHandle];
-
- } else if ([nsHandle isKindOfClass:[NSView class]]) {
-
+ }
+ else if ([nsHandle isKindOfClass:[NSView class]])
+ {
// We have a view.
m_delegate = [[SFViewController alloc] initWithView:nsHandle];
-
- } else {
-
- sf::err()
- << "Cannot import this Window Handle because it is neither "
- << "a <NSWindow*> nor <NSView*> object "
- << "(or any of their subclasses). You gave a <"
- << [[nsHandle className] UTF8String]
- << "> object."
- << std::endl;
- return;
-
}
-
+ else
+ {
+
+ sf::err() << "Cannot import this Window Handle because it is neither "
+ << "a <NSWindow*> nor <NSView*> object "
+ << "(or any of their subclasses). You gave a <"
+ << [[nsHandle className] UTF8String]
+ << "> object."
+ << std::endl;
+ return;
+
+ }
+
[m_delegate setRequesterTo:this];
+
+ // Finally, set up keyboard helper
+ initialiseKeyboardHelper();
}
-
-
+
+
////////////////////////////////////////////////////////////
WindowImplCocoa::WindowImplCocoa(VideoMode mode,
const String& title,
unsigned long style,
- const ContextSettings& /*settings*/)
-: m_showCursor(true)
+ const ContextSettings& /*settings*/) :
+m_showCursor(true)
{
// Transform the app process.
setUpProcess();
-
+
// Ask for a pool.
retainPool();
-
+
+ // Use backing size
+ scaleInWidthHeight(mode, nil);
+
m_delegate = [[SFWindowController alloc] initWithMode:mode andStyle:style];
[m_delegate changeTitle:sfStringToNSString(title)];
[m_delegate setRequesterTo:this];
+
+ // Finally, set up keyboard helper
+ initialiseKeyboardHelper();
}
-
+
////////////////////////////////////////////////////////////
WindowImplCocoa::~WindowImplCocoa()
{
[m_delegate closeWindow];
-
+
[m_delegate release];
-
- releasePool();
-
- drainPool(); // Make sure everything was freed
+
+ // Put the next window in front, if any.
+ NSArray* windows = [NSApp orderedWindows];
+ if ([windows count] > 0)
+ [[windows objectAtIndex:0] makeKeyAndOrderFront:nil];
+
+ drainCurrentPool(); // Make sure everything was freed
// This solve some issue when sf::Window::Create is called for the
// second time (nothing was render until the function was called again)
+
+ releasePool();
}
-
-
+
+
////////////////////////////////////////////////////////////
void WindowImplCocoa::applyContext(NSOpenGLContextRef context) const
{
@@ -125,21 +245,29 @@ void WindowImplCocoa::applyContext(NSOpenGLContextRef context) const
void WindowImplCocoa::setUpProcess(void)
{
static bool isTheProcessSetAsApplication = false;
-
- if (!isTheProcessSetAsApplication) {
+
+ if (!isTheProcessSetAsApplication)
+ {
// Do it only once !
isTheProcessSetAsApplication = true;
-
- // Set the process as a normal application so it can get focus.
- ProcessSerialNumber psn;
- if (!GetCurrentProcess(&psn)) {
- TransformProcessType(&psn, kProcessTransformToForegroundApplication);
- SetFrontProcess(&psn);
- }
-
+
+ // Make sure NSApp is properly initialized
+ [SFApplication sharedApplication];
+
+ // Set the process as a normal application so it can get focus
+ [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
+ [NSApp activateIgnoringOtherApps:YES];
+
+ // Register an application delegate if there is none
+ if (![[SFApplication sharedApplication] delegate])
+ [[NSApplication sharedApplication] setDelegate:[[SFApplicationDelegate alloc] init]];
+
+ // Create menus for the application (before finishing launching!)
+ [SFApplication setUpMenuBar];
+
// Tell the application to stop bouncing in the Dock.
[[SFApplication sharedApplication] finishLaunching];
- // NOTE : This last call won't harm anything even if SFML window was
+ // NOTE: This last call won't harm anything even if SFML window was
// created with an external handle.
}
}
@@ -147,18 +275,18 @@ void WindowImplCocoa::setUpProcess(void)
#pragma mark
#pragma mark WindowImplCocoa's window-event methods
-
-
+
+
////////////////////////////////////////////////////////////
void WindowImplCocoa::windowClosed(void)
-{
+{
Event event;
event.type = Event::Closed;
-
+
pushEvent(event);
}
-
-
+
+
////////////////////////////////////////////////////////////
void WindowImplCocoa::windowResized(unsigned int width, unsigned int height)
{
@@ -166,42 +294,41 @@ void WindowImplCocoa::windowResized(unsigned int width, unsigned int height)
event.type = Event::Resized;
event.size.width = width;
event.size.height = height;
-
+ scaleOutWidthHeight(event.size, m_delegate);
+
pushEvent(event);
}
-
+
////////////////////////////////////////////////////////////
void WindowImplCocoa::windowLostFocus(void)
{
- if (!m_showCursor) {
- [m_delegate showMouseCursor]; // Make sur the cursor is visible
- }
-
+ if (!m_showCursor && [m_delegate isMouseInside])
+ showMouseCursor(); // Make sure the cursor is visible
+
Event event;
event.type = Event::LostFocus;
-
+
pushEvent(event);
}
-
+
////////////////////////////////////////////////////////////
void WindowImplCocoa::windowGainedFocus(void)
{
- if (!m_showCursor) {
- [m_delegate hideMouseCursor]; // Restore user's setting
- }
-
+ if (!m_showCursor && [m_delegate isMouseInside])
+ hideMouseCursor(); // Restore user's setting
+
Event event;
event.type = Event::GainedFocus;
-
+
pushEvent(event);
}
-
+
#pragma mark
#pragma mark WindowImplCocoa's mouse-event methods
-
-
+
+
////////////////////////////////////////////////////////////
void WindowImplCocoa::mouseDownAt(Mouse::Button button, int x, int y)
{
@@ -210,11 +337,12 @@ void WindowImplCocoa::mouseDownAt(Mouse::Button button, int x, int y)
event.mouseButton.button = button;
event.mouseButton.x = x;
event.mouseButton.y = y;
-
+ scaleOutXY(event.mouseButton, m_delegate);
+
pushEvent(event);
}
-
+
////////////////////////////////////////////////////////////
void WindowImplCocoa::mouseUpAt(Mouse::Button button, int x, int y)
{
@@ -223,7 +351,8 @@ void WindowImplCocoa::mouseUpAt(Mouse::Button button, int x, int y)
event.mouseButton.button = button;
event.mouseButton.x = x;
event.mouseButton.y = y;
-
+ scaleOutXY(event.mouseButton, m_delegate);
+
pushEvent(event);
}
@@ -235,7 +364,8 @@ void WindowImplCocoa::mouseMovedAt(int x, int y)
event.type = Event::MouseMoved;
event.mouseMove.x = x;
event.mouseMove.y = y;
-
+ scaleOutXY(event.mouseMove, m_delegate);
+
pushEvent(event);
}
@@ -247,59 +377,58 @@ void WindowImplCocoa::mouseWheelScrolledAt(float delta, int x, int y)
event.mouseWheel.delta = delta;
event.mouseWheel.x = x;
event.mouseWheel.y = y;
-
+ scaleOutXY(event.mouseWheel, m_delegate);
+
pushEvent(event);
}
////////////////////////////////////////////////////////////
void WindowImplCocoa::mouseMovedIn(void)
{
- if (!m_showCursor) {
- [m_delegate hideMouseCursor]; // Restore user's setting
- }
-
+ if (!m_showCursor)
+ hideMouseCursor(); // Restore user's setting
+
Event event;
event.type = Event::MouseEntered;
-
+
pushEvent(event);
}
-
+
////////////////////////////////////////////////////////////
void WindowImplCocoa::mouseMovedOut(void)
{
- if (!m_showCursor) {
- [m_delegate showMouseCursor]; // Make sur the cursor is visible
- }
-
+ if (!m_showCursor)
+ showMouseCursor(); // Make sure the cursor is visible
+
Event event;
event.type = Event::MouseLeft;
-
+
pushEvent(event);
}
-
-
+
+
#pragma mark
#pragma mark WindowImplCocoa's key-event methods
-
-
+
+
////////////////////////////////////////////////////////////
void WindowImplCocoa::keyDown(Event::KeyEvent key)
{
Event event;
event.type = Event::KeyPressed;
event.key = key;
-
+
pushEvent(event);
}
-
+
////////////////////////////////////////////////////////////
void WindowImplCocoa::keyUp(Event::KeyEvent key)
{
Event event;
event.type = Event::KeyReleased;
event.key = key;
-
+
pushEvent(event);
}
@@ -310,11 +439,11 @@ void WindowImplCocoa::textEntered(unichar charcode)
Event event;
event.type = Event::TextEntered;
event.text.unicode = charcode;
-
+
pushEvent(event);
}
-
+
#pragma mark
#pragma mark WindowImplCocoa's event-related methods
@@ -322,8 +451,9 @@ void WindowImplCocoa::textEntered(unichar charcode)
void WindowImplCocoa::processEvents()
{
[m_delegate processEvent];
+ drainCurrentPool(); // Reduce memory footprint
}
-
+
#pragma mark
#pragma mark WindowImplCocoa's private methods
@@ -333,19 +463,23 @@ WindowHandle WindowImplCocoa::getSystemHandle() const
return [m_delegate getSystemHandle];
}
-
+
////////////////////////////////////////////////////////////
Vector2i WindowImplCocoa::getPosition() const
{
NSPoint pos = [m_delegate position];
- return Vector2i(pos.x, pos.y);
+ sf::Vector2i ret(pos.x, pos.y);
+ scaleOutXY(ret, m_delegate);
+ return ret;
}
////////////////////////////////////////////////////////////
void WindowImplCocoa::setPosition(const Vector2i& position)
{
- [m_delegate setWindowPositionToX:position.x Y:position.y];
+ sf::Vector2i backingPosition = position;
+ scaleInXY(backingPosition, m_delegate);
+ [m_delegate setWindowPositionToX:backingPosition.x Y:backingPosition.y];
}
@@ -353,66 +487,85 @@ void WindowImplCocoa::setPosition(const Vector2i& position)
Vector2u WindowImplCocoa::getSize() const
{
NSSize size = [m_delegate size];
- return Vector2u(size.width, size.height);
+ Vector2u ret(size.width, size.height);
+ scaleOutXY(ret, m_delegate);
+ return ret;
}
-
+
////////////////////////////////////////////////////////////
void WindowImplCocoa::setSize(const Vector2u& size)
-{
- [m_delegate resizeTo:size.x by:size.y];
+{
+ sf::Vector2u backingSize = size;
+ scaleInXY(backingSize, m_delegate);
+ [m_delegate resizeTo:backingSize.x by:backingSize.y];
}
-
+
////////////////////////////////////////////////////////////
void WindowImplCocoa::setTitle(const String& title)
{
[m_delegate changeTitle:sfStringToNSString(title)];
}
-
+
////////////////////////////////////////////////////////////
void WindowImplCocoa::setIcon(unsigned int width, unsigned int height, const Uint8* pixels)
{
[m_delegate setIconTo:width by:height with:pixels];
}
-
+
////////////////////////////////////////////////////////////
void WindowImplCocoa::setVisible(bool visible)
{
- if (visible) {
+ if (visible)
[m_delegate showWindow];
- } else {
+ else
[m_delegate hideWindow];
- }
}
-
+
////////////////////////////////////////////////////////////
void WindowImplCocoa::setMouseCursorVisible(bool visible)
{
m_showCursor = visible;
-
- if (m_showCursor) {
- [m_delegate showMouseCursor];
- } else {
- [m_delegate hideMouseCursor];
+
+ // If the mouse is over the window, we apply the new setting
+ if ([m_delegate isMouseInside])
+ {
+ if (m_showCursor)
+ showMouseCursor();
+ else
+ hideMouseCursor();
}
}
-
+
////////////////////////////////////////////////////////////
void WindowImplCocoa::setKeyRepeatEnabled(bool enabled)
{
- if (enabled) {
+ if (enabled)
[m_delegate enableKeyRepeat];
- } else {
+ else
[m_delegate disableKeyRepeat];
- }
}
-
+
+////////////////////////////////////////////////////////////
+void WindowImplCocoa::requestFocus()
+{
+ [m_delegate requestFocus];
+}
+
+
+////////////////////////////////////////////////////////////
+bool WindowImplCocoa::hasFocus() const
+{
+ return [m_delegate hasFocus];
+}
+
+
} // namespace priv
-
+
} // namespace sf
diff --git a/src/SFML/Window/OSX/WindowImplDelegateProtocol.h b/src/SFML/Window/OSX/WindowImplDelegateProtocol.h
index 7e4bbbf..0132f40 100644
--- a/src/SFML/Window/OSX/WindowImplDelegateProtocol.h
+++ b/src/SFML/Window/OSX/WindowImplDelegateProtocol.h
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -26,8 +26,8 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include <SFML/Window/WindowHandle.hpp>
#include <SFML/Config.hpp> // for sf::Uint8
+#include <SFML/Window/WindowHandle.hpp>
#import <AppKit/AppKit.h>
@@ -38,8 +38,7 @@ namespace sf {
}
////////////////////////////////////////////////////////////
-/// This protocol defines the interface of the delegate of
-/// the window implementation.
+/// \brief Interface of the delegate of the window implementation
///
/// We don't create an interface here because Obj-C doesn't allow
/// multiple inheritance (SFViewController and SFWindowController
@@ -47,12 +46,12 @@ namespace sf {
/// we have to duplicate some code.
///
/// Everything is done via a class that implement this protocol.
-/// There are two of these classes :
+/// There are two of these classes:
///
/// SFViewController and SFWindowController
///
/// The requester is a WindowImplCocoa. It's used to send back
-/// event via these functions :
+/// event via these functions:
///
/// windowClosed, windowResized, windowLostFocus, windowGainedFocus
///
@@ -61,99 +60,161 @@ namespace sf {
///
/// keyDown, keyUp, textEntered
///
-/// Note : Joysticks are not bound to a view or window
+/// Note: Joysticks are not bound to a view or window
/// thus they're not managed by a class implementing this protocol.
///
////////////////////////////////////////////////////////////
@protocol WindowImplDelegateProtocol
////////////////////////////////////////////////////////////
-/// Set the WindowImpl who requested this delegate
-/// (This would be a ctor in C++ or Java where we can prohibit the
-/// construction of an object.)
+/// \brief Get the display scale factor
+///
+/// \return e.g. 1.0 for classic display, 2.0 for retina display
+///
+////////////////////////////////////////////////////////////
+-(CGFloat)displayScaleFactor;
+
+////////////////////////////////////////////////////////////
+/// \brief Set the WindowImpl who requested this delegate
///
////////////////////////////////////////////////////////////
--(void)setRequesterTo:(sf::priv::WindowImplCocoa *)requester;
+-(void)setRequesterTo:(sf::priv::WindowImplCocoa*)requester;
////////////////////////////////////////////////////////////
-/// Return the main view or window.
+/// \brief Get the underlying OS specific handle
+///
+/// \return Return the main view or window.
///
////////////////////////////////////////////////////////////
-(sf::WindowHandle)getSystemHandle;
////////////////////////////////////////////////////////////
-/// Hide or show the mouse cursor.
+/// \brief Determine where the mouse is
+///
+/// \return true when the mouse is inside the OpenGL view, false otherwise
///
////////////////////////////////////////////////////////////
--(void)hideMouseCursor;
--(void)showMouseCursor;
+-(BOOL)isMouseInside;
////////////////////////////////////////////////////////////
-/// Get window's position.
+/// \brief Get window position
+///
+/// \return Top left corner of the window or view
///
////////////////////////////////////////////////////////////
-(NSPoint)position;
////////////////////////////////////////////////////////////
-/// Move the window (not the view if we handle not a window) (SFML Coordinates).
+/// \brief Move the window
+///
+/// Doesn't apply if the implementation is 'only' a view.
+///
+/// \param x x position in SFML coordinates
+/// \param y y position in SFML coordinates
///
////////////////////////////////////////////////////////////
-(void)setWindowPositionToX:(int)x Y:(int)y;
////////////////////////////////////////////////////////////
-/// Get window's size.
+/// \brief Get window/view's size
+///
+/// \return the size of the rendering area
///
////////////////////////////////////////////////////////////
-(NSSize)size;
////////////////////////////////////////////////////////////
-/// Resize the window/view.
+/// \brief Resize the window/view
+///
+/// \param width new width
+/// \param height new height
///
////////////////////////////////////////////////////////////
-(void)resizeTo:(unsigned int)width by:(unsigned int)height;
////////////////////////////////////////////////////////////
-/// Set the title (does nothing if we manage a view).
+/// \brief Set the window's title
+///
+/// Doesn't apply if the implementation is 'only' a view.
+///
+/// \param title new title
///
////////////////////////////////////////////////////////////
--(void)changeTitle:(NSString *)title;
+-(void)changeTitle:(NSString*)title;
////////////////////////////////////////////////////////////
-/// Hide or show the window (does nothing if we manage a view).
+/// \brief Hide the window
+///
+/// Doesn't apply if the implementation is 'only' a view.
///
////////////////////////////////////////////////////////////
-(void)hideWindow;
+
+////////////////////////////////////////////////////////////
+/// \brief Show the window
+///
+/// Doesn't apply if the implementation is 'only' a view.
+///
+////////////////////////////////////////////////////////////
-(void)showWindow;
////////////////////////////////////////////////////////////
-/// Close the window (does nothing if we manage a view).
+/// \brief Close the window
+///
+/// Doesn't apply if the implementation is 'only' a view.
///
////////////////////////////////////////////////////////////
-(void)closeWindow;
////////////////////////////////////////////////////////////
-/// Enable or disable key repeat.
+/// \brief Request the current window to be made the active
+/// foreground window
+///
+////////////////////////////////////////////////////////////
+-(void)requestFocus;
+
+////////////////////////////////////////////////////////////
+/// \brief Check whether the window has the input focus
+///
+/// \return True if window has focus, false otherwise
+///
+////////////////////////////////////////////////////////////
+-(BOOL)hasFocus;
+
+////////////////////////////////////////////////////////////
+/// \brief Enable key repeat
///
////////////////////////////////////////////////////////////
-(void)enableKeyRepeat;
+
+////////////////////////////////////////////////////////////
+/// \brief Disable key repeat
+///
+////////////////////////////////////////////////////////////
-(void)disableKeyRepeat;
////////////////////////////////////////////////////////////
-/// Set an icon to the application.
+/// \brief Set an icon to the application
+///
+/// \param width icon's width
+/// \param height icon's height
+/// \param pixels icon's data
///
////////////////////////////////////////////////////////////
--(void)setIconTo:(unsigned int)width by:(unsigned int)height with:(sf::Uint8 const*)pixels;
+-(void)setIconTo:(unsigned int)width by:(unsigned int)height with:(const sf::Uint8*)pixels;
////////////////////////////////////////////////////////////
-/// Fetch new event
+/// \brief Fetch new event
///
////////////////////////////////////////////////////////////
-(void)processEvent;
////////////////////////////////////////////////////////////
-/// Apply a given context to an OpenGL view.
+/// \brief Apply a given context to an OpenGL view
+///
+/// \param context OpenGL context to attach to the OpenGL view
///
////////////////////////////////////////////////////////////
--(void)applyContext:(NSOpenGLContext *)context;
+-(void)applyContext:(NSOpenGLContext*)context;
@end
diff --git a/src/SFML/Window/OSX/cg_sf_conversion.cpp b/src/SFML/Window/OSX/cg_sf_conversion.cpp
index 3481cce..b5adf4c 100644
--- a/src/SFML/Window/OSX/cg_sf_conversion.cpp
+++ b/src/SFML/Window/OSX/cg_sf_conversion.cpp
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -35,81 +35,43 @@ namespace priv
{
////////////////////////////////////////////////////////////
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
size_t modeBitsPerPixel(CGDisplayModeRef mode)
{
size_t bpp = 0; // no match
-
+
// Compare encoding.
CFStringRef pixEnc = CGDisplayModeCopyPixelEncoding(mode);
- if(CFStringCompare(pixEnc, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
-
+ if(CFStringCompare(pixEnc, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)
bpp = 32;
-
- } else if(CFStringCompare(pixEnc, CFSTR(IO16BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
-
+ else if(CFStringCompare(pixEnc, CFSTR(IO16BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)
bpp = 16;
-
- } else if(CFStringCompare(pixEnc, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
-
+ else if(CFStringCompare(pixEnc, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)
bpp = 8;
-
- }
-
+
// Clean up memory.
CFRelease(pixEnc);
-
+
return bpp;
}
-#endif
-
////////////////////////////////////////////////////////////
size_t displayBitsPerPixel(CGDirectDisplayID displayId)
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-
- return CGDisplayBitsPerPixel(displayId);
-
-#else // MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
-
// Get the display mode.
CGDisplayModeRef mode = CGDisplayCopyDisplayMode(displayId);
-
+
// Get bpp for the mode.
- size_t const bpp = modeBitsPerPixel(mode);
-
+ const size_t bpp = modeBitsPerPixel(mode);
+
// Clean up Memory.
CGDisplayModeRelease(mode);
-
+
return bpp;
-
-#endif
}
////////////////////////////////////////////////////////////
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-
-VideoMode convertCGModeToSFMode(CFDictionaryRef dictionary)
-{
- VideoMode sfmode;
-
- CFNumberRef cfnumber = (CFNumberRef)CFDictionaryGetValue(dictionary, kCGDisplayWidth);
- CFNumberGetValue(cfnumber, kCFNumberIntType, &(sfmode.width));
-
- cfnumber = (CFNumberRef)CFDictionaryGetValue(dictionary, kCGDisplayHeight);
- CFNumberGetValue(cfnumber, kCFNumberIntType, &(sfmode.height));
-
- cfnumber = (CFNumberRef)CFDictionaryGetValue(dictionary, kCGDisplayBitsPerPixel);
- CFNumberGetValue(cfnumber, kCFNumberIntType, &(sfmode.bitsPerPixel));
-
- return sfmode;
-}
-
-#else // MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
-
VideoMode convertCGModeToSFMode(CGDisplayModeRef cgmode)
{
return VideoMode(CGDisplayModeGetWidth(cgmode),
@@ -117,65 +79,46 @@ VideoMode convertCGModeToSFMode(CGDisplayModeRef cgmode)
modeBitsPerPixel(cgmode));
}
-#endif
-
-////////////////////////////////////////////////////////////
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-
-CFDictionaryRef convertSFModeToCGMode(VideoMode sfmode)
-{
- // If sfmode is in VideoMode::GetFullscreenModes
- // then this should be an exact match (see NULL parameter doc).
- return CGDisplayBestModeForParameters(CGMainDisplayID(),
- sfmode.bitsPerPixel,
- sfmode.width,
- sfmode.height,
- NULL);
-}
-
-#else // MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
+////////////////////////////////////////////////////////////
CGDisplayModeRef convertSFModeToCGMode(VideoMode sfmode)
{
// Starting with 10.6 we should query the display all the modes and
// search for the best one.
-
+
// Will return NULL if sfmode is not in VideoMode::GetFullscreenModes.
CGDisplayModeRef cgbestMode = NULL;
-
+
// Retrieve all modes available for main screen only.
CFArrayRef cgmodes = CGDisplayCopyAllDisplayModes(CGMainDisplayID(), NULL);
-
- if (cgmodes == NULL) { // Should not happen but anyway...
+
+ if (cgmodes == NULL) // Should not happen but anyway...
+ {
sf::err() << "Couldn't get VideoMode for main display.";
return NULL;
}
-
+
// Loop on each mode and convert it into a sf::VideoMode object.
- CFIndex const modesCount = CFArrayGetCount(cgmodes);
- for (CFIndex i = 0; i < modesCount; i++) {
+ const CFIndex modesCount = CFArrayGetCount(cgmodes);
+ for (CFIndex i = 0; i < modesCount; i++)
+ {
CGDisplayModeRef cgmode = (CGDisplayModeRef)CFArrayGetValueAtIndex(cgmodes, i);
-
+
VideoMode mode = convertCGModeToSFMode(cgmode);
-
- if (mode == sfmode) {
+
+ if (mode == sfmode)
cgbestMode = cgmode;
- }
}
-
+
// Clean up memory.
CFRelease(cgmodes);
-
- if (cgbestMode == NULL) {
- sf::err()
- << "Couldn't convert the given sf:VideoMode into a CGDisplayMode."
- << std::endl;
- }
-
+
+ if (cgbestMode == NULL)
+ sf::err() << "Couldn't convert the given sf:VideoMode into a CGDisplayMode."
+ << std::endl;
+
return cgbestMode;
}
-#endif
-
} // namespace priv
} // namespace sf
diff --git a/src/SFML/Window/OSX/cg_sf_conversion.hpp b/src/SFML/Window/OSX/cg_sf_conversion.hpp
index 150e7b5..a60cce4 100644
--- a/src/SFML/Window/OSX/cg_sf_conversion.hpp
+++ b/src/SFML/Window/OSX/cg_sf_conversion.hpp
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -37,19 +37,17 @@ namespace sf
namespace priv
{
////////////////////////////////////////////////////////////
-/// \brief Get bpp of a video mode for OS 10.6 or later.
-///
-/// With OS 10.6 and later, Quartz doesn't use anymore dictionaries
+/// \brief Get bpp of a video mode for OS 10.6 or later
+///
+/// With OS 10.6 and later, Quartz doesn't use dictionaries any more
/// to represent video mode. Instead it uses a CGDisplayMode opaque type.
///
-////////////////////////////////////////////////////////////
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
+////////////////////////////////////////////////////////////
size_t modeBitsPerPixel(CGDisplayModeRef mode);
-#endif
////////////////////////////////////////////////////////////
-/// \brief Get bpp for all OS X version.
-///
+/// \brief Get bpp for all OS X version
+///
/// This function use only non-deprecated way to get the
/// display bits per pixel information for a given display id.
///
@@ -57,25 +55,17 @@ size_t modeBitsPerPixel(CGDisplayModeRef mode);
size_t displayBitsPerPixel(CGDirectDisplayID displayId);
////////////////////////////////////////////////////////////
-/// \brief Convert a Quartz video mode into a sf::VideoMode object.
+/// \brief Convert a Quartz video mode into a sf::VideoMode object
///
////////////////////////////////////////////////////////////
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-VideoMode convertCGModeToSFMode(CFDictionaryRef dictionary);
-#else // MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
VideoMode convertCGModeToSFMode(CGDisplayModeRef cgmode);
-#endif
-
+
////////////////////////////////////////////////////////////
-/// \brief Convert a sf::VideoMode object into a Quartz video mode.
+/// \brief Convert a sf::VideoMode object into a Quartz video mode
///
////////////////////////////////////////////////////////////
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-CFDictionaryRef convertSFModeToCGMode(VideoMode sfmode);
-#else // MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
CGDisplayModeRef convertSFModeToCGMode(VideoMode sfmode);
-#endif
-
+
} // namespace priv
} // namespace sf
diff --git a/src/SFML/Window/OSX/cpp_objc_conversion.h b/src/SFML/Window/OSX/cpp_objc_conversion.h
index 75095b3..32b010c 100644
--- a/src/SFML/Window/OSX/cpp_objc_conversion.h
+++ b/src/SFML/Window/OSX/cpp_objc_conversion.h
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -26,14 +26,19 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include <string>
#include <SFML/System/String.hpp>
+#include <string>
#import <Foundation/Foundation.h>
////////////////////////////////////////////////////////////
-/// \brief Returns a NSString construct with +stringWithCString:encoding:.
+/// \brief Returns a NSString construct with +stringWithCString:encoding:
+///
+////////////////////////////////////////////////////////////
+NSString* stringToNSString(const std::string& string);
+
+////////////////////////////////////////////////////////////
+/// \brief Returns a NSString construct with +stringWithCString:encoding:
///
////////////////////////////////////////////////////////////
-NSString* stringToNSString(std::string const& string);
-NSString* sfStringToNSString(sf::String const& string);
+NSString* sfStringToNSString(const sf::String& string);
diff --git a/src/SFML/Window/OSX/cpp_objc_conversion.mm b/src/SFML/Window/OSX/cpp_objc_conversion.mm
index 4b619a5..6ce8a9b 100644
--- a/src/SFML/Window/OSX/cpp_objc_conversion.mm
+++ b/src/SFML/Window/OSX/cpp_objc_conversion.mm
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2012 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent.gom@gmail.com),
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -28,21 +28,21 @@
////////////////////////////////////////////////////////////
#include <SFML/System/Utf.hpp>
-#import <Foundation/Foundation.h>
#import <SFML/Window/OSX/cpp_objc_conversion.h>
+#import <Foundation/Foundation.h>
////////////////////////////////////////////////////////////
-NSString* stringToNSString(std::string const& string)
+NSString* stringToNSString(const std::string& string)
{
std::string utf8; utf8.reserve(string.size() + 1);
sf::Utf8::fromAnsi(string.begin(), string.end(), std::back_inserter(utf8));
NSString* str = [NSString stringWithCString:utf8.c_str() encoding:NSUTF8StringEncoding];
-
+
return str;
}
////////////////////////////////////////////////////////////
-NSString* sfStringToNSString(sf::String const& string)
+NSString* sfStringToNSString(const sf::String& string)
{
sf::Uint32 length = string.getSize() * sizeof(sf::Uint32);
const void* data = reinterpret_cast<const void*>(string.getData());
@@ -54,5 +54,5 @@ NSString* sfStringToNSString(sf::String const& string)
encoding = NSUTF32BigEndianStringEncoding;
NSString* str = [[NSString alloc] initWithBytes:data length:length encoding:encoding];
- return str;
+ return [str autorelease];
}
diff --git a/src/SFML/Window/Sensor.cpp b/src/SFML/Window/Sensor.cpp
new file mode 100644
index 0000000..d90fcec
--- /dev/null
+++ b/src/SFML/Window/Sensor.cpp
@@ -0,0 +1,53 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/Sensor.hpp>
+#include <SFML/Window/SensorManager.hpp>
+
+
+namespace sf
+{
+
+////////////////////////////////////////////////////////////
+bool Sensor::isAvailable(Type sensor)
+{
+ return priv::SensorManager::getInstance().isAvailable(sensor);
+}
+
+////////////////////////////////////////////////////////////
+void Sensor::setEnabled(Type sensor, bool enabled)
+{
+ return priv::SensorManager::getInstance().setEnabled(sensor, enabled);
+}
+
+////////////////////////////////////////////////////////////
+Vector3f Sensor::getValue(Type sensor)
+{
+ return priv::SensorManager::getInstance().getValue(sensor);
+}
+
+} // namespace sf
diff --git a/src/SFML/Window/SensorImpl.hpp b/src/SFML/Window/SensorImpl.hpp
new file mode 100644
index 0000000..40f266f
--- /dev/null
+++ b/src/SFML/Window/SensorImpl.hpp
@@ -0,0 +1,57 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SENSORIMPL_HPP
+#define SFML_SENSORIMPL_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <SFML/Window/Sensor.hpp>
+
+#if defined(SFML_SYSTEM_WINDOWS)
+
+ #include <SFML/Window/Win32/SensorImpl.hpp>
+
+#elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD)
+
+ #include <SFML/Window/Unix/SensorImpl.hpp>
+
+#elif defined(SFML_SYSTEM_MACOS)
+
+ #include <SFML/Window/OSX/SensorImpl.hpp>
+
+#elif defined(SFML_SYSTEM_IOS)
+
+ #include <SFML/Window/iOS/SensorImpl.hpp>
+
+#elif defined(SFML_SYSTEM_ANDROID)
+
+ #include <SFML/Window/Android/SensorImpl.hpp>
+
+#endif
+
+
+#endif // SFML_SENSORIMPL_HPP
diff --git a/src/SFML/Window/SensorManager.cpp b/src/SFML/Window/SensorManager.cpp
new file mode 100644
index 0000000..c802554
--- /dev/null
+++ b/src/SFML/Window/SensorManager.cpp
@@ -0,0 +1,129 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/SensorManager.hpp>
+#include <SFML/System/Err.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+SensorManager& SensorManager::getInstance()
+{
+ static SensorManager instance;
+ return instance;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SensorManager::isAvailable(Sensor::Type sensor)
+{
+ return m_sensors[sensor].available;
+}
+
+
+////////////////////////////////////////////////////////////
+void SensorManager::setEnabled(Sensor::Type sensor, bool enabled)
+{
+ if (m_sensors[sensor].available)
+ {
+ m_sensors[sensor].enabled = enabled;
+ m_sensors[sensor].sensor.setEnabled(enabled);
+ }
+ else
+ {
+ err() << "Warning: trying to enable a sensor that is not available (call Sensor::isAvailable to check it)" << std::endl;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+bool SensorManager::isEnabled(Sensor::Type sensor) const
+{
+ return m_sensors[sensor].enabled;
+}
+
+
+////////////////////////////////////////////////////////////
+Vector3f SensorManager::getValue(Sensor::Type sensor) const
+{
+ return m_sensors[sensor].value;
+}
+
+
+////////////////////////////////////////////////////////////
+void SensorManager::update()
+{
+ for (int i = 0; i < Sensor::Count; ++i)
+ {
+ // Only process available sensors
+ if (m_sensors[i].available)
+ m_sensors[i].value = m_sensors[i].sensor.update();
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+SensorManager::SensorManager()
+{
+ // Global sensor initialization
+ SensorImpl::initialize();
+
+ // Per sensor initialization
+ for (int i = 0; i < Sensor::Count; ++i)
+ {
+ // Check which sensors are available
+ m_sensors[i].available = SensorImpl::isAvailable(static_cast<Sensor::Type>(i));
+
+ // Open the available sensors
+ if (m_sensors[i].available)
+ {
+ m_sensors[i].sensor.open(static_cast<Sensor::Type>(i));
+ m_sensors[i].sensor.setEnabled(false);
+ }
+ }
+}
+
+////////////////////////////////////////////////////////////
+SensorManager::~SensorManager()
+{
+ // Per sensor cleanup
+ for (int i = 0; i < Sensor::Count; ++i)
+ {
+ if (m_sensors[i].available)
+ m_sensors[i].sensor.close();
+ }
+
+ // Global sensor cleanup
+ SensorImpl::cleanup();
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/SensorManager.hpp b/src/SFML/Window/SensorManager.hpp
new file mode 100644
index 0000000..aa2ec95
--- /dev/null
+++ b/src/SFML/Window/SensorManager.hpp
@@ -0,0 +1,138 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SENSORMANAGER_HPP
+#define SFML_SENSORMANAGER_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/Sensor.hpp>
+#include <SFML/Window/SensorImpl.hpp>
+#include <SFML/System/NonCopyable.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Global sensor manager
+///
+////////////////////////////////////////////////////////////
+class SensorManager : NonCopyable
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the global unique instance of the manager
+ ///
+ /// \return Unique instance of the sensor manager
+ ///
+ ////////////////////////////////////////////////////////////
+ static SensorManager& getInstance();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a sensor is available on the underlying platform
+ ///
+ /// \param sensor Sensor to check
+ ///
+ /// \return True if the sensor is available, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ bool isAvailable(Sensor::Type sensor);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Enable or disable a sensor
+ ///
+ /// \param sensor Sensor to modify
+ /// \param enabled Whether it should be enabled or not
+ ///
+ ////////////////////////////////////////////////////////////
+ void setEnabled(Sensor::Type sensor, bool enabled);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a sensor is enabled
+ ///
+ /// \param sensor Sensor to check
+ ///
+ /// \return True if the sensor is enabled, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ bool isEnabled(Sensor::Type sensor) const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current value of a sensor
+ ///
+ /// \param sensor Sensor to read
+ ///
+ /// \return Current value of the sensor
+ ///
+ ////////////////////////////////////////////////////////////
+ Vector3f getValue(Sensor::Type sensor) const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Update the state of all the sensors
+ ///
+ ////////////////////////////////////////////////////////////
+ void update();
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ SensorManager();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~SensorManager();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Sensor information and state
+ ///
+ ////////////////////////////////////////////////////////////
+ struct Item
+ {
+ bool available; ///< Is the sensor available on this device?
+ bool enabled; ///< Current enable state of the sensor
+ SensorImpl sensor; ///< Sensor implementation
+ Vector3f value; ///< The current sensor value
+ };
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ Item m_sensors[Sensor::Count]; ///< Sensors information and state
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_SENSORMANAGER_HPP
diff --git a/src/SFML/Window/Touch.cpp b/src/SFML/Window/Touch.cpp
new file mode 100644
index 0000000..2bdc52f
--- /dev/null
+++ b/src/SFML/Window/Touch.cpp
@@ -0,0 +1,54 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/Touch.hpp>
+#include <SFML/Window/InputImpl.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+bool Touch::isDown(unsigned int finger)
+{
+ return priv::InputImpl::isTouchDown(finger);
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i Touch::getPosition(unsigned int finger)
+{
+ return priv::InputImpl::getTouchPosition(finger);
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i Touch::getPosition(unsigned int finger, const Window& relativeTo)
+{
+ return priv::InputImpl::getTouchPosition(finger, relativeTo);
+}
+
+} // namespace sf
diff --git a/src/SFML/Window/Linux/Display.cpp b/src/SFML/Window/Unix/Display.cpp
index 557f8d6..aad1b26 100644
--- a/src/SFML/Window/Linux/Display.cpp
+++ b/src/SFML/Window/Unix/Display.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -25,8 +25,10 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include <SFML/Window/Linux/Display.hpp>
+#include <SFML/System/Err.hpp>
+#include <SFML/Window/Unix/Display.hpp>
#include <cassert>
+#include <cstdlib>
namespace
@@ -44,7 +46,18 @@ namespace priv
Display* OpenDisplay()
{
if (referenceCount == 0)
+ {
sharedDisplay = XOpenDisplay(NULL);
+
+ // Opening display failed: The best we can do at the moment is to output a meaningful error message
+ // and cause an abnormal program termination
+ if (!sharedDisplay)
+ {
+ err() << "Failed to open X11 display; make sure the DISPLAY environment variable is set correctly" << std::endl;
+ std::abort();
+ }
+ }
+
referenceCount++;
return sharedDisplay;
}
diff --git a/src/SFML/Window/Linux/Display.hpp b/src/SFML/Window/Unix/Display.hpp
index 94bc98c..df018b3 100644
--- a/src/SFML/Window/Linux/Display.hpp
+++ b/src/SFML/Window/Unix/Display.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
diff --git a/src/SFML/Window/Linux/GlxContext.cpp b/src/SFML/Window/Unix/GlxContext.cpp
index 6454d78..eac6099 100644
--- a/src/SFML/Window/Linux/GlxContext.cpp
+++ b/src/SFML/Window/Unix/GlxContext.cpp
@@ -1,343 +1,341 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#define GLX_GLXEXT_LEGACY // so that our local glxext.h is used instead of the system one
-#include <SFML/Window/Linux/GlxContext.hpp>
-#include <SFML/Window/Linux/WindowImplX11.hpp>
-#include <SFML/Window/Linux/Display.hpp>
-#include <SFML/OpenGL.hpp>
-#include <SFML/Window/glext/glxext.h>
-#include <SFML/System/Err.hpp>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-GlxContext::GlxContext(GlxContext* shared) :
-m_window (0),
-m_context (NULL),
-m_ownsWindow(true)
-{
- // Open a connection with the X server
- m_display = OpenDisplay();
-
- // Create a dummy window (disabled and hidden)
- int screen = DefaultScreen(m_display);
- m_window = XCreateWindow(m_display,
- RootWindow(m_display, screen),
- 0, 0,
- 1, 1,
- 0,
- DefaultDepth(m_display, screen),
- InputOutput,
- DefaultVisual(m_display, screen),
- 0, NULL);
-
- // Create the context
- createContext(shared, VideoMode::getDesktopMode().bitsPerPixel, ContextSettings());
-}
-
-
-////////////////////////////////////////////////////////////
-GlxContext::GlxContext(GlxContext* shared, const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel) :
-m_window (0),
-m_context (NULL),
-m_ownsWindow(false)
-{
- // Open a connection with the X server
- // (important: must be the same display as the owner window)
- m_display = OpenDisplay();
-
- // Get the owner window and its device context
- m_window = static_cast< ::Window>(owner->getSystemHandle());
-
- // Create the context
- if (m_window)
- createContext(shared, bitsPerPixel, settings);
-}
-
-
-////////////////////////////////////////////////////////////
-GlxContext::GlxContext(GlxContext* shared, const ContextSettings& settings, unsigned int width, unsigned int height) :
-m_window (0),
-m_context (NULL),
-m_ownsWindow(true)
-{
- // Open a connection with the X server
- m_display = OpenDisplay();
-
- // Create the hidden window
- int screen = DefaultScreen(m_display);
- m_window = XCreateWindow(m_display,
- RootWindow(m_display, screen),
- 0, 0,
- width, height,
- 0,
- DefaultDepth(m_display, screen),
- InputOutput,
- DefaultVisual(m_display, screen),
- 0, NULL);
-
- // Create the context
- createContext(shared, VideoMode::getDesktopMode().bitsPerPixel, settings);
-}
-
-
-////////////////////////////////////////////////////////////
-GlxContext::~GlxContext()
-{
- // Destroy the context
- if (m_context)
- {
- if (glXGetCurrentContext() == m_context)
- glXMakeCurrent(m_display, None, NULL);
- glXDestroyContext(m_display, m_context);
- }
-
- // Destroy the window if we own it
- if (m_window && m_ownsWindow)
- {
- XDestroyWindow(m_display, m_window);
- XFlush(m_display);
- }
-
- // Close the connection with the X server
- CloseDisplay(m_display);
-}
-
-
-////////////////////////////////////////////////////////////
-bool GlxContext::makeCurrent()
-{
- return m_context && glXMakeCurrent(m_display, m_window, m_context);
-}
-
-
-////////////////////////////////////////////////////////////
-void GlxContext::display()
-{
- if (m_window)
- glXSwapBuffers(m_display, m_window);
-}
-
-
-////////////////////////////////////////////////////////////
-void GlxContext::setVerticalSyncEnabled(bool enabled)
-{
- const GLubyte* name = reinterpret_cast<const GLubyte*>("glXSwapIntervalSGI");
- PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI = reinterpret_cast<PFNGLXSWAPINTERVALSGIPROC>(glXGetProcAddress(name));
- if (glXSwapIntervalSGI)
- glXSwapIntervalSGI(enabled ? 1 : 0);
-}
-
-
-////////////////////////////////////////////////////////////
-XVisualInfo GlxContext::selectBestVisual(::Display* display, unsigned int bitsPerPixel, const ContextSettings& settings)
-{
- // Retrieve all the visuals
- int count;
- XVisualInfo* visuals = XGetVisualInfo(display, 0, NULL, &count);
- if (visuals)
- {
- // Evaluate all the returned visuals, and pick the best one1
- int bestScore = 0xFFFF;
- XVisualInfo bestVisual;
- for (int i = 0; i < count; ++i)
- {
- // Check mandatory attributes
- int doubleBuffer;
- glXGetConfig(display, &visuals[i], GLX_DOUBLEBUFFER, &doubleBuffer);
- if (!doubleBuffer)
- continue;
-
- // Extract the components of the current visual
- int red, green, blue, alpha, depth, stencil, multiSampling, samples;
- glXGetConfig(display, &visuals[i], GLX_RED_SIZE, &red);
- glXGetConfig(display, &visuals[i], GLX_GREEN_SIZE, &green);
- glXGetConfig(display, &visuals[i], GLX_BLUE_SIZE, &blue);
- glXGetConfig(display, &visuals[i], GLX_ALPHA_SIZE, &alpha);
- glXGetConfig(display, &visuals[i], GLX_DEPTH_SIZE, &depth);
- glXGetConfig(display, &visuals[i], GLX_STENCIL_SIZE, &stencil);
- glXGetConfig(display, &visuals[i], GLX_SAMPLE_BUFFERS_ARB, &multiSampling);
- glXGetConfig(display, &visuals[i], GLX_SAMPLES_ARB, &samples);
-
- // Evaluate the visual
- int color = red + green + blue + alpha;
- int score = evaluateFormat(bitsPerPixel, settings, color, depth, stencil, multiSampling ? samples : 0);
-
- // If it's better than the current best, make it the new best
- if (score < bestScore)
- {
- bestScore = score;
- bestVisual = visuals[i];
- }
- }
-
- // Free the array of visuals
- XFree(visuals);
-
- return bestVisual;
- }
- else
- {
- // Should never happen...
- err() << "No GLX visual found. You should check your graphics driver" << std::endl;
-
- return XVisualInfo();
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void GlxContext::createContext(GlxContext* shared, unsigned int bitsPerPixel, const ContextSettings& settings)
-{
- XVisualInfo* visualInfo = NULL;
-
- // Save the creation settings
- m_settings = settings;
-
- // Get the context to share display lists with
- GLXContext toShare = shared ? shared->m_context : NULL;
-
- // Create the OpenGL context -- first try context versions >= 3.0 if it is requested (they require special code)
- if (m_settings.majorVersion >= 3)
- {
- const GLubyte* name = reinterpret_cast<const GLubyte*>("glXCreateContextAttribsARB");
- PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = reinterpret_cast<PFNGLXCREATECONTEXTATTRIBSARBPROC>(glXGetProcAddress(name));
- if (glXCreateContextAttribsARB)
- {
- // Select a GLXFB config that matches the requested context settings
- int nbConfigs = 0;
- int fbAttributes[] =
- {
- GLX_DEPTH_SIZE, settings.depthBits,
- GLX_STENCIL_SIZE, settings.stencilBits,
- GLX_SAMPLE_BUFFERS, settings.antialiasingLevel > 0,
- GLX_SAMPLES, settings.antialiasingLevel,
- GLX_RED_SIZE, 8,
- GLX_GREEN_SIZE, 8,
- GLX_BLUE_SIZE, 8,
- GLX_ALPHA_SIZE, bitsPerPixel == 32 ? 8 : 0,
- GLX_DOUBLEBUFFER, True,
- GLX_X_RENDERABLE, True,
- GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
- GLX_RENDER_TYPE, GLX_RGBA_BIT,
- GLX_CONFIG_CAVEAT, GLX_NONE,
- None
- };
- GLXFBConfig* configs = glXChooseFBConfig(m_display, DefaultScreen(m_display), fbAttributes, &nbConfigs);
- if (configs && nbConfigs)
- {
- while (!m_context && (m_settings.majorVersion >= 3))
- {
- // Create the context
- int attributes[] =
- {
- GLX_CONTEXT_MAJOR_VERSION_ARB, static_cast<int>(m_settings.majorVersion),
- GLX_CONTEXT_MINOR_VERSION_ARB, static_cast<int>(m_settings.minorVersion),
- GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
- 0, 0
- };
- m_context = glXCreateContextAttribsARB(m_display, configs[0], toShare, true, attributes);
-
- if (m_context)
- {
- // Ok: retrieve the config's visual
- visualInfo = glXGetVisualFromFBConfig(m_display, configs[0]);
- }
- else
- {
- // If we couldn't create the context, lower the version number and try again -- stop at 3.0
- // Invalid version numbers will be generated by this algorithm (like 3.9), but we really don't care
- if (m_settings.minorVersion > 0)
- {
- // If the minor version is not 0, we decrease it and try again
- m_settings.minorVersion--;
- }
- else
- {
- // If the minor version is 0, we decrease the major version
- m_settings.majorVersion--;
- m_settings.minorVersion = 9;
- }
- }
- }
- XFree(configs);
- }
- }
- }
-
- // If the OpenGL >= 3.0 context failed or if we don't want one, create a regular OpenGL 1.x/2.x context
- if (!m_context)
- {
- // set the context version to 2.0 (arbitrary)
- m_settings.majorVersion = 2;
- m_settings.minorVersion = 0;
-
- // Retrieve the attributes of the target window
- XWindowAttributes windowAttributes;
- if (XGetWindowAttributes(m_display, m_window, &windowAttributes) == 0)
- {
- err() << "Failed to get the window attributes" << std::endl;
- return;
- }
-
- // Get its visual
- XVisualInfo tpl;
- tpl.screen = DefaultScreen(m_display);
- tpl.visualid = XVisualIDFromVisual(windowAttributes.visual);
- int nbVisuals = 0;
- visualInfo = XGetVisualInfo(m_display, VisualIDMask | VisualScreenMask, &tpl, &nbVisuals);
-
- // Create the context, using the target window's visual
- m_context = glXCreateContext(m_display, visualInfo, toShare, true);
- if (!m_context)
- {
- err() << "Failed to create an OpenGL context for this window" << std::endl;
- return;
- }
- }
-
- // Update the creation settings from the chosen format
- int depth, stencil, multiSampling, samples;
- glXGetConfig(m_display, visualInfo, GLX_DEPTH_SIZE, &depth);
- glXGetConfig(m_display, visualInfo, GLX_STENCIL_SIZE, &stencil);
- glXGetConfig(m_display, visualInfo, GLX_SAMPLE_BUFFERS_ARB, &multiSampling);
- glXGetConfig(m_display, visualInfo, GLX_SAMPLES_ARB, &samples);
- m_settings.depthBits = static_cast<unsigned int>(depth);
- m_settings.stencilBits = static_cast<unsigned int>(stencil);
- m_settings.antialiasingLevel = multiSampling ? samples : 0;
-
- // Free the visual info
- XFree(visualInfo);
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/Unix/GlxContext.hpp>
+#include <SFML/Window/Unix/WindowImplX11.hpp>
+#include <SFML/Window/Unix/Display.hpp>
+#include <SFML/OpenGL.hpp>
+#include <SFML/System/Err.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+GlxContext::GlxContext(GlxContext* shared) :
+m_window (0),
+m_context (NULL),
+m_ownsWindow(true)
+{
+ // Open a connection with the X server
+ m_display = OpenDisplay();
+
+ // Create a dummy window (disabled and hidden)
+ int screen = DefaultScreen(m_display);
+ m_window = XCreateWindow(m_display,
+ RootWindow(m_display, screen),
+ 0, 0,
+ 1, 1,
+ 0,
+ DefaultDepth(m_display, screen),
+ InputOutput,
+ DefaultVisual(m_display, screen),
+ 0, NULL);
+
+ // Create the context
+ createContext(shared, VideoMode::getDesktopMode().bitsPerPixel, ContextSettings());
+}
+
+
+////////////////////////////////////////////////////////////
+GlxContext::GlxContext(GlxContext* shared, const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel) :
+m_window (0),
+m_context (NULL),
+m_ownsWindow(false)
+{
+ // Open a connection with the X server
+ // (important: must be the same display as the owner window)
+ m_display = OpenDisplay();
+
+ // Get the owner window and its device context
+ m_window = static_cast< ::Window>(owner->getSystemHandle());
+
+ // Create the context
+ if (m_window)
+ createContext(shared, bitsPerPixel, settings);
+}
+
+
+////////////////////////////////////////////////////////////
+GlxContext::GlxContext(GlxContext* shared, const ContextSettings& settings, unsigned int width, unsigned int height) :
+m_window (0),
+m_context (NULL),
+m_ownsWindow(true)
+{
+ // Open a connection with the X server
+ m_display = OpenDisplay();
+
+ // Create the hidden window
+ int screen = DefaultScreen(m_display);
+ m_window = XCreateWindow(m_display,
+ RootWindow(m_display, screen),
+ 0, 0,
+ width, height,
+ 0,
+ DefaultDepth(m_display, screen),
+ InputOutput,
+ DefaultVisual(m_display, screen),
+ 0, NULL);
+
+ // Create the context
+ createContext(shared, VideoMode::getDesktopMode().bitsPerPixel, settings);
+}
+
+
+////////////////////////////////////////////////////////////
+GlxContext::~GlxContext()
+{
+ // Destroy the context
+ if (m_context)
+ {
+ if (glXGetCurrentContext() == m_context)
+ glXMakeCurrent(m_display, None, NULL);
+ glXDestroyContext(m_display, m_context);
+ }
+
+ // Destroy the window if we own it
+ if (m_window && m_ownsWindow)
+ {
+ XDestroyWindow(m_display, m_window);
+ XFlush(m_display);
+ }
+
+ // Close the connection with the X server
+ CloseDisplay(m_display);
+}
+
+
+////////////////////////////////////////////////////////////
+bool GlxContext::makeCurrent()
+{
+ return m_context && glXMakeCurrent(m_display, m_window, m_context);
+}
+
+
+////////////////////////////////////////////////////////////
+void GlxContext::display()
+{
+ if (m_window)
+ glXSwapBuffers(m_display, m_window);
+}
+
+
+////////////////////////////////////////////////////////////
+void GlxContext::setVerticalSyncEnabled(bool enabled)
+{
+ const GLubyte* name = reinterpret_cast<const GLubyte*>("glXSwapIntervalSGI");
+ PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI = reinterpret_cast<PFNGLXSWAPINTERVALSGIPROC>(glXGetProcAddress(name));
+ if (glXSwapIntervalSGI)
+ glXSwapIntervalSGI(enabled ? 1 : 0);
+}
+
+
+////////////////////////////////////////////////////////////
+XVisualInfo GlxContext::selectBestVisual(::Display* display, unsigned int bitsPerPixel, const ContextSettings& settings)
+{
+ // Retrieve all the visuals
+ int count;
+ XVisualInfo* visuals = XGetVisualInfo(display, 0, NULL, &count);
+ if (visuals)
+ {
+ // Evaluate all the returned visuals, and pick the best one
+ int bestScore = 0xFFFF;
+ XVisualInfo bestVisual;
+ for (int i = 0; i < count; ++i)
+ {
+ // Check mandatory attributes
+ int doubleBuffer;
+ glXGetConfig(display, &visuals[i], GLX_DOUBLEBUFFER, &doubleBuffer);
+ if (!doubleBuffer)
+ continue;
+
+ // Extract the components of the current visual
+ int red, green, blue, alpha, depth, stencil, multiSampling, samples;
+ glXGetConfig(display, &visuals[i], GLX_RED_SIZE, &red);
+ glXGetConfig(display, &visuals[i], GLX_GREEN_SIZE, &green);
+ glXGetConfig(display, &visuals[i], GLX_BLUE_SIZE, &blue);
+ glXGetConfig(display, &visuals[i], GLX_ALPHA_SIZE, &alpha);
+ glXGetConfig(display, &visuals[i], GLX_DEPTH_SIZE, &depth);
+ glXGetConfig(display, &visuals[i], GLX_STENCIL_SIZE, &stencil);
+ glXGetConfig(display, &visuals[i], GLX_SAMPLE_BUFFERS_ARB, &multiSampling);
+ glXGetConfig(display, &visuals[i], GLX_SAMPLES_ARB, &samples);
+
+ // Evaluate the visual
+ int color = red + green + blue + alpha;
+ int score = evaluateFormat(bitsPerPixel, settings, color, depth, stencil, multiSampling ? samples : 0);
+
+ // If it's better than the current best, make it the new best
+ if (score < bestScore)
+ {
+ bestScore = score;
+ bestVisual = visuals[i];
+ }
+ }
+
+ // Free the array of visuals
+ XFree(visuals);
+
+ return bestVisual;
+ }
+ else
+ {
+ // Should never happen...
+ err() << "No GLX visual found. You should check your graphics driver" << std::endl;
+
+ return XVisualInfo();
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void GlxContext::createContext(GlxContext* shared, unsigned int bitsPerPixel, const ContextSettings& settings)
+{
+ XVisualInfo* visualInfo = NULL;
+
+ // Save the creation settings
+ m_settings = settings;
+
+ // Get the context to share display lists with
+ GLXContext toShare = shared ? shared->m_context : NULL;
+
+ // Create the OpenGL context -- first try context versions >= 3.0 if it is requested (they require special code)
+ if (m_settings.majorVersion >= 3)
+ {
+ const GLubyte* name = reinterpret_cast<const GLubyte*>("glXCreateContextAttribsARB");
+ PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = reinterpret_cast<PFNGLXCREATECONTEXTATTRIBSARBPROC>(glXGetProcAddress(name));
+ if (glXCreateContextAttribsARB)
+ {
+ // Select a GLXFB config that matches the requested context settings
+ int nbConfigs = 0;
+ int fbAttributes[] =
+ {
+ GLX_DEPTH_SIZE, static_cast<int>(settings.depthBits),
+ GLX_STENCIL_SIZE, static_cast<int>(settings.stencilBits),
+ GLX_SAMPLE_BUFFERS, settings.antialiasingLevel > 0,
+ GLX_SAMPLES, static_cast<int>(settings.antialiasingLevel),
+ GLX_RED_SIZE, 8,
+ GLX_GREEN_SIZE, 8,
+ GLX_BLUE_SIZE, 8,
+ GLX_ALPHA_SIZE, bitsPerPixel == 32 ? 8 : 0,
+ GLX_DOUBLEBUFFER, True,
+ GLX_X_RENDERABLE, True,
+ GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
+ GLX_RENDER_TYPE, GLX_RGBA_BIT,
+ GLX_CONFIG_CAVEAT, GLX_NONE,
+ None
+ };
+ GLXFBConfig* configs = glXChooseFBConfig(m_display, DefaultScreen(m_display), fbAttributes, &nbConfigs);
+ if (configs && nbConfigs)
+ {
+ while (!m_context && (m_settings.majorVersion >= 3))
+ {
+ // Create the context
+ int attributes[] =
+ {
+ GLX_CONTEXT_MAJOR_VERSION_ARB, static_cast<int>(m_settings.majorVersion),
+ GLX_CONTEXT_MINOR_VERSION_ARB, static_cast<int>(m_settings.minorVersion),
+ GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
+ 0, 0
+ };
+ m_context = glXCreateContextAttribsARB(m_display, configs[0], toShare, true, attributes);
+
+ if (m_context)
+ {
+ // Ok: retrieve the config's visual
+ visualInfo = glXGetVisualFromFBConfig(m_display, configs[0]);
+ }
+ else
+ {
+ // If we couldn't create the context, lower the version number and try again -- stop at 3.0
+ // Invalid version numbers will be generated by this algorithm (like 3.9), but we really don't care
+ if (m_settings.minorVersion > 0)
+ {
+ // If the minor version is not 0, we decrease it and try again
+ m_settings.minorVersion--;
+ }
+ else
+ {
+ // If the minor version is 0, we decrease the major version
+ m_settings.majorVersion--;
+ m_settings.minorVersion = 9;
+ }
+ }
+ }
+ XFree(configs);
+ }
+ }
+ }
+
+ // If the OpenGL >= 3.0 context failed or if we don't want one, create a regular OpenGL 1.x/2.x context
+ if (!m_context)
+ {
+ // set the context version to 2.0 (arbitrary)
+ m_settings.majorVersion = 2;
+ m_settings.minorVersion = 0;
+
+ // Retrieve the attributes of the target window
+ XWindowAttributes windowAttributes;
+ if (XGetWindowAttributes(m_display, m_window, &windowAttributes) == 0)
+ {
+ err() << "Failed to get the window attributes" << std::endl;
+ return;
+ }
+
+ // Get its visual
+ XVisualInfo tpl;
+ tpl.screen = DefaultScreen(m_display);
+ tpl.visualid = XVisualIDFromVisual(windowAttributes.visual);
+ int nbVisuals = 0;
+ visualInfo = XGetVisualInfo(m_display, VisualIDMask | VisualScreenMask, &tpl, &nbVisuals);
+
+ // Create the context, using the target window's visual
+ m_context = glXCreateContext(m_display, visualInfo, toShare, true);
+ if (!m_context)
+ {
+ err() << "Failed to create an OpenGL context for this window" << std::endl;
+ return;
+ }
+ }
+
+ // Update the creation settings from the chosen format
+ int depth, stencil, multiSampling, samples;
+ glXGetConfig(m_display, visualInfo, GLX_DEPTH_SIZE, &depth);
+ glXGetConfig(m_display, visualInfo, GLX_STENCIL_SIZE, &stencil);
+ glXGetConfig(m_display, visualInfo, GLX_SAMPLE_BUFFERS_ARB, &multiSampling);
+ glXGetConfig(m_display, visualInfo, GLX_SAMPLES_ARB, &samples);
+ m_settings.depthBits = static_cast<unsigned int>(depth);
+ m_settings.stencilBits = static_cast<unsigned int>(stencil);
+ m_settings.antialiasingLevel = multiSampling ? samples : 0;
+
+ // Free the visual info
+ XFree(visualInfo);
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/Linux/GlxContext.hpp b/src/SFML/Window/Unix/GlxContext.hpp
index 493c858..0b5982f 100644
--- a/src/SFML/Window/Linux/GlxContext.hpp
+++ b/src/SFML/Window/Unix/GlxContext.hpp
@@ -1,148 +1,148 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_GLXCONTEXT_HPP
-#define SFML_GLXCONTEXT_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Window/GlContext.hpp>
-#include <X11/Xlib.h>
-#include <GL/glx.h>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief Linux (GLX) implementation of OpenGL contexts
-///
-////////////////////////////////////////////////////////////
-class GlxContext : public GlContext
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Create a new default context
- ///
- /// \param shared Context to share the new one with (can be NULL)
- ///
- ////////////////////////////////////////////////////////////
- GlxContext(GlxContext* shared);
-
- ////////////////////////////////////////////////////////////
- /// \brief Create a new context attached to a window
- ///
- /// \param shared Context to share the new one with
- /// \param settings Creation parameters
- /// \param owner Pointer to the owner window
- /// \param bitsPerPixel Pixel depth, in bits per pixel
- ///
- ////////////////////////////////////////////////////////////
- GlxContext(GlxContext* shared, const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel);
-
- ////////////////////////////////////////////////////////////
- /// \brief Create a new context that embeds its own rendering target
- ///
- /// \param shared Context to share the new one with
- /// \param settings Creation parameters
- /// \param width Back buffer width, in pixels
- /// \param height Back buffer height, in pixels
- ///
- ////////////////////////////////////////////////////////////
- GlxContext(GlxContext* shared, const ContextSettings& settings, unsigned int width, unsigned int height);
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor
- ///
- ////////////////////////////////////////////////////////////
- ~GlxContext();
-
- ////////////////////////////////////////////////////////////
- /// \brief Activate the context as the current target for rendering
- ///
- /// \return True on success, false if any error happened
- ///
- ////////////////////////////////////////////////////////////
- virtual bool makeCurrent();
-
- ////////////////////////////////////////////////////////////
- /// \brief Display what has been rendered to the context so far
- ///
- ////////////////////////////////////////////////////////////
- virtual void display();
-
- ////////////////////////////////////////////////////////////
- /// \brief Enable or disable vertical synchronization
- ///
- /// Activating vertical synchronization will limit the number
- /// of frames displayed to the refresh rate of the monitor.
- /// This can avoid some visual artifacts, and limit the framerate
- /// to a good value (but not constant across different computers).
- ///
- /// \param enabled True to enable v-sync, false to deactivate
- ///
- ////////////////////////////////////////////////////////////
- virtual void setVerticalSyncEnabled(bool enabled);
-
- ////////////////////////////////////////////////////////////
- /// \brief Select the best GLX visual for a given set of settings
- ///
- /// \param display X display
- /// \param bitsPerPixel Pixel depth, in bits per pixel
- /// \param settings Requested context settings
- ///
- /// \return The best visual
- ///
- ////////////////////////////////////////////////////////////
- static XVisualInfo selectBestVisual(::Display* display, unsigned int bitsPerPixel, const ContextSettings& settings);
-
-private :
-
- ////////////////////////////////////////////////////////////
- /// \brief Create the context
- ///
- /// \param shared Context to share the new one with (can be NULL)
- /// \param bitsPerPixel Pixel depth, in bits per pixel
- /// \param settings Creation parameters
- ///
- ////////////////////////////////////////////////////////////
- void createContext(GlxContext* shared, unsigned int bitsPerPixel, const ContextSettings& settings);
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- ::Display* m_display; ///< Connection to the X server
- ::Window m_window; ///< Window to which the context is attached
- GLXContext m_context; ///< OpenGL context
- bool m_ownsWindow; ///< Do we own the window associated to the context?
-};
-
-} // namespace priv
-
-} // namespace sf
-
-#endif // SFML_GLXCONTEXT_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_GLXCONTEXT_HPP
+#define SFML_GLXCONTEXT_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/GlContext.hpp>
+#include <X11/Xlib.h>
+#include <GL/glx.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Linux (GLX) implementation of OpenGL contexts
+///
+////////////////////////////////////////////////////////////
+class GlxContext : public GlContext
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create a new default context
+ ///
+ /// \param shared Context to share the new one with (can be NULL)
+ ///
+ ////////////////////////////////////////////////////////////
+ GlxContext(GlxContext* shared);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create a new context attached to a window
+ ///
+ /// \param shared Context to share the new one with
+ /// \param settings Creation parameters
+ /// \param owner Pointer to the owner window
+ /// \param bitsPerPixel Pixel depth, in bits per pixel
+ ///
+ ////////////////////////////////////////////////////////////
+ GlxContext(GlxContext* shared, const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create a new context that embeds its own rendering target
+ ///
+ /// \param shared Context to share the new one with
+ /// \param settings Creation parameters
+ /// \param width Back buffer width, in pixels
+ /// \param height Back buffer height, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ GlxContext(GlxContext* shared, const ContextSettings& settings, unsigned int width, unsigned int height);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~GlxContext();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Activate the context as the current target for rendering
+ ///
+ /// \return True on success, false if any error happened
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool makeCurrent();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Display what has been rendered to the context so far
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void display();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Enable or disable vertical synchronization
+ ///
+ /// Activating vertical synchronization will limit the number
+ /// of frames displayed to the refresh rate of the monitor.
+ /// This can avoid some visual artifacts, and limit the framerate
+ /// to a good value (but not constant across different computers).
+ ///
+ /// \param enabled True to enable v-sync, false to deactivate
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setVerticalSyncEnabled(bool enabled);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Select the best GLX visual for a given set of settings
+ ///
+ /// \param display X display
+ /// \param bitsPerPixel Pixel depth, in bits per pixel
+ /// \param settings Requested context settings
+ ///
+ /// \return The best visual
+ ///
+ ////////////////////////////////////////////////////////////
+ static XVisualInfo selectBestVisual(::Display* display, unsigned int bitsPerPixel, const ContextSettings& settings);
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create the context
+ ///
+ /// \param shared Context to share the new one with (can be NULL)
+ /// \param bitsPerPixel Pixel depth, in bits per pixel
+ /// \param settings Creation parameters
+ ///
+ ////////////////////////////////////////////////////////////
+ void createContext(GlxContext* shared, unsigned int bitsPerPixel, const ContextSettings& settings);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ ::Display* m_display; ///< Connection to the X server
+ ::Window m_window; ///< Window to which the context is attached
+ GLXContext m_context; ///< OpenGL context
+ bool m_ownsWindow; ///< Do we own the window associated to the context?
+};
+
+} // namespace priv
+
+} // namespace sf
+
+#endif // SFML_GLXCONTEXT_HPP
diff --git a/src/SFML/Window/Linux/InputImpl.cpp b/src/SFML/Window/Unix/InputImpl.cpp
index a9362ff..8ff7697 100644
--- a/src/SFML/Window/Linux/InputImpl.cpp
+++ b/src/SFML/Window/Unix/InputImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -25,9 +25,9 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include <SFML/Window/Linux/InputImpl.hpp>
+#include <SFML/Window/Unix/InputImpl.hpp>
#include <SFML/Window/Window.hpp>
-#include <SFML/Window/Linux/Display.hpp>
+#include <SFML/Window/Unix/Display.hpp>
#include <X11/Xlib.h>
#include <X11/keysym.h>
@@ -175,6 +175,13 @@ bool InputImpl::isKeyPressed(Keyboard::Key key)
////////////////////////////////////////////////////////////
+void InputImpl::setVirtualKeyboardVisible(bool visible)
+{
+ // Not applicable
+}
+
+
+////////////////////////////////////////////////////////////
bool InputImpl::isMouseButtonPressed(Mouse::Button button)
{
// Open a connection with the X server
@@ -288,6 +295,30 @@ void InputImpl::setMousePosition(const Vector2i& position, const Window& relativ
CloseDisplay(display);
}
+
+////////////////////////////////////////////////////////////
+bool InputImpl::isTouchDown(unsigned int /*finger*/)
+{
+ // Not applicable
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i InputImpl::getTouchPosition(unsigned int /*finger*/)
+{
+ // Not applicable
+ return Vector2i();
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i InputImpl::getTouchPosition(unsigned int /*finger*/, const Window& /*relativeTo*/)
+{
+ // Not applicable
+ return Vector2i();
+}
+
} // namespace priv
} // namespace sf
diff --git a/src/SFML/Window/Linux/InputImpl.hpp b/src/SFML/Window/Unix/InputImpl.hpp
index 22ba5fd..32c8f21 100644
--- a/src/SFML/Window/Linux/InputImpl.hpp
+++ b/src/SFML/Window/Unix/InputImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -42,7 +42,7 @@ namespace priv
////////////////////////////////////////////////////////////
class InputImpl
{
-public :
+public:
////////////////////////////////////////////////////////////
/// \brief Check if a key is pressed
@@ -55,6 +55,14 @@ public :
static bool isKeyPressed(Keyboard::Key key);
////////////////////////////////////////////////////////////
+ /// \brief Show or hide the virtual keyboard
+ ///
+ /// \param visible True to show, false to hide
+ ///
+ ////////////////////////////////////////////////////////////
+ static void setVirtualKeyboardVisible(bool visible);
+
+ ////////////////////////////////////////////////////////////
/// \brief Check if a mouse button is pressed
///
/// \param button Button to check
@@ -113,6 +121,43 @@ public :
///
////////////////////////////////////////////////////////////
static void setMousePosition(const Vector2i& position, const Window& relativeTo);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a touch event is currently down
+ ///
+ /// \param finger Finger index
+ ///
+ /// \return True if \a finger is currently touching the screen, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isTouchDown(unsigned int finger);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current position of a touch in desktop coordinates
+ ///
+ /// This function returns the current touch position
+ /// in global (desktop) coordinates.
+ ///
+ /// \param finger Finger index
+ ///
+ /// \return Current position of \a finger, or undefined if it's not down
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector2i getTouchPosition(unsigned int finger);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current position of a touch in window coordinates
+ ///
+ /// This function returns the current touch position
+ /// in global (desktop) coordinates.
+ ///
+ /// \param finger Finger index
+ /// \param relativeTo Reference window
+ ///
+ /// \return Current position of \a finger, or undefined if it's not down
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector2i getTouchPosition(unsigned int finger, const Window& relativeTo);
};
} // namespace priv
diff --git a/src/SFML/Window/Unix/JoystickImpl.cpp b/src/SFML/Window/Unix/JoystickImpl.cpp
new file mode 100644
index 0000000..0b8d479
--- /dev/null
+++ b/src/SFML/Window/Unix/JoystickImpl.cpp
@@ -0,0 +1,388 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/JoystickImpl.hpp>
+#include <SFML/System/Err.hpp>
+#include <sys/inotify.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <libudev.h>
+#include <unistd.h>
+#include <cstdio>
+#include <cstdlib>
+#include <sstream>
+
+namespace
+{
+ int notifyFd = -1;
+ int inputFd = -1;
+ bool plugged[sf::Joystick::Count];
+
+ void updatePluggedList()
+ {
+ udev* udevContext = udev_new();
+
+ for (unsigned int i = 0; i < sf::Joystick::Count; ++i)
+ {
+ std::ostringstream name;
+ name << "js" << i;
+ std::string nameString = name.str();
+
+ int file = ::open(("/dev/input/" + nameString).c_str(), O_RDONLY);
+
+ if (file < 0)
+ {
+ plugged[i] = false;
+ continue;
+ }
+
+ ::close(file);
+
+ // Check if the device is really a joystick or an
+ // accelerometer by inspecting whether
+ // ID_INPUT_ACCELEROMETER is present
+ if (!udevContext)
+ {
+ // Go safe and assume it is if udev isn't available
+ plugged[i] = true;
+ continue;
+ }
+
+ udev_device* udevDevice = udev_device_new_from_subsystem_sysname(udevContext, "input", nameString.c_str());
+
+ if (!udevDevice)
+ {
+ // Go safe and assume it is if we can't get the device
+ plugged[i] = true;
+ continue;
+ }
+
+ if (udev_device_get_property_value(udevDevice, "ID_INPUT_ACCELEROMETER"))
+ {
+ // This device is an accelerometer
+ plugged[i] = false;
+ }
+ else
+ {
+ // This device is not an accelerometer
+ // Assume it's a joystick
+ plugged[i] = true;
+ }
+
+ udev_device_unref(udevDevice);
+ }
+
+ if (udevContext)
+ udev_unref(udevContext);
+ }
+
+ bool hasInotifyEvent()
+ {
+ fd_set descriptorSet;
+ FD_ZERO(&descriptorSet);
+ FD_SET(notifyFd, &descriptorSet);
+ timeval timeout = {0, 0};
+
+ return (select(notifyFd + 1, &descriptorSet, NULL, NULL, &timeout) > 0) &&
+ FD_ISSET(notifyFd, &descriptorSet);
+ }
+
+ // Get the joystick name
+ std::string getJoystickName(int file, unsigned int index)
+ {
+ // Get the name
+ char name[128];
+
+ if (ioctl(file, JSIOCGNAME(sizeof(name)), name) >= 0)
+ return std::string(name);
+
+ sf::err() << "Unable to get name for joystick at index " << index << std::endl;
+
+ return std::string("Unknown Joystick");
+ }
+
+ // Get a system attribute from a udev device as an unsigned int
+ unsigned int getUdevAttributeUint(udev_device* device, unsigned int index, const std::string& attributeName)
+ {
+ udev_device* udevDeviceParent = udev_device_get_parent_with_subsystem_devtype(device, "usb", "usb_device");
+
+ if (!udevDeviceParent)
+ {
+ sf::err() << "Unable to get joystick attribute. "
+ << "Could not find parent USB device for joystick at index " << index << "." << std::endl;
+ return 0;
+ }
+
+ const char* attributeString = udev_device_get_sysattr_value(udevDeviceParent, attributeName.c_str());
+
+ if (!attributeString)
+ {
+ sf::err() << "Unable to get joystick attribute '" << attributeName << "'. "
+ << "Attribute does not exist for joystick at index " << index << "." << std::endl;
+ return 0;
+ }
+
+ return static_cast<unsigned int>(std::strtoul(attributeString, NULL, 16));
+ }
+
+ // Get a system attribute for a joystick at index as an unsigned int
+ unsigned int getAttributeUint(unsigned int index, const std::string& attributeName)
+ {
+ udev* udevContext = udev_new();
+
+ if (!udevContext)
+ {
+ sf::err() << "Unable to get joystick attribute. "
+ << "Could not create udev context." << std::endl;
+ return 0;
+ }
+
+ std::ostringstream sysname("js");
+ sysname << index;
+
+ udev_device* udevDevice = udev_device_new_from_subsystem_sysname(udevContext, "input", sysname.str().c_str());
+
+ if (!udevDevice)
+ {
+ sf::err() << "Unable to get joystick attribute. "
+ << "Could not find USB device for joystick at index " << index << "." << std::endl;
+ udev_unref(udevContext);
+ return 0;
+ }
+
+ unsigned int attribute = getUdevAttributeUint(udevDevice, index, attributeName);
+
+ udev_device_unref(udevDevice);
+ udev_unref(udevContext);
+ return attribute;
+ }
+}
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+void JoystickImpl::initialize()
+{
+ // Reset the array of plugged joysticks
+ std::fill(plugged, plugged + Joystick::Count, false);
+
+ // Do an initial scan
+ updatePluggedList();
+
+ // Create the inotify instance
+ notifyFd = inotify_init();
+ if (notifyFd < 0)
+ {
+ err() << "Failed to initialize inotify, joystick connections and disconnections won't be notified" << std::endl;
+ return;
+ }
+
+ // Watch nodes created and deleted in the /dev/input directory
+ inputFd = inotify_add_watch(notifyFd, "/dev/input", IN_CREATE | IN_DELETE);
+ if (inputFd < 0)
+ {
+ err() << "Failed to initialize inotify, joystick connections and disconnections won't be notified" << std::endl;
+
+ // No need to hang on to the inotify handle in this case
+ ::close(notifyFd);
+ notifyFd = -1;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void JoystickImpl::cleanup()
+{
+ // Stop watching the /dev/input directory
+ if (inputFd >= 0)
+ inotify_rm_watch(notifyFd, inputFd);
+
+ // Close the inotify file descriptor
+ if (notifyFd >= 0)
+ ::close(notifyFd);
+}
+
+
+////////////////////////////////////////////////////////////
+bool JoystickImpl::isConnected(unsigned int index)
+{
+ // See if we can skip scanning if inotify is available
+ if (notifyFd < 0)
+ {
+ // inotify is not available, perform a scan every query
+ updatePluggedList();
+ }
+ else if (hasInotifyEvent())
+ {
+ // Check if new joysticks were added/removed since last update
+ // Don't bother decomposing and interpreting the filename, just do a full scan
+ updatePluggedList();
+
+ // Flush all the pending events
+ if (lseek(notifyFd, 0, SEEK_END) < 0)
+ err() << "Failed to flush inotify of all pending joystick events." << std::endl;
+ }
+
+ // Then check if the joystick is connected
+ return plugged[index];
+}
+
+////////////////////////////////////////////////////////////
+bool JoystickImpl::open(unsigned int index)
+{
+ if (plugged[index])
+ {
+ std::ostringstream name;
+ name << "/dev/input/js" << index;
+
+ // Open the joystick's file descriptor (read-only and non-blocking)
+ m_file = ::open(name.str().c_str(), O_RDONLY | O_NONBLOCK);
+ if (m_file >= 0)
+ {
+ // Retrieve the axes mapping
+ ioctl(m_file, JSIOCGAXMAP, m_mapping);
+
+ // Get info
+ m_identification.name = getJoystickName(m_file, index);
+ m_identification.vendorId = getAttributeUint(index, "idVendor");
+ m_identification.productId = getAttributeUint(index, "idProduct");
+
+ // Reset the joystick state
+ m_state = JoystickState();
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+void JoystickImpl::close()
+{
+ ::close(m_file);
+}
+
+
+////////////////////////////////////////////////////////////
+JoystickCaps JoystickImpl::getCapabilities() const
+{
+ JoystickCaps caps;
+
+ // Get the number of buttons
+ char buttonCount;
+ ioctl(m_file, JSIOCGBUTTONS, &buttonCount);
+ caps.buttonCount = buttonCount;
+ if (caps.buttonCount > Joystick::ButtonCount)
+ caps.buttonCount = Joystick::ButtonCount;
+
+ // Get the supported axes
+ char axesCount;
+ ioctl(m_file, JSIOCGAXES, &axesCount);
+ for (int i = 0; i < axesCount; ++i)
+ {
+ switch (m_mapping[i])
+ {
+ case ABS_X: caps.axes[Joystick::X] = true; break;
+ case ABS_Y: caps.axes[Joystick::Y] = true; break;
+ case ABS_Z:
+ case ABS_THROTTLE: caps.axes[Joystick::Z] = true; break;
+ case ABS_RZ:
+ case ABS_RUDDER: caps.axes[Joystick::R] = true; break;
+ case ABS_RX: caps.axes[Joystick::U] = true; break;
+ case ABS_RY: caps.axes[Joystick::V] = true; break;
+ case ABS_HAT0X: caps.axes[Joystick::PovX] = true; break;
+ case ABS_HAT0Y: caps.axes[Joystick::PovY] = true; break;
+ default: break;
+ }
+ }
+
+ return caps;
+}
+
+
+////////////////////////////////////////////////////////////
+Joystick::Identification JoystickImpl::getIdentification() const
+{
+ return m_identification;
+}
+
+
+////////////////////////////////////////////////////////////
+JoystickState JoystickImpl::JoystickImpl::update()
+{
+ // pop events from the joystick file
+ js_event joyState;
+ while (read(m_file, &joyState, sizeof(joyState)) > 0)
+ {
+ switch (joyState.type & ~JS_EVENT_INIT)
+ {
+ // An axis was moved
+ case JS_EVENT_AXIS:
+ {
+ float value = joyState.value * 100.f / 32767.f;
+ switch (m_mapping[joyState.number])
+ {
+ case ABS_X: m_state.axes[Joystick::X] = value; break;
+ case ABS_Y: m_state.axes[Joystick::Y] = value; break;
+ case ABS_Z:
+ case ABS_THROTTLE: m_state.axes[Joystick::Z] = value; break;
+ case ABS_RZ:
+ case ABS_RUDDER: m_state.axes[Joystick::R] = value; break;
+ case ABS_RX: m_state.axes[Joystick::U] = value; break;
+ case ABS_RY: m_state.axes[Joystick::V] = value; break;
+ case ABS_HAT0X: m_state.axes[Joystick::PovX] = value; break;
+ case ABS_HAT0Y: m_state.axes[Joystick::PovY] = value; break;
+ default: break;
+ }
+ break;
+ }
+
+ // A button was pressed
+ case JS_EVENT_BUTTON:
+ {
+ if (joyState.number < Joystick::ButtonCount)
+ m_state.buttons[joyState.number] = (joyState.value != 0);
+ break;
+ }
+ }
+ }
+
+ // Check the connection state of the joystick (read() fails with an error != EGAIN if it's no longer connected)
+ m_state.connected = (errno == EAGAIN);
+
+ return m_state;
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/Unix/JoystickImpl.hpp b/src/SFML/Window/Unix/JoystickImpl.hpp
new file mode 100644
index 0000000..50777ef
--- /dev/null
+++ b/src/SFML/Window/Unix/JoystickImpl.hpp
@@ -0,0 +1,126 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_JOYSTICKIMPLLINUX_HPP
+#define SFML_JOYSTICKIMPLLINUX_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <linux/joystick.h>
+#include <fcntl.h>
+#include <string>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Linux implementation of joysticks
+///
+////////////////////////////////////////////////////////////
+class JoystickImpl
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global initialization of the joystick module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void initialize();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global cleanup of the joystick module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void cleanup();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a joystick is currently connected
+ ///
+ /// \param index Index of the joystick to check
+ ///
+ /// \return True if the joystick is connected, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isConnected(unsigned int index);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open the joystick
+ ///
+ /// \param index Index assigned to the joystick
+ ///
+ /// \return True on success, false on failure
+ ///
+ ////////////////////////////////////////////////////////////
+ bool open(unsigned int index);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Close the joystick
+ ///
+ ////////////////////////////////////////////////////////////
+ void close();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the joystick capabilities
+ ///
+ /// \return Joystick capabilities
+ ///
+ ////////////////////////////////////////////////////////////
+ JoystickCaps getCapabilities() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the joystick identification
+ ///
+ /// \return Joystick identification
+ ///
+ ////////////////////////////////////////////////////////////
+ Joystick::Identification getIdentification() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Update the joystick and get its new state
+ ///
+ /// \return Joystick state
+ ///
+ ////////////////////////////////////////////////////////////
+ JoystickState update();
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ int m_file; ///< File descriptor of the joystick
+ char m_mapping[ABS_MAX + 1]; ///< Axes mapping (index to axis id)
+ JoystickState m_state; ///< Current state of the joystick
+ sf::Joystick::Identification m_identification; ///< Identification of the joystick
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_JOYSTICKIMPLLINUX_HPP
diff --git a/src/SFML/Window/Unix/SensorImpl.cpp b/src/SFML/Window/Unix/SensorImpl.cpp
new file mode 100644
index 0000000..be5e439
--- /dev/null
+++ b/src/SFML/Window/Unix/SensorImpl.cpp
@@ -0,0 +1,88 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/SensorImpl.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+void SensorImpl::initialize()
+{
+ // To be implemented
+}
+
+
+////////////////////////////////////////////////////////////
+void SensorImpl::cleanup()
+{
+ // To be implemented
+}
+
+
+////////////////////////////////////////////////////////////
+bool SensorImpl::isAvailable(Sensor::Type /*sensor*/)
+{
+ // To be implemented
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SensorImpl::open(Sensor::Type /*sensor*/)
+{
+ // To be implemented
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+void SensorImpl::close()
+{
+ // To be implemented
+}
+
+
+////////////////////////////////////////////////////////////
+Vector3f SensorImpl::update()
+{
+ // To be implemented
+ return Vector3f(0, 0, 0);
+}
+
+
+////////////////////////////////////////////////////////////
+void SensorImpl::setEnabled(bool /*enabled*/)
+{
+ // To be implemented
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/Unix/SensorImpl.hpp b/src/SFML/Window/Unix/SensorImpl.hpp
new file mode 100644
index 0000000..bbd705b
--- /dev/null
+++ b/src/SFML/Window/Unix/SensorImpl.hpp
@@ -0,0 +1,101 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SENSORIMPLUNIX_HPP
+#define SFML_SENSORIMPLUNIX_HPP
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Unix implementation of sensors
+///
+////////////////////////////////////////////////////////////
+class SensorImpl
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global initialization of the sensor module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void initialize();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global cleanup of the sensor module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void cleanup();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a sensor is available
+ ///
+ /// \param sensor Sensor to check
+ ///
+ /// \return True if the sensor is available, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isAvailable(Sensor::Type sensor);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open the sensor
+ ///
+ /// \param sensor Type of the sensor
+ ///
+ /// \return True on success, false on failure
+ ///
+ ////////////////////////////////////////////////////////////
+ bool open(Sensor::Type sensor);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Close the sensor
+ ///
+ ////////////////////////////////////////////////////////////
+ void close();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Update the sensor and get its new value
+ ///
+ /// \return Sensor value
+ ///
+ ////////////////////////////////////////////////////////////
+ Vector3f update();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Enable or disable the sensor
+ ///
+ /// \param enabled True to enable, false to disable
+ ///
+ ////////////////////////////////////////////////////////////
+ void setEnabled(bool enabled);
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_SENSORIMPLUNIX_HPP
diff --git a/src/SFML/Window/Linux/VideoModeImpl.cpp b/src/SFML/Window/Unix/VideoModeImpl.cpp
index c669a13..c7e6204 100644
--- a/src/SFML/Window/Linux/VideoModeImpl.cpp
+++ b/src/SFML/Window/Unix/VideoModeImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -26,7 +26,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window/VideoModeImpl.hpp>
-#include <SFML/Window/Linux/Display.hpp>
+#include <SFML/Window/Unix/Display.hpp>
#include <SFML/System/Err.hpp>
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
@@ -74,7 +74,7 @@ std::vector<VideoMode> VideoModeImpl::getFullscreenModes()
{
// Convert to VideoMode
VideoMode mode(sizes[j].width, sizes[j].height, depths[i]);
-
+
// Add it only if it is not already in the array
if (std::find(modes.begin(), modes.end(), mode) == modes.end())
modes.push_back(mode);
@@ -97,7 +97,7 @@ std::vector<VideoMode> VideoModeImpl::getFullscreenModes()
}
else
{
- // XRandr extension is not supported : we cannot get the video modes
+ // XRandr extension is not supported: we cannot get the video modes
err() << "Failed to use the XRandR extension while trying to get the supported video modes" << std::endl;
}
@@ -155,7 +155,7 @@ VideoMode VideoModeImpl::getDesktopMode()
}
else
{
- // XRandr extension is not supported : we cannot get the video modes
+ // XRandr extension is not supported: we cannot get the video modes
err() << "Failed to use the XRandR extension while trying to get the desktop video modes" << std::endl;
}
diff --git a/src/SFML/Window/Linux/WindowImplX11.cpp b/src/SFML/Window/Unix/WindowImplX11.cpp
index 1b71210..9e29757 100644
--- a/src/SFML/Window/Linux/WindowImplX11.cpp
+++ b/src/SFML/Window/Unix/WindowImplX11.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -26,31 +26,40 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window/WindowStyle.hpp> // important to be included first (conflict with None)
-#include <SFML/Window/Linux/WindowImplX11.hpp>
-#include <SFML/Window/Linux/GlxContext.hpp>
-#include <SFML/Window/Linux/Display.hpp>
+#include <SFML/Window/Unix/WindowImplX11.hpp>
+#include <SFML/Window/Unix/Display.hpp>
#include <SFML/System/Utf.hpp>
#include <SFML/System/Err.hpp>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <X11/extensions/Xrandr.h>
+#include <libgen.h>
#include <unistd.h>
#include <cstring>
#include <sstream>
#include <vector>
#include <string>
#include <iterator>
+#include <algorithm>
+#ifdef SFML_OPENGL_ES
+ #include <SFML/Window/EglContext.hpp>
+ typedef sf::priv::EglContext ContextType;
+#else
+ #include <SFML/Window/Unix/GlxContext.hpp>
+ typedef sf::priv::GlxContext ContextType;
+#endif
////////////////////////////////////////////////////////////
// Private data
////////////////////////////////////////////////////////////
namespace
{
- sf::priv::WindowImplX11* fullscreenWindow = NULL;
- unsigned long eventMask = FocusChangeMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask |
- PointerMotionMask | KeyPressMask | KeyReleaseMask | StructureNotifyMask |
- EnterWindowMask | LeaveWindowMask;
+ sf::priv::WindowImplX11* fullscreenWindow = NULL;
+ std::vector<sf::priv::WindowImplX11*> allWindows;
+ unsigned long eventMask = FocusChangeMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask |
+ PointerMotionMask | KeyPressMask | KeyReleaseMask | StructureNotifyMask |
+ EnterWindowMask | LeaveWindowMask;
// Filter the events received by windows (only allow those matching a specific window)
Bool checkEvent(::Display*, XEvent* event, XPointer userData)
@@ -90,7 +99,8 @@ m_atomClose (0),
m_oldVideoMode(-1),
m_hiddenCursor(0),
m_keyRepeat (true),
-m_previousSize(-1, -1)
+m_previousSize(-1, -1),
+m_useSizeHints(false)
{
// Open a connection with the X server
m_display = OpenDisplay();
@@ -101,7 +111,7 @@ m_previousSize(-1, -1)
if (m_window)
{
- // Make sure the window is listening to all the requiered events
+ // Make sure the window is listening to all the required events
XSelectInput(m_display, m_window, eventMask & ~ButtonPressMask);
// Do some common initializations
@@ -120,7 +130,8 @@ m_atomClose (0),
m_oldVideoMode(-1),
m_hiddenCursor(0),
m_keyRepeat (true),
-m_previousSize(-1, -1)
+m_previousSize(-1, -1),
+m_useSizeHints(false)
{
// Open a connection with the X server
m_display = OpenDisplay();
@@ -148,7 +159,7 @@ m_previousSize(-1, -1)
switchToFullscreen(mode);
// Choose the visual according to the context settings
- XVisualInfo visualInfo = GlxContext::selectBestVisual(m_display, mode.bitsPerPixel, settings);
+ XVisualInfo visualInfo = ContextType::selectBestVisual(m_display, mode.bitsPerPixel, settings);
// Define the window attributes
XSetWindowAttributes attributes;
@@ -183,7 +194,7 @@ m_previousSize(-1, -1)
{
static const unsigned long MWM_HINTS_FUNCTIONS = 1 << 0;
static const unsigned long MWM_HINTS_DECORATIONS = 1 << 1;
-
+
//static const unsigned long MWM_DECOR_ALL = 1 << 0;
static const unsigned long MWM_DECOR_BORDER = 1 << 1;
static const unsigned long MWM_DECOR_RESIZEH = 1 << 2;
@@ -198,7 +209,7 @@ m_previousSize(-1, -1)
static const unsigned long MWM_FUNC_MINIMIZE = 1 << 3;
static const unsigned long MWM_FUNC_MAXIMIZE = 1 << 4;
static const unsigned long MWM_FUNC_CLOSE = 1 << 5;
-
+
struct WMHints
{
unsigned long flags;
@@ -207,7 +218,7 @@ m_previousSize(-1, -1)
long inputMode;
unsigned long state;
};
-
+
WMHints hints;
hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS;
hints.decorations = 0;
@@ -236,15 +247,16 @@ m_previousSize(-1, -1)
// This is a hack to force some windows managers to disable resizing
if (!(style & Style::Resize))
{
+ m_useSizeHints = true;
XSizeHints* sizeHints = XAllocSizeHints();
sizeHints->flags = PMinSize | PMaxSize;
- sizeHints->min_width = sizeHints->max_width = width;
+ sizeHints->min_width = sizeHints->max_width = width;
sizeHints->min_height = sizeHints->max_height = height;
- XSetWMNormalHints(m_display, m_window, sizeHints);
+ XSetWMNormalHints(m_display, m_window, sizeHints);
XFree(sizeHints);
}
}
-
+
// Set the window's WM class (this can be used by window managers)
char windowClass[512];
findExecutableName(windowClass, sizeof(windowClass));
@@ -293,6 +305,9 @@ WindowImplX11::~WindowImplX11()
// Close the connection with the X server
CloseDisplay(m_display);
+
+ // Remove this window from the global list of windows (required for focus request)
+ allWindows.erase(std::find(allWindows.begin(), allWindows.end(), this));
}
@@ -348,6 +363,17 @@ Vector2u WindowImplX11::getSize() const
////////////////////////////////////////////////////////////
void WindowImplX11::setSize(const Vector2u& size)
{
+ // If we used size hint to fix the size of the window, we must update them
+ if (m_useSizeHints)
+ {
+ XSizeHints* sizeHints = XAllocSizeHints();
+ sizeHints->flags = PMinSize | PMaxSize;
+ sizeHints->min_width = sizeHints->max_width = size.x;
+ sizeHints->min_height = sizeHints->max_height = size.y;
+ XSetWMNormalHints(m_display, m_window, sizeHints);
+ XFree(sizeHints);
+ }
+
XResizeWindow(m_display, m_window, size.x, size.y);
XFlush(m_display);
}
@@ -357,18 +383,18 @@ void WindowImplX11::setSize(const Vector2u& size)
void WindowImplX11::setTitle(const String& title)
{
// Bare X11 has no Unicode window title support.
- // There is however an option to tell the window manager your unicode title via hints.
-
+ // There is however an option to tell the window manager your Unicode title via hints.
+
// Convert to UTF-8 encoding.
std::basic_string<Uint8> utf8Title;
Utf32::toUtf8(title.begin(), title.end(), std::back_inserter(utf8Title));
-
+
// Set the _NET_WM_NAME atom, which specifies a UTF-8 encoded window title.
Atom wmName = XInternAtom(m_display, "_NET_WM_NAME", False);
Atom useUtf8 = XInternAtom(m_display, "UTF8_STRING", False);
XChangeProperty(m_display, m_window, wmName, useUtf8, 8,
PropModeReplace, utf8Title.c_str(), utf8Title.size());
-
+
// Set the non-Unicode title as a fallback for window managers who don't support _NET_WM_NAME.
XStoreName(m_display, m_window, title.toAnsiString().c_str());
}
@@ -377,7 +403,7 @@ void WindowImplX11::setTitle(const String& title)
////////////////////////////////////////////////////////////
void WindowImplX11::setIcon(unsigned int width, unsigned int height, const Uint8* pixels)
{
- // X11 wants BGRA pixels : swap red and blue channels
+ // X11 wants BGRA pixels: swap red and blue channels
// Note: this memory will be freed by XDestroyImage
Uint8* iconPixels = static_cast<Uint8*>(std::malloc(width * height * 4));
for (std::size_t i = 0; i < width * height; ++i)
@@ -416,7 +442,7 @@ void WindowImplX11::setIcon(unsigned int width, unsigned int height, const Uint8
if (i * 8 + k < width)
{
Uint8 opacity = (pixels[(i * 8 + k + j * width) * 4 + 3] > 0) ? 1 : 0;
- maskPixels[i + j * pitch] |= (opacity << k);
+ maskPixels[i + j * pitch] |= (opacity << k);
}
}
}
@@ -463,6 +489,67 @@ void WindowImplX11::setKeyRepeatEnabled(bool enabled)
////////////////////////////////////////////////////////////
+void WindowImplX11::requestFocus()
+{
+ // Focus is only stolen among SFML windows, not between applications
+ // Check the global list of windows to find out whether an SFML window has the focus
+ // Note: can't handle console and other non-SFML windows belonging to the application.
+ bool sfmlWindowFocused = false;
+ for (std::vector<WindowImplX11*>::iterator itr = allWindows.begin(); itr != allWindows.end(); ++itr)
+ {
+ if ((*itr)->hasFocus())
+ {
+ sfmlWindowFocused = true;
+ break;
+ }
+ }
+
+ // Check if window is viewable (not on other desktop, ...)
+ // TODO: Check also if minimized
+ XWindowAttributes attributes;
+ if (XGetWindowAttributes(m_display, m_window, &attributes) == 0)
+ {
+ sf::err() << "Failed to check if window is viewable while requesting focus" << std::endl;
+ return; // error getting attribute
+ }
+
+ bool windowViewable = (attributes.map_state == IsViewable);
+
+ if (sfmlWindowFocused && windowViewable)
+ {
+ // Another SFML window of this application has the focus and the current window is viewable:
+ // steal focus (i.e. bring window to the front and give it input focus)
+ XRaiseWindow(m_display, m_window);
+ XSetInputFocus(m_display, m_window, RevertToPointerRoot, CurrentTime);
+ }
+ else
+ {
+ // Otherwise: display urgency hint (flashing application logo)
+ // Ensure WM hints exist, allocate if necessary
+ XWMHints* hints = XGetWMHints(m_display, m_window);
+ if (hints == NULL)
+ hints = XAllocWMHints();
+
+ // Add urgency (notification) flag to hints
+ hints->flags |= XUrgencyHint;
+ XSetWMHints(m_display, m_window, hints);
+ XFree(hints);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+bool WindowImplX11::hasFocus() const
+{
+ ::Window focusedWindow = 0;
+ int revertToReturn = 0;
+ XGetInputFocus(m_display, &focusedWindow, &revertToReturn);
+
+ return m_window == focusedWindow;
+}
+
+
+////////////////////////////////////////////////////////////
void WindowImplX11::switchToFullscreen(const VideoMode& mode)
{
// Check if the XRandR extension is present
@@ -508,7 +595,7 @@ void WindowImplX11::switchToFullscreen(const VideoMode& mode)
}
else
{
- // XRandr extension is not supported : we cannot use fullscreen mode
+ // XRandr extension is not supported: we cannot use fullscreen mode
err() << "Fullscreen is not supported, switching to window mode" << std::endl;
}
}
@@ -542,11 +629,14 @@ void WindowImplX11::initialize()
XMapWindow(m_display, m_window);
XFlush(m_display);
- // Create the hiden cursor
+ // Create the hidden cursor
createHiddenCursor();
// Flush the commands queue
XFlush(m_display);
+
+ // Add this window to the global list of windows (required for focus request)
+ allWindows.push_back(this);
}
@@ -578,7 +668,7 @@ void WindowImplX11::cleanup()
{
// Get current screen info
XRRScreenConfiguration* config = XRRGetScreenInfo(m_display, RootWindow(m_display, m_screen));
- if (config)
+ if (config)
{
// Get the current rotation
Rotation currentRotation;
@@ -589,7 +679,7 @@ void WindowImplX11::cleanup()
// Free the configuration instance
XRRFreeScreenConfigInfo(config);
- }
+ }
// Reset the fullscreen window
fullscreenWindow = NULL;
@@ -642,15 +732,15 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
switch (windowEvent.type)
{
// Destroy event
- case DestroyNotify :
+ case DestroyNotify:
{
- // The window is about to be destroyed : we must cleanup resources
+ // The window is about to be destroyed: we must cleanup resources
cleanup();
break;
}
// Gain focus event
- case FocusIn :
+ case FocusIn:
{
// Update the input context
if (m_inputContext)
@@ -659,11 +749,21 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
Event event;
event.type = Event::GainedFocus;
pushEvent(event);
+
+ // If the window has been previously marked urgent (notification) as a result of a focus request, undo that
+ XWMHints* hints = XGetWMHints(m_display, m_window);
+ if (hints != NULL)
+ {
+ // Remove urgency (notification) flag from hints
+ hints->flags &= ~XUrgencyHint;
+ XSetWMHints(m_display, m_window, hints);
+ XFree(hints);
+ }
break;
}
// Lost focus event
- case FocusOut :
+ case FocusOut:
{
// Update the input context
if (m_inputContext)
@@ -676,9 +776,9 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
}
// Resize event
- case ConfigureNotify :
+ case ConfigureNotify:
{
- // ConfigureNotify can be triggered for other reasons, check if the size has acutally changed
+ // ConfigureNotify can be triggered for other reasons, check if the size has actually changed
if ((windowEvent.xconfigure.width != m_previousSize.x) || (windowEvent.xconfigure.height != m_previousSize.y))
{
Event event;
@@ -694,9 +794,9 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
}
// Close event
- case ClientMessage :
+ case ClientMessage:
{
- if ((windowEvent.xclient.format == 32) && (windowEvent.xclient.data.l[0]) == static_cast<long>(m_atomClose))
+ if ((windowEvent.xclient.format == 32) && (windowEvent.xclient.data.l[0]) == static_cast<long>(m_atomClose))
{
Event event;
event.type = Event::Closed;
@@ -706,7 +806,7 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
}
// Key down event
- case KeyPress :
+ case KeyPress:
{
// Get the keysym of the key that has been pressed
static XComposeStatus keyboard;
@@ -766,7 +866,7 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
}
// Key up event
- case KeyRelease :
+ case KeyRelease:
{
// Get the keysym of the key that has been pressed
char buffer[32];
@@ -787,7 +887,7 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
}
// Mouse button pressed
- case ButtonPress :
+ case ButtonPress:
{
unsigned int button = windowEvent.xbutton.button;
if ((button == Button1) || (button == Button2) || (button == Button3) || (button == 8) || (button == 9))
@@ -798,11 +898,11 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
event.mouseButton.y = windowEvent.xbutton.y;
switch (button)
{
- case Button1 : event.mouseButton.button = Mouse::Left; break;
- case Button2 : event.mouseButton.button = Mouse::Middle; break;
- case Button3 : event.mouseButton.button = Mouse::Right; break;
- case 8 : event.mouseButton.button = Mouse::XButton1; break;
- case 9 : event.mouseButton.button = Mouse::XButton2; break;
+ case Button1: event.mouseButton.button = Mouse::Left; break;
+ case Button2: event.mouseButton.button = Mouse::Middle; break;
+ case Button3: event.mouseButton.button = Mouse::Right; break;
+ case 8: event.mouseButton.button = Mouse::XButton1; break;
+ case 9: event.mouseButton.button = Mouse::XButton2; break;
}
pushEvent(event);
}
@@ -810,7 +910,7 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
}
// Mouse button released
- case ButtonRelease :
+ case ButtonRelease:
{
unsigned int button = windowEvent.xbutton.button;
if ((button == Button1) || (button == Button2) || (button == Button3) || (button == 8) || (button == 9))
@@ -821,11 +921,11 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
event.mouseButton.y = windowEvent.xbutton.y;
switch (button)
{
- case Button1 : event.mouseButton.button = Mouse::Left; break;
- case Button2 : event.mouseButton.button = Mouse::Middle; break;
- case Button3 : event.mouseButton.button = Mouse::Right; break;
- case 8 : event.mouseButton.button = Mouse::XButton1; break;
- case 9 : event.mouseButton.button = Mouse::XButton2; break;
+ case Button1: event.mouseButton.button = Mouse::Left; break;
+ case Button2: event.mouseButton.button = Mouse::Middle; break;
+ case Button3: event.mouseButton.button = Mouse::Right; break;
+ case 8: event.mouseButton.button = Mouse::XButton1; break;
+ case 9: event.mouseButton.button = Mouse::XButton2; break;
}
pushEvent(event);
}
@@ -842,7 +942,7 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
}
// Mouse moved
- case MotionNotify :
+ case MotionNotify:
{
Event event;
event.type = Event::MouseMoved;
@@ -853,7 +953,7 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
}
// Mouse entered
- case EnterNotify :
+ case EnterNotify:
{
if (windowEvent.xcrossing.mode == NotifyNormal)
{
@@ -865,7 +965,7 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
}
// Mouse left
- case LeaveNotify :
+ case LeaveNotify:
{
if (windowEvent.xcrossing.mode == NotifyNormal)
{
@@ -875,6 +975,13 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
}
break;
}
+
+ // Parent window changed
+ case ReparentNotify:
+ {
+ XSync(m_display, True); // Discard remaining events
+ break;
+ }
}
return true;
@@ -890,108 +997,108 @@ Keyboard::Key WindowImplX11::keysymToSF(KeySym symbol)
switch (key)
{
- case XK_Shift_L : return Keyboard::LShift;
- case XK_Shift_R : return Keyboard::RShift;
- case XK_Control_L : return Keyboard::LControl;
- case XK_Control_R : return Keyboard::RControl;
- case XK_Alt_L : return Keyboard::LAlt;
- case XK_Alt_R : return Keyboard::RAlt;
- case XK_Super_L : return Keyboard::LSystem;
- case XK_Super_R : return Keyboard::RSystem;
- case XK_Menu : return Keyboard::Menu;
- case XK_Escape : return Keyboard::Escape;
- case XK_semicolon : return Keyboard::SemiColon;
- case XK_slash : return Keyboard::Slash;
- case XK_equal : return Keyboard::Equal;
- case XK_minus : return Keyboard::Dash;
- case XK_bracketleft : return Keyboard::LBracket;
- case XK_bracketright : return Keyboard::RBracket;
- case XK_comma : return Keyboard::Comma;
- case XK_period : return Keyboard::Period;
- case XK_dead_acute : return Keyboard::Quote;
- case XK_backslash : return Keyboard::BackSlash;
- case XK_dead_grave : return Keyboard::Tilde;
- case XK_space : return Keyboard::Space;
- case XK_Return : return Keyboard::Return;
- case XK_KP_Enter : return Keyboard::Return;
- case XK_BackSpace : return Keyboard::BackSpace;
- case XK_Tab : return Keyboard::Tab;
- case XK_Prior : return Keyboard::PageUp;
- case XK_Next : return Keyboard::PageDown;
- case XK_End : return Keyboard::End;
- case XK_Home : return Keyboard::Home;
- case XK_Insert : return Keyboard::Insert;
- case XK_Delete : return Keyboard::Delete;
- case XK_KP_Add : return Keyboard::Add;
- case XK_KP_Subtract : return Keyboard::Subtract;
- case XK_KP_Multiply : return Keyboard::Multiply;
- case XK_KP_Divide : return Keyboard::Divide;
- case XK_Pause : return Keyboard::Pause;
- case XK_F1 : return Keyboard::F1;
- case XK_F2 : return Keyboard::F2;
- case XK_F3 : return Keyboard::F3;
- case XK_F4 : return Keyboard::F4;
- case XK_F5 : return Keyboard::F5;
- case XK_F6 : return Keyboard::F6;
- case XK_F7 : return Keyboard::F7;
- case XK_F8 : return Keyboard::F8;
- case XK_F9 : return Keyboard::F9;
- case XK_F10 : return Keyboard::F10;
- case XK_F11 : return Keyboard::F11;
- case XK_F12 : return Keyboard::F12;
- case XK_F13 : return Keyboard::F13;
- case XK_F14 : return Keyboard::F14;
- case XK_F15 : return Keyboard::F15;
- case XK_Left : return Keyboard::Left;
- case XK_Right : return Keyboard::Right;
- case XK_Up : return Keyboard::Up;
- case XK_Down : return Keyboard::Down;
- case XK_KP_0 : return Keyboard::Numpad0;
- case XK_KP_1 : return Keyboard::Numpad1;
- case XK_KP_2 : return Keyboard::Numpad2;
- case XK_KP_3 : return Keyboard::Numpad3;
- case XK_KP_4 : return Keyboard::Numpad4;
- case XK_KP_5 : return Keyboard::Numpad5;
- case XK_KP_6 : return Keyboard::Numpad6;
- case XK_KP_7 : return Keyboard::Numpad7;
- case XK_KP_8 : return Keyboard::Numpad8;
- case XK_KP_9 : return Keyboard::Numpad9;
- case XK_A : return Keyboard::A;
- case XK_Z : return Keyboard::Z;
- case XK_E : return Keyboard::E;
- case XK_R : return Keyboard::R;
- case XK_T : return Keyboard::T;
- case XK_Y : return Keyboard::Y;
- case XK_U : return Keyboard::U;
- case XK_I : return Keyboard::I;
- case XK_O : return Keyboard::O;
- case XK_P : return Keyboard::P;
- case XK_Q : return Keyboard::Q;
- case XK_S : return Keyboard::S;
- case XK_D : return Keyboard::D;
- case XK_F : return Keyboard::F;
- case XK_G : return Keyboard::G;
- case XK_H : return Keyboard::H;
- case XK_J : return Keyboard::J;
- case XK_K : return Keyboard::K;
- case XK_L : return Keyboard::L;
- case XK_M : return Keyboard::M;
- case XK_W : return Keyboard::W;
- case XK_X : return Keyboard::X;
- case XK_C : return Keyboard::C;
- case XK_V : return Keyboard::V;
- case XK_B : return Keyboard::B;
- case XK_N : return Keyboard::N;
- case XK_0 : return Keyboard::Num0;
- case XK_1 : return Keyboard::Num1;
- case XK_2 : return Keyboard::Num2;
- case XK_3 : return Keyboard::Num3;
- case XK_4 : return Keyboard::Num4;
- case XK_5 : return Keyboard::Num5;
- case XK_6 : return Keyboard::Num6;
- case XK_7 : return Keyboard::Num7;
- case XK_8 : return Keyboard::Num8;
- case XK_9 : return Keyboard::Num9;
+ case XK_Shift_L: return Keyboard::LShift;
+ case XK_Shift_R: return Keyboard::RShift;
+ case XK_Control_L: return Keyboard::LControl;
+ case XK_Control_R: return Keyboard::RControl;
+ case XK_Alt_L: return Keyboard::LAlt;
+ case XK_Alt_R: return Keyboard::RAlt;
+ case XK_Super_L: return Keyboard::LSystem;
+ case XK_Super_R: return Keyboard::RSystem;
+ case XK_Menu: return Keyboard::Menu;
+ case XK_Escape: return Keyboard::Escape;
+ case XK_semicolon: return Keyboard::SemiColon;
+ case XK_slash: return Keyboard::Slash;
+ case XK_equal: return Keyboard::Equal;
+ case XK_minus: return Keyboard::Dash;
+ case XK_bracketleft: return Keyboard::LBracket;
+ case XK_bracketright: return Keyboard::RBracket;
+ case XK_comma: return Keyboard::Comma;
+ case XK_period: return Keyboard::Period;
+ case XK_dead_acute: return Keyboard::Quote;
+ case XK_backslash: return Keyboard::BackSlash;
+ case XK_dead_grave: return Keyboard::Tilde;
+ case XK_space: return Keyboard::Space;
+ case XK_Return: return Keyboard::Return;
+ case XK_KP_Enter: return Keyboard::Return;
+ case XK_BackSpace: return Keyboard::BackSpace;
+ case XK_Tab: return Keyboard::Tab;
+ case XK_Prior: return Keyboard::PageUp;
+ case XK_Next: return Keyboard::PageDown;
+ case XK_End: return Keyboard::End;
+ case XK_Home: return Keyboard::Home;
+ case XK_Insert: return Keyboard::Insert;
+ case XK_Delete: return Keyboard::Delete;
+ case XK_KP_Add: return Keyboard::Add;
+ case XK_KP_Subtract: return Keyboard::Subtract;
+ case XK_KP_Multiply: return Keyboard::Multiply;
+ case XK_KP_Divide: return Keyboard::Divide;
+ case XK_Pause: return Keyboard::Pause;
+ case XK_F1: return Keyboard::F1;
+ case XK_F2: return Keyboard::F2;
+ case XK_F3: return Keyboard::F3;
+ case XK_F4: return Keyboard::F4;
+ case XK_F5: return Keyboard::F5;
+ case XK_F6: return Keyboard::F6;
+ case XK_F7: return Keyboard::F7;
+ case XK_F8: return Keyboard::F8;
+ case XK_F9: return Keyboard::F9;
+ case XK_F10: return Keyboard::F10;
+ case XK_F11: return Keyboard::F11;
+ case XK_F12: return Keyboard::F12;
+ case XK_F13: return Keyboard::F13;
+ case XK_F14: return Keyboard::F14;
+ case XK_F15: return Keyboard::F15;
+ case XK_Left: return Keyboard::Left;
+ case XK_Right: return Keyboard::Right;
+ case XK_Up: return Keyboard::Up;
+ case XK_Down: return Keyboard::Down;
+ case XK_KP_0: return Keyboard::Numpad0;
+ case XK_KP_1: return Keyboard::Numpad1;
+ case XK_KP_2: return Keyboard::Numpad2;
+ case XK_KP_3: return Keyboard::Numpad3;
+ case XK_KP_4: return Keyboard::Numpad4;
+ case XK_KP_5: return Keyboard::Numpad5;
+ case XK_KP_6: return Keyboard::Numpad6;
+ case XK_KP_7: return Keyboard::Numpad7;
+ case XK_KP_8: return Keyboard::Numpad8;
+ case XK_KP_9: return Keyboard::Numpad9;
+ case XK_A: return Keyboard::A;
+ case XK_Z: return Keyboard::Z;
+ case XK_E: return Keyboard::E;
+ case XK_R: return Keyboard::R;
+ case XK_T: return Keyboard::T;
+ case XK_Y: return Keyboard::Y;
+ case XK_U: return Keyboard::U;
+ case XK_I: return Keyboard::I;
+ case XK_O: return Keyboard::O;
+ case XK_P: return Keyboard::P;
+ case XK_Q: return Keyboard::Q;
+ case XK_S: return Keyboard::S;
+ case XK_D: return Keyboard::D;
+ case XK_F: return Keyboard::F;
+ case XK_G: return Keyboard::G;
+ case XK_H: return Keyboard::H;
+ case XK_J: return Keyboard::J;
+ case XK_K: return Keyboard::K;
+ case XK_L: return Keyboard::L;
+ case XK_M: return Keyboard::M;
+ case XK_W: return Keyboard::W;
+ case XK_X: return Keyboard::X;
+ case XK_C: return Keyboard::C;
+ case XK_V: return Keyboard::V;
+ case XK_B: return Keyboard::B;
+ case XK_N: return Keyboard::N;
+ case XK_0: return Keyboard::Num0;
+ case XK_1: return Keyboard::Num1;
+ case XK_2: return Keyboard::Num2;
+ case XK_3: return Keyboard::Num3;
+ case XK_4: return Keyboard::Num4;
+ case XK_5: return Keyboard::Num5;
+ case XK_6: return Keyboard::Num6;
+ case XK_7: return Keyboard::Num7;
+ case XK_8: return Keyboard::Num8;
+ case XK_9: return Keyboard::Num9;
}
return Keyboard::Unknown;
diff --git a/src/SFML/Window/Linux/WindowImplX11.hpp b/src/SFML/Window/Unix/WindowImplX11.hpp
index 613fa7b..d824492 100644
--- a/src/SFML/Window/Linux/WindowImplX11.hpp
+++ b/src/SFML/Window/Unix/WindowImplX11.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -45,7 +45,7 @@ namespace priv
////////////////////////////////////////////////////////////
class WindowImplX11 : public WindowImpl
{
-public :
+public:
////////////////////////////////////////////////////////////
/// \brief Construct the window implementation from an existing control
@@ -154,7 +154,22 @@ public :
////////////////////////////////////////////////////////////
virtual void setKeyRepeatEnabled(bool enabled);
-protected :
+ ////////////////////////////////////////////////////////////
+ /// \brief Request the current window to be made the active
+ /// foreground window
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void requestFocus();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check whether the window has the input focus
+ ///
+ /// \return True if window has focus, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool hasFocus() const;
+
+protected:
////////////////////////////////////////////////////////////
/// \brief Process incoming events from the operating system
@@ -162,7 +177,7 @@ protected :
////////////////////////////////////////////////////////////
virtual void processEvents();
-private :
+private:
////////////////////////////////////////////////////////////
/// \brief Switch to fullscreen mode
@@ -205,7 +220,7 @@ private :
///
/// \param symbol Key symbol to convert
///
- /// \return Corrsponding SFML key code
+ /// \return Corresponding SFML key code
///
////////////////////////////////////////////////////////////
static Keyboard::Key keysymToSF(KeySym symbol);
@@ -217,13 +232,14 @@ private :
::Display* m_display; ///< Pointer to the display
int m_screen; ///< Screen identifier
XIM m_inputMethod; ///< Input method linked to the X display
- XIC m_inputContext; ///< Input context used to get unicode input in our window
+ XIC m_inputContext; ///< Input context used to get Unicode input in our window
bool m_isExternal; ///< Tell whether the window has been created externally or by SFML
Atom m_atomClose; ///< Atom used to identify the close event
int m_oldVideoMode; ///< Video mode in use before we switch to fullscreen
- Cursor m_hiddenCursor; ///< As X11 doesn't provide cursor hidding, we must create a transparent one
- bool m_keyRepeat; ///< Is the KeyRepeat feature enabled ?
+ Cursor m_hiddenCursor; ///< As X11 doesn't provide cursor hiding, we must create a transparent one
+ bool m_keyRepeat; ///< Is the KeyRepeat feature enabled?
Vector2i m_previousSize; ///< Previous size of the window, to find if a ConfigureNotify event is a resize event (could be a move event only)
+ bool m_useSizeHints; ///< Is the size of the window fixed with size hints?
};
} // namespace priv
diff --git a/src/SFML/Window/VideoMode.cpp b/src/SFML/Window/VideoMode.cpp
index 1a4b141..2f8d802 100644
--- a/src/SFML/Window/VideoMode.cpp
+++ b/src/SFML/Window/VideoMode.cpp
@@ -1,146 +1,146 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Window/VideoMode.hpp>
-#include <SFML/Window/VideoModeImpl.hpp>
-#include <algorithm>
-#include <functional>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-VideoMode::VideoMode() :
-width (0),
-height (0),
-bitsPerPixel(0)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-VideoMode::VideoMode(unsigned int modeWidth, unsigned int modeHeight, unsigned int modeBitsPerPixel) :
-width (modeWidth),
-height (modeHeight),
-bitsPerPixel(modeBitsPerPixel)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-VideoMode VideoMode::getDesktopMode()
-{
- // Directly forward to the OS-specific implementation
- return priv::VideoModeImpl::getDesktopMode();
-}
-
-
-////////////////////////////////////////////////////////////
-const std::vector<VideoMode>& VideoMode::getFullscreenModes()
-{
- static std::vector<VideoMode> modes;
-
- // Populate the array on first call
- if (modes.empty())
- {
- modes = priv::VideoModeImpl::getFullscreenModes();
- std::sort(modes.begin(), modes.end(), std::greater<VideoMode>());
- }
-
- return modes;
-}
-
-
-////////////////////////////////////////////////////////////
-bool VideoMode::isValid() const
-{
- const std::vector<VideoMode>& modes = getFullscreenModes();
-
- return std::find(modes.begin(), modes.end(), *this) != modes.end();
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator ==(const VideoMode& left, const VideoMode& right)
-{
- return (left.width == right.width) &&
- (left.height == right.height) &&
- (left.bitsPerPixel == right.bitsPerPixel);
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator !=(const VideoMode& left, const VideoMode& right)
-{
- return !(left == right);
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator <(const VideoMode& left, const VideoMode& right)
-{
- if (left.bitsPerPixel == right.bitsPerPixel)
- {
- if (left.width == right.width)
- {
- return left.height < right.height;
- }
- else
- {
- return left.width < right.width;
- }
- }
- else
- {
- return left.bitsPerPixel < right.bitsPerPixel;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator >(const VideoMode& left, const VideoMode& right)
-{
- return right < left;
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator <=(const VideoMode& left, const VideoMode& right)
-{
- return !(right < left);
-}
-
-
-////////////////////////////////////////////////////////////
-bool operator >=(const VideoMode& left, const VideoMode& right)
-{
- return !(left < right);
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/VideoMode.hpp>
+#include <SFML/Window/VideoModeImpl.hpp>
+#include <algorithm>
+#include <functional>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+VideoMode::VideoMode() :
+width (0),
+height (0),
+bitsPerPixel(0)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+VideoMode::VideoMode(unsigned int modeWidth, unsigned int modeHeight, unsigned int modeBitsPerPixel) :
+width (modeWidth),
+height (modeHeight),
+bitsPerPixel(modeBitsPerPixel)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+VideoMode VideoMode::getDesktopMode()
+{
+ // Directly forward to the OS-specific implementation
+ return priv::VideoModeImpl::getDesktopMode();
+}
+
+
+////////////////////////////////////////////////////////////
+const std::vector<VideoMode>& VideoMode::getFullscreenModes()
+{
+ static std::vector<VideoMode> modes;
+
+ // Populate the array on first call
+ if (modes.empty())
+ {
+ modes = priv::VideoModeImpl::getFullscreenModes();
+ std::sort(modes.begin(), modes.end(), std::greater<VideoMode>());
+ }
+
+ return modes;
+}
+
+
+////////////////////////////////////////////////////////////
+bool VideoMode::isValid() const
+{
+ const std::vector<VideoMode>& modes = getFullscreenModes();
+
+ return std::find(modes.begin(), modes.end(), *this) != modes.end();
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator ==(const VideoMode& left, const VideoMode& right)
+{
+ return (left.width == right.width) &&
+ (left.height == right.height) &&
+ (left.bitsPerPixel == right.bitsPerPixel);
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator !=(const VideoMode& left, const VideoMode& right)
+{
+ return !(left == right);
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator <(const VideoMode& left, const VideoMode& right)
+{
+ if (left.bitsPerPixel == right.bitsPerPixel)
+ {
+ if (left.width == right.width)
+ {
+ return left.height < right.height;
+ }
+ else
+ {
+ return left.width < right.width;
+ }
+ }
+ else
+ {
+ return left.bitsPerPixel < right.bitsPerPixel;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator >(const VideoMode& left, const VideoMode& right)
+{
+ return right < left;
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator <=(const VideoMode& left, const VideoMode& right)
+{
+ return !(right < left);
+}
+
+
+////////////////////////////////////////////////////////////
+bool operator >=(const VideoMode& left, const VideoMode& right)
+{
+ return !(left < right);
+}
+
+} // namespace sf
diff --git a/src/SFML/Window/VideoModeImpl.hpp b/src/SFML/Window/VideoModeImpl.hpp
index 7908c20..cbc36a1 100644
--- a/src/SFML/Window/VideoModeImpl.hpp
+++ b/src/SFML/Window/VideoModeImpl.hpp
@@ -1,68 +1,68 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_VIDEOMODEIMPL_HPP
-#define SFML_VIDEOMODEIMPL_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Window/VideoMode.hpp>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief OS-specific implementation of video modes functions
-///
-////////////////////////////////////////////////////////////
-class VideoModeImpl
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the list of all the supported fullscreen video modes
- ///
- /// \return Array filled with the fullscreen video modes
- ///
- ////////////////////////////////////////////////////////////
- static std::vector<VideoMode> getFullscreenModes();
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the current desktop video mode
- ///
- /// \return Current desktop video mode
- ///
- ////////////////////////////////////////////////////////////
- static VideoMode getDesktopMode();
-};
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_VIDEOMODEIMPL_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_VIDEOMODEIMPL_HPP
+#define SFML_VIDEOMODEIMPL_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/VideoMode.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief OS-specific implementation of video modes functions
+///
+////////////////////////////////////////////////////////////
+class VideoModeImpl
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the list of all the supported fullscreen video modes
+ ///
+ /// \return Array filled with the fullscreen video modes
+ ///
+ ////////////////////////////////////////////////////////////
+ static std::vector<VideoMode> getFullscreenModes();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current desktop video mode
+ ///
+ /// \return Current desktop video mode
+ ///
+ ////////////////////////////////////////////////////////////
+ static VideoMode getDesktopMode();
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_VIDEOMODEIMPL_HPP
diff --git a/src/SFML/Window/Win32/InputImpl.cpp b/src/SFML/Window/Win32/InputImpl.cpp
index 0ad303b..bace512 100644
--- a/src/SFML/Window/Win32/InputImpl.cpp
+++ b/src/SFML/Window/Win32/InputImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -148,7 +148,7 @@ bool InputImpl::isKeyPressed(Keyboard::Key key)
case Keyboard::F12: vkey = VK_F12; break;
case Keyboard::F13: vkey = VK_F13; break;
case Keyboard::F14: vkey = VK_F14; break;
- case Keyboard::F15: vkey = VK_F16; break;
+ case Keyboard::F15: vkey = VK_F15; break;
case Keyboard::Pause: vkey = VK_PAUSE; break;
}
@@ -157,6 +157,13 @@ bool InputImpl::isKeyPressed(Keyboard::Key key)
////////////////////////////////////////////////////////////
+void InputImpl::setVirtualKeyboardVisible(bool visible)
+{
+ // Not applicable
+}
+
+
+////////////////////////////////////////////////////////////
bool InputImpl::isMouseButtonPressed(Mouse::Button button)
{
int vkey = 0;
@@ -220,6 +227,30 @@ void InputImpl::setMousePosition(const Vector2i& position, const Window& relativ
}
}
+
+////////////////////////////////////////////////////////////
+bool InputImpl::isTouchDown(unsigned int /*finger*/)
+{
+ // Not applicable
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i InputImpl::getTouchPosition(unsigned int /*finger*/)
+{
+ // Not applicable
+ return Vector2i();
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i InputImpl::getTouchPosition(unsigned int /*finger*/, const Window& /*relativeTo*/)
+{
+ // Not applicable
+ return Vector2i();
+}
+
} // namespace priv
} // namespace sf
diff --git a/src/SFML/Window/Win32/InputImpl.hpp b/src/SFML/Window/Win32/InputImpl.hpp
index 0669b4a..f62f2d2 100644
--- a/src/SFML/Window/Win32/InputImpl.hpp
+++ b/src/SFML/Window/Win32/InputImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -42,7 +42,7 @@ namespace priv
////////////////////////////////////////////////////////////
class InputImpl
{
-public :
+public:
////////////////////////////////////////////////////////////
/// \brief Check if a key is pressed
@@ -55,6 +55,14 @@ public :
static bool isKeyPressed(Keyboard::Key key);
////////////////////////////////////////////////////////////
+ /// \brief Show or hide the virtual keyboard
+ ///
+ /// \param visible True to show, false to hide
+ ///
+ ////////////////////////////////////////////////////////////
+ static void setVirtualKeyboardVisible(bool visible);
+
+ ////////////////////////////////////////////////////////////
/// \brief Check if a mouse button is pressed
///
/// \param button Button to check
@@ -113,6 +121,43 @@ public :
///
////////////////////////////////////////////////////////////
static void setMousePosition(const Vector2i& position, const Window& relativeTo);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a touch event is currently down
+ ///
+ /// \param finger Finger index
+ ///
+ /// \return True if \a finger is currently touching the screen, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isTouchDown(unsigned int finger);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current position of a touch in desktop coordinates
+ ///
+ /// This function returns the current touch position
+ /// in global (desktop) coordinates.
+ ///
+ /// \param finger Finger index
+ ///
+ /// \return Current position of \a finger, or undefined if it's not down
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector2i getTouchPosition(unsigned int finger);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current position of a touch in window coordinates
+ ///
+ /// This function returns the current touch position
+ /// in global (desktop) coordinates.
+ ///
+ /// \param finger Finger index
+ /// \param relativeTo Reference window
+ ///
+ /// \return Current position of \a finger, or undefined if it's not down
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector2i getTouchPosition(unsigned int finger, const Window& relativeTo);
};
} // namespace priv
diff --git a/src/SFML/Window/Win32/JoystickImpl.cpp b/src/SFML/Window/Win32/JoystickImpl.cpp
index c2645e8..380e25f 100644
--- a/src/SFML/Window/Win32/JoystickImpl.cpp
+++ b/src/SFML/Window/Win32/JoystickImpl.cpp
@@ -1,189 +1,302 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Window/JoystickImpl.hpp>
-#include <SFML/System/Clock.hpp>
-#include <windows.h>
-#include <cmath>
-
-
-namespace
-{
- struct ConnectionCache
- {
- ConnectionCache() : connected(false) {}
- bool connected;
- sf::Clock timer;
- };
-
- const sf::Time connectionRefreshDelay = sf::milliseconds(500);
- ConnectionCache connectionCache[sf::Joystick::Count];
-}
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-void JoystickImpl::initialize()
-{
- // Perform the initial scan and populate the connection cache
- for (unsigned int i = 0; i < Joystick::Count; ++i)
- {
- ConnectionCache& cache = connectionCache[i];
-
- // Check if the joystick is connected
- JOYINFOEX joyInfo;
- joyInfo.dwSize = sizeof(joyInfo);
- joyInfo.dwFlags = 0;
- cache.connected = joyGetPosEx(JOYSTICKID1 + i, &joyInfo) == JOYERR_NOERROR;
-
- // start the timeout
- cache.timer.restart();
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void JoystickImpl::cleanup()
-{
- // Nothing to do
-}
-
-
-////////////////////////////////////////////////////////////
-bool JoystickImpl::isConnected(unsigned int index)
-{
- // We check the connection state of joysticks only every N milliseconds,
- // because of a strange (buggy?) behaviour of joyGetPosEx when joysticks
- // are just plugged/unplugged -- it takes really long and kills the app performances
- ConnectionCache& cache = connectionCache[index];
- if (cache.timer.getElapsedTime() > connectionRefreshDelay)
- {
- cache.timer.restart();
-
- JOYINFOEX joyInfo;
- joyInfo.dwSize = sizeof(joyInfo);
- joyInfo.dwFlags = 0;
-
- cache.connected = joyGetPosEx(JOYSTICKID1 + index, &joyInfo) == JOYERR_NOERROR;
- return cache.connected;
- }
- else
- {
- return cache.connected;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-bool JoystickImpl::open(unsigned int index)
-{
- // No explicit "open" action is required
- m_index = JOYSTICKID1 + index;
-
- // Store the joystick capabilities
- return joyGetDevCaps(m_index, &m_caps, sizeof(m_caps)) == JOYERR_NOERROR;
-}
-
-
-////////////////////////////////////////////////////////////
-void JoystickImpl::close()
-{
- // Nothing to do
-}
-
-
-////////////////////////////////////////////////////////////
-JoystickCaps JoystickImpl::getCapabilities() const
-{
- JoystickCaps caps;
-
- caps.buttonCount = m_caps.wNumButtons;
- if (caps.buttonCount > Joystick::ButtonCount)
- caps.buttonCount = Joystick::ButtonCount;
-
- caps.axes[Joystick::X] = true;
- caps.axes[Joystick::Y] = true;
- caps.axes[Joystick::Z] = (m_caps.wCaps & JOYCAPS_HASZ) != 0;
- caps.axes[Joystick::R] = (m_caps.wCaps & JOYCAPS_HASR) != 0;
- caps.axes[Joystick::U] = (m_caps.wCaps & JOYCAPS_HASU) != 0;
- caps.axes[Joystick::V] = (m_caps.wCaps & JOYCAPS_HASV) != 0;
- caps.axes[Joystick::PovX] = (m_caps.wCaps & JOYCAPS_HASPOV) != 0;
- caps.axes[Joystick::PovY] = (m_caps.wCaps & JOYCAPS_HASPOV) != 0;
-
- return caps;
-}
-
-
-////////////////////////////////////////////////////////////
-JoystickState JoystickImpl::update()
-{
- JoystickState state;
-
- // Get the current joystick state
- JOYINFOEX pos;
- pos.dwFlags = JOY_RETURNX | JOY_RETURNY | JOY_RETURNZ | JOY_RETURNR | JOY_RETURNU | JOY_RETURNV | JOY_RETURNBUTTONS;
- pos.dwFlags |= (m_caps.wCaps & JOYCAPS_POVCTS) ? JOY_RETURNPOVCTS : JOY_RETURNPOV;
- pos.dwSize = sizeof(JOYINFOEX);
- if (joyGetPosEx(m_index, &pos) == JOYERR_NOERROR)
- {
- // The joystick is connected
- state.connected = true;
-
- // Axes
- state.axes[Joystick::X] = (pos.dwXpos - (m_caps.wXmax + m_caps.wXmin) / 2.f) * 200.f / (m_caps.wXmax - m_caps.wXmin);
- state.axes[Joystick::Y] = (pos.dwYpos - (m_caps.wYmax + m_caps.wYmin) / 2.f) * 200.f / (m_caps.wYmax - m_caps.wYmin);
- state.axes[Joystick::Z] = (pos.dwZpos - (m_caps.wZmax + m_caps.wZmin) / 2.f) * 200.f / (m_caps.wZmax - m_caps.wZmin);
- state.axes[Joystick::R] = (pos.dwRpos - (m_caps.wRmax + m_caps.wRmin) / 2.f) * 200.f / (m_caps.wRmax - m_caps.wRmin);
- state.axes[Joystick::U] = (pos.dwUpos - (m_caps.wUmax + m_caps.wUmin) / 2.f) * 200.f / (m_caps.wUmax - m_caps.wUmin);
- state.axes[Joystick::V] = (pos.dwVpos - (m_caps.wVmax + m_caps.wVmin) / 2.f) * 200.f / (m_caps.wVmax - m_caps.wVmin);
-
- // Special case for POV, it is given as an angle
- if (pos.dwPOV != 0xFFFF)
- {
- float angle = pos.dwPOV / 18000.f * 3.141592654f;
- state.axes[Joystick::PovX] = std::cos(angle) * 100;
- state.axes[Joystick::PovY] = std::sin(angle) * 100;
- }
- else
- {
- state.axes[Joystick::PovX] = 0;
- state.axes[Joystick::PovY] = 0;
- }
-
- // Buttons
- for (unsigned int i = 0; i < Joystick::ButtonCount; ++i)
- state.buttons[i] = (pos.dwButtons & (1 << i)) != 0;
- }
-
- return state;
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/JoystickImpl.hpp>
+#include <SFML/System/Clock.hpp>
+#include <SFML/System/Err.hpp>
+#include <windows.h>
+#include <tchar.h>
+#include <regstr.h>
+#include <algorithm>
+#include <cmath>
+#include <sstream>
+#include <string>
+
+namespace
+{
+ struct ConnectionCache
+ {
+ ConnectionCache() : connected(false) {}
+ bool connected;
+ sf::Clock timer;
+ };
+
+ const sf::Time connectionRefreshDelay = sf::milliseconds(500);
+ ConnectionCache connectionCache[sf::Joystick::Count];
+
+ // Get a system error string from an error code
+ std::string getErrorString(DWORD error)
+ {
+ PTCHAR buffer;
+
+ if (FormatMessage(FORMAT_MESSAGE_MAX_WIDTH_MASK | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, reinterpret_cast<PTCHAR>(&buffer), 0, NULL) == 0)
+ return "Unknown error.";
+
+ sf::String message = buffer;
+ LocalFree(buffer);
+ return message.toAnsiString();
+ }
+
+ // Get the joystick's name
+ sf::String getDeviceName(unsigned int index, JOYCAPS caps)
+ {
+ // Give the joystick a default name
+ sf::String joystickDescription = "Unknown Joystick";
+
+ LONG result;
+ HKEY rootKey;
+ HKEY currentKey;
+ std::basic_string<TCHAR> subkey;
+
+ subkey = REGSTR_PATH_JOYCONFIG;
+ subkey += TEXT('\\');
+ subkey += caps.szRegKey;
+ subkey += TEXT('\\');
+ subkey += REGSTR_KEY_JOYCURR;
+
+ rootKey = HKEY_CURRENT_USER;
+ result = RegOpenKeyEx(rootKey, subkey.c_str(), 0, KEY_READ, &currentKey);
+
+ if (result != ERROR_SUCCESS)
+ {
+ rootKey = HKEY_LOCAL_MACHINE;
+ result = RegOpenKeyEx(rootKey, subkey.c_str(), 0, KEY_READ, &currentKey);
+
+ if (result != ERROR_SUCCESS)
+ {
+ sf::err() << "Unable to open registry for joystick at index " << index << ": " << getErrorString(result) << std::endl;
+ return joystickDescription;
+ }
+ }
+
+ std::basic_ostringstream<TCHAR> indexString;
+ indexString << index + 1;
+
+ subkey = TEXT("Joystick");
+ subkey += indexString.str();
+ subkey += REGSTR_VAL_JOYOEMNAME;
+
+ TCHAR keyData[256];
+ DWORD keyDataSize = sizeof(keyData);
+
+ result = RegQueryValueEx(currentKey, subkey.c_str(), NULL, NULL, reinterpret_cast<LPBYTE>(keyData), &keyDataSize);
+ RegCloseKey(currentKey);
+
+ if (result != ERROR_SUCCESS)
+ {
+ sf::err() << "Unable to query registry key for joystick at index " << index << ": " << getErrorString(result) << std::endl;
+ return joystickDescription;
+ }
+
+ subkey = REGSTR_PATH_JOYOEM;
+ subkey += TEXT('\\');
+ subkey.append(keyData, keyDataSize / sizeof(TCHAR));
+
+ result = RegOpenKeyEx(rootKey, subkey.c_str(), 0, KEY_READ, &currentKey);
+
+ if (result != ERROR_SUCCESS)
+ {
+ sf::err() << "Unable to open registry key for joystick at index " << index << ": " << getErrorString(result) << std::endl;
+ return joystickDescription;
+ }
+
+ keyDataSize = sizeof(keyData);
+
+ result = RegQueryValueEx(currentKey, REGSTR_VAL_JOYOEMNAME, NULL, NULL, reinterpret_cast<LPBYTE>(keyData), &keyDataSize);
+ RegCloseKey(currentKey);
+
+ if (result != ERROR_SUCCESS)
+ {
+ sf::err() << "Unable to query name for joystick at index " << index << ": " << getErrorString(result) << std::endl;
+ return joystickDescription;
+ }
+
+ keyData[255] = TEXT('\0'); // Ensure null terminator in case the data is too long.
+ joystickDescription = keyData;
+
+ return joystickDescription;
+ }
+}
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+void JoystickImpl::initialize()
+{
+ // Perform the initial scan and populate the connection cache
+ for (unsigned int i = 0; i < Joystick::Count; ++i)
+ {
+ ConnectionCache& cache = connectionCache[i];
+
+ // Check if the joystick is connected
+ JOYINFOEX joyInfo;
+ joyInfo.dwSize = sizeof(joyInfo);
+ joyInfo.dwFlags = 0;
+ cache.connected = joyGetPosEx(JOYSTICKID1 + i, &joyInfo) == JOYERR_NOERROR;
+
+ // start the timeout
+ cache.timer.restart();
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void JoystickImpl::cleanup()
+{
+ // Nothing to do
+}
+
+
+////////////////////////////////////////////////////////////
+bool JoystickImpl::isConnected(unsigned int index)
+{
+ // We check the connection state of joysticks only every N milliseconds,
+ // because of a strange (buggy?) behavior of joyGetPosEx when joysticks
+ // are just plugged/unplugged -- it takes really long and kills the app performances
+ ConnectionCache& cache = connectionCache[index];
+ if (cache.timer.getElapsedTime() > connectionRefreshDelay)
+ {
+ cache.timer.restart();
+
+ JOYINFOEX joyInfo;
+ joyInfo.dwSize = sizeof(joyInfo);
+ joyInfo.dwFlags = 0;
+
+ cache.connected = joyGetPosEx(JOYSTICKID1 + index, &joyInfo) == JOYERR_NOERROR;
+ return cache.connected;
+ }
+ else
+ {
+ return cache.connected;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+bool JoystickImpl::open(unsigned int index)
+{
+ // No explicit "open" action is required
+ m_index = JOYSTICKID1 + index;
+
+ // Store the joystick capabilities
+ bool success = joyGetDevCaps(m_index, &m_caps, sizeof(m_caps)) == JOYERR_NOERROR;
+
+ if (success)
+ {
+ m_identification.name = getDeviceName(m_index, m_caps);
+ m_identification.productId = m_caps.wPid;
+ m_identification.vendorId = m_caps.wMid;
+ }
+
+ return success;
+}
+
+
+////////////////////////////////////////////////////////////
+void JoystickImpl::close()
+{
+ // Nothing to do
+}
+
+////////////////////////////////////////////////////////////
+JoystickCaps JoystickImpl::getCapabilities() const
+{
+ JoystickCaps caps;
+
+ caps.buttonCount = m_caps.wNumButtons;
+ if (caps.buttonCount > Joystick::ButtonCount)
+ caps.buttonCount = Joystick::ButtonCount;
+
+ caps.axes[Joystick::X] = true;
+ caps.axes[Joystick::Y] = true;
+ caps.axes[Joystick::Z] = (m_caps.wCaps & JOYCAPS_HASZ) != 0;
+ caps.axes[Joystick::R] = (m_caps.wCaps & JOYCAPS_HASR) != 0;
+ caps.axes[Joystick::U] = (m_caps.wCaps & JOYCAPS_HASU) != 0;
+ caps.axes[Joystick::V] = (m_caps.wCaps & JOYCAPS_HASV) != 0;
+ caps.axes[Joystick::PovX] = (m_caps.wCaps & JOYCAPS_HASPOV) != 0;
+ caps.axes[Joystick::PovY] = (m_caps.wCaps & JOYCAPS_HASPOV) != 0;
+
+ return caps;
+}
+
+
+////////////////////////////////////////////////////////////
+Joystick::Identification JoystickImpl::getIdentification() const
+{
+ return m_identification;
+}
+
+
+////////////////////////////////////////////////////////////
+JoystickState JoystickImpl::update()
+{
+ JoystickState state;
+
+ // Get the current joystick state
+ JOYINFOEX pos;
+ pos.dwFlags = JOY_RETURNX | JOY_RETURNY | JOY_RETURNZ | JOY_RETURNR | JOY_RETURNU | JOY_RETURNV | JOY_RETURNBUTTONS;
+ pos.dwFlags |= (m_caps.wCaps & JOYCAPS_POVCTS) ? JOY_RETURNPOVCTS : JOY_RETURNPOV;
+ pos.dwSize = sizeof(JOYINFOEX);
+ if (joyGetPosEx(m_index, &pos) == JOYERR_NOERROR)
+ {
+ // The joystick is connected
+ state.connected = true;
+
+ // Axes
+ state.axes[Joystick::X] = (pos.dwXpos - (m_caps.wXmax + m_caps.wXmin) / 2.f) * 200.f / (m_caps.wXmax - m_caps.wXmin);
+ state.axes[Joystick::Y] = (pos.dwYpos - (m_caps.wYmax + m_caps.wYmin) / 2.f) * 200.f / (m_caps.wYmax - m_caps.wYmin);
+ state.axes[Joystick::Z] = (pos.dwZpos - (m_caps.wZmax + m_caps.wZmin) / 2.f) * 200.f / (m_caps.wZmax - m_caps.wZmin);
+ state.axes[Joystick::R] = (pos.dwRpos - (m_caps.wRmax + m_caps.wRmin) / 2.f) * 200.f / (m_caps.wRmax - m_caps.wRmin);
+ state.axes[Joystick::U] = (pos.dwUpos - (m_caps.wUmax + m_caps.wUmin) / 2.f) * 200.f / (m_caps.wUmax - m_caps.wUmin);
+ state.axes[Joystick::V] = (pos.dwVpos - (m_caps.wVmax + m_caps.wVmin) / 2.f) * 200.f / (m_caps.wVmax - m_caps.wVmin);
+
+ // Special case for POV, it is given as an angle
+ if (pos.dwPOV != 0xFFFF)
+ {
+ float angle = pos.dwPOV / 18000.f * 3.141592654f;
+ state.axes[Joystick::PovX] = std::sin(angle) * 100;
+ state.axes[Joystick::PovY] = std::cos(angle) * 100;
+ }
+ else
+ {
+ state.axes[Joystick::PovX] = 0;
+ state.axes[Joystick::PovY] = 0;
+ }
+
+ // Buttons
+ for (unsigned int i = 0; i < Joystick::ButtonCount; ++i)
+ state.buttons[i] = (pos.dwButtons & (1 << i)) != 0;
+ }
+
+ return state;
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/Win32/JoystickImpl.hpp b/src/SFML/Window/Win32/JoystickImpl.hpp
index 1630f99..a5d258d 100644
--- a/src/SFML/Window/Win32/JoystickImpl.hpp
+++ b/src/SFML/Window/Win32/JoystickImpl.hpp
@@ -1,125 +1,135 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_JOYSTICKIMPLWIN32_HPP
-#define SFML_JOYSTICKIMPLWIN32_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#ifdef _WIN32_WINDOWS
- #undef _WIN32_WINDOWS
-#endif
-#ifdef _WIN32_WINNT
- #undef _WIN32_WINNT
-#endif
-#define _WIN32_WINDOWS 0x0501
-#define _WIN32_WINNT 0x0501
-#include <SFML/Window/JoystickImpl.hpp>
-#include <windows.h>
-#include <mmsystem.h>
-#include <cmath>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief Windows implementation of joysticks
-///
-////////////////////////////////////////////////////////////
-class JoystickImpl
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Perform the global initialization of the joystick module
- ///
- ////////////////////////////////////////////////////////////
- static void initialize();
-
- ////////////////////////////////////////////////////////////
- /// \brief Perform the global cleanup of the joystick module
- ///
- ////////////////////////////////////////////////////////////
- static void cleanup();
-
- ////////////////////////////////////////////////////////////
- /// \brief Check if a joystick is currently connected
- ///
- /// \param index Index of the joystick to check
- ///
- /// \return True if the joystick is connected, false otherwise
- ///
- ////////////////////////////////////////////////////////////
- static bool isConnected(unsigned int index);
-
- ////////////////////////////////////////////////////////////
- /// \brief Open the joystick
- ///
- /// \param index Index assigned to the joystick
- ///
- /// \return True on success, false on failure
- ///
- ////////////////////////////////////////////////////////////
- bool open(unsigned int index);
-
- ////////////////////////////////////////////////////////////
- /// \brief Close the joystick
- ///
- ////////////////////////////////////////////////////////////
- void close();
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the joystick capabilities
- ///
- /// \return Joystick capabilities
- ///
- ////////////////////////////////////////////////////////////
- JoystickCaps getCapabilities() const;
-
- ////////////////////////////////////////////////////////////
- /// \brief Update the joystick and get its new state
- ///
- /// \return Joystick state
- ///
- ////////////////////////////////////////////////////////////
- JoystickState update();
-
-private :
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- unsigned int m_index; ///< Index of the joystick
- JOYCAPS m_caps; ///< Joystick capabilities
-};
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_JOYSTICKIMPLWIN32_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_JOYSTICKIMPLWIN32_HPP
+#define SFML_JOYSTICKIMPLWIN32_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#ifdef _WIN32_WINDOWS
+ #undef _WIN32_WINDOWS
+#endif
+#ifdef _WIN32_WINNT
+ #undef _WIN32_WINNT
+#endif
+#define _WIN32_WINDOWS 0x0501
+#define _WIN32_WINNT 0x0501
+#include <SFML/Window/Joystick.hpp>
+#include <SFML/Window/JoystickImpl.hpp>
+#include <SFML/System/String.hpp>
+#include <windows.h>
+#include <mmsystem.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Windows implementation of joysticks
+///
+////////////////////////////////////////////////////////////
+class JoystickImpl
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global initialization of the joystick module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void initialize();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global cleanup of the joystick module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void cleanup();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a joystick is currently connected
+ ///
+ /// \param index Index of the joystick to check
+ ///
+ /// \return True if the joystick is connected, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isConnected(unsigned int index);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open the joystick
+ ///
+ /// \param index Index assigned to the joystick
+ ///
+ /// \return True on success, false on failure
+ ///
+ ////////////////////////////////////////////////////////////
+ bool open(unsigned int index);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Close the joystick
+ ///
+ ////////////////////////////////////////////////////////////
+ void close();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the joystick capabilities
+ ///
+ /// \return Joystick capabilities
+ ///
+ ////////////////////////////////////////////////////////////
+ JoystickCaps getCapabilities() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the joystick identification
+ ///
+ /// \return Joystick identification
+ ///
+ ////////////////////////////////////////////////////////////
+ Joystick::Identification getIdentification() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Update the joystick and get its new state
+ ///
+ /// \return Joystick state
+ ///
+ ////////////////////////////////////////////////////////////
+ JoystickState update();
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ unsigned int m_index; ///< Index of the joystick
+ JOYCAPS m_caps; ///< Joystick capabilities
+ Joystick::Identification m_identification; ///< Joystick identification
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_JOYSTICKIMPLWIN32_HPP
diff --git a/src/SFML/Window/Win32/SensorImpl.cpp b/src/SFML/Window/Win32/SensorImpl.cpp
new file mode 100644
index 0000000..be5e439
--- /dev/null
+++ b/src/SFML/Window/Win32/SensorImpl.cpp
@@ -0,0 +1,88 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/SensorImpl.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+void SensorImpl::initialize()
+{
+ // To be implemented
+}
+
+
+////////////////////////////////////////////////////////////
+void SensorImpl::cleanup()
+{
+ // To be implemented
+}
+
+
+////////////////////////////////////////////////////////////
+bool SensorImpl::isAvailable(Sensor::Type /*sensor*/)
+{
+ // To be implemented
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SensorImpl::open(Sensor::Type /*sensor*/)
+{
+ // To be implemented
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+void SensorImpl::close()
+{
+ // To be implemented
+}
+
+
+////////////////////////////////////////////////////////////
+Vector3f SensorImpl::update()
+{
+ // To be implemented
+ return Vector3f(0, 0, 0);
+}
+
+
+////////////////////////////////////////////////////////////
+void SensorImpl::setEnabled(bool /*enabled*/)
+{
+ // To be implemented
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/Win32/SensorImpl.hpp b/src/SFML/Window/Win32/SensorImpl.hpp
new file mode 100644
index 0000000..e174fa2
--- /dev/null
+++ b/src/SFML/Window/Win32/SensorImpl.hpp
@@ -0,0 +1,101 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SENSORIMPLWIN32_HPP
+#define SFML_SENSORIMPLWIN32_HPP
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Windows implementation of sensors
+///
+////////////////////////////////////////////////////////////
+class SensorImpl
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global initialization of the sensor module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void initialize();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global cleanup of the sensor module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void cleanup();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a sensor is available
+ ///
+ /// \param sensor Sensor to check
+ ///
+ /// \return True if the sensor is available, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isAvailable(Sensor::Type sensor);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open the sensor
+ ///
+ /// \param sensor Type of the sensor
+ ///
+ /// \return True on success, false on failure
+ ///
+ ////////////////////////////////////////////////////////////
+ bool open(Sensor::Type sensor);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Close the sensor
+ ///
+ ////////////////////////////////////////////////////////////
+ void close();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Update the sensor and get its new value
+ ///
+ /// \return Sensor value
+ ///
+ ////////////////////////////////////////////////////////////
+ Vector3f update();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Enable or disable the sensor
+ ///
+ /// \param enabled True to enable, false to disable
+ ///
+ ////////////////////////////////////////////////////////////
+ void setEnabled(bool enabled);
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_SENSORIMPLWIN32_HPP
diff --git a/src/SFML/Window/Win32/VideoModeImpl.cpp b/src/SFML/Window/Win32/VideoModeImpl.cpp
index 11f04ab..b19588a 100644
--- a/src/SFML/Window/Win32/VideoModeImpl.cpp
+++ b/src/SFML/Window/Win32/VideoModeImpl.cpp
@@ -1,71 +1,71 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Window/VideoModeImpl.hpp>
-#include <windows.h>
-#include <algorithm>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-std::vector<VideoMode> VideoModeImpl::getFullscreenModes()
-{
- std::vector<VideoMode> modes;
-
- // Enumerate all available video modes for the primary display adapter
- DEVMODE win32Mode;
- win32Mode.dmSize = sizeof(win32Mode);
- for (int count = 0; EnumDisplaySettings(NULL, count, &win32Mode); ++count)
- {
- // Convert to sf::VideoMode
- VideoMode mode(win32Mode.dmPelsWidth, win32Mode.dmPelsHeight, win32Mode.dmBitsPerPel);
-
- // Add it only if it is not already in the array
- if (std::find(modes.begin(), modes.end(), mode) == modes.end())
- modes.push_back(mode);
- }
-
- return modes;
-}
-
-
-////////////////////////////////////////////////////////////
-VideoMode VideoModeImpl::getDesktopMode()
-{
- DEVMODE win32Mode;
- win32Mode.dmSize = sizeof(win32Mode);
- EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &win32Mode);
-
- return VideoMode(win32Mode.dmPelsWidth, win32Mode.dmPelsHeight, win32Mode.dmBitsPerPel);
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/VideoModeImpl.hpp>
+#include <windows.h>
+#include <algorithm>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+std::vector<VideoMode> VideoModeImpl::getFullscreenModes()
+{
+ std::vector<VideoMode> modes;
+
+ // Enumerate all available video modes for the primary display adapter
+ DEVMODE win32Mode;
+ win32Mode.dmSize = sizeof(win32Mode);
+ for (int count = 0; EnumDisplaySettings(NULL, count, &win32Mode); ++count)
+ {
+ // Convert to sf::VideoMode
+ VideoMode mode(win32Mode.dmPelsWidth, win32Mode.dmPelsHeight, win32Mode.dmBitsPerPel);
+
+ // Add it only if it is not already in the array
+ if (std::find(modes.begin(), modes.end(), mode) == modes.end())
+ modes.push_back(mode);
+ }
+
+ return modes;
+}
+
+
+////////////////////////////////////////////////////////////
+VideoMode VideoModeImpl::getDesktopMode()
+{
+ DEVMODE win32Mode;
+ win32Mode.dmSize = sizeof(win32Mode);
+ EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &win32Mode);
+
+ return VideoMode(win32Mode.dmPelsWidth, win32Mode.dmPelsHeight, win32Mode.dmBitsPerPel);
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/Win32/WglContext.cpp b/src/SFML/Window/Win32/WglContext.cpp
index 7d9cc43..c6e7c33 100644
--- a/src/SFML/Window/Win32/WglContext.cpp
+++ b/src/SFML/Window/Win32/WglContext.cpp
@@ -1,325 +1,325 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Window/WindowImpl.hpp> // included first to avoid a warning about macro redefinition
-#include <SFML/Window/Win32/WglContext.hpp>
-#include <SFML/Window/glext/wglext.h>
-#include <SFML/System/Lock.hpp>
-#include <SFML/System/Mutex.hpp>
-#include <SFML/System/Err.hpp>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-WglContext::WglContext(WglContext* shared) :
-m_window (NULL),
-m_deviceContext(NULL),
-m_context (NULL),
-m_ownsWindow (true)
-{
- // Creating a dummy window is mandatory: we could create a memory DC but then
- // its pixel format wouldn't match the regular contexts' format, and thus
- // wglShareLists would always fail. Too bad...
-
- // Create a dummy window (disabled and hidden)
- m_window = CreateWindowA("STATIC", "", WS_POPUP | WS_DISABLED, 0, 0, 1, 1, NULL, NULL, GetModuleHandle(NULL), NULL);
- ShowWindow(m_window, SW_HIDE);
- m_deviceContext = GetDC(m_window);
-
- // Create the context
- if (m_deviceContext)
- createContext(shared, VideoMode::getDesktopMode().bitsPerPixel, ContextSettings());
-}
-
-
-////////////////////////////////////////////////////////////
-WglContext::WglContext(WglContext* shared, const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel) :
-m_window (NULL),
-m_deviceContext(NULL),
-m_context (NULL),
-m_ownsWindow (false)
-{
- // Get the owner window and its device context
- m_window = owner->getSystemHandle();
- m_deviceContext = GetDC(m_window);
-
- // Create the context
- if (m_deviceContext)
- createContext(shared, bitsPerPixel, settings);
-}
-
-
-////////////////////////////////////////////////////////////
-WglContext::WglContext(WglContext* shared, const ContextSettings& settings, unsigned int width, unsigned int height) :
-m_window (NULL),
-m_deviceContext(NULL),
-m_context (NULL),
-m_ownsWindow (true)
-{
- // The target of the context is a hidden window.
- // We can't create a memory DC (the resulting context wouldn't be compatible
- // with other contexts), and we don't add the extra complexity of P-Buffers;
- // we can still support them in the future if this solution is not good enough.
-
- // Create the hidden window
- m_window = CreateWindowA("STATIC", "", WS_POPUP | WS_DISABLED, 0, 0, width, height, NULL, NULL, GetModuleHandle(NULL), NULL);
- ShowWindow(m_window, SW_HIDE);
- m_deviceContext = GetDC(m_window);
-
- // Create the context
- if (m_deviceContext)
- createContext(shared, VideoMode::getDesktopMode().bitsPerPixel, settings);
-}
-
-
-////////////////////////////////////////////////////////////
-WglContext::~WglContext()
-{
- // Destroy the OpenGL context
- if (m_context)
- {
- if (wglGetCurrentContext() == m_context)
- wglMakeCurrent(NULL, NULL);
- wglDeleteContext(m_context);
- }
-
- // Destroy the device context
- if (m_deviceContext)
- ReleaseDC(m_window, m_deviceContext);
-
- // Destroy the window if we own it
- if (m_window && m_ownsWindow)
- DestroyWindow(m_window);
-}
-
-
-////////////////////////////////////////////////////////////
-bool WglContext::makeCurrent()
-{
- return m_deviceContext && m_context && wglMakeCurrent(m_deviceContext, m_context);
-}
-
-
-////////////////////////////////////////////////////////////
-void WglContext::display()
-{
- if (m_deviceContext && m_context)
- SwapBuffers(m_deviceContext);
-}
-
-
-////////////////////////////////////////////////////////////
-void WglContext::setVerticalSyncEnabled(bool enabled)
-{
- PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = reinterpret_cast<PFNWGLSWAPINTERVALEXTPROC>(wglGetProcAddress("wglSwapIntervalEXT"));
- if (wglSwapIntervalEXT)
- wglSwapIntervalEXT(enabled ? 1 : 0);
-}
-
-
-////////////////////////////////////////////////////////////
-void WglContext::createContext(WglContext* shared, unsigned int bitsPerPixel, const ContextSettings& settings)
-{
- // Save the creation settings
- m_settings = settings;
-
- // Let's find a suitable pixel format -- first try with antialiasing
- int bestFormat = 0;
- if (m_settings.antialiasingLevel > 0)
- {
- // Get the wglChoosePixelFormatARB function (it is an extension)
- PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB = reinterpret_cast<PFNWGLCHOOSEPIXELFORMATARBPROC>(wglGetProcAddress("wglChoosePixelFormatARB"));
- if (wglChoosePixelFormatARB)
- {
- // Define the basic attributes we want for our window
- int intAttributes[] =
- {
- WGL_DRAW_TO_WINDOW_ARB, GL_TRUE,
- WGL_SUPPORT_OPENGL_ARB, GL_TRUE,
- WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB,
- WGL_DOUBLE_BUFFER_ARB, GL_TRUE,
- WGL_SAMPLE_BUFFERS_ARB, (m_settings.antialiasingLevel ? GL_TRUE : GL_FALSE),
- WGL_SAMPLES_ARB, static_cast<int>(m_settings.antialiasingLevel),
- 0, 0
- };
-
- // Let's check how many formats are supporting our requirements
- int formats[128];
- UINT nbFormats;
- float floatAttributes[] = {0, 0};
- bool isValid = wglChoosePixelFormatARB(m_deviceContext, intAttributes, floatAttributes, sizeof(formats) / sizeof(*formats), formats, &nbFormats) != 0;
- while ((!isValid || (nbFormats == 0)) && m_settings.antialiasingLevel > 0)
- {
- // Decrease the antialiasing level until we find a valid one
- m_settings.antialiasingLevel--;
- intAttributes[11] = m_settings.antialiasingLevel;
- isValid = wglChoosePixelFormatARB(m_deviceContext, intAttributes, floatAttributes, sizeof(formats) / sizeof(*formats), formats, &nbFormats) != 0;
- }
-
- // Get the best format among the returned ones
- if (isValid && (nbFormats > 0))
- {
- int bestScore = 0xFFFF;
- for (UINT i = 0; i < nbFormats; ++i)
- {
- // Get the current format's attributes
- PIXELFORMATDESCRIPTOR attributes;
- attributes.nSize = sizeof(attributes);
- attributes.nVersion = 1;
- DescribePixelFormat(m_deviceContext, formats[i], sizeof(attributes), &attributes);
-
- // Evaluate the current configuration
- int color = attributes.cRedBits + attributes.cGreenBits + attributes.cBlueBits + attributes.cAlphaBits;
- int score = evaluateFormat(bitsPerPixel, m_settings, color, attributes.cDepthBits, attributes.cStencilBits, m_settings.antialiasingLevel);
-
- // Keep it if it's better than the current best
- if (score < bestScore)
- {
- bestScore = score;
- bestFormat = formats[i];
- }
- }
- }
- }
- else
- {
- // wglChoosePixelFormatARB not supported ; disabling antialiasing
- err() << "Antialiasing is not supported ; it will be disabled" << std::endl;
- m_settings.antialiasingLevel = 0;
- }
- }
-
- // Find a pixel format with no antialiasing, if not needed or not supported
- if (bestFormat == 0)
- {
- // Setup a pixel format descriptor from the rendering settings
- PIXELFORMATDESCRIPTOR descriptor;
- ZeroMemory(&descriptor, sizeof(descriptor));
- descriptor.nSize = sizeof(descriptor);
- descriptor.nVersion = 1;
- descriptor.iLayerType = PFD_MAIN_PLANE;
- descriptor.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
- descriptor.iPixelType = PFD_TYPE_RGBA;
- descriptor.cColorBits = static_cast<BYTE>(bitsPerPixel);
- descriptor.cDepthBits = static_cast<BYTE>(m_settings.depthBits);
- descriptor.cStencilBits = static_cast<BYTE>(m_settings.stencilBits);
- descriptor.cAlphaBits = bitsPerPixel == 32 ? 8 : 0;
-
- // Get the pixel format that best matches our requirements
- bestFormat = ChoosePixelFormat(m_deviceContext, &descriptor);
- if (bestFormat == 0)
- {
- err() << "Failed to find a suitable pixel format for device context -- cannot create OpenGL context" << std::endl;
- return;
- }
- }
-
- // Extract the depth and stencil bits from the chosen format
- PIXELFORMATDESCRIPTOR actualFormat;
- actualFormat.nSize = sizeof(actualFormat);
- actualFormat.nVersion = 1;
- DescribePixelFormat(m_deviceContext, bestFormat, sizeof(actualFormat), &actualFormat);
- m_settings.depthBits = actualFormat.cDepthBits;
- m_settings.stencilBits = actualFormat.cStencilBits;
-
- // Set the chosen pixel format
- if (!SetPixelFormat(m_deviceContext, bestFormat, &actualFormat))
- {
- err() << "Failed to set pixel format for device context -- cannot create OpenGL context" << std::endl;
- return;
- }
-
- // Get the context to share display lists with
- HGLRC sharedContext = shared ? shared->m_context : NULL;
-
- // Create the OpenGL context -- first try context versions >= 3.0 if it is requested (they require special code)
- while (!m_context && (m_settings.majorVersion >= 3))
- {
- PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = reinterpret_cast<PFNWGLCREATECONTEXTATTRIBSARBPROC>(wglGetProcAddress("wglCreateContextAttribsARB"));
- if (wglCreateContextAttribsARB)
- {
- int attributes[] =
- {
- WGL_CONTEXT_MAJOR_VERSION_ARB, static_cast<int>(m_settings.majorVersion),
- WGL_CONTEXT_MINOR_VERSION_ARB, static_cast<int>(m_settings.minorVersion),
- WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
- 0, 0
- };
- m_context = wglCreateContextAttribsARB(m_deviceContext, sharedContext, attributes);
- }
-
- // If we couldn't create the context, lower the version number and try again -- stop at 3.0
- // Invalid version numbers will be generated by this algorithm (like 3.9), but we really don't care
- if (!m_context)
- {
- if (m_settings.minorVersion > 0)
- {
- // If the minor version is not 0, we decrease it and try again
- m_settings.minorVersion--;
- }
- else
- {
- // If the minor version is 0, we decrease the major version
- m_settings.majorVersion--;
- m_settings.minorVersion = 9;
- }
- }
- }
-
- // If the OpenGL >= 3.0 context failed or if we don't want one, create a regular OpenGL 1.x/2.x context
- if (!m_context)
- {
- // set the context version to 2.0 (arbitrary)
- m_settings.majorVersion = 2;
- m_settings.minorVersion = 0;
-
- m_context = wglCreateContext(m_deviceContext);
- if (!m_context)
- {
- err() << "Failed to create an OpenGL context for this window" << std::endl;
- return;
- }
-
- // Share this context with others
- if (sharedContext)
- {
- // wglShareLists doesn't seem to be thread-safe
- static Mutex mutex;
- Lock lock(mutex);
-
- if (!wglShareLists(sharedContext, m_context))
- err() << "Failed to share the OpenGL context" << std::endl;
- }
- }
-}
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/WindowImpl.hpp> // included first to avoid a warning about macro redefinition
+#include <SFML/Window/Win32/WglContext.hpp>
+#include <SFML/Window/glext/wglext.h>
+#include <SFML/System/Lock.hpp>
+#include <SFML/System/Mutex.hpp>
+#include <SFML/System/Err.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+WglContext::WglContext(WglContext* shared) :
+m_window (NULL),
+m_deviceContext(NULL),
+m_context (NULL),
+m_ownsWindow (true)
+{
+ // Creating a dummy window is mandatory: we could create a memory DC but then
+ // its pixel format wouldn't match the regular contexts' format, and thus
+ // wglShareLists would always fail. Too bad...
+
+ // Create a dummy window (disabled and hidden)
+ m_window = CreateWindowA("STATIC", "", WS_POPUP | WS_DISABLED, 0, 0, 1, 1, NULL, NULL, GetModuleHandle(NULL), NULL);
+ ShowWindow(m_window, SW_HIDE);
+ m_deviceContext = GetDC(m_window);
+
+ // Create the context
+ if (m_deviceContext)
+ createContext(shared, VideoMode::getDesktopMode().bitsPerPixel, ContextSettings());
+}
+
+
+////////////////////////////////////////////////////////////
+WglContext::WglContext(WglContext* shared, const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel) :
+m_window (NULL),
+m_deviceContext(NULL),
+m_context (NULL),
+m_ownsWindow (false)
+{
+ // Get the owner window and its device context
+ m_window = owner->getSystemHandle();
+ m_deviceContext = GetDC(m_window);
+
+ // Create the context
+ if (m_deviceContext)
+ createContext(shared, bitsPerPixel, settings);
+}
+
+
+////////////////////////////////////////////////////////////
+WglContext::WglContext(WglContext* shared, const ContextSettings& settings, unsigned int width, unsigned int height) :
+m_window (NULL),
+m_deviceContext(NULL),
+m_context (NULL),
+m_ownsWindow (true)
+{
+ // The target of the context is a hidden window.
+ // We can't create a memory DC (the resulting context wouldn't be compatible
+ // with other contexts), and we don't add the extra complexity of P-Buffers;
+ // we can still support them in the future if this solution is not good enough.
+
+ // Create the hidden window
+ m_window = CreateWindowA("STATIC", "", WS_POPUP | WS_DISABLED, 0, 0, width, height, NULL, NULL, GetModuleHandle(NULL), NULL);
+ ShowWindow(m_window, SW_HIDE);
+ m_deviceContext = GetDC(m_window);
+
+ // Create the context
+ if (m_deviceContext)
+ createContext(shared, VideoMode::getDesktopMode().bitsPerPixel, settings);
+}
+
+
+////////////////////////////////////////////////////////////
+WglContext::~WglContext()
+{
+ // Destroy the OpenGL context
+ if (m_context)
+ {
+ if (wglGetCurrentContext() == m_context)
+ wglMakeCurrent(NULL, NULL);
+ wglDeleteContext(m_context);
+ }
+
+ // Destroy the device context
+ if (m_deviceContext)
+ ReleaseDC(m_window, m_deviceContext);
+
+ // Destroy the window if we own it
+ if (m_window && m_ownsWindow)
+ DestroyWindow(m_window);
+}
+
+
+////////////////////////////////////////////////////////////
+bool WglContext::makeCurrent()
+{
+ return m_deviceContext && m_context && wglMakeCurrent(m_deviceContext, m_context);
+}
+
+
+////////////////////////////////////////////////////////////
+void WglContext::display()
+{
+ if (m_deviceContext && m_context)
+ SwapBuffers(m_deviceContext);
+}
+
+
+////////////////////////////////////////////////////////////
+void WglContext::setVerticalSyncEnabled(bool enabled)
+{
+ PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = reinterpret_cast<PFNWGLSWAPINTERVALEXTPROC>(wglGetProcAddress("wglSwapIntervalEXT"));
+ if (wglSwapIntervalEXT)
+ wglSwapIntervalEXT(enabled ? 1 : 0);
+}
+
+
+////////////////////////////////////////////////////////////
+void WglContext::createContext(WglContext* shared, unsigned int bitsPerPixel, const ContextSettings& settings)
+{
+ // Save the creation settings
+ m_settings = settings;
+
+ // Let's find a suitable pixel format -- first try with antialiasing
+ int bestFormat = 0;
+ if (m_settings.antialiasingLevel > 0)
+ {
+ // Get the wglChoosePixelFormatARB function (it is an extension)
+ PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB = reinterpret_cast<PFNWGLCHOOSEPIXELFORMATARBPROC>(wglGetProcAddress("wglChoosePixelFormatARB"));
+ if (wglChoosePixelFormatARB)
+ {
+ // Define the basic attributes we want for our window
+ int intAttributes[] =
+ {
+ WGL_DRAW_TO_WINDOW_ARB, GL_TRUE,
+ WGL_SUPPORT_OPENGL_ARB, GL_TRUE,
+ WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB,
+ WGL_DOUBLE_BUFFER_ARB, GL_TRUE,
+ WGL_SAMPLE_BUFFERS_ARB, (m_settings.antialiasingLevel ? GL_TRUE : GL_FALSE),
+ WGL_SAMPLES_ARB, static_cast<int>(m_settings.antialiasingLevel),
+ 0, 0
+ };
+
+ // Let's check how many formats are supporting our requirements
+ int formats[128];
+ UINT nbFormats;
+ float floatAttributes[] = {0, 0};
+ bool isValid = wglChoosePixelFormatARB(m_deviceContext, intAttributes, floatAttributes, sizeof(formats) / sizeof(*formats), formats, &nbFormats) != 0;
+ while ((!isValid || (nbFormats == 0)) && m_settings.antialiasingLevel > 0)
+ {
+ // Decrease the antialiasing level until we find a valid one
+ m_settings.antialiasingLevel--;
+ intAttributes[11] = m_settings.antialiasingLevel;
+ isValid = wglChoosePixelFormatARB(m_deviceContext, intAttributes, floatAttributes, sizeof(formats) / sizeof(*formats), formats, &nbFormats) != 0;
+ }
+
+ // Get the best format among the returned ones
+ if (isValid && (nbFormats > 0))
+ {
+ int bestScore = 0xFFFF;
+ for (UINT i = 0; i < nbFormats; ++i)
+ {
+ // Get the current format's attributes
+ PIXELFORMATDESCRIPTOR attributes;
+ attributes.nSize = sizeof(attributes);
+ attributes.nVersion = 1;
+ DescribePixelFormat(m_deviceContext, formats[i], sizeof(attributes), &attributes);
+
+ // Evaluate the current configuration
+ int color = attributes.cRedBits + attributes.cGreenBits + attributes.cBlueBits + attributes.cAlphaBits;
+ int score = evaluateFormat(bitsPerPixel, m_settings, color, attributes.cDepthBits, attributes.cStencilBits, m_settings.antialiasingLevel);
+
+ // Keep it if it's better than the current best
+ if (score < bestScore)
+ {
+ bestScore = score;
+ bestFormat = formats[i];
+ }
+ }
+ }
+ }
+ else
+ {
+ // wglChoosePixelFormatARB not supported ; disabling antialiasing
+ err() << "Antialiasing is not supported ; it will be disabled" << std::endl;
+ m_settings.antialiasingLevel = 0;
+ }
+ }
+
+ // Find a pixel format with no antialiasing, if not needed or not supported
+ if (bestFormat == 0)
+ {
+ // Setup a pixel format descriptor from the rendering settings
+ PIXELFORMATDESCRIPTOR descriptor;
+ ZeroMemory(&descriptor, sizeof(descriptor));
+ descriptor.nSize = sizeof(descriptor);
+ descriptor.nVersion = 1;
+ descriptor.iLayerType = PFD_MAIN_PLANE;
+ descriptor.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
+ descriptor.iPixelType = PFD_TYPE_RGBA;
+ descriptor.cColorBits = static_cast<BYTE>(bitsPerPixel);
+ descriptor.cDepthBits = static_cast<BYTE>(m_settings.depthBits);
+ descriptor.cStencilBits = static_cast<BYTE>(m_settings.stencilBits);
+ descriptor.cAlphaBits = bitsPerPixel == 32 ? 8 : 0;
+
+ // Get the pixel format that best matches our requirements
+ bestFormat = ChoosePixelFormat(m_deviceContext, &descriptor);
+ if (bestFormat == 0)
+ {
+ err() << "Failed to find a suitable pixel format for device context -- cannot create OpenGL context" << std::endl;
+ return;
+ }
+ }
+
+ // Extract the depth and stencil bits from the chosen format
+ PIXELFORMATDESCRIPTOR actualFormat;
+ actualFormat.nSize = sizeof(actualFormat);
+ actualFormat.nVersion = 1;
+ DescribePixelFormat(m_deviceContext, bestFormat, sizeof(actualFormat), &actualFormat);
+ m_settings.depthBits = actualFormat.cDepthBits;
+ m_settings.stencilBits = actualFormat.cStencilBits;
+
+ // Set the chosen pixel format
+ if (!SetPixelFormat(m_deviceContext, bestFormat, &actualFormat))
+ {
+ err() << "Failed to set pixel format for device context -- cannot create OpenGL context" << std::endl;
+ return;
+ }
+
+ // Get the context to share display lists with
+ HGLRC sharedContext = shared ? shared->m_context : NULL;
+
+ // Create the OpenGL context -- first try context versions >= 3.0 if it is requested (they require special code)
+ while (!m_context && (m_settings.majorVersion >= 3))
+ {
+ PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = reinterpret_cast<PFNWGLCREATECONTEXTATTRIBSARBPROC>(wglGetProcAddress("wglCreateContextAttribsARB"));
+ if (wglCreateContextAttribsARB)
+ {
+ int attributes[] =
+ {
+ WGL_CONTEXT_MAJOR_VERSION_ARB, static_cast<int>(m_settings.majorVersion),
+ WGL_CONTEXT_MINOR_VERSION_ARB, static_cast<int>(m_settings.minorVersion),
+ WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
+ 0, 0
+ };
+ m_context = wglCreateContextAttribsARB(m_deviceContext, sharedContext, attributes);
+ }
+
+ // If we couldn't create the context, lower the version number and try again -- stop at 3.0
+ // Invalid version numbers will be generated by this algorithm (like 3.9), but we really don't care
+ if (!m_context)
+ {
+ if (m_settings.minorVersion > 0)
+ {
+ // If the minor version is not 0, we decrease it and try again
+ m_settings.minorVersion--;
+ }
+ else
+ {
+ // If the minor version is 0, we decrease the major version
+ m_settings.majorVersion--;
+ m_settings.minorVersion = 9;
+ }
+ }
+ }
+
+ // If the OpenGL >= 3.0 context failed or if we don't want one, create a regular OpenGL 1.x/2.x context
+ if (!m_context)
+ {
+ // set the context version to 2.0 (arbitrary)
+ m_settings.majorVersion = 2;
+ m_settings.minorVersion = 0;
+
+ m_context = wglCreateContext(m_deviceContext);
+ if (!m_context)
+ {
+ err() << "Failed to create an OpenGL context for this window" << std::endl;
+ return;
+ }
+
+ // Share this context with others
+ if (sharedContext)
+ {
+ // wglShareLists doesn't seem to be thread-safe
+ static Mutex mutex;
+ Lock lock(mutex);
+
+ if (!wglShareLists(sharedContext, m_context))
+ err() << "Failed to share the OpenGL context" << std::endl;
+ }
+ }
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/Win32/WglContext.hpp b/src/SFML/Window/Win32/WglContext.hpp
index 3fa1c3a..75ef4d5 100644
--- a/src/SFML/Window/Win32/WglContext.hpp
+++ b/src/SFML/Window/Win32/WglContext.hpp
@@ -1,136 +1,136 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_WGLCONTEXT_HPP
-#define SFML_WGLCONTEXT_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Window/GlContext.hpp>
-#include <SFML/OpenGL.hpp>
-#include <windows.h>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief Windows (WGL) implementation of OpenGL contexts
-///
-////////////////////////////////////////////////////////////
-class WglContext : public GlContext
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Create a new default context
- ///
- /// \param shared Context to share the new one with (can be NULL)
- ///
- ////////////////////////////////////////////////////////////
- WglContext(WglContext* shared);
-
- ////////////////////////////////////////////////////////////
- /// \brief Create a new context attached to a window
- ///
- /// \param shared Context to share the new one with
- /// \param settings Creation parameters
- /// \param owner Pointer to the owner window
- /// \param bitsPerPixel Pixel depth, in bits per pixel
- ///
- ////////////////////////////////////////////////////////////
- WglContext(WglContext* shared, const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel);
-
- ////////////////////////////////////////////////////////////
- /// \brief Create a new context that embeds its own rendering target
- ///
- /// \param shared Context to share the new one with
- /// \param settings Creation parameters
- /// \param width Back buffer width, in pixels
- /// \param height Back buffer height, in pixels
- ///
- ////////////////////////////////////////////////////////////
- WglContext(WglContext* shared, const ContextSettings& settings, unsigned int width, unsigned int height);
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor
- ///
- ////////////////////////////////////////////////////////////
- ~WglContext();
-
- ////////////////////////////////////////////////////////////
- /// \brief Activate the context as the current target for rendering
- ///
- /// \return True on success, false if any error happened
- ///
- ////////////////////////////////////////////////////////////
- virtual bool makeCurrent();
-
- ////////////////////////////////////////////////////////////
- /// \brief Display what has been rendered to the context so far
- ///
- ////////////////////////////////////////////////////////////
- virtual void display();
-
- ////////////////////////////////////////////////////////////
- /// \brief Enable or disable vertical synchronization
- ///
- /// Activating vertical synchronization will limit the number
- /// of frames displayed to the refresh rate of the monitor.
- /// This can avoid some visual artifacts, and limit the framerate
- /// to a good value (but not constant across different computers).
- ///
- /// \param enabled : True to enable v-sync, false to deactivate
- ///
- ////////////////////////////////////////////////////////////
- virtual void setVerticalSyncEnabled(bool enabled);
-
-private :
-
- ////////////////////////////////////////////////////////////
- /// \brief Create the context
- ///
- /// \param shared Context to share the new one with (can be NULL)
- /// \param bitsPerPixel Pixel depth, in bits per pixel
- /// \param settings Creation parameters
- ///
- ////////////////////////////////////////////////////////////
- void createContext(WglContext* shared, unsigned int bitsPerPixel, const ContextSettings& settings);
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- HWND m_window; ///< Window to which the context is attached
- HDC m_deviceContext; ///< Device context associated to the context
- HGLRC m_context; ///< OpenGL context
- bool m_ownsWindow; ///< Do we own the target window?
-};
-
-} // namespace priv
-
-} // namespace sf
-
-#endif // SFML_WGLCONTEXT_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_WGLCONTEXT_HPP
+#define SFML_WGLCONTEXT_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/GlContext.hpp>
+#include <SFML/OpenGL.hpp>
+#include <windows.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Windows (WGL) implementation of OpenGL contexts
+///
+////////////////////////////////////////////////////////////
+class WglContext : public GlContext
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create a new default context
+ ///
+ /// \param shared Context to share the new one with (can be NULL)
+ ///
+ ////////////////////////////////////////////////////////////
+ WglContext(WglContext* shared);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create a new context attached to a window
+ ///
+ /// \param shared Context to share the new one with
+ /// \param settings Creation parameters
+ /// \param owner Pointer to the owner window
+ /// \param bitsPerPixel Pixel depth, in bits per pixel
+ ///
+ ////////////////////////////////////////////////////////////
+ WglContext(WglContext* shared, const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create a new context that embeds its own rendering target
+ ///
+ /// \param shared Context to share the new one with
+ /// \param settings Creation parameters
+ /// \param width Back buffer width, in pixels
+ /// \param height Back buffer height, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ WglContext(WglContext* shared, const ContextSettings& settings, unsigned int width, unsigned int height);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~WglContext();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Activate the context as the current target for rendering
+ ///
+ /// \return True on success, false if any error happened
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool makeCurrent();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Display what has been rendered to the context so far
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void display();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Enable or disable vertical synchronization
+ ///
+ /// Activating vertical synchronization will limit the number
+ /// of frames displayed to the refresh rate of the monitor.
+ /// This can avoid some visual artifacts, and limit the framerate
+ /// to a good value (but not constant across different computers).
+ ///
+ /// \param enabled: True to enable v-sync, false to deactivate
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setVerticalSyncEnabled(bool enabled);
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create the context
+ ///
+ /// \param shared Context to share the new one with (can be NULL)
+ /// \param bitsPerPixel Pixel depth, in bits per pixel
+ /// \param settings Creation parameters
+ ///
+ ////////////////////////////////////////////////////////////
+ void createContext(WglContext* shared, unsigned int bitsPerPixel, const ContextSettings& settings);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ HWND m_window; ///< Window to which the context is attached
+ HDC m_deviceContext; ///< Device context associated to the context
+ HGLRC m_context; ///< OpenGL context
+ bool m_ownsWindow; ///< Do we own the target window?
+};
+
+} // namespace priv
+
+} // namespace sf
+
+#endif // SFML_WGLCONTEXT_HPP
diff --git a/src/SFML/Window/Win32/WindowImplWin32.cpp b/src/SFML/Window/Win32/WindowImplWin32.cpp
index 4c83cae..69fe2ea 100644
--- a/src/SFML/Window/Win32/WindowImplWin32.cpp
+++ b/src/SFML/Window/Win32/WindowImplWin32.cpp
@@ -1,939 +1,1025 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#ifdef _WIN32_WINDOWS
- #undef _WIN32_WINDOWS
-#endif
-#ifdef _WIN32_WINNT
- #undef _WIN32_WINNT
-#endif
-#define _WIN32_WINDOWS 0x0501
-#define _WIN32_WINNT 0x0501
-#include <SFML/Window/Win32/WindowImplWin32.hpp>
-#include <SFML/Window/WindowStyle.hpp>
-#include <GL/gl.h>
-#include <SFML/System/Err.hpp>
-#include <SFML/System/Utf.hpp>
-#include <vector>
-
-// MinGW lacks the definition of some Win32 constants
-#ifndef XBUTTON1
- #define XBUTTON1 0x0001
-#endif
-#ifndef XBUTTON2
- #define XBUTTON2 0x0002
-#endif
-#ifndef MAPVK_VK_TO_VSC
- #define MAPVK_VK_TO_VSC (0)
-#endif
-
-
-namespace
-{
- unsigned int windowCount = 0;
- const char* classNameA = "SFML_Window";
- const wchar_t* classNameW = L"SFML_Window";
- sf::priv::WindowImplWin32* fullscreenWindow = NULL;
-}
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-WindowImplWin32::WindowImplWin32(WindowHandle handle) :
-m_handle (handle),
-m_callback (0),
-m_cursor (NULL),
-m_icon (NULL),
-m_keyRepeatEnabled(true),
-m_lastSize (0, 0),
-m_resizing (false),
-m_surrogate (0)
-{
- if (m_handle)
- {
- // We change the event procedure of the control (it is important to save the old one)
- SetWindowLongPtr(m_handle, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
- m_callback = SetWindowLongPtr(m_handle, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(&WindowImplWin32::globalOnEvent));
- }
-}
-
-
-////////////////////////////////////////////////////////////
-WindowImplWin32::WindowImplWin32(VideoMode mode, const String& title, Uint32 style, const ContextSettings& /*settings*/) :
-m_handle (NULL),
-m_callback (0),
-m_cursor (NULL),
-m_icon (NULL),
-m_keyRepeatEnabled(true),
-m_lastSize (mode.width, mode.height),
-m_resizing (false),
-m_surrogate (0)
-{
- // Register the window class at first call
- if (windowCount == 0)
- registerWindowClass();
-
- // Compute position and size
- HDC screenDC = GetDC(NULL);
- int left = (GetDeviceCaps(screenDC, HORZRES) - static_cast<int>(mode.width)) / 2;
- int top = (GetDeviceCaps(screenDC, VERTRES) - static_cast<int>(mode.height)) / 2;
- int width = mode.width;
- int height = mode.height;
- ReleaseDC(NULL, screenDC);
-
- // Choose the window style according to the Style parameter
- DWORD win32Style = WS_VISIBLE;
- if (style == Style::None)
- {
- win32Style |= WS_POPUP;
- }
- else
- {
- if (style & Style::Titlebar) win32Style |= WS_CAPTION | WS_MINIMIZEBOX;
- if (style & Style::Resize) win32Style |= WS_THICKFRAME | WS_MAXIMIZEBOX;
- if (style & Style::Close) win32Style |= WS_SYSMENU;
- }
-
- // In windowed mode, adjust width and height so that window will have the requested client area
- bool fullscreen = (style & Style::Fullscreen) != 0;
- if (!fullscreen)
- {
- RECT rectangle = {0, 0, width, height};
- AdjustWindowRect(&rectangle, win32Style, false);
- width = rectangle.right - rectangle.left;
- height = rectangle.bottom - rectangle.top;
- }
-
- // Create the window
- if (hasUnicodeSupport())
- {
- m_handle = CreateWindowW(classNameW, title.toWideString().c_str(), win32Style, left, top, width, height, NULL, NULL, GetModuleHandle(NULL), this);
- }
- else
- {
- m_handle = CreateWindowA(classNameA, title.toAnsiString().c_str(), win32Style, left, top, width, height, NULL, NULL, GetModuleHandle(NULL), this);
- }
-
- // By default, the OS limits the size of the window the the desktop size,
- // we have to resize it after creation to apply the real size
- setSize(Vector2u(mode.width, mode.height));
-
- // Switch to fullscreen if requested
- if (fullscreen)
- switchToFullscreen(mode);
-
- // Increment window count
- windowCount++;
-}
-
-
-////////////////////////////////////////////////////////////
-WindowImplWin32::~WindowImplWin32()
-{
- // Destroy the custom icon, if any
- if (m_icon)
- DestroyIcon(m_icon);
-
- if (!m_callback)
- {
- // Destroy the window
- if (m_handle)
- DestroyWindow(m_handle);
-
- // Decrement the window count
- windowCount--;
-
- // Unregister window class if we were the last window
- if (windowCount == 0)
- {
- if (hasUnicodeSupport())
- {
- UnregisterClassW(classNameW, GetModuleHandle(NULL));
- }
- else
- {
- UnregisterClassA(classNameA, GetModuleHandle(NULL));
- }
- }
- }
- else
- {
- // The window is external : remove the hook on its message callback
- SetWindowLongPtr(m_handle, GWLP_WNDPROC, m_callback);
- }
-}
-
-
-////////////////////////////////////////////////////////////
-WindowHandle WindowImplWin32::getSystemHandle() const
-{
- return m_handle;
-}
-
-
-////////////////////////////////////////////////////////////
-void WindowImplWin32::processEvents()
-{
- // We process the window events only if we own it
- if (!m_callback)
- {
- MSG message;
- while (PeekMessage(&message, NULL, 0, 0, PM_REMOVE))
- {
- TranslateMessage(&message);
- DispatchMessage(&message);
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////
-Vector2i WindowImplWin32::getPosition() const
-{
- RECT rect;
- GetWindowRect(m_handle, &rect);
-
- return Vector2i(rect.left, rect.top);
-}
-
-
-////////////////////////////////////////////////////////////
-void WindowImplWin32::setPosition(const Vector2i& position)
-{
- SetWindowPos(m_handle, NULL, position.x, position.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
-}
-
-
-////////////////////////////////////////////////////////////
-Vector2u WindowImplWin32::getSize() const
-{
- RECT rect;
- GetClientRect(m_handle, &rect);
-
- return Vector2u(rect.right - rect.left, rect.bottom - rect.top);
-}
-
-
-////////////////////////////////////////////////////////////
-void WindowImplWin32::setSize(const Vector2u& size)
-{
- // SetWindowPos wants the total size of the window (including title bar and borders),
- // so we have to compute it
- RECT rectangle = {0, 0, static_cast<long>(size.x), static_cast<long>(size.y)};
- AdjustWindowRect(&rectangle, GetWindowLong(m_handle, GWL_STYLE), false);
- int width = rectangle.right - rectangle.left;
- int height = rectangle.bottom - rectangle.top;
-
- SetWindowPos(m_handle, NULL, 0, 0, width, height, SWP_NOMOVE | SWP_NOZORDER);
-}
-
-
-////////////////////////////////////////////////////////////
-void WindowImplWin32::setTitle(const String& title)
-{
- if (hasUnicodeSupport())
- {
- SetWindowTextW(m_handle, title.toWideString().c_str());
- }
- else
- {
- SetWindowTextA(m_handle, title.toAnsiString().c_str());
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void WindowImplWin32::setIcon(unsigned int width, unsigned int height, const Uint8* pixels)
-{
- // First destroy the previous one
- if (m_icon)
- DestroyIcon(m_icon);
-
- // Windows wants BGRA pixels: swap red and blue channels
- std::vector<Uint8> iconPixels(width * height * 4);
- for (std::size_t i = 0; i < iconPixels.size() / 4; ++i)
- {
- iconPixels[i * 4 + 0] = pixels[i * 4 + 2];
- iconPixels[i * 4 + 1] = pixels[i * 4 + 1];
- iconPixels[i * 4 + 2] = pixels[i * 4 + 0];
- iconPixels[i * 4 + 3] = pixels[i * 4 + 3];
- }
-
- // Create the icon from the pixel array
- m_icon = CreateIcon(GetModuleHandle(NULL), width, height, 1, 32, NULL, &iconPixels[0]);
-
- // Set it as both big and small icon of the window
- if (m_icon)
- {
- SendMessage(m_handle, WM_SETICON, ICON_BIG, (LPARAM)m_icon);
- SendMessage(m_handle, WM_SETICON, ICON_SMALL, (LPARAM)m_icon);
- }
- else
- {
- err() << "Failed to set the window's icon" << std::endl;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void WindowImplWin32::setVisible(bool visible)
-{
- ShowWindow(m_handle, visible ? SW_SHOW : SW_HIDE);
-}
-
-
-////////////////////////////////////////////////////////////
-void WindowImplWin32::setMouseCursorVisible(bool visible)
-{
- if (visible)
- m_cursor = LoadCursor(NULL, IDC_ARROW);
- else
- m_cursor = NULL;
-
- SetCursor(m_cursor);
-}
-
-
-////////////////////////////////////////////////////////////
-void WindowImplWin32::setKeyRepeatEnabled(bool enabled)
-{
- m_keyRepeatEnabled = enabled;
-}
-
-
-////////////////////////////////////////////////////////////
-void WindowImplWin32::registerWindowClass()
-{
- if (hasUnicodeSupport())
- {
- WNDCLASSW windowClass;
- windowClass.style = 0;
- windowClass.lpfnWndProc = &WindowImplWin32::globalOnEvent;
- windowClass.cbClsExtra = 0;
- windowClass.cbWndExtra = 0;
- windowClass.hInstance = GetModuleHandle(NULL);
- windowClass.hIcon = NULL;
- windowClass.hCursor = 0;
- windowClass.hbrBackground = 0;
- windowClass.lpszMenuName = NULL;
- windowClass.lpszClassName = classNameW;
- RegisterClassW(&windowClass);
- }
- else
- {
- WNDCLASSA windowClass;
- windowClass.style = 0;
- windowClass.lpfnWndProc = &WindowImplWin32::globalOnEvent;
- windowClass.cbClsExtra = 0;
- windowClass.cbWndExtra = 0;
- windowClass.hInstance = GetModuleHandle(NULL);
- windowClass.hIcon = NULL;
- windowClass.hCursor = 0;
- windowClass.hbrBackground = 0;
- windowClass.lpszMenuName = NULL;
- windowClass.lpszClassName = classNameA;
- RegisterClassA(&windowClass);
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void WindowImplWin32::switchToFullscreen(const VideoMode& mode)
-{
- DEVMODE devMode;
- devMode.dmSize = sizeof(devMode);
- devMode.dmPelsWidth = mode.width;
- devMode.dmPelsHeight = mode.height;
- devMode.dmBitsPerPel = mode.bitsPerPixel;
- devMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;
-
- // Apply fullscreen mode
- if (ChangeDisplaySettings(&devMode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
- {
- err() << "Failed to change display mode for fullscreen" << std::endl;
- return;
- }
-
- // Make the window flags compatible with fullscreen mode
- SetWindowLong(m_handle, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
- SetWindowLong(m_handle, GWL_EXSTYLE, WS_EX_APPWINDOW);
-
- // Resize the window so that it fits the entire screen
- SetWindowPos(m_handle, HWND_TOP, 0, 0, mode.width, mode.height, SWP_FRAMECHANGED);
- ShowWindow(m_handle, SW_SHOW);
-
- // Set "this" as the current fullscreen window
- fullscreenWindow = this;
-}
-
-
-////////////////////////////////////////////////////////////
-void WindowImplWin32::cleanup()
-{
- // Restore the previous video mode (in case we were running in fullscreen)
- if (fullscreenWindow == this)
- {
- ChangeDisplaySettings(NULL, 0);
- fullscreenWindow = NULL;
- }
-
- // Unhide the mouse cursor (in case it was hidden)
- setMouseCursorVisible(true);
-}
-
-
-////////////////////////////////////////////////////////////
-void WindowImplWin32::processEvent(UINT message, WPARAM wParam, LPARAM lParam)
-{
- // Don't process any message until window is created
- if (m_handle == NULL)
- return;
-
- switch (message)
- {
- // Destroy event
- case WM_DESTROY :
- {
- // Here we must cleanup resources !
- cleanup();
- break;
- }
-
- // Set cursor event
- case WM_SETCURSOR :
- {
- // The mouse has moved, if the cursor is in our window we must refresh the cursor
- if (LOWORD(lParam) == HTCLIENT)
- SetCursor(m_cursor);
-
- break;
- }
-
- // Close event
- case WM_CLOSE :
- {
- Event event;
- event.type = Event::Closed;
- pushEvent(event);
- break;
- }
-
- // Resize event
- case WM_SIZE :
- {
- // Consider only events triggered by a maximize or a un-maximize
- if (wParam != SIZE_MINIMIZED && !m_resizing && m_lastSize != getSize())
- {
- // Update the last handled size
- m_lastSize = getSize();
-
- // Push a resize event
- Event event;
- event.type = Event::Resized;
- event.size.width = m_lastSize.x;
- event.size.height = m_lastSize.y;
- pushEvent(event);
- }
- break;
- }
-
- // Start resizing
- case WM_ENTERSIZEMOVE:
- {
- m_resizing = true;
- break;
- }
-
- // Stop resizing
- case WM_EXITSIZEMOVE:
- {
- m_resizing = false;
-
- // Ignore cases where the window has only been moved
- if(m_lastSize != getSize())
- {
- // Update the last handled size
- m_lastSize = getSize();
-
- // Push a resize event
- Event event;
- event.type = Event::Resized;
- event.size.width = m_lastSize.x;
- event.size.height = m_lastSize.y;
- pushEvent(event);
- }
- break;
- }
-
- // The system request the min/max window size and position
- case WM_GETMINMAXINFO :
- {
- // We override the returned information to remove the default limit
- // (the OS doesn't allow windows bigger than the desktop by default)
- MINMAXINFO* info = reinterpret_cast<MINMAXINFO*>(lParam);
- info->ptMaxTrackSize.x = 50000;
- info->ptMaxTrackSize.y = 50000;
- break;
- }
-
- // Gain focus event
- case WM_SETFOCUS :
- {
- Event event;
- event.type = Event::GainedFocus;
- pushEvent(event);
- break;
- }
-
- // Lost focus event
- case WM_KILLFOCUS :
- {
- Event event;
- event.type = Event::LostFocus;
- pushEvent(event);
- break;
- }
-
- // Text event
- case WM_CHAR :
- {
- if (m_keyRepeatEnabled || ((lParam & (1 << 30)) == 0))
- {
- // Get the code of the typed character
- Uint32 character = static_cast<Uint32>(wParam);
-
- // Check if it is the first part of a surrogate pair, or a regular character
- if ((character >= 0xD800) && (character <= 0xDBFF))
- {
- // First part of a surrogate pair: store it and wait for the second one
- m_surrogate = static_cast<Uint16>(character);
- }
- else
- {
-
- // Check if it is the second part of a surrogate pair, or a regular character
- if ((character >= 0xDC00) && (character <= 0xDFFF))
- {
- // Convert the UTF-16 surrogate pair to a single UTF-32 value
- Uint16 utf16[] = {m_surrogate, static_cast<Uint16>(character)};
- sf::Utf16::toUtf32(utf16, utf16 + 2, &character);
- m_surrogate = 0;
- }
-
- // Send a TextEntered event
- Event event;
- event.type = Event::TextEntered;
- event.text.unicode = character;
- pushEvent(event);
- }
- }
- break;
- }
-
- // Keydown event
- case WM_KEYDOWN :
- case WM_SYSKEYDOWN :
- {
- if (m_keyRepeatEnabled || ((HIWORD(lParam) & KF_REPEAT) == 0))
- {
- Event event;
- event.type = Event::KeyPressed;
- event.key.alt = HIWORD(GetAsyncKeyState(VK_MENU)) != 0;
- event.key.control = HIWORD(GetAsyncKeyState(VK_CONTROL)) != 0;
- event.key.shift = HIWORD(GetAsyncKeyState(VK_SHIFT)) != 0;
- event.key.system = HIWORD(GetAsyncKeyState(VK_LWIN)) || HIWORD(GetAsyncKeyState(VK_RWIN));
- event.key.code = virtualKeyCodeToSF(wParam, lParam);
- pushEvent(event);
- }
- break;
- }
-
- // Keyup event
- case WM_KEYUP :
- case WM_SYSKEYUP :
- {
- Event event;
- event.type = Event::KeyReleased;
- event.key.alt = HIWORD(GetAsyncKeyState(VK_MENU)) != 0;
- event.key.control = HIWORD(GetAsyncKeyState(VK_CONTROL)) != 0;
- event.key.shift = HIWORD(GetAsyncKeyState(VK_SHIFT)) != 0;
- event.key.system = HIWORD(GetAsyncKeyState(VK_LWIN)) || HIWORD(GetAsyncKeyState(VK_RWIN));
- event.key.code = virtualKeyCodeToSF(wParam, lParam);
- pushEvent(event);
- break;
- }
-
- // Mouse wheel event
- case WM_MOUSEWHEEL :
- {
- // Mouse position is in screen coordinates, convert it to window coordinates
- POINT position;
- position.x = static_cast<Int16>(LOWORD(lParam));
- position.y = static_cast<Int16>(HIWORD(lParam));
- ScreenToClient(m_handle, &position);
-
- Event event;
- event.type = Event::MouseWheelMoved;
- event.mouseWheel.delta = static_cast<Int16>(HIWORD(wParam)) / 120;
- event.mouseWheel.x = position.x;
- event.mouseWheel.y = position.y;
- pushEvent(event);
- break;
- }
-
- // Mouse left button down event
- case WM_LBUTTONDOWN :
- {
- Event event;
- event.type = Event::MouseButtonPressed;
- event.mouseButton.button = Mouse::Left;
- event.mouseButton.x = static_cast<Int16>(LOWORD(lParam));
- event.mouseButton.y = static_cast<Int16>(HIWORD(lParam));
- pushEvent(event);
- break;
- }
-
- // Mouse left button up event
- case WM_LBUTTONUP :
- {
- Event event;
- event.type = Event::MouseButtonReleased;
- event.mouseButton.button = Mouse::Left;
- event.mouseButton.x = static_cast<Int16>(LOWORD(lParam));
- event.mouseButton.y = static_cast<Int16>(HIWORD(lParam));
- pushEvent(event);
- break;
- }
-
- // Mouse right button down event
- case WM_RBUTTONDOWN :
- {
- Event event;
- event.type = Event::MouseButtonPressed;
- event.mouseButton.button = Mouse::Right;
- event.mouseButton.x = static_cast<Int16>(LOWORD(lParam));
- event.mouseButton.y = static_cast<Int16>(HIWORD(lParam));
- pushEvent(event);
- break;
- }
-
- // Mouse right button up event
- case WM_RBUTTONUP :
- {
- Event event;
- event.type = Event::MouseButtonReleased;
- event.mouseButton.button = Mouse::Right;
- event.mouseButton.x = static_cast<Int16>(LOWORD(lParam));
- event.mouseButton.y = static_cast<Int16>(HIWORD(lParam));
- pushEvent(event);
- break;
- }
-
- // Mouse wheel button down event
- case WM_MBUTTONDOWN :
- {
- Event event;
- event.type = Event::MouseButtonPressed;
- event.mouseButton.button = Mouse::Middle;
- event.mouseButton.x = static_cast<Int16>(LOWORD(lParam));
- event.mouseButton.y = static_cast<Int16>(HIWORD(lParam));
- pushEvent(event);
- break;
- }
-
- // Mouse wheel button up event
- case WM_MBUTTONUP :
- {
- Event event;
- event.type = Event::MouseButtonReleased;
- event.mouseButton.button = Mouse::Middle;
- event.mouseButton.x = static_cast<Int16>(LOWORD(lParam));
- event.mouseButton.y = static_cast<Int16>(HIWORD(lParam));
- pushEvent(event);
- break;
- }
-
- // Mouse X button down event
- case WM_XBUTTONDOWN :
- {
- Event event;
- event.type = Event::MouseButtonPressed;
- event.mouseButton.button = HIWORD(wParam) == XBUTTON1 ? Mouse::XButton1 : Mouse::XButton2;
- event.mouseButton.x = static_cast<Int16>(LOWORD(lParam));
- event.mouseButton.y = static_cast<Int16>(HIWORD(lParam));
- pushEvent(event);
- break;
- }
-
- // Mouse X button up event
- case WM_XBUTTONUP :
- {
- Event event;
- event.type = Event::MouseButtonReleased;
- event.mouseButton.button = HIWORD(wParam) == XBUTTON1 ? Mouse::XButton1 : Mouse::XButton2;
- event.mouseButton.x = static_cast<Int16>(LOWORD(lParam));
- event.mouseButton.y = static_cast<Int16>(HIWORD(lParam));
- pushEvent(event);
- break;
- }
-
- // Mouse move event
- case WM_MOUSEMOVE :
- {
- // Extract the mouse local coordinates
- int x = static_cast<Int16>(LOWORD(lParam));
- int y = static_cast<Int16>(HIWORD(lParam));
-
- // Get the client area of the window
- RECT area;
- GetClientRect(m_handle, &area);
-
- // Check the mouse position against the window
- if ((x < area.left) || (x > area.right) || (y < area.top) || (y > area.bottom))
- {
- // Mouse is outside
-
- // Release the mouse capture
- ReleaseCapture();
-
- // Generate a MouseLeft event
- Event event;
- event.type = Event::MouseLeft;
- pushEvent(event);
- }
- else
- {
- // Mouse is inside
- if (GetCapture() != m_handle)
- {
- // Mouse was previously outside the window
-
- // Capture the mouse
- SetCapture(m_handle);
-
- // Generate a MouseEntered event
- Event event;
- event.type = Event::MouseEntered;
- pushEvent(event);
- }
-
- // Generate a MouseMove event
- Event event;
- event.type = Event::MouseMoved;
- event.mouseMove.x = x;
- event.mouseMove.y = y;
- pushEvent(event);
- break;
- }
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////
-Keyboard::Key WindowImplWin32::virtualKeyCodeToSF(WPARAM key, LPARAM flags)
-{
- switch (key)
- {
- // Check the scancode to distinguish between left and right shift
- case VK_SHIFT :
- {
- static UINT lShift = MapVirtualKey(VK_LSHIFT, MAPVK_VK_TO_VSC);
- UINT scancode = static_cast<UINT>((flags & (0xFF << 16)) >> 16);
- return scancode == lShift ? Keyboard::LShift : Keyboard::RShift;
- }
-
- // Check the "extended" flag to distinguish between left and right alt
- case VK_MENU : return (HIWORD(flags) & KF_EXTENDED) ? Keyboard::RAlt : Keyboard::LAlt;
-
- // Check the "extended" flag to distinguish between left and right control
- case VK_CONTROL : return (HIWORD(flags) & KF_EXTENDED) ? Keyboard::RControl : Keyboard::LControl;
-
- // Other keys are reported properly
- case VK_LWIN : return Keyboard::LSystem;
- case VK_RWIN : return Keyboard::RSystem;
- case VK_APPS : return Keyboard::Menu;
- case VK_OEM_1 : return Keyboard::SemiColon;
- case VK_OEM_2 : return Keyboard::Slash;
- case VK_OEM_PLUS : return Keyboard::Equal;
- case VK_OEM_MINUS : return Keyboard::Dash;
- case VK_OEM_4 : return Keyboard::LBracket;
- case VK_OEM_6 : return Keyboard::RBracket;
- case VK_OEM_COMMA : return Keyboard::Comma;
- case VK_OEM_PERIOD : return Keyboard::Period;
- case VK_OEM_7 : return Keyboard::Quote;
- case VK_OEM_5 : return Keyboard::BackSlash;
- case VK_OEM_3 : return Keyboard::Tilde;
- case VK_ESCAPE : return Keyboard::Escape;
- case VK_SPACE : return Keyboard::Space;
- case VK_RETURN : return Keyboard::Return;
- case VK_BACK : return Keyboard::BackSpace;
- case VK_TAB : return Keyboard::Tab;
- case VK_PRIOR : return Keyboard::PageUp;
- case VK_NEXT : return Keyboard::PageDown;
- case VK_END : return Keyboard::End;
- case VK_HOME : return Keyboard::Home;
- case VK_INSERT : return Keyboard::Insert;
- case VK_DELETE : return Keyboard::Delete;
- case VK_ADD : return Keyboard::Add;
- case VK_SUBTRACT : return Keyboard::Subtract;
- case VK_MULTIPLY : return Keyboard::Multiply;
- case VK_DIVIDE : return Keyboard::Divide;
- case VK_PAUSE : return Keyboard::Pause;
- case VK_F1 : return Keyboard::F1;
- case VK_F2 : return Keyboard::F2;
- case VK_F3 : return Keyboard::F3;
- case VK_F4 : return Keyboard::F4;
- case VK_F5 : return Keyboard::F5;
- case VK_F6 : return Keyboard::F6;
- case VK_F7 : return Keyboard::F7;
- case VK_F8 : return Keyboard::F8;
- case VK_F9 : return Keyboard::F9;
- case VK_F10 : return Keyboard::F10;
- case VK_F11 : return Keyboard::F11;
- case VK_F12 : return Keyboard::F12;
- case VK_F13 : return Keyboard::F13;
- case VK_F14 : return Keyboard::F14;
- case VK_F15 : return Keyboard::F15;
- case VK_LEFT : return Keyboard::Left;
- case VK_RIGHT : return Keyboard::Right;
- case VK_UP : return Keyboard::Up;
- case VK_DOWN : return Keyboard::Down;
- case VK_NUMPAD0 : return Keyboard::Numpad0;
- case VK_NUMPAD1 : return Keyboard::Numpad1;
- case VK_NUMPAD2 : return Keyboard::Numpad2;
- case VK_NUMPAD3 : return Keyboard::Numpad3;
- case VK_NUMPAD4 : return Keyboard::Numpad4;
- case VK_NUMPAD5 : return Keyboard::Numpad5;
- case VK_NUMPAD6 : return Keyboard::Numpad6;
- case VK_NUMPAD7 : return Keyboard::Numpad7;
- case VK_NUMPAD8 : return Keyboard::Numpad8;
- case VK_NUMPAD9 : return Keyboard::Numpad9;
- case 'A' : return Keyboard::A;
- case 'Z' : return Keyboard::Z;
- case 'E' : return Keyboard::E;
- case 'R' : return Keyboard::R;
- case 'T' : return Keyboard::T;
- case 'Y' : return Keyboard::Y;
- case 'U' : return Keyboard::U;
- case 'I' : return Keyboard::I;
- case 'O' : return Keyboard::O;
- case 'P' : return Keyboard::P;
- case 'Q' : return Keyboard::Q;
- case 'S' : return Keyboard::S;
- case 'D' : return Keyboard::D;
- case 'F' : return Keyboard::F;
- case 'G' : return Keyboard::G;
- case 'H' : return Keyboard::H;
- case 'J' : return Keyboard::J;
- case 'K' : return Keyboard::K;
- case 'L' : return Keyboard::L;
- case 'M' : return Keyboard::M;
- case 'W' : return Keyboard::W;
- case 'X' : return Keyboard::X;
- case 'C' : return Keyboard::C;
- case 'V' : return Keyboard::V;
- case 'B' : return Keyboard::B;
- case 'N' : return Keyboard::N;
- case '0' : return Keyboard::Num0;
- case '1' : return Keyboard::Num1;
- case '2' : return Keyboard::Num2;
- case '3' : return Keyboard::Num3;
- case '4' : return Keyboard::Num4;
- case '5' : return Keyboard::Num5;
- case '6' : return Keyboard::Num6;
- case '7' : return Keyboard::Num7;
- case '8' : return Keyboard::Num8;
- case '9' : return Keyboard::Num9;
- }
-
- return Keyboard::Unknown;
-}
-
-
-////////////////////////////////////////////////////////////
-bool WindowImplWin32::hasUnicodeSupport()
-{
- OSVERSIONINFO version;
- ZeroMemory(&version, sizeof(version));
- version.dwOSVersionInfoSize = sizeof(version);
-
- if (GetVersionEx(&version))
- {
- return version.dwPlatformId == VER_PLATFORM_WIN32_NT;
- }
- else
- {
- return false;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-LRESULT CALLBACK WindowImplWin32::globalOnEvent(HWND handle, UINT message, WPARAM wParam, LPARAM lParam)
-{
- // Associate handle and Window instance when the creation message is received
- if (message == WM_CREATE)
- {
- // Get WindowImplWin32 instance (it was passed as the last argument of CreateWindow)
- LONG_PTR window = (LONG_PTR)reinterpret_cast<CREATESTRUCT*>(lParam)->lpCreateParams;
-
- // Set as the "user data" parameter of the window
- SetWindowLongPtr(handle, GWLP_USERDATA, window);
- }
-
- // Get the WindowImpl instance corresponding to the window handle
- WindowImplWin32* window = handle ? reinterpret_cast<WindowImplWin32*>(GetWindowLongPtr(handle, GWLP_USERDATA)) : NULL;
-
- // Forward the event to the appropriate function
- if (window)
- {
- window->processEvent(message, wParam, lParam);
-
- if (window->m_callback)
- return CallWindowProc(reinterpret_cast<WNDPROC>(window->m_callback), handle, message, wParam, lParam);
- }
-
- // We don't forward the WM_CLOSE message to prevent the OS from automatically destroying the window
- if (message == WM_CLOSE)
- return 0;
-
- // Don't forward the menu system command, so that pressing ALT or F10 doesn't steal the focus
- if ((message == WM_SYSCOMMAND) && (wParam == SC_KEYMENU))
- return 0;
-
- static const bool hasUnicode = hasUnicodeSupport();
- return hasUnicode ? DefWindowProcW(handle, message, wParam, lParam) :
- DefWindowProcA(handle, message, wParam, lParam);
-}
-
-} // namespace priv
-
-} // namespace sf
-
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#ifdef _WIN32_WINDOWS
+ #undef _WIN32_WINDOWS
+#endif
+#ifdef _WIN32_WINNT
+ #undef _WIN32_WINNT
+#endif
+#define _WIN32_WINDOWS 0x0501
+#define _WIN32_WINNT 0x0501
+#define WINVER 0x0501
+#include <SFML/Window/Win32/WindowImplWin32.hpp>
+#include <SFML/Window/WindowStyle.hpp>
+#include <GL/gl.h>
+#include <SFML/System/Err.hpp>
+#include <SFML/System/Utf.hpp>
+#include <vector>
+
+// MinGW lacks the definition of some Win32 constants
+#ifndef XBUTTON1
+ #define XBUTTON1 0x0001
+#endif
+#ifndef XBUTTON2
+ #define XBUTTON2 0x0002
+#endif
+#ifndef MAPVK_VK_TO_VSC
+ #define MAPVK_VK_TO_VSC (0)
+#endif
+
+
+namespace
+{
+ unsigned int windowCount = 0;
+ const wchar_t* className = L"SFML_Window";
+ sf::priv::WindowImplWin32* fullscreenWindow = NULL;
+
+ void setProcessDpiAware()
+ {
+ // Try SetProcessDpiAwareness first
+ HINSTANCE shCoreDll = LoadLibrary(L"Shcore.dll");
+
+ if (shCoreDll)
+ {
+ enum ProcessDpiAwareness
+ {
+ ProcessDpiUnaware = 0,
+ ProcessSystemDpiAware = 1,
+ ProcessPerMonitorDpiAware = 2
+ };
+
+ typedef HRESULT (WINAPI* SetProcessDpiAwarenessFuncType)(ProcessDpiAwareness);
+ SetProcessDpiAwarenessFuncType SetProcessDpiAwarenessFunc = reinterpret_cast<SetProcessDpiAwarenessFuncType>(GetProcAddress(shCoreDll, "SetProcessDpiAwareness"));
+
+ if (SetProcessDpiAwarenessFunc)
+ {
+ // We only check for E_INVALIDARG because we would get
+ // E_ACCESSDENIED if the DPI was already set previously
+ // and S_OK means the call was successful
+ if (SetProcessDpiAwarenessFunc(ProcessSystemDpiAware) == E_INVALIDARG)
+ {
+ sf::err() << "Failed to set process DPI awareness" << std::endl;
+ }
+ else
+ {
+ FreeLibrary(shCoreDll);
+ return;
+ }
+ }
+
+ FreeLibrary(shCoreDll);
+ }
+
+ // Fall back to SetProcessDPIAware if SetProcessDpiAwareness
+ // is not available on this system
+ HINSTANCE user32Dll = LoadLibrary(L"user32.dll");
+
+ if (user32Dll)
+ {
+ typedef BOOL (WINAPI* SetProcessDPIAwareFuncType)(void);
+ SetProcessDPIAwareFuncType SetProcessDPIAwareFunc = reinterpret_cast<SetProcessDPIAwareFuncType>(GetProcAddress(user32Dll, "SetProcessDPIAware"));
+
+ if (SetProcessDPIAwareFunc)
+ {
+ if (!SetProcessDPIAwareFunc())
+ sf::err() << "Failed to set process DPI awareness" << std::endl;
+ }
+
+ FreeLibrary(user32Dll);
+ }
+ }
+}
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+WindowImplWin32::WindowImplWin32(WindowHandle handle) :
+m_handle (handle),
+m_callback (0),
+m_cursor (NULL),
+m_icon (NULL),
+m_keyRepeatEnabled(true),
+m_lastSize (0, 0),
+m_resizing (false),
+m_surrogate (0),
+m_mouseInside (false)
+{
+ // Set that this process is DPI aware and can handle DPI scaling
+ setProcessDpiAware();
+
+ if (m_handle)
+ {
+ // We change the event procedure of the control (it is important to save the old one)
+ SetWindowLongPtrW(m_handle, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
+ m_callback = SetWindowLongPtrW(m_handle, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(&WindowImplWin32::globalOnEvent));
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+WindowImplWin32::WindowImplWin32(VideoMode mode, const String& title, Uint32 style, const ContextSettings& /*settings*/) :
+m_handle (NULL),
+m_callback (0),
+m_cursor (NULL),
+m_icon (NULL),
+m_keyRepeatEnabled(true),
+m_lastSize (mode.width, mode.height),
+m_resizing (false),
+m_surrogate (0),
+m_mouseInside (false)
+{
+ // Set that this process is DPI aware and can handle DPI scaling
+ setProcessDpiAware();
+
+ // Register the window class at first call
+ if (windowCount == 0)
+ registerWindowClass();
+
+ // Compute position and size
+ HDC screenDC = GetDC(NULL);
+ int left = (GetDeviceCaps(screenDC, HORZRES) - static_cast<int>(mode.width)) / 2;
+ int top = (GetDeviceCaps(screenDC, VERTRES) - static_cast<int>(mode.height)) / 2;
+ int width = mode.width;
+ int height = mode.height;
+ ReleaseDC(NULL, screenDC);
+
+ // Choose the window style according to the Style parameter
+ DWORD win32Style = WS_VISIBLE;
+ if (style == Style::None)
+ {
+ win32Style |= WS_POPUP;
+ }
+ else
+ {
+ if (style & Style::Titlebar) win32Style |= WS_CAPTION | WS_MINIMIZEBOX;
+ if (style & Style::Resize) win32Style |= WS_THICKFRAME | WS_MAXIMIZEBOX;
+ if (style & Style::Close) win32Style |= WS_SYSMENU;
+ }
+
+ // In windowed mode, adjust width and height so that window will have the requested client area
+ bool fullscreen = (style & Style::Fullscreen) != 0;
+ if (!fullscreen)
+ {
+ RECT rectangle = {0, 0, width, height};
+ AdjustWindowRect(&rectangle, win32Style, false);
+ width = rectangle.right - rectangle.left;
+ height = rectangle.bottom - rectangle.top;
+ }
+
+ // Create the window
+ m_handle = CreateWindowW(className, title.toWideString().c_str(), win32Style, left, top, width, height, NULL, NULL, GetModuleHandle(NULL), this);
+
+ // By default, the OS limits the size of the window the the desktop size,
+ // we have to resize it after creation to apply the real size
+ setSize(Vector2u(mode.width, mode.height));
+
+ // Switch to fullscreen if requested
+ if (fullscreen)
+ switchToFullscreen(mode);
+
+ // Increment window count
+ windowCount++;
+}
+
+
+////////////////////////////////////////////////////////////
+WindowImplWin32::~WindowImplWin32()
+{
+ // Destroy the custom icon, if any
+ if (m_icon)
+ DestroyIcon(m_icon);
+
+ if (!m_callback)
+ {
+ // Destroy the window
+ if (m_handle)
+ DestroyWindow(m_handle);
+
+ // Decrement the window count
+ windowCount--;
+
+ // Unregister window class if we were the last window
+ if (windowCount == 0)
+ UnregisterClassW(className, GetModuleHandleW(NULL));
+ }
+ else
+ {
+ // The window is external: remove the hook on its message callback
+ SetWindowLongPtrW(m_handle, GWLP_WNDPROC, m_callback);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+WindowHandle WindowImplWin32::getSystemHandle() const
+{
+ return m_handle;
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplWin32::processEvents()
+{
+ // We process the window events only if we own it
+ if (!m_callback)
+ {
+ MSG message;
+ while (PeekMessageW(&message, NULL, 0, 0, PM_REMOVE))
+ {
+ TranslateMessage(&message);
+ DispatchMessageW(&message);
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i WindowImplWin32::getPosition() const
+{
+ RECT rect;
+ GetWindowRect(m_handle, &rect);
+
+ return Vector2i(rect.left, rect.top);
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplWin32::setPosition(const Vector2i& position)
+{
+ SetWindowPos(m_handle, NULL, position.x, position.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2u WindowImplWin32::getSize() const
+{
+ RECT rect;
+ GetClientRect(m_handle, &rect);
+
+ return Vector2u(rect.right - rect.left, rect.bottom - rect.top);
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplWin32::setSize(const Vector2u& size)
+{
+ // SetWindowPos wants the total size of the window (including title bar and borders),
+ // so we have to compute it
+ RECT rectangle = {0, 0, static_cast<long>(size.x), static_cast<long>(size.y)};
+ AdjustWindowRect(&rectangle, GetWindowLong(m_handle, GWL_STYLE), false);
+ int width = rectangle.right - rectangle.left;
+ int height = rectangle.bottom - rectangle.top;
+
+ SetWindowPos(m_handle, NULL, 0, 0, width, height, SWP_NOMOVE | SWP_NOZORDER);
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplWin32::setTitle(const String& title)
+{
+ SetWindowTextW(m_handle, title.toWideString().c_str());
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplWin32::setIcon(unsigned int width, unsigned int height, const Uint8* pixels)
+{
+ // First destroy the previous one
+ if (m_icon)
+ DestroyIcon(m_icon);
+
+ // Windows wants BGRA pixels: swap red and blue channels
+ std::vector<Uint8> iconPixels(width * height * 4);
+ for (std::size_t i = 0; i < iconPixels.size() / 4; ++i)
+ {
+ iconPixels[i * 4 + 0] = pixels[i * 4 + 2];
+ iconPixels[i * 4 + 1] = pixels[i * 4 + 1];
+ iconPixels[i * 4 + 2] = pixels[i * 4 + 0];
+ iconPixels[i * 4 + 3] = pixels[i * 4 + 3];
+ }
+
+ // Create the icon from the pixel array
+ m_icon = CreateIcon(GetModuleHandleW(NULL), width, height, 1, 32, NULL, &iconPixels[0]);
+
+ // Set it as both big and small icon of the window
+ if (m_icon)
+ {
+ SendMessageW(m_handle, WM_SETICON, ICON_BIG, (LPARAM)m_icon);
+ SendMessageW(m_handle, WM_SETICON, ICON_SMALL, (LPARAM)m_icon);
+ }
+ else
+ {
+ err() << "Failed to set the window's icon" << std::endl;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplWin32::setVisible(bool visible)
+{
+ ShowWindow(m_handle, visible ? SW_SHOW : SW_HIDE);
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplWin32::setMouseCursorVisible(bool visible)
+{
+ if (visible)
+ m_cursor = LoadCursorW(NULL, IDC_ARROW);
+ else
+ m_cursor = NULL;
+
+ SetCursor(m_cursor);
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplWin32::setKeyRepeatEnabled(bool enabled)
+{
+ m_keyRepeatEnabled = enabled;
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplWin32::requestFocus()
+{
+ // Allow focus stealing only within the same process; compare PIDs of current and foreground window
+ DWORD thisPid = GetWindowThreadProcessId(m_handle, NULL);
+ DWORD foregroundPid = GetWindowThreadProcessId(GetForegroundWindow(), NULL);
+
+ if (thisPid == foregroundPid)
+ {
+ // The window requesting focus belongs to the same process as the current window: steal focus
+ SetForegroundWindow(m_handle);
+ }
+ else
+ {
+ // Different process: don't steal focus, but create a taskbar notification ("flash")
+ FLASHWINFO info;
+ info.cbSize = sizeof(info);
+ info.hwnd = m_handle;
+ info.dwFlags = FLASHW_TRAY;
+ info.dwTimeout = 0;
+ info.uCount = 3;
+
+ FlashWindowEx(&info);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+bool WindowImplWin32::hasFocus() const
+{
+ return m_handle == GetForegroundWindow();
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplWin32::registerWindowClass()
+{
+ WNDCLASSW windowClass;
+ windowClass.style = 0;
+ windowClass.lpfnWndProc = &WindowImplWin32::globalOnEvent;
+ windowClass.cbClsExtra = 0;
+ windowClass.cbWndExtra = 0;
+ windowClass.hInstance = GetModuleHandleW(NULL);
+ windowClass.hIcon = NULL;
+ windowClass.hCursor = 0;
+ windowClass.hbrBackground = 0;
+ windowClass.lpszMenuName = NULL;
+ windowClass.lpszClassName = className;
+ RegisterClassW(&windowClass);
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplWin32::switchToFullscreen(const VideoMode& mode)
+{
+ DEVMODE devMode;
+ devMode.dmSize = sizeof(devMode);
+ devMode.dmPelsWidth = mode.width;
+ devMode.dmPelsHeight = mode.height;
+ devMode.dmBitsPerPel = mode.bitsPerPixel;
+ devMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;
+
+ // Apply fullscreen mode
+ if (ChangeDisplaySettingsW(&devMode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
+ {
+ err() << "Failed to change display mode for fullscreen" << std::endl;
+ return;
+ }
+
+ // Make the window flags compatible with fullscreen mode
+ SetWindowLongW(m_handle, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
+ SetWindowLongW(m_handle, GWL_EXSTYLE, WS_EX_APPWINDOW);
+
+ // Resize the window so that it fits the entire screen
+ SetWindowPos(m_handle, HWND_TOP, 0, 0, mode.width, mode.height, SWP_FRAMECHANGED);
+ ShowWindow(m_handle, SW_SHOW);
+
+ // Set "this" as the current fullscreen window
+ fullscreenWindow = this;
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplWin32::cleanup()
+{
+ // Restore the previous video mode (in case we were running in fullscreen)
+ if (fullscreenWindow == this)
+ {
+ ChangeDisplaySettingsW(NULL, 0);
+ fullscreenWindow = NULL;
+ }
+
+ // Unhide the mouse cursor (in case it was hidden)
+ setMouseCursorVisible(true);
+
+ // No longer track the cursor
+ setTracking(false);
+
+ // No longer capture the cursor
+ ReleaseCapture();
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplWin32::setTracking(bool track)
+{
+ TRACKMOUSEEVENT mouseEvent;
+ mouseEvent.cbSize = sizeof(TRACKMOUSEEVENT);
+ mouseEvent.dwFlags = track ? TME_LEAVE : TME_CANCEL;
+ mouseEvent.hwndTrack = m_handle;
+ mouseEvent.dwHoverTime = HOVER_DEFAULT;
+ TrackMouseEvent(&mouseEvent);
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplWin32::processEvent(UINT message, WPARAM wParam, LPARAM lParam)
+{
+ // Don't process any message until window is created
+ if (m_handle == NULL)
+ return;
+
+ switch (message)
+ {
+ // Destroy event
+ case WM_DESTROY:
+ {
+ // Here we must cleanup resources !
+ cleanup();
+ break;
+ }
+
+ // Set cursor event
+ case WM_SETCURSOR:
+ {
+ // The mouse has moved, if the cursor is in our window we must refresh the cursor
+ if (LOWORD(lParam) == HTCLIENT)
+ SetCursor(m_cursor);
+
+ break;
+ }
+
+ // Close event
+ case WM_CLOSE:
+ {
+ Event event;
+ event.type = Event::Closed;
+ pushEvent(event);
+ break;
+ }
+
+ // Resize event
+ case WM_SIZE:
+ {
+ // Consider only events triggered by a maximize or a un-maximize
+ if (wParam != SIZE_MINIMIZED && !m_resizing && m_lastSize != getSize())
+ {
+ // Update the last handled size
+ m_lastSize = getSize();
+
+ // Push a resize event
+ Event event;
+ event.type = Event::Resized;
+ event.size.width = m_lastSize.x;
+ event.size.height = m_lastSize.y;
+ pushEvent(event);
+ }
+ break;
+ }
+
+ // Start resizing
+ case WM_ENTERSIZEMOVE:
+ {
+ m_resizing = true;
+ break;
+ }
+
+ // Stop resizing
+ case WM_EXITSIZEMOVE:
+ {
+ m_resizing = false;
+
+ // Ignore cases where the window has only been moved
+ if(m_lastSize != getSize())
+ {
+ // Update the last handled size
+ m_lastSize = getSize();
+
+ // Push a resize event
+ Event event;
+ event.type = Event::Resized;
+ event.size.width = m_lastSize.x;
+ event.size.height = m_lastSize.y;
+ pushEvent(event);
+ }
+ break;
+ }
+
+ // The system request the min/max window size and position
+ case WM_GETMINMAXINFO:
+ {
+ // We override the returned information to remove the default limit
+ // (the OS doesn't allow windows bigger than the desktop by default)
+ MINMAXINFO* info = reinterpret_cast<MINMAXINFO*>(lParam);
+ info->ptMaxTrackSize.x = 50000;
+ info->ptMaxTrackSize.y = 50000;
+ break;
+ }
+
+ // Gain focus event
+ case WM_SETFOCUS:
+ {
+ Event event;
+ event.type = Event::GainedFocus;
+ pushEvent(event);
+ break;
+ }
+
+ // Lost focus event
+ case WM_KILLFOCUS:
+ {
+ Event event;
+ event.type = Event::LostFocus;
+ pushEvent(event);
+ break;
+ }
+
+ // Text event
+ case WM_CHAR:
+ {
+ if (m_keyRepeatEnabled || ((lParam & (1 << 30)) == 0))
+ {
+ // Get the code of the typed character
+ Uint32 character = static_cast<Uint32>(wParam);
+
+ // Check if it is the first part of a surrogate pair, or a regular character
+ if ((character >= 0xD800) && (character <= 0xDBFF))
+ {
+ // First part of a surrogate pair: store it and wait for the second one
+ m_surrogate = static_cast<Uint16>(character);
+ }
+ else
+ {
+ // Check if it is the second part of a surrogate pair, or a regular character
+ if ((character >= 0xDC00) && (character <= 0xDFFF))
+ {
+ // Convert the UTF-16 surrogate pair to a single UTF-32 value
+ Uint16 utf16[] = {m_surrogate, static_cast<Uint16>(character)};
+ sf::Utf16::toUtf32(utf16, utf16 + 2, &character);
+ m_surrogate = 0;
+ }
+
+ // Send a TextEntered event
+ Event event;
+ event.type = Event::TextEntered;
+ event.text.unicode = character;
+ pushEvent(event);
+ }
+ }
+ break;
+ }
+
+ // Keydown event
+ case WM_KEYDOWN:
+ case WM_SYSKEYDOWN:
+ {
+ if (m_keyRepeatEnabled || ((HIWORD(lParam) & KF_REPEAT) == 0))
+ {
+ Event event;
+ event.type = Event::KeyPressed;
+ event.key.alt = HIWORD(GetAsyncKeyState(VK_MENU)) != 0;
+ event.key.control = HIWORD(GetAsyncKeyState(VK_CONTROL)) != 0;
+ event.key.shift = HIWORD(GetAsyncKeyState(VK_SHIFT)) != 0;
+ event.key.system = HIWORD(GetAsyncKeyState(VK_LWIN)) || HIWORD(GetAsyncKeyState(VK_RWIN));
+ event.key.code = virtualKeyCodeToSF(wParam, lParam);
+ pushEvent(event);
+ }
+ break;
+ }
+
+ // Keyup event
+ case WM_KEYUP:
+ case WM_SYSKEYUP:
+ {
+ Event event;
+ event.type = Event::KeyReleased;
+ event.key.alt = HIWORD(GetAsyncKeyState(VK_MENU)) != 0;
+ event.key.control = HIWORD(GetAsyncKeyState(VK_CONTROL)) != 0;
+ event.key.shift = HIWORD(GetAsyncKeyState(VK_SHIFT)) != 0;
+ event.key.system = HIWORD(GetAsyncKeyState(VK_LWIN)) || HIWORD(GetAsyncKeyState(VK_RWIN));
+ event.key.code = virtualKeyCodeToSF(wParam, lParam);
+ pushEvent(event);
+ break;
+ }
+
+ // Mouse wheel event
+ case WM_MOUSEWHEEL:
+ {
+ // Mouse position is in screen coordinates, convert it to window coordinates
+ POINT position;
+ position.x = static_cast<Int16>(LOWORD(lParam));
+ position.y = static_cast<Int16>(HIWORD(lParam));
+ ScreenToClient(m_handle, &position);
+
+ Event event;
+ event.type = Event::MouseWheelMoved;
+ event.mouseWheel.delta = static_cast<Int16>(HIWORD(wParam)) / 120;
+ event.mouseWheel.x = position.x;
+ event.mouseWheel.y = position.y;
+ pushEvent(event);
+ break;
+ }
+
+ // Mouse left button down event
+ case WM_LBUTTONDOWN:
+ {
+ Event event;
+ event.type = Event::MouseButtonPressed;
+ event.mouseButton.button = Mouse::Left;
+ event.mouseButton.x = static_cast<Int16>(LOWORD(lParam));
+ event.mouseButton.y = static_cast<Int16>(HIWORD(lParam));
+ pushEvent(event);
+ break;
+ }
+
+ // Mouse left button up event
+ case WM_LBUTTONUP:
+ {
+ Event event;
+ event.type = Event::MouseButtonReleased;
+ event.mouseButton.button = Mouse::Left;
+ event.mouseButton.x = static_cast<Int16>(LOWORD(lParam));
+ event.mouseButton.y = static_cast<Int16>(HIWORD(lParam));
+ pushEvent(event);
+ break;
+ }
+
+ // Mouse right button down event
+ case WM_RBUTTONDOWN:
+ {
+ Event event;
+ event.type = Event::MouseButtonPressed;
+ event.mouseButton.button = Mouse::Right;
+ event.mouseButton.x = static_cast<Int16>(LOWORD(lParam));
+ event.mouseButton.y = static_cast<Int16>(HIWORD(lParam));
+ pushEvent(event);
+ break;
+ }
+
+ // Mouse right button up event
+ case WM_RBUTTONUP:
+ {
+ Event event;
+ event.type = Event::MouseButtonReleased;
+ event.mouseButton.button = Mouse::Right;
+ event.mouseButton.x = static_cast<Int16>(LOWORD(lParam));
+ event.mouseButton.y = static_cast<Int16>(HIWORD(lParam));
+ pushEvent(event);
+ break;
+ }
+
+ // Mouse wheel button down event
+ case WM_MBUTTONDOWN:
+ {
+ Event event;
+ event.type = Event::MouseButtonPressed;
+ event.mouseButton.button = Mouse::Middle;
+ event.mouseButton.x = static_cast<Int16>(LOWORD(lParam));
+ event.mouseButton.y = static_cast<Int16>(HIWORD(lParam));
+ pushEvent(event);
+ break;
+ }
+
+ // Mouse wheel button up event
+ case WM_MBUTTONUP:
+ {
+ Event event;
+ event.type = Event::MouseButtonReleased;
+ event.mouseButton.button = Mouse::Middle;
+ event.mouseButton.x = static_cast<Int16>(LOWORD(lParam));
+ event.mouseButton.y = static_cast<Int16>(HIWORD(lParam));
+ pushEvent(event);
+ break;
+ }
+
+ // Mouse X button down event
+ case WM_XBUTTONDOWN:
+ {
+ Event event;
+ event.type = Event::MouseButtonPressed;
+ event.mouseButton.button = HIWORD(wParam) == XBUTTON1 ? Mouse::XButton1 : Mouse::XButton2;
+ event.mouseButton.x = static_cast<Int16>(LOWORD(lParam));
+ event.mouseButton.y = static_cast<Int16>(HIWORD(lParam));
+ pushEvent(event);
+ break;
+ }
+
+ // Mouse X button up event
+ case WM_XBUTTONUP:
+ {
+ Event event;
+ event.type = Event::MouseButtonReleased;
+ event.mouseButton.button = HIWORD(wParam) == XBUTTON1 ? Mouse::XButton1 : Mouse::XButton2;
+ event.mouseButton.x = static_cast<Int16>(LOWORD(lParam));
+ event.mouseButton.y = static_cast<Int16>(HIWORD(lParam));
+ pushEvent(event);
+ break;
+ }
+
+ // Mouse leave event
+ case WM_MOUSELEAVE:
+ {
+ // Avoid this firing a second time in case the cursor is dragged outside
+ if (m_mouseInside)
+ {
+ m_mouseInside = false;
+
+ // Generate a MouseLeft event
+ Event event;
+ event.type = Event::MouseLeft;
+ pushEvent(event);
+ }
+ break;
+ }
+
+ // Mouse move event
+ case WM_MOUSEMOVE:
+ {
+ // Extract the mouse local coordinates
+ int x = static_cast<Int16>(LOWORD(lParam));
+ int y = static_cast<Int16>(HIWORD(lParam));
+
+ // Get the client area of the window
+ RECT area;
+ GetClientRect(m_handle, &area);
+
+ // Capture the mouse in case the user wants to drag it outside
+ if ((wParam & (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON | MK_XBUTTON1 | MK_XBUTTON2)) == 0)
+ {
+ // Only release the capture if we really have it
+ if (GetCapture() == m_handle)
+ ReleaseCapture();
+ }
+ else if (GetCapture() != m_handle)
+ {
+ // Set the capture to continue receiving mouse events
+ SetCapture(m_handle);
+ }
+
+ // If the cursor is outside the client area...
+ if ((x < area.left) || (x > area.right) || (y < area.top) || (y > area.bottom))
+ {
+ // and it used to be inside, the mouse left it.
+ if (m_mouseInside)
+ {
+ m_mouseInside = false;
+
+ // No longer care for the mouse leaving the window
+ setTracking(false);
+
+ // Generate a MouseLeft event
+ Event event;
+ event.type = Event::MouseLeft;
+ pushEvent(event);
+ }
+ }
+ else
+ {
+ // and vice-versa
+ if (!m_mouseInside)
+ {
+ m_mouseInside = true;
+
+ // Look for the mouse leaving the window
+ setTracking(true);
+
+ // Generate a MouseEntered event
+ Event event;
+ event.type = Event::MouseEntered;
+ pushEvent(event);
+ }
+ }
+
+ // Generate a MouseMove event
+ Event event;
+ event.type = Event::MouseMoved;
+ event.mouseMove.x = x;
+ event.mouseMove.y = y;
+ pushEvent(event);
+ break;
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+Keyboard::Key WindowImplWin32::virtualKeyCodeToSF(WPARAM key, LPARAM flags)
+{
+ switch (key)
+ {
+ // Check the scancode to distinguish between left and right shift
+ case VK_SHIFT:
+ {
+ static UINT lShift = MapVirtualKeyW(VK_LSHIFT, MAPVK_VK_TO_VSC);
+ UINT scancode = static_cast<UINT>((flags & (0xFF << 16)) >> 16);
+ return scancode == lShift ? Keyboard::LShift : Keyboard::RShift;
+ }
+
+ // Check the "extended" flag to distinguish between left and right alt
+ case VK_MENU : return (HIWORD(flags) & KF_EXTENDED) ? Keyboard::RAlt : Keyboard::LAlt;
+
+ // Check the "extended" flag to distinguish between left and right control
+ case VK_CONTROL : return (HIWORD(flags) & KF_EXTENDED) ? Keyboard::RControl : Keyboard::LControl;
+
+ // Other keys are reported properly
+ case VK_LWIN: return Keyboard::LSystem;
+ case VK_RWIN: return Keyboard::RSystem;
+ case VK_APPS: return Keyboard::Menu;
+ case VK_OEM_1: return Keyboard::SemiColon;
+ case VK_OEM_2: return Keyboard::Slash;
+ case VK_OEM_PLUS: return Keyboard::Equal;
+ case VK_OEM_MINUS: return Keyboard::Dash;
+ case VK_OEM_4: return Keyboard::LBracket;
+ case VK_OEM_6: return Keyboard::RBracket;
+ case VK_OEM_COMMA: return Keyboard::Comma;
+ case VK_OEM_PERIOD: return Keyboard::Period;
+ case VK_OEM_7: return Keyboard::Quote;
+ case VK_OEM_5: return Keyboard::BackSlash;
+ case VK_OEM_3: return Keyboard::Tilde;
+ case VK_ESCAPE: return Keyboard::Escape;
+ case VK_SPACE: return Keyboard::Space;
+ case VK_RETURN: return Keyboard::Return;
+ case VK_BACK: return Keyboard::BackSpace;
+ case VK_TAB: return Keyboard::Tab;
+ case VK_PRIOR: return Keyboard::PageUp;
+ case VK_NEXT: return Keyboard::PageDown;
+ case VK_END: return Keyboard::End;
+ case VK_HOME: return Keyboard::Home;
+ case VK_INSERT: return Keyboard::Insert;
+ case VK_DELETE: return Keyboard::Delete;
+ case VK_ADD: return Keyboard::Add;
+ case VK_SUBTRACT: return Keyboard::Subtract;
+ case VK_MULTIPLY: return Keyboard::Multiply;
+ case VK_DIVIDE: return Keyboard::Divide;
+ case VK_PAUSE: return Keyboard::Pause;
+ case VK_F1: return Keyboard::F1;
+ case VK_F2: return Keyboard::F2;
+ case VK_F3: return Keyboard::F3;
+ case VK_F4: return Keyboard::F4;
+ case VK_F5: return Keyboard::F5;
+ case VK_F6: return Keyboard::F6;
+ case VK_F7: return Keyboard::F7;
+ case VK_F8: return Keyboard::F8;
+ case VK_F9: return Keyboard::F9;
+ case VK_F10: return Keyboard::F10;
+ case VK_F11: return Keyboard::F11;
+ case VK_F12: return Keyboard::F12;
+ case VK_F13: return Keyboard::F13;
+ case VK_F14: return Keyboard::F14;
+ case VK_F15: return Keyboard::F15;
+ case VK_LEFT: return Keyboard::Left;
+ case VK_RIGHT: return Keyboard::Right;
+ case VK_UP: return Keyboard::Up;
+ case VK_DOWN: return Keyboard::Down;
+ case VK_NUMPAD0: return Keyboard::Numpad0;
+ case VK_NUMPAD1: return Keyboard::Numpad1;
+ case VK_NUMPAD2: return Keyboard::Numpad2;
+ case VK_NUMPAD3: return Keyboard::Numpad3;
+ case VK_NUMPAD4: return Keyboard::Numpad4;
+ case VK_NUMPAD5: return Keyboard::Numpad5;
+ case VK_NUMPAD6: return Keyboard::Numpad6;
+ case VK_NUMPAD7: return Keyboard::Numpad7;
+ case VK_NUMPAD8: return Keyboard::Numpad8;
+ case VK_NUMPAD9: return Keyboard::Numpad9;
+ case 'A': return Keyboard::A;
+ case 'Z': return Keyboard::Z;
+ case 'E': return Keyboard::E;
+ case 'R': return Keyboard::R;
+ case 'T': return Keyboard::T;
+ case 'Y': return Keyboard::Y;
+ case 'U': return Keyboard::U;
+ case 'I': return Keyboard::I;
+ case 'O': return Keyboard::O;
+ case 'P': return Keyboard::P;
+ case 'Q': return Keyboard::Q;
+ case 'S': return Keyboard::S;
+ case 'D': return Keyboard::D;
+ case 'F': return Keyboard::F;
+ case 'G': return Keyboard::G;
+ case 'H': return Keyboard::H;
+ case 'J': return Keyboard::J;
+ case 'K': return Keyboard::K;
+ case 'L': return Keyboard::L;
+ case 'M': return Keyboard::M;
+ case 'W': return Keyboard::W;
+ case 'X': return Keyboard::X;
+ case 'C': return Keyboard::C;
+ case 'V': return Keyboard::V;
+ case 'B': return Keyboard::B;
+ case 'N': return Keyboard::N;
+ case '0': return Keyboard::Num0;
+ case '1': return Keyboard::Num1;
+ case '2': return Keyboard::Num2;
+ case '3': return Keyboard::Num3;
+ case '4': return Keyboard::Num4;
+ case '5': return Keyboard::Num5;
+ case '6': return Keyboard::Num6;
+ case '7': return Keyboard::Num7;
+ case '8': return Keyboard::Num8;
+ case '9': return Keyboard::Num9;
+ }
+
+ return Keyboard::Unknown;
+}
+
+
+////////////////////////////////////////////////////////////
+LRESULT CALLBACK WindowImplWin32::globalOnEvent(HWND handle, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ // Associate handle and Window instance when the creation message is received
+ if (message == WM_CREATE)
+ {
+ // Get WindowImplWin32 instance (it was passed as the last argument of CreateWindow)
+ LONG_PTR window = (LONG_PTR)reinterpret_cast<CREATESTRUCT*>(lParam)->lpCreateParams;
+
+ // Set as the "user data" parameter of the window
+ SetWindowLongPtrW(handle, GWLP_USERDATA, window);
+ }
+
+ // Get the WindowImpl instance corresponding to the window handle
+ WindowImplWin32* window = handle ? reinterpret_cast<WindowImplWin32*>(GetWindowLongPtr(handle, GWLP_USERDATA)) : NULL;
+
+ // Forward the event to the appropriate function
+ if (window)
+ {
+ window->processEvent(message, wParam, lParam);
+
+ if (window->m_callback)
+ return CallWindowProcW(reinterpret_cast<WNDPROC>(window->m_callback), handle, message, wParam, lParam);
+ }
+
+ // We don't forward the WM_CLOSE message to prevent the OS from automatically destroying the window
+ if (message == WM_CLOSE)
+ return 0;
+
+ // Don't forward the menu system command, so that pressing ALT or F10 doesn't steal the focus
+ if ((message == WM_SYSCOMMAND) && (wParam == SC_KEYMENU))
+ return 0;
+
+ return DefWindowProcW(handle, message, wParam, lParam);
+}
+
+} // namespace priv
+
+} // namespace sf
+
diff --git a/src/SFML/Window/Win32/WindowImplWin32.hpp b/src/SFML/Window/Win32/WindowImplWin32.hpp
index a0ccc61..0bb3ce8 100644
--- a/src/SFML/Window/Win32/WindowImplWin32.hpp
+++ b/src/SFML/Window/Win32/WindowImplWin32.hpp
@@ -1,248 +1,261 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_WINDOWIMPLWIN32_HPP
-#define SFML_WINDOWIMPLWIN32_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Window/Event.hpp>
-#include <SFML/Window/WindowImpl.hpp>
-#include <SFML/System/String.hpp>
-#include <windows.h>
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief Windows implementation of WindowImpl
-///
-////////////////////////////////////////////////////////////
-class WindowImplWin32 : public WindowImpl
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Construct the window implementation from an existing control
- ///
- /// \param handle Platform-specific handle of the control
- ///
- ////////////////////////////////////////////////////////////
- WindowImplWin32(WindowHandle handle);
-
- ////////////////////////////////////////////////////////////
- /// \brief Create the window implementation
- ///
- /// \param mode Video mode to use
- /// \param title Title of the window
- /// \param style Window style
- /// \param settings Additional settings for the underlying OpenGL context
- ///
- ////////////////////////////////////////////////////////////
- WindowImplWin32(VideoMode mode, const String& title, Uint32 style, const ContextSettings& settings);
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor
- ///
- ////////////////////////////////////////////////////////////
- ~WindowImplWin32();
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the OS-specific handle of the window
- ///
- /// \return Handle of the window
- ///
- ////////////////////////////////////////////////////////////
- virtual WindowHandle getSystemHandle() const;
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the position of the window
- ///
- /// \return Position of the window, in pixels
- ///
- ////////////////////////////////////////////////////////////
- virtual Vector2i getPosition() const;
-
- ////////////////////////////////////////////////////////////
- /// \brief Change the position of the window on screen
- ///
- /// \param position New position of the window, in pixels
- ///
- ////////////////////////////////////////////////////////////
- virtual void setPosition(const Vector2i& position);
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the client size of the window
- ///
- /// \return Size of the window, in pixels
- ///
- ////////////////////////////////////////////////////////////
- virtual Vector2u getSize() const;
-
- ////////////////////////////////////////////////////////////
- /// \brief Change the size of the rendering region of the window
- ///
- /// \param size New size, in pixels
- ///
- ////////////////////////////////////////////////////////////
- virtual void setSize(const Vector2u& size);
-
- ////////////////////////////////////////////////////////////
- /// \brief Change the title of the window
- ///
- /// \param title New title
- ///
- ////////////////////////////////////////////////////////////
- virtual void setTitle(const String& title);
-
- ////////////////////////////////////////////////////////////
- /// \brief Change the window's icon
- ///
- /// \param width Icon's width, in pixels
- /// \param height Icon's height, in pixels
- /// \param pixels Pointer to the pixels in memory, format must be RGBA 32 bits
- ///
- ////////////////////////////////////////////////////////////
- virtual void setIcon(unsigned int width, unsigned int height, const Uint8* pixels);
-
- ////////////////////////////////////////////////////////////
- /// \brief Show or hide the window
- ///
- /// \param visible True to show, false to hide
- ///
- ////////////////////////////////////////////////////////////
- virtual void setVisible(bool visible);
-
- ////////////////////////////////////////////////////////////
- /// \brief Show or hide the mouse cursor
- ///
- /// \param visible True to show, false to hide
- ///
- ////////////////////////////////////////////////////////////
- virtual void setMouseCursorVisible(bool visible);
-
- ////////////////////////////////////////////////////////////
- /// \brief Enable or disable automatic key-repeat
- ///
- /// \param enabled True to enable, false to disable
- ///
- ////////////////////////////////////////////////////////////
- virtual void setKeyRepeatEnabled(bool enabled);
-
-protected:
-
- ////////////////////////////////////////////////////////////
- /// \brief Process incoming events from the operating system
- ///
- ////////////////////////////////////////////////////////////
- virtual void processEvents();
-
-private :
-
- ////////////////////////////////////////////////////////////
- /// Register the window class
- ///
- ////////////////////////////////////////////////////////////
- void registerWindowClass();
-
- ////////////////////////////////////////////////////////////
- /// \brief Switch to fullscreen mode
- ///
- /// \param mode Video mode to switch to
- ///
- ////////////////////////////////////////////////////////////
- void switchToFullscreen(const VideoMode& mode);
-
- ////////////////////////////////////////////////////////////
- /// \brief Free all the graphical resources attached to the window
- ///
- ////////////////////////////////////////////////////////////
- void cleanup();
-
- ////////////////////////////////////////////////////////////
- /// \brief Process a Win32 event
- ///
- /// \param message Message to process
- /// \param wParam First parameter of the event
- /// \param lParam Second parameter of the event
- ///
- ////////////////////////////////////////////////////////////
- void processEvent(UINT message, WPARAM wParam, LPARAM lParam);
-
- ////////////////////////////////////////////////////////////
- /// \brief Convert a Win32 virtual key code to a SFML key code
- ///
- /// \param key Virtual key code to convert
- /// \param flags Additional flags
- ///
- /// \return SFML key code corresponding to the key
- ///
- ////////////////////////////////////////////////////////////
- static Keyboard::Key virtualKeyCodeToSF(WPARAM key, LPARAM flags);
-
- ////////////////////////////////////////////////////////////
- /// \brief Check if the current version of the OS supports
- /// unicode messages and functions ; Windows 95/98/Me
- /// may not support it, whereas Windows NT/2000/XP/Vista
- /// will
- ///
- /// \return True if the OS supports unicode
- ///
- ////////////////////////////////////////////////////////////
- static bool hasUnicodeSupport();
-
- ////////////////////////////////////////////////////////////
- /// \brief Function called whenever one of our windows receives a message
- ///
- /// \param handle Win32 handle of the window
- /// \param message Message received
- /// \param wParam First parameter of the message
- /// \param lParam Second parameter of the message
- ///
- /// \return True to discard the event after it has been processed
- ///
- ////////////////////////////////////////////////////////////
- static LRESULT CALLBACK globalOnEvent(HWND handle, UINT message, WPARAM wParam, LPARAM lParam);
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- HWND m_handle; ///< Win32 handle of the window
- LONG_PTR m_callback; ///< Stores the original event callback function of the control
- HCURSOR m_cursor; ///< The system cursor to display into the window
- HICON m_icon; ///< Custom icon assigned to the window
- bool m_keyRepeatEnabled; ///< Automatic key-repeat state for keydown events
- Vector2u m_lastSize; ///< The last handled size of the window
- bool m_resizing; ///< Is the window being resized ?
- Uint16 m_surrogate; ///< First half of the surrogate pair, in case we're receiving a Unicode character in two events
-};
-
-} // namespace priv
-
-} // namespace sf
-
-#endif // SFML_WINDOWIMPLWIN32_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_WINDOWIMPLWIN32_HPP
+#define SFML_WINDOWIMPLWIN32_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/Event.hpp>
+#include <SFML/Window/WindowImpl.hpp>
+#include <SFML/System/String.hpp>
+#include <windows.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Windows implementation of WindowImpl
+///
+////////////////////////////////////////////////////////////
+class WindowImplWin32 : public WindowImpl
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Construct the window implementation from an existing control
+ ///
+ /// \param handle Platform-specific handle of the control
+ ///
+ ////////////////////////////////////////////////////////////
+ WindowImplWin32(WindowHandle handle);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create the window implementation
+ ///
+ /// \param mode Video mode to use
+ /// \param title Title of the window
+ /// \param style Window style
+ /// \param settings Additional settings for the underlying OpenGL context
+ ///
+ ////////////////////////////////////////////////////////////
+ WindowImplWin32(VideoMode mode, const String& title, Uint32 style, const ContextSettings& settings);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~WindowImplWin32();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the OS-specific handle of the window
+ ///
+ /// \return Handle of the window
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual WindowHandle getSystemHandle() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the position of the window
+ ///
+ /// \return Position of the window, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Vector2i getPosition() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the position of the window on screen
+ ///
+ /// \param position New position of the window, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setPosition(const Vector2i& position);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the client size of the window
+ ///
+ /// \return Size of the window, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Vector2u getSize() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the size of the rendering region of the window
+ ///
+ /// \param size New size, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setSize(const Vector2u& size);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the title of the window
+ ///
+ /// \param title New title
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setTitle(const String& title);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the window's icon
+ ///
+ /// \param width Icon's width, in pixels
+ /// \param height Icon's height, in pixels
+ /// \param pixels Pointer to the pixels in memory, format must be RGBA 32 bits
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setIcon(unsigned int width, unsigned int height, const Uint8* pixels);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Show or hide the window
+ ///
+ /// \param visible True to show, false to hide
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setVisible(bool visible);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Show or hide the mouse cursor
+ ///
+ /// \param visible True to show, false to hide
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setMouseCursorVisible(bool visible);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Enable or disable automatic key-repeat
+ ///
+ /// \param enabled True to enable, false to disable
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setKeyRepeatEnabled(bool enabled);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Request the current window to be made the active
+ /// foreground window
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void requestFocus();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check whether the window has the input focus
+ ///
+ /// \return True if window has focus, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool hasFocus() const;
+
+protected:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Process incoming events from the operating system
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void processEvents();
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// Register the window class
+ ///
+ ////////////////////////////////////////////////////////////
+ void registerWindowClass();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Switch to fullscreen mode
+ ///
+ /// \param mode Video mode to switch to
+ ///
+ ////////////////////////////////////////////////////////////
+ void switchToFullscreen(const VideoMode& mode);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Free all the graphical resources attached to the window
+ ///
+ ////////////////////////////////////////////////////////////
+ void cleanup();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Process a Win32 event
+ ///
+ /// \param message Message to process
+ /// \param wParam First parameter of the event
+ /// \param lParam Second parameter of the event
+ ///
+ ////////////////////////////////////////////////////////////
+ void processEvent(UINT message, WPARAM wParam, LPARAM lParam);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Enables or disables tracking for the mouse cursor leaving the window
+ ///
+ /// \param track True to enable, false to disable
+ ///
+ ////////////////////////////////////////////////////////////
+ void setTracking(bool track);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert a Win32 virtual key code to a SFML key code
+ ///
+ /// \param key Virtual key code to convert
+ /// \param flags Additional flags
+ ///
+ /// \return SFML key code corresponding to the key
+ ///
+ ////////////////////////////////////////////////////////////
+ static Keyboard::Key virtualKeyCodeToSF(WPARAM key, LPARAM flags);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Function called whenever one of our windows receives a message
+ ///
+ /// \param handle Win32 handle of the window
+ /// \param message Message received
+ /// \param wParam First parameter of the message
+ /// \param lParam Second parameter of the message
+ ///
+ /// \return True to discard the event after it has been processed
+ ///
+ ////////////////////////////////////////////////////////////
+ static LRESULT CALLBACK globalOnEvent(HWND handle, UINT message, WPARAM wParam, LPARAM lParam);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ HWND m_handle; ///< Win32 handle of the window
+ LONG_PTR m_callback; ///< Stores the original event callback function of the control
+ HCURSOR m_cursor; ///< The system cursor to display into the window
+ HICON m_icon; ///< Custom icon assigned to the window
+ bool m_keyRepeatEnabled; ///< Automatic key-repeat state for keydown events
+ Vector2u m_lastSize; ///< The last handled size of the window
+ bool m_resizing; ///< Is the window being resized?
+ Uint16 m_surrogate; ///< First half of the surrogate pair, in case we're receiving a Unicode character in two events
+ bool m_mouseInside; ///< Mouse is inside the window?
+};
+
+} // namespace priv
+
+} // namespace sf
+
+#endif // SFML_WINDOWIMPLWIN32_HPP
diff --git a/src/SFML/Window/Window.cpp b/src/SFML/Window/Window.cpp
index 0970c98..2f7bff3 100644
--- a/src/SFML/Window/Window.cpp
+++ b/src/SFML/Window/Window.cpp
@@ -1,406 +1,433 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Window/Window.hpp>
-#include <SFML/Window/GlContext.hpp>
-#include <SFML/Window/WindowImpl.hpp>
-#include <SFML/System/Sleep.hpp>
-#include <SFML/System/Err.hpp>
-
-
-namespace
-{
- const sf::Window* fullscreenWindow = NULL;
-}
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-Window::Window() :
-m_impl (NULL),
-m_context (NULL),
-m_frameTimeLimit(Time::Zero),
-m_size (0, 0)
-{
-
-}
-
-
-////////////////////////////////////////////////////////////
-Window::Window(VideoMode mode, const String& title, Uint32 style, const ContextSettings& settings) :
-m_impl (NULL),
-m_context (NULL),
-m_frameTimeLimit(Time::Zero),
-m_size (0, 0)
-{
- create(mode, title, style, settings);
-}
-
-
-////////////////////////////////////////////////////////////
-Window::Window(WindowHandle handle, const ContextSettings& settings) :
-m_impl (NULL),
-m_context (NULL),
-m_frameTimeLimit(Time::Zero),
-m_size (0, 0)
-{
- create(handle, settings);
-}
-
-
-////////////////////////////////////////////////////////////
-Window::~Window()
-{
- close();
-}
-
-
-////////////////////////////////////////////////////////////
-void Window::create(VideoMode mode, const String& title, Uint32 style, const ContextSettings& settings)
-{
- // Destroy the previous window implementation
- close();
-
- // Fullscreen style requires some tests
- if (style & Style::Fullscreen)
- {
- // Make sure there's not already a fullscreen window (only one is allowed)
- if (fullscreenWindow)
- {
- err() << "Creating two fullscreen windows is not allowed, switching to windowed mode" << std::endl;
- style &= ~Style::Fullscreen;
- }
- else
- {
- // Make sure that the chosen video mode is compatible
- if (!mode.isValid())
- {
- err() << "The requested video mode is not available, switching to a valid mode" << std::endl;
- mode = VideoMode::getFullscreenModes()[0];
- }
-
- // Update the fullscreen window
- fullscreenWindow = this;
- }
- }
-
- // Check validity of style
- if ((style & Style::Close) || (style & Style::Resize))
- style |= Style::Titlebar;
-
- // Recreate the window implementation
- m_impl = priv::WindowImpl::create(mode, title, style, settings);
-
- // Recreate the context
- m_context = priv::GlContext::create(settings, m_impl, mode.bitsPerPixel);
-
- // Perform common initializations
- initialize();
-}
-
-
-////////////////////////////////////////////////////////////
-void Window::create(WindowHandle handle, const ContextSettings& settings)
-{
- // Destroy the previous window implementation
- close();
-
- // Recreate the window implementation
- m_impl = priv::WindowImpl::create(handle);
-
- // Recreate the context
- m_context = priv::GlContext::create(settings, m_impl, VideoMode::getDesktopMode().bitsPerPixel);
-
- // Perform common initializations
- initialize();
-}
-
-
-////////////////////////////////////////////////////////////
-void Window::close()
-{
- if (m_context)
- {
- // Delete the context
- delete m_context;
- m_context = NULL;
- }
-
- if (m_impl)
- {
- // Delete the window implementation
- delete m_impl;
- m_impl = NULL;
- }
-
- // Update the fullscreen window
- if (this == fullscreenWindow)
- fullscreenWindow = NULL;
-}
-
-
-////////////////////////////////////////////////////////////
-bool Window::isOpen() const
-{
- return m_impl != NULL;
-}
-
-
-////////////////////////////////////////////////////////////
-const ContextSettings& Window::getSettings() const
-{
- static const ContextSettings empty(0, 0, 0);
-
- return m_context ? m_context->getSettings() : empty;
-}
-
-
-////////////////////////////////////////////////////////////
-bool Window::pollEvent(Event& event)
-{
- if (m_impl && m_impl->popEvent(event, false))
- {
- return filterEvent(event);
- }
- else
- {
- return false;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-bool Window::waitEvent(Event& event)
-{
- if (m_impl && m_impl->popEvent(event, true))
- {
- return filterEvent(event);
- }
- else
- {
- return false;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-Vector2i Window::getPosition() const
-{
- return m_impl ? m_impl->getPosition() : Vector2i();
-}
-
-
-////////////////////////////////////////////////////////////
-void Window::setPosition(const Vector2i& position)
-{
- if (m_impl)
- m_impl->setPosition(position);
-}
-
-
-////////////////////////////////////////////////////////////
-Vector2u Window::getSize() const
-{
- return m_size;
-}
-
-
-////////////////////////////////////////////////////////////
-void Window::setSize(const Vector2u size)
-{
- if (m_impl)
- m_impl->setSize(size);
-}
-
-
-////////////////////////////////////////////////////////////
-void Window::setTitle(const String& title)
-{
- if (m_impl)
- m_impl->setTitle(title);
-}
-
-
-////////////////////////////////////////////////////////////
-void Window::setIcon(unsigned int width, unsigned int height, const Uint8* pixels)
-{
- if (m_impl)
- m_impl->setIcon(width, height, pixels);
-}
-
-
-////////////////////////////////////////////////////////////
-void Window::setVisible(bool visible)
-{
- if (m_impl)
- m_impl->setVisible(visible);
-}
-
-
-////////////////////////////////////////////////////////////
-void Window::setVerticalSyncEnabled(bool enabled)
-{
- if (setActive())
- m_context->setVerticalSyncEnabled(enabled);
-}
-
-
-////////////////////////////////////////////////////////////
-void Window::setMouseCursorVisible(bool visible)
-{
- if (m_impl)
- m_impl->setMouseCursorVisible(visible);
-}
-
-
-////////////////////////////////////////////////////////////
-void Window::setKeyRepeatEnabled(bool enabled)
-{
- if (m_impl)
- m_impl->setKeyRepeatEnabled(enabled);
-}
-
-
-////////////////////////////////////////////////////////////
-void Window::setFramerateLimit(unsigned int limit)
-{
- if (limit > 0)
- m_frameTimeLimit = seconds(1.f / limit);
- else
- m_frameTimeLimit = Time::Zero;
-}
-
-
-////////////////////////////////////////////////////////////
-void Window::setJoystickThreshold(float threshold)
-{
- if (m_impl)
- m_impl->setJoystickThreshold(threshold);
-}
-
-
-////////////////////////////////////////////////////////////
-bool Window::setActive(bool active) const
-{
- if (m_context)
- {
- if (m_context->setActive(active))
- {
- return true;
- }
- else
- {
- err() << "Failed to activate the window's context" << std::endl;
- return false;
- }
- }
- else
- {
- return false;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void Window::display()
-{
- // Display the backbuffer on screen
- if (setActive())
- m_context->display();
-
- // Limit the framerate if needed
- if (m_frameTimeLimit != Time::Zero)
- {
- sleep(m_frameTimeLimit - m_clock.getElapsedTime());
- m_clock.restart();
- }
-}
-
-
-////////////////////////////////////////////////////////////
-WindowHandle Window::getSystemHandle() const
-{
- return m_impl ? m_impl->getSystemHandle() : 0;
-}
-
-
-////////////////////////////////////////////////////////////
-void Window::onCreate()
-{
- // Nothing by default
-}
-
-
-////////////////////////////////////////////////////////////
-void Window::onResize()
-{
- // Nothing by default
-}
-
-
-////////////////////////////////////////////////////////////
-bool Window::filterEvent(const Event& event)
-{
- // Notify resize events to the derived class
- if (event.type == Event::Resized)
- {
- // Cache the new size
- m_size.x = event.size.width;
- m_size.y = event.size.height;
-
- // Notify the derived class
- onResize();
- }
-
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-void Window::initialize()
-{
- // Setup default behaviours (to get a consistent behaviour across different implementations)
- setVisible(true);
- setMouseCursorVisible(true);
- setVerticalSyncEnabled(false);
- setKeyRepeatEnabled(true);
-
- // Get and cache the initial size of the window
- m_size = m_impl->getSize();
-
- // Reset frame time
- m_clock.restart();
-
- // Activate the window
- setActive();
-
- // Notify the derived class
- onCreate();
-}
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/Window.hpp>
+#include <SFML/Window/GlContext.hpp>
+#include <SFML/Window/WindowImpl.hpp>
+#include <SFML/System/Sleep.hpp>
+#include <SFML/System/Err.hpp>
+
+
+namespace
+{
+ const sf::Window* fullscreenWindow = NULL;
+}
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+Window::Window() :
+m_impl (NULL),
+m_context (NULL),
+m_frameTimeLimit(Time::Zero),
+m_size (0, 0)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+Window::Window(VideoMode mode, const String& title, Uint32 style, const ContextSettings& settings) :
+m_impl (NULL),
+m_context (NULL),
+m_frameTimeLimit(Time::Zero),
+m_size (0, 0)
+{
+ create(mode, title, style, settings);
+}
+
+
+////////////////////////////////////////////////////////////
+Window::Window(WindowHandle handle, const ContextSettings& settings) :
+m_impl (NULL),
+m_context (NULL),
+m_frameTimeLimit(Time::Zero),
+m_size (0, 0)
+{
+ create(handle, settings);
+}
+
+
+////////////////////////////////////////////////////////////
+Window::~Window()
+{
+ close();
+}
+
+
+////////////////////////////////////////////////////////////
+void Window::create(VideoMode mode, const String& title, Uint32 style, const ContextSettings& settings)
+{
+ // Destroy the previous window implementation
+ close();
+
+ // Fullscreen style requires some tests
+ if (style & Style::Fullscreen)
+ {
+ // Make sure there's not already a fullscreen window (only one is allowed)
+ if (fullscreenWindow)
+ {
+ err() << "Creating two fullscreen windows is not allowed, switching to windowed mode" << std::endl;
+ style &= ~Style::Fullscreen;
+ }
+ else
+ {
+ // Make sure that the chosen video mode is compatible
+ if (!mode.isValid())
+ {
+ err() << "The requested video mode is not available, switching to a valid mode" << std::endl;
+ mode = VideoMode::getFullscreenModes()[0];
+ }
+
+ // Update the fullscreen window
+ fullscreenWindow = this;
+ }
+ }
+
+ // Check validity of style according to the underlying platform
+ #if defined(SFML_SYSTEM_IOS) || defined(SFML_SYSTEM_ANDROID)
+ if (style & Style::Fullscreen)
+ style &= ~Style::Titlebar;
+ else
+ style |= Style::Titlebar;
+ #else
+ if ((style & Style::Close) || (style & Style::Resize))
+ style |= Style::Titlebar;
+ #endif
+
+ // Recreate the window implementation
+ m_impl = priv::WindowImpl::create(mode, title, style, settings);
+
+ // Recreate the context
+ m_context = priv::GlContext::create(settings, m_impl, mode.bitsPerPixel);
+
+ // Perform common initializations
+ initialize();
+}
+
+
+////////////////////////////////////////////////////////////
+void Window::create(WindowHandle handle, const ContextSettings& settings)
+{
+ // Destroy the previous window implementation
+ close();
+
+ // Recreate the window implementation
+ m_impl = priv::WindowImpl::create(handle);
+
+ // Recreate the context
+ m_context = priv::GlContext::create(settings, m_impl, VideoMode::getDesktopMode().bitsPerPixel);
+
+ // Perform common initializations
+ initialize();
+}
+
+
+////////////////////////////////////////////////////////////
+void Window::close()
+{
+ // Delete the context
+ delete m_context;
+ m_context = NULL;
+
+ // Delete the window implementation
+ delete m_impl;
+ m_impl = NULL;
+
+ // Update the fullscreen window
+ if (this == fullscreenWindow)
+ fullscreenWindow = NULL;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Window::isOpen() const
+{
+ return m_impl != NULL;
+}
+
+
+////////////////////////////////////////////////////////////
+const ContextSettings& Window::getSettings() const
+{
+ static const ContextSettings empty(0, 0, 0);
+
+ return m_context ? m_context->getSettings() : empty;
+}
+
+
+////////////////////////////////////////////////////////////
+bool Window::pollEvent(Event& event)
+{
+ if (m_impl && m_impl->popEvent(event, false))
+ {
+ return filterEvent(event);
+ }
+ else
+ {
+ return false;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+bool Window::waitEvent(Event& event)
+{
+ if (m_impl && m_impl->popEvent(event, true))
+ {
+ return filterEvent(event);
+ }
+ else
+ {
+ return false;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i Window::getPosition() const
+{
+ return m_impl ? m_impl->getPosition() : Vector2i();
+}
+
+
+////////////////////////////////////////////////////////////
+void Window::setPosition(const Vector2i& position)
+{
+ if (m_impl)
+ m_impl->setPosition(position);
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2u Window::getSize() const
+{
+ return m_size;
+}
+
+
+////////////////////////////////////////////////////////////
+void Window::setSize(const Vector2u& size)
+{
+ if (m_impl)
+ {
+ m_impl->setSize(size);
+
+ // Cache the new size
+ m_size.x = size.x;
+ m_size.y = size.y;
+
+ // Notify the derived class
+ onResize();
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Window::setTitle(const String& title)
+{
+ if (m_impl)
+ m_impl->setTitle(title);
+}
+
+
+////////////////////////////////////////////////////////////
+void Window::setIcon(unsigned int width, unsigned int height, const Uint8* pixels)
+{
+ if (m_impl)
+ m_impl->setIcon(width, height, pixels);
+}
+
+
+////////////////////////////////////////////////////////////
+void Window::setVisible(bool visible)
+{
+ if (m_impl)
+ m_impl->setVisible(visible);
+}
+
+
+////////////////////////////////////////////////////////////
+void Window::setVerticalSyncEnabled(bool enabled)
+{
+ if (setActive())
+ m_context->setVerticalSyncEnabled(enabled);
+}
+
+
+////////////////////////////////////////////////////////////
+void Window::setMouseCursorVisible(bool visible)
+{
+ if (m_impl)
+ m_impl->setMouseCursorVisible(visible);
+}
+
+
+////////////////////////////////////////////////////////////
+void Window::setKeyRepeatEnabled(bool enabled)
+{
+ if (m_impl)
+ m_impl->setKeyRepeatEnabled(enabled);
+}
+
+
+////////////////////////////////////////////////////////////
+void Window::setFramerateLimit(unsigned int limit)
+{
+ if (limit > 0)
+ m_frameTimeLimit = seconds(1.f / limit);
+ else
+ m_frameTimeLimit = Time::Zero;
+}
+
+
+////////////////////////////////////////////////////////////
+void Window::setJoystickThreshold(float threshold)
+{
+ if (m_impl)
+ m_impl->setJoystickThreshold(threshold);
+}
+
+
+////////////////////////////////////////////////////////////
+bool Window::setActive(bool active) const
+{
+ if (m_context)
+ {
+ if (m_context->setActive(active))
+ {
+ return true;
+ }
+ else
+ {
+ err() << "Failed to activate the window's context" << std::endl;
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void Window::requestFocus()
+{
+ if (m_impl)
+ m_impl->requestFocus();
+}
+
+
+////////////////////////////////////////////////////////////
+bool Window::hasFocus() const
+{
+ return m_impl && m_impl->hasFocus();
+}
+
+
+////////////////////////////////////////////////////////////
+
+void Window::display()
+{
+ // Display the backbuffer on screen
+ if (setActive())
+ m_context->display();
+
+ // Limit the framerate if needed
+ if (m_frameTimeLimit != Time::Zero)
+ {
+ sleep(m_frameTimeLimit - m_clock.getElapsedTime());
+ m_clock.restart();
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+WindowHandle Window::getSystemHandle() const
+{
+ return m_impl ? m_impl->getSystemHandle() : 0;
+}
+
+
+////////////////////////////////////////////////////////////
+void Window::onCreate()
+{
+ // Nothing by default
+}
+
+
+////////////////////////////////////////////////////////////
+void Window::onResize()
+{
+ // Nothing by default
+}
+
+
+////////////////////////////////////////////////////////////
+bool Window::filterEvent(const Event& event)
+{
+ // Notify resize events to the derived class
+ if (event.type == Event::Resized)
+ {
+ // Cache the new size
+ m_size.x = event.size.width;
+ m_size.y = event.size.height;
+
+ // Notify the derived class
+ onResize();
+ }
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+void Window::initialize()
+{
+ // Setup default behaviors (to get a consistent behavior across different implementations)
+ setVisible(true);
+ setMouseCursorVisible(true);
+ setVerticalSyncEnabled(false);
+ setKeyRepeatEnabled(true);
+ setFramerateLimit(0);
+
+ // Get and cache the initial size of the window
+ m_size = m_impl->getSize();
+
+ // Reset frame time
+ m_clock.restart();
+
+ // Activate the window
+ setActive();
+
+ // Notify the derived class
+ onCreate();
+}
+
+} // namespace sf
diff --git a/src/SFML/Window/WindowImpl.cpp b/src/SFML/Window/WindowImpl.cpp
index 1b336c7..db4518e 100644
--- a/src/SFML/Window/WindowImpl.cpp
+++ b/src/SFML/Window/WindowImpl.cpp
@@ -1,211 +1,257 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Window/WindowImpl.hpp>
-#include <SFML/Window/Event.hpp>
-#include <SFML/Window/JoystickManager.hpp>
-#include <SFML/System/Sleep.hpp>
-#include <algorithm>
-#include <cmath>
-
-#if defined(SFML_SYSTEM_WINDOWS)
-
- #include <SFML/Window/Win32/WindowImplWin32.hpp>
- typedef sf::priv::WindowImplWin32 WindowImplType;
-
-#elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD)
-
- #include <SFML/Window/Linux/WindowImplX11.hpp>
- typedef sf::priv::WindowImplX11 WindowImplType;
-
-#elif defined(SFML_SYSTEM_MACOS)
-
- #include <SFML/Window/OSX/WindowImplCocoa.hpp>
- typedef sf::priv::WindowImplCocoa WindowImplType;
-
-#endif
-
-
-namespace sf
-{
-namespace priv
-{
-////////////////////////////////////////////////////////////
-WindowImpl* WindowImpl::create(VideoMode mode, const String& title, Uint32 style, const ContextSettings& settings)
-{
- return new WindowImplType(mode, title, style, settings);
-}
-
-
-////////////////////////////////////////////////////////////
-WindowImpl* WindowImpl::create(WindowHandle handle)
-{
- return new WindowImplType(handle);
-}
-
-
-////////////////////////////////////////////////////////////
-WindowImpl::WindowImpl() :
-m_joyThreshold(0.1f)
-{
- // Get the initial joystick states
- JoystickManager::getInstance().update();
- for (unsigned int i = 0; i < Joystick::Count; ++i)
- m_joyStates[i] = JoystickManager::getInstance().getState(i);
-}
-
-
-////////////////////////////////////////////////////////////
-WindowImpl::~WindowImpl()
-{
- // Nothing to do
-}
-
-
-////////////////////////////////////////////////////////////
-void WindowImpl::setJoystickThreshold(float threshold)
-{
- m_joyThreshold = threshold;
-}
-
-
-////////////////////////////////////////////////////////////
-bool WindowImpl::popEvent(Event& event, bool block)
-{
- // If the event queue is empty, let's first check if new events are available from the OS
- if (m_events.empty())
- {
- if (!block)
- {
- // Non-blocking mode: process events and continue
- processJoystickEvents();
- processEvents();
- }
- else
- {
- // Blocking mode: process events until one is triggered
-
- // Here we use a manual wait loop instead of the optimized
- // wait-event provided by the OS, so that we don't skip joystick
- // events (which require polling)
- while (m_events.empty())
- {
- processJoystickEvents();
- processEvents();
- sleep(milliseconds(10));
- }
- }
- }
-
- // Pop the first event of the queue, if it is not empty
- if (!m_events.empty())
- {
- event = m_events.front();
- m_events.pop();
-
- return true;
- }
-
- return false;
-}
-
-
-////////////////////////////////////////////////////////////
-void WindowImpl::pushEvent(const Event& event)
-{
- m_events.push(event);
-}
-
-
-////////////////////////////////////////////////////////////
-void WindowImpl::processJoystickEvents()
-{
- // First update the global joystick states
- JoystickManager::getInstance().update();
-
- for (unsigned int i = 0; i < Joystick::Count; ++i)
- {
- // Copy the previous state of the joystick and get the new one
- JoystickState previousState = m_joyStates[i];
- m_joyStates[i] = JoystickManager::getInstance().getState(i);
- JoystickCaps caps = JoystickManager::getInstance().getCapabilities(i);
-
- // Connection state
- bool connected = m_joyStates[i].connected;
- if (previousState.connected ^ connected)
- {
- Event event;
- event.type = connected ? Event::JoystickConnected : Event::JoystickDisconnected;
- event.joystickButton.joystickId = i;
- pushEvent(event);
- }
-
- if (connected)
- {
- // Axes
- for (unsigned int j = 0; j < Joystick::AxisCount; ++j)
- {
- if (caps.axes[j])
- {
- Joystick::Axis axis = static_cast<Joystick::Axis>(j);
- float prevPos = previousState.axes[axis];
- float currPos = m_joyStates[i].axes[axis];
- if (fabs(currPos - prevPos) >= m_joyThreshold)
- {
- Event event;
- event.type = Event::JoystickMoved;
- event.joystickMove.joystickId = i;
- event.joystickMove.axis = axis;
- event.joystickMove.position = currPos;
- pushEvent(event);
- }
- }
- }
-
- // Buttons
- for (unsigned int j = 0; j < caps.buttonCount; ++j)
- {
- bool prevPressed = previousState.buttons[j];
- bool currPressed = m_joyStates[i].buttons[j];
-
- if (prevPressed ^ currPressed)
- {
- Event event;
- event.type = currPressed ? Event::JoystickButtonPressed : Event::JoystickButtonReleased;
- event.joystickButton.joystickId = i;
- event.joystickButton.button = j;
- pushEvent(event);
- }
- }
- }
- }
-}
-
-
-} // namespace priv
-
-} // namespace sf
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/WindowImpl.hpp>
+#include <SFML/Window/Event.hpp>
+#include <SFML/Window/JoystickManager.hpp>
+#include <SFML/Window/SensorManager.hpp>
+#include <SFML/System/Sleep.hpp>
+#include <algorithm>
+#include <cmath>
+
+#if defined(SFML_SYSTEM_WINDOWS)
+
+ #include <SFML/Window/Win32/WindowImplWin32.hpp>
+ typedef sf::priv::WindowImplWin32 WindowImplType;
+
+#elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD)
+
+ #include <SFML/Window/Unix/WindowImplX11.hpp>
+ typedef sf::priv::WindowImplX11 WindowImplType;
+
+#elif defined(SFML_SYSTEM_MACOS)
+
+ #include <SFML/Window/OSX/WindowImplCocoa.hpp>
+ typedef sf::priv::WindowImplCocoa WindowImplType;
+
+#elif defined(SFML_SYSTEM_IOS)
+
+ #include <SFML/Window/iOS/WindowImplUIKit.hpp>
+ typedef sf::priv::WindowImplUIKit WindowImplType;
+
+#elif defined(SFML_SYSTEM_ANDROID)
+
+ #include <SFML/Window/Android/WindowImplAndroid.hpp>
+ typedef sf::priv::WindowImplAndroid WindowImplType;
+
+#endif
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+WindowImpl* WindowImpl::create(VideoMode mode, const String& title, Uint32 style, const ContextSettings& settings)
+{
+ return new WindowImplType(mode, title, style, settings);
+}
+
+
+////////////////////////////////////////////////////////////
+WindowImpl* WindowImpl::create(WindowHandle handle)
+{
+ return new WindowImplType(handle);
+}
+
+
+////////////////////////////////////////////////////////////
+WindowImpl::WindowImpl() :
+m_joystickThreshold(0.1f)
+{
+ // Get the initial joystick states
+ JoystickManager::getInstance().update();
+ for (unsigned int i = 0; i < Joystick::Count; ++i)
+ m_joystickStates[i] = JoystickManager::getInstance().getState(i);
+
+ // Get the initial sensor states
+ for (unsigned int i = 0; i < Sensor::Count; ++i)
+ m_sensorValue[i] = Vector3f(0, 0, 0);
+}
+
+
+////////////////////////////////////////////////////////////
+WindowImpl::~WindowImpl()
+{
+ // Nothing to do
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImpl::setJoystickThreshold(float threshold)
+{
+ m_joystickThreshold = threshold;
+}
+
+
+////////////////////////////////////////////////////////////
+bool WindowImpl::popEvent(Event& event, bool block)
+{
+ // If the event queue is empty, let's first check if new events are available from the OS
+ if (m_events.empty())
+ {
+ // Get events from the system
+ processJoystickEvents();
+ processSensorEvents();
+ processEvents();
+
+ // In blocking mode, we must process events until one is triggered
+ if (block)
+ {
+ // Here we use a manual wait loop instead of the optimized
+ // wait-event provided by the OS, so that we don't skip joystick
+ // events (which require polling)
+ while (m_events.empty())
+ {
+ sleep(milliseconds(10));
+ processJoystickEvents();
+ processSensorEvents();
+ processEvents();
+ }
+ }
+ }
+
+ // Pop the first event of the queue, if it is not empty
+ if (!m_events.empty())
+ {
+ event = m_events.front();
+ m_events.pop();
+
+ return true;
+ }
+
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImpl::pushEvent(const Event& event)
+{
+ m_events.push(event);
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImpl::processJoystickEvents()
+{
+ // First update the global joystick states
+ JoystickManager::getInstance().update();
+
+ for (unsigned int i = 0; i < Joystick::Count; ++i)
+ {
+ // Copy the previous state of the joystick and get the new one
+ JoystickState previousState = m_joystickStates[i];
+ m_joystickStates[i] = JoystickManager::getInstance().getState(i);
+ JoystickCaps caps = JoystickManager::getInstance().getCapabilities(i);
+
+ // Connection state
+ bool connected = m_joystickStates[i].connected;
+ if (previousState.connected ^ connected)
+ {
+ Event event;
+ event.type = connected ? Event::JoystickConnected : Event::JoystickDisconnected;
+ event.joystickButton.joystickId = i;
+ pushEvent(event);
+ }
+
+ if (connected)
+ {
+ // Axes
+ for (unsigned int j = 0; j < Joystick::AxisCount; ++j)
+ {
+ if (caps.axes[j])
+ {
+ Joystick::Axis axis = static_cast<Joystick::Axis>(j);
+ float prevPos = previousState.axes[axis];
+ float currPos = m_joystickStates[i].axes[axis];
+ if (fabs(currPos - prevPos) >= m_joystickThreshold)
+ {
+ Event event;
+ event.type = Event::JoystickMoved;
+ event.joystickMove.joystickId = i;
+ event.joystickMove.axis = axis;
+ event.joystickMove.position = currPos;
+ pushEvent(event);
+ }
+ }
+ }
+
+ // Buttons
+ for (unsigned int j = 0; j < caps.buttonCount; ++j)
+ {
+ bool prevPressed = previousState.buttons[j];
+ bool currPressed = m_joystickStates[i].buttons[j];
+
+ if (prevPressed ^ currPressed)
+ {
+ Event event;
+ event.type = currPressed ? Event::JoystickButtonPressed : Event::JoystickButtonReleased;
+ event.joystickButton.joystickId = i;
+ event.joystickButton.button = j;
+ pushEvent(event);
+ }
+ }
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImpl::processSensorEvents()
+{
+ // First update the sensor states
+ SensorManager::getInstance().update();
+
+ for (unsigned int i = 0; i < Sensor::Count; ++i)
+ {
+ Sensor::Type sensor = static_cast<Sensor::Type>(i);
+
+ // Only process enabled sensors
+ if (SensorManager::getInstance().isEnabled(sensor))
+ {
+ // Copy the previous value of the sensor and get the new one
+ Vector3f previousValue = m_sensorValue[i];
+ m_sensorValue[i] = SensorManager::getInstance().getValue(sensor);
+
+ // If the value has changed, trigger an event
+ if (m_sensorValue[i] != previousValue) // @todo use a threshold?
+ {
+ Event event;
+ event.type = Event::SensorChanged;
+ event.sensor.type = sensor;
+ event.sensor.x = m_sensorValue[i].x;
+ event.sensor.y = m_sensorValue[i].y;
+ event.sensor.z = m_sensorValue[i].z;
+ pushEvent(event);
+ }
+ }
+ }
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/WindowImpl.hpp b/src/SFML/Window/WindowImpl.hpp
index 4d061a1..e30b42c 100644
--- a/src/SFML/Window/WindowImpl.hpp
+++ b/src/SFML/Window/WindowImpl.hpp
@@ -1,242 +1,266 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_WINDOWIMPL_HPP
-#define SFML_WINDOWIMPL_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <SFML/Config.hpp>
-#include <SFML/System/NonCopyable.hpp>
-#include <SFML/System/String.hpp>
-#include <SFML/Window/Event.hpp>
-#include <SFML/Window/Joystick.hpp>
-#include <SFML/Window/JoystickImpl.hpp>
-#include <SFML/Window/VideoMode.hpp>
-#include <SFML/Window/WindowHandle.hpp>
-#include <SFML/Window/ContextSettings.hpp>
-#include <queue>
-#include <set>
-
-namespace sf
-{
-class WindowListener;
-
-namespace priv
-{
-////////////////////////////////////////////////////////////
-/// \brief Abstract base class for OS-specific window implementation
-///
-////////////////////////////////////////////////////////////
-class WindowImpl : NonCopyable
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Create a new window depending on the current OS
- ///
- /// \param mode Video mode to use
- /// \param title Title of the window
- /// \param style Window style
- /// \param settings Additional settings for the underlying OpenGL context
- ///
- /// \return Pointer to the created window (don't forget to delete it)
- ///
- ////////////////////////////////////////////////////////////
- static WindowImpl* create(VideoMode mode, const String& title, Uint32 style, const ContextSettings& settings);
-
- ////////////////////////////////////////////////////////////
- /// \brief Create a new window depending on to the current OS
- ///
- /// \param handle Platform-specific handle of the control
- ///
- /// \return Pointer to the created window (don't forget to delete it)
- ///
- ////////////////////////////////////////////////////////////
- static WindowImpl* create(WindowHandle handle);
-
-public :
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor
- ///
- ////////////////////////////////////////////////////////////
- virtual ~WindowImpl();
-
- ////////////////////////////////////////////////////////////
- /// \brief Change the joystick threshold, ie. the value below which
- /// no move event will be generated
- ///
- /// \param threshold : New threshold, in range [0, 100]
- ///
- ////////////////////////////////////////////////////////////
- void setJoystickThreshold(float threshold);
-
- ////////////////////////////////////////////////////////////
- /// \brief Return the next window event available
- ///
- /// If there's no event available, this function calls the
- /// window's internal event processing function.
- /// The \a block parameter controls the behaviour of the function
- /// if no event is available: if it is true then the function
- /// doesn't return until a new event is triggered; otherwise it
- /// returns false to indicate that no event is available.
- ///
- /// \param event Event to be returned
- /// \param block Use true to block the thread until an event arrives
- ///
- ////////////////////////////////////////////////////////////
- bool popEvent(Event& event, bool block);
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the OS-specific handle of the window
- ///
- /// \return Handle of the window
- ///
- ////////////////////////////////////////////////////////////
- virtual WindowHandle getSystemHandle() const = 0;
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the position of the window
- ///
- /// \return Position of the window, in pixels
- ///
- ////////////////////////////////////////////////////////////
- virtual Vector2i getPosition() const = 0;
-
- ////////////////////////////////////////////////////////////
- /// \brief Change the position of the window on screen
- ///
- /// \param position New position of the window, in pixels
- ///
- ////////////////////////////////////////////////////////////
- virtual void setPosition(const Vector2i& position) = 0;
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the client size of the window
- ///
- /// \return Size of the window, in pixels
- ///
- ////////////////////////////////////////////////////////////
- virtual Vector2u getSize() const = 0;
-
- ////////////////////////////////////////////////////////////
- /// \brief Change the size of the rendering region of the window
- ///
- /// \param size New size, in pixels
- ///
- ////////////////////////////////////////////////////////////
- virtual void setSize(const Vector2u& size) = 0;
-
- ////////////////////////////////////////////////////////////
- /// \brief Change the title of the window
- ///
- /// \param title New title
- ///
- ////////////////////////////////////////////////////////////
- virtual void setTitle(const String& title) = 0;
-
- ////////////////////////////////////////////////////////////
- /// \brief Change the window's icon
- ///
- /// \param width Icon's width, in pixels
- /// \param height Icon's height, in pixels
- /// \param pixels Pointer to the pixels in memory, format must be RGBA 32 bits
- ///
- ////////////////////////////////////////////////////////////
- virtual void setIcon(unsigned int width, unsigned int height, const Uint8* pixels) = 0;
-
- ////////////////////////////////////////////////////////////
- /// \brief Show or hide the window
- ///
- /// \param visible True to show, false to hide
- ///
- ////////////////////////////////////////////////////////////
- virtual void setVisible(bool visible) = 0;
-
- ////////////////////////////////////////////////////////////
- /// \brief Show or hide the mouse cursor
- ///
- /// \param visible True to show, false to hide
- ///
- ////////////////////////////////////////////////////////////
- virtual void setMouseCursorVisible(bool visible) = 0;
-
- ////////////////////////////////////////////////////////////
- /// \brief Enable or disable automatic key-repeat
- ///
- /// \param enabled True to enable, false to disable
- ///
- ////////////////////////////////////////////////////////////
- virtual void setKeyRepeatEnabled(bool enabled) = 0;
-
-protected :
-
- ////////////////////////////////////////////////////////////
- /// \brief Default constructor
- ///
- ////////////////////////////////////////////////////////////
- WindowImpl();
-
- ////////////////////////////////////////////////////////////
- /// \brief Push a new event into the event queue
- ///
- /// This function is to be used by derived classes, to
- /// notify the SFML window that a new event was triggered
- /// by the system.
- ///
- /// \param event Event to push
- ///
- ////////////////////////////////////////////////////////////
- void pushEvent(const Event& event);
-
- ////////////////////////////////////////////////////////////
- /// \brief Process incoming events from the operating system
- ///
- ////////////////////////////////////////////////////////////
- virtual void processEvents() = 0;
-
-private :
-
- ////////////////////////////////////////////////////////////
- /// \brief Read the joysticks state and generate the appropriate events
- ///
- ////////////////////////////////////////////////////////////
- void processJoystickEvents();
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- std::queue<Event> m_events; ///< Queue of available events
- JoystickState m_joyStates[Joystick::Count]; ///< Previous state of the joysticks
- float m_joyThreshold; ///< Joystick threshold (minimum motion for MOVE event to be generated)
-};
-
-} // namespace priv
-
-} // namespace sf
-
-
-#endif // SFML_WINDOWIMPL_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_WINDOWIMPL_HPP
+#define SFML_WINDOWIMPL_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <SFML/System/NonCopyable.hpp>
+#include <SFML/System/String.hpp>
+#include <SFML/Window/Event.hpp>
+#include <SFML/Window/Joystick.hpp>
+#include <SFML/Window/JoystickImpl.hpp>
+#include <SFML/Window/Sensor.hpp>
+#include <SFML/Window/SensorImpl.hpp>
+#include <SFML/Window/VideoMode.hpp>
+#include <SFML/Window/WindowHandle.hpp>
+#include <SFML/Window/ContextSettings.hpp>
+#include <queue>
+#include <set>
+
+namespace sf
+{
+class WindowListener;
+
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Abstract base class for OS-specific window implementation
+///
+////////////////////////////////////////////////////////////
+class WindowImpl : NonCopyable
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create a new window depending on the current OS
+ ///
+ /// \param mode Video mode to use
+ /// \param title Title of the window
+ /// \param style Window style
+ /// \param settings Additional settings for the underlying OpenGL context
+ ///
+ /// \return Pointer to the created window (don't forget to delete it)
+ ///
+ ////////////////////////////////////////////////////////////
+ static WindowImpl* create(VideoMode mode, const String& title, Uint32 style, const ContextSettings& settings);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create a new window depending on to the current OS
+ ///
+ /// \param handle Platform-specific handle of the control
+ ///
+ /// \return Pointer to the created window (don't forget to delete it)
+ ///
+ ////////////////////////////////////////////////////////////
+ static WindowImpl* create(WindowHandle handle);
+
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~WindowImpl();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the joystick threshold, i.e. the value below which
+ /// no move event will be generated
+ ///
+ /// \param threshold New threshold, in range [0, 100]
+ ///
+ ////////////////////////////////////////////////////////////
+ void setJoystickThreshold(float threshold);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Return the next window event available
+ ///
+ /// If there's no event available, this function calls the
+ /// window's internal event processing function.
+ /// The \a block parameter controls the behavior of the function
+ /// if no event is available: if it is true then the function
+ /// doesn't return until a new event is triggered; otherwise it
+ /// returns false to indicate that no event is available.
+ ///
+ /// \param event Event to be returned
+ /// \param block Use true to block the thread until an event arrives
+ ///
+ ////////////////////////////////////////////////////////////
+ bool popEvent(Event& event, bool block);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the OS-specific handle of the window
+ ///
+ /// \return Handle of the window
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual WindowHandle getSystemHandle() const = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the position of the window
+ ///
+ /// \return Position of the window, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Vector2i getPosition() const = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the position of the window on screen
+ ///
+ /// \param position New position of the window, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setPosition(const Vector2i& position) = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the client size of the window
+ ///
+ /// \return Size of the window, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Vector2u getSize() const = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the size of the rendering region of the window
+ ///
+ /// \param size New size, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setSize(const Vector2u& size) = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the title of the window
+ ///
+ /// \param title New title
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setTitle(const String& title) = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the window's icon
+ ///
+ /// \param width Icon's width, in pixels
+ /// \param height Icon's height, in pixels
+ /// \param pixels Pointer to the pixels in memory, format must be RGBA 32 bits
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setIcon(unsigned int width, unsigned int height, const Uint8* pixels) = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Show or hide the window
+ ///
+ /// \param visible True to show, false to hide
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setVisible(bool visible) = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Show or hide the mouse cursor
+ ///
+ /// \param visible True to show, false to hide
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setMouseCursorVisible(bool visible) = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Enable or disable automatic key-repeat
+ ///
+ /// \param enabled True to enable, false to disable
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setKeyRepeatEnabled(bool enabled) = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Request the current window to be made the active
+ /// foreground window
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void requestFocus() = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check whether the window has the input focus
+ ///
+ /// \return True if window has focus, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool hasFocus() const = 0;
+
+protected:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ WindowImpl();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Push a new event into the event queue
+ ///
+ /// This function is to be used by derived classes, to
+ /// notify the SFML window that a new event was triggered
+ /// by the system.
+ ///
+ /// \param event Event to push
+ ///
+ ////////////////////////////////////////////////////////////
+ void pushEvent(const Event& event);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Process incoming events from the operating system
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void processEvents() = 0;
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Read the joysticks state and generate the appropriate events
+ ///
+ ////////////////////////////////////////////////////////////
+ void processJoystickEvents();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Read the sensors state and generate the appropriate events
+ ///
+ ////////////////////////////////////////////////////////////
+ void processSensorEvents();
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ std::queue<Event> m_events; ///< Queue of available events
+ JoystickState m_joystickStates[Joystick::Count]; ///< Previous state of the joysticks
+ Vector3f m_sensorValue[Sensor::Count]; ///< Previous value of the sensors
+ float m_joystickThreshold; ///< Joystick threshold (minimum motion for "move" event to be generated)
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_WINDOWIMPL_HPP
diff --git a/src/SFML/Window/glext/glext.h b/src/SFML/Window/glext/glext.h
index 22348a1..997dfe0 100644
--- a/src/SFML/Window/glext/glext.h
+++ b/src/SFML/Window/glext/glext.h
@@ -1,13 +1,13 @@
#ifndef __glext_h_
-#define __glext_h_
+#define __glext_h_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
-** Copyright (c) 2007-2010 The Khronos Group Inc.
-**
+** Copyright (c) 2013-2014 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
@@ -15,10 +15,10 @@ extern "C" {
** 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.
@@ -27,15 +27,19 @@ extern "C" {
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
-
-/* Header file version number, required by OpenGL ABI for Linux */
-/* glext.h last updated $Date: 2010-08-03 01:30:25 -0700 (Tue, 03 Aug 2010) $ */
-/* Current version at http://www.opengl.org/registry/ */
-#define GL_GLEXT_VERSION 64
-/* Function declaration macros - to move into glplatform.h */
+/*
+** This header is generated from the Khronos OpenGL / OpenGL ES XML
+** API Registry. The current version of the Registry, generator scripts
+** used to make the header, and the header can be found at
+** http://www.opengl.org/registry/
+**
+** Khronos $Revision: 26320 $ on $Date: 2014-04-17 03:07:07 -0700 (Thu, 17 Apr 2014) $
+*/
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
+#endif
#include <windows.h>
#endif
@@ -49,9 +53,20 @@ extern "C" {
#define GLAPI extern
#endif
-/*************************************************************/
+#define GL_GLEXT_VERSION 20140417
+
+/* Generated C header for:
+ * API: gl
+ * Profile: compatibility
+ * Versions considered: .*
+ * Versions emitted: 1\.[2-9]|[234]\.[0-9]
+ * Default extensions included: gl
+ * Additional extensions included: _nomatch_^
+ * Extensions removed: _nomatch_^
+ */
#ifndef GL_VERSION_1_2
+#define GL_VERSION_1_2 1
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
@@ -88,98 +103,25 @@ extern "C" {
#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#endif
-
-#ifndef GL_VERSION_1_2_DEPRECATED
#define GL_RESCALE_NORMAL 0x803A
#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
#define GL_SINGLE_COLOR 0x81F9
#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
+GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
#endif
-
-#ifndef GL_ARB_imaging
-#define GL_CONSTANT_COLOR 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#define GL_CONSTANT_ALPHA 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
-#define GL_BLEND_COLOR 0x8005
-#define GL_FUNC_ADD 0x8006
-#define GL_MIN 0x8007
-#define GL_MAX 0x8008
-#define GL_BLEND_EQUATION 0x8009
-#define GL_FUNC_SUBTRACT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-#endif
-
-#ifndef GL_ARB_imaging_DEPRECATED
-#define GL_CONVOLUTION_1D 0x8010
-#define GL_CONVOLUTION_2D 0x8011
-#define GL_SEPARABLE_2D 0x8012
-#define GL_CONVOLUTION_BORDER_MODE 0x8013
-#define GL_CONVOLUTION_FILTER_SCALE 0x8014
-#define GL_CONVOLUTION_FILTER_BIAS 0x8015
-#define GL_REDUCE 0x8016
-#define GL_CONVOLUTION_FORMAT 0x8017
-#define GL_CONVOLUTION_WIDTH 0x8018
-#define GL_CONVOLUTION_HEIGHT 0x8019
-#define GL_MAX_CONVOLUTION_WIDTH 0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
-#define GL_HISTOGRAM 0x8024
-#define GL_PROXY_HISTOGRAM 0x8025
-#define GL_HISTOGRAM_WIDTH 0x8026
-#define GL_HISTOGRAM_FORMAT 0x8027
-#define GL_HISTOGRAM_RED_SIZE 0x8028
-#define GL_HISTOGRAM_GREEN_SIZE 0x8029
-#define GL_HISTOGRAM_BLUE_SIZE 0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
-#define GL_HISTOGRAM_SINK 0x802D
-#define GL_MINMAX 0x802E
-#define GL_MINMAX_FORMAT 0x802F
-#define GL_MINMAX_SINK 0x8030
-#define GL_TABLE_TOO_LARGE 0x8031
-#define GL_COLOR_MATRIX 0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
-#define GL_COLOR_TABLE 0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
-#define GL_PROXY_COLOR_TABLE 0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
-#define GL_COLOR_TABLE_SCALE 0x80D6
-#define GL_COLOR_TABLE_BIAS 0x80D7
-#define GL_COLOR_TABLE_FORMAT 0x80D8
-#define GL_COLOR_TABLE_WIDTH 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
-#define GL_CONSTANT_BORDER 0x8151
-#define GL_REPLICATE_BORDER 0x8153
-#define GL_CONVOLUTION_BORDER_COLOR 0x8154
-#endif
+#endif /* GL_VERSION_1_2 */
#ifndef GL_VERSION_1_3
+#define GL_VERSION_1_3 1
#define GL_TEXTURE0 0x84C0
#define GL_TEXTURE1 0x84C1
#define GL_TEXTURE2 0x84C2
@@ -239,9 +181,6 @@ extern "C" {
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
#define GL_CLAMP_TO_BORDER 0x812D
-#endif
-
-#ifndef GL_VERSION_1_3_DEPRECATED
#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
#define GL_MAX_TEXTURE_UNITS 0x84E2
#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
@@ -279,9 +218,104 @@ extern "C" {
#define GL_PREVIOUS 0x8578
#define GL_DOT3_RGB 0x86AE
#define GL_DOT3_RGBA 0x86AF
+typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTexture (GLenum texture);
+GLAPI void APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
+GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data);
+GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
+GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, void *img);
+GLAPI void APIENTRY glClientActiveTexture (GLenum texture);
+GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s);
+GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s);
+GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s);
+GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s);
+GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t);
+GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t);
+GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t);
+GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t);
+GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r);
+GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m);
+GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m);
+GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m);
+GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m);
#endif
+#endif /* GL_VERSION_1_3 */
#ifndef GL_VERSION_1_4
+#define GL_VERSION_1_4 1
#define GL_BLEND_DST_RGB 0x80C8
#define GL_BLEND_SRC_RGB 0x80C9
#define GL_BLEND_DST_ALPHA 0x80CA
@@ -298,9 +332,6 @@ extern "C" {
#define GL_TEXTURE_DEPTH_SIZE 0x884A
#define GL_TEXTURE_COMPARE_MODE 0x884C
#define GL_TEXTURE_COMPARE_FUNC 0x884D
-#endif
-
-#ifndef GL_VERSION_1_4_DEPRECATED
#define GL_POINT_SIZE_MIN 0x8126
#define GL_POINT_SIZE_MAX 0x8127
#define GL_POINT_DISTANCE_ATTENUATION 0x8129
@@ -324,9 +355,118 @@ extern "C" {
#define GL_TEXTURE_FILTER_CONTROL 0x8500
#define GL_DEPTH_TEXTURE_MODE 0x884B
#define GL_COMPARE_R_TO_TEXTURE 0x884E
+#define GL_FUNC_ADD 0x8006
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#define GL_MIN 0x8007
+#define GL_MAX 0x8008
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const void *pointer);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount);
+GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount);
+GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param);
+GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params);
+GLAPI void APIENTRY glFogCoordf (GLfloat coord);
+GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord);
+GLAPI void APIENTRY glFogCoordd (GLdouble coord);
+GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord);
+GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const void *pointer);
+GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue);
+GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v);
+GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue);
+GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v);
+GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue);
+GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v);
+GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue);
+GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v);
+GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue);
+GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v);
+GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue);
+GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v);
+GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue);
+GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v);
+GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue);
+GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v);
+GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer);
+GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y);
+GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y);
+GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y);
+GLAPI void APIENTRY glWindowPos2iv (const GLint *v);
+GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y);
+GLAPI void APIENTRY glWindowPos2sv (const GLshort *v);
+GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glWindowPos3iv (const GLint *v);
+GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glWindowPos3sv (const GLshort *v);
+GLAPI void APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GLAPI void APIENTRY glBlendEquation (GLenum mode);
#endif
+#endif /* GL_VERSION_1_4 */
#ifndef GL_VERSION_1_5
+#define GL_VERSION_1_5 1
+#include <stddef.h>
+typedef ptrdiff_t GLsizeiptr;
+typedef ptrdiff_t GLintptr;
#define GL_BUFFER_SIZE 0x8764
#define GL_BUFFER_USAGE 0x8765
#define GL_QUERY_COUNTER_BITS 0x8864
@@ -354,9 +494,7 @@ extern "C" {
#define GL_DYNAMIC_READ 0x88E9
#define GL_DYNAMIC_COPY 0x88EA
#define GL_SAMPLES_PASSED 0x8914
-#endif
-
-#ifndef GL_VERSION_1_5_DEPRECATED
+#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
@@ -378,11 +516,52 @@ extern "C" {
#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
+typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void *data);
+typedef void *(APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void **params);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids);
+GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids);
+GLAPI GLboolean APIENTRY glIsQuery (GLuint id);
+GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id);
+GLAPI void APIENTRY glEndQuery (GLenum target);
+GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
+GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
+GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer);
+GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
+GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
+GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, void *data);
+GLAPI void *APIENTRY glMapBuffer (GLenum target, GLenum access);
+GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target);
+GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params);
#endif
+#endif /* GL_VERSION_1_5 */
#ifndef GL_VERSION_2_0
+#define GL_VERSION_2_0 1
+typedef char GLchar;
#define GL_BLEND_EQUATION_RGB 0x8009
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
@@ -463,16 +642,202 @@ extern "C" {
#define GL_STENCIL_BACK_REF 0x8CA3
#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
-#endif
-
-#ifndef GL_VERSION_2_0_DEPRECATED
#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
#define GL_POINT_SPRITE 0x8861
#define GL_COORD_REPLACE 0x8862
#define GL_MAX_TEXTURE_COORDS 0x8871
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
+typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
+typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
+typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
+typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
+typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
+typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
+typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
+GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs);
+GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
+GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
+GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader);
+GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
+GLAPI void APIENTRY glCompileShader (GLuint shader);
+GLAPI GLuint APIENTRY glCreateProgram (void);
+GLAPI GLuint APIENTRY glCreateShader (GLenum type);
+GLAPI void APIENTRY glDeleteProgram (GLuint program);
+GLAPI void APIENTRY glDeleteShader (GLuint shader);
+GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader);
+GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index);
+GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index);
+GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
+GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
+GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
+GLAPI GLboolean APIENTRY glIsProgram (GLuint program);
+GLAPI GLboolean APIENTRY glIsShader (GLuint shader);
+GLAPI void APIENTRY glLinkProgram (GLuint program);
+GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
+GLAPI void APIENTRY glUseProgram (GLuint program);
+GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0);
+GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY glUniform1i (GLint location, GLint v0);
+GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glValidateProgram (GLuint program);
+GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
+GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x);
+GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y);
+GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
#endif
+#endif /* GL_VERSION_2_0 */
#ifndef GL_VERSION_2_1
+#define GL_VERSION_2_1 1
#define GL_PIXEL_PACK_BUFFER 0x88EB
#define GL_PIXEL_UNPACK_BUFFER 0x88EC
#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
@@ -489,9 +854,6 @@ extern "C" {
#define GL_SRGB8_ALPHA8 0x8C43
#define GL_COMPRESSED_SRGB 0x8C48
#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
-#endif
-
-#ifndef GL_VERSION_2_1_DEPRECATED
#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
#define GL_SLUMINANCE_ALPHA 0x8C44
#define GL_SLUMINANCE8_ALPHA8 0x8C45
@@ -499,9 +861,25 @@ extern "C" {
#define GL_SLUMINANCE8 0x8C47
#define GL_COMPRESSED_SLUMINANCE 0x8C4A
#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
#endif
+#endif /* GL_VERSION_2_1 */
#ifndef GL_VERSION_3_0
+#define GL_VERSION_3_0 1
+typedef unsigned short GLhalf;
#define GL_COMPARE_REF_TO_TEXTURE 0x884E
#define GL_CLIP_DISTANCE0 0x3000
#define GL_CLIP_DISTANCE1 0x3001
@@ -516,11 +894,9 @@ extern "C" {
#define GL_MINOR_VERSION 0x821C
#define GL_NUM_EXTENSIONS 0x821D
#define GL_CONTEXT_FLAGS 0x821E
-#define GL_DEPTH_BUFFER 0x8223
-#define GL_STENCIL_BUFFER 0x8224
#define GL_COMPRESSED_RED 0x8225
#define GL_COMPRESSED_RG 0x8226
-#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001
+#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001
#define GL_RGBA32F 0x8814
#define GL_RGB32F 0x8815
#define GL_RGBA16F 0x881A
@@ -604,954 +980,9 @@ extern "C" {
#define GL_BUFFER_ACCESS_FLAGS 0x911F
#define GL_BUFFER_MAP_LENGTH 0x9120
#define GL_BUFFER_MAP_OFFSET 0x9121
-/* Reuse tokens from ARB_depth_buffer_float */
-/* reuse GL_DEPTH_COMPONENT32F */
-/* reuse GL_DEPTH32F_STENCIL8 */
-/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */
-/* Reuse tokens from ARB_framebuffer_object */
-/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
-/* reuse GL_FRAMEBUFFER_DEFAULT */
-/* reuse GL_FRAMEBUFFER_UNDEFINED */
-/* reuse GL_DEPTH_STENCIL_ATTACHMENT */
-/* reuse GL_INDEX */
-/* reuse GL_MAX_RENDERBUFFER_SIZE */
-/* reuse GL_DEPTH_STENCIL */
-/* reuse GL_UNSIGNED_INT_24_8 */
-/* reuse GL_DEPTH24_STENCIL8 */
-/* reuse GL_TEXTURE_STENCIL_SIZE */
-/* reuse GL_TEXTURE_RED_TYPE */
-/* reuse GL_TEXTURE_GREEN_TYPE */
-/* reuse GL_TEXTURE_BLUE_TYPE */
-/* reuse GL_TEXTURE_ALPHA_TYPE */
-/* reuse GL_TEXTURE_DEPTH_TYPE */
-/* reuse GL_UNSIGNED_NORMALIZED */
-/* reuse GL_FRAMEBUFFER_BINDING */
-/* reuse GL_DRAW_FRAMEBUFFER_BINDING */
-/* reuse GL_RENDERBUFFER_BINDING */
-/* reuse GL_READ_FRAMEBUFFER */
-/* reuse GL_DRAW_FRAMEBUFFER */
-/* reuse GL_READ_FRAMEBUFFER_BINDING */
-/* reuse GL_RENDERBUFFER_SAMPLES */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
-/* reuse GL_FRAMEBUFFER_COMPLETE */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */
-/* reuse GL_FRAMEBUFFER_UNSUPPORTED */
-/* reuse GL_MAX_COLOR_ATTACHMENTS */
-/* reuse GL_COLOR_ATTACHMENT0 */
-/* reuse GL_COLOR_ATTACHMENT1 */
-/* reuse GL_COLOR_ATTACHMENT2 */
-/* reuse GL_COLOR_ATTACHMENT3 */
-/* reuse GL_COLOR_ATTACHMENT4 */
-/* reuse GL_COLOR_ATTACHMENT5 */
-/* reuse GL_COLOR_ATTACHMENT6 */
-/* reuse GL_COLOR_ATTACHMENT7 */
-/* reuse GL_COLOR_ATTACHMENT8 */
-/* reuse GL_COLOR_ATTACHMENT9 */
-/* reuse GL_COLOR_ATTACHMENT10 */
-/* reuse GL_COLOR_ATTACHMENT11 */
-/* reuse GL_COLOR_ATTACHMENT12 */
-/* reuse GL_COLOR_ATTACHMENT13 */
-/* reuse GL_COLOR_ATTACHMENT14 */
-/* reuse GL_COLOR_ATTACHMENT15 */
-/* reuse GL_DEPTH_ATTACHMENT */
-/* reuse GL_STENCIL_ATTACHMENT */
-/* reuse GL_FRAMEBUFFER */
-/* reuse GL_RENDERBUFFER */
-/* reuse GL_RENDERBUFFER_WIDTH */
-/* reuse GL_RENDERBUFFER_HEIGHT */
-/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */
-/* reuse GL_STENCIL_INDEX1 */
-/* reuse GL_STENCIL_INDEX4 */
-/* reuse GL_STENCIL_INDEX8 */
-/* reuse GL_STENCIL_INDEX16 */
-/* reuse GL_RENDERBUFFER_RED_SIZE */
-/* reuse GL_RENDERBUFFER_GREEN_SIZE */
-/* reuse GL_RENDERBUFFER_BLUE_SIZE */
-/* reuse GL_RENDERBUFFER_ALPHA_SIZE */
-/* reuse GL_RENDERBUFFER_DEPTH_SIZE */
-/* reuse GL_RENDERBUFFER_STENCIL_SIZE */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
-/* reuse GL_MAX_SAMPLES */
-/* Reuse tokens from ARB_framebuffer_sRGB */
-/* reuse GL_FRAMEBUFFER_SRGB */
-/* Reuse tokens from ARB_half_float_vertex */
-/* reuse GL_HALF_FLOAT */
-/* Reuse tokens from ARB_map_buffer_range */
-/* reuse GL_MAP_READ_BIT */
-/* reuse GL_MAP_WRITE_BIT */
-/* reuse GL_MAP_INVALIDATE_RANGE_BIT */
-/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */
-/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */
-/* reuse GL_MAP_UNSYNCHRONIZED_BIT */
-/* Reuse tokens from ARB_texture_compression_rgtc */
-/* reuse GL_COMPRESSED_RED_RGTC1 */
-/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */
-/* reuse GL_COMPRESSED_RG_RGTC2 */
-/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */
-/* Reuse tokens from ARB_texture_rg */
-/* reuse GL_RG */
-/* reuse GL_RG_INTEGER */
-/* reuse GL_R8 */
-/* reuse GL_R16 */
-/* reuse GL_RG8 */
-/* reuse GL_RG16 */
-/* reuse GL_R16F */
-/* reuse GL_R32F */
-/* reuse GL_RG16F */
-/* reuse GL_RG32F */
-/* reuse GL_R8I */
-/* reuse GL_R8UI */
-/* reuse GL_R16I */
-/* reuse GL_R16UI */
-/* reuse GL_R32I */
-/* reuse GL_R32UI */
-/* reuse GL_RG8I */
-/* reuse GL_RG8UI */
-/* reuse GL_RG16I */
-/* reuse GL_RG16UI */
-/* reuse GL_RG32I */
-/* reuse GL_RG32UI */
-/* Reuse tokens from ARB_vertex_array_object */
-/* reuse GL_VERTEX_ARRAY_BINDING */
-#endif
-
-#ifndef GL_VERSION_3_0_DEPRECATED
-#define GL_CLAMP_VERTEX_COLOR 0x891A
-#define GL_CLAMP_FRAGMENT_COLOR 0x891B
-#define GL_ALPHA_INTEGER 0x8D97
-/* Reuse tokens from ARB_framebuffer_object */
-/* reuse GL_TEXTURE_LUMINANCE_TYPE */
-/* reuse GL_TEXTURE_INTENSITY_TYPE */
-#endif
-
-#ifndef GL_VERSION_3_1
-#define GL_SAMPLER_2D_RECT 0x8B63
-#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
-#define GL_SAMPLER_BUFFER 0x8DC2
-#define GL_INT_SAMPLER_2D_RECT 0x8DCD
-#define GL_INT_SAMPLER_BUFFER 0x8DD0
-#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
-#define GL_TEXTURE_BUFFER 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER 0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D
-#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E
-#define GL_TEXTURE_RECTANGLE 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
-#define GL_RED_SNORM 0x8F90
-#define GL_RG_SNORM 0x8F91
-#define GL_RGB_SNORM 0x8F92
-#define GL_RGBA_SNORM 0x8F93
-#define GL_R8_SNORM 0x8F94
-#define GL_RG8_SNORM 0x8F95
-#define GL_RGB8_SNORM 0x8F96
-#define GL_RGBA8_SNORM 0x8F97
-#define GL_R16_SNORM 0x8F98
-#define GL_RG16_SNORM 0x8F99
-#define GL_RGB16_SNORM 0x8F9A
-#define GL_RGBA16_SNORM 0x8F9B
-#define GL_SIGNED_NORMALIZED 0x8F9C
-#define GL_PRIMITIVE_RESTART 0x8F9D
-#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
-/* Reuse tokens from ARB_copy_buffer */
-/* reuse GL_COPY_READ_BUFFER */
-/* reuse GL_COPY_WRITE_BUFFER */
-/* Reuse tokens from ARB_draw_instanced (none) */
-/* Reuse tokens from ARB_uniform_buffer_object */
-/* reuse GL_UNIFORM_BUFFER */
-/* reuse GL_UNIFORM_BUFFER_BINDING */
-/* reuse GL_UNIFORM_BUFFER_START */
-/* reuse GL_UNIFORM_BUFFER_SIZE */
-/* reuse GL_MAX_VERTEX_UNIFORM_BLOCKS */
-/* reuse GL_MAX_FRAGMENT_UNIFORM_BLOCKS */
-/* reuse GL_MAX_COMBINED_UNIFORM_BLOCKS */
-/* reuse GL_MAX_UNIFORM_BUFFER_BINDINGS */
-/* reuse GL_MAX_UNIFORM_BLOCK_SIZE */
-/* reuse GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS */
-/* reuse GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS */
-/* reuse GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT */
-/* reuse GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */
-/* reuse GL_ACTIVE_UNIFORM_BLOCKS */
-/* reuse GL_UNIFORM_TYPE */
-/* reuse GL_UNIFORM_SIZE */
-/* reuse GL_UNIFORM_NAME_LENGTH */
-/* reuse GL_UNIFORM_BLOCK_INDEX */
-/* reuse GL_UNIFORM_OFFSET */
-/* reuse GL_UNIFORM_ARRAY_STRIDE */
-/* reuse GL_UNIFORM_MATRIX_STRIDE */
-/* reuse GL_UNIFORM_IS_ROW_MAJOR */
-/* reuse GL_UNIFORM_BLOCK_BINDING */
-/* reuse GL_UNIFORM_BLOCK_DATA_SIZE */
-/* reuse GL_UNIFORM_BLOCK_NAME_LENGTH */
-/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS */
-/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES */
-/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER */
-/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER */
-/* reuse GL_INVALID_INDEX */
-#endif
-
-#ifndef GL_VERSION_3_2
-#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
-#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
-#define GL_LINES_ADJACENCY 0x000A
-#define GL_LINE_STRIP_ADJACENCY 0x000B
-#define GL_TRIANGLES_ADJACENCY 0x000C
-#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D
-#define GL_PROGRAM_POINT_SIZE 0x8642
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8
-#define GL_GEOMETRY_SHADER 0x8DD9
-#define GL_GEOMETRY_VERTICES_OUT 0x8916
-#define GL_GEOMETRY_INPUT_TYPE 0x8917
-#define GL_GEOMETRY_OUTPUT_TYPE 0x8918
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1
-#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
-#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123
-#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124
-#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
-#define GL_CONTEXT_PROFILE_MASK 0x9126
-/* reuse GL_MAX_VARYING_COMPONENTS */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
-/* Reuse tokens from ARB_depth_clamp */
-/* reuse GL_DEPTH_CLAMP */
-/* Reuse tokens from ARB_draw_elements_base_vertex (none) */
-/* Reuse tokens from ARB_fragment_coord_conventions (none) */
-/* Reuse tokens from ARB_provoking_vertex */
-/* reuse GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
-/* reuse GL_FIRST_VERTEX_CONVENTION */
-/* reuse GL_LAST_VERTEX_CONVENTION */
-/* reuse GL_PROVOKING_VERTEX */
-/* Reuse tokens from ARB_seamless_cube_map */
-/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */
-/* Reuse tokens from ARB_sync */
-/* reuse GL_MAX_SERVER_WAIT_TIMEOUT */
-/* reuse GL_OBJECT_TYPE */
-/* reuse GL_SYNC_CONDITION */
-/* reuse GL_SYNC_STATUS */
-/* reuse GL_SYNC_FLAGS */
-/* reuse GL_SYNC_FENCE */
-/* reuse GL_SYNC_GPU_COMMANDS_COMPLETE */
-/* reuse GL_UNSIGNALED */
-/* reuse GL_SIGNALED */
-/* reuse GL_ALREADY_SIGNALED */
-/* reuse GL_TIMEOUT_EXPIRED */
-/* reuse GL_CONDITION_SATISFIED */
-/* reuse GL_WAIT_FAILED */
-/* reuse GL_TIMEOUT_IGNORED */
-/* reuse GL_SYNC_FLUSH_COMMANDS_BIT */
-/* reuse GL_TIMEOUT_IGNORED */
-/* Reuse tokens from ARB_texture_multisample */
-/* reuse GL_SAMPLE_POSITION */
-/* reuse GL_SAMPLE_MASK */
-/* reuse GL_SAMPLE_MASK_VALUE */
-/* reuse GL_MAX_SAMPLE_MASK_WORDS */
-/* reuse GL_TEXTURE_2D_MULTISAMPLE */
-/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE */
-/* reuse GL_TEXTURE_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE */
-/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_TEXTURE_SAMPLES */
-/* reuse GL_TEXTURE_FIXED_SAMPLE_LOCATIONS */
-/* reuse GL_SAMPLER_2D_MULTISAMPLE */
-/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE */
-/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE */
-/* reuse GL_SAMPLER_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_MAX_COLOR_TEXTURE_SAMPLES */
-/* reuse GL_MAX_DEPTH_TEXTURE_SAMPLES */
-/* reuse GL_MAX_INTEGER_SAMPLES */
-/* Don't need to reuse tokens from ARB_vertex_array_bgra since they're already in 1.2 core */
-#endif
-
-#ifndef GL_VERSION_3_3
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
-/* Reuse tokens from ARB_blend_func_extended */
-/* reuse GL_SRC1_COLOR */
-/* reuse GL_ONE_MINUS_SRC1_COLOR */
-/* reuse GL_ONE_MINUS_SRC1_ALPHA */
-/* reuse GL_MAX_DUAL_SOURCE_DRAW_BUFFERS */
-/* Reuse tokens from ARB_explicit_attrib_location (none) */
-/* Reuse tokens from ARB_occlusion_query2 */
-/* reuse GL_ANY_SAMPLES_PASSED */
-/* Reuse tokens from ARB_sampler_objects */
-/* reuse GL_SAMPLER_BINDING */
-/* Reuse tokens from ARB_shader_bit_encoding (none) */
-/* Reuse tokens from ARB_texture_rgb10_a2ui */
-/* reuse GL_RGB10_A2UI */
-/* Reuse tokens from ARB_texture_swizzle */
-/* reuse GL_TEXTURE_SWIZZLE_R */
-/* reuse GL_TEXTURE_SWIZZLE_G */
-/* reuse GL_TEXTURE_SWIZZLE_B */
-/* reuse GL_TEXTURE_SWIZZLE_A */
-/* reuse GL_TEXTURE_SWIZZLE_RGBA */
-/* Reuse tokens from ARB_timer_query */
-/* reuse GL_TIME_ELAPSED */
-/* reuse GL_TIMESTAMP */
-/* Reuse tokens from ARB_vertex_type_2_10_10_10_rev */
-/* reuse GL_INT_2_10_10_10_REV */
-#endif
-
-#ifndef GL_VERSION_4_0
-#define GL_SAMPLE_SHADING 0x8C36
-#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F
-#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B
-#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C
-#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D
-#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F
-/* Reuse tokens from ARB_texture_query_lod (none) */
-/* Reuse tokens from ARB_draw_buffers_blend (none) */
-/* Reuse tokens from ARB_draw_indirect */
-/* reuse GL_DRAW_INDIRECT_BUFFER */
-/* reuse GL_DRAW_INDIRECT_BUFFER_BINDING */
-/* Reuse tokens from ARB_gpu_shader5 */
-/* reuse GL_GEOMETRY_SHADER_INVOCATIONS */
-/* reuse GL_MAX_GEOMETRY_SHADER_INVOCATIONS */
-/* reuse GL_MIN_FRAGMENT_INTERPOLATION_OFFSET */
-/* reuse GL_MAX_FRAGMENT_INTERPOLATION_OFFSET */
-/* reuse GL_FRAGMENT_INTERPOLATION_OFFSET_BITS */
-/* reuse GL_MAX_VERTEX_STREAMS */
-/* Reuse tokens from ARB_gpu_shader_fp64 */
-/* reuse GL_DOUBLE_VEC2 */
-/* reuse GL_DOUBLE_VEC3 */
-/* reuse GL_DOUBLE_VEC4 */
-/* reuse GL_DOUBLE_MAT2 */
-/* reuse GL_DOUBLE_MAT3 */
-/* reuse GL_DOUBLE_MAT4 */
-/* reuse GL_DOUBLE_MAT2x3 */
-/* reuse GL_DOUBLE_MAT2x4 */
-/* reuse GL_DOUBLE_MAT3x2 */
-/* reuse GL_DOUBLE_MAT3x4 */
-/* reuse GL_DOUBLE_MAT4x2 */
-/* reuse GL_DOUBLE_MAT4x3 */
-/* Reuse tokens from ARB_shader_subroutine */
-/* reuse GL_ACTIVE_SUBROUTINES */
-/* reuse GL_ACTIVE_SUBROUTINE_UNIFORMS */
-/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS */
-/* reuse GL_ACTIVE_SUBROUTINE_MAX_LENGTH */
-/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH */
-/* reuse GL_MAX_SUBROUTINES */
-/* reuse GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS */
-/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */
-/* reuse GL_COMPATIBLE_SUBROUTINES */
-/* Reuse tokens from ARB_tessellation_shader */
-/* reuse GL_PATCHES */
-/* reuse GL_PATCH_VERTICES */
-/* reuse GL_PATCH_DEFAULT_INNER_LEVEL */
-/* reuse GL_PATCH_DEFAULT_OUTER_LEVEL */
-/* reuse GL_TESS_CONTROL_OUTPUT_VERTICES */
-/* reuse GL_TESS_GEN_MODE */
-/* reuse GL_TESS_GEN_SPACING */
-/* reuse GL_TESS_GEN_VERTEX_ORDER */
-/* reuse GL_TESS_GEN_POINT_MODE */
-/* reuse GL_ISOLINES */
-/* reuse GL_FRACTIONAL_ODD */
-/* reuse GL_FRACTIONAL_EVEN */
-/* reuse GL_MAX_PATCH_VERTICES */
-/* reuse GL_MAX_TESS_GEN_LEVEL */
-/* reuse GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS */
-/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS */
-/* reuse GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS */
-/* reuse GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS */
-/* reuse GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS */
-/* reuse GL_MAX_TESS_PATCH_COMPONENTS */
-/* reuse GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS */
-/* reuse GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS */
-/* reuse GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS */
-/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS */
-/* reuse GL_MAX_TESS_CONTROL_INPUT_COMPONENTS */
-/* reuse GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS */
-/* reuse GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS */
-/* reuse GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS */
-/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER */
-/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER */
-/* reuse GL_TESS_EVALUATION_SHADER */
-/* reuse GL_TESS_CONTROL_SHADER */
-/* Reuse tokens from ARB_texture_buffer_object_rgb32 (none) */
-/* Reuse tokens from ARB_transform_feedback2 */
-/* reuse GL_TRANSFORM_FEEDBACK */
-/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
-/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
-/* reuse GL_TRANSFORM_FEEDBACK_BINDING */
-/* Reuse tokens from ARB_transform_feedback3 */
-/* reuse GL_MAX_TRANSFORM_FEEDBACK_BUFFERS */
-/* reuse GL_MAX_VERTEX_STREAMS */
-#endif
-
-#ifndef GL_VERSION_4_1
-/* Reuse tokens from ARB_ES2_compatibility */
-/* reuse GL_FIXED */
-/* reuse GL_IMPLEMENTATION_COLOR_READ_TYPE */
-/* reuse GL_IMPLEMENTATION_COLOR_READ_FORMAT */
-/* reuse GL_LOW_FLOAT */
-/* reuse GL_MEDIUM_FLOAT */
-/* reuse GL_HIGH_FLOAT */
-/* reuse GL_LOW_INT */
-/* reuse GL_MEDIUM_INT */
-/* reuse GL_HIGH_INT */
-/* reuse GL_SHADER_COMPILER */
-/* reuse GL_NUM_SHADER_BINARY_FORMATS */
-/* reuse GL_MAX_VERTEX_UNIFORM_VECTORS */
-/* reuse GL_MAX_VARYING_VECTORS */
-/* reuse GL_MAX_FRAGMENT_UNIFORM_VECTORS */
-/* Reuse tokens from ARB_get_program_binary */
-/* reuse GL_PROGRAM_BINARY_RETRIEVABLE_HINT */
-/* reuse GL_PROGRAM_BINARY_LENGTH */
-/* reuse GL_NUM_PROGRAM_BINARY_FORMATS */
-/* reuse GL_PROGRAM_BINARY_FORMATS */
-/* Reuse tokens from ARB_separate_shader_objects */
-/* reuse GL_VERTEX_SHADER_BIT */
-/* reuse GL_FRAGMENT_SHADER_BIT */
-/* reuse GL_GEOMETRY_SHADER_BIT */
-/* reuse GL_TESS_CONTROL_SHADER_BIT */
-/* reuse GL_TESS_EVALUATION_SHADER_BIT */
-/* reuse GL_ALL_SHADER_BITS */
-/* reuse GL_PROGRAM_SEPARABLE */
-/* reuse GL_ACTIVE_PROGRAM */
-/* reuse GL_PROGRAM_PIPELINE_BINDING */
-/* Reuse tokens from ARB_shader_precision (none) */
-/* Reuse tokens from ARB_vertex_attrib_64bit - all are in GL 3.0 and 4.0 already */
-/* Reuse tokens from ARB_viewport_array - some are in GL 1.1 and ARB_provoking_vertex already */
-/* reuse GL_MAX_VIEWPORTS */
-/* reuse GL_VIEWPORT_SUBPIXEL_BITS */
-/* reuse GL_VIEWPORT_BOUNDS_RANGE */
-/* reuse GL_LAYER_PROVOKING_VERTEX */
-/* reuse GL_VIEWPORT_INDEX_PROVOKING_VERTEX */
-/* reuse GL_UNDEFINED_VERTEX */
-#endif
-
-#ifndef GL_ARB_multitexture
-#define GL_TEXTURE0_ARB 0x84C0
-#define GL_TEXTURE1_ARB 0x84C1
-#define GL_TEXTURE2_ARB 0x84C2
-#define GL_TEXTURE3_ARB 0x84C3
-#define GL_TEXTURE4_ARB 0x84C4
-#define GL_TEXTURE5_ARB 0x84C5
-#define GL_TEXTURE6_ARB 0x84C6
-#define GL_TEXTURE7_ARB 0x84C7
-#define GL_TEXTURE8_ARB 0x84C8
-#define GL_TEXTURE9_ARB 0x84C9
-#define GL_TEXTURE10_ARB 0x84CA
-#define GL_TEXTURE11_ARB 0x84CB
-#define GL_TEXTURE12_ARB 0x84CC
-#define GL_TEXTURE13_ARB 0x84CD
-#define GL_TEXTURE14_ARB 0x84CE
-#define GL_TEXTURE15_ARB 0x84CF
-#define GL_TEXTURE16_ARB 0x84D0
-#define GL_TEXTURE17_ARB 0x84D1
-#define GL_TEXTURE18_ARB 0x84D2
-#define GL_TEXTURE19_ARB 0x84D3
-#define GL_TEXTURE20_ARB 0x84D4
-#define GL_TEXTURE21_ARB 0x84D5
-#define GL_TEXTURE22_ARB 0x84D6
-#define GL_TEXTURE23_ARB 0x84D7
-#define GL_TEXTURE24_ARB 0x84D8
-#define GL_TEXTURE25_ARB 0x84D9
-#define GL_TEXTURE26_ARB 0x84DA
-#define GL_TEXTURE27_ARB 0x84DB
-#define GL_TEXTURE28_ARB 0x84DC
-#define GL_TEXTURE29_ARB 0x84DD
-#define GL_TEXTURE30_ARB 0x84DE
-#define GL_TEXTURE31_ARB 0x84DF
-#define GL_ACTIVE_TEXTURE_ARB 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
-#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
-#endif
-
-#ifndef GL_ARB_transpose_matrix
-#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6
-#endif
-
-#ifndef GL_ARB_multisample
-#define GL_MULTISAMPLE_ARB 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F
-#define GL_SAMPLE_COVERAGE_ARB 0x80A0
-#define GL_SAMPLE_BUFFERS_ARB 0x80A8
-#define GL_SAMPLES_ARB 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB
-#define GL_MULTISAMPLE_BIT_ARB 0x20000000
-#endif
-
-#ifndef GL_ARB_texture_env_add
-#endif
-
-#ifndef GL_ARB_texture_cube_map
-#define GL_NORMAL_MAP_ARB 0x8511
-#define GL_REFLECTION_MAP_ARB 0x8512
-#define GL_TEXTURE_CUBE_MAP_ARB 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C
-#endif
-
-#ifndef GL_ARB_texture_compression
-#define GL_COMPRESSED_ALPHA_ARB 0x84E9
-#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
-#define GL_COMPRESSED_INTENSITY_ARB 0x84EC
-#define GL_COMPRESSED_RGB_ARB 0x84ED
-#define GL_COMPRESSED_RGBA_ARB 0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
-#define GL_TEXTURE_COMPRESSED_ARB 0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
-#endif
-
-#ifndef GL_ARB_texture_border_clamp
-#define GL_CLAMP_TO_BORDER_ARB 0x812D
-#endif
-
-#ifndef GL_ARB_point_parameters
-#define GL_POINT_SIZE_MIN_ARB 0x8126
-#define GL_POINT_SIZE_MAX_ARB 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128
-#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
-#endif
-
-#ifndef GL_ARB_vertex_blend
-#define GL_MAX_VERTEX_UNITS_ARB 0x86A4
-#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5
-#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6
-#define GL_VERTEX_BLEND_ARB 0x86A7
-#define GL_CURRENT_WEIGHT_ARB 0x86A8
-#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9
-#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA
-#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB
-#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC
-#define GL_WEIGHT_ARRAY_ARB 0x86AD
-#define GL_MODELVIEW0_ARB 0x1700
-#define GL_MODELVIEW1_ARB 0x850A
-#define GL_MODELVIEW2_ARB 0x8722
-#define GL_MODELVIEW3_ARB 0x8723
-#define GL_MODELVIEW4_ARB 0x8724
-#define GL_MODELVIEW5_ARB 0x8725
-#define GL_MODELVIEW6_ARB 0x8726
-#define GL_MODELVIEW7_ARB 0x8727
-#define GL_MODELVIEW8_ARB 0x8728
-#define GL_MODELVIEW9_ARB 0x8729
-#define GL_MODELVIEW10_ARB 0x872A
-#define GL_MODELVIEW11_ARB 0x872B
-#define GL_MODELVIEW12_ARB 0x872C
-#define GL_MODELVIEW13_ARB 0x872D
-#define GL_MODELVIEW14_ARB 0x872E
-#define GL_MODELVIEW15_ARB 0x872F
-#define GL_MODELVIEW16_ARB 0x8730
-#define GL_MODELVIEW17_ARB 0x8731
-#define GL_MODELVIEW18_ARB 0x8732
-#define GL_MODELVIEW19_ARB 0x8733
-#define GL_MODELVIEW20_ARB 0x8734
-#define GL_MODELVIEW21_ARB 0x8735
-#define GL_MODELVIEW22_ARB 0x8736
-#define GL_MODELVIEW23_ARB 0x8737
-#define GL_MODELVIEW24_ARB 0x8738
-#define GL_MODELVIEW25_ARB 0x8739
-#define GL_MODELVIEW26_ARB 0x873A
-#define GL_MODELVIEW27_ARB 0x873B
-#define GL_MODELVIEW28_ARB 0x873C
-#define GL_MODELVIEW29_ARB 0x873D
-#define GL_MODELVIEW30_ARB 0x873E
-#define GL_MODELVIEW31_ARB 0x873F
-#endif
-
-#ifndef GL_ARB_matrix_palette
-#define GL_MATRIX_PALETTE_ARB 0x8840
-#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
-#define GL_MAX_PALETTE_MATRICES_ARB 0x8842
-#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843
-#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844
-#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845
-#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846
-#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847
-#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848
-#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
-#endif
-
-#ifndef GL_ARB_texture_env_combine
-#define GL_COMBINE_ARB 0x8570
-#define GL_COMBINE_RGB_ARB 0x8571
-#define GL_COMBINE_ALPHA_ARB 0x8572
-#define GL_SOURCE0_RGB_ARB 0x8580
-#define GL_SOURCE1_RGB_ARB 0x8581
-#define GL_SOURCE2_RGB_ARB 0x8582
-#define GL_SOURCE0_ALPHA_ARB 0x8588
-#define GL_SOURCE1_ALPHA_ARB 0x8589
-#define GL_SOURCE2_ALPHA_ARB 0x858A
-#define GL_OPERAND0_RGB_ARB 0x8590
-#define GL_OPERAND1_RGB_ARB 0x8591
-#define GL_OPERAND2_RGB_ARB 0x8592
-#define GL_OPERAND0_ALPHA_ARB 0x8598
-#define GL_OPERAND1_ALPHA_ARB 0x8599
-#define GL_OPERAND2_ALPHA_ARB 0x859A
-#define GL_RGB_SCALE_ARB 0x8573
-#define GL_ADD_SIGNED_ARB 0x8574
-#define GL_INTERPOLATE_ARB 0x8575
-#define GL_SUBTRACT_ARB 0x84E7
-#define GL_CONSTANT_ARB 0x8576
-#define GL_PRIMARY_COLOR_ARB 0x8577
-#define GL_PREVIOUS_ARB 0x8578
-#endif
-
-#ifndef GL_ARB_texture_env_crossbar
-#endif
-
-#ifndef GL_ARB_texture_env_dot3
-#define GL_DOT3_RGB_ARB 0x86AE
-#define GL_DOT3_RGBA_ARB 0x86AF
-#endif
-
-#ifndef GL_ARB_texture_mirrored_repeat
-#define GL_MIRRORED_REPEAT_ARB 0x8370
-#endif
-
-#ifndef GL_ARB_depth_texture
-#define GL_DEPTH_COMPONENT16_ARB 0x81A5
-#define GL_DEPTH_COMPONENT24_ARB 0x81A6
-#define GL_DEPTH_COMPONENT32_ARB 0x81A7
-#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A
-#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
-#endif
-
-#ifndef GL_ARB_shadow
-#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C
-#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D
-#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E
-#endif
-
-#ifndef GL_ARB_shadow_ambient
-#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
-#endif
-
-#ifndef GL_ARB_window_pos
-#endif
-
-#ifndef GL_ARB_vertex_program
-#define GL_COLOR_SUM_ARB 0x8458
-#define GL_VERTEX_PROGRAM_ARB 0x8620
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625
-#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626
-#define GL_PROGRAM_LENGTH_ARB 0x8627
-#define GL_PROGRAM_STRING_ARB 0x8628
-#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
-#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F
-#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
-#define GL_CURRENT_MATRIX_ARB 0x8641
-#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
-#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B
-#define GL_PROGRAM_BINDING_ARB 0x8677
-#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
-#define GL_PROGRAM_ERROR_STRING_ARB 0x8874
-#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
-#define GL_PROGRAM_FORMAT_ARB 0x8876
-#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0
-#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1
-#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
-#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
-#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4
-#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5
-#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
-#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
-#define GL_PROGRAM_PARAMETERS_ARB 0x88A8
-#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9
-#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA
-#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
-#define GL_PROGRAM_ATTRIBS_ARB 0x88AC
-#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD
-#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE
-#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
-#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0
-#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
-#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
-#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
-#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
-#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
-#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
-#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7
-#define GL_MATRIX0_ARB 0x88C0
-#define GL_MATRIX1_ARB 0x88C1
-#define GL_MATRIX2_ARB 0x88C2
-#define GL_MATRIX3_ARB 0x88C3
-#define GL_MATRIX4_ARB 0x88C4
-#define GL_MATRIX5_ARB 0x88C5
-#define GL_MATRIX6_ARB 0x88C6
-#define GL_MATRIX7_ARB 0x88C7
-#define GL_MATRIX8_ARB 0x88C8
-#define GL_MATRIX9_ARB 0x88C9
-#define GL_MATRIX10_ARB 0x88CA
-#define GL_MATRIX11_ARB 0x88CB
-#define GL_MATRIX12_ARB 0x88CC
-#define GL_MATRIX13_ARB 0x88CD
-#define GL_MATRIX14_ARB 0x88CE
-#define GL_MATRIX15_ARB 0x88CF
-#define GL_MATRIX16_ARB 0x88D0
-#define GL_MATRIX17_ARB 0x88D1
-#define GL_MATRIX18_ARB 0x88D2
-#define GL_MATRIX19_ARB 0x88D3
-#define GL_MATRIX20_ARB 0x88D4
-#define GL_MATRIX21_ARB 0x88D5
-#define GL_MATRIX22_ARB 0x88D6
-#define GL_MATRIX23_ARB 0x88D7
-#define GL_MATRIX24_ARB 0x88D8
-#define GL_MATRIX25_ARB 0x88D9
-#define GL_MATRIX26_ARB 0x88DA
-#define GL_MATRIX27_ARB 0x88DB
-#define GL_MATRIX28_ARB 0x88DC
-#define GL_MATRIX29_ARB 0x88DD
-#define GL_MATRIX30_ARB 0x88DE
-#define GL_MATRIX31_ARB 0x88DF
-#endif
-
-#ifndef GL_ARB_fragment_program
-#define GL_FRAGMENT_PROGRAM_ARB 0x8804
-#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805
-#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806
-#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807
-#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
-#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
-#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
-#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
-#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
-#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
-#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
-#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
-#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
-#define GL_MAX_TEXTURE_COORDS_ARB 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872
-#endif
-
-#ifndef GL_ARB_vertex_buffer_object
-#define GL_BUFFER_SIZE_ARB 0x8764
-#define GL_BUFFER_USAGE_ARB 0x8765
-#define GL_ARRAY_BUFFER_ARB 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893
-#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
-#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
-#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
-#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
-#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
-#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
-#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
-#define GL_READ_ONLY_ARB 0x88B8
-#define GL_WRITE_ONLY_ARB 0x88B9
-#define GL_READ_WRITE_ARB 0x88BA
-#define GL_BUFFER_ACCESS_ARB 0x88BB
-#define GL_BUFFER_MAPPED_ARB 0x88BC
-#define GL_BUFFER_MAP_POINTER_ARB 0x88BD
-#define GL_STREAM_DRAW_ARB 0x88E0
-#define GL_STREAM_READ_ARB 0x88E1
-#define GL_STREAM_COPY_ARB 0x88E2
-#define GL_STATIC_DRAW_ARB 0x88E4
-#define GL_STATIC_READ_ARB 0x88E5
-#define GL_STATIC_COPY_ARB 0x88E6
-#define GL_DYNAMIC_DRAW_ARB 0x88E8
-#define GL_DYNAMIC_READ_ARB 0x88E9
-#define GL_DYNAMIC_COPY_ARB 0x88EA
-#endif
-
-#ifndef GL_ARB_occlusion_query
-#define GL_QUERY_COUNTER_BITS_ARB 0x8864
-#define GL_CURRENT_QUERY_ARB 0x8865
-#define GL_QUERY_RESULT_ARB 0x8866
-#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867
-#define GL_SAMPLES_PASSED_ARB 0x8914
-#endif
-
-#ifndef GL_ARB_shader_objects
-#define GL_PROGRAM_OBJECT_ARB 0x8B40
-#define GL_SHADER_OBJECT_ARB 0x8B48
-#define GL_OBJECT_TYPE_ARB 0x8B4E
-#define GL_OBJECT_SUBTYPE_ARB 0x8B4F
-#define GL_FLOAT_VEC2_ARB 0x8B50
-#define GL_FLOAT_VEC3_ARB 0x8B51
-#define GL_FLOAT_VEC4_ARB 0x8B52
-#define GL_INT_VEC2_ARB 0x8B53
-#define GL_INT_VEC3_ARB 0x8B54
-#define GL_INT_VEC4_ARB 0x8B55
-#define GL_BOOL_ARB 0x8B56
-#define GL_BOOL_VEC2_ARB 0x8B57
-#define GL_BOOL_VEC3_ARB 0x8B58
-#define GL_BOOL_VEC4_ARB 0x8B59
-#define GL_FLOAT_MAT2_ARB 0x8B5A
-#define GL_FLOAT_MAT3_ARB 0x8B5B
-#define GL_FLOAT_MAT4_ARB 0x8B5C
-#define GL_SAMPLER_1D_ARB 0x8B5D
-#define GL_SAMPLER_2D_ARB 0x8B5E
-#define GL_SAMPLER_3D_ARB 0x8B5F
-#define GL_SAMPLER_CUBE_ARB 0x8B60
-#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61
-#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62
-#define GL_SAMPLER_2D_RECT_ARB 0x8B63
-#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
-#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80
-#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81
-#define GL_OBJECT_LINK_STATUS_ARB 0x8B82
-#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83
-#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84
-#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85
-#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86
-#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
-#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
-#endif
-
-#ifndef GL_ARB_vertex_shader
-#define GL_VERTEX_SHADER_ARB 0x8B31
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
-#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
-#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89
-#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
-#endif
-
-#ifndef GL_ARB_fragment_shader
-#define GL_FRAGMENT_SHADER_ARB 0x8B30
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
-#endif
-
-#ifndef GL_ARB_shading_language_100
-#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C
-#endif
-
-#ifndef GL_ARB_texture_non_power_of_two
-#endif
-
-#ifndef GL_ARB_point_sprite
-#define GL_POINT_SPRITE_ARB 0x8861
-#define GL_COORD_REPLACE_ARB 0x8862
-#endif
-
-#ifndef GL_ARB_fragment_program_shadow
-#endif
-
-#ifndef GL_ARB_draw_buffers
-#define GL_MAX_DRAW_BUFFERS_ARB 0x8824
-#define GL_DRAW_BUFFER0_ARB 0x8825
-#define GL_DRAW_BUFFER1_ARB 0x8826
-#define GL_DRAW_BUFFER2_ARB 0x8827
-#define GL_DRAW_BUFFER3_ARB 0x8828
-#define GL_DRAW_BUFFER4_ARB 0x8829
-#define GL_DRAW_BUFFER5_ARB 0x882A
-#define GL_DRAW_BUFFER6_ARB 0x882B
-#define GL_DRAW_BUFFER7_ARB 0x882C
-#define GL_DRAW_BUFFER8_ARB 0x882D
-#define GL_DRAW_BUFFER9_ARB 0x882E
-#define GL_DRAW_BUFFER10_ARB 0x882F
-#define GL_DRAW_BUFFER11_ARB 0x8830
-#define GL_DRAW_BUFFER12_ARB 0x8831
-#define GL_DRAW_BUFFER13_ARB 0x8832
-#define GL_DRAW_BUFFER14_ARB 0x8833
-#define GL_DRAW_BUFFER15_ARB 0x8834
-#endif
-
-#ifndef GL_ARB_texture_rectangle
-#define GL_TEXTURE_RECTANGLE_ARB 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
-#endif
-
-#ifndef GL_ARB_color_buffer_float
-#define GL_RGBA_FLOAT_MODE_ARB 0x8820
-#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A
-#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B
-#define GL_CLAMP_READ_COLOR_ARB 0x891C
-#define GL_FIXED_ONLY_ARB 0x891D
-#endif
-
-#ifndef GL_ARB_half_float_pixel
-#define GL_HALF_FLOAT_ARB 0x140B
-#endif
-
-#ifndef GL_ARB_texture_float
-#define GL_TEXTURE_RED_TYPE_ARB 0x8C10
-#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11
-#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12
-#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13
-#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14
-#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15
-#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16
-#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17
-#define GL_RGBA32F_ARB 0x8814
-#define GL_RGB32F_ARB 0x8815
-#define GL_ALPHA32F_ARB 0x8816
-#define GL_INTENSITY32F_ARB 0x8817
-#define GL_LUMINANCE32F_ARB 0x8818
-#define GL_LUMINANCE_ALPHA32F_ARB 0x8819
-#define GL_RGBA16F_ARB 0x881A
-#define GL_RGB16F_ARB 0x881B
-#define GL_ALPHA16F_ARB 0x881C
-#define GL_INTENSITY16F_ARB 0x881D
-#define GL_LUMINANCE16F_ARB 0x881E
-#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
-#endif
-
-#ifndef GL_ARB_pixel_buffer_object
-#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
-#endif
-
-#ifndef GL_ARB_depth_buffer_float
#define GL_DEPTH_COMPONENT32F 0x8CAC
#define GL_DEPTH32F_STENCIL8 0x8CAD
#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
-#endif
-
-#ifndef GL_ARB_draw_instanced
-#endif
-
-#ifndef GL_ARB_framebuffer_object
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
@@ -1576,7 +1007,7 @@ extern "C" {
#define GL_TEXTURE_DEPTH_TYPE 0x8C16
#define GL_UNSIGNED_NORMALIZED 0x8C17
#define GL_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING
+#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6
#define GL_RENDERBUFFER_BINDING 0x8CA7
#define GL_READ_FRAMEBUFFER 0x8CA8
#define GL_DRAW_FRAMEBUFFER 0x8CA9
@@ -1629,74 +1060,21 @@ extern "C" {
#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
#define GL_MAX_SAMPLES 0x8D57
-#endif
-
-#ifndef GL_ARB_framebuffer_object_DEPRECATED
#define GL_INDEX 0x8222
#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14
#define GL_TEXTURE_INTENSITY_TYPE 0x8C15
-#endif
-
-#ifndef GL_ARB_framebuffer_sRGB
#define GL_FRAMEBUFFER_SRGB 0x8DB9
-#endif
-
-#ifndef GL_ARB_geometry_shader4
-#define GL_LINES_ADJACENCY_ARB 0x000A
-#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B
-#define GL_TRIANGLES_ADJACENCY_ARB 0x000C
-#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D
-#define GL_PROGRAM_POINT_SIZE_ARB 0x8642
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9
-#define GL_GEOMETRY_SHADER_ARB 0x8DD9
-#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA
-#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB
-#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC
-#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD
-#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1
-/* reuse GL_MAX_VARYING_COMPONENTS */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
-#endif
-
-#ifndef GL_ARB_half_float_vertex
#define GL_HALF_FLOAT 0x140B
-#endif
-
-#ifndef GL_ARB_instanced_arrays
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE
-#endif
-
-#ifndef GL_ARB_map_buffer_range
#define GL_MAP_READ_BIT 0x0001
#define GL_MAP_WRITE_BIT 0x0002
#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
-#endif
-
-#ifndef GL_ARB_texture_buffer_object
-#define GL_TEXTURE_BUFFER_ARB 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D
-#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E
-#endif
-
-#ifndef GL_ARB_texture_compression_rgtc
#define GL_COMPRESSED_RED_RGTC1 0x8DBB
#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
#define GL_COMPRESSED_RG_RGTC2 0x8DBD
#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
-#endif
-
-#ifndef GL_ARB_texture_rg
#define GL_RG 0x8227
#define GL_RG_INTEGER 0x8228
#define GL_R8 0x8229
@@ -1719,25 +1097,222 @@ extern "C" {
#define GL_RG16UI 0x823A
#define GL_RG32I 0x823B
#define GL_RG32UI 0x823C
-#endif
-
-#ifndef GL_ARB_vertex_array_object
#define GL_VERTEX_ARRAY_BINDING 0x85B5
+#define GL_CLAMP_VERTEX_COLOR 0x891A
+#define GL_CLAMP_FRAGMENT_COLOR 0x891B
+#define GL_ALPHA_INTEGER 0x8D97
+typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);
+typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index);
+typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode);
+typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void);
+typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp);
+typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode);
+typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value);
+typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value);
+typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value);
+typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
+typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
+typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
+typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
+typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void *(APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
+typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);
+typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
+typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
+typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data);
+GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data);
+GLAPI void APIENTRY glEnablei (GLenum target, GLuint index);
+GLAPI void APIENTRY glDisablei (GLenum target, GLuint index);
+GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index);
+GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode);
+GLAPI void APIENTRY glEndTransformFeedback (void);
+GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer);
+GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
+GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp);
+GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode);
+GLAPI void APIENTRY glEndConditionalRender (void);
+GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
+GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x);
+GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y);
+GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x);
+GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y);
+GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z);
+GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params);
+GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name);
+GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0);
+GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value);
+GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value);
+GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value);
+GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+GLAPI const GLubyte *APIENTRY glGetStringi (GLenum name, GLuint index);
+GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer);
+GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
+GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
+GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer);
+GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
+GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
+GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
+GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target);
+GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGenerateMipmap (GLenum target);
+GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GLAPI void *APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length);
+GLAPI void APIENTRY glBindVertexArray (GLuint array);
+GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
+GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
+GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array);
#endif
+#endif /* GL_VERSION_3_0 */
-#ifndef GL_ARB_uniform_buffer_object
+#ifndef GL_VERSION_3_1
+#define GL_VERSION_3_1 1
+#define GL_SAMPLER_2D_RECT 0x8B63
+#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
+#define GL_SAMPLER_BUFFER 0x8DC2
+#define GL_INT_SAMPLER_2D_RECT 0x8DCD
+#define GL_INT_SAMPLER_BUFFER 0x8DD0
+#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5
+#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
+#define GL_TEXTURE_BUFFER 0x8C2A
+#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B
+#define GL_TEXTURE_BINDING_BUFFER 0x8C2C
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D
+#define GL_TEXTURE_RECTANGLE 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
+#define GL_R8_SNORM 0x8F94
+#define GL_RG8_SNORM 0x8F95
+#define GL_RGB8_SNORM 0x8F96
+#define GL_RGBA8_SNORM 0x8F97
+#define GL_R16_SNORM 0x8F98
+#define GL_RG16_SNORM 0x8F99
+#define GL_RGB16_SNORM 0x8F9A
+#define GL_RGBA16_SNORM 0x8F9B
+#define GL_SIGNED_NORMALIZED 0x8F9C
+#define GL_PRIMITIVE_RESTART 0x8F9D
+#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
+#define GL_COPY_READ_BUFFER 0x8F36
+#define GL_COPY_WRITE_BUFFER 0x8F37
#define GL_UNIFORM_BUFFER 0x8A11
#define GL_UNIFORM_BUFFER_BINDING 0x8A28
#define GL_UNIFORM_BUFFER_START 0x8A29
#define GL_UNIFORM_BUFFER_SIZE 0x8A2A
#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
-#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
-#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
@@ -1756,45 +1331,106 @@ extern "C" {
#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
#define GL_INVALID_INDEX 0xFFFFFFFFu
+typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
+typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
+typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
+GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
+GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer);
+GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index);
+GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
+GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
+GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName);
+GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
#endif
+#endif /* GL_VERSION_3_1 */
-#ifndef GL_ARB_compatibility
-/* ARB_compatibility just defines tokens from core 3.0 */
-#endif
-
-#ifndef GL_ARB_copy_buffer
-#define GL_COPY_READ_BUFFER 0x8F36
-#define GL_COPY_WRITE_BUFFER 0x8F37
+#ifndef GL_VERSION_3_2
+#define GL_VERSION_3_2 1
+typedef struct __GLsync *GLsync;
+#ifndef GLEXT_64_TYPES_DEFINED
+/* This code block is duplicated in glxext.h, so must be protected */
+#define GLEXT_64_TYPES_DEFINED
+/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
+/* (as used in the GL_EXT_timer_query extension). */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#include <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
+/* Fallback if nothing above works */
+#include <inttypes.h>
#endif
-
-#ifndef GL_ARB_shader_texture_lod
#endif
-
-#ifndef GL_ARB_depth_clamp
+typedef uint64_t GLuint64;
+typedef int64_t GLint64;
+#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
+#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
+#define GL_LINES_ADJACENCY 0x000A
+#define GL_LINE_STRIP_ADJACENCY 0x000B
+#define GL_TRIANGLES_ADJACENCY 0x000C
+#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D
+#define GL_PROGRAM_POINT_SIZE 0x8642
+#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8
+#define GL_GEOMETRY_SHADER 0x8DD9
+#define GL_GEOMETRY_VERTICES_OUT 0x8916
+#define GL_GEOMETRY_INPUT_TYPE 0x8917
+#define GL_GEOMETRY_OUTPUT_TYPE 0x8918
+#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF
+#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0
+#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1
+#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
+#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123
+#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124
+#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
+#define GL_CONTEXT_PROFILE_MASK 0x9126
#define GL_DEPTH_CLAMP 0x864F
-#endif
-
-#ifndef GL_ARB_draw_elements_base_vertex
-#endif
-
-#ifndef GL_ARB_fragment_coord_conventions
-#endif
-
-#ifndef GL_ARB_provoking_vertex
#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C
#define GL_FIRST_VERTEX_CONVENTION 0x8E4D
#define GL_LAST_VERTEX_CONVENTION 0x8E4E
#define GL_PROVOKING_VERTEX 0x8E4F
-#endif
-
-#ifndef GL_ARB_seamless_cube_map
#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
-#endif
-
-#ifndef GL_ARB_sync
#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
#define GL_OBJECT_TYPE 0x9112
#define GL_SYNC_CONDITION 0x9113
@@ -1808,11 +1444,8 @@ extern "C" {
#define GL_TIMEOUT_EXPIRED 0x911B
#define GL_CONDITION_SATISFIED 0x911C
#define GL_WAIT_FAILED 0x911D
-#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull
-#endif
-
-#ifndef GL_ARB_texture_multisample
+#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
#define GL_SAMPLE_POSITION 0x8E50
#define GL_SAMPLE_MASK 0x8E51
#define GL_SAMPLE_MASK_VALUE 0x8E52
@@ -1834,111 +1467,207 @@ extern "C" {
#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E
#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F
#define GL_MAX_INTEGER_SAMPLES 0x9110
+typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex);
+typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode);
+typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
+typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync);
+typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync);
+typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
+typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
+typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data);
+typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val);
+typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint maskNumber, GLbitfield mask);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
+GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex);
+GLAPI void APIENTRY glProvokingVertex (GLenum mode);
+GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags);
+GLAPI GLboolean APIENTRY glIsSync (GLsync sync);
+GLAPI void APIENTRY glDeleteSync (GLsync sync);
+GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *data);
+GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
+GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
+GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level);
+GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val);
+GLAPI void APIENTRY glSampleMaski (GLuint maskNumber, GLbitfield mask);
#endif
+#endif /* GL_VERSION_3_2 */
-#ifndef GL_ARB_vertex_array_bgra
-/* reuse GL_BGRA */
-#endif
-
-#ifndef GL_ARB_draw_buffers_blend
-#endif
-
-#ifndef GL_ARB_sample_shading
-#define GL_SAMPLE_SHADING_ARB 0x8C36
-#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37
-#endif
-
-#ifndef GL_ARB_texture_cube_map_array
-#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B
-#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C
-#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D
-#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F
-#endif
-
-#ifndef GL_ARB_texture_gather
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F
-#endif
-
-#ifndef GL_ARB_texture_query_lod
-#endif
-
-#ifndef GL_ARB_shading_language_include
-#define GL_SHADER_INCLUDE_ARB 0x8DAE
-#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9
-#define GL_NAMED_STRING_TYPE_ARB 0x8DEA
-#endif
-
-#ifndef GL_ARB_texture_compression_bptc
-#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C
-#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D
-#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E
-#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F
-#endif
-
-#ifndef GL_ARB_blend_func_extended
+#ifndef GL_VERSION_3_3
+#define GL_VERSION_3_3 1
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
#define GL_SRC1_COLOR 0x88F9
-/* reuse GL_SRC1_ALPHA */
#define GL_ONE_MINUS_SRC1_COLOR 0x88FA
#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB
#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC
-#endif
-
-#ifndef GL_ARB_explicit_attrib_location
-#endif
-
-#ifndef GL_ARB_occlusion_query2
#define GL_ANY_SAMPLES_PASSED 0x8C2F
-#endif
-
-#ifndef GL_ARB_sampler_objects
#define GL_SAMPLER_BINDING 0x8919
-#endif
-
-#ifndef GL_ARB_shader_bit_encoding
-#endif
-
-#ifndef GL_ARB_texture_rgb10_a2ui
#define GL_RGB10_A2UI 0x906F
-#endif
-
-#ifndef GL_ARB_texture_swizzle
#define GL_TEXTURE_SWIZZLE_R 0x8E42
#define GL_TEXTURE_SWIZZLE_G 0x8E43
#define GL_TEXTURE_SWIZZLE_B 0x8E44
#define GL_TEXTURE_SWIZZLE_A 0x8E45
#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
-#endif
-
-#ifndef GL_ARB_timer_query
#define GL_TIME_ELAPSED 0x88BF
#define GL_TIMESTAMP 0x8E28
-#endif
-
-#ifndef GL_ARB_vertex_type_2_10_10_10_rev
-/* reuse GL_UNSIGNED_INT_2_10_10_10_REV */
#define GL_INT_2_10_10_10_REV 0x8D9F
+typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
+typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);
+typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler);
+typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param);
+typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value);
+typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color);
+typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color);
+typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color);
+typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
+GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
+GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers);
+GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler);
+GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler);
+GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param);
+GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param);
+GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param);
+GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param);
+GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param);
+GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target);
+GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params);
+GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params);
+GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor);
+GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value);
+GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value);
+GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value);
+GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value);
+GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value);
+GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value);
+GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords);
+GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords);
+GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords);
+GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords);
+GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color);
+GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color);
+GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color);
+GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color);
+GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color);
+GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color);
#endif
+#endif /* GL_VERSION_3_3 */
-#ifndef GL_ARB_draw_indirect
+#ifndef GL_VERSION_4_0
+#define GL_VERSION_4_0 1
+#define GL_SAMPLE_SHADING 0x8C36
+#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37
+#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E
+#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F
+#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B
+#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C
+#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D
+#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E
+#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F
#define GL_DRAW_INDIRECT_BUFFER 0x8F3F
#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43
-#endif
-
-#ifndef GL_ARB_gpu_shader5
#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F
#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A
#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B
#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C
#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D
-/* reuse GL_MAX_VERTEX_STREAMS */
-#endif
-
-#ifndef GL_ARB_gpu_shader_fp64
-/* reuse GL_DOUBLE */
+#define GL_MAX_VERTEX_STREAMS 0x8E71
#define GL_DOUBLE_VEC2 0x8FFC
#define GL_DOUBLE_VEC3 0x8FFD
#define GL_DOUBLE_VEC4 0x8FFE
@@ -1951,9 +1680,6 @@ extern "C" {
#define GL_DOUBLE_MAT3x4 0x8F4C
#define GL_DOUBLE_MAT4x2 0x8F4D
#define GL_DOUBLE_MAT4x3 0x8F4E
-#endif
-
-#ifndef GL_ARB_shader_subroutine
#define GL_ACTIVE_SUBROUTINES 0x8DE5
#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6
#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47
@@ -1963,11 +1689,6 @@ extern "C" {
#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8
#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A
#define GL_COMPATIBLE_SUBROUTINES 0x8E4B
-/* reuse GL_UNIFORM_SIZE */
-/* reuse GL_UNIFORM_NAME_LENGTH */
-#endif
-
-#ifndef GL_ARB_tessellation_shader
#define GL_PATCHES 0x000E
#define GL_PATCH_VERTICES 0x8E72
#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73
@@ -1977,14 +1698,9 @@ extern "C" {
#define GL_TESS_GEN_SPACING 0x8E77
#define GL_TESS_GEN_VERTEX_ORDER 0x8E78
#define GL_TESS_GEN_POINT_MODE 0x8E79
-/* reuse GL_TRIANGLES */
-/* reuse GL_QUADS */
#define GL_ISOLINES 0x8E7A
-/* reuse GL_EQUAL */
#define GL_FRACTIONAL_ODD 0x8E7B
#define GL_FRACTIONAL_EVEN 0x8E7C
-/* reuse GL_CCW */
-/* reuse GL_CW */
#define GL_MAX_PATCH_VERTICES 0x8E7D
#define GL_MAX_TESS_GEN_LEVEL 0x8E7E
#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F
@@ -2005,27 +1721,109 @@ extern "C" {
#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1
#define GL_TESS_EVALUATION_SHADER 0x8E87
#define GL_TESS_CONTROL_SHADER 0x8E88
-#endif
-
-#ifndef GL_ARB_texture_buffer_object_rgb32
-/* reuse GL_RGB32F */
-/* reuse GL_RGB32UI */
-/* reuse GL_RGB32I */
-#endif
-
-#ifndef GL_ARB_transform_feedback2
#define GL_TRANSFORM_FEEDBACK 0x8E22
#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23
#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24
#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25
-#endif
-
-#ifndef GL_ARB_transform_feedback3
#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70
-#define GL_MAX_VERTEX_STREAMS 0x8E71
+typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLfloat value);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst);
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect);
+typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x);
+typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params);
+typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name);
+typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
+typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
+typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices);
+typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
+typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value);
+typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values);
+typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids);
+typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void);
+typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void);
+typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id);
+typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream);
+typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMinSampleShading (GLfloat value);
+GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode);
+GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst);
+GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const void *indirect);
+GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect);
+GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x);
+GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params);
+GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name);
+GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name);
+GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
+GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
+GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
+GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices);
+GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params);
+GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
+GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value);
+GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values);
+GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id);
+GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids);
+GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids);
+GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id);
+GLAPI void APIENTRY glPauseTransformFeedback (void);
+GLAPI void APIENTRY glResumeTransformFeedback (void);
+GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id);
+GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream);
+GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id);
+GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index);
+GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params);
#endif
+#endif /* GL_VERSION_4_0 */
-#ifndef GL_ARB_ES2_compatibility
+#ifndef GL_VERSION_4_1
+#define GL_VERSION_4_1 1
#define GL_FIXED 0x140C
#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
@@ -2036,20 +1834,16 @@ extern "C" {
#define GL_MEDIUM_INT 0x8DF4
#define GL_HIGH_INT 0x8DF5
#define GL_SHADER_COMPILER 0x8DFA
+#define GL_SHADER_BINARY_FORMATS 0x8DF8
#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
#define GL_MAX_VARYING_VECTORS 0x8DFC
#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
-#endif
-
-#ifndef GL_ARB_get_program_binary
+#define GL_RGB565 0x8D62
#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
#define GL_PROGRAM_BINARY_LENGTH 0x8741
#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
#define GL_PROGRAM_BINARY_FORMATS 0x87FF
-#endif
-
-#ifndef GL_ARB_separate_shader_objects
#define GL_VERTEX_SHADER_BIT 0x00000001
#define GL_FRAGMENT_SHADER_BIT 0x00000002
#define GL_GEOMETRY_SHADER_BIT 0x00000004
@@ -2059,49 +1853,863 @@ extern "C" {
#define GL_PROGRAM_SEPARABLE 0x8258
#define GL_ACTIVE_PROGRAM 0x8259
#define GL_PROGRAM_PIPELINE_BINDING 0x825A
-#endif
-
-#ifndef GL_ARB_shader_precision
-#endif
-
-#ifndef GL_ARB_vertex_attrib_64bit
-/* reuse GL_RGB32I */
-/* reuse GL_DOUBLE_VEC2 */
-/* reuse GL_DOUBLE_VEC3 */
-/* reuse GL_DOUBLE_VEC4 */
-/* reuse GL_DOUBLE_MAT2 */
-/* reuse GL_DOUBLE_MAT3 */
-/* reuse GL_DOUBLE_MAT4 */
-/* reuse GL_DOUBLE_MAT2x3 */
-/* reuse GL_DOUBLE_MAT2x4 */
-/* reuse GL_DOUBLE_MAT3x2 */
-/* reuse GL_DOUBLE_MAT3x4 */
-/* reuse GL_DOUBLE_MAT4x2 */
-/* reuse GL_DOUBLE_MAT4x3 */
-#endif
-
-#ifndef GL_ARB_viewport_array
-/* reuse GL_SCISSOR_BOX */
-/* reuse GL_VIEWPORT */
-/* reuse GL_DEPTH_RANGE */
-/* reuse GL_SCISSOR_TEST */
#define GL_MAX_VIEWPORTS 0x825B
#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C
#define GL_VIEWPORT_BOUNDS_RANGE 0x825D
#define GL_LAYER_PROVOKING_VERTEX 0x825E
#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F
#define GL_UNDEFINED_VERTEX 0x8260
-/* reuse GL_FIRST_VERTEX_CONVENTION */
-/* reuse GL_LAST_VERTEX_CONVENTION */
-/* reuse GL_PROVOKING_VERTEX */
+typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
+typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
+typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f);
+typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d);
+typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
+typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
+typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar *const*strings);
+typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines);
+typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline);
+typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline);
+typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
+typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v);
+typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLdouble n, GLdouble f);
+typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReleaseShaderCompiler (void);
+GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
+GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+GLAPI void APIENTRY glDepthRangef (GLfloat n, GLfloat f);
+GLAPI void APIENTRY glClearDepthf (GLfloat d);
+GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
+GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value);
+GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program);
+GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program);
+GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar *const*strings);
+GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline);
+GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines);
+GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines);
+GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline);
+GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params);
+GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0);
+GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0);
+GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0);
+GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0);
+GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1);
+GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);
+GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
+GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline);
+GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
+GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
+GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v);
+GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLdouble n, GLdouble f);
+GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data);
+GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data);
#endif
+#endif /* GL_VERSION_4_1 */
+
+#ifndef GL_VERSION_4_2
+#define GL_VERSION_4_2 1
+#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127
+#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128
+#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129
+#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A
+#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B
+#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C
+#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D
+#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E
+#define GL_NUM_SAMPLE_COUNTS 0x9380
+#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC
+#define GL_ATOMIC_COUNTER_BUFFER 0x92C0
+#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1
+#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2
+#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3
+#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4
+#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5
+#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB
+#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC
+#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD
+#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE
+#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF
+#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0
+#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1
+#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2
+#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3
+#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4
+#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5
+#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6
+#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7
+#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8
+#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC
+#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9
+#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA
+#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB
+#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001
+#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002
+#define GL_UNIFORM_BARRIER_BIT 0x00000004
+#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008
+#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020
+#define GL_COMMAND_BARRIER_BIT 0x00000040
+#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080
+#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100
+#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200
+#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400
+#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800
+#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000
+#define GL_ALL_BARRIER_BITS 0xFFFFFFFF
+#define GL_MAX_IMAGE_UNITS 0x8F38
+#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39
+#define GL_IMAGE_BINDING_NAME 0x8F3A
+#define GL_IMAGE_BINDING_LEVEL 0x8F3B
+#define GL_IMAGE_BINDING_LAYERED 0x8F3C
+#define GL_IMAGE_BINDING_LAYER 0x8F3D
+#define GL_IMAGE_BINDING_ACCESS 0x8F3E
+#define GL_IMAGE_1D 0x904C
+#define GL_IMAGE_2D 0x904D
+#define GL_IMAGE_3D 0x904E
+#define GL_IMAGE_2D_RECT 0x904F
+#define GL_IMAGE_CUBE 0x9050
+#define GL_IMAGE_BUFFER 0x9051
+#define GL_IMAGE_1D_ARRAY 0x9052
+#define GL_IMAGE_2D_ARRAY 0x9053
+#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054
+#define GL_IMAGE_2D_MULTISAMPLE 0x9055
+#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056
+#define GL_INT_IMAGE_1D 0x9057
+#define GL_INT_IMAGE_2D 0x9058
+#define GL_INT_IMAGE_3D 0x9059
+#define GL_INT_IMAGE_2D_RECT 0x905A
+#define GL_INT_IMAGE_CUBE 0x905B
+#define GL_INT_IMAGE_BUFFER 0x905C
+#define GL_INT_IMAGE_1D_ARRAY 0x905D
+#define GL_INT_IMAGE_2D_ARRAY 0x905E
+#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F
+#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060
+#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061
+#define GL_UNSIGNED_INT_IMAGE_1D 0x9062
+#define GL_UNSIGNED_INT_IMAGE_2D 0x9063
+#define GL_UNSIGNED_INT_IMAGE_3D 0x9064
+#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065
+#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
+#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067
+#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068
+#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
+#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A
+#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B
+#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C
+#define GL_MAX_IMAGE_SAMPLES 0x906D
+#define GL_IMAGE_BINDING_FORMAT 0x906E
+#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7
+#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8
+#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9
+#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA
+#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB
+#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC
+#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD
+#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE
+#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF
+#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C
+#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D
+#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E
+#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F
+#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F
+typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
+typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);
+typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei instancecount);
+typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
+GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
+GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
+GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);
+GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers);
+GLAPI void APIENTRY glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GLAPI void APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei instancecount);
+GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount);
+#endif
+#endif /* GL_VERSION_4_2 */
+
+#ifndef GL_VERSION_4_3
+#define GL_VERSION_4_3 1
+typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
+#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9
+#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E
+#define GL_COMPRESSED_RGB8_ETC2 0x9274
+#define GL_COMPRESSED_SRGB8_ETC2 0x9275
+#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
+#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
+#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
+#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
+#define GL_COMPRESSED_R11_EAC 0x9270
+#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271
+#define GL_COMPRESSED_RG11_EAC 0x9272
+#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273
+#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69
+#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A
+#define GL_MAX_ELEMENT_INDEX 0x8D6B
+#define GL_COMPUTE_SHADER 0x91B9
+#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB
+#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC
+#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD
+#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262
+#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263
+#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264
+#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265
+#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266
+#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB
+#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE
+#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF
+#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED
+#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE
+#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF
+#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242
+#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243
+#define GL_DEBUG_CALLBACK_FUNCTION 0x8244
+#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245
+#define GL_DEBUG_SOURCE_API 0x8246
+#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247
+#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248
+#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249
+#define GL_DEBUG_SOURCE_APPLICATION 0x824A
+#define GL_DEBUG_SOURCE_OTHER 0x824B
+#define GL_DEBUG_TYPE_ERROR 0x824C
+#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D
+#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E
+#define GL_DEBUG_TYPE_PORTABILITY 0x824F
+#define GL_DEBUG_TYPE_PERFORMANCE 0x8250
+#define GL_DEBUG_TYPE_OTHER 0x8251
+#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143
+#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144
+#define GL_DEBUG_LOGGED_MESSAGES 0x9145
+#define GL_DEBUG_SEVERITY_HIGH 0x9146
+#define GL_DEBUG_SEVERITY_MEDIUM 0x9147
+#define GL_DEBUG_SEVERITY_LOW 0x9148
+#define GL_DEBUG_TYPE_MARKER 0x8268
+#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269
+#define GL_DEBUG_TYPE_POP_GROUP 0x826A
+#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B
+#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C
+#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D
+#define GL_BUFFER 0x82E0
+#define GL_SHADER 0x82E1
+#define GL_PROGRAM 0x82E2
+#define GL_QUERY 0x82E3
+#define GL_PROGRAM_PIPELINE 0x82E4
+#define GL_SAMPLER 0x82E6
+#define GL_MAX_LABEL_LENGTH 0x82E8
+#define GL_DEBUG_OUTPUT 0x92E0
+#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
+#define GL_MAX_UNIFORM_LOCATIONS 0x826E
+#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310
+#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311
+#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312
+#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313
+#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314
+#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315
+#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316
+#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317
+#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318
+#define GL_INTERNALFORMAT_SUPPORTED 0x826F
+#define GL_INTERNALFORMAT_PREFERRED 0x8270
+#define GL_INTERNALFORMAT_RED_SIZE 0x8271
+#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272
+#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273
+#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274
+#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275
+#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276
+#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277
+#define GL_INTERNALFORMAT_RED_TYPE 0x8278
+#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279
+#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A
+#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B
+#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C
+#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D
+#define GL_MAX_WIDTH 0x827E
+#define GL_MAX_HEIGHT 0x827F
+#define GL_MAX_DEPTH 0x8280
+#define GL_MAX_LAYERS 0x8281
+#define GL_MAX_COMBINED_DIMENSIONS 0x8282
+#define GL_COLOR_COMPONENTS 0x8283
+#define GL_DEPTH_COMPONENTS 0x8284
+#define GL_STENCIL_COMPONENTS 0x8285
+#define GL_COLOR_RENDERABLE 0x8286
+#define GL_DEPTH_RENDERABLE 0x8287
+#define GL_STENCIL_RENDERABLE 0x8288
+#define GL_FRAMEBUFFER_RENDERABLE 0x8289
+#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A
+#define GL_FRAMEBUFFER_BLEND 0x828B
+#define GL_READ_PIXELS 0x828C
+#define GL_READ_PIXELS_FORMAT 0x828D
+#define GL_READ_PIXELS_TYPE 0x828E
+#define GL_TEXTURE_IMAGE_FORMAT 0x828F
+#define GL_TEXTURE_IMAGE_TYPE 0x8290
+#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291
+#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292
+#define GL_MIPMAP 0x8293
+#define GL_MANUAL_GENERATE_MIPMAP 0x8294
+#define GL_AUTO_GENERATE_MIPMAP 0x8295
+#define GL_COLOR_ENCODING 0x8296
+#define GL_SRGB_READ 0x8297
+#define GL_SRGB_WRITE 0x8298
+#define GL_FILTER 0x829A
+#define GL_VERTEX_TEXTURE 0x829B
+#define GL_TESS_CONTROL_TEXTURE 0x829C
+#define GL_TESS_EVALUATION_TEXTURE 0x829D
+#define GL_GEOMETRY_TEXTURE 0x829E
+#define GL_FRAGMENT_TEXTURE 0x829F
+#define GL_COMPUTE_TEXTURE 0x82A0
+#define GL_TEXTURE_SHADOW 0x82A1
+#define GL_TEXTURE_GATHER 0x82A2
+#define GL_TEXTURE_GATHER_SHADOW 0x82A3
+#define GL_SHADER_IMAGE_LOAD 0x82A4
+#define GL_SHADER_IMAGE_STORE 0x82A5
+#define GL_SHADER_IMAGE_ATOMIC 0x82A6
+#define GL_IMAGE_TEXEL_SIZE 0x82A7
+#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8
+#define GL_IMAGE_PIXEL_FORMAT 0x82A9
+#define GL_IMAGE_PIXEL_TYPE 0x82AA
+#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC
+#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD
+#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE
+#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF
+#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1
+#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2
+#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3
+#define GL_CLEAR_BUFFER 0x82B4
+#define GL_TEXTURE_VIEW 0x82B5
+#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6
+#define GL_FULL_SUPPORT 0x82B7
+#define GL_CAVEAT_SUPPORT 0x82B8
+#define GL_IMAGE_CLASS_4_X_32 0x82B9
+#define GL_IMAGE_CLASS_2_X_32 0x82BA
+#define GL_IMAGE_CLASS_1_X_32 0x82BB
+#define GL_IMAGE_CLASS_4_X_16 0x82BC
+#define GL_IMAGE_CLASS_2_X_16 0x82BD
+#define GL_IMAGE_CLASS_1_X_16 0x82BE
+#define GL_IMAGE_CLASS_4_X_8 0x82BF
+#define GL_IMAGE_CLASS_2_X_8 0x82C0
+#define GL_IMAGE_CLASS_1_X_8 0x82C1
+#define GL_IMAGE_CLASS_11_11_10 0x82C2
+#define GL_IMAGE_CLASS_10_10_10_2 0x82C3
+#define GL_VIEW_CLASS_128_BITS 0x82C4
+#define GL_VIEW_CLASS_96_BITS 0x82C5
+#define GL_VIEW_CLASS_64_BITS 0x82C6
+#define GL_VIEW_CLASS_48_BITS 0x82C7
+#define GL_VIEW_CLASS_32_BITS 0x82C8
+#define GL_VIEW_CLASS_24_BITS 0x82C9
+#define GL_VIEW_CLASS_16_BITS 0x82CA
+#define GL_VIEW_CLASS_8_BITS 0x82CB
+#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC
+#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD
+#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE
+#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF
+#define GL_VIEW_CLASS_RGTC1_RED 0x82D0
+#define GL_VIEW_CLASS_RGTC2_RG 0x82D1
+#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2
+#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3
+#define GL_UNIFORM 0x92E1
+#define GL_UNIFORM_BLOCK 0x92E2
+#define GL_PROGRAM_INPUT 0x92E3
+#define GL_PROGRAM_OUTPUT 0x92E4
+#define GL_BUFFER_VARIABLE 0x92E5
+#define GL_SHADER_STORAGE_BLOCK 0x92E6
+#define GL_VERTEX_SUBROUTINE 0x92E8
+#define GL_TESS_CONTROL_SUBROUTINE 0x92E9
+#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA
+#define GL_GEOMETRY_SUBROUTINE 0x92EB
+#define GL_FRAGMENT_SUBROUTINE 0x92EC
+#define GL_COMPUTE_SUBROUTINE 0x92ED
+#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE
+#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF
+#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0
+#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1
+#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2
+#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3
+#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4
+#define GL_ACTIVE_RESOURCES 0x92F5
+#define GL_MAX_NAME_LENGTH 0x92F6
+#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7
+#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8
+#define GL_NAME_LENGTH 0x92F9
+#define GL_TYPE 0x92FA
+#define GL_ARRAY_SIZE 0x92FB
+#define GL_OFFSET 0x92FC
+#define GL_BLOCK_INDEX 0x92FD
+#define GL_ARRAY_STRIDE 0x92FE
+#define GL_MATRIX_STRIDE 0x92FF
+#define GL_IS_ROW_MAJOR 0x9300
+#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301
+#define GL_BUFFER_BINDING 0x9302
+#define GL_BUFFER_DATA_SIZE 0x9303
+#define GL_NUM_ACTIVE_VARIABLES 0x9304
+#define GL_ACTIVE_VARIABLES 0x9305
+#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306
+#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307
+#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308
+#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309
+#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A
+#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B
+#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C
+#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D
+#define GL_LOCATION 0x930E
+#define GL_LOCATION_INDEX 0x930F
+#define GL_IS_PER_PATCH 0x92E7
+#define GL_SHADER_STORAGE_BUFFER 0x90D2
+#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3
+#define GL_SHADER_STORAGE_BUFFER_START 0x90D4
+#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5
+#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6
+#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7
+#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8
+#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9
+#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA
+#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB
+#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC
+#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD
+#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE
+#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF
+#define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000
+#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39
+#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA
+#define GL_TEXTURE_BUFFER_OFFSET 0x919D
+#define GL_TEXTURE_BUFFER_SIZE 0x919E
+#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F
+#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB
+#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC
+#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD
+#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE
+#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF
+#define GL_VERTEX_ATTRIB_BINDING 0x82D4
+#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5
+#define GL_VERTEX_BINDING_DIVISOR 0x82D6
+#define GL_VERTEX_BINDING_OFFSET 0x82D7
+#define GL_VERTEX_BINDING_STRIDE 0x82D8
+#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9
+#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA
+#define GL_VERTEX_BINDING_BUFFER 0x8F4F
+#define GL_DISPLAY_LIST 0x82E7
+typedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data);
+typedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
+typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect);
+typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);
+typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);
+typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
+typedef void (APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+typedef void (APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride);
+typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
+typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
+typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);
+typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);
+typedef void (APIENTRYP PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+typedef void (APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+typedef void (APIENTRYP PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
+typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex);
+typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam);
+typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message);
+typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void);
+typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
+typedef void (APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
+typedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label);
+typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glClearBufferData (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data);
+GLAPI void APIENTRY glClearBufferSubData (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
+GLAPI void APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect);
+GLAPI void APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
+GLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);
+GLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);
+GLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level);
+GLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length);
+GLAPI void APIENTRY glInvalidateBufferData (GLuint buffer);
+GLAPI void APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+GLAPI void APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glMultiDrawArraysIndirect (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride);
+GLAPI void APIENTRY glMultiDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride);
+GLAPI void APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
+GLAPI GLuint APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name);
+GLAPI void APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
+GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
+GLAPI GLint APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name);
+GLAPI GLint APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name);
+GLAPI void APIENTRY glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);
+GLAPI void APIENTRY glTexBufferRange (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+GLAPI void APIENTRY glTexStorage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+GLAPI void APIENTRY glTextureView (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
+GLAPI void APIENTRY glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+GLAPI void APIENTRY glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+GLAPI void APIENTRY glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+GLAPI void APIENTRY glVertexAttribLFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+GLAPI void APIENTRY glVertexAttribBinding (GLuint attribindex, GLuint bindingindex);
+GLAPI void APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor);
+GLAPI void APIENTRY glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+GLAPI void APIENTRY glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+GLAPI void APIENTRY glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam);
+GLAPI GLuint APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+GLAPI void APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message);
+GLAPI void APIENTRY glPopDebugGroup (void);
+GLAPI void APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
+GLAPI void APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
+GLAPI void APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label);
+GLAPI void APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
+#endif
+#endif /* GL_VERSION_4_3 */
+
+#ifndef GL_VERSION_4_4
+#define GL_VERSION_4_4 1
+#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5
+#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221
+#define GL_TEXTURE_BUFFER_BINDING 0x8C2A
+#define GL_MAP_PERSISTENT_BIT 0x0040
+#define GL_MAP_COHERENT_BIT 0x0080
+#define GL_DYNAMIC_STORAGE_BIT 0x0100
+#define GL_CLIENT_STORAGE_BIT 0x0200
+#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000
+#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F
+#define GL_BUFFER_STORAGE_FLAGS 0x8220
+#define GL_CLEAR_TEXTURE 0x9365
+#define GL_LOCATION_COMPONENT 0x934A
+#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B
+#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C
+#define GL_QUERY_BUFFER 0x9192
+#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000
+#define GL_QUERY_BUFFER_BINDING 0x9193
+#define GL_QUERY_RESULT_NO_WAIT 0x9194
+#define GL_MIRROR_CLAMP_TO_EDGE 0x8743
+typedef void (APIENTRYP PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags);
+typedef void (APIENTRYP PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data);
+typedef void (APIENTRYP PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
+typedef void (APIENTRYP PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes);
+typedef void (APIENTRYP PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures);
+typedef void (APIENTRYP PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint *samplers);
+typedef void (APIENTRYP PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures);
+typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBufferStorage (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags);
+GLAPI void APIENTRY glClearTexImage (GLuint texture, GLint level, GLenum format, GLenum type, const void *data);
+GLAPI void APIENTRY glClearTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
+GLAPI void APIENTRY glBindBuffersBase (GLenum target, GLuint first, GLsizei count, const GLuint *buffers);
+GLAPI void APIENTRY glBindBuffersRange (GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes);
+GLAPI void APIENTRY glBindTextures (GLuint first, GLsizei count, const GLuint *textures);
+GLAPI void APIENTRY glBindSamplers (GLuint first, GLsizei count, const GLuint *samplers);
+GLAPI void APIENTRY glBindImageTextures (GLuint first, GLsizei count, const GLuint *textures);
+GLAPI void APIENTRY glBindVertexBuffers (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides);
+#endif
+#endif /* GL_VERSION_4_4 */
+
+#ifndef GL_ARB_ES2_compatibility
+#define GL_ARB_ES2_compatibility 1
+#endif /* GL_ARB_ES2_compatibility */
+
+#ifndef GL_ARB_ES3_compatibility
+#define GL_ARB_ES3_compatibility 1
+#endif /* GL_ARB_ES3_compatibility */
+
+#ifndef GL_ARB_arrays_of_arrays
+#define GL_ARB_arrays_of_arrays 1
+#endif /* GL_ARB_arrays_of_arrays */
+
+#ifndef GL_ARB_base_instance
+#define GL_ARB_base_instance 1
+#endif /* GL_ARB_base_instance */
+
+#ifndef GL_ARB_bindless_texture
+#define GL_ARB_bindless_texture 1
+typedef uint64_t GLuint64EXT;
+#define GL_UNSIGNED_INT64_ARB 0x140F
+typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture);
+typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler);
+typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle);
+typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle);
+typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
+typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access);
+typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle);
+typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value);
+typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values);
+typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle);
+typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT *v);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint64 APIENTRY glGetTextureHandleARB (GLuint texture);
+GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleARB (GLuint texture, GLuint sampler);
+GLAPI void APIENTRY glMakeTextureHandleResidentARB (GLuint64 handle);
+GLAPI void APIENTRY glMakeTextureHandleNonResidentARB (GLuint64 handle);
+GLAPI GLuint64 APIENTRY glGetImageHandleARB (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
+GLAPI void APIENTRY glMakeImageHandleResidentARB (GLuint64 handle, GLenum access);
+GLAPI void APIENTRY glMakeImageHandleNonResidentARB (GLuint64 handle);
+GLAPI void APIENTRY glUniformHandleui64ARB (GLint location, GLuint64 value);
+GLAPI void APIENTRY glUniformHandleui64vARB (GLint location, GLsizei count, const GLuint64 *value);
+GLAPI void APIENTRY glProgramUniformHandleui64ARB (GLuint program, GLint location, GLuint64 value);
+GLAPI void APIENTRY glProgramUniformHandleui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *values);
+GLAPI GLboolean APIENTRY glIsTextureHandleResidentARB (GLuint64 handle);
+GLAPI GLboolean APIENTRY glIsImageHandleResidentARB (GLuint64 handle);
+GLAPI void APIENTRY glVertexAttribL1ui64ARB (GLuint index, GLuint64EXT x);
+GLAPI void APIENTRY glVertexAttribL1ui64vARB (GLuint index, const GLuint64EXT *v);
+GLAPI void APIENTRY glGetVertexAttribLui64vARB (GLuint index, GLenum pname, GLuint64EXT *params);
+#endif
+#endif /* GL_ARB_bindless_texture */
+
+#ifndef GL_ARB_blend_func_extended
+#define GL_ARB_blend_func_extended 1
+#endif /* GL_ARB_blend_func_extended */
+
+#ifndef GL_ARB_buffer_storage
+#define GL_ARB_buffer_storage 1
+#endif /* GL_ARB_buffer_storage */
#ifndef GL_ARB_cl_event
+#define GL_ARB_cl_event 1
+struct _cl_context;
+struct _cl_event;
#define GL_SYNC_CL_EVENT_ARB 0x8240
#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241
+typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context *context, struct _cl_event *event, GLbitfield flags);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context *context, struct _cl_event *event, GLbitfield flags);
+#endif
+#endif /* GL_ARB_cl_event */
+
+#ifndef GL_ARB_clear_buffer_object
+#define GL_ARB_clear_buffer_object 1
+#endif /* GL_ARB_clear_buffer_object */
+
+#ifndef GL_ARB_clear_texture
+#define GL_ARB_clear_texture 1
+#endif /* GL_ARB_clear_texture */
+
+#ifndef GL_ARB_color_buffer_float
+#define GL_ARB_color_buffer_float 1
+#define GL_RGBA_FLOAT_MODE_ARB 0x8820
+#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A
+#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B
+#define GL_CLAMP_READ_COLOR_ARB 0x891C
+#define GL_FIXED_ONLY_ARB 0x891D
+typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp);
+#endif
+#endif /* GL_ARB_color_buffer_float */
+
+#ifndef GL_ARB_compatibility
+#define GL_ARB_compatibility 1
+#endif /* GL_ARB_compatibility */
+
+#ifndef GL_ARB_compressed_texture_pixel_storage
+#define GL_ARB_compressed_texture_pixel_storage 1
+#endif /* GL_ARB_compressed_texture_pixel_storage */
+
+#ifndef GL_ARB_compute_shader
+#define GL_ARB_compute_shader 1
+#define GL_COMPUTE_SHADER_BIT 0x00000020
+#endif /* GL_ARB_compute_shader */
+
+#ifndef GL_ARB_compute_variable_group_size
+#define GL_ARB_compute_variable_group_size 1
+#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344
+#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB
+#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345
+#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF
+typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDispatchComputeGroupSizeARB (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z);
#endif
+#endif /* GL_ARB_compute_variable_group_size */
+
+#ifndef GL_ARB_conservative_depth
+#define GL_ARB_conservative_depth 1
+#endif /* GL_ARB_conservative_depth */
+
+#ifndef GL_ARB_copy_buffer
+#define GL_ARB_copy_buffer 1
+#define GL_COPY_READ_BUFFER_BINDING 0x8F36
+#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37
+#endif /* GL_ARB_copy_buffer */
+
+#ifndef GL_ARB_copy_image
+#define GL_ARB_copy_image 1
+#endif /* GL_ARB_copy_image */
#ifndef GL_ARB_debug_output
+#define GL_ARB_debug_output 1
+typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242
#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243
#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244
@@ -2124,1501 +2732,2627 @@ extern "C" {
#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146
#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147
#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148
+typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam);
+typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const void *userParam);
+GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
#endif
+#endif /* GL_ARB_debug_output */
-#ifndef GL_ARB_robustness
-/* reuse GL_NO_ERROR */
-#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004
-#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
-#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253
-#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254
-#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255
-#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
-#define GL_NO_RESET_NOTIFICATION_ARB 0x8261
-#endif
+#ifndef GL_ARB_depth_buffer_float
+#define GL_ARB_depth_buffer_float 1
+#endif /* GL_ARB_depth_buffer_float */
-#ifndef GL_ARB_shader_stencil_export
-#endif
+#ifndef GL_ARB_depth_clamp
+#define GL_ARB_depth_clamp 1
+#endif /* GL_ARB_depth_clamp */
-#ifndef GL_EXT_abgr
-#define GL_ABGR_EXT 0x8000
-#endif
+#ifndef GL_ARB_depth_texture
+#define GL_ARB_depth_texture 1
+#define GL_DEPTH_COMPONENT16_ARB 0x81A5
+#define GL_DEPTH_COMPONENT24_ARB 0x81A6
+#define GL_DEPTH_COMPONENT32_ARB 0x81A7
+#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A
+#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
+#endif /* GL_ARB_depth_texture */
-#ifndef GL_EXT_blend_color
-#define GL_CONSTANT_COLOR_EXT 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002
-#define GL_CONSTANT_ALPHA_EXT 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004
-#define GL_BLEND_COLOR_EXT 0x8005
+#ifndef GL_ARB_draw_buffers
+#define GL_ARB_draw_buffers 1
+#define GL_MAX_DRAW_BUFFERS_ARB 0x8824
+#define GL_DRAW_BUFFER0_ARB 0x8825
+#define GL_DRAW_BUFFER1_ARB 0x8826
+#define GL_DRAW_BUFFER2_ARB 0x8827
+#define GL_DRAW_BUFFER3_ARB 0x8828
+#define GL_DRAW_BUFFER4_ARB 0x8829
+#define GL_DRAW_BUFFER5_ARB 0x882A
+#define GL_DRAW_BUFFER6_ARB 0x882B
+#define GL_DRAW_BUFFER7_ARB 0x882C
+#define GL_DRAW_BUFFER8_ARB 0x882D
+#define GL_DRAW_BUFFER9_ARB 0x882E
+#define GL_DRAW_BUFFER10_ARB 0x882F
+#define GL_DRAW_BUFFER11_ARB 0x8830
+#define GL_DRAW_BUFFER12_ARB 0x8831
+#define GL_DRAW_BUFFER13_ARB 0x8832
+#define GL_DRAW_BUFFER14_ARB 0x8833
+#define GL_DRAW_BUFFER15_ARB 0x8834
+typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs);
#endif
+#endif /* GL_ARB_draw_buffers */
-#ifndef GL_EXT_polygon_offset
-#define GL_POLYGON_OFFSET_EXT 0x8037
-#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038
-#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039
+#ifndef GL_ARB_draw_buffers_blend
+#define GL_ARB_draw_buffers_blend 1
+typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst);
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode);
+GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst);
+GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
#endif
+#endif /* GL_ARB_draw_buffers_blend */
-#ifndef GL_EXT_texture
-#define GL_ALPHA4_EXT 0x803B
-#define GL_ALPHA8_EXT 0x803C
-#define GL_ALPHA12_EXT 0x803D
-#define GL_ALPHA16_EXT 0x803E
-#define GL_LUMINANCE4_EXT 0x803F
-#define GL_LUMINANCE8_EXT 0x8040
-#define GL_LUMINANCE12_EXT 0x8041
-#define GL_LUMINANCE16_EXT 0x8042
-#define GL_LUMINANCE4_ALPHA4_EXT 0x8043
-#define GL_LUMINANCE6_ALPHA2_EXT 0x8044
-#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
-#define GL_LUMINANCE12_ALPHA4_EXT 0x8046
-#define GL_LUMINANCE12_ALPHA12_EXT 0x8047
-#define GL_LUMINANCE16_ALPHA16_EXT 0x8048
-#define GL_INTENSITY_EXT 0x8049
-#define GL_INTENSITY4_EXT 0x804A
-#define GL_INTENSITY8_EXT 0x804B
-#define GL_INTENSITY12_EXT 0x804C
-#define GL_INTENSITY16_EXT 0x804D
-#define GL_RGB2_EXT 0x804E
-#define GL_RGB4_EXT 0x804F
-#define GL_RGB5_EXT 0x8050
-#define GL_RGB8_EXT 0x8051
-#define GL_RGB10_EXT 0x8052
-#define GL_RGB12_EXT 0x8053
-#define GL_RGB16_EXT 0x8054
-#define GL_RGBA2_EXT 0x8055
-#define GL_RGBA4_EXT 0x8056
-#define GL_RGB5_A1_EXT 0x8057
-#define GL_RGBA8_EXT 0x8058
-#define GL_RGB10_A2_EXT 0x8059
-#define GL_RGBA12_EXT 0x805A
-#define GL_RGBA16_EXT 0x805B
-#define GL_TEXTURE_RED_SIZE_EXT 0x805C
-#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D
-#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E
-#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F
-#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060
-#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061
-#define GL_REPLACE_EXT 0x8062
-#define GL_PROXY_TEXTURE_1D_EXT 0x8063
-#define GL_PROXY_TEXTURE_2D_EXT 0x8064
-#define GL_TEXTURE_TOO_LARGE_EXT 0x8065
-#endif
+#ifndef GL_ARB_draw_elements_base_vertex
+#define GL_ARB_draw_elements_base_vertex 1
+#endif /* GL_ARB_draw_elements_base_vertex */
-#ifndef GL_EXT_texture3D
-#define GL_PACK_SKIP_IMAGES_EXT 0x806B
-#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C
-#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E
-#define GL_TEXTURE_3D_EXT 0x806F
-#define GL_PROXY_TEXTURE_3D_EXT 0x8070
-#define GL_TEXTURE_DEPTH_EXT 0x8071
-#define GL_TEXTURE_WRAP_R_EXT 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073
-#endif
+#ifndef GL_ARB_draw_indirect
+#define GL_ARB_draw_indirect 1
+#endif /* GL_ARB_draw_indirect */
-#ifndef GL_SGIS_texture_filter4
-#define GL_FILTER4_SGIS 0x8146
-#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147
+#ifndef GL_ARB_draw_instanced
+#define GL_ARB_draw_instanced 1
+typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
#endif
+#endif /* GL_ARB_draw_instanced */
-#ifndef GL_EXT_subtexture
-#endif
+#ifndef GL_ARB_enhanced_layouts
+#define GL_ARB_enhanced_layouts 1
+#endif /* GL_ARB_enhanced_layouts */
-#ifndef GL_EXT_copy_texture
-#endif
+#ifndef GL_ARB_explicit_attrib_location
+#define GL_ARB_explicit_attrib_location 1
+#endif /* GL_ARB_explicit_attrib_location */
-#ifndef GL_EXT_histogram
-#define GL_HISTOGRAM_EXT 0x8024
-#define GL_PROXY_HISTOGRAM_EXT 0x8025
-#define GL_HISTOGRAM_WIDTH_EXT 0x8026
-#define GL_HISTOGRAM_FORMAT_EXT 0x8027
-#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028
-#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029
-#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C
-#define GL_HISTOGRAM_SINK_EXT 0x802D
-#define GL_MINMAX_EXT 0x802E
-#define GL_MINMAX_FORMAT_EXT 0x802F
-#define GL_MINMAX_SINK_EXT 0x8030
-#define GL_TABLE_TOO_LARGE_EXT 0x8031
-#endif
+#ifndef GL_ARB_explicit_uniform_location
+#define GL_ARB_explicit_uniform_location 1
+#endif /* GL_ARB_explicit_uniform_location */
-#ifndef GL_EXT_convolution
-#define GL_CONVOLUTION_1D_EXT 0x8010
-#define GL_CONVOLUTION_2D_EXT 0x8011
-#define GL_SEPARABLE_2D_EXT 0x8012
-#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013
-#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014
-#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015
-#define GL_REDUCE_EXT 0x8016
-#define GL_CONVOLUTION_FORMAT_EXT 0x8017
-#define GL_CONVOLUTION_WIDTH_EXT 0x8018
-#define GL_CONVOLUTION_HEIGHT_EXT 0x8019
-#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
-#endif
+#ifndef GL_ARB_fragment_coord_conventions
+#define GL_ARB_fragment_coord_conventions 1
+#endif /* GL_ARB_fragment_coord_conventions */
-#ifndef GL_SGI_color_matrix
-#define GL_COLOR_MATRIX_SGI 0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
-#endif
+#ifndef GL_ARB_fragment_layer_viewport
+#define GL_ARB_fragment_layer_viewport 1
+#endif /* GL_ARB_fragment_layer_viewport */
-#ifndef GL_SGI_color_table
-#define GL_COLOR_TABLE_SGI 0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
-#define GL_PROXY_COLOR_TABLE_SGI 0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
-#define GL_COLOR_TABLE_SCALE_SGI 0x80D6
-#define GL_COLOR_TABLE_BIAS_SGI 0x80D7
-#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8
-#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
+#ifndef GL_ARB_fragment_program
+#define GL_ARB_fragment_program 1
+#define GL_FRAGMENT_PROGRAM_ARB 0x8804
+#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
+#define GL_PROGRAM_LENGTH_ARB 0x8627
+#define GL_PROGRAM_FORMAT_ARB 0x8876
+#define GL_PROGRAM_BINDING_ARB 0x8677
+#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0
+#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1
+#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
+#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
+#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4
+#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5
+#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
+#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
+#define GL_PROGRAM_PARAMETERS_ARB 0x88A8
+#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9
+#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA
+#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
+#define GL_PROGRAM_ATTRIBS_ARB 0x88AC
+#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD
+#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE
+#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
+#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
+#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
+#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
+#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805
+#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806
+#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807
+#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
+#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
+#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
+#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
+#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
+#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
+#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
+#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
+#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
+#define GL_PROGRAM_STRING_ARB 0x8628
+#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B
+#define GL_CURRENT_MATRIX_ARB 0x8641
+#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7
+#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
+#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F
+#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
+#define GL_MAX_TEXTURE_COORDS_ARB 0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872
+#define GL_PROGRAM_ERROR_STRING_ARB 0x8874
+#define GL_MATRIX0_ARB 0x88C0
+#define GL_MATRIX1_ARB 0x88C1
+#define GL_MATRIX2_ARB 0x88C2
+#define GL_MATRIX3_ARB 0x88C3
+#define GL_MATRIX4_ARB 0x88C4
+#define GL_MATRIX5_ARB 0x88C5
+#define GL_MATRIX6_ARB 0x88C6
+#define GL_MATRIX7_ARB 0x88C7
+#define GL_MATRIX8_ARB 0x88C8
+#define GL_MATRIX9_ARB 0x88C9
+#define GL_MATRIX10_ARB 0x88CA
+#define GL_MATRIX11_ARB 0x88CB
+#define GL_MATRIX12_ARB 0x88CC
+#define GL_MATRIX13_ARB 0x88CD
+#define GL_MATRIX14_ARB 0x88CE
+#define GL_MATRIX15_ARB 0x88CF
+#define GL_MATRIX16_ARB 0x88D0
+#define GL_MATRIX17_ARB 0x88D1
+#define GL_MATRIX18_ARB 0x88D2
+#define GL_MATRIX19_ARB 0x88D3
+#define GL_MATRIX20_ARB 0x88D4
+#define GL_MATRIX21_ARB 0x88D5
+#define GL_MATRIX22_ARB 0x88D6
+#define GL_MATRIX23_ARB 0x88D7
+#define GL_MATRIX24_ARB 0x88D8
+#define GL_MATRIX25_ARB 0x88D9
+#define GL_MATRIX26_ARB 0x88DA
+#define GL_MATRIX27_ARB 0x88DB
+#define GL_MATRIX28_ARB 0x88DC
+#define GL_MATRIX29_ARB 0x88DD
+#define GL_MATRIX30_ARB 0x88DE
+#define GL_MATRIX31_ARB 0x88DF
+typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void *string);
+typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void *string);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const void *string);
+GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program);
+GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs);
+GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs);
+GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);
+GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);
+GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);
+GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);
+GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params);
+GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params);
+GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params);
+GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params);
+GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, void *string);
+GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program);
#endif
+#endif /* GL_ARB_fragment_program */
-#ifndef GL_SGIS_pixel_texture
-#define GL_PIXEL_TEXTURE_SGIS 0x8353
-#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354
-#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355
-#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356
-#endif
+#ifndef GL_ARB_fragment_program_shadow
+#define GL_ARB_fragment_program_shadow 1
+#endif /* GL_ARB_fragment_program_shadow */
-#ifndef GL_SGIX_pixel_texture
-#define GL_PIXEL_TEX_GEN_SGIX 0x8139
-#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B
-#endif
+#ifndef GL_ARB_fragment_shader
+#define GL_ARB_fragment_shader 1
+#define GL_FRAGMENT_SHADER_ARB 0x8B30
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
+#endif /* GL_ARB_fragment_shader */
-#ifndef GL_SGIS_texture4D
-#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130
-#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131
-#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132
-#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133
-#define GL_TEXTURE_4D_SGIS 0x8134
-#define GL_PROXY_TEXTURE_4D_SGIS 0x8135
-#define GL_TEXTURE_4DSIZE_SGIS 0x8136
-#define GL_TEXTURE_WRAP_Q_SGIS 0x8137
-#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138
-#define GL_TEXTURE_4D_BINDING_SGIS 0x814F
-#endif
+#ifndef GL_ARB_framebuffer_no_attachments
+#define GL_ARB_framebuffer_no_attachments 1
+#endif /* GL_ARB_framebuffer_no_attachments */
-#ifndef GL_SGI_texture_color_table
-#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC
-#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD
-#endif
+#ifndef GL_ARB_framebuffer_object
+#define GL_ARB_framebuffer_object 1
+#endif /* GL_ARB_framebuffer_object */
-#ifndef GL_EXT_cmyka
-#define GL_CMYK_EXT 0x800C
-#define GL_CMYKA_EXT 0x800D
-#define GL_PACK_CMYK_HINT_EXT 0x800E
-#define GL_UNPACK_CMYK_HINT_EXT 0x800F
-#endif
+#ifndef GL_ARB_framebuffer_sRGB
+#define GL_ARB_framebuffer_sRGB 1
+#endif /* GL_ARB_framebuffer_sRGB */
-#ifndef GL_EXT_texture_object
-#define GL_TEXTURE_PRIORITY_EXT 0x8066
-#define GL_TEXTURE_RESIDENT_EXT 0x8067
-#define GL_TEXTURE_1D_BINDING_EXT 0x8068
-#define GL_TEXTURE_2D_BINDING_EXT 0x8069
-#define GL_TEXTURE_3D_BINDING_EXT 0x806A
+#ifndef GL_ARB_geometry_shader4
+#define GL_ARB_geometry_shader4 1
+#define GL_LINES_ADJACENCY_ARB 0x000A
+#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B
+#define GL_TRIANGLES_ADJACENCY_ARB 0x000C
+#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D
+#define GL_PROGRAM_POINT_SIZE_ARB 0x8642
+#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9
+#define GL_GEOMETRY_SHADER_ARB 0x8DD9
+#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA
+#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB
+#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC
+#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD
+#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE
+#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF
+#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0
+#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value);
+GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
#endif
+#endif /* GL_ARB_geometry_shader4 */
-#ifndef GL_SGIS_detail_texture
-#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095
-#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
-#define GL_LINEAR_DETAIL_SGIS 0x8097
-#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098
-#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099
-#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A
-#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B
-#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
-#endif
+#ifndef GL_ARB_get_program_binary
+#define GL_ARB_get_program_binary 1
+#endif /* GL_ARB_get_program_binary */
-#ifndef GL_SGIS_sharpen_texture
-#define GL_LINEAR_SHARPEN_SGIS 0x80AD
-#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE
-#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF
-#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0
-#endif
+#ifndef GL_ARB_gpu_shader5
+#define GL_ARB_gpu_shader5 1
+#endif /* GL_ARB_gpu_shader5 */
-#ifndef GL_EXT_packed_pixels
-#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034
-#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035
-#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036
-#endif
+#ifndef GL_ARB_gpu_shader_fp64
+#define GL_ARB_gpu_shader_fp64 1
+#endif /* GL_ARB_gpu_shader_fp64 */
-#ifndef GL_SGIS_texture_lod
-#define GL_TEXTURE_MIN_LOD_SGIS 0x813A
-#define GL_TEXTURE_MAX_LOD_SGIS 0x813B
-#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C
-#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D
-#endif
+#ifndef GL_ARB_half_float_pixel
+#define GL_ARB_half_float_pixel 1
+typedef unsigned short GLhalfARB;
+#define GL_HALF_FLOAT_ARB 0x140B
+#endif /* GL_ARB_half_float_pixel */
-#ifndef GL_SGIS_multisample
-#define GL_MULTISAMPLE_SGIS 0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F
-#define GL_SAMPLE_MASK_SGIS 0x80A0
-#define GL_1PASS_SGIS 0x80A1
-#define GL_2PASS_0_SGIS 0x80A2
-#define GL_2PASS_1_SGIS 0x80A3
-#define GL_4PASS_0_SGIS 0x80A4
-#define GL_4PASS_1_SGIS 0x80A5
-#define GL_4PASS_2_SGIS 0x80A6
-#define GL_4PASS_3_SGIS 0x80A7
-#define GL_SAMPLE_BUFFERS_SGIS 0x80A8
-#define GL_SAMPLES_SGIS 0x80A9
-#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA
-#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB
-#define GL_SAMPLE_PATTERN_SGIS 0x80AC
-#endif
+#ifndef GL_ARB_half_float_vertex
+#define GL_ARB_half_float_vertex 1
+#endif /* GL_ARB_half_float_vertex */
-#ifndef GL_EXT_rescale_normal
-#define GL_RESCALE_NORMAL_EXT 0x803A
+#ifndef GL_ARB_imaging
+#define GL_ARB_imaging 1
+#define GL_BLEND_COLOR 0x8005
+#define GL_BLEND_EQUATION 0x8009
+#define GL_CONVOLUTION_1D 0x8010
+#define GL_CONVOLUTION_2D 0x8011
+#define GL_SEPARABLE_2D 0x8012
+#define GL_CONVOLUTION_BORDER_MODE 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS 0x8015
+#define GL_REDUCE 0x8016
+#define GL_CONVOLUTION_FORMAT 0x8017
+#define GL_CONVOLUTION_WIDTH 0x8018
+#define GL_CONVOLUTION_HEIGHT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
+#define GL_HISTOGRAM 0x8024
+#define GL_PROXY_HISTOGRAM 0x8025
+#define GL_HISTOGRAM_WIDTH 0x8026
+#define GL_HISTOGRAM_FORMAT 0x8027
+#define GL_HISTOGRAM_RED_SIZE 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
+#define GL_HISTOGRAM_SINK 0x802D
+#define GL_MINMAX 0x802E
+#define GL_MINMAX_FORMAT 0x802F
+#define GL_MINMAX_SINK 0x8030
+#define GL_TABLE_TOO_LARGE 0x8031
+#define GL_COLOR_MATRIX 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
+#define GL_COLOR_TABLE 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
+#define GL_PROXY_COLOR_TABLE 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
+#define GL_COLOR_TABLE_SCALE 0x80D6
+#define GL_COLOR_TABLE_BIAS 0x80D7
+#define GL_COLOR_TABLE_FORMAT 0x80D8
+#define GL_COLOR_TABLE_WIDTH 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
+#define GL_CONSTANT_BORDER 0x8151
+#define GL_REPLICATE_BORDER 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR 0x8154
+typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, void *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, void *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table);
+GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, void *table);
+GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data);
+GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image);
+GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image);
+GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params);
+GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params);
+GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, void *image);
+GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span);
+GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column);
+GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values);
+GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values);
+GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY glResetHistogram (GLenum target);
+GLAPI void APIENTRY glResetMinmax (GLenum target);
#endif
+#endif /* GL_ARB_imaging */
-#ifndef GL_EXT_vertex_array
-#define GL_VERTEX_ARRAY_EXT 0x8074
-#define GL_NORMAL_ARRAY_EXT 0x8075
-#define GL_COLOR_ARRAY_EXT 0x8076
-#define GL_INDEX_ARRAY_EXT 0x8077
-#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078
-#define GL_EDGE_FLAG_ARRAY_EXT 0x8079
-#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A
-#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B
-#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C
-#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D
-#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E
-#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F
-#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080
-#define GL_COLOR_ARRAY_SIZE_EXT 0x8081
-#define GL_COLOR_ARRAY_TYPE_EXT 0x8082
-#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083
-#define GL_COLOR_ARRAY_COUNT_EXT 0x8084
-#define GL_INDEX_ARRAY_TYPE_EXT 0x8085
-#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086
-#define GL_INDEX_ARRAY_COUNT_EXT 0x8087
-#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
-#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B
-#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C
-#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D
-#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E
-#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F
-#define GL_COLOR_ARRAY_POINTER_EXT 0x8090
-#define GL_INDEX_ARRAY_POINTER_EXT 0x8091
-#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
-#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093
+#ifndef GL_ARB_indirect_parameters
+#define GL_ARB_indirect_parameters 1
+#define GL_PARAMETER_BUFFER_ARB 0x80EE
+#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiDrawArraysIndirectCountARB (GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+GLAPI void APIENTRY glMultiDrawElementsIndirectCountARB (GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
#endif
+#endif /* GL_ARB_indirect_parameters */
-#ifndef GL_EXT_misc_attribute
+#ifndef GL_ARB_instanced_arrays
+#define GL_ARB_instanced_arrays 1
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE
+typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor);
#endif
+#endif /* GL_ARB_instanced_arrays */
-#ifndef GL_SGIS_generate_mipmap
-#define GL_GENERATE_MIPMAP_SGIS 0x8191
-#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
-#endif
+#ifndef GL_ARB_internalformat_query
+#define GL_ARB_internalformat_query 1
+#endif /* GL_ARB_internalformat_query */
-#ifndef GL_SGIX_clipmap
-#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170
-#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171
-#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172
-#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173
-#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174
-#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175
-#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176
-#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177
-#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178
-#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D
-#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E
-#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F
-#endif
+#ifndef GL_ARB_internalformat_query2
+#define GL_ARB_internalformat_query2 1
+#define GL_SRGB_DECODE_ARB 0x8299
+#endif /* GL_ARB_internalformat_query2 */
-#ifndef GL_SGIX_shadow
-#define GL_TEXTURE_COMPARE_SGIX 0x819A
-#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B
-#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C
-#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D
-#endif
+#ifndef GL_ARB_invalidate_subdata
+#define GL_ARB_invalidate_subdata 1
+#endif /* GL_ARB_invalidate_subdata */
-#ifndef GL_SGIS_texture_edge_clamp
-#define GL_CLAMP_TO_EDGE_SGIS 0x812F
-#endif
+#ifndef GL_ARB_map_buffer_alignment
+#define GL_ARB_map_buffer_alignment 1
+#endif /* GL_ARB_map_buffer_alignment */
-#ifndef GL_SGIS_texture_border_clamp
-#define GL_CLAMP_TO_BORDER_SGIS 0x812D
-#endif
+#ifndef GL_ARB_map_buffer_range
+#define GL_ARB_map_buffer_range 1
+#endif /* GL_ARB_map_buffer_range */
-#ifndef GL_EXT_blend_minmax
-#define GL_FUNC_ADD_EXT 0x8006
-#define GL_MIN_EXT 0x8007
-#define GL_MAX_EXT 0x8008
-#define GL_BLEND_EQUATION_EXT 0x8009
+#ifndef GL_ARB_matrix_palette
+#define GL_ARB_matrix_palette 1
+#define GL_MATRIX_PALETTE_ARB 0x8840
+#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
+#define GL_MAX_PALETTE_MATRICES_ARB 0x8842
+#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843
+#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844
+#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845
+#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846
+#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847
+#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848
+#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
+typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index);
+GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices);
+GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices);
+GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices);
+GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer);
#endif
+#endif /* GL_ARB_matrix_palette */
-#ifndef GL_EXT_blend_subtract
-#define GL_FUNC_SUBTRACT_EXT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B
-#endif
+#ifndef GL_ARB_multi_bind
+#define GL_ARB_multi_bind 1
+#endif /* GL_ARB_multi_bind */
-#ifndef GL_EXT_blend_logic_op
-#endif
+#ifndef GL_ARB_multi_draw_indirect
+#define GL_ARB_multi_draw_indirect 1
+#endif /* GL_ARB_multi_draw_indirect */
-#ifndef GL_SGIX_interlace
-#define GL_INTERLACE_SGIX 0x8094
+#ifndef GL_ARB_multisample
+#define GL_ARB_multisample 1
+#define GL_MULTISAMPLE_ARB 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F
+#define GL_SAMPLE_COVERAGE_ARB 0x80A0
+#define GL_SAMPLE_BUFFERS_ARB 0x80A8
+#define GL_SAMPLES_ARB 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB
+#define GL_MULTISAMPLE_BIT_ARB 0x20000000
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLfloat value, GLboolean invert);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleCoverageARB (GLfloat value, GLboolean invert);
#endif
+#endif /* GL_ARB_multisample */
-#ifndef GL_SGIX_pixel_tiles
-#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E
-#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F
-#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140
-#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141
-#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142
-#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143
-#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144
-#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145
+#ifndef GL_ARB_multitexture
+#define GL_ARB_multitexture 1
+#define GL_TEXTURE0_ARB 0x84C0
+#define GL_TEXTURE1_ARB 0x84C1
+#define GL_TEXTURE2_ARB 0x84C2
+#define GL_TEXTURE3_ARB 0x84C3
+#define GL_TEXTURE4_ARB 0x84C4
+#define GL_TEXTURE5_ARB 0x84C5
+#define GL_TEXTURE6_ARB 0x84C6
+#define GL_TEXTURE7_ARB 0x84C7
+#define GL_TEXTURE8_ARB 0x84C8
+#define GL_TEXTURE9_ARB 0x84C9
+#define GL_TEXTURE10_ARB 0x84CA
+#define GL_TEXTURE11_ARB 0x84CB
+#define GL_TEXTURE12_ARB 0x84CC
+#define GL_TEXTURE13_ARB 0x84CD
+#define GL_TEXTURE14_ARB 0x84CE
+#define GL_TEXTURE15_ARB 0x84CF
+#define GL_TEXTURE16_ARB 0x84D0
+#define GL_TEXTURE17_ARB 0x84D1
+#define GL_TEXTURE18_ARB 0x84D2
+#define GL_TEXTURE19_ARB 0x84D3
+#define GL_TEXTURE20_ARB 0x84D4
+#define GL_TEXTURE21_ARB 0x84D5
+#define GL_TEXTURE22_ARB 0x84D6
+#define GL_TEXTURE23_ARB 0x84D7
+#define GL_TEXTURE24_ARB 0x84D8
+#define GL_TEXTURE25_ARB 0x84D9
+#define GL_TEXTURE26_ARB 0x84DA
+#define GL_TEXTURE27_ARB 0x84DB
+#define GL_TEXTURE28_ARB 0x84DC
+#define GL_TEXTURE29_ARB 0x84DD
+#define GL_TEXTURE30_ARB 0x84DE
+#define GL_TEXTURE31_ARB 0x84DF
+#define GL_ACTIVE_TEXTURE_ARB 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
+#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
+typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTextureARB (GLenum texture);
+GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture);
+GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s);
+GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s);
+GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s);
+GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s);
+GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t);
+GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t);
+GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t);
+GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t);
+GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r);
+GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v);
#endif
+#endif /* GL_ARB_multitexture */
-#ifndef GL_SGIS_texture_select
-#define GL_DUAL_ALPHA4_SGIS 0x8110
-#define GL_DUAL_ALPHA8_SGIS 0x8111
-#define GL_DUAL_ALPHA12_SGIS 0x8112
-#define GL_DUAL_ALPHA16_SGIS 0x8113
-#define GL_DUAL_LUMINANCE4_SGIS 0x8114
-#define GL_DUAL_LUMINANCE8_SGIS 0x8115
-#define GL_DUAL_LUMINANCE12_SGIS 0x8116
-#define GL_DUAL_LUMINANCE16_SGIS 0x8117
-#define GL_DUAL_INTENSITY4_SGIS 0x8118
-#define GL_DUAL_INTENSITY8_SGIS 0x8119
-#define GL_DUAL_INTENSITY12_SGIS 0x811A
-#define GL_DUAL_INTENSITY16_SGIS 0x811B
-#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C
-#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D
-#define GL_QUAD_ALPHA4_SGIS 0x811E
-#define GL_QUAD_ALPHA8_SGIS 0x811F
-#define GL_QUAD_LUMINANCE4_SGIS 0x8120
-#define GL_QUAD_LUMINANCE8_SGIS 0x8121
-#define GL_QUAD_INTENSITY4_SGIS 0x8122
-#define GL_QUAD_INTENSITY8_SGIS 0x8123
-#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124
-#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125
+#ifndef GL_ARB_occlusion_query
+#define GL_ARB_occlusion_query 1
+#define GL_QUERY_COUNTER_BITS_ARB 0x8864
+#define GL_CURRENT_QUERY_ARB 0x8865
+#define GL_QUERY_RESULT_ARB 0x8866
+#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867
+#define GL_SAMPLES_PASSED_ARB 0x8914
+typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids);
+GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids);
+GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id);
+GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id);
+GLAPI void APIENTRY glEndQueryARB (GLenum target);
+GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params);
#endif
+#endif /* GL_ARB_occlusion_query */
-#ifndef GL_SGIX_sprite
-#define GL_SPRITE_SGIX 0x8148
-#define GL_SPRITE_MODE_SGIX 0x8149
-#define GL_SPRITE_AXIS_SGIX 0x814A
-#define GL_SPRITE_TRANSLATION_SGIX 0x814B
-#define GL_SPRITE_AXIAL_SGIX 0x814C
-#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D
-#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E
-#endif
+#ifndef GL_ARB_occlusion_query2
+#define GL_ARB_occlusion_query2 1
+#endif /* GL_ARB_occlusion_query2 */
-#ifndef GL_SGIX_texture_multi_buffer
-#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
-#endif
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_ARB_pixel_buffer_object 1
+#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
+#endif /* GL_ARB_pixel_buffer_object */
-#ifndef GL_EXT_point_parameters
-#define GL_POINT_SIZE_MIN_EXT 0x8126
-#define GL_POINT_SIZE_MAX_EXT 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
-#define GL_DISTANCE_ATTENUATION_EXT 0x8129
+#ifndef GL_ARB_point_parameters
+#define GL_ARB_point_parameters 1
+#define GL_POINT_SIZE_MIN_ARB 0x8126
+#define GL_POINT_SIZE_MAX_ARB 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128
+#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params);
#endif
+#endif /* GL_ARB_point_parameters */
-#ifndef GL_SGIS_point_parameters
-#define GL_POINT_SIZE_MIN_SGIS 0x8126
-#define GL_POINT_SIZE_MAX_SGIS 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128
-#define GL_DISTANCE_ATTENUATION_SGIS 0x8129
-#endif
+#ifndef GL_ARB_point_sprite
+#define GL_ARB_point_sprite 1
+#define GL_POINT_SPRITE_ARB 0x8861
+#define GL_COORD_REPLACE_ARB 0x8862
+#endif /* GL_ARB_point_sprite */
-#ifndef GL_SGIX_instruments
-#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
-#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181
-#endif
+#ifndef GL_ARB_program_interface_query
+#define GL_ARB_program_interface_query 1
+#endif /* GL_ARB_program_interface_query */
-#ifndef GL_SGIX_texture_scale_bias
-#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179
-#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
-#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
-#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
-#endif
+#ifndef GL_ARB_provoking_vertex
+#define GL_ARB_provoking_vertex 1
+#endif /* GL_ARB_provoking_vertex */
-#ifndef GL_SGIX_framezoom
-#define GL_FRAMEZOOM_SGIX 0x818B
-#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C
-#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D
-#endif
+#ifndef GL_ARB_query_buffer_object
+#define GL_ARB_query_buffer_object 1
+#endif /* GL_ARB_query_buffer_object */
-#ifndef GL_SGIX_tag_sample_buffer
-#endif
+#ifndef GL_ARB_robust_buffer_access_behavior
+#define GL_ARB_robust_buffer_access_behavior 1
+#endif /* GL_ARB_robust_buffer_access_behavior */
-#ifndef GL_FfdMaskSGIX
-#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001
-#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002
+#ifndef GL_ARB_robustness
+#define GL_ARB_robustness 1
+#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004
+#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
+#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253
+#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254
+#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255
+#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
+#define GL_NO_RESET_NOTIFICATION_ARB 0x8261
+typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void);
+typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img);
+typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void *img);
+typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
+typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
+typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
+typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
+typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values);
+typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values);
+typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values);
+typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern);
+typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table);
+typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image);
+typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span);
+typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
+typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void);
+GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img);
+GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, void *img);
+GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
+GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
+GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
+GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
+GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
+GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values);
+GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values);
+GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values);
+GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern);
+GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table);
+GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image);
+GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span);
+GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
+GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
#endif
+#endif /* GL_ARB_robustness */
-#ifndef GL_SGIX_polynomial_ffd
-#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194
-#define GL_TEXTURE_DEFORMATION_SGIX 0x8195
-#define GL_DEFORMATIONS_MASK_SGIX 0x8196
-#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197
-#endif
+#ifndef GL_ARB_robustness_isolation
+#define GL_ARB_robustness_isolation 1
+#endif /* GL_ARB_robustness_isolation */
-#ifndef GL_SGIX_reference_plane
-#define GL_REFERENCE_PLANE_SGIX 0x817D
-#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E
+#ifndef GL_ARB_sample_shading
+#define GL_ARB_sample_shading 1
+#define GL_SAMPLE_SHADING_ARB 0x8C36
+#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37
+typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLfloat value);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMinSampleShadingARB (GLfloat value);
#endif
+#endif /* GL_ARB_sample_shading */
-#ifndef GL_SGIX_flush_raster
-#endif
+#ifndef GL_ARB_sampler_objects
+#define GL_ARB_sampler_objects 1
+#endif /* GL_ARB_sampler_objects */
-#ifndef GL_SGIX_depth_texture
-#define GL_DEPTH_COMPONENT16_SGIX 0x81A5
-#define GL_DEPTH_COMPONENT24_SGIX 0x81A6
-#define GL_DEPTH_COMPONENT32_SGIX 0x81A7
-#endif
+#ifndef GL_ARB_seamless_cube_map
+#define GL_ARB_seamless_cube_map 1
+#endif /* GL_ARB_seamless_cube_map */
-#ifndef GL_SGIS_fog_function
-#define GL_FOG_FUNC_SGIS 0x812A
-#define GL_FOG_FUNC_POINTS_SGIS 0x812B
-#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C
-#endif
+#ifndef GL_ARB_seamless_cubemap_per_texture
+#define GL_ARB_seamless_cubemap_per_texture 1
+#endif /* GL_ARB_seamless_cubemap_per_texture */
-#ifndef GL_SGIX_fog_offset
-#define GL_FOG_OFFSET_SGIX 0x8198
-#define GL_FOG_OFFSET_VALUE_SGIX 0x8199
-#endif
+#ifndef GL_ARB_separate_shader_objects
+#define GL_ARB_separate_shader_objects 1
+#endif /* GL_ARB_separate_shader_objects */
-#ifndef GL_HP_image_transform
-#define GL_IMAGE_SCALE_X_HP 0x8155
-#define GL_IMAGE_SCALE_Y_HP 0x8156
-#define GL_IMAGE_TRANSLATE_X_HP 0x8157
-#define GL_IMAGE_TRANSLATE_Y_HP 0x8158
-#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159
-#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A
-#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B
-#define GL_IMAGE_MAG_FILTER_HP 0x815C
-#define GL_IMAGE_MIN_FILTER_HP 0x815D
-#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E
-#define GL_CUBIC_HP 0x815F
-#define GL_AVERAGE_HP 0x8160
-#define GL_IMAGE_TRANSFORM_2D_HP 0x8161
-#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162
-#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163
-#endif
+#ifndef GL_ARB_shader_atomic_counters
+#define GL_ARB_shader_atomic_counters 1
+#endif /* GL_ARB_shader_atomic_counters */
-#ifndef GL_HP_convolution_border_modes
-#define GL_IGNORE_BORDER_HP 0x8150
-#define GL_CONSTANT_BORDER_HP 0x8151
-#define GL_REPLICATE_BORDER_HP 0x8153
-#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154
-#endif
+#ifndef GL_ARB_shader_bit_encoding
+#define GL_ARB_shader_bit_encoding 1
+#endif /* GL_ARB_shader_bit_encoding */
-#ifndef GL_INGR_palette_buffer
-#endif
+#ifndef GL_ARB_shader_draw_parameters
+#define GL_ARB_shader_draw_parameters 1
+#endif /* GL_ARB_shader_draw_parameters */
-#ifndef GL_SGIX_texture_add_env
-#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE
-#endif
+#ifndef GL_ARB_shader_group_vote
+#define GL_ARB_shader_group_vote 1
+#endif /* GL_ARB_shader_group_vote */
-#ifndef GL_EXT_color_subtable
-#endif
+#ifndef GL_ARB_shader_image_load_store
+#define GL_ARB_shader_image_load_store 1
+#endif /* GL_ARB_shader_image_load_store */
-#ifndef GL_PGI_vertex_hints
-#define GL_VERTEX_DATA_HINT_PGI 0x1A22A
-#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B
-#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C
-#define GL_MAX_VERTEX_HINT_PGI 0x1A22D
-#define GL_COLOR3_BIT_PGI 0x00010000
-#define GL_COLOR4_BIT_PGI 0x00020000
-#define GL_EDGEFLAG_BIT_PGI 0x00040000
-#define GL_INDEX_BIT_PGI 0x00080000
-#define GL_MAT_AMBIENT_BIT_PGI 0x00100000
-#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
-#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000
-#define GL_MAT_EMISSION_BIT_PGI 0x00800000
-#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000
-#define GL_MAT_SHININESS_BIT_PGI 0x02000000
-#define GL_MAT_SPECULAR_BIT_PGI 0x04000000
-#define GL_NORMAL_BIT_PGI 0x08000000
-#define GL_TEXCOORD1_BIT_PGI 0x10000000
-#define GL_TEXCOORD2_BIT_PGI 0x20000000
-#define GL_TEXCOORD3_BIT_PGI 0x40000000
-#define GL_TEXCOORD4_BIT_PGI 0x80000000
-#define GL_VERTEX23_BIT_PGI 0x00000004
-#define GL_VERTEX4_BIT_PGI 0x00000008
-#endif
+#ifndef GL_ARB_shader_image_size
+#define GL_ARB_shader_image_size 1
+#endif /* GL_ARB_shader_image_size */
-#ifndef GL_PGI_misc_hints
-#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8
-#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD
-#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE
-#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202
-#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203
-#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204
-#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C
-#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D
-#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E
-#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F
-#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210
-#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211
-#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216
-#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217
-#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218
-#define GL_FULL_STIPPLE_HINT_PGI 0x1A219
-#define GL_CLIP_NEAR_HINT_PGI 0x1A220
-#define GL_CLIP_FAR_HINT_PGI 0x1A221
-#define GL_WIDE_LINE_HINT_PGI 0x1A222
-#define GL_BACK_NORMALS_HINT_PGI 0x1A223
+#ifndef GL_ARB_shader_objects
+#define GL_ARB_shader_objects 1
+#ifdef __APPLE__
+typedef void *GLhandleARB;
+#else
+typedef unsigned int GLhandleARB;
#endif
-
-#ifndef GL_EXT_paletted_texture
-#define GL_COLOR_INDEX1_EXT 0x80E2
-#define GL_COLOR_INDEX2_EXT 0x80E3
-#define GL_COLOR_INDEX4_EXT 0x80E4
-#define GL_COLOR_INDEX8_EXT 0x80E5
-#define GL_COLOR_INDEX12_EXT 0x80E6
-#define GL_COLOR_INDEX16_EXT 0x80E7
-#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
+typedef char GLcharARB;
+#define GL_PROGRAM_OBJECT_ARB 0x8B40
+#define GL_SHADER_OBJECT_ARB 0x8B48
+#define GL_OBJECT_TYPE_ARB 0x8B4E
+#define GL_OBJECT_SUBTYPE_ARB 0x8B4F
+#define GL_FLOAT_VEC2_ARB 0x8B50
+#define GL_FLOAT_VEC3_ARB 0x8B51
+#define GL_FLOAT_VEC4_ARB 0x8B52
+#define GL_INT_VEC2_ARB 0x8B53
+#define GL_INT_VEC3_ARB 0x8B54
+#define GL_INT_VEC4_ARB 0x8B55
+#define GL_BOOL_ARB 0x8B56
+#define GL_BOOL_VEC2_ARB 0x8B57
+#define GL_BOOL_VEC3_ARB 0x8B58
+#define GL_BOOL_VEC4_ARB 0x8B59
+#define GL_FLOAT_MAT2_ARB 0x8B5A
+#define GL_FLOAT_MAT3_ARB 0x8B5B
+#define GL_FLOAT_MAT4_ARB 0x8B5C
+#define GL_SAMPLER_1D_ARB 0x8B5D
+#define GL_SAMPLER_2D_ARB 0x8B5E
+#define GL_SAMPLER_3D_ARB 0x8B5F
+#define GL_SAMPLER_CUBE_ARB 0x8B60
+#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61
+#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62
+#define GL_SAMPLER_2D_RECT_ARB 0x8B63
+#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
+#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80
+#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81
+#define GL_OBJECT_LINK_STATUS_ARB 0x8B82
+#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83
+#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84
+#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85
+#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86
+#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
+#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
+typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
+typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
+typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length);
+typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
+typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
+typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
+typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj);
+GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname);
+GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj);
+GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType);
+GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length);
+GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj);
+GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);
+GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj);
+GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj);
+GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj);
+GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj);
+GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0);
+GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0);
+GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
+GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
+GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name);
+GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params);
+GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params);
+GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
#endif
+#endif /* GL_ARB_shader_objects */
-#ifndef GL_EXT_clip_volume_hint
-#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0
-#endif
+#ifndef GL_ARB_shader_precision
+#define GL_ARB_shader_precision 1
+#endif /* GL_ARB_shader_precision */
-#ifndef GL_SGIX_list_priority
-#define GL_LIST_PRIORITY_SGIX 0x8182
-#endif
+#ifndef GL_ARB_shader_stencil_export
+#define GL_ARB_shader_stencil_export 1
+#endif /* GL_ARB_shader_stencil_export */
-#ifndef GL_SGIX_ir_instrument1
-#define GL_IR_INSTRUMENT1_SGIX 0x817F
-#endif
+#ifndef GL_ARB_shader_storage_buffer_object
+#define GL_ARB_shader_storage_buffer_object 1
+#endif /* GL_ARB_shader_storage_buffer_object */
-#ifndef GL_SGIX_calligraphic_fragment
-#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183
-#endif
+#ifndef GL_ARB_shader_subroutine
+#define GL_ARB_shader_subroutine 1
+#endif /* GL_ARB_shader_subroutine */
-#ifndef GL_SGIX_texture_lod_bias
-#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E
-#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F
-#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190
-#endif
+#ifndef GL_ARB_shader_texture_lod
+#define GL_ARB_shader_texture_lod 1
+#endif /* GL_ARB_shader_texture_lod */
-#ifndef GL_SGIX_shadow_ambient
-#define GL_SHADOW_AMBIENT_SGIX 0x80BF
-#endif
+#ifndef GL_ARB_shading_language_100
+#define GL_ARB_shading_language_100 1
+#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C
+#endif /* GL_ARB_shading_language_100 */
-#ifndef GL_EXT_index_texture
-#endif
+#ifndef GL_ARB_shading_language_420pack
+#define GL_ARB_shading_language_420pack 1
+#endif /* GL_ARB_shading_language_420pack */
-#ifndef GL_EXT_index_material
-#define GL_INDEX_MATERIAL_EXT 0x81B8
-#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9
-#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA
+#ifndef GL_ARB_shading_language_include
+#define GL_ARB_shading_language_include 1
+#define GL_SHADER_INCLUDE_ARB 0x8DAE
+#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9
+#define GL_NAMED_STRING_TYPE_ARB 0x8DEA
+typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);
+typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);
+typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length);
+typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);
+typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);
+GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name);
+GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length);
+GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name);
+GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);
+GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params);
#endif
+#endif /* GL_ARB_shading_language_include */
-#ifndef GL_EXT_index_func
-#define GL_INDEX_TEST_EXT 0x81B5
-#define GL_INDEX_TEST_FUNC_EXT 0x81B6
-#define GL_INDEX_TEST_REF_EXT 0x81B7
-#endif
+#ifndef GL_ARB_shading_language_packing
+#define GL_ARB_shading_language_packing 1
+#endif /* GL_ARB_shading_language_packing */
-#ifndef GL_EXT_index_array_formats
-#define GL_IUI_V2F_EXT 0x81AD
-#define GL_IUI_V3F_EXT 0x81AE
-#define GL_IUI_N3F_V2F_EXT 0x81AF
-#define GL_IUI_N3F_V3F_EXT 0x81B0
-#define GL_T2F_IUI_V2F_EXT 0x81B1
-#define GL_T2F_IUI_V3F_EXT 0x81B2
-#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3
-#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4
-#endif
+#ifndef GL_ARB_shadow
+#define GL_ARB_shadow 1
+#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C
+#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D
+#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E
+#endif /* GL_ARB_shadow */
-#ifndef GL_EXT_compiled_vertex_array
-#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8
-#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9
-#endif
+#ifndef GL_ARB_shadow_ambient
+#define GL_ARB_shadow_ambient 1
+#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
+#endif /* GL_ARB_shadow_ambient */
+
+#ifndef GL_ARB_sparse_texture
+#define GL_ARB_sparse_texture 1
+#define GL_TEXTURE_SPARSE_ARB 0x91A6
+#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7
+#define GL_MIN_SPARSE_LEVEL_ARB 0x919B
+#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8
+#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195
+#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196
+#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197
+#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198
+#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199
+#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A
+#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9
+typedef void (APIENTRYP PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexPageCommitmentARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident);
+#endif
+#endif /* GL_ARB_sparse_texture */
+
+#ifndef GL_ARB_stencil_texturing
+#define GL_ARB_stencil_texturing 1
+#endif /* GL_ARB_stencil_texturing */
-#ifndef GL_EXT_cull_vertex
-#define GL_CULL_VERTEX_EXT 0x81AA
-#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB
-#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
-#endif
+#ifndef GL_ARB_sync
+#define GL_ARB_sync 1
+#endif /* GL_ARB_sync */
-#ifndef GL_SGIX_ycrcb
-#define GL_YCRCB_422_SGIX 0x81BB
-#define GL_YCRCB_444_SGIX 0x81BC
-#endif
+#ifndef GL_ARB_tessellation_shader
+#define GL_ARB_tessellation_shader 1
+#endif /* GL_ARB_tessellation_shader */
-#ifndef GL_SGIX_fragment_lighting
-#define GL_FRAGMENT_LIGHTING_SGIX 0x8400
-#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401
-#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
-#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
-#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404
-#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405
-#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406
-#define GL_LIGHT_ENV_MODE_SGIX 0x8407
-#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
-#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
-#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
-#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
-#define GL_FRAGMENT_LIGHT0_SGIX 0x840C
-#define GL_FRAGMENT_LIGHT1_SGIX 0x840D
-#define GL_FRAGMENT_LIGHT2_SGIX 0x840E
-#define GL_FRAGMENT_LIGHT3_SGIX 0x840F
-#define GL_FRAGMENT_LIGHT4_SGIX 0x8410
-#define GL_FRAGMENT_LIGHT5_SGIX 0x8411
-#define GL_FRAGMENT_LIGHT6_SGIX 0x8412
-#define GL_FRAGMENT_LIGHT7_SGIX 0x8413
-#endif
+#ifndef GL_ARB_texture_border_clamp
+#define GL_ARB_texture_border_clamp 1
+#define GL_CLAMP_TO_BORDER_ARB 0x812D
+#endif /* GL_ARB_texture_border_clamp */
-#ifndef GL_IBM_rasterpos_clip
-#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262
+#ifndef GL_ARB_texture_buffer_object
+#define GL_ARB_texture_buffer_object 1
+#define GL_TEXTURE_BUFFER_ARB 0x8C2A
+#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B
+#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D
+#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E
+typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer);
#endif
+#endif /* GL_ARB_texture_buffer_object */
-#ifndef GL_HP_texture_lighting
-#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167
-#define GL_TEXTURE_POST_SPECULAR_HP 0x8168
-#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169
-#endif
+#ifndef GL_ARB_texture_buffer_object_rgb32
+#define GL_ARB_texture_buffer_object_rgb32 1
+#endif /* GL_ARB_texture_buffer_object_rgb32 */
-#ifndef GL_EXT_draw_range_elements
-#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8
-#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9
-#endif
+#ifndef GL_ARB_texture_buffer_range
+#define GL_ARB_texture_buffer_range 1
+#endif /* GL_ARB_texture_buffer_range */
-#ifndef GL_WIN_phong_shading
-#define GL_PHONG_WIN 0x80EA
-#define GL_PHONG_HINT_WIN 0x80EB
-#endif
+#ifndef GL_ARB_texture_compression
+#define GL_ARB_texture_compression 1
+#define GL_COMPRESSED_ALPHA_ARB 0x84E9
+#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
+#define GL_COMPRESSED_INTENSITY_ARB 0x84EC
+#define GL_COMPRESSED_RGB_ARB 0x84ED
+#define GL_COMPRESSED_RGBA_ARB 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
+#define GL_TEXTURE_COMPRESSED_ARB 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data);
+GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
+GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, void *img);
+#endif
+#endif /* GL_ARB_texture_compression */
-#ifndef GL_WIN_specular_fog
-#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC
-#endif
+#ifndef GL_ARB_texture_compression_bptc
+#define GL_ARB_texture_compression_bptc 1
+#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C
+#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D
+#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E
+#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F
+#endif /* GL_ARB_texture_compression_bptc */
-#ifndef GL_EXT_light_texture
-#define GL_FRAGMENT_MATERIAL_EXT 0x8349
-#define GL_FRAGMENT_NORMAL_EXT 0x834A
-#define GL_FRAGMENT_COLOR_EXT 0x834C
-#define GL_ATTENUATION_EXT 0x834D
-#define GL_SHADOW_ATTENUATION_EXT 0x834E
-#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F
-#define GL_TEXTURE_LIGHT_EXT 0x8350
-#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351
-#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
-/* reuse GL_FRAGMENT_DEPTH_EXT */
-#endif
+#ifndef GL_ARB_texture_compression_rgtc
+#define GL_ARB_texture_compression_rgtc 1
+#endif /* GL_ARB_texture_compression_rgtc */
-#ifndef GL_SGIX_blend_alpha_minmax
-#define GL_ALPHA_MIN_SGIX 0x8320
-#define GL_ALPHA_MAX_SGIX 0x8321
-#endif
+#ifndef GL_ARB_texture_cube_map
+#define GL_ARB_texture_cube_map 1
+#define GL_NORMAL_MAP_ARB 0x8511
+#define GL_REFLECTION_MAP_ARB 0x8512
+#define GL_TEXTURE_CUBE_MAP_ARB 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C
+#endif /* GL_ARB_texture_cube_map */
-#ifndef GL_SGIX_impact_pixel_texture
-#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184
-#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185
-#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186
-#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187
-#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188
-#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189
-#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A
-#endif
+#ifndef GL_ARB_texture_cube_map_array
+#define GL_ARB_texture_cube_map_array 1
+#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B
+#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C
+#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D
+#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E
+#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F
+#endif /* GL_ARB_texture_cube_map_array */
-#ifndef GL_EXT_bgra
-#define GL_BGR_EXT 0x80E0
-#define GL_BGRA_EXT 0x80E1
-#endif
+#ifndef GL_ARB_texture_env_add
+#define GL_ARB_texture_env_add 1
+#endif /* GL_ARB_texture_env_add */
-#ifndef GL_SGIX_async
-#define GL_ASYNC_MARKER_SGIX 0x8329
-#endif
+#ifndef GL_ARB_texture_env_combine
+#define GL_ARB_texture_env_combine 1
+#define GL_COMBINE_ARB 0x8570
+#define GL_COMBINE_RGB_ARB 0x8571
+#define GL_COMBINE_ALPHA_ARB 0x8572
+#define GL_SOURCE0_RGB_ARB 0x8580
+#define GL_SOURCE1_RGB_ARB 0x8581
+#define GL_SOURCE2_RGB_ARB 0x8582
+#define GL_SOURCE0_ALPHA_ARB 0x8588
+#define GL_SOURCE1_ALPHA_ARB 0x8589
+#define GL_SOURCE2_ALPHA_ARB 0x858A
+#define GL_OPERAND0_RGB_ARB 0x8590
+#define GL_OPERAND1_RGB_ARB 0x8591
+#define GL_OPERAND2_RGB_ARB 0x8592
+#define GL_OPERAND0_ALPHA_ARB 0x8598
+#define GL_OPERAND1_ALPHA_ARB 0x8599
+#define GL_OPERAND2_ALPHA_ARB 0x859A
+#define GL_RGB_SCALE_ARB 0x8573
+#define GL_ADD_SIGNED_ARB 0x8574
+#define GL_INTERPOLATE_ARB 0x8575
+#define GL_SUBTRACT_ARB 0x84E7
+#define GL_CONSTANT_ARB 0x8576
+#define GL_PRIMARY_COLOR_ARB 0x8577
+#define GL_PREVIOUS_ARB 0x8578
+#endif /* GL_ARB_texture_env_combine */
-#ifndef GL_SGIX_async_pixel
-#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C
-#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D
-#define GL_ASYNC_READ_PIXELS_SGIX 0x835E
-#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F
-#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360
-#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361
-#endif
+#ifndef GL_ARB_texture_env_crossbar
+#define GL_ARB_texture_env_crossbar 1
+#endif /* GL_ARB_texture_env_crossbar */
-#ifndef GL_SGIX_async_histogram
-#define GL_ASYNC_HISTOGRAM_SGIX 0x832C
-#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D
-#endif
+#ifndef GL_ARB_texture_env_dot3
+#define GL_ARB_texture_env_dot3 1
+#define GL_DOT3_RGB_ARB 0x86AE
+#define GL_DOT3_RGBA_ARB 0x86AF
+#endif /* GL_ARB_texture_env_dot3 */
-#ifndef GL_INTEL_texture_scissor
-#endif
+#ifndef GL_ARB_texture_float
+#define GL_ARB_texture_float 1
+#define GL_TEXTURE_RED_TYPE_ARB 0x8C10
+#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11
+#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12
+#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13
+#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14
+#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15
+#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16
+#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17
+#define GL_RGBA32F_ARB 0x8814
+#define GL_RGB32F_ARB 0x8815
+#define GL_ALPHA32F_ARB 0x8816
+#define GL_INTENSITY32F_ARB 0x8817
+#define GL_LUMINANCE32F_ARB 0x8818
+#define GL_LUMINANCE_ALPHA32F_ARB 0x8819
+#define GL_RGBA16F_ARB 0x881A
+#define GL_RGB16F_ARB 0x881B
+#define GL_ALPHA16F_ARB 0x881C
+#define GL_INTENSITY16F_ARB 0x881D
+#define GL_LUMINANCE16F_ARB 0x881E
+#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
+#endif /* GL_ARB_texture_float */
-#ifndef GL_INTEL_parallel_arrays
-#define GL_PARALLEL_ARRAYS_INTEL 0x83F4
-#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
-#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
-#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
-#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
-#endif
+#ifndef GL_ARB_texture_gather
+#define GL_ARB_texture_gather 1
+#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E
+#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F
+#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F
+#endif /* GL_ARB_texture_gather */
-#ifndef GL_HP_occlusion_test
-#define GL_OCCLUSION_TEST_HP 0x8165
-#define GL_OCCLUSION_TEST_RESULT_HP 0x8166
-#endif
+#ifndef GL_ARB_texture_mirror_clamp_to_edge
+#define GL_ARB_texture_mirror_clamp_to_edge 1
+#endif /* GL_ARB_texture_mirror_clamp_to_edge */
-#ifndef GL_EXT_pixel_transform
-#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330
-#define GL_PIXEL_MAG_FILTER_EXT 0x8331
-#define GL_PIXEL_MIN_FILTER_EXT 0x8332
-#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333
-#define GL_CUBIC_EXT 0x8334
-#define GL_AVERAGE_EXT 0x8335
-#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
-#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
-#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338
-#endif
+#ifndef GL_ARB_texture_mirrored_repeat
+#define GL_ARB_texture_mirrored_repeat 1
+#define GL_MIRRORED_REPEAT_ARB 0x8370
+#endif /* GL_ARB_texture_mirrored_repeat */
-#ifndef GL_EXT_pixel_transform_color_table
-#endif
+#ifndef GL_ARB_texture_multisample
+#define GL_ARB_texture_multisample 1
+#endif /* GL_ARB_texture_multisample */
-#ifndef GL_EXT_shared_texture_palette
-#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
-#endif
+#ifndef GL_ARB_texture_non_power_of_two
+#define GL_ARB_texture_non_power_of_two 1
+#endif /* GL_ARB_texture_non_power_of_two */
-#ifndef GL_EXT_separate_specular_color
-#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8
-#define GL_SINGLE_COLOR_EXT 0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
-#endif
+#ifndef GL_ARB_texture_query_levels
+#define GL_ARB_texture_query_levels 1
+#endif /* GL_ARB_texture_query_levels */
-#ifndef GL_EXT_secondary_color
-#define GL_COLOR_SUM_EXT 0x8458
-#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
-#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
-#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
-#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
-#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
-#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E
-#endif
+#ifndef GL_ARB_texture_query_lod
+#define GL_ARB_texture_query_lod 1
+#endif /* GL_ARB_texture_query_lod */
-#ifndef GL_EXT_texture_perturb_normal
-#define GL_PERTURB_EXT 0x85AE
-#define GL_TEXTURE_NORMAL_EXT 0x85AF
-#endif
+#ifndef GL_ARB_texture_rectangle
+#define GL_ARB_texture_rectangle 1
+#define GL_TEXTURE_RECTANGLE_ARB 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
+#endif /* GL_ARB_texture_rectangle */
-#ifndef GL_EXT_multi_draw_arrays
-#endif
+#ifndef GL_ARB_texture_rg
+#define GL_ARB_texture_rg 1
+#endif /* GL_ARB_texture_rg */
-#ifndef GL_EXT_fog_coord
-#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450
-#define GL_FOG_COORDINATE_EXT 0x8451
-#define GL_FRAGMENT_DEPTH_EXT 0x8452
-#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453
-#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454
-#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
-#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
-#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457
-#endif
+#ifndef GL_ARB_texture_rgb10_a2ui
+#define GL_ARB_texture_rgb10_a2ui 1
+#endif /* GL_ARB_texture_rgb10_a2ui */
-#ifndef GL_REND_screen_coordinates
-#define GL_SCREEN_COORDINATES_REND 0x8490
-#define GL_INVERTED_SCREEN_W_REND 0x8491
-#endif
+#ifndef GL_ARB_texture_stencil8
+#define GL_ARB_texture_stencil8 1
+#endif /* GL_ARB_texture_stencil8 */
-#ifndef GL_EXT_coordinate_frame
-#define GL_TANGENT_ARRAY_EXT 0x8439
-#define GL_BINORMAL_ARRAY_EXT 0x843A
-#define GL_CURRENT_TANGENT_EXT 0x843B
-#define GL_CURRENT_BINORMAL_EXT 0x843C
-#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E
-#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F
-#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440
-#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441
-#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442
-#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443
-#define GL_MAP1_TANGENT_EXT 0x8444
-#define GL_MAP2_TANGENT_EXT 0x8445
-#define GL_MAP1_BINORMAL_EXT 0x8446
-#define GL_MAP2_BINORMAL_EXT 0x8447
-#endif
+#ifndef GL_ARB_texture_storage
+#define GL_ARB_texture_storage 1
+#endif /* GL_ARB_texture_storage */
-#ifndef GL_EXT_texture_env_combine
-#define GL_COMBINE_EXT 0x8570
-#define GL_COMBINE_RGB_EXT 0x8571
-#define GL_COMBINE_ALPHA_EXT 0x8572
-#define GL_RGB_SCALE_EXT 0x8573
-#define GL_ADD_SIGNED_EXT 0x8574
-#define GL_INTERPOLATE_EXT 0x8575
-#define GL_CONSTANT_EXT 0x8576
-#define GL_PRIMARY_COLOR_EXT 0x8577
-#define GL_PREVIOUS_EXT 0x8578
-#define GL_SOURCE0_RGB_EXT 0x8580
-#define GL_SOURCE1_RGB_EXT 0x8581
-#define GL_SOURCE2_RGB_EXT 0x8582
-#define GL_SOURCE0_ALPHA_EXT 0x8588
-#define GL_SOURCE1_ALPHA_EXT 0x8589
-#define GL_SOURCE2_ALPHA_EXT 0x858A
-#define GL_OPERAND0_RGB_EXT 0x8590
-#define GL_OPERAND1_RGB_EXT 0x8591
-#define GL_OPERAND2_RGB_EXT 0x8592
-#define GL_OPERAND0_ALPHA_EXT 0x8598
-#define GL_OPERAND1_ALPHA_EXT 0x8599
-#define GL_OPERAND2_ALPHA_EXT 0x859A
-#endif
+#ifndef GL_ARB_texture_storage_multisample
+#define GL_ARB_texture_storage_multisample 1
+#endif /* GL_ARB_texture_storage_multisample */
-#ifndef GL_APPLE_specular_vector
-#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
-#endif
+#ifndef GL_ARB_texture_swizzle
+#define GL_ARB_texture_swizzle 1
+#endif /* GL_ARB_texture_swizzle */
-#ifndef GL_APPLE_transform_hint
-#define GL_TRANSFORM_HINT_APPLE 0x85B1
-#endif
+#ifndef GL_ARB_texture_view
+#define GL_ARB_texture_view 1
+#endif /* GL_ARB_texture_view */
-#ifndef GL_SGIX_fog_scale
-#define GL_FOG_SCALE_SGIX 0x81FC
-#define GL_FOG_SCALE_VALUE_SGIX 0x81FD
-#endif
+#ifndef GL_ARB_timer_query
+#define GL_ARB_timer_query 1
+#endif /* GL_ARB_timer_query */
-#ifndef GL_SUNX_constant_data
-#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5
-#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6
-#endif
+#ifndef GL_ARB_transform_feedback2
+#define GL_ARB_transform_feedback2 1
+#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23
+#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24
+#endif /* GL_ARB_transform_feedback2 */
-#ifndef GL_SUN_global_alpha
-#define GL_GLOBAL_ALPHA_SUN 0x81D9
-#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA
-#endif
+#ifndef GL_ARB_transform_feedback3
+#define GL_ARB_transform_feedback3 1
+#endif /* GL_ARB_transform_feedback3 */
-#ifndef GL_SUN_triangle_list
-#define GL_RESTART_SUN 0x0001
-#define GL_REPLACE_MIDDLE_SUN 0x0002
-#define GL_REPLACE_OLDEST_SUN 0x0003
-#define GL_TRIANGLE_LIST_SUN 0x81D7
-#define GL_REPLACEMENT_CODE_SUN 0x81D8
-#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0
-#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
-#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
-#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
-#define GL_R1UI_V3F_SUN 0x85C4
-#define GL_R1UI_C4UB_V3F_SUN 0x85C5
-#define GL_R1UI_C3F_V3F_SUN 0x85C6
-#define GL_R1UI_N3F_V3F_SUN 0x85C7
-#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8
-#define GL_R1UI_T2F_V3F_SUN 0x85C9
-#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA
-#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB
-#endif
+#ifndef GL_ARB_transform_feedback_instanced
+#define GL_ARB_transform_feedback_instanced 1
+#endif /* GL_ARB_transform_feedback_instanced */
-#ifndef GL_SUN_vertex
+#ifndef GL_ARB_transpose_matrix
+#define GL_ARB_transpose_matrix 1
+#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m);
+GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m);
+GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m);
+GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m);
#endif
+#endif /* GL_ARB_transpose_matrix */
-#ifndef GL_EXT_blend_func_separate
-#define GL_BLEND_DST_RGB_EXT 0x80C8
-#define GL_BLEND_SRC_RGB_EXT 0x80C9
-#define GL_BLEND_DST_ALPHA_EXT 0x80CA
-#define GL_BLEND_SRC_ALPHA_EXT 0x80CB
-#endif
+#ifndef GL_ARB_uniform_buffer_object
+#define GL_ARB_uniform_buffer_object 1
+#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
+#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
+#endif /* GL_ARB_uniform_buffer_object */
-#ifndef GL_INGR_color_clamp
-#define GL_RED_MIN_CLAMP_INGR 0x8560
-#define GL_GREEN_MIN_CLAMP_INGR 0x8561
-#define GL_BLUE_MIN_CLAMP_INGR 0x8562
-#define GL_ALPHA_MIN_CLAMP_INGR 0x8563
-#define GL_RED_MAX_CLAMP_INGR 0x8564
-#define GL_GREEN_MAX_CLAMP_INGR 0x8565
-#define GL_BLUE_MAX_CLAMP_INGR 0x8566
-#define GL_ALPHA_MAX_CLAMP_INGR 0x8567
-#endif
+#ifndef GL_ARB_vertex_array_bgra
+#define GL_ARB_vertex_array_bgra 1
+#endif /* GL_ARB_vertex_array_bgra */
-#ifndef GL_INGR_interlace_read
-#define GL_INTERLACE_READ_INGR 0x8568
-#endif
+#ifndef GL_ARB_vertex_array_object
+#define GL_ARB_vertex_array_object 1
+#endif /* GL_ARB_vertex_array_object */
-#ifndef GL_EXT_stencil_wrap
-#define GL_INCR_WRAP_EXT 0x8507
-#define GL_DECR_WRAP_EXT 0x8508
-#endif
+#ifndef GL_ARB_vertex_attrib_64bit
+#define GL_ARB_vertex_attrib_64bit 1
+#endif /* GL_ARB_vertex_attrib_64bit */
-#ifndef GL_EXT_422_pixels
-#define GL_422_EXT 0x80CC
-#define GL_422_REV_EXT 0x80CD
-#define GL_422_AVERAGE_EXT 0x80CE
-#define GL_422_REV_AVERAGE_EXT 0x80CF
-#endif
+#ifndef GL_ARB_vertex_attrib_binding
+#define GL_ARB_vertex_attrib_binding 1
+#endif /* GL_ARB_vertex_attrib_binding */
-#ifndef GL_NV_texgen_reflection
-#define GL_NORMAL_MAP_NV 0x8511
-#define GL_REFLECTION_MAP_NV 0x8512
+#ifndef GL_ARB_vertex_blend
+#define GL_ARB_vertex_blend 1
+#define GL_MAX_VERTEX_UNITS_ARB 0x86A4
+#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5
+#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6
+#define GL_VERTEX_BLEND_ARB 0x86A7
+#define GL_CURRENT_WEIGHT_ARB 0x86A8
+#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9
+#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA
+#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB
+#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC
+#define GL_WEIGHT_ARRAY_ARB 0x86AD
+#define GL_MODELVIEW0_ARB 0x1700
+#define GL_MODELVIEW1_ARB 0x850A
+#define GL_MODELVIEW2_ARB 0x8722
+#define GL_MODELVIEW3_ARB 0x8723
+#define GL_MODELVIEW4_ARB 0x8724
+#define GL_MODELVIEW5_ARB 0x8725
+#define GL_MODELVIEW6_ARB 0x8726
+#define GL_MODELVIEW7_ARB 0x8727
+#define GL_MODELVIEW8_ARB 0x8728
+#define GL_MODELVIEW9_ARB 0x8729
+#define GL_MODELVIEW10_ARB 0x872A
+#define GL_MODELVIEW11_ARB 0x872B
+#define GL_MODELVIEW12_ARB 0x872C
+#define GL_MODELVIEW13_ARB 0x872D
+#define GL_MODELVIEW14_ARB 0x872E
+#define GL_MODELVIEW15_ARB 0x872F
+#define GL_MODELVIEW16_ARB 0x8730
+#define GL_MODELVIEW17_ARB 0x8731
+#define GL_MODELVIEW18_ARB 0x8732
+#define GL_MODELVIEW19_ARB 0x8733
+#define GL_MODELVIEW20_ARB 0x8734
+#define GL_MODELVIEW21_ARB 0x8735
+#define GL_MODELVIEW22_ARB 0x8736
+#define GL_MODELVIEW23_ARB 0x8737
+#define GL_MODELVIEW24_ARB 0x8738
+#define GL_MODELVIEW25_ARB 0x8739
+#define GL_MODELVIEW26_ARB 0x873A
+#define GL_MODELVIEW27_ARB 0x873B
+#define GL_MODELVIEW28_ARB 0x873C
+#define GL_MODELVIEW29_ARB 0x873D
+#define GL_MODELVIEW30_ARB 0x873E
+#define GL_MODELVIEW31_ARB 0x873F
+typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
+typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer);
+typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights);
+GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights);
+GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights);
+GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights);
+GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights);
+GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights);
+GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights);
+GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights);
+GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer);
+GLAPI void APIENTRY glVertexBlendARB (GLint count);
#endif
+#endif /* GL_ARB_vertex_blend */
-#ifndef GL_EXT_texture_cube_map
-#define GL_NORMAL_MAP_EXT 0x8511
-#define GL_REFLECTION_MAP_EXT 0x8512
-#define GL_TEXTURE_CUBE_MAP_EXT 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_ARB_vertex_buffer_object 1
+typedef ptrdiff_t GLsizeiptrARB;
+typedef ptrdiff_t GLintptrARB;
+#define GL_BUFFER_SIZE_ARB 0x8764
+#define GL_BUFFER_USAGE_ARB 0x8765
+#define GL_ARRAY_BUFFER_ARB 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893
+#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
+#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
+#define GL_READ_ONLY_ARB 0x88B8
+#define GL_WRITE_ONLY_ARB 0x88B9
+#define GL_READ_WRITE_ARB 0x88BA
+#define GL_BUFFER_ACCESS_ARB 0x88BB
+#define GL_BUFFER_MAPPED_ARB 0x88BC
+#define GL_BUFFER_MAP_POINTER_ARB 0x88BD
+#define GL_STREAM_DRAW_ARB 0x88E0
+#define GL_STREAM_READ_ARB 0x88E1
+#define GL_STREAM_COPY_ARB 0x88E2
+#define GL_STATIC_DRAW_ARB 0x88E4
+#define GL_STATIC_READ_ARB 0x88E5
+#define GL_STATIC_COPY_ARB 0x88E6
+#define GL_DYNAMIC_DRAW_ARB 0x88E8
+#define GL_DYNAMIC_READ_ARB 0x88E9
+#define GL_DYNAMIC_COPY_ARB 0x88EA
+typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data);
+typedef void *(APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, void **params);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer);
+GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers);
+GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers);
+GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer);
+GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage);
+GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data);
+GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data);
+GLAPI void *APIENTRY glMapBufferARB (GLenum target, GLenum access);
+GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target);
+GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, void **params);
#endif
+#endif /* GL_ARB_vertex_buffer_object */
-#ifndef GL_SUN_convolution_border_modes
-#define GL_WRAP_BORDER_SUN 0x81D4
+#ifndef GL_ARB_vertex_program
+#define GL_ARB_vertex_program 1
+#define GL_COLOR_SUM_ARB 0x8458
+#define GL_VERTEX_PROGRAM_ARB 0x8620
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625
+#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626
+#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
+#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
+#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0
+#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
+#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
+#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, void **pointer);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x);
+GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x);
+GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y);
+GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index);
+GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index);
+GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, void **pointer);
#endif
+#endif /* GL_ARB_vertex_program */
-#ifndef GL_EXT_texture_env_add
+#ifndef GL_ARB_vertex_shader
+#define GL_ARB_vertex_shader 1
+#define GL_VERTEX_SHADER_ARB 0x8B31
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
+#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
+#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89
+#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name);
+GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name);
#endif
+#endif /* GL_ARB_vertex_shader */
-#ifndef GL_EXT_texture_lod_bias
-#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
-#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
-#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
-#endif
+#ifndef GL_ARB_vertex_type_10f_11f_11f_rev
+#define GL_ARB_vertex_type_10f_11f_11f_rev 1
+#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
-#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
-#endif
+#ifndef GL_ARB_vertex_type_2_10_10_10_rev
+#define GL_ARB_vertex_type_2_10_10_10_rev 1
+#endif /* GL_ARB_vertex_type_2_10_10_10_rev */
-#ifndef GL_EXT_vertex_weighting
-#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH
-#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502
-#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX
-#define GL_MODELVIEW1_MATRIX_EXT 0x8506
-#define GL_VERTEX_WEIGHTING_EXT 0x8509
-#define GL_MODELVIEW0_EXT GL_MODELVIEW
-#define GL_MODELVIEW1_EXT 0x850A
-#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B
-#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C
-#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D
-#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E
-#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
-#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
-#endif
+#ifndef GL_ARB_viewport_array
+#define GL_ARB_viewport_array 1
+#endif /* GL_ARB_viewport_array */
-#ifndef GL_NV_light_max_exponent
-#define GL_MAX_SHININESS_NV 0x8504
-#define GL_MAX_SPOT_EXPONENT_NV 0x8505
+#ifndef GL_ARB_window_pos
+#define GL_ARB_window_pos 1
+typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y);
+GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y);
+GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y);
+GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v);
+GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y);
+GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v);
+GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v);
+GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v);
#endif
+#endif /* GL_ARB_window_pos */
+
+#ifndef GL_KHR_debug
+#define GL_KHR_debug 1
+#endif /* GL_KHR_debug */
+
+#ifndef GL_KHR_texture_compression_astc_hdr
+#define GL_KHR_texture_compression_astc_hdr 1
+#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0
+#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1
+#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2
+#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3
+#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4
+#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5
+#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6
+#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7
+#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8
+#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9
+#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA
+#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB
+#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC
+#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD
+#endif /* GL_KHR_texture_compression_astc_hdr */
+
+#ifndef GL_KHR_texture_compression_astc_ldr
+#define GL_KHR_texture_compression_astc_ldr 1
+#endif /* GL_KHR_texture_compression_astc_ldr */
+
+#ifndef GL_OES_byte_coordinates
+#define GL_OES_byte_coordinates 1
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1BOESPROC) (GLenum texture, GLbyte s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1BVOESPROC) (GLenum texture, const GLbyte *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2BOESPROC) (GLenum texture, GLbyte s, GLbyte t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2BVOESPROC) (GLenum texture, const GLbyte *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3BOESPROC) (GLenum texture, GLbyte s, GLbyte t, GLbyte r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3BVOESPROC) (GLenum texture, const GLbyte *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4BOESPROC) (GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4BVOESPROC) (GLenum texture, const GLbyte *coords);
+typedef void (APIENTRYP PFNGLTEXCOORD1BOESPROC) (GLbyte s);
+typedef void (APIENTRYP PFNGLTEXCOORD1BVOESPROC) (const GLbyte *coords);
+typedef void (APIENTRYP PFNGLTEXCOORD2BOESPROC) (GLbyte s, GLbyte t);
+typedef void (APIENTRYP PFNGLTEXCOORD2BVOESPROC) (const GLbyte *coords);
+typedef void (APIENTRYP PFNGLTEXCOORD3BOESPROC) (GLbyte s, GLbyte t, GLbyte r);
+typedef void (APIENTRYP PFNGLTEXCOORD3BVOESPROC) (const GLbyte *coords);
+typedef void (APIENTRYP PFNGLTEXCOORD4BOESPROC) (GLbyte s, GLbyte t, GLbyte r, GLbyte q);
+typedef void (APIENTRYP PFNGLTEXCOORD4BVOESPROC) (const GLbyte *coords);
+typedef void (APIENTRYP PFNGLVERTEX2BOESPROC) (GLbyte x);
+typedef void (APIENTRYP PFNGLVERTEX2BVOESPROC) (const GLbyte *coords);
+typedef void (APIENTRYP PFNGLVERTEX3BOESPROC) (GLbyte x, GLbyte y);
+typedef void (APIENTRYP PFNGLVERTEX3BVOESPROC) (const GLbyte *coords);
+typedef void (APIENTRYP PFNGLVERTEX4BOESPROC) (GLbyte x, GLbyte y, GLbyte z);
+typedef void (APIENTRYP PFNGLVERTEX4BVOESPROC) (const GLbyte *coords);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiTexCoord1bOES (GLenum texture, GLbyte s);
+GLAPI void APIENTRY glMultiTexCoord1bvOES (GLenum texture, const GLbyte *coords);
+GLAPI void APIENTRY glMultiTexCoord2bOES (GLenum texture, GLbyte s, GLbyte t);
+GLAPI void APIENTRY glMultiTexCoord2bvOES (GLenum texture, const GLbyte *coords);
+GLAPI void APIENTRY glMultiTexCoord3bOES (GLenum texture, GLbyte s, GLbyte t, GLbyte r);
+GLAPI void APIENTRY glMultiTexCoord3bvOES (GLenum texture, const GLbyte *coords);
+GLAPI void APIENTRY glMultiTexCoord4bOES (GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q);
+GLAPI void APIENTRY glMultiTexCoord4bvOES (GLenum texture, const GLbyte *coords);
+GLAPI void APIENTRY glTexCoord1bOES (GLbyte s);
+GLAPI void APIENTRY glTexCoord1bvOES (const GLbyte *coords);
+GLAPI void APIENTRY glTexCoord2bOES (GLbyte s, GLbyte t);
+GLAPI void APIENTRY glTexCoord2bvOES (const GLbyte *coords);
+GLAPI void APIENTRY glTexCoord3bOES (GLbyte s, GLbyte t, GLbyte r);
+GLAPI void APIENTRY glTexCoord3bvOES (const GLbyte *coords);
+GLAPI void APIENTRY glTexCoord4bOES (GLbyte s, GLbyte t, GLbyte r, GLbyte q);
+GLAPI void APIENTRY glTexCoord4bvOES (const GLbyte *coords);
+GLAPI void APIENTRY glVertex2bOES (GLbyte x);
+GLAPI void APIENTRY glVertex2bvOES (const GLbyte *coords);
+GLAPI void APIENTRY glVertex3bOES (GLbyte x, GLbyte y);
+GLAPI void APIENTRY glVertex3bvOES (const GLbyte *coords);
+GLAPI void APIENTRY glVertex4bOES (GLbyte x, GLbyte y, GLbyte z);
+GLAPI void APIENTRY glVertex4bvOES (const GLbyte *coords);
+#endif
+#endif /* GL_OES_byte_coordinates */
+
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_OES_compressed_paletted_texture 1
+#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 /* GL_OES_compressed_paletted_texture */
+
+#ifndef GL_OES_fixed_point
+#define GL_OES_fixed_point 1
+typedef GLint GLfixed;
+#define GL_FIXED_OES 0x140C
+typedef void (APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLfixed ref);
+typedef void (APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+typedef void (APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLfixed depth);
+typedef void (APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation);
+typedef void (APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+typedef void (APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLfixed n, GLfixed f);
+typedef void (APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param);
+typedef void (APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *param);
+typedef void (APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
+typedef void (APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum plane, GLfixed *equation);
+typedef void (APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params);
+typedef void (APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum target, GLenum pname, GLfixed *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params);
+typedef void (APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param);
+typedef void (APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *param);
+typedef void (APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param);
+typedef void (APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params);
+typedef void (APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width);
+typedef void (APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m);
+typedef void (APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param);
+typedef void (APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *param);
+typedef void (APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+typedef void (APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz);
+typedef void (APIENTRYP PFNGLORTHOXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params);
+typedef void (APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size);
+typedef void (APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units);
+typedef void (APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEOESPROC) (GLfixed value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z);
+typedef void (APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param);
+typedef void (APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
+typedef void (APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param);
+typedef void (APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
+typedef void (APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z);
+typedef void (APIENTRYP PFNGLACCUMXOESPROC) (GLenum op, GLfixed value);
+typedef void (APIENTRYP PFNGLBITMAPXOESPROC) (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte *bitmap);
+typedef void (APIENTRYP PFNGLBLENDCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+typedef void (APIENTRYP PFNGLCLEARACCUMXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+typedef void (APIENTRYP PFNGLCOLOR3XOESPROC) (GLfixed red, GLfixed green, GLfixed blue);
+typedef void (APIENTRYP PFNGLCOLOR3XVOESPROC) (const GLfixed *components);
+typedef void (APIENTRYP PFNGLCOLOR4XVOESPROC) (const GLfixed *components);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
+typedef void (APIENTRYP PFNGLEVALCOORD1XOESPROC) (GLfixed u);
+typedef void (APIENTRYP PFNGLEVALCOORD1XVOESPROC) (const GLfixed *coords);
+typedef void (APIENTRYP PFNGLEVALCOORD2XOESPROC) (GLfixed u, GLfixed v);
+typedef void (APIENTRYP PFNGLEVALCOORD2XVOESPROC) (const GLfixed *coords);
+typedef void (APIENTRYP PFNGLFEEDBACKBUFFERXOESPROC) (GLsizei n, GLenum type, const GLfixed *buffer);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params);
+typedef void (APIENTRYP PFNGLGETLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed *params);
+typedef void (APIENTRYP PFNGLGETMAPXVOESPROC) (GLenum target, GLenum query, GLfixed *v);
+typedef void (APIENTRYP PFNGLGETMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param);
+typedef void (APIENTRYP PFNGLGETPIXELMAPXVPROC) (GLenum map, GLint size, GLfixed *values);
+typedef void (APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params);
+typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERXVOESPROC) (GLenum target, GLint level, GLenum pname, GLfixed *params);
+typedef void (APIENTRYP PFNGLINDEXXOESPROC) (GLfixed component);
+typedef void (APIENTRYP PFNGLINDEXXVOESPROC) (const GLfixed *component);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXXOESPROC) (const GLfixed *m);
+typedef void (APIENTRYP PFNGLMAP1XOESPROC) (GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points);
+typedef void (APIENTRYP PFNGLMAP2XOESPROC) (GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points);
+typedef void (APIENTRYP PFNGLMAPGRID1XOESPROC) (GLint n, GLfixed u1, GLfixed u2);
+typedef void (APIENTRYP PFNGLMAPGRID2XOESPROC) (GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXXOESPROC) (const GLfixed *m);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1XOESPROC) (GLenum texture, GLfixed s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1XVOESPROC) (GLenum texture, const GLfixed *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2XOESPROC) (GLenum texture, GLfixed s, GLfixed t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2XVOESPROC) (GLenum texture, const GLfixed *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3XVOESPROC) (GLenum texture, const GLfixed *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4XVOESPROC) (GLenum texture, const GLfixed *coords);
+typedef void (APIENTRYP PFNGLNORMAL3XVOESPROC) (const GLfixed *coords);
+typedef void (APIENTRYP PFNGLPASSTHROUGHXOESPROC) (GLfixed token);
+typedef void (APIENTRYP PFNGLPIXELMAPXPROC) (GLenum map, GLint size, const GLfixed *values);
+typedef void (APIENTRYP PFNGLPIXELSTOREXPROC) (GLenum pname, GLfixed param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFERXOESPROC) (GLenum pname, GLfixed param);
+typedef void (APIENTRYP PFNGLPIXELZOOMXOESPROC) (GLfixed xfactor, GLfixed yfactor);
+typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESXOESPROC) (GLsizei n, const GLuint *textures, const GLfixed *priorities);
+typedef void (APIENTRYP PFNGLRASTERPOS2XOESPROC) (GLfixed x, GLfixed y);
+typedef void (APIENTRYP PFNGLRASTERPOS2XVOESPROC) (const GLfixed *coords);
+typedef void (APIENTRYP PFNGLRASTERPOS3XOESPROC) (GLfixed x, GLfixed y, GLfixed z);
+typedef void (APIENTRYP PFNGLRASTERPOS3XVOESPROC) (const GLfixed *coords);
+typedef void (APIENTRYP PFNGLRASTERPOS4XOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed w);
+typedef void (APIENTRYP PFNGLRASTERPOS4XVOESPROC) (const GLfixed *coords);
+typedef void (APIENTRYP PFNGLRECTXOESPROC) (GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2);
+typedef void (APIENTRYP PFNGLRECTXVOESPROC) (const GLfixed *v1, const GLfixed *v2);
+typedef void (APIENTRYP PFNGLTEXCOORD1XOESPROC) (GLfixed s);
+typedef void (APIENTRYP PFNGLTEXCOORD1XVOESPROC) (const GLfixed *coords);
+typedef void (APIENTRYP PFNGLTEXCOORD2XOESPROC) (GLfixed s, GLfixed t);
+typedef void (APIENTRYP PFNGLTEXCOORD2XVOESPROC) (const GLfixed *coords);
+typedef void (APIENTRYP PFNGLTEXCOORD3XOESPROC) (GLfixed s, GLfixed t, GLfixed r);
+typedef void (APIENTRYP PFNGLTEXCOORD3XVOESPROC) (const GLfixed *coords);
+typedef void (APIENTRYP PFNGLTEXCOORD4XOESPROC) (GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+typedef void (APIENTRYP PFNGLTEXCOORD4XVOESPROC) (const GLfixed *coords);
+typedef void (APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param);
+typedef void (APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params);
+typedef void (APIENTRYP PFNGLVERTEX2XOESPROC) (GLfixed x);
+typedef void (APIENTRYP PFNGLVERTEX2XVOESPROC) (const GLfixed *coords);
+typedef void (APIENTRYP PFNGLVERTEX3XOESPROC) (GLfixed x, GLfixed y);
+typedef void (APIENTRYP PFNGLVERTEX3XVOESPROC) (const GLfixed *coords);
+typedef void (APIENTRYP PFNGLVERTEX4XOESPROC) (GLfixed x, GLfixed y, GLfixed z);
+typedef void (APIENTRYP PFNGLVERTEX4XVOESPROC) (const GLfixed *coords);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glAlphaFuncxOES (GLenum func, GLfixed ref);
+GLAPI void APIENTRY glClearColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+GLAPI void APIENTRY glClearDepthxOES (GLfixed depth);
+GLAPI void APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation);
+GLAPI void APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+GLAPI void APIENTRY glDepthRangexOES (GLfixed n, GLfixed f);
+GLAPI void APIENTRY glFogxOES (GLenum pname, GLfixed param);
+GLAPI void APIENTRY glFogxvOES (GLenum pname, const GLfixed *param);
+GLAPI void APIENTRY glFrustumxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
+GLAPI void APIENTRY glGetClipPlanexOES (GLenum plane, GLfixed *equation);
+GLAPI void APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params);
+GLAPI void APIENTRY glGetTexEnvxvOES (GLenum target, GLenum pname, GLfixed *params);
+GLAPI void APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params);
+GLAPI void APIENTRY glLightModelxOES (GLenum pname, GLfixed param);
+GLAPI void APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *param);
+GLAPI void APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param);
+GLAPI void APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params);
+GLAPI void APIENTRY glLineWidthxOES (GLfixed width);
+GLAPI void APIENTRY glLoadMatrixxOES (const GLfixed *m);
+GLAPI void APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param);
+GLAPI void APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *param);
+GLAPI void APIENTRY glMultMatrixxOES (const GLfixed *m);
+GLAPI void APIENTRY glMultiTexCoord4xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+GLAPI void APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz);
+GLAPI void APIENTRY glOrthoxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
+GLAPI void APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params);
+GLAPI void APIENTRY glPointSizexOES (GLfixed size);
+GLAPI void APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units);
+GLAPI void APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+GLAPI void APIENTRY glSampleCoverageOES (GLfixed value, GLboolean invert);
+GLAPI void APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z);
+GLAPI void APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param);
+GLAPI void APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params);
+GLAPI void APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param);
+GLAPI void APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params);
+GLAPI void APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z);
+GLAPI void APIENTRY glAccumxOES (GLenum op, GLfixed value);
+GLAPI void APIENTRY glBitmapxOES (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte *bitmap);
+GLAPI void APIENTRY glBlendColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+GLAPI void APIENTRY glClearAccumxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+GLAPI void APIENTRY glColor3xOES (GLfixed red, GLfixed green, GLfixed blue);
+GLAPI void APIENTRY glColor3xvOES (const GLfixed *components);
+GLAPI void APIENTRY glColor4xvOES (const GLfixed *components);
+GLAPI void APIENTRY glConvolutionParameterxOES (GLenum target, GLenum pname, GLfixed param);
+GLAPI void APIENTRY glConvolutionParameterxvOES (GLenum target, GLenum pname, const GLfixed *params);
+GLAPI void APIENTRY glEvalCoord1xOES (GLfixed u);
+GLAPI void APIENTRY glEvalCoord1xvOES (const GLfixed *coords);
+GLAPI void APIENTRY glEvalCoord2xOES (GLfixed u, GLfixed v);
+GLAPI void APIENTRY glEvalCoord2xvOES (const GLfixed *coords);
+GLAPI void APIENTRY glFeedbackBufferxOES (GLsizei n, GLenum type, const GLfixed *buffer);
+GLAPI void APIENTRY glGetConvolutionParameterxvOES (GLenum target, GLenum pname, GLfixed *params);
+GLAPI void APIENTRY glGetHistogramParameterxvOES (GLenum target, GLenum pname, GLfixed *params);
+GLAPI void APIENTRY glGetLightxOES (GLenum light, GLenum pname, GLfixed *params);
+GLAPI void APIENTRY glGetMapxvOES (GLenum target, GLenum query, GLfixed *v);
+GLAPI void APIENTRY glGetMaterialxOES (GLenum face, GLenum pname, GLfixed param);
+GLAPI void APIENTRY glGetPixelMapxv (GLenum map, GLint size, GLfixed *values);
+GLAPI void APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params);
+GLAPI void APIENTRY glGetTexLevelParameterxvOES (GLenum target, GLint level, GLenum pname, GLfixed *params);
+GLAPI void APIENTRY glIndexxOES (GLfixed component);
+GLAPI void APIENTRY glIndexxvOES (const GLfixed *component);
+GLAPI void APIENTRY glLoadTransposeMatrixxOES (const GLfixed *m);
+GLAPI void APIENTRY glMap1xOES (GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points);
+GLAPI void APIENTRY glMap2xOES (GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points);
+GLAPI void APIENTRY glMapGrid1xOES (GLint n, GLfixed u1, GLfixed u2);
+GLAPI void APIENTRY glMapGrid2xOES (GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2);
+GLAPI void APIENTRY glMultTransposeMatrixxOES (const GLfixed *m);
+GLAPI void APIENTRY glMultiTexCoord1xOES (GLenum texture, GLfixed s);
+GLAPI void APIENTRY glMultiTexCoord1xvOES (GLenum texture, const GLfixed *coords);
+GLAPI void APIENTRY glMultiTexCoord2xOES (GLenum texture, GLfixed s, GLfixed t);
+GLAPI void APIENTRY glMultiTexCoord2xvOES (GLenum texture, const GLfixed *coords);
+GLAPI void APIENTRY glMultiTexCoord3xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r);
+GLAPI void APIENTRY glMultiTexCoord3xvOES (GLenum texture, const GLfixed *coords);
+GLAPI void APIENTRY glMultiTexCoord4xvOES (GLenum texture, const GLfixed *coords);
+GLAPI void APIENTRY glNormal3xvOES (const GLfixed *coords);
+GLAPI void APIENTRY glPassThroughxOES (GLfixed token);
+GLAPI void APIENTRY glPixelMapx (GLenum map, GLint size, const GLfixed *values);
+GLAPI void APIENTRY glPixelStorex (GLenum pname, GLfixed param);
+GLAPI void APIENTRY glPixelTransferxOES (GLenum pname, GLfixed param);
+GLAPI void APIENTRY glPixelZoomxOES (GLfixed xfactor, GLfixed yfactor);
+GLAPI void APIENTRY glPrioritizeTexturesxOES (GLsizei n, const GLuint *textures, const GLfixed *priorities);
+GLAPI void APIENTRY glRasterPos2xOES (GLfixed x, GLfixed y);
+GLAPI void APIENTRY glRasterPos2xvOES (const GLfixed *coords);
+GLAPI void APIENTRY glRasterPos3xOES (GLfixed x, GLfixed y, GLfixed z);
+GLAPI void APIENTRY glRasterPos3xvOES (const GLfixed *coords);
+GLAPI void APIENTRY glRasterPos4xOES (GLfixed x, GLfixed y, GLfixed z, GLfixed w);
+GLAPI void APIENTRY glRasterPos4xvOES (const GLfixed *coords);
+GLAPI void APIENTRY glRectxOES (GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2);
+GLAPI void APIENTRY glRectxvOES (const GLfixed *v1, const GLfixed *v2);
+GLAPI void APIENTRY glTexCoord1xOES (GLfixed s);
+GLAPI void APIENTRY glTexCoord1xvOES (const GLfixed *coords);
+GLAPI void APIENTRY glTexCoord2xOES (GLfixed s, GLfixed t);
+GLAPI void APIENTRY glTexCoord2xvOES (const GLfixed *coords);
+GLAPI void APIENTRY glTexCoord3xOES (GLfixed s, GLfixed t, GLfixed r);
+GLAPI void APIENTRY glTexCoord3xvOES (const GLfixed *coords);
+GLAPI void APIENTRY glTexCoord4xOES (GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+GLAPI void APIENTRY glTexCoord4xvOES (const GLfixed *coords);
+GLAPI void APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param);
+GLAPI void APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params);
+GLAPI void APIENTRY glVertex2xOES (GLfixed x);
+GLAPI void APIENTRY glVertex2xvOES (const GLfixed *coords);
+GLAPI void APIENTRY glVertex3xOES (GLfixed x, GLfixed y);
+GLAPI void APIENTRY glVertex3xvOES (const GLfixed *coords);
+GLAPI void APIENTRY glVertex4xOES (GLfixed x, GLfixed y, GLfixed z);
+GLAPI void APIENTRY glVertex4xvOES (const GLfixed *coords);
+#endif
+#endif /* GL_OES_fixed_point */
+
+#ifndef GL_OES_query_matrix
+#define GL_OES_query_matrix 1
+typedef GLbitfield (APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed *mantissa, GLint *exponent);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLbitfield APIENTRY glQueryMatrixxOES (GLfixed *mantissa, GLint *exponent);
+#endif
+#endif /* GL_OES_query_matrix */
-#ifndef GL_NV_vertex_array_range
-#define GL_VERTEX_ARRAY_RANGE_NV 0x851D
-#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E
-#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F
-#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
-#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521
-#endif
+#ifndef GL_OES_read_format
+#define GL_OES_read_format 1
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
+#endif /* GL_OES_read_format */
+
+#ifndef GL_OES_single_precision
+#define GL_OES_single_precision 1
+typedef void (APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth);
+typedef void (APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation);
+typedef void (APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f);
+typedef void (APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
+typedef void (APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat *equation);
+typedef void (APIENTRYP PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glClearDepthfOES (GLclampf depth);
+GLAPI void APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation);
+GLAPI void APIENTRY glDepthRangefOES (GLclampf n, GLclampf f);
+GLAPI void APIENTRY glFrustumfOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
+GLAPI void APIENTRY glGetClipPlanefOES (GLenum plane, GLfloat *equation);
+GLAPI void APIENTRY glOrthofOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
+#endif
+#endif /* GL_OES_single_precision */
-#ifndef GL_NV_register_combiners
-#define GL_REGISTER_COMBINERS_NV 0x8522
-#define GL_VARIABLE_A_NV 0x8523
-#define GL_VARIABLE_B_NV 0x8524
-#define GL_VARIABLE_C_NV 0x8525
-#define GL_VARIABLE_D_NV 0x8526
-#define GL_VARIABLE_E_NV 0x8527
-#define GL_VARIABLE_F_NV 0x8528
-#define GL_VARIABLE_G_NV 0x8529
-#define GL_CONSTANT_COLOR0_NV 0x852A
-#define GL_CONSTANT_COLOR1_NV 0x852B
-#define GL_PRIMARY_COLOR_NV 0x852C
-#define GL_SECONDARY_COLOR_NV 0x852D
-#define GL_SPARE0_NV 0x852E
-#define GL_SPARE1_NV 0x852F
-#define GL_DISCARD_NV 0x8530
-#define GL_E_TIMES_F_NV 0x8531
-#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
-#define GL_UNSIGNED_IDENTITY_NV 0x8536
-#define GL_UNSIGNED_INVERT_NV 0x8537
-#define GL_EXPAND_NORMAL_NV 0x8538
-#define GL_EXPAND_NEGATE_NV 0x8539
-#define GL_HALF_BIAS_NORMAL_NV 0x853A
-#define GL_HALF_BIAS_NEGATE_NV 0x853B
-#define GL_SIGNED_IDENTITY_NV 0x853C
-#define GL_SIGNED_NEGATE_NV 0x853D
-#define GL_SCALE_BY_TWO_NV 0x853E
-#define GL_SCALE_BY_FOUR_NV 0x853F
-#define GL_SCALE_BY_ONE_HALF_NV 0x8540
-#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541
-#define GL_COMBINER_INPUT_NV 0x8542
-#define GL_COMBINER_MAPPING_NV 0x8543
-#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544
-#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545
-#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546
-#define GL_COMBINER_MUX_SUM_NV 0x8547
-#define GL_COMBINER_SCALE_NV 0x8548
-#define GL_COMBINER_BIAS_NV 0x8549
-#define GL_COMBINER_AB_OUTPUT_NV 0x854A
-#define GL_COMBINER_CD_OUTPUT_NV 0x854B
-#define GL_COMBINER_SUM_OUTPUT_NV 0x854C
-#define GL_MAX_GENERAL_COMBINERS_NV 0x854D
-#define GL_NUM_GENERAL_COMBINERS_NV 0x854E
-#define GL_COLOR_SUM_CLAMP_NV 0x854F
-#define GL_COMBINER0_NV 0x8550
-#define GL_COMBINER1_NV 0x8551
-#define GL_COMBINER2_NV 0x8552
-#define GL_COMBINER3_NV 0x8553
-#define GL_COMBINER4_NV 0x8554
-#define GL_COMBINER5_NV 0x8555
-#define GL_COMBINER6_NV 0x8556
-#define GL_COMBINER7_NV 0x8557
-/* reuse GL_TEXTURE0_ARB */
-/* reuse GL_TEXTURE1_ARB */
-/* reuse GL_ZERO */
-/* reuse GL_NONE */
-/* reuse GL_FOG */
-#endif
+#ifndef GL_3DFX_multisample
+#define GL_3DFX_multisample 1
+#define GL_MULTISAMPLE_3DFX 0x86B2
+#define GL_SAMPLE_BUFFERS_3DFX 0x86B3
+#define GL_SAMPLES_3DFX 0x86B4
+#define GL_MULTISAMPLE_BIT_3DFX 0x20000000
+#endif /* GL_3DFX_multisample */
-#ifndef GL_NV_fog_distance
-#define GL_FOG_DISTANCE_MODE_NV 0x855A
-#define GL_EYE_RADIAL_NV 0x855B
-#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C
-/* reuse GL_EYE_PLANE */
+#ifndef GL_3DFX_tbuffer
+#define GL_3DFX_tbuffer 1
+typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask);
#endif
+#endif /* GL_3DFX_tbuffer */
-#ifndef GL_NV_texgen_emboss
-#define GL_EMBOSS_LIGHT_NV 0x855D
-#define GL_EMBOSS_CONSTANT_NV 0x855E
-#define GL_EMBOSS_MAP_NV 0x855F
-#endif
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_3DFX_texture_compression_FXT1 1
+#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
+#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
+#endif /* GL_3DFX_texture_compression_FXT1 */
-#ifndef GL_NV_blend_square
-#endif
+#ifndef GL_AMD_blend_minmax_factor
+#define GL_AMD_blend_minmax_factor 1
+#define GL_FACTOR_MIN_AMD 0x901C
+#define GL_FACTOR_MAX_AMD 0x901D
+#endif /* GL_AMD_blend_minmax_factor */
-#ifndef GL_NV_texture_env_combine4
-#define GL_COMBINE4_NV 0x8503
-#define GL_SOURCE3_RGB_NV 0x8583
-#define GL_SOURCE3_ALPHA_NV 0x858B
-#define GL_OPERAND3_RGB_NV 0x8593
-#define GL_OPERAND3_ALPHA_NV 0x859B
-#endif
+#ifndef GL_AMD_conservative_depth
+#define GL_AMD_conservative_depth 1
+#endif /* GL_AMD_conservative_depth */
-#ifndef GL_MESA_resize_buffers
+#ifndef GL_AMD_debug_output
+#define GL_AMD_debug_output 1
+typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam);
+#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143
+#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144
+#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145
+#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146
+#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147
+#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148
+#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149
+#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A
+#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B
+#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C
+#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D
+#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E
+#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F
+#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150
+typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void *userParam);
+typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
+GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, void *userParam);
+GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
#endif
+#endif /* GL_AMD_debug_output */
-#ifndef GL_MESA_window_pos
-#endif
+#ifndef GL_AMD_depth_clamp_separate
+#define GL_AMD_depth_clamp_separate 1
+#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E
+#define GL_DEPTH_CLAMP_FAR_AMD 0x901F
+#endif /* GL_AMD_depth_clamp_separate */
-#ifndef GL_EXT_texture_compression_s3tc
-#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
-#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
-#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
+#ifndef GL_AMD_draw_buffers_blend
+#define GL_AMD_draw_buffers_blend 1
+typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst);
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst);
+GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode);
+GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
#endif
+#endif /* GL_AMD_draw_buffers_blend */
-#ifndef GL_IBM_cull_vertex
-#define GL_CULL_VERTEX_IBM 103050
-#endif
+#ifndef GL_AMD_gcn_shader
+#define GL_AMD_gcn_shader 1
+#endif /* GL_AMD_gcn_shader */
-#ifndef GL_IBM_multimode_draw_arrays
+#ifndef GL_AMD_gpu_shader_int64
+#define GL_AMD_gpu_shader_int64 1
+typedef int64_t GLint64EXT;
+#define GL_INT64_NV 0x140E
+#define GL_UNSIGNED_INT64_NV 0x140F
+#define GL_INT8_NV 0x8FE0
+#define GL_INT8_VEC2_NV 0x8FE1
+#define GL_INT8_VEC3_NV 0x8FE2
+#define GL_INT8_VEC4_NV 0x8FE3
+#define GL_INT16_NV 0x8FE4
+#define GL_INT16_VEC2_NV 0x8FE5
+#define GL_INT16_VEC3_NV 0x8FE6
+#define GL_INT16_VEC4_NV 0x8FE7
+#define GL_INT64_VEC2_NV 0x8FE9
+#define GL_INT64_VEC3_NV 0x8FEA
+#define GL_INT64_VEC4_NV 0x8FEB
+#define GL_UNSIGNED_INT8_NV 0x8FEC
+#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED
+#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE
+#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF
+#define GL_UNSIGNED_INT16_NV 0x8FF0
+#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1
+#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2
+#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3
+#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5
+#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6
+#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7
+#define GL_FLOAT16_NV 0x8FF8
+#define GL_FLOAT16_VEC2_NV 0x8FF9
+#define GL_FLOAT16_VEC3_NV 0x8FFA
+#define GL_FLOAT16_VEC4_NV 0x8FFB
+typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x);
+typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y);
+typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x);
+typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y);
+typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x);
+GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y);
+GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x);
+GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y);
+GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params);
+GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params);
+GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x);
+GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
+GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x);
+GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
+GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
#endif
+#endif /* GL_AMD_gpu_shader_int64 */
-#ifndef GL_IBM_vertex_array_lists
-#define GL_VERTEX_ARRAY_LIST_IBM 103070
-#define GL_NORMAL_ARRAY_LIST_IBM 103071
-#define GL_COLOR_ARRAY_LIST_IBM 103072
-#define GL_INDEX_ARRAY_LIST_IBM 103073
-#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074
-#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075
-#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076
-#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
-#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080
-#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081
-#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082
-#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083
-#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
-#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
-#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
-#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
+#ifndef GL_AMD_interleaved_elements
+#define GL_AMD_interleaved_elements 1
+#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4
+#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribParameteriAMD (GLuint index, GLenum pname, GLint param);
#endif
+#endif /* GL_AMD_interleaved_elements */
-#ifndef GL_SGIX_subsample
-#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0
-#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1
-#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2
-#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3
-#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4
+#ifndef GL_AMD_multi_draw_indirect
+#define GL_AMD_multi_draw_indirect 1
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride);
+GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride);
#endif
+#endif /* GL_AMD_multi_draw_indirect */
-#ifndef GL_SGIX_ycrcb_subsample
+#ifndef GL_AMD_name_gen_delete
+#define GL_AMD_name_gen_delete 1
+#define GL_DATA_BUFFER_AMD 0x9151
+#define GL_PERFORMANCE_MONITOR_AMD 0x9152
+#define GL_QUERY_OBJECT_AMD 0x9153
+#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154
+#define GL_SAMPLER_OBJECT_AMD 0x9155
+typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names);
+typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names);
+typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names);
+GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names);
+GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name);
#endif
+#endif /* GL_AMD_name_gen_delete */
-#ifndef GL_SGIX_ycrcba
-#define GL_YCRCB_SGIX 0x8318
-#define GL_YCRCBA_SGIX 0x8319
+#ifndef GL_AMD_occlusion_query_event
+#define GL_AMD_occlusion_query_event 1
+#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F
+#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001
+#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002
+#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004
+#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008
+#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF
+typedef void (APIENTRYP PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glQueryObjectParameteruiAMD (GLenum target, GLuint id, GLenum pname, GLuint param);
#endif
+#endif /* GL_AMD_occlusion_query_event */
-#ifndef GL_SGI_depth_pass_instrument
-#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310
-#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311
-#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312
+#ifndef GL_AMD_performance_monitor
+#define GL_AMD_performance_monitor 1
+#define GL_COUNTER_TYPE_AMD 0x8BC0
+#define GL_COUNTER_RANGE_AMD 0x8BC1
+#define GL_UNSIGNED_INT64_AMD 0x8BC2
+#define GL_PERCENTAGE_AMD 0x8BC3
+#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4
+#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5
+#define GL_PERFMON_RESULT_AMD 0x8BC6
+typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
+typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
+typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data);
+typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
+typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
+typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
+typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
+typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
+typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
+GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
+GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data);
+GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);
+GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);
+GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
+GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor);
+GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor);
+GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
#endif
+#endif /* GL_AMD_performance_monitor */
-#ifndef GL_3DFX_texture_compression_FXT1
-#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
-#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
-#endif
+#ifndef GL_AMD_pinned_memory
+#define GL_AMD_pinned_memory 1
+#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160
+#endif /* GL_AMD_pinned_memory */
-#ifndef GL_3DFX_multisample
-#define GL_MULTISAMPLE_3DFX 0x86B2
-#define GL_SAMPLE_BUFFERS_3DFX 0x86B3
-#define GL_SAMPLES_3DFX 0x86B4
-#define GL_MULTISAMPLE_BIT_3DFX 0x20000000
-#endif
+#ifndef GL_AMD_query_buffer_object
+#define GL_AMD_query_buffer_object 1
+#define GL_QUERY_BUFFER_AMD 0x9192
+#define GL_QUERY_BUFFER_BINDING_AMD 0x9193
+#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194
+#endif /* GL_AMD_query_buffer_object */
-#ifndef GL_3DFX_tbuffer
+#ifndef GL_AMD_sample_positions
+#define GL_AMD_sample_positions 1
+#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F
+typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val);
#endif
+#endif /* GL_AMD_sample_positions */
-#ifndef GL_EXT_multisample
-#define GL_MULTISAMPLE_EXT 0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F
-#define GL_SAMPLE_MASK_EXT 0x80A0
-#define GL_1PASS_EXT 0x80A1
-#define GL_2PASS_0_EXT 0x80A2
-#define GL_2PASS_1_EXT 0x80A3
-#define GL_4PASS_0_EXT 0x80A4
-#define GL_4PASS_1_EXT 0x80A5
-#define GL_4PASS_2_EXT 0x80A6
-#define GL_4PASS_3_EXT 0x80A7
-#define GL_SAMPLE_BUFFERS_EXT 0x80A8
-#define GL_SAMPLES_EXT 0x80A9
-#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA
-#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB
-#define GL_SAMPLE_PATTERN_EXT 0x80AC
-#define GL_MULTISAMPLE_BIT_EXT 0x20000000
-#endif
+#ifndef GL_AMD_seamless_cubemap_per_texture
+#define GL_AMD_seamless_cubemap_per_texture 1
+#endif /* GL_AMD_seamless_cubemap_per_texture */
-#ifndef GL_SGIX_vertex_preclip
-#define GL_VERTEX_PRECLIP_SGIX 0x83EE
-#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF
-#endif
+#ifndef GL_AMD_shader_atomic_counter_ops
+#define GL_AMD_shader_atomic_counter_ops 1
+#endif /* GL_AMD_shader_atomic_counter_ops */
-#ifndef GL_SGIX_convolution_accuracy
-#define GL_CONVOLUTION_HINT_SGIX 0x8316
-#endif
+#ifndef GL_AMD_shader_stencil_export
+#define GL_AMD_shader_stencil_export 1
+#endif /* GL_AMD_shader_stencil_export */
+
+#ifndef GL_AMD_shader_trinary_minmax
+#define GL_AMD_shader_trinary_minmax 1
+#endif /* GL_AMD_shader_trinary_minmax */
+
+#ifndef GL_AMD_sparse_texture
+#define GL_AMD_sparse_texture 1
+#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195
+#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196
+#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197
+#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198
+#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199
+#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A
+#define GL_MIN_SPARSE_LEVEL_AMD 0x919B
+#define GL_MIN_LOD_WARNING_AMD 0x919C
+#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001
+typedef void (APIENTRYP PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexStorageSparseAMD (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);
+GLAPI void APIENTRY glTextureStorageSparseAMD (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);
+#endif
+#endif /* GL_AMD_sparse_texture */
+
+#ifndef GL_AMD_stencil_operation_extended
+#define GL_AMD_stencil_operation_extended 1
+#define GL_SET_AMD 0x874A
+#define GL_REPLACE_VALUE_AMD 0x874B
+#define GL_STENCIL_OP_VALUE_AMD 0x874C
+#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D
+typedef void (APIENTRYP PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStencilOpValueAMD (GLenum face, GLuint value);
+#endif
+#endif /* GL_AMD_stencil_operation_extended */
-#ifndef GL_SGIX_resample
-#define GL_PACK_RESAMPLE_SGIX 0x842C
-#define GL_UNPACK_RESAMPLE_SGIX 0x842D
-#define GL_RESAMPLE_REPLICATE_SGIX 0x842E
-#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F
-#define GL_RESAMPLE_DECIMATE_SGIX 0x8430
-#endif
+#ifndef GL_AMD_texture_texture4
+#define GL_AMD_texture_texture4 1
+#endif /* GL_AMD_texture_texture4 */
-#ifndef GL_SGIS_point_line_texgen
-#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0
-#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1
-#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2
-#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3
-#define GL_EYE_POINT_SGIS 0x81F4
-#define GL_OBJECT_POINT_SGIS 0x81F5
-#define GL_EYE_LINE_SGIS 0x81F6
-#define GL_OBJECT_LINE_SGIS 0x81F7
-#endif
+#ifndef GL_AMD_transform_feedback3_lines_triangles
+#define GL_AMD_transform_feedback3_lines_triangles 1
+#endif /* GL_AMD_transform_feedback3_lines_triangles */
-#ifndef GL_SGIS_texture_color_mask
-#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF
-#endif
+#ifndef GL_AMD_transform_feedback4
+#define GL_AMD_transform_feedback4 1
+#define GL_STREAM_RASTERIZATION_AMD 0x91A0
+#endif /* GL_AMD_transform_feedback4 */
-#ifndef GL_EXT_texture_env_dot3
-#define GL_DOT3_RGB_EXT 0x8740
-#define GL_DOT3_RGBA_EXT 0x8741
-#endif
+#ifndef GL_AMD_vertex_shader_layer
+#define GL_AMD_vertex_shader_layer 1
+#endif /* GL_AMD_vertex_shader_layer */
-#ifndef GL_ATI_texture_mirror_once
-#define GL_MIRROR_CLAMP_ATI 0x8742
-#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743
+#ifndef GL_AMD_vertex_shader_tessellator
+#define GL_AMD_vertex_shader_tessellator 1
+#define GL_SAMPLER_BUFFER_AMD 0x9001
+#define GL_INT_SAMPLER_BUFFER_AMD 0x9002
+#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003
+#define GL_TESSELLATION_MODE_AMD 0x9004
+#define GL_TESSELLATION_FACTOR_AMD 0x9005
+#define GL_DISCRETE_AMD 0x9006
+#define GL_CONTINUOUS_AMD 0x9007
+typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor);
+typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor);
+GLAPI void APIENTRY glTessellationModeAMD (GLenum mode);
#endif
+#endif /* GL_AMD_vertex_shader_tessellator */
-#ifndef GL_NV_fence
-#define GL_ALL_COMPLETED_NV 0x84F2
-#define GL_FENCE_STATUS_NV 0x84F3
-#define GL_FENCE_CONDITION_NV 0x84F4
-#endif
+#ifndef GL_AMD_vertex_shader_viewport_index
+#define GL_AMD_vertex_shader_viewport_index 1
+#endif /* GL_AMD_vertex_shader_viewport_index */
-#ifndef GL_IBM_texture_mirrored_repeat
-#define GL_MIRRORED_REPEAT_IBM 0x8370
-#endif
+#ifndef GL_APPLE_aux_depth_stencil
+#define GL_APPLE_aux_depth_stencil 1
+#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14
+#endif /* GL_APPLE_aux_depth_stencil */
-#ifndef GL_NV_evaluators
-#define GL_EVAL_2D_NV 0x86C0
-#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1
-#define GL_MAP_TESSELLATION_NV 0x86C2
-#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3
-#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4
-#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
-#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6
-#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7
-#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8
-#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9
-#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA
-#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB
-#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC
-#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD
-#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE
-#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF
-#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0
-#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1
-#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2
-#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3
-#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4
-#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5
-#define GL_MAX_MAP_TESSELLATION_NV 0x86D6
-#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7
-#endif
+#ifndef GL_APPLE_client_storage
+#define GL_APPLE_client_storage 1
+#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
+#endif /* GL_APPLE_client_storage */
-#ifndef GL_NV_packed_depth_stencil
-#define GL_DEPTH_STENCIL_NV 0x84F9
-#define GL_UNSIGNED_INT_24_8_NV 0x84FA
+#ifndef GL_APPLE_element_array
+#define GL_APPLE_element_array 1
+#define GL_ELEMENT_ARRAY_APPLE 0x8A0C
+#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D
+#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E
+typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const void *pointer);
+GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count);
+GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
+GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
#endif
+#endif /* GL_APPLE_element_array */
-#ifndef GL_NV_register_combiners2
-#define GL_PER_STAGE_CONSTANTS_NV 0x8535
+#ifndef GL_APPLE_fence
+#define GL_APPLE_fence 1
+#define GL_DRAW_PIXELS_APPLE 0x8A0A
+#define GL_FENCE_APPLE 0x8A0B
+typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);
+typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
+typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences);
+GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences);
+GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence);
+GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence);
+GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence);
+GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence);
+GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name);
+GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name);
#endif
+#endif /* GL_APPLE_fence */
-#ifndef GL_NV_texture_compression_vtc
-#endif
+#ifndef GL_APPLE_float_pixels
+#define GL_APPLE_float_pixels 1
+#define GL_HALF_APPLE 0x140B
+#define GL_RGBA_FLOAT32_APPLE 0x8814
+#define GL_RGB_FLOAT32_APPLE 0x8815
+#define GL_ALPHA_FLOAT32_APPLE 0x8816
+#define GL_INTENSITY_FLOAT32_APPLE 0x8817
+#define GL_LUMINANCE_FLOAT32_APPLE 0x8818
+#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819
+#define GL_RGBA_FLOAT16_APPLE 0x881A
+#define GL_RGB_FLOAT16_APPLE 0x881B
+#define GL_ALPHA_FLOAT16_APPLE 0x881C
+#define GL_INTENSITY_FLOAT16_APPLE 0x881D
+#define GL_LUMINANCE_FLOAT16_APPLE 0x881E
+#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F
+#define GL_COLOR_FLOAT_APPLE 0x8A0F
+#endif /* GL_APPLE_float_pixels */
-#ifndef GL_NV_texture_rectangle
-#define GL_TEXTURE_RECTANGLE_NV 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8
+#ifndef GL_APPLE_flush_buffer_range
+#define GL_APPLE_flush_buffer_range 1
+#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12
+#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13
+typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size);
#endif
+#endif /* GL_APPLE_flush_buffer_range */
-#ifndef GL_NV_texture_shader
-#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C
-#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
-#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
-#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
-#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
-#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
-#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
-#define GL_SHADER_CONSISTENT_NV 0x86DD
-#define GL_TEXTURE_SHADER_NV 0x86DE
-#define GL_SHADER_OPERATION_NV 0x86DF
-#define GL_CULL_MODES_NV 0x86E0
-#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1
-#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2
-#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3
-#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV
-#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV
-#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV
-#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4
-#define GL_CONST_EYE_NV 0x86E5
-#define GL_PASS_THROUGH_NV 0x86E6
-#define GL_CULL_FRAGMENT_NV 0x86E7
-#define GL_OFFSET_TEXTURE_2D_NV 0x86E8
-#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9
-#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA
-#define GL_DOT_PRODUCT_NV 0x86EC
-#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED
-#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE
-#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
-#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
-#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
-#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
-#define GL_HILO_NV 0x86F4
-#define GL_DSDT_NV 0x86F5
-#define GL_DSDT_MAG_NV 0x86F6
-#define GL_DSDT_MAG_VIB_NV 0x86F7
-#define GL_HILO16_NV 0x86F8
-#define GL_SIGNED_HILO_NV 0x86F9
-#define GL_SIGNED_HILO16_NV 0x86FA
-#define GL_SIGNED_RGBA_NV 0x86FB
-#define GL_SIGNED_RGBA8_NV 0x86FC
-#define GL_SIGNED_RGB_NV 0x86FE
-#define GL_SIGNED_RGB8_NV 0x86FF
-#define GL_SIGNED_LUMINANCE_NV 0x8701
-#define GL_SIGNED_LUMINANCE8_NV 0x8702
-#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
-#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
-#define GL_SIGNED_ALPHA_NV 0x8705
-#define GL_SIGNED_ALPHA8_NV 0x8706
-#define GL_SIGNED_INTENSITY_NV 0x8707
-#define GL_SIGNED_INTENSITY8_NV 0x8708
-#define GL_DSDT8_NV 0x8709
-#define GL_DSDT8_MAG8_NV 0x870A
-#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
-#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
-#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
-#define GL_HI_SCALE_NV 0x870E
-#define GL_LO_SCALE_NV 0x870F
-#define GL_DS_SCALE_NV 0x8710
-#define GL_DT_SCALE_NV 0x8711
-#define GL_MAGNITUDE_SCALE_NV 0x8712
-#define GL_VIBRANCE_SCALE_NV 0x8713
-#define GL_HI_BIAS_NV 0x8714
-#define GL_LO_BIAS_NV 0x8715
-#define GL_DS_BIAS_NV 0x8716
-#define GL_DT_BIAS_NV 0x8717
-#define GL_MAGNITUDE_BIAS_NV 0x8718
-#define GL_VIBRANCE_BIAS_NV 0x8719
-#define GL_TEXTURE_BORDER_VALUES_NV 0x871A
-#define GL_TEXTURE_HI_SIZE_NV 0x871B
-#define GL_TEXTURE_LO_SIZE_NV 0x871C
-#define GL_TEXTURE_DS_SIZE_NV 0x871D
-#define GL_TEXTURE_DT_SIZE_NV 0x871E
-#define GL_TEXTURE_MAG_SIZE_NV 0x871F
+#ifndef GL_APPLE_object_purgeable
+#define GL_APPLE_object_purgeable 1
+#define GL_BUFFER_OBJECT_APPLE 0x85B3
+#define GL_RELEASED_APPLE 0x8A19
+#define GL_VOLATILE_APPLE 0x8A1A
+#define GL_RETAINED_APPLE 0x8A1B
+#define GL_UNDEFINED_APPLE 0x8A1C
+#define GL_PURGEABLE_APPLE 0x8A1D
+typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
+typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option);
+GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option);
+GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params);
#endif
+#endif /* GL_APPLE_object_purgeable */
-#ifndef GL_NV_texture_shader2
-#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF
-#endif
+#ifndef GL_APPLE_rgb_422
+#define GL_APPLE_rgb_422 1
+#define GL_RGB_422_APPLE 0x8A1F
+#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
+#define GL_RGB_RAW_422_APPLE 0x8A51
+#endif /* GL_APPLE_rgb_422 */
-#ifndef GL_NV_vertex_array_range2
-#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
-#endif
+#ifndef GL_APPLE_row_bytes
+#define GL_APPLE_row_bytes 1
+#define GL_PACK_ROW_BYTES_APPLE 0x8A15
+#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16
+#endif /* GL_APPLE_row_bytes */
-#ifndef GL_NV_vertex_program
-#define GL_VERTEX_PROGRAM_NV 0x8620
-#define GL_VERTEX_STATE_PROGRAM_NV 0x8621
-#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623
-#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624
-#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625
-#define GL_CURRENT_ATTRIB_NV 0x8626
-#define GL_PROGRAM_LENGTH_NV 0x8627
-#define GL_PROGRAM_STRING_NV 0x8628
-#define GL_MODELVIEW_PROJECTION_NV 0x8629
-#define GL_IDENTITY_NV 0x862A
-#define GL_INVERSE_NV 0x862B
-#define GL_TRANSPOSE_NV 0x862C
-#define GL_INVERSE_TRANSPOSE_NV 0x862D
-#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
-#define GL_MAX_TRACK_MATRICES_NV 0x862F
-#define GL_MATRIX0_NV 0x8630
-#define GL_MATRIX1_NV 0x8631
-#define GL_MATRIX2_NV 0x8632
-#define GL_MATRIX3_NV 0x8633
-#define GL_MATRIX4_NV 0x8634
-#define GL_MATRIX5_NV 0x8635
-#define GL_MATRIX6_NV 0x8636
-#define GL_MATRIX7_NV 0x8637
-#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640
-#define GL_CURRENT_MATRIX_NV 0x8641
-#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643
-#define GL_PROGRAM_PARAMETER_NV 0x8644
-#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645
-#define GL_PROGRAM_TARGET_NV 0x8646
-#define GL_PROGRAM_RESIDENT_NV 0x8647
-#define GL_TRACK_MATRIX_NV 0x8648
-#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649
-#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A
-#define GL_PROGRAM_ERROR_POSITION_NV 0x864B
-#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650
-#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651
-#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652
-#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653
-#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654
-#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655
-#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656
-#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657
-#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658
-#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659
-#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A
-#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B
-#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C
-#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D
-#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E
-#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F
-#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660
-#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661
-#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662
-#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663
-#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664
-#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665
-#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666
-#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667
-#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668
-#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669
-#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A
-#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B
-#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C
-#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D
-#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E
-#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F
-#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670
-#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671
-#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672
-#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673
-#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674
-#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675
-#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676
-#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677
-#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678
-#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679
-#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A
-#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B
-#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C
-#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D
-#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E
-#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F
-#endif
+#ifndef GL_APPLE_specular_vector
+#define GL_APPLE_specular_vector 1
+#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
+#endif /* GL_APPLE_specular_vector */
-#ifndef GL_SGIX_texture_coordinate_clamp
-#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369
-#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A
-#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B
+#ifndef GL_APPLE_texture_range
+#define GL_APPLE_texture_range 1
+#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7
+#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8
+#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC
+#define GL_STORAGE_PRIVATE_APPLE 0x85BD
+#define GL_STORAGE_CACHED_APPLE 0x85BE
+#define GL_STORAGE_SHARED_APPLE 0x85BF
+typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const void *pointer);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, void **params);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const void *pointer);
+GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, void **params);
#endif
+#endif /* GL_APPLE_texture_range */
-#ifndef GL_SGIX_scalebias_hint
-#define GL_SCALEBIAS_HINT_SGIX 0x8322
+#ifndef GL_APPLE_transform_hint
+#define GL_APPLE_transform_hint 1
+#define GL_TRANSFORM_HINT_APPLE 0x85B1
+#endif /* GL_APPLE_transform_hint */
+
+#ifndef GL_APPLE_vertex_array_object
+#define GL_APPLE_vertex_array_object 1
+#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5
+typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
+typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
+typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
+typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array);
+GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays);
+GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays);
+GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array);
#endif
+#endif /* GL_APPLE_vertex_array_object */
-#ifndef GL_OML_interlace
-#define GL_INTERLACE_OML 0x8980
-#define GL_INTERLACE_READ_OML 0x8981
+#ifndef GL_APPLE_vertex_array_range
+#define GL_APPLE_vertex_array_range 1
+#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
+#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
+#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
+#define GL_STORAGE_CLIENT_APPLE 0x85B4
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer);
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer);
+typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, void *pointer);
+GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, void *pointer);
+GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param);
#endif
+#endif /* GL_APPLE_vertex_array_range */
-#ifndef GL_OML_subsample
-#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982
-#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983
+#ifndef GL_APPLE_vertex_program_evaluators
+#define GL_APPLE_vertex_program_evaluators 1
+#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00
+#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01
+#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02
+#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03
+#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04
+#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05
+#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06
+#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07
+#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08
+#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
+typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname);
+typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
+typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
+typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
+typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname);
+GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname);
+GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname);
+GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
+GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
+GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
+GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
#endif
+#endif /* GL_APPLE_vertex_program_evaluators */
-#ifndef GL_OML_resample
-#define GL_PACK_RESAMPLE_OML 0x8984
-#define GL_UNPACK_RESAMPLE_OML 0x8985
-#define GL_RESAMPLE_REPLICATE_OML 0x8986
-#define GL_RESAMPLE_ZERO_FILL_OML 0x8987
-#define GL_RESAMPLE_AVERAGE_OML 0x8988
-#define GL_RESAMPLE_DECIMATE_OML 0x8989
+#ifndef GL_APPLE_ycbcr_422
+#define GL_APPLE_ycbcr_422 1
+#define GL_YCBCR_422_APPLE 0x85B9
+#endif /* GL_APPLE_ycbcr_422 */
+
+#ifndef GL_ATI_draw_buffers
+#define GL_ATI_draw_buffers 1
+#define GL_MAX_DRAW_BUFFERS_ATI 0x8824
+#define GL_DRAW_BUFFER0_ATI 0x8825
+#define GL_DRAW_BUFFER1_ATI 0x8826
+#define GL_DRAW_BUFFER2_ATI 0x8827
+#define GL_DRAW_BUFFER3_ATI 0x8828
+#define GL_DRAW_BUFFER4_ATI 0x8829
+#define GL_DRAW_BUFFER5_ATI 0x882A
+#define GL_DRAW_BUFFER6_ATI 0x882B
+#define GL_DRAW_BUFFER7_ATI 0x882C
+#define GL_DRAW_BUFFER8_ATI 0x882D
+#define GL_DRAW_BUFFER9_ATI 0x882E
+#define GL_DRAW_BUFFER10_ATI 0x882F
+#define GL_DRAW_BUFFER11_ATI 0x8830
+#define GL_DRAW_BUFFER12_ATI 0x8831
+#define GL_DRAW_BUFFER13_ATI 0x8832
+#define GL_DRAW_BUFFER14_ATI 0x8833
+#define GL_DRAW_BUFFER15_ATI 0x8834
+typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs);
#endif
+#endif /* GL_ATI_draw_buffers */
-#ifndef GL_NV_copy_depth_to_color
-#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
-#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F
+#ifndef GL_ATI_element_array
+#define GL_ATI_element_array 1
+#define GL_ELEMENT_ARRAY_ATI 0x8768
+#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
+#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
+typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerATI (GLenum type, const void *pointer);
+GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count);
+GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count);
#endif
+#endif /* GL_ATI_element_array */
#ifndef GL_ATI_envmap_bumpmap
+#define GL_ATI_envmap_bumpmap 1
#define GL_BUMP_ROT_MATRIX_ATI 0x8775
#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776
#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777
@@ -3627,9 +5361,20 @@ extern "C" {
#define GL_DU8DV8_ATI 0x877A
#define GL_BUMP_ENVMAP_ATI 0x877B
#define GL_BUMP_TARGET_ATI 0x877C
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param);
+GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param);
+GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param);
+GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param);
#endif
+#endif /* GL_ATI_envmap_bumpmap */
#ifndef GL_ATI_fragment_shader
+#define GL_ATI_fragment_shader 1
#define GL_FRAGMENT_SHADER_ATI 0x8920
#define GL_REG_0_ATI 0x8921
#define GL_REG_1_ATI 0x8922
@@ -3734,9 +5479,63 @@ extern "C" {
#define GL_COMP_BIT_ATI 0x00000002
#define GL_NEGATE_BIT_ATI 0x00000004
#define GL_BIAS_BIT_ATI 0x00000008
+typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
+typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range);
+GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id);
+GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id);
+GLAPI void APIENTRY glBeginFragmentShaderATI (void);
+GLAPI void APIENTRY glEndFragmentShaderATI (void);
+GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle);
+GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle);
+GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value);
+#endif
+#endif /* GL_ATI_fragment_shader */
+
+#ifndef GL_ATI_map_object_buffer
+#define GL_ATI_map_object_buffer 1
+typedef void *(APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void *APIENTRY glMapObjectBufferATI (GLuint buffer);
+GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer);
#endif
+#endif /* GL_ATI_map_object_buffer */
+
+#ifndef GL_ATI_meminfo
+#define GL_ATI_meminfo 1
+#define GL_VBO_FREE_MEMORY_ATI 0x87FB
+#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC
+#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD
+#endif /* GL_ATI_meminfo */
+
+#ifndef GL_ATI_pixel_format_float
+#define GL_ATI_pixel_format_float 1
+#define GL_RGBA_FLOAT_MODE_ATI 0x8820
+#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
+#endif /* GL_ATI_pixel_format_float */
#ifndef GL_ATI_pn_triangles
+#define GL_ATI_pn_triangles 1
#define GL_PN_TRIANGLES_ATI 0x87F0
#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2
@@ -3746,9 +5545,64 @@ extern "C" {
#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6
#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7
#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8
+typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param);
+GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param);
+#endif
+#endif /* GL_ATI_pn_triangles */
+
+#ifndef GL_ATI_separate_stencil
+#define GL_ATI_separate_stencil 1
+#define GL_STENCIL_BACK_FUNC_ATI 0x8800
+#define GL_STENCIL_BACK_FAIL_ATI 0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
#endif
+#endif /* GL_ATI_separate_stencil */
+
+#ifndef GL_ATI_text_fragment_shader
+#define GL_ATI_text_fragment_shader 1
+#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200
+#endif /* GL_ATI_text_fragment_shader */
+
+#ifndef GL_ATI_texture_env_combine3
+#define GL_ATI_texture_env_combine3 1
+#define GL_MODULATE_ADD_ATI 0x8744
+#define GL_MODULATE_SIGNED_ADD_ATI 0x8745
+#define GL_MODULATE_SUBTRACT_ATI 0x8746
+#endif /* GL_ATI_texture_env_combine3 */
+
+#ifndef GL_ATI_texture_float
+#define GL_ATI_texture_float 1
+#define GL_RGBA_FLOAT32_ATI 0x8814
+#define GL_RGB_FLOAT32_ATI 0x8815
+#define GL_ALPHA_FLOAT32_ATI 0x8816
+#define GL_INTENSITY_FLOAT32_ATI 0x8817
+#define GL_LUMINANCE_FLOAT32_ATI 0x8818
+#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
+#define GL_RGBA_FLOAT16_ATI 0x881A
+#define GL_RGB_FLOAT16_ATI 0x881B
+#define GL_ALPHA_FLOAT16_ATI 0x881C
+#define GL_INTENSITY_FLOAT16_ATI 0x881D
+#define GL_LUMINANCE_FLOAT16_ATI 0x881E
+#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
+#endif /* GL_ATI_texture_float */
+
+#ifndef GL_ATI_texture_mirror_once
+#define GL_ATI_texture_mirror_once 1
+#define GL_MIRROR_CLAMP_ATI 0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743
+#endif /* GL_ATI_texture_mirror_once */
#ifndef GL_ATI_vertex_array_object
+#define GL_ATI_vertex_array_object 1
#define GL_STATIC_ATI 0x8760
#define GL_DYNAMIC_ATI 0x8761
#define GL_PRESERVE_ATI 0x8762
@@ -3757,122 +5611,48 @@ extern "C" {
#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765
#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766
#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767
+typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void *pointer, GLenum usage);
+typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const void *pointer, GLenum usage);
+GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer);
+GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve);
+GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params);
+GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer);
+GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params);
+GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params);
#endif
+#endif /* GL_ATI_vertex_array_object */
-#ifndef GL_EXT_vertex_shader
-#define GL_VERTEX_SHADER_EXT 0x8780
-#define GL_VERTEX_SHADER_BINDING_EXT 0x8781
-#define GL_OP_INDEX_EXT 0x8782
-#define GL_OP_NEGATE_EXT 0x8783
-#define GL_OP_DOT3_EXT 0x8784
-#define GL_OP_DOT4_EXT 0x8785
-#define GL_OP_MUL_EXT 0x8786
-#define GL_OP_ADD_EXT 0x8787
-#define GL_OP_MADD_EXT 0x8788
-#define GL_OP_FRAC_EXT 0x8789
-#define GL_OP_MAX_EXT 0x878A
-#define GL_OP_MIN_EXT 0x878B
-#define GL_OP_SET_GE_EXT 0x878C
-#define GL_OP_SET_LT_EXT 0x878D
-#define GL_OP_CLAMP_EXT 0x878E
-#define GL_OP_FLOOR_EXT 0x878F
-#define GL_OP_ROUND_EXT 0x8790
-#define GL_OP_EXP_BASE_2_EXT 0x8791
-#define GL_OP_LOG_BASE_2_EXT 0x8792
-#define GL_OP_POWER_EXT 0x8793
-#define GL_OP_RECIP_EXT 0x8794
-#define GL_OP_RECIP_SQRT_EXT 0x8795
-#define GL_OP_SUB_EXT 0x8796
-#define GL_OP_CROSS_PRODUCT_EXT 0x8797
-#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798
-#define GL_OP_MOV_EXT 0x8799
-#define GL_OUTPUT_VERTEX_EXT 0x879A
-#define GL_OUTPUT_COLOR0_EXT 0x879B
-#define GL_OUTPUT_COLOR1_EXT 0x879C
-#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D
-#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E
-#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F
-#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0
-#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1
-#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2
-#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3
-#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4
-#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5
-#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6
-#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7
-#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8
-#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9
-#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA
-#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB
-#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC
-#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD
-#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE
-#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF
-#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0
-#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1
-#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2
-#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3
-#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4
-#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5
-#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6
-#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7
-#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8
-#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9
-#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA
-#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB
-#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC
-#define GL_OUTPUT_FOG_EXT 0x87BD
-#define GL_SCALAR_EXT 0x87BE
-#define GL_VECTOR_EXT 0x87BF
-#define GL_MATRIX_EXT 0x87C0
-#define GL_VARIANT_EXT 0x87C1
-#define GL_INVARIANT_EXT 0x87C2
-#define GL_LOCAL_CONSTANT_EXT 0x87C3
-#define GL_LOCAL_EXT 0x87C4
-#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
-#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
-#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
-#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
-#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
-#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
-#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0
-#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1
-#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
-#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3
-#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4
-#define GL_X_EXT 0x87D5
-#define GL_Y_EXT 0x87D6
-#define GL_Z_EXT 0x87D7
-#define GL_W_EXT 0x87D8
-#define GL_NEGATIVE_X_EXT 0x87D9
-#define GL_NEGATIVE_Y_EXT 0x87DA
-#define GL_NEGATIVE_Z_EXT 0x87DB
-#define GL_NEGATIVE_W_EXT 0x87DC
-#define GL_ZERO_EXT 0x87DD
-#define GL_ONE_EXT 0x87DE
-#define GL_NEGATIVE_ONE_EXT 0x87DF
-#define GL_NORMALIZED_RANGE_EXT 0x87E0
-#define GL_FULL_RANGE_EXT 0x87E1
-#define GL_CURRENT_VERTEX_EXT 0x87E2
-#define GL_MVP_MATRIX_EXT 0x87E3
-#define GL_VARIANT_VALUE_EXT 0x87E4
-#define GL_VARIANT_DATATYPE_EXT 0x87E5
-#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6
-#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7
-#define GL_VARIANT_ARRAY_EXT 0x87E8
-#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9
-#define GL_INVARIANT_VALUE_EXT 0x87EA
-#define GL_INVARIANT_DATATYPE_EXT 0x87EB
-#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC
-#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED
+#ifndef GL_ATI_vertex_attrib_array_object
+#define GL_ATI_vertex_attrib_array_object 1
+typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params);
#endif
+#endif /* GL_ATI_vertex_attrib_array_object */
#ifndef GL_ATI_vertex_streams
+#define GL_ATI_vertex_streams 1
#define GL_MAX_VERTEX_STREAMS_ATI 0x876B
#define GL_VERTEX_STREAM0_ATI 0x876C
#define GL_VERTEX_STREAM1_ATI 0x876D
@@ -3883,291 +5663,1014 @@ extern "C" {
#define GL_VERTEX_STREAM6_ATI 0x8772
#define GL_VERTEX_STREAM7_ATI 0x8773
#define GL_VERTEX_SOURCE_ATI 0x8774
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x);
+GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x);
+GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x);
+GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x);
+GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y);
+GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y);
+GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
+GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords);
+GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
+GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz);
+GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
+GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
+GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream);
+GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param);
+GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param);
#endif
+#endif /* GL_ATI_vertex_streams */
-#ifndef GL_ATI_element_array
-#define GL_ELEMENT_ARRAY_ATI 0x8768
-#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
-#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
-#endif
-
-#ifndef GL_SUN_mesh_array
-#define GL_QUAD_MESH_SUN 0x8614
-#define GL_TRIANGLE_MESH_SUN 0x8615
-#endif
-
-#ifndef GL_SUN_slice_accum
-#define GL_SLICE_ACCUM_SUN 0x85CC
-#endif
-
-#ifndef GL_NV_multisample_filter_hint
-#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
-#endif
-
-#ifndef GL_NV_depth_clamp
-#define GL_DEPTH_CLAMP_NV 0x864F
-#endif
-
-#ifndef GL_NV_occlusion_query
-#define GL_PIXEL_COUNTER_BITS_NV 0x8864
-#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865
-#define GL_PIXEL_COUNT_NV 0x8866
-#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867
-#endif
-
-#ifndef GL_NV_point_sprite
-#define GL_POINT_SPRITE_NV 0x8861
-#define GL_COORD_REPLACE_NV 0x8862
-#define GL_POINT_SPRITE_R_MODE_NV 0x8863
-#endif
-
-#ifndef GL_NV_texture_shader3
-#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
-#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
-#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
-#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
-#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854
-#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
-#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
-#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
-#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858
-#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859
-#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
-#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B
-#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C
-#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
-#define GL_HILO8_NV 0x885E
-#define GL_SIGNED_HILO8_NV 0x885F
-#define GL_FORCE_BLUE_TO_ONE_NV 0x8860
-#endif
-
-#ifndef GL_NV_vertex_program1_1
-#endif
-
-#ifndef GL_EXT_shadow_funcs
-#endif
-
-#ifndef GL_EXT_stencil_two_side
-#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910
-#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911
-#endif
-
-#ifndef GL_ATI_text_fragment_shader
-#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200
-#endif
-
-#ifndef GL_APPLE_client_storage
-#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
-#endif
-
-#ifndef GL_APPLE_element_array
-#define GL_ELEMENT_ARRAY_APPLE 0x8A0C
-#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D
-#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E
-#endif
-
-#ifndef GL_APPLE_fence
-#define GL_DRAW_PIXELS_APPLE 0x8A0A
-#define GL_FENCE_APPLE 0x8A0B
-#endif
+#ifndef GL_EXT_422_pixels
+#define GL_EXT_422_pixels 1
+#define GL_422_EXT 0x80CC
+#define GL_422_REV_EXT 0x80CD
+#define GL_422_AVERAGE_EXT 0x80CE
+#define GL_422_REV_AVERAGE_EXT 0x80CF
+#endif /* GL_EXT_422_pixels */
-#ifndef GL_APPLE_vertex_array_object
-#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5
-#endif
+#ifndef GL_EXT_abgr
+#define GL_EXT_abgr 1
+#define GL_ABGR_EXT 0x8000
+#endif /* GL_EXT_abgr */
-#ifndef GL_APPLE_vertex_array_range
-#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D
-#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
-#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
-#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
-#define GL_STORAGE_CLIENT_APPLE 0x85B4
-#define GL_STORAGE_CACHED_APPLE 0x85BE
-#define GL_STORAGE_SHARED_APPLE 0x85BF
-#endif
+#ifndef GL_EXT_bgra
+#define GL_EXT_bgra 1
+#define GL_BGR_EXT 0x80E0
+#define GL_BGRA_EXT 0x80E1
+#endif /* GL_EXT_bgra */
-#ifndef GL_APPLE_ycbcr_422
-#define GL_YCBCR_422_APPLE 0x85B9
-#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
+#ifndef GL_EXT_bindable_uniform
+#define GL_EXT_bindable_uniform 1
+#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2
+#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3
+#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4
+#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED
+#define GL_UNIFORM_BUFFER_EXT 0x8DEE
+#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF
+typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location);
+typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer);
+GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location);
+GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location);
#endif
+#endif /* GL_EXT_bindable_uniform */
-#ifndef GL_S3_s3tc
-#define GL_RGB_S3TC 0x83A0
-#define GL_RGB4_S3TC 0x83A1
-#define GL_RGBA_S3TC 0x83A2
-#define GL_RGBA4_S3TC 0x83A3
+#ifndef GL_EXT_blend_color
+#define GL_EXT_blend_color 1
+#define GL_CONSTANT_COLOR_EXT 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002
+#define GL_CONSTANT_ALPHA_EXT 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004
+#define GL_BLEND_COLOR_EXT 0x8005
+typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendColorEXT (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
#endif
+#endif /* GL_EXT_blend_color */
-#ifndef GL_ATI_draw_buffers
-#define GL_MAX_DRAW_BUFFERS_ATI 0x8824
-#define GL_DRAW_BUFFER0_ATI 0x8825
-#define GL_DRAW_BUFFER1_ATI 0x8826
-#define GL_DRAW_BUFFER2_ATI 0x8827
-#define GL_DRAW_BUFFER3_ATI 0x8828
-#define GL_DRAW_BUFFER4_ATI 0x8829
-#define GL_DRAW_BUFFER5_ATI 0x882A
-#define GL_DRAW_BUFFER6_ATI 0x882B
-#define GL_DRAW_BUFFER7_ATI 0x882C
-#define GL_DRAW_BUFFER8_ATI 0x882D
-#define GL_DRAW_BUFFER9_ATI 0x882E
-#define GL_DRAW_BUFFER10_ATI 0x882F
-#define GL_DRAW_BUFFER11_ATI 0x8830
-#define GL_DRAW_BUFFER12_ATI 0x8831
-#define GL_DRAW_BUFFER13_ATI 0x8832
-#define GL_DRAW_BUFFER14_ATI 0x8833
-#define GL_DRAW_BUFFER15_ATI 0x8834
+#ifndef GL_EXT_blend_equation_separate
+#define GL_EXT_blend_equation_separate 1
+#define GL_BLEND_EQUATION_RGB_EXT 0x8009
+#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha);
#endif
+#endif /* GL_EXT_blend_equation_separate */
-#ifndef GL_ATI_pixel_format_float
-#define GL_TYPE_RGBA_FLOAT_ATI 0x8820
-#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
+#ifndef GL_EXT_blend_func_separate
+#define GL_EXT_blend_func_separate 1
+#define GL_BLEND_DST_RGB_EXT 0x80C8
+#define GL_BLEND_SRC_RGB_EXT 0x80C9
+#define GL_BLEND_DST_ALPHA_EXT 0x80CA
+#define GL_BLEND_SRC_ALPHA_EXT 0x80CB
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
#endif
+#endif /* GL_EXT_blend_func_separate */
-#ifndef GL_ATI_texture_env_combine3
-#define GL_MODULATE_ADD_ATI 0x8744
-#define GL_MODULATE_SIGNED_ADD_ATI 0x8745
-#define GL_MODULATE_SUBTRACT_ATI 0x8746
-#endif
+#ifndef GL_EXT_blend_logic_op
+#define GL_EXT_blend_logic_op 1
+#endif /* GL_EXT_blend_logic_op */
-#ifndef GL_ATI_texture_float
-#define GL_RGBA_FLOAT32_ATI 0x8814
-#define GL_RGB_FLOAT32_ATI 0x8815
-#define GL_ALPHA_FLOAT32_ATI 0x8816
-#define GL_INTENSITY_FLOAT32_ATI 0x8817
-#define GL_LUMINANCE_FLOAT32_ATI 0x8818
-#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
-#define GL_RGBA_FLOAT16_ATI 0x881A
-#define GL_RGB_FLOAT16_ATI 0x881B
-#define GL_ALPHA_FLOAT16_ATI 0x881C
-#define GL_INTENSITY_FLOAT16_ATI 0x881D
-#define GL_LUMINANCE_FLOAT16_ATI 0x881E
-#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
+#ifndef GL_EXT_blend_minmax
+#define GL_EXT_blend_minmax 1
+#define GL_MIN_EXT 0x8007
+#define GL_MAX_EXT 0x8008
+#define GL_FUNC_ADD_EXT 0x8006
+#define GL_BLEND_EQUATION_EXT 0x8009
+typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationEXT (GLenum mode);
#endif
+#endif /* GL_EXT_blend_minmax */
-#ifndef GL_NV_float_buffer
-#define GL_FLOAT_R_NV 0x8880
-#define GL_FLOAT_RG_NV 0x8881
-#define GL_FLOAT_RGB_NV 0x8882
-#define GL_FLOAT_RGBA_NV 0x8883
-#define GL_FLOAT_R16_NV 0x8884
-#define GL_FLOAT_R32_NV 0x8885
-#define GL_FLOAT_RG16_NV 0x8886
-#define GL_FLOAT_RG32_NV 0x8887
-#define GL_FLOAT_RGB16_NV 0x8888
-#define GL_FLOAT_RGB32_NV 0x8889
-#define GL_FLOAT_RGBA16_NV 0x888A
-#define GL_FLOAT_RGBA32_NV 0x888B
-#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C
-#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D
-#define GL_FLOAT_RGBA_MODE_NV 0x888E
-#endif
+#ifndef GL_EXT_blend_subtract
+#define GL_EXT_blend_subtract 1
+#define GL_FUNC_SUBTRACT_EXT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B
+#endif /* GL_EXT_blend_subtract */
-#ifndef GL_NV_fragment_program
-#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
-#define GL_FRAGMENT_PROGRAM_NV 0x8870
-#define GL_MAX_TEXTURE_COORDS_NV 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872
-#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873
-#define GL_PROGRAM_ERROR_STRING_NV 0x8874
-#endif
+#ifndef GL_EXT_clip_volume_hint
+#define GL_EXT_clip_volume_hint 1
+#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0
+#endif /* GL_EXT_clip_volume_hint */
-#ifndef GL_NV_half_float
-#define GL_HALF_FLOAT_NV 0x140B
-#endif
+#ifndef GL_EXT_cmyka
+#define GL_EXT_cmyka 1
+#define GL_CMYK_EXT 0x800C
+#define GL_CMYKA_EXT 0x800D
+#define GL_PACK_CMYK_HINT_EXT 0x800E
+#define GL_UNPACK_CMYK_HINT_EXT 0x800F
+#endif /* GL_EXT_cmyka */
-#ifndef GL_NV_pixel_data_range
-#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878
-#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879
-#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
-#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
-#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
-#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
+#ifndef GL_EXT_color_subtable
+#define GL_EXT_color_subtable 1
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data);
+GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
#endif
+#endif /* GL_EXT_color_subtable */
-#ifndef GL_NV_primitive_restart
-#define GL_PRIMITIVE_RESTART_NV 0x8558
-#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_EXT_compiled_vertex_array 1
+#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8
+#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9
+typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count);
+GLAPI void APIENTRY glUnlockArraysEXT (void);
#endif
+#endif /* GL_EXT_compiled_vertex_array */
-#ifndef GL_NV_texture_expand_normal
-#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
+#ifndef GL_EXT_convolution
+#define GL_EXT_convolution 1
+#define GL_CONVOLUTION_1D_EXT 0x8010
+#define GL_CONVOLUTION_2D_EXT 0x8011
+#define GL_SEPARABLE_2D_EXT 0x8012
+#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015
+#define GL_REDUCE_EXT 0x8016
+#define GL_CONVOLUTION_FORMAT_EXT 0x8017
+#define GL_CONVOLUTION_WIDTH_EXT 0x8018
+#define GL_CONVOLUTION_HEIGHT_EXT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image);
+GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image);
+GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params);
+GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params);
+GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, void *image);
+GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span);
+GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column);
#endif
+#endif /* GL_EXT_convolution */
-#ifndef GL_NV_vertex_program2
+#ifndef GL_EXT_coordinate_frame
+#define GL_EXT_coordinate_frame 1
+#define GL_TANGENT_ARRAY_EXT 0x8439
+#define GL_BINORMAL_ARRAY_EXT 0x843A
+#define GL_CURRENT_TANGENT_EXT 0x843B
+#define GL_CURRENT_BINORMAL_EXT 0x843C
+#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E
+#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F
+#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440
+#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441
+#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442
+#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443
+#define GL_MAP1_TANGENT_EXT 0x8444
+#define GL_MAP2_TANGENT_EXT 0x8445
+#define GL_MAP1_BINORMAL_EXT 0x8446
+#define GL_MAP2_BINORMAL_EXT 0x8447
+typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
+typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);
+typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);
+typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);
+typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);
+typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);
+typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);
+typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);
+typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);
+typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);
+typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer);
+typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz);
+GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v);
+GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz);
+GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v);
+GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz);
+GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v);
+GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz);
+GLAPI void APIENTRY glTangent3ivEXT (const GLint *v);
+GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz);
+GLAPI void APIENTRY glTangent3svEXT (const GLshort *v);
+GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz);
+GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v);
+GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz);
+GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v);
+GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz);
+GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v);
+GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz);
+GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v);
+GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz);
+GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v);
+GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const void *pointer);
+GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const void *pointer);
#endif
+#endif /* GL_EXT_coordinate_frame */
-#ifndef GL_ATI_map_object_buffer
+#ifndef GL_EXT_copy_texture
+#define GL_EXT_copy_texture 1
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
#endif
+#endif /* GL_EXT_copy_texture */
-#ifndef GL_ATI_separate_stencil
-#define GL_STENCIL_BACK_FUNC_ATI 0x8800
-#define GL_STENCIL_BACK_FAIL_ATI 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
+#ifndef GL_EXT_cull_vertex
+#define GL_EXT_cull_vertex 1
+#define GL_CULL_VERTEX_EXT 0x81AA
+#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB
+#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
+typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params);
#endif
+#endif /* GL_EXT_cull_vertex */
-#ifndef GL_ATI_vertex_attrib_array_object
+#ifndef GL_EXT_debug_label
+#define GL_EXT_debug_label 1
+#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F
+#define GL_PROGRAM_OBJECT_EXT 0x8B40
+#define GL_SHADER_OBJECT_EXT 0x8B48
+#define GL_BUFFER_OBJECT_EXT 0x9151
+#define GL_QUERY_OBJECT_EXT 0x9153
+#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154
+typedef void (APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label);
+typedef void (APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label);
+GLAPI void APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
#endif
+#endif /* GL_EXT_debug_label */
-#ifndef GL_OES_read_format
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
+#ifndef GL_EXT_debug_marker
+#define GL_EXT_debug_marker 1
+typedef void (APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker);
+typedef void (APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker);
+typedef void (APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker);
+GLAPI void APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker);
+GLAPI void APIENTRY glPopGroupMarkerEXT (void);
#endif
+#endif /* GL_EXT_debug_marker */
#ifndef GL_EXT_depth_bounds_test
+#define GL_EXT_depth_bounds_test 1
#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890
#define GL_DEPTH_BOUNDS_EXT 0x8891
+typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax);
#endif
+#endif /* GL_EXT_depth_bounds_test */
-#ifndef GL_EXT_texture_mirror_clamp
-#define GL_MIRROR_CLAMP_EXT 0x8742
-#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743
-#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912
-#endif
-
-#ifndef GL_EXT_blend_equation_separate
-#define GL_BLEND_EQUATION_RGB_EXT 0x8009
-#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D
+#ifndef GL_EXT_direct_state_access
+#define GL_EXT_direct_state_access 1
+#define GL_PROGRAM_MATRIX_EXT 0x8E2D
+#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E
+#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F
+typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
+typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels);
+typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer);
+typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
+typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);
+typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels);
+typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
+typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
+typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data);
+typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, void **data);
+typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
+typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data);
+typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, void *img);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, void *img);
+typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage);
+typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
+typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void **params);
+typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);
+typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params);
+typedef void (APIENTRYP PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index);
+typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index);
+typedef void (APIENTRYP PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, void **params);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void *string);
+typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target);
+typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);
+typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+typedef void (APIENTRYP PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+typedef void (APIENTRYP PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset);
+typedef void (APIENTRYP PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);
+typedef void (APIENTRYP PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);
+typedef void (APIENTRYP PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+typedef void (APIENTRYP PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+typedef void (APIENTRYP PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);
+typedef void (APIENTRYP PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array);
+typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index);
+typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint *param);
+typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, void **param);
+typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint *param);
+typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, void **param);
+typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
+typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
+typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags);
+typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);
+typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+typedef void (APIENTRYP PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+typedef void (APIENTRYP PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC) (GLuint vaobj, GLuint index, GLuint divisor);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m);
+GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m);
+GLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m);
+GLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m);
+GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode);
+GLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GLAPI void APIENTRY glMatrixPopEXT (GLenum mode);
+GLAPI void APIENTRY glMatrixPushEXT (GLenum mode);
+GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask);
+GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask);
+GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels);
+GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels);
+GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels);
+GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);
+GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture);
+GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer);
+GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
+GLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);
+GLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param);
+GLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params);
+GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels);
+GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels);
+GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels);
+GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);
+GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index);
+GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index);
+GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data);
+GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data);
+GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, void **data);
+GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index);
+GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index);
+GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index);
+GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data);
+GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data);
+GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits);
+GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits);
+GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits);
+GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits);
+GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits);
+GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits);
+GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, void *img);
+GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits);
+GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits);
+GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits);
+GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits);
+GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits);
+GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits);
+GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, void *img);
+GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m);
+GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m);
+GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m);
+GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m);
+GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage);
+GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
+GLAPI void *APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access);
+GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer);
+GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, void **params);
+GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data);
+GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0);
+GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0);
+GLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);
+GLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);
+GLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0);
+GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params);
+GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params);
+GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params);
+GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params);
+GLAPI void APIENTRY glEnableClientStateiEXT (GLenum array, GLuint index);
+GLAPI void APIENTRY glDisableClientStateiEXT (GLenum array, GLuint index);
+GLAPI void APIENTRY glGetFloati_vEXT (GLenum pname, GLuint index, GLfloat *params);
+GLAPI void APIENTRY glGetDoublei_vEXT (GLenum pname, GLuint index, GLdouble *params);
+GLAPI void APIENTRY glGetPointeri_vEXT (GLenum pname, GLuint index, void **params);
+GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string);
+GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params);
+GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params);
+GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params);
+GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params);
+GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, void *string);
+GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params);
+GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target);
+GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target);
+GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target);
+GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode);
+GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs);
+GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode);
+GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params);
+GLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
+GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);
+GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY glVertexArrayVertexOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+GLAPI void APIENTRY glVertexArrayColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+GLAPI void APIENTRY glVertexArrayEdgeFlagOffsetEXT (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset);
+GLAPI void APIENTRY glVertexArrayIndexOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);
+GLAPI void APIENTRY glVertexArrayNormalOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);
+GLAPI void APIENTRY glVertexArrayTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+GLAPI void APIENTRY glVertexArrayMultiTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+GLAPI void APIENTRY glVertexArrayFogCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);
+GLAPI void APIENTRY glVertexArraySecondaryColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+GLAPI void APIENTRY glVertexArrayVertexAttribOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset);
+GLAPI void APIENTRY glVertexArrayVertexAttribIOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+GLAPI void APIENTRY glEnableVertexArrayEXT (GLuint vaobj, GLenum array);
+GLAPI void APIENTRY glDisableVertexArrayEXT (GLuint vaobj, GLenum array);
+GLAPI void APIENTRY glEnableVertexArrayAttribEXT (GLuint vaobj, GLuint index);
+GLAPI void APIENTRY glDisableVertexArrayAttribEXT (GLuint vaobj, GLuint index);
+GLAPI void APIENTRY glGetVertexArrayIntegervEXT (GLuint vaobj, GLenum pname, GLint *param);
+GLAPI void APIENTRY glGetVertexArrayPointervEXT (GLuint vaobj, GLenum pname, void **param);
+GLAPI void APIENTRY glGetVertexArrayIntegeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, GLint *param);
+GLAPI void APIENTRY glGetVertexArrayPointeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, void **param);
+GLAPI void *APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length);
+GLAPI void APIENTRY glNamedBufferStorageEXT (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags);
+GLAPI void APIENTRY glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);
+GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
+GLAPI void APIENTRY glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param);
+GLAPI void APIENTRY glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params);
+GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x);
+GLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glTextureBufferRangeEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GLAPI void APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+GLAPI void APIENTRY glTextureStorage2DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+GLAPI void APIENTRY glTextureStorage3DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+GLAPI void APIENTRY glVertexArrayBindVertexBufferEXT (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+GLAPI void APIENTRY glVertexArrayVertexAttribFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+GLAPI void APIENTRY glVertexArrayVertexAttribIFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+GLAPI void APIENTRY glVertexArrayVertexAttribLFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+GLAPI void APIENTRY glVertexArrayVertexAttribBindingEXT (GLuint vaobj, GLuint attribindex, GLuint bindingindex);
+GLAPI void APIENTRY glVertexArrayVertexBindingDivisorEXT (GLuint vaobj, GLuint bindingindex, GLuint divisor);
+GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+GLAPI void APIENTRY glTexturePageCommitmentEXT (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident);
+GLAPI void APIENTRY glVertexArrayVertexAttribDivisorEXT (GLuint vaobj, GLuint index, GLuint divisor);
#endif
+#endif /* GL_EXT_direct_state_access */
-#ifndef GL_MESA_pack_invert
-#define GL_PACK_INVERT_MESA 0x8758
+#ifndef GL_EXT_draw_buffers2
+#define GL_EXT_draw_buffers2 1
+typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
#endif
+#endif /* GL_EXT_draw_buffers2 */
-#ifndef GL_MESA_ycbcr_texture
-#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB
-#define GL_YCBCR_MESA 0x8757
+#ifndef GL_EXT_draw_instanced
+#define GL_EXT_draw_instanced 1
+typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
+GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
#endif
+#endif /* GL_EXT_draw_instanced */
-#ifndef GL_EXT_pixel_buffer_object
-#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF
+#ifndef GL_EXT_draw_range_elements
+#define GL_EXT_draw_range_elements 1
+#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8
+#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
#endif
+#endif /* GL_EXT_draw_range_elements */
-#ifndef GL_NV_fragment_program_option
+#ifndef GL_EXT_fog_coord
+#define GL_EXT_fog_coord 1
+#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450
+#define GL_FOG_COORDINATE_EXT 0x8451
+#define GL_FRAGMENT_DEPTH_EXT 0x8452
+#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
+#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457
+typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord);
+GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord);
+GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord);
+GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord);
+GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const void *pointer);
#endif
+#endif /* GL_EXT_fog_coord */
-#ifndef GL_NV_fragment_program2
-#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
-#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5
-#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6
-#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7
-#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8
+#ifndef GL_EXT_framebuffer_blit
+#define GL_EXT_framebuffer_blit 1
+#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
+#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA
+typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
#endif
+#endif /* GL_EXT_framebuffer_blit */
-#ifndef GL_NV_vertex_program2_option
-/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
-/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */
+#ifndef GL_EXT_framebuffer_multisample
+#define GL_EXT_framebuffer_multisample 1
+#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
+#define GL_MAX_SAMPLES_EXT 0x8D57
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
#endif
+#endif /* GL_EXT_framebuffer_multisample */
-#ifndef GL_NV_vertex_program3
-/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
-#endif
+#ifndef GL_EXT_framebuffer_multisample_blit_scaled
+#define GL_EXT_framebuffer_multisample_blit_scaled 1
+#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA
+#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB
+#endif /* GL_EXT_framebuffer_multisample_blit_scaled */
#ifndef GL_EXT_framebuffer_object
+#define GL_EXT_framebuffer_object 1
#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
@@ -4219,134 +6722,91 @@ extern "C" {
#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
+typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
+typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
+typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
+typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer);
+GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers);
+GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers);
+GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer);
+GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer);
+GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers);
+GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers);
+GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target);
+GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target);
#endif
+#endif /* GL_EXT_framebuffer_object */
-#ifndef GL_GREMEDY_string_marker
-#endif
-
-#ifndef GL_EXT_packed_depth_stencil
-#define GL_DEPTH_STENCIL_EXT 0x84F9
-#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
-#define GL_DEPTH24_STENCIL8_EXT 0x88F0
-#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
-#endif
-
-#ifndef GL_EXT_stencil_clear_tag
-#define GL_STENCIL_TAG_BITS_EXT 0x88F2
-#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3
-#endif
-
-#ifndef GL_EXT_texture_sRGB
-#define GL_SRGB_EXT 0x8C40
-#define GL_SRGB8_EXT 0x8C41
-#define GL_SRGB_ALPHA_EXT 0x8C42
-#define GL_SRGB8_ALPHA8_EXT 0x8C43
-#define GL_SLUMINANCE_ALPHA_EXT 0x8C44
-#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45
-#define GL_SLUMINANCE_EXT 0x8C46
-#define GL_SLUMINANCE8_EXT 0x8C47
-#define GL_COMPRESSED_SRGB_EXT 0x8C48
-#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49
-#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A
-#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B
-#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
-#endif
-
-#ifndef GL_EXT_framebuffer_blit
-#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
-#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
-#define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT
-#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA
-#endif
-
-#ifndef GL_EXT_framebuffer_multisample
-#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
-#define GL_MAX_SAMPLES_EXT 0x8D57
-#endif
-
-#ifndef GL_MESAX_texture_stack
-#define GL_TEXTURE_1D_STACK_MESAX 0x8759
-#define GL_TEXTURE_2D_STACK_MESAX 0x875A
-#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B
-#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C
-#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D
-#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E
-#endif
-
-#ifndef GL_EXT_timer_query
-#define GL_TIME_ELAPSED_EXT 0x88BF
-#endif
-
-#ifndef GL_EXT_gpu_program_parameters
-#endif
-
-#ifndef GL_APPLE_flush_buffer_range
-#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12
-#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13
-#endif
-
-#ifndef GL_NV_gpu_program4
-#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904
-#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905
-#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906
-#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907
-#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908
-#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909
-#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5
-#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6
-#endif
+#ifndef GL_EXT_framebuffer_sRGB
+#define GL_EXT_framebuffer_sRGB 1
+#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
+#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA
+#endif /* GL_EXT_framebuffer_sRGB */
-#ifndef GL_NV_geometry_program4
-#define GL_LINES_ADJACENCY_EXT 0x000A
-#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B
-#define GL_TRIANGLES_ADJACENCY_EXT 0x000C
-#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D
-#define GL_GEOMETRY_PROGRAM_NV 0x8C26
-#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27
-#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28
+#ifndef GL_EXT_geometry_shader4
+#define GL_EXT_geometry_shader4 1
+#define GL_GEOMETRY_SHADER_EXT 0x8DD9
#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA
#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB
#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC
#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
-#define GL_PROGRAM_POINT_SIZE_EXT 0x8642
-#endif
-
-#ifndef GL_EXT_geometry_shader4
-#define GL_GEOMETRY_SHADER_EXT 0x8DD9
-/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */
-/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */
-/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */
-/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */
#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD
#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE
#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B
#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
-/* reuse GL_LINES_ADJACENCY_EXT */
-/* reuse GL_LINE_STRIP_ADJACENCY_EXT */
-/* reuse GL_TRIANGLES_ADJACENCY_EXT */
-/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
-/* reuse GL_PROGRAM_POINT_SIZE_EXT */
+#define GL_LINES_ADJACENCY_EXT 0x000A
+#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B
+#define GL_TRIANGLES_ADJACENCY_EXT 0x000C
+#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
+#define GL_PROGRAM_POINT_SIZE_EXT 0x8642
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);
#endif
+#endif /* GL_EXT_geometry_shader4 */
-#ifndef GL_NV_vertex_program4
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD
+#ifndef GL_EXT_gpu_program_parameters
+#define GL_EXT_gpu_program_parameters 1
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
#endif
+#endif /* GL_EXT_gpu_program_parameters */
#ifndef GL_EXT_gpu_shader4
+#define GL_EXT_gpu_shader4 1
+#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD
#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0
#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1
#define GL_SAMPLER_BUFFER_EXT 0x8DC2
@@ -4372,481 +6832,373 @@ extern "C" {
#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6
#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7
#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8
+#define GL_MIN_PROGRAM_TEXEL_OFFSET_EXT 0x8904
+#define GL_MAX_PROGRAM_TEXEL_OFFSET_EXT 0x8905
+typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params);
+GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name);
+GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0);
+GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value);
#endif
+#endif /* GL_EXT_gpu_shader4 */
-#ifndef GL_EXT_draw_instanced
-#endif
-
-#ifndef GL_EXT_packed_float
-#define GL_R11F_G11F_B10F_EXT 0x8C3A
-#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B
-#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C
-#endif
-
-#ifndef GL_EXT_texture_array
-#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18
-#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19
-#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
-#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B
-#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
-#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
-#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
-#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
-#endif
-
-#ifndef GL_EXT_texture_buffer_object
-#define GL_TEXTURE_BUFFER_EXT 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D
-#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E
-#endif
-
-#ifndef GL_EXT_texture_compression_latc
-#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70
-#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71
-#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72
-#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73
-#endif
-
-#ifndef GL_EXT_texture_compression_rgtc
-#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB
-#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
-#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
-#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
-#endif
-
-#ifndef GL_EXT_texture_shared_exponent
-#define GL_RGB9_E5_EXT 0x8C3D
-#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E
-#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F
-#endif
-
-#ifndef GL_NV_depth_buffer_float
-#define GL_DEPTH_COMPONENT32F_NV 0x8DAB
-#define GL_DEPTH32F_STENCIL8_NV 0x8DAC
-#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD
-#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF
-#endif
-
-#ifndef GL_NV_fragment_program4
-#endif
-
-#ifndef GL_NV_framebuffer_multisample_coverage
-#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB
-#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10
-#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11
-#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12
-#endif
-
-#ifndef GL_EXT_framebuffer_sRGB
-#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
-#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA
-#endif
-
-#ifndef GL_NV_geometry_shader4
-#endif
-
-#ifndef GL_NV_parameter_buffer_object
-#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0
-#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1
-#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2
-#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3
-#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4
+#ifndef GL_EXT_histogram
+#define GL_EXT_histogram 1
+#define GL_HISTOGRAM_EXT 0x8024
+#define GL_PROXY_HISTOGRAM_EXT 0x8025
+#define GL_HISTOGRAM_WIDTH_EXT 0x8026
+#define GL_HISTOGRAM_FORMAT_EXT 0x8027
+#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C
+#define GL_HISTOGRAM_SINK_EXT 0x802D
+#define GL_MINMAX_EXT 0x802E
+#define GL_MINMAX_FORMAT_EXT 0x802F
+#define GL_MINMAX_SINK_EXT 0x8030
+#define GL_TABLE_TOO_LARGE_EXT 0x8031
+typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values);
+GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values);
+GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY glResetHistogramEXT (GLenum target);
+GLAPI void APIENTRY glResetMinmaxEXT (GLenum target);
#endif
+#endif /* GL_EXT_histogram */
-#ifndef GL_EXT_draw_buffers2
-#endif
+#ifndef GL_EXT_index_array_formats
+#define GL_EXT_index_array_formats 1
+#define GL_IUI_V2F_EXT 0x81AD
+#define GL_IUI_V3F_EXT 0x81AE
+#define GL_IUI_N3F_V2F_EXT 0x81AF
+#define GL_IUI_N3F_V3F_EXT 0x81B0
+#define GL_T2F_IUI_V2F_EXT 0x81B1
+#define GL_T2F_IUI_V3F_EXT 0x81B2
+#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3
+#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4
+#endif /* GL_EXT_index_array_formats */
-#ifndef GL_NV_transform_feedback
-#define GL_BACK_PRIMARY_COLOR_NV 0x8C77
-#define GL_BACK_SECONDARY_COLOR_NV 0x8C78
-#define GL_TEXTURE_COORD_NV 0x8C79
-#define GL_CLIP_DISTANCE_NV 0x8C7A
-#define GL_VERTEX_ID_NV 0x8C7B
-#define GL_PRIMITIVE_ID_NV 0x8C7C
-#define GL_GENERIC_ATTRIB_NV 0x8C7D
-#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80
-#define GL_ACTIVE_VARYINGS_NV 0x8C81
-#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82
-#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85
-#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86
-#define GL_PRIMITIVES_GENERATED_NV 0x8C87
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88
-#define GL_RASTERIZER_DISCARD_NV 0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B
-#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C
-#define GL_SEPARATE_ATTRIBS_NV 0x8C8D
-#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F
-#define GL_LAYER_NV 0x8DAA
-#define GL_NEXT_BUFFER_NV -2
-#define GL_SKIP_COMPONENTS4_NV -3
-#define GL_SKIP_COMPONENTS3_NV -4
-#define GL_SKIP_COMPONENTS2_NV -5
-#define GL_SKIP_COMPONENTS1_NV -6
+#ifndef GL_EXT_index_func
+#define GL_EXT_index_func 1
+#define GL_INDEX_TEST_EXT 0x81B5
+#define GL_INDEX_TEST_FUNC_EXT 0x81B6
+#define GL_INDEX_TEST_REF_EXT 0x81B7
+typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref);
#endif
+#endif /* GL_EXT_index_func */
-#ifndef GL_EXT_bindable_uniform
-#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2
-#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3
-#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4
-#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED
-#define GL_UNIFORM_BUFFER_EXT 0x8DEE
-#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF
+#ifndef GL_EXT_index_material
+#define GL_EXT_index_material 1
+#define GL_INDEX_MATERIAL_EXT 0x81B8
+#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9
+#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA
+typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode);
#endif
+#endif /* GL_EXT_index_material */
-#ifndef GL_EXT_texture_integer
-#define GL_RGBA32UI_EXT 0x8D70
-#define GL_RGB32UI_EXT 0x8D71
-#define GL_ALPHA32UI_EXT 0x8D72
-#define GL_INTENSITY32UI_EXT 0x8D73
-#define GL_LUMINANCE32UI_EXT 0x8D74
-#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75
-#define GL_RGBA16UI_EXT 0x8D76
-#define GL_RGB16UI_EXT 0x8D77
-#define GL_ALPHA16UI_EXT 0x8D78
-#define GL_INTENSITY16UI_EXT 0x8D79
-#define GL_LUMINANCE16UI_EXT 0x8D7A
-#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B
-#define GL_RGBA8UI_EXT 0x8D7C
-#define GL_RGB8UI_EXT 0x8D7D
-#define GL_ALPHA8UI_EXT 0x8D7E
-#define GL_INTENSITY8UI_EXT 0x8D7F
-#define GL_LUMINANCE8UI_EXT 0x8D80
-#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81
-#define GL_RGBA32I_EXT 0x8D82
-#define GL_RGB32I_EXT 0x8D83
-#define GL_ALPHA32I_EXT 0x8D84
-#define GL_INTENSITY32I_EXT 0x8D85
-#define GL_LUMINANCE32I_EXT 0x8D86
-#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87
-#define GL_RGBA16I_EXT 0x8D88
-#define GL_RGB16I_EXT 0x8D89
-#define GL_ALPHA16I_EXT 0x8D8A
-#define GL_INTENSITY16I_EXT 0x8D8B
-#define GL_LUMINANCE16I_EXT 0x8D8C
-#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D
-#define GL_RGBA8I_EXT 0x8D8E
-#define GL_RGB8I_EXT 0x8D8F
-#define GL_ALPHA8I_EXT 0x8D90
-#define GL_INTENSITY8I_EXT 0x8D91
-#define GL_LUMINANCE8I_EXT 0x8D92
-#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93
-#define GL_RED_INTEGER_EXT 0x8D94
-#define GL_GREEN_INTEGER_EXT 0x8D95
-#define GL_BLUE_INTEGER_EXT 0x8D96
-#define GL_ALPHA_INTEGER_EXT 0x8D97
-#define GL_RGB_INTEGER_EXT 0x8D98
-#define GL_RGBA_INTEGER_EXT 0x8D99
-#define GL_BGR_INTEGER_EXT 0x8D9A
-#define GL_BGRA_INTEGER_EXT 0x8D9B
-#define GL_LUMINANCE_INTEGER_EXT 0x8D9C
-#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D
-#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E
-#endif
+#ifndef GL_EXT_index_texture
+#define GL_EXT_index_texture 1
+#endif /* GL_EXT_index_texture */
-#ifndef GL_GREMEDY_frame_terminator
+#ifndef GL_EXT_light_texture
+#define GL_EXT_light_texture 1
+#define GL_FRAGMENT_MATERIAL_EXT 0x8349
+#define GL_FRAGMENT_NORMAL_EXT 0x834A
+#define GL_FRAGMENT_COLOR_EXT 0x834C
+#define GL_ATTENUATION_EXT 0x834D
+#define GL_SHADOW_ATTENUATION_EXT 0x834E
+#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F
+#define GL_TEXTURE_LIGHT_EXT 0x8350
+#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351
+#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
+typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glApplyTextureEXT (GLenum mode);
+GLAPI void APIENTRY glTextureLightEXT (GLenum pname);
+GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode);
#endif
+#endif /* GL_EXT_light_texture */
-#ifndef GL_NV_conditional_render
-#define GL_QUERY_WAIT_NV 0x8E13
-#define GL_QUERY_NO_WAIT_NV 0x8E14
-#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15
-#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16
-#endif
+#ifndef GL_EXT_misc_attribute
+#define GL_EXT_misc_attribute 1
+#endif /* GL_EXT_misc_attribute */
-#ifndef GL_NV_present_video
-#define GL_FRAME_NV 0x8E26
-#define GL_FIELDS_NV 0x8E27
-#define GL_CURRENT_TIME_NV 0x8E28
-#define GL_NUM_FILL_STREAMS_NV 0x8E29
-#define GL_PRESENT_TIME_NV 0x8E2A
-#define GL_PRESENT_DURATION_NV 0x8E2B
+#ifndef GL_EXT_multi_draw_arrays
+#define GL_EXT_multi_draw_arrays 1
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount);
#endif
+#endif /* GL_EXT_multi_draw_arrays */
-#ifndef GL_EXT_transform_feedback
-#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F
-#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C
-#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D
-#define GL_PRIMITIVES_GENERATED_EXT 0x8C87
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88
-#define GL_RASTERIZER_DISCARD_EXT 0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80
-#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F
-#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76
+#ifndef GL_EXT_multisample
+#define GL_EXT_multisample 1
+#define GL_MULTISAMPLE_EXT 0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F
+#define GL_SAMPLE_MASK_EXT 0x80A0
+#define GL_1PASS_EXT 0x80A1
+#define GL_2PASS_0_EXT 0x80A2
+#define GL_2PASS_1_EXT 0x80A3
+#define GL_4PASS_0_EXT 0x80A4
+#define GL_4PASS_1_EXT 0x80A5
+#define GL_4PASS_2_EXT 0x80A6
+#define GL_4PASS_3_EXT 0x80A7
+#define GL_SAMPLE_BUFFERS_EXT 0x80A8
+#define GL_SAMPLES_EXT 0x80A9
+#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA
+#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB
+#define GL_SAMPLE_PATTERN_EXT 0x80AC
+#define GL_MULTISAMPLE_BIT_EXT 0x20000000
+typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert);
+GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern);
#endif
+#endif /* GL_EXT_multisample */
-#ifndef GL_EXT_direct_state_access
-#define GL_PROGRAM_MATRIX_EXT 0x8E2D
-#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E
-#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F
-#endif
+#ifndef GL_EXT_packed_depth_stencil
+#define GL_EXT_packed_depth_stencil 1
+#define GL_DEPTH_STENCIL_EXT 0x84F9
+#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
+#define GL_DEPTH24_STENCIL8_EXT 0x88F0
+#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
+#endif /* GL_EXT_packed_depth_stencil */
-#ifndef GL_EXT_vertex_array_bgra
-/* reuse GL_BGRA */
-#endif
+#ifndef GL_EXT_packed_float
+#define GL_EXT_packed_float 1
+#define GL_R11F_G11F_B10F_EXT 0x8C3A
+#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B
+#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C
+#endif /* GL_EXT_packed_float */
-#ifndef GL_EXT_texture_swizzle
-#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42
-#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43
-#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44
-#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45
-#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46
-#endif
+#ifndef GL_EXT_packed_pixels
+#define GL_EXT_packed_pixels 1
+#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034
+#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035
+#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036
+#endif /* GL_EXT_packed_pixels */
-#ifndef GL_NV_explicit_multisample
-#define GL_SAMPLE_POSITION_NV 0x8E50
-#define GL_SAMPLE_MASK_NV 0x8E51
-#define GL_SAMPLE_MASK_VALUE_NV 0x8E52
-#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53
-#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54
-#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55
-#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56
-#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57
-#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58
-#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59
+#ifndef GL_EXT_paletted_texture
+#define GL_EXT_paletted_texture 1
+#define GL_COLOR_INDEX1_EXT 0x80E2
+#define GL_COLOR_INDEX2_EXT 0x80E3
+#define GL_COLOR_INDEX4_EXT 0x80E4
+#define GL_COLOR_INDEX8_EXT 0x80E5
+#define GL_COLOR_INDEX12_EXT 0x80E6
+#define GL_COLOR_INDEX16_EXT 0x80E7
+#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
+typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void *data);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table);
+GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, void *data);
+GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
#endif
+#endif /* GL_EXT_paletted_texture */
-#ifndef GL_NV_transform_feedback2
-#define GL_TRANSFORM_FEEDBACK_NV 0x8E22
-#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23
-#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24
-#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25
-#endif
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_EXT_pixel_buffer_object 1
+#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF
+#endif /* GL_EXT_pixel_buffer_object */
-#ifndef GL_ATI_meminfo
-#define GL_VBO_FREE_MEMORY_ATI 0x87FB
-#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC
-#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD
+#ifndef GL_EXT_pixel_transform
+#define GL_EXT_pixel_transform 1
+#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330
+#define GL_PIXEL_MAG_FILTER_EXT 0x8331
+#define GL_PIXEL_MIN_FILTER_EXT 0x8332
+#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333
+#define GL_CUBIC_EXT 0x8334
+#define GL_AVERAGE_EXT 0x8335
+#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
+#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
+#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetPixelTransformParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetPixelTransformParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
#endif
+#endif /* GL_EXT_pixel_transform */
-#ifndef GL_AMD_performance_monitor
-#define GL_COUNTER_TYPE_AMD 0x8BC0
-#define GL_COUNTER_RANGE_AMD 0x8BC1
-#define GL_UNSIGNED_INT64_AMD 0x8BC2
-#define GL_PERCENTAGE_AMD 0x8BC3
-#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4
-#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5
-#define GL_PERFMON_RESULT_AMD 0x8BC6
-#endif
+#ifndef GL_EXT_pixel_transform_color_table
+#define GL_EXT_pixel_transform_color_table 1
+#endif /* GL_EXT_pixel_transform_color_table */
-#ifndef GL_AMD_texture_texture4
+#ifndef GL_EXT_point_parameters
+#define GL_EXT_point_parameters 1
+#define GL_POINT_SIZE_MIN_EXT 0x8126
+#define GL_POINT_SIZE_MAX_EXT 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
+#define GL_DISTANCE_ATTENUATION_EXT 0x8129
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params);
#endif
+#endif /* GL_EXT_point_parameters */
-#ifndef GL_AMD_vertex_shader_tesselator
-#define GL_SAMPLER_BUFFER_AMD 0x9001
-#define GL_INT_SAMPLER_BUFFER_AMD 0x9002
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003
-#define GL_TESSELLATION_MODE_AMD 0x9004
-#define GL_TESSELLATION_FACTOR_AMD 0x9005
-#define GL_DISCRETE_AMD 0x9006
-#define GL_CONTINUOUS_AMD 0x9007
+#ifndef GL_EXT_polygon_offset
+#define GL_EXT_polygon_offset 1
+#define GL_POLYGON_OFFSET_EXT 0x8037
+#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038
+#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039
+typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias);
#endif
+#endif /* GL_EXT_polygon_offset */
#ifndef GL_EXT_provoking_vertex
+#define GL_EXT_provoking_vertex 1
#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C
#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D
#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E
#define GL_PROVOKING_VERTEX_EXT 0x8E4F
+typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode);
#endif
+#endif /* GL_EXT_provoking_vertex */
-#ifndef GL_EXT_texture_snorm
-#define GL_ALPHA_SNORM 0x9010
-#define GL_LUMINANCE_SNORM 0x9011
-#define GL_LUMINANCE_ALPHA_SNORM 0x9012
-#define GL_INTENSITY_SNORM 0x9013
-#define GL_ALPHA8_SNORM 0x9014
-#define GL_LUMINANCE8_SNORM 0x9015
-#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016
-#define GL_INTENSITY8_SNORM 0x9017
-#define GL_ALPHA16_SNORM 0x9018
-#define GL_LUMINANCE16_SNORM 0x9019
-#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A
-#define GL_INTENSITY16_SNORM 0x901B
-/* reuse GL_RED_SNORM */
-/* reuse GL_RG_SNORM */
-/* reuse GL_RGB_SNORM */
-/* reuse GL_RGBA_SNORM */
-/* reuse GL_R8_SNORM */
-/* reuse GL_RG8_SNORM */
-/* reuse GL_RGB8_SNORM */
-/* reuse GL_RGBA8_SNORM */
-/* reuse GL_R16_SNORM */
-/* reuse GL_RG16_SNORM */
-/* reuse GL_RGB16_SNORM */
-/* reuse GL_RGBA16_SNORM */
-/* reuse GL_SIGNED_NORMALIZED */
-#endif
-
-#ifndef GL_AMD_draw_buffers_blend
-#endif
-
-#ifndef GL_APPLE_texture_range
-#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7
-#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8
-#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC
-#define GL_STORAGE_PRIVATE_APPLE 0x85BD
-/* reuse GL_STORAGE_CACHED_APPLE */
-/* reuse GL_STORAGE_SHARED_APPLE */
-#endif
-
-#ifndef GL_APPLE_float_pixels
-#define GL_HALF_APPLE 0x140B
-#define GL_RGBA_FLOAT32_APPLE 0x8814
-#define GL_RGB_FLOAT32_APPLE 0x8815
-#define GL_ALPHA_FLOAT32_APPLE 0x8816
-#define GL_INTENSITY_FLOAT32_APPLE 0x8817
-#define GL_LUMINANCE_FLOAT32_APPLE 0x8818
-#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819
-#define GL_RGBA_FLOAT16_APPLE 0x881A
-#define GL_RGB_FLOAT16_APPLE 0x881B
-#define GL_ALPHA_FLOAT16_APPLE 0x881C
-#define GL_INTENSITY_FLOAT16_APPLE 0x881D
-#define GL_LUMINANCE_FLOAT16_APPLE 0x881E
-#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F
-#define GL_COLOR_FLOAT_APPLE 0x8A0F
-#endif
-
-#ifndef GL_APPLE_vertex_program_evaluators
-#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00
-#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01
-#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02
-#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03
-#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04
-#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05
-#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06
-#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07
-#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08
-#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09
-#endif
-
-#ifndef GL_APPLE_aux_depth_stencil
-#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14
-#endif
-
-#ifndef GL_APPLE_object_purgeable
-#define GL_BUFFER_OBJECT_APPLE 0x85B3
-#define GL_RELEASED_APPLE 0x8A19
-#define GL_VOLATILE_APPLE 0x8A1A
-#define GL_RETAINED_APPLE 0x8A1B
-#define GL_UNDEFINED_APPLE 0x8A1C
-#define GL_PURGEABLE_APPLE 0x8A1D
-#endif
-
-#ifndef GL_APPLE_row_bytes
-#define GL_PACK_ROW_BYTES_APPLE 0x8A15
-#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16
-#endif
-
-#ifndef GL_APPLE_rgb_422
-#define GL_RGB_422_APPLE 0x8A1F
-/* reuse GL_UNSIGNED_SHORT_8_8_APPLE */
-/* reuse GL_UNSIGNED_SHORT_8_8_REV_APPLE */
-#endif
-
-#ifndef GL_NV_video_capture
-#define GL_VIDEO_BUFFER_NV 0x9020
-#define GL_VIDEO_BUFFER_BINDING_NV 0x9021
-#define GL_FIELD_UPPER_NV 0x9022
-#define GL_FIELD_LOWER_NV 0x9023
-#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024
-#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025
-#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026
-#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027
-#define GL_VIDEO_BUFFER_PITCH_NV 0x9028
-#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029
-#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A
-#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B
-#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C
-#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D
-#define GL_PARTIAL_SUCCESS_NV 0x902E
-#define GL_SUCCESS_NV 0x902F
-#define GL_FAILURE_NV 0x9030
-#define GL_YCBYCR8_422_NV 0x9031
-#define GL_YCBAYCR8A_4224_NV 0x9032
-#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033
-#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034
-#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035
-#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036
-#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037
-#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038
-#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039
-#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A
-#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B
-#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C
-#endif
+#ifndef GL_EXT_rescale_normal
+#define GL_EXT_rescale_normal 1
+#define GL_RESCALE_NORMAL_EXT 0x803A
+#endif /* GL_EXT_rescale_normal */
-#ifndef GL_NV_copy_image
+#ifndef GL_EXT_secondary_color
+#define GL_EXT_secondary_color 1
+#define GL_COLOR_SUM_EXT 0x8458
+#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
+#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue);
+GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v);
+GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue);
+GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v);
+GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue);
+GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v);
+GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue);
+GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v);
+GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue);
+GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v);
+GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue);
+GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v);
+GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue);
+GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v);
+GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue);
+GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v);
+GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer);
#endif
+#endif /* GL_EXT_secondary_color */
#ifndef GL_EXT_separate_shader_objects
+#define GL_EXT_separate_shader_objects 1
#define GL_ACTIVE_PROGRAM_EXT 0x8B8D
+typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program);
+typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program);
+GLAPI void APIENTRY glActiveProgramEXT (GLuint program);
+GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string);
#endif
+#endif /* GL_EXT_separate_shader_objects */
-#ifndef GL_NV_parameter_buffer_object2
-#endif
-
-#ifndef GL_NV_shader_buffer_load
-#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D
-#define GL_GPU_ADDRESS_NV 0x8F34
-#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35
-#endif
-
-#ifndef GL_NV_vertex_buffer_unified_memory
-#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E
-#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F
-#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20
-#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21
-#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22
-#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23
-#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24
-#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25
-#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26
-#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27
-#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28
-#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29
-#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A
-#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B
-#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C
-#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D
-#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E
-#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F
-#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30
-#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31
-#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32
-#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33
-#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40
-#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41
-#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42
-#endif
-
-#ifndef GL_NV_texture_barrier
-#endif
-
-#ifndef GL_AMD_shader_stencil_export
-#endif
-
-#ifndef GL_AMD_seamless_cubemap_per_texture
-/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB */
-#endif
+#ifndef GL_EXT_separate_specular_color
+#define GL_EXT_separate_specular_color 1
+#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8
+#define GL_SINGLE_COLOR_EXT 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
+#endif /* GL_EXT_separate_specular_color */
-#ifndef GL_AMD_conservative_depth
-#endif
+#ifndef GL_EXT_shader_image_load_formatted
+#define GL_EXT_shader_image_load_formatted 1
+#endif /* GL_EXT_shader_image_load_formatted */
#ifndef GL_EXT_shader_image_load_store
+#define GL_EXT_shader_image_load_store 1
#define GL_MAX_IMAGE_UNITS_EXT 0x8F38
#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39
#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A
@@ -4902,2620 +7254,327 @@ extern "C" {
#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800
#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000
#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF
-#endif
-
-#ifndef GL_EXT_vertex_attrib_64bit
-/* reuse GL_DOUBLE */
-#define GL_DOUBLE_VEC2_EXT 0x8FFC
-#define GL_DOUBLE_VEC3_EXT 0x8FFD
-#define GL_DOUBLE_VEC4_EXT 0x8FFE
-#define GL_DOUBLE_MAT2_EXT 0x8F46
-#define GL_DOUBLE_MAT3_EXT 0x8F47
-#define GL_DOUBLE_MAT4_EXT 0x8F48
-#define GL_DOUBLE_MAT2x3_EXT 0x8F49
-#define GL_DOUBLE_MAT2x4_EXT 0x8F4A
-#define GL_DOUBLE_MAT3x2_EXT 0x8F4B
-#define GL_DOUBLE_MAT3x4_EXT 0x8F4C
-#define GL_DOUBLE_MAT4x2_EXT 0x8F4D
-#define GL_DOUBLE_MAT4x3_EXT 0x8F4E
-#endif
-
-#ifndef GL_NV_gpu_program5
-#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A
-#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B
-#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C
-#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D
-#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44
-#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45
-#endif
-
-#ifndef GL_NV_gpu_shader5
-#define GL_INT64_NV 0x140E
-#define GL_UNSIGNED_INT64_NV 0x140F
-#define GL_INT8_NV 0x8FE0
-#define GL_INT8_VEC2_NV 0x8FE1
-#define GL_INT8_VEC3_NV 0x8FE2
-#define GL_INT8_VEC4_NV 0x8FE3
-#define GL_INT16_NV 0x8FE4
-#define GL_INT16_VEC2_NV 0x8FE5
-#define GL_INT16_VEC3_NV 0x8FE6
-#define GL_INT16_VEC4_NV 0x8FE7
-#define GL_INT64_VEC2_NV 0x8FE9
-#define GL_INT64_VEC3_NV 0x8FEA
-#define GL_INT64_VEC4_NV 0x8FEB
-#define GL_UNSIGNED_INT8_NV 0x8FEC
-#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED
-#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE
-#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF
-#define GL_UNSIGNED_INT16_NV 0x8FF0
-#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1
-#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2
-#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3
-#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5
-#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6
-#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7
-#define GL_FLOAT16_NV 0x8FF8
-#define GL_FLOAT16_VEC2_NV 0x8FF9
-#define GL_FLOAT16_VEC3_NV 0x8FFA
-#define GL_FLOAT16_VEC4_NV 0x8FFB
-/* reuse GL_PATCHES */
-#endif
-
-#ifndef GL_NV_shader_buffer_store
-#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010
-/* reuse GL_READ_WRITE */
-/* reuse GL_WRITE_ONLY */
-#endif
-
-#ifndef GL_NV_tessellation_program5
-#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8
-#define GL_TESS_CONTROL_PROGRAM_NV 0x891E
-#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F
-#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74
-#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75
-#endif
-
-#ifndef GL_NV_vertex_attrib_integer_64bit
-/* reuse GL_INT64_NV */
-/* reuse GL_UNSIGNED_INT64_NV */
-#endif
-
-#ifndef GL_NV_multisample_coverage
-#define GL_COVERAGE_SAMPLES_NV 0x80A9
-#define GL_COLOR_SAMPLES_NV 0x8E20
-#endif
-
-#ifndef GL_AMD_name_gen_delete
-#define GL_DATA_BUFFER_AMD 0x9151
-#define GL_PERFORMANCE_MONITOR_AMD 0x9152
-#define GL_QUERY_OBJECT_AMD 0x9153
-#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154
-#define GL_SAMPLER_OBJECT_AMD 0x9155
-#endif
-
-#ifndef GL_AMD_debug_output
-#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144
-#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145
-#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146
-#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147
-#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148
-#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149
-#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A
-#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B
-#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C
-#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D
-#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E
-#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F
-#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150
-#endif
-
-#ifndef GL_NV_vdpau_interop
-#define GL_SURFACE_STATE_NV 0x86EB
-#define GL_SURFACE_REGISTERED_NV 0x86FD
-#define GL_SURFACE_MAPPED_NV 0x8700
-#define GL_WRITE_DISCARD_NV 0x88BE
-#endif
-
-#ifndef GL_AMD_transform_feedback3_lines_triangles
-#endif
-
-
-/*************************************************************/
-
-#include <stddef.h>
-#ifndef GL_VERSION_2_0
-/* GL type for program/shader text */
-typedef char GLchar;
-#endif
-
-#ifndef GL_VERSION_1_5
-/* GL types for handling large vertex buffer objects */
-typedef ptrdiff_t GLintptr;
-typedef ptrdiff_t GLsizeiptr;
-#endif
-
-#ifndef GL_ARB_vertex_buffer_object
-/* GL types for handling large vertex buffer objects */
-typedef ptrdiff_t GLintptrARB;
-typedef ptrdiff_t GLsizeiptrARB;
-#endif
-
-#ifndef GL_ARB_shader_objects
-/* GL types for program/shader text and shader object handles */
-typedef char GLcharARB;
-typedef unsigned int GLhandleARB;
-#endif
-
-/* GL type for "half" precision (s10e5) float data in host memory */
-#ifndef GL_ARB_half_float_pixel
-typedef unsigned short GLhalfARB;
-#endif
-
-#ifndef GL_NV_half_float
-typedef unsigned short GLhalfNV;
-#endif
-
-#ifndef GLEXT_64_TYPES_DEFINED
-/* This code block is duplicated in glxext.h, so must be protected */
-#define GLEXT_64_TYPES_DEFINED
-/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
-/* (as used in the GL_EXT_timer_query extension). */
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-#include <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
-/* Fallback if nothing above works */
-#include <inttypes.h>
-#endif
-#endif
-
-#ifndef GL_EXT_timer_query
-typedef int64_t GLint64EXT;
-typedef uint64_t GLuint64EXT;
-#endif
-
-#ifndef GL_ARB_sync
-typedef int64_t GLint64;
-typedef uint64_t GLuint64;
-typedef struct __GLsync *GLsync;
-#endif
-
-#ifndef GL_ARB_cl_event
-/* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */
-struct _cl_context;
-struct _cl_event;
-#endif
-
-#ifndef GL_ARB_debug_output
-typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
-#endif
-
-#ifndef GL_AMD_debug_output
-typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
-#endif
-
-#ifndef GL_NV_vdpau_interop
-typedef GLintptr GLvdpauSurfaceNV;
-#endif
-
-#ifndef GL_VERSION_1_2
-#define GL_VERSION_1_2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-GLAPI void APIENTRY glBlendEquation (GLenum mode);
-GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_VERSION_1_2_DEPRECATED
-#define GL_VERSION_1_2_DEPRECATED 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, GLvoid *table);
-GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params);
-GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params);
-GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, GLvoid *image);
-GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink);
-GLAPI void APIENTRY glResetHistogram (GLenum target);
-GLAPI void APIENTRY glResetMinmax (GLenum target);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
-#endif
-
-#ifndef GL_VERSION_1_3
-#define GL_VERSION_1_3 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveTexture (GLenum texture);
-GLAPI void APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
-GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
-#endif
-
-#ifndef GL_VERSION_1_3_DEPRECATED
-#define GL_VERSION_1_3_DEPRECATED 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glClientActiveTexture (GLenum texture);
-GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s);
-GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s);
-GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s);
-GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s);
-GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t);
-GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t);
-GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t);
-GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t);
-GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r);
-GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r);
-GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q);
-GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m);
-GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m);
-GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m);
-GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
-#endif
-
-#ifndef GL_VERSION_1_4
-#define GL_VERSION_1_4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param);
-GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_VERSION_1_4_DEPRECATED
-#define GL_VERSION_1_4_DEPRECATED 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFogCoordf (GLfloat coord);
-GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord);
-GLAPI void APIENTRY glFogCoordd (GLdouble coord);
-GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord);
-GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue);
-GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v);
-GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue);
-GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v);
-GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue);
-GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v);
-GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue);
-GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v);
-GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue);
-GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v);
-GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue);
-GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v);
-GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue);
-GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v);
-GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue);
-GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v);
-GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y);
-GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y);
-GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y);
-GLAPI void APIENTRY glWindowPos2iv (const GLint *v);
-GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y);
-GLAPI void APIENTRY glWindowPos2sv (const GLshort *v);
-GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glWindowPos3iv (const GLint *v);
-GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glWindowPos3sv (const GLshort *v);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
-typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v);
-#endif
-
-#ifndef GL_VERSION_1_5
-#define GL_VERSION_1_5 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids);
-GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids);
-GLAPI GLboolean APIENTRY glIsQuery (GLuint id);
-GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id);
-GLAPI void APIENTRY glEndQuery (GLenum target);
-GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer);
-GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
-GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
-GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer);
-GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
-GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
-GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
-GLAPI GLvoid* APIENTRY glMapBuffer (GLenum target, GLenum access);
-GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target);
-GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
-typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
-typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
-typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
-typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
-typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
-typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);
-#endif
-
-#ifndef GL_VERSION_2_0
-#define GL_VERSION_2_0 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
-GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs);
-GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
-GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
-GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader);
-GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
-GLAPI void APIENTRY glCompileShader (GLuint shader);
-GLAPI GLuint APIENTRY glCreateProgram (void);
-GLAPI GLuint APIENTRY glCreateShader (GLenum type);
-GLAPI void APIENTRY glDeleteProgram (GLuint program);
-GLAPI void APIENTRY glDeleteShader (GLuint shader);
-GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader);
-GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index);
-GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index);
-GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
-GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
-GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid* *pointer);
-GLAPI GLboolean APIENTRY glIsProgram (GLuint program);
-GLAPI GLboolean APIENTRY glIsShader (GLuint shader);
-GLAPI void APIENTRY glLinkProgram (GLuint program);
-GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
-GLAPI void APIENTRY glUseProgram (GLuint program);
-GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0);
-GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
-GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GLAPI void APIENTRY glUniform1i (GLint location, GLint v0);
-GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
-GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
-GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glValidateProgram (GLuint program);
-GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x);
-GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
-GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x);
-GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
-GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y);
-GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
-typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
-typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
-typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
-typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
-typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
-typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
-typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
-typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
-typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
-typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
-typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
-typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_VERSION_2_1
-#define GL_VERSION_2_1 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-#endif
-
-#ifndef GL_VERSION_3_0
-#define GL_VERSION_3_0 1
-/* OpenGL 3.0 also reuses entry points from these extensions: */
-/* ARB_framebuffer_object */
-/* ARB_map_buffer_range */
-/* ARB_vertex_array_object */
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data);
-GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data);
-GLAPI void APIENTRY glEnablei (GLenum target, GLuint index);
-GLAPI void APIENTRY glDisablei (GLenum target, GLuint index);
-GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index);
-GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode);
-GLAPI void APIENTRY glEndTransformFeedback (void);
-GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer);
-GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
-GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp);
-GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode);
-GLAPI void APIENTRY glEndConditionalRender (void);
-GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x);
-GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y);
-GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x);
-GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y);
-GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z);
-GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params);
-GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name);
-GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0);
-GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1);
-GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2);
-GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params);
-GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value);
-GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value);
-GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value);
-GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
-GLAPI const GLubyte * APIENTRY glGetStringi (GLenum name, GLuint index);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);
-typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index);
-typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index);
-typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index);
-typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode);
-typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void);
-typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
-typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp);
-typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode);
-typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params);
-typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value);
-typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value);
-typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value);
-typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
-typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
-#endif
-
-#ifndef GL_VERSION_3_1
-#define GL_VERSION_3_1 1
-/* OpenGL 3.1 also reuses entry points from these extensions: */
-/* ARB_copy_buffer */
-/* ARB_uniform_buffer_object */
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer);
-GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer);
-typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index);
-#endif
-
-#ifndef GL_VERSION_3_2
-#define GL_VERSION_3_2 1
-/* OpenGL 3.2 also reuses entry points from these extensions: */
-/* ARB_draw_elements_base_vertex */
-/* ARB_provoking_vertex */
-/* ARB_sync */
-/* ARB_texture_multisample */
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
-GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
-GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-#endif
-
-#ifndef GL_VERSION_3_3
-#define GL_VERSION_3_3 1
-/* OpenGL 3.3 also reuses entry points from these extensions: */
-/* ARB_blend_func_extended */
-/* ARB_sampler_objects */
-/* ARB_explicit_attrib_location, but it has none */
-/* ARB_occlusion_query2 (no entry points) */
-/* ARB_shader_bit_encoding (no entry points) */
-/* ARB_texture_rgb10_a2ui (no entry points) */
-/* ARB_texture_swizzle (no entry points) */
-/* ARB_timer_query */
-/* ARB_vertex_type_2_10_10_10_rev */
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
-#endif
-
-#ifndef GL_VERSION_4_0
-#define GL_VERSION_4_0 1
-/* OpenGL 4.0 also reuses entry points from these extensions: */
-/* ARB_texture_query_lod (no entry points) */
-/* ARB_draw_indirect */
-/* ARB_gpu_shader5 (no entry points) */
-/* ARB_gpu_shader_fp64 */
-/* ARB_shader_subroutine */
-/* ARB_tessellation_shader */
-/* ARB_texture_buffer_object_rgb32 (no entry points) */
-/* ARB_texture_cube_map_array (no entry points) */
-/* ARB_texture_gather (no entry points) */
-/* ARB_transform_feedback2 */
-/* ARB_transform_feedback3 */
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMinSampleShading (GLclampf value);
-GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode);
-GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst);
-GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLclampf value);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-#endif
-
-#ifndef GL_VERSION_4_1
-#define GL_VERSION_4_1 1
-/* OpenGL 4.1 also reuses entry points from these extensions: */
-/* ARB_ES2_compatibility */
-/* ARB_get_program_binary */
-/* ARB_separate_shader_objects */
-/* ARB_shader_precision (no entry points) */
-/* ARB_vertex_attrib_64bit */
-/* ARB_viewport_array */
-#endif
-
-#ifndef GL_ARB_multitexture
-#define GL_ARB_multitexture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveTextureARB (GLenum texture);
-GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture);
-GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s);
-GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s);
-GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s);
-GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s);
-GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t);
-GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t);
-GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t);
-GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t);
-GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r);
-GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r);
-GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q);
-GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
-#endif
-
-#ifndef GL_ARB_transpose_matrix
-#define GL_ARB_transpose_matrix 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m);
-GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m);
-GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m);
-GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
-#endif
-
-#ifndef GL_ARB_multisample
-#define GL_ARB_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleCoverageARB (GLclampf value, GLboolean invert);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
-#endif
-
-#ifndef GL_ARB_texture_env_add
-#define GL_ARB_texture_env_add 1
-#endif
-
-#ifndef GL_ARB_texture_cube_map
-#define GL_ARB_texture_cube_map 1
-#endif
-
-#ifndef GL_ARB_texture_compression
-#define GL_ARB_texture_compression 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, GLvoid *img);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img);
-#endif
-
-#ifndef GL_ARB_texture_border_clamp
-#define GL_ARB_texture_border_clamp 1
-#endif
-
-#ifndef GL_ARB_point_parameters
-#define GL_ARB_point_parameters 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_ARB_vertex_blend
-#define GL_ARB_vertex_blend 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights);
-GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights);
-GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights);
-GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights);
-GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights);
-GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights);
-GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights);
-GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights);
-GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glVertexBlendARB (GLint count);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);
-typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);
-typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights);
-typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
-typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights);
-typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
-#endif
-
-#ifndef GL_ARB_matrix_palette
-#define GL_ARB_matrix_palette 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index);
-GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices);
-GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices);
-GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices);
-GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_ARB_texture_env_combine
-#define GL_ARB_texture_env_combine 1
-#endif
-
-#ifndef GL_ARB_texture_env_crossbar
-#define GL_ARB_texture_env_crossbar 1
-#endif
-
-#ifndef GL_ARB_texture_env_dot3
-#define GL_ARB_texture_env_dot3 1
-#endif
-
-#ifndef GL_ARB_texture_mirrored_repeat
-#define GL_ARB_texture_mirrored_repeat 1
-#endif
-
-#ifndef GL_ARB_depth_texture
-#define GL_ARB_depth_texture 1
-#endif
-
-#ifndef GL_ARB_shadow
-#define GL_ARB_shadow 1
-#endif
-
-#ifndef GL_ARB_shadow_ambient
-#define GL_ARB_shadow_ambient 1
-#endif
-
-#ifndef GL_ARB_window_pos
-#define GL_ARB_window_pos 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y);
-GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y);
-GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y);
-GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v);
-GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y);
-GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v);
-GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v);
-GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);
-#endif
-
-#ifndef GL_ARB_vertex_program
-#define GL_ARB_vertex_program 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x);
-GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x);
-GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x);
-GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y);
-GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y);
-GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index);
-GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index);
-GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
-GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program);
-GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs);
-GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs);
-GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);
-GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);
-GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);
-GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);
-GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params);
-GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params);
-GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params);
-GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params);
-GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, GLvoid *string);
-GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, GLvoid* *pointer);
-GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
-typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);
-#endif
-
-#ifndef GL_ARB_fragment_program
-#define GL_ARB_fragment_program 1
-/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */
-#endif
-
-#ifndef GL_ARB_vertex_buffer_object
-#define GL_ARB_vertex_buffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer);
-GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers);
-GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers);
-GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer);
-GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
-GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
-GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
-GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum target, GLenum access);
-GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target);
-GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid* *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
-typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
-typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
-typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
-typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
-typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
-typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params);
-#endif
-
-#ifndef GL_ARB_occlusion_query
-#define GL_ARB_occlusion_query 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids);
-GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids);
-GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id);
-GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id);
-GLAPI void APIENTRY glEndQueryARB (GLenum target);
-GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);
-#endif
-
-#ifndef GL_ARB_shader_objects
-#define GL_ARB_shader_objects 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj);
-GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname);
-GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj);
-GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType);
-GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
-GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj);
-GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);
-GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj);
-GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj);
-GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj);
-GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj);
-GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0);
-GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1);
-GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0);
-GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1);
-GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2);
-GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
-GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
-GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name);
-GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params);
-GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params);
-GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
-typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
-typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
-typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
-typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
-typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
-typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
-typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
-typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
-typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
-typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
-typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
-#endif
-
-#ifndef GL_ARB_vertex_shader
-#define GL_ARB_vertex_shader 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name);
-GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
-#endif
-
-#ifndef GL_ARB_fragment_shader
-#define GL_ARB_fragment_shader 1
-#endif
-
-#ifndef GL_ARB_shading_language_100
-#define GL_ARB_shading_language_100 1
-#endif
-
-#ifndef GL_ARB_texture_non_power_of_two
-#define GL_ARB_texture_non_power_of_two 1
-#endif
-
-#ifndef GL_ARB_point_sprite
-#define GL_ARB_point_sprite 1
-#endif
-
-#ifndef GL_ARB_fragment_program_shadow
-#define GL_ARB_fragment_program_shadow 1
-#endif
-
-#ifndef GL_ARB_draw_buffers
-#define GL_ARB_draw_buffers 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);
-#endif
-
-#ifndef GL_ARB_texture_rectangle
-#define GL_ARB_texture_rectangle 1
-#endif
-
-#ifndef GL_ARB_color_buffer_float
-#define GL_ARB_color_buffer_float 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
-#endif
-
-#ifndef GL_ARB_half_float_pixel
-#define GL_ARB_half_float_pixel 1
-#endif
-
-#ifndef GL_ARB_texture_float
-#define GL_ARB_texture_float 1
-#endif
-
-#ifndef GL_ARB_pixel_buffer_object
-#define GL_ARB_pixel_buffer_object 1
-#endif
-
-#ifndef GL_ARB_depth_buffer_float
-#define GL_ARB_depth_buffer_float 1
-#endif
-
-#ifndef GL_ARB_draw_instanced
-#define GL_ARB_draw_instanced 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-#endif
-
-#ifndef GL_ARB_framebuffer_object
-#define GL_ARB_framebuffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer);
-GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
-GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
-GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
-GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer);
-GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
-GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
-GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
-GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target);
-GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGenerateMipmap (GLenum target);
-GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
-typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
-typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
-typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
-typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-#endif
-
-#ifndef GL_ARB_framebuffer_sRGB
-#define GL_ARB_framebuffer_sRGB 1
-#endif
-
-#ifndef GL_ARB_geometry_shader4
-#define GL_ARB_geometry_shader4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value);
-GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
-#endif
-
-#ifndef GL_ARB_half_float_vertex
-#define GL_ARB_half_float_vertex 1
-#endif
-
-#ifndef GL_ARB_instanced_arrays
-#define GL_ARB_instanced_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor);
-#endif
-
-#ifndef GL_ARB_map_buffer_range
-#define GL_ARB_map_buffer_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
-#endif
-
-#ifndef GL_ARB_texture_buffer_object
-#define GL_ARB_texture_buffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer);
-#endif
-
-#ifndef GL_ARB_texture_compression_rgtc
-#define GL_ARB_texture_compression_rgtc 1
-#endif
-
-#ifndef GL_ARB_texture_rg
-#define GL_ARB_texture_rg 1
-#endif
-
-#ifndef GL_ARB_vertex_array_object
-#define GL_ARB_vertex_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindVertexArray (GLuint array);
-GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
-GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
-GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);
-typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
-typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
-typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array);
-#endif
-
-#ifndef GL_ARB_uniform_buffer_object
-#define GL_ARB_uniform_buffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices);
-GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
-GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName);
-GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
-GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
-typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
-typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-#endif
-
-#ifndef GL_ARB_compatibility
-#define GL_ARB_compatibility 1
-#endif
-
-#ifndef GL_ARB_copy_buffer
-#define GL_ARB_copy_buffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-#endif
-
-#ifndef GL_ARB_shader_texture_lod
-#define GL_ARB_shader_texture_lod 1
-#endif
-
-#ifndef GL_ARB_depth_clamp
-#define GL_ARB_depth_clamp 1
-#endif
-
-#ifndef GL_ARB_draw_elements_base_vertex
-#define GL_ARB_draw_elements_base_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
-GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
-GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex);
-GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, const GLint *basevertex);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, const GLint *basevertex);
-#endif
-
-#ifndef GL_ARB_fragment_coord_conventions
-#define GL_ARB_fragment_coord_conventions 1
-#endif
-
-#ifndef GL_ARB_provoking_vertex
-#define GL_ARB_provoking_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProvokingVertex (GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode);
-#endif
-
-#ifndef GL_ARB_seamless_cube_map
-#define GL_ARB_seamless_cube_map 1
-#endif
-
-#ifndef GL_ARB_sync
-#define GL_ARB_sync 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags);
-GLAPI GLboolean APIENTRY glIsSync (GLsync sync);
-GLAPI void APIENTRY glDeleteSync (GLsync sync);
-GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
-GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
-GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *params);
-GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
-typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync);
-typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync);
-typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
-typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
-typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params);
-typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-#endif
-
-#ifndef GL_ARB_texture_multisample
-#define GL_ARB_texture_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val);
-GLAPI void APIENTRY glSampleMaski (GLuint index, GLbitfield mask);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val);
-typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask);
-#endif
-
-#ifndef GL_ARB_vertex_array_bgra
-#define GL_ARB_vertex_array_bgra 1
-#endif
-
-#ifndef GL_ARB_draw_buffers_blend
-#define GL_ARB_draw_buffers_blend 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode);
-GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst);
-GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-#endif
-
-#ifndef GL_ARB_sample_shading
-#define GL_ARB_sample_shading 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMinSampleShadingARB (GLclampf value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value);
-#endif
-
-#ifndef GL_ARB_texture_cube_map_array
-#define GL_ARB_texture_cube_map_array 1
-#endif
-
-#ifndef GL_ARB_texture_gather
-#define GL_ARB_texture_gather 1
-#endif
-
-#ifndef GL_ARB_texture_query_lod
-#define GL_ARB_texture_query_lod 1
-#endif
-
-#ifndef GL_ARB_shading_language_include
-#define GL_ARB_shading_language_include 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);
-GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name);
-GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length);
-GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name);
-GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);
-GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);
-typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);
-typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length);
-typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);
-typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_ARB_texture_compression_bptc
-#define GL_ARB_texture_compression_bptc 1
-#endif
-
-#ifndef GL_ARB_blend_func_extended
-#define GL_ARB_blend_func_extended 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
-GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name);
-#endif
-
-#ifndef GL_ARB_explicit_attrib_location
-#define GL_ARB_explicit_attrib_location 1
-#endif
-
-#ifndef GL_ARB_occlusion_query2
-#define GL_ARB_occlusion_query2 1
-#endif
-
-#ifndef GL_ARB_sampler_objects
-#define GL_ARB_sampler_objects 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
-GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers);
-GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler);
-GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler);
-GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param);
-GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param);
-GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param);
-GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param);
-GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param);
-GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
-typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);
-typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler);
-typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param);
-typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params);
-#endif
-
-#ifndef GL_ARB_texture_rgb10_a2ui
-#define GL_ARB_texture_rgb10_a2ui 1
-#endif
-
-#ifndef GL_ARB_texture_swizzle
-#define GL_ARB_texture_swizzle 1
-#endif
-
-#ifndef GL_ARB_timer_query
-#define GL_ARB_timer_query 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target);
-GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params);
-GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params);
-#endif
-
-#ifndef GL_ARB_vertex_type_2_10_10_10_rev
-#define GL_ARB_vertex_type_2_10_10_10_rev 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value);
-GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value);
-GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value);
-GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value);
-GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value);
-GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value);
-GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords);
-GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords);
-GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords);
-GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords);
-GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color);
-GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color);
-GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color);
-GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color);
-GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color);
-GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color);
-GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value);
-typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color);
-typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color);
-typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color);
-typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-#endif
-
-#ifndef GL_ARB_draw_indirect
-#define GL_ARB_draw_indirect 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const GLvoid *indirect);
-GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const GLvoid *indirect);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect);
-#endif
-
-#ifndef GL_ARB_gpu_shader5
-#define GL_ARB_gpu_shader5 1
-#endif
-
-#ifndef GL_ARB_gpu_shader_fp64
-#define GL_ARB_gpu_shader_fp64 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x);
-GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x);
-typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params);
-#endif
-
-#ifndef GL_ARB_shader_subroutine
-#define GL_ARB_shader_subroutine 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name);
-GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name);
-GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
-GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
-GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
-GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices);
-GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params);
-GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name);
-typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
-typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
-typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices);
-typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
-#endif
-
-#ifndef GL_ARB_tessellation_shader
-#define GL_ARB_tessellation_shader 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value);
-GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value);
-typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values);
-#endif
-
-#ifndef GL_ARB_texture_buffer_object_rgb32
-#define GL_ARB_texture_buffer_object_rgb32 1
-#endif
-
-#ifndef GL_ARB_transform_feedback2
-#define GL_ARB_transform_feedback2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id);
-GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids);
-GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids);
-GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id);
-GLAPI void APIENTRY glPauseTransformFeedback (void);
-GLAPI void APIENTRY glResumeTransformFeedback (void);
-GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids);
-typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void);
-typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void);
-typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id);
-#endif
-
-#ifndef GL_ARB_transform_feedback3
-#define GL_ARB_transform_feedback3 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream);
-GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id);
-GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index);
-GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream);
-typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id);
-typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index);
-typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_ARB_ES2_compatibility
-#define GL_ARB_ES2_compatibility 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glReleaseShaderCompiler (void);
-GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length);
-GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
-GLAPI void APIENTRY glDepthRangef (GLclampf n, GLclampf f);
-GLAPI void APIENTRY glClearDepthf (GLclampf d);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
-typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length);
-typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
-typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f);
-typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLclampf d);
-#endif
-
-#ifndef GL_ARB_get_program_binary
-#define GL_ARB_get_program_binary 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
-GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
-GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
-typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
-#endif
-
-#ifndef GL_ARB_separate_shader_objects
-#define GL_ARB_separate_shader_objects 1
+typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
+typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program);
-GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program);
-GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar* *strings);
-GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline);
-GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines);
-GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines);
-GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline);
-GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params);
-GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0);
-GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0);
-GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0);
-GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0);
-GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1);
-GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1);
-GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1);
-GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);
-GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
-GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline);
-GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
-typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program);
-typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar* *strings);
-typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines);
-typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
+GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers);
#endif
+#endif /* GL_EXT_shader_image_load_store */
-#ifndef GL_ARB_vertex_attrib_64bit
-#define GL_ARB_vertex_attrib_64bit 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x);
-GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params);
-#endif
+#ifndef GL_EXT_shader_integer_mix
+#define GL_EXT_shader_integer_mix 1
+#endif /* GL_EXT_shader_integer_mix */
-#ifndef GL_ARB_viewport_array
-#define GL_ARB_viewport_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v);
-GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
-GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v);
-GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLclampd *v);
-GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLclampd n, GLclampd f);
-GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data);
-GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
-typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v);
-typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd *v);
-typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f);
-typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data);
-#endif
+#ifndef GL_EXT_shadow_funcs
+#define GL_EXT_shadow_funcs 1
+#endif /* GL_EXT_shadow_funcs */
-#ifndef GL_ARB_cl_event
-#define GL_ARB_cl_event 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context * context, struct _cl_event * event, GLbitfield flags);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context * context, struct _cl_event * event, GLbitfield flags);
-#endif
+#ifndef GL_EXT_shared_texture_palette
+#define GL_EXT_shared_texture_palette 1
+#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
+#endif /* GL_EXT_shared_texture_palette */
-#ifndef GL_ARB_debug_output
-#define GL_ARB_debug_output 1
+#ifndef GL_EXT_stencil_clear_tag
+#define GL_EXT_stencil_clear_tag 1
+#define GL_STENCIL_TAG_BITS_EXT 0x88F2
+#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3
+typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const GLvoid *userParam);
-GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam);
-typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag);
#endif
+#endif /* GL_EXT_stencil_clear_tag */
-#ifndef GL_ARB_robustness
-#define GL_ARB_robustness 1
+#ifndef GL_EXT_stencil_two_side
+#define GL_EXT_stencil_two_side 1
+#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910
+#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911
+typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void);
-GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
-GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
-GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
-GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values);
-GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values);
-GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values);
-GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern);
-GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table);
-GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image);
-GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span);
-GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
-GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
-GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img);
-GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
-GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img);
-GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
-GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
-GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void);
-typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
-typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
-typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
-typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values);
-typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values);
-typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values);
-typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern);
-typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table);
-typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image);
-typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span);
-typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img);
-typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
-typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img);
-typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
-typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
-#endif
-
-#ifndef GL_ARB_shader_stencil_export
-#define GL_ARB_shader_stencil_export 1
-#endif
-
-#ifndef GL_EXT_abgr
-#define GL_EXT_abgr 1
+GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face);
#endif
+#endif /* GL_EXT_stencil_two_side */
-#ifndef GL_EXT_blend_color
-#define GL_EXT_blend_color 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendColorEXT (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-#endif
+#ifndef GL_EXT_stencil_wrap
+#define GL_EXT_stencil_wrap 1
+#define GL_INCR_WRAP_EXT 0x8507
+#define GL_DECR_WRAP_EXT 0x8508
+#endif /* GL_EXT_stencil_wrap */
-#ifndef GL_EXT_polygon_offset
-#define GL_EXT_polygon_offset 1
+#ifndef GL_EXT_subtexture
+#define GL_EXT_subtexture 1
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
+GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels);
+GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
#endif
+#endif /* GL_EXT_subtexture */
#ifndef GL_EXT_texture
#define GL_EXT_texture 1
-#endif
+#define GL_ALPHA4_EXT 0x803B
+#define GL_ALPHA8_EXT 0x803C
+#define GL_ALPHA12_EXT 0x803D
+#define GL_ALPHA16_EXT 0x803E
+#define GL_LUMINANCE4_EXT 0x803F
+#define GL_LUMINANCE8_EXT 0x8040
+#define GL_LUMINANCE12_EXT 0x8041
+#define GL_LUMINANCE16_EXT 0x8042
+#define GL_LUMINANCE4_ALPHA4_EXT 0x8043
+#define GL_LUMINANCE6_ALPHA2_EXT 0x8044
+#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
+#define GL_LUMINANCE12_ALPHA4_EXT 0x8046
+#define GL_LUMINANCE12_ALPHA12_EXT 0x8047
+#define GL_LUMINANCE16_ALPHA16_EXT 0x8048
+#define GL_INTENSITY_EXT 0x8049
+#define GL_INTENSITY4_EXT 0x804A
+#define GL_INTENSITY8_EXT 0x804B
+#define GL_INTENSITY12_EXT 0x804C
+#define GL_INTENSITY16_EXT 0x804D
+#define GL_RGB2_EXT 0x804E
+#define GL_RGB4_EXT 0x804F
+#define GL_RGB5_EXT 0x8050
+#define GL_RGB8_EXT 0x8051
+#define GL_RGB10_EXT 0x8052
+#define GL_RGB12_EXT 0x8053
+#define GL_RGB16_EXT 0x8054
+#define GL_RGBA2_EXT 0x8055
+#define GL_RGBA4_EXT 0x8056
+#define GL_RGB5_A1_EXT 0x8057
+#define GL_RGBA8_EXT 0x8058
+#define GL_RGB10_A2_EXT 0x8059
+#define GL_RGBA12_EXT 0x805A
+#define GL_RGBA16_EXT 0x805B
+#define GL_TEXTURE_RED_SIZE_EXT 0x805C
+#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D
+#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E
+#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060
+#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061
+#define GL_REPLACE_EXT 0x8062
+#define GL_PROXY_TEXTURE_1D_EXT 0x8063
+#define GL_PROXY_TEXTURE_2D_EXT 0x8064
+#define GL_TEXTURE_TOO_LARGE_EXT 0x8065
+#endif /* GL_EXT_texture */
#ifndef GL_EXT_texture3D
#define GL_EXT_texture3D 1
+#define GL_PACK_SKIP_IMAGES_EXT 0x806B
+#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C
+#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E
+#define GL_TEXTURE_3D_EXT 0x806F
+#define GL_PROXY_TEXTURE_3D_EXT 0x8070
+#define GL_TEXTURE_DEPTH_EXT 0x8071
+#define GL_TEXTURE_WRAP_R_EXT 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073
+typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
#endif
+#endif /* GL_EXT_texture3D */
-#ifndef GL_SGIS_texture_filter4
-#define GL_SGIS_texture_filter4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights);
-GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);
-typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
-#endif
+#ifndef GL_EXT_texture_array
+#define GL_EXT_texture_array 1
+#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18
+#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19
+#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
+#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B
+#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
+#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
+#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
+#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E
+#endif /* GL_EXT_texture_array */
-#ifndef GL_EXT_subtexture
-#define GL_EXT_subtexture 1
+#ifndef GL_EXT_texture_buffer_object
+#define GL_EXT_texture_buffer_object 1
+#define GL_TEXTURE_BUFFER_EXT 0x8C2A
+#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B
+#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D
+#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E
+typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer);
#endif
+#endif /* GL_EXT_texture_buffer_object */
-#ifndef GL_EXT_copy_texture
-#define GL_EXT_copy_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
+#ifndef GL_EXT_texture_compression_latc
+#define GL_EXT_texture_compression_latc 1
+#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70
+#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71
+#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72
+#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73
+#endif /* GL_EXT_texture_compression_latc */
-#ifndef GL_EXT_histogram
-#define GL_EXT_histogram 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink);
-GLAPI void APIENTRY glResetHistogramEXT (GLenum target);
-GLAPI void APIENTRY glResetMinmaxEXT (GLenum target);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target);
-#endif
+#ifndef GL_EXT_texture_compression_rgtc
+#define GL_EXT_texture_compression_rgtc 1
+#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB
+#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
+#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
+#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
+#endif /* GL_EXT_texture_compression_rgtc */
-#ifndef GL_EXT_convolution
-#define GL_EXT_convolution 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params);
-GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params);
-GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *image);
-GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-#endif
+#ifndef GL_EXT_texture_compression_s3tc
+#define GL_EXT_texture_compression_s3tc 1
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
+#endif /* GL_EXT_texture_compression_s3tc */
-#ifndef GL_SGI_color_matrix
-#define GL_SGI_color_matrix 1
-#endif
+#ifndef GL_EXT_texture_cube_map
+#define GL_EXT_texture_cube_map 1
+#define GL_NORMAL_MAP_EXT 0x8511
+#define GL_REFLECTION_MAP_EXT 0x8512
+#define GL_TEXTURE_CUBE_MAP_EXT 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C
+#endif /* GL_EXT_texture_cube_map */
-#ifndef GL_SGI_color_table
-#define GL_SGI_color_table 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, GLvoid *table);
-GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);
-#endif
+#ifndef GL_EXT_texture_env_add
+#define GL_EXT_texture_env_add 1
+#endif /* GL_EXT_texture_env_add */
-#ifndef GL_SGIX_pixel_texture
-#define GL_SGIX_pixel_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
-#endif
+#ifndef GL_EXT_texture_env_combine
+#define GL_EXT_texture_env_combine 1
+#define GL_COMBINE_EXT 0x8570
+#define GL_COMBINE_RGB_EXT 0x8571
+#define GL_COMBINE_ALPHA_EXT 0x8572
+#define GL_RGB_SCALE_EXT 0x8573
+#define GL_ADD_SIGNED_EXT 0x8574
+#define GL_INTERPOLATE_EXT 0x8575
+#define GL_CONSTANT_EXT 0x8576
+#define GL_PRIMARY_COLOR_EXT 0x8577
+#define GL_PREVIOUS_EXT 0x8578
+#define GL_SOURCE0_RGB_EXT 0x8580
+#define GL_SOURCE1_RGB_EXT 0x8581
+#define GL_SOURCE2_RGB_EXT 0x8582
+#define GL_SOURCE0_ALPHA_EXT 0x8588
+#define GL_SOURCE1_ALPHA_EXT 0x8589
+#define GL_SOURCE2_ALPHA_EXT 0x858A
+#define GL_OPERAND0_RGB_EXT 0x8590
+#define GL_OPERAND1_RGB_EXT 0x8591
+#define GL_OPERAND2_RGB_EXT 0x8592
+#define GL_OPERAND0_ALPHA_EXT 0x8598
+#define GL_OPERAND1_ALPHA_EXT 0x8599
+#define GL_OPERAND2_ALPHA_EXT 0x859A
+#endif /* GL_EXT_texture_env_combine */
-#ifndef GL_SGIS_pixel_texture
-#define GL_SGIS_pixel_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param);
-GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params);
-GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);
-#endif
+#ifndef GL_EXT_texture_env_dot3
+#define GL_EXT_texture_env_dot3 1
+#define GL_DOT3_RGB_EXT 0x8740
+#define GL_DOT3_RGBA_EXT 0x8741
+#endif /* GL_EXT_texture_env_dot3 */
-#ifndef GL_SGIS_texture4D
-#define GL_SGIS_texture4D 1
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+#endif /* GL_EXT_texture_filter_anisotropic */
+
+#ifndef GL_EXT_texture_integer
+#define GL_EXT_texture_integer 1
+#define GL_RGBA32UI_EXT 0x8D70
+#define GL_RGB32UI_EXT 0x8D71
+#define GL_ALPHA32UI_EXT 0x8D72
+#define GL_INTENSITY32UI_EXT 0x8D73
+#define GL_LUMINANCE32UI_EXT 0x8D74
+#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75
+#define GL_RGBA16UI_EXT 0x8D76
+#define GL_RGB16UI_EXT 0x8D77
+#define GL_ALPHA16UI_EXT 0x8D78
+#define GL_INTENSITY16UI_EXT 0x8D79
+#define GL_LUMINANCE16UI_EXT 0x8D7A
+#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B
+#define GL_RGBA8UI_EXT 0x8D7C
+#define GL_RGB8UI_EXT 0x8D7D
+#define GL_ALPHA8UI_EXT 0x8D7E
+#define GL_INTENSITY8UI_EXT 0x8D7F
+#define GL_LUMINANCE8UI_EXT 0x8D80
+#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81
+#define GL_RGBA32I_EXT 0x8D82
+#define GL_RGB32I_EXT 0x8D83
+#define GL_ALPHA32I_EXT 0x8D84
+#define GL_INTENSITY32I_EXT 0x8D85
+#define GL_LUMINANCE32I_EXT 0x8D86
+#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87
+#define GL_RGBA16I_EXT 0x8D88
+#define GL_RGB16I_EXT 0x8D89
+#define GL_ALPHA16I_EXT 0x8D8A
+#define GL_INTENSITY16I_EXT 0x8D8B
+#define GL_LUMINANCE16I_EXT 0x8D8C
+#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D
+#define GL_RGBA8I_EXT 0x8D8E
+#define GL_RGB8I_EXT 0x8D8F
+#define GL_ALPHA8I_EXT 0x8D90
+#define GL_INTENSITY8I_EXT 0x8D91
+#define GL_LUMINANCE8I_EXT 0x8D92
+#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93
+#define GL_RED_INTEGER_EXT 0x8D94
+#define GL_GREEN_INTEGER_EXT 0x8D95
+#define GL_BLUE_INTEGER_EXT 0x8D96
+#define GL_ALPHA_INTEGER_EXT 0x8D97
+#define GL_RGB_INTEGER_EXT 0x8D98
+#define GL_RGBA_INTEGER_EXT 0x8D99
+#define GL_BGR_INTEGER_EXT 0x8D9A
+#define GL_BGRA_INTEGER_EXT 0x8D9B
+#define GL_LUMINANCE_INTEGER_EXT 0x8D9C
+#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D
+#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E
+typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha);
+typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha);
+GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha);
#endif
+#endif /* GL_EXT_texture_integer */
-#ifndef GL_SGI_texture_color_table
-#define GL_SGI_texture_color_table 1
-#endif
+#ifndef GL_EXT_texture_lod_bias
+#define GL_EXT_texture_lod_bias 1
+#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
+#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
+#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
+#endif /* GL_EXT_texture_lod_bias */
-#ifndef GL_EXT_cmyka
-#define GL_EXT_cmyka 1
-#endif
+#ifndef GL_EXT_texture_mirror_clamp
+#define GL_EXT_texture_mirror_clamp 1
+#define GL_MIRROR_CLAMP_EXT 0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743
+#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912
+#endif /* GL_EXT_texture_mirror_clamp */
#ifndef GL_EXT_texture_object
#define GL_EXT_texture_object 1
+#define GL_TEXTURE_PRIORITY_EXT 0x8066
+#define GL_TEXTURE_RESIDENT_EXT 0x8067
+#define GL_TEXTURE_1D_BINDING_EXT 0x8068
+#define GL_TEXTURE_2D_BINDING_EXT 0x8069
+#define GL_TEXTURE_3D_BINDING_EXT 0x806A
+typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
+typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);
+typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);
+typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture);
+typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences);
GLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture);
@@ -7523,1003 +7582,738 @@ GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures);
GLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures);
GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture);
GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
-typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
-typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);
-typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);
-typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture);
-typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
#endif
+#endif /* GL_EXT_texture_object */
-#ifndef GL_SGIS_detail_texture
-#define GL_SGIS_detail_texture 1
+#ifndef GL_EXT_texture_perturb_normal
+#define GL_EXT_texture_perturb_normal 1
+#define GL_PERTURB_EXT 0x85AE
+#define GL_TEXTURE_NORMAL_EXT 0x85AF
+typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);
-GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
+GLAPI void APIENTRY glTextureNormalEXT (GLenum mode);
#endif
+#endif /* GL_EXT_texture_perturb_normal */
-#ifndef GL_SGIS_sharpen_texture
-#define GL_SGIS_sharpen_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);
-GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
-#endif
+#ifndef GL_EXT_texture_sRGB
+#define GL_EXT_texture_sRGB 1
+#define GL_SRGB_EXT 0x8C40
+#define GL_SRGB8_EXT 0x8C41
+#define GL_SRGB_ALPHA_EXT 0x8C42
+#define GL_SRGB8_ALPHA8_EXT 0x8C43
+#define GL_SLUMINANCE_ALPHA_EXT 0x8C44
+#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45
+#define GL_SLUMINANCE_EXT 0x8C46
+#define GL_SLUMINANCE8_EXT 0x8C47
+#define GL_COMPRESSED_SRGB_EXT 0x8C48
+#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49
+#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A
+#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B
+#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
+#endif /* GL_EXT_texture_sRGB */
-#ifndef GL_EXT_packed_pixels
-#define GL_EXT_packed_pixels 1
-#endif
+#ifndef GL_EXT_texture_sRGB_decode
+#define GL_EXT_texture_sRGB_decode 1
+#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48
+#define GL_DECODE_EXT 0x8A49
+#define GL_SKIP_DECODE_EXT 0x8A4A
+#endif /* GL_EXT_texture_sRGB_decode */
-#ifndef GL_SGIS_texture_lod
-#define GL_SGIS_texture_lod 1
-#endif
+#ifndef GL_EXT_texture_shared_exponent
+#define GL_EXT_texture_shared_exponent 1
+#define GL_RGB9_E5_EXT 0x8C3D
+#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E
+#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F
+#endif /* GL_EXT_texture_shared_exponent */
-#ifndef GL_SGIS_multisample
-#define GL_SGIS_multisample 1
+#ifndef GL_EXT_texture_snorm
+#define GL_EXT_texture_snorm 1
+#define GL_ALPHA_SNORM 0x9010
+#define GL_LUMINANCE_SNORM 0x9011
+#define GL_LUMINANCE_ALPHA_SNORM 0x9012
+#define GL_INTENSITY_SNORM 0x9013
+#define GL_ALPHA8_SNORM 0x9014
+#define GL_LUMINANCE8_SNORM 0x9015
+#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016
+#define GL_INTENSITY8_SNORM 0x9017
+#define GL_ALPHA16_SNORM 0x9018
+#define GL_LUMINANCE16_SNORM 0x9019
+#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A
+#define GL_INTENSITY16_SNORM 0x901B
+#define GL_RED_SNORM 0x8F90
+#define GL_RG_SNORM 0x8F91
+#define GL_RGB_SNORM 0x8F92
+#define GL_RGBA_SNORM 0x8F93
+#endif /* GL_EXT_texture_snorm */
+
+#ifndef GL_EXT_texture_swizzle
+#define GL_EXT_texture_swizzle 1
+#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42
+#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43
+#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44
+#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45
+#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46
+#endif /* GL_EXT_texture_swizzle */
+
+#ifndef GL_EXT_timer_query
+#define GL_EXT_timer_query 1
+#define GL_TIME_ELAPSED_EXT 0x88BF
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert);
-GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
+GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params);
+GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params);
#endif
+#endif /* GL_EXT_timer_query */
-#ifndef GL_EXT_rescale_normal
-#define GL_EXT_rescale_normal 1
+#ifndef GL_EXT_transform_feedback
+#define GL_EXT_transform_feedback 1
+#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F
+#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C
+#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D
+#define GL_PRIMITIVES_GENERATED_EXT 0x8C87
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88
+#define GL_RASTERIZER_DISCARD_EXT 0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80
+#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F
+#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76
+typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode);
+typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void);
+typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode);
+GLAPI void APIENTRY glEndTransformFeedbackEXT (void);
+GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer);
+GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
+GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
#endif
+#endif /* GL_EXT_transform_feedback */
#ifndef GL_EXT_vertex_array
#define GL_EXT_vertex_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glArrayElementEXT (GLint i);
-GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count);
-GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer);
-GLAPI void APIENTRY glGetPointervEXT (GLenum pname, GLvoid* *params);
-GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
+#define GL_VERTEX_ARRAY_EXT 0x8074
+#define GL_NORMAL_ARRAY_EXT 0x8075
+#define GL_COLOR_ARRAY_EXT 0x8076
+#define GL_INDEX_ARRAY_EXT 0x8077
+#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078
+#define GL_EDGE_FLAG_ARRAY_EXT 0x8079
+#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A
+#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B
+#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C
+#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D
+#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E
+#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F
+#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080
+#define GL_COLOR_ARRAY_SIZE_EXT 0x8081
+#define GL_COLOR_ARRAY_TYPE_EXT 0x8082
+#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083
+#define GL_COLOR_ARRAY_COUNT_EXT 0x8084
+#define GL_INDEX_ARRAY_TYPE_EXT 0x8085
+#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086
+#define GL_INDEX_ARRAY_COUNT_EXT 0x8087
+#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
+#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B
+#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C
+#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D
+#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E
+#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F
+#define GL_COLOR_ARRAY_POINTER_EXT 0x8090
+#define GL_INDEX_ARRAY_POINTER_EXT 0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093
typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i);
-typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer);
typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);
-typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);
-typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_misc_attribute
-#define GL_EXT_misc_attribute 1
-#endif
-
-#ifndef GL_SGIS_generate_mipmap
-#define GL_SGIS_generate_mipmap 1
-#endif
-
-#ifndef GL_SGIX_clipmap
-#define GL_SGIX_clipmap 1
-#endif
-
-#ifndef GL_SGIX_shadow
-#define GL_SGIX_shadow 1
-#endif
-
-#ifndef GL_SGIS_texture_edge_clamp
-#define GL_SGIS_texture_edge_clamp 1
-#endif
-
-#ifndef GL_SGIS_texture_border_clamp
-#define GL_SGIS_texture_border_clamp 1
-#endif
-
-#ifndef GL_EXT_blend_minmax
-#define GL_EXT_blend_minmax 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationEXT (GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
-#endif
-
-#ifndef GL_EXT_blend_subtract
-#define GL_EXT_blend_subtract 1
-#endif
-
-#ifndef GL_EXT_blend_logic_op
-#define GL_EXT_blend_logic_op 1
-#endif
-
-#ifndef GL_SGIX_interlace
-#define GL_SGIX_interlace 1
-#endif
-
-#ifndef GL_SGIX_pixel_tiles
-#define GL_SGIX_pixel_tiles 1
-#endif
-
-#ifndef GL_SGIX_texture_select
-#define GL_SGIX_texture_select 1
-#endif
-
-#ifndef GL_SGIX_sprite
-#define GL_SGIX_sprite 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param);
-GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_SGIX_texture_multi_buffer
-#define GL_SGIX_texture_multi_buffer 1
-#endif
-
-#ifndef GL_EXT_point_parameters
-#define GL_EXT_point_parameters 1
+typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, void **params);
+typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer);
+typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_SGIS_point_parameters
-#define GL_SGIS_point_parameters 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_SGIX_instruments
-#define GL_SGIX_instruments 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLint APIENTRY glGetInstrumentsSGIX (void);
-GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer);
-GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p);
-GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker);
-GLAPI void APIENTRY glStartInstrumentsSGIX (void);
-GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);
-typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
-typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);
-typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);
-typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void);
-typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);
+GLAPI void APIENTRY glArrayElementEXT (GLint i);
+GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer);
+GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count);
+GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer);
+GLAPI void APIENTRY glGetPointervEXT (GLenum pname, void **params);
+GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer);
+GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer);
+GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer);
+GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer);
#endif
+#endif /* GL_EXT_vertex_array */
-#ifndef GL_SGIX_texture_scale_bias
-#define GL_SGIX_texture_scale_bias 1
-#endif
+#ifndef GL_EXT_vertex_array_bgra
+#define GL_EXT_vertex_array_bgra 1
+#endif /* GL_EXT_vertex_array_bgra */
-#ifndef GL_SGIX_framezoom
-#define GL_SGIX_framezoom 1
+#ifndef GL_EXT_vertex_attrib_64bit
+#define GL_EXT_vertex_attrib_64bit 1
+#define GL_DOUBLE_VEC2_EXT 0x8FFC
+#define GL_DOUBLE_VEC3_EXT 0x8FFD
+#define GL_DOUBLE_VEC4_EXT 0x8FFE
+#define GL_DOUBLE_MAT2_EXT 0x8F46
+#define GL_DOUBLE_MAT3_EXT 0x8F47
+#define GL_DOUBLE_MAT4_EXT 0x8F48
+#define GL_DOUBLE_MAT2x3_EXT 0x8F49
+#define GL_DOUBLE_MAT2x4_EXT 0x8F4A
+#define GL_DOUBLE_MAT3x2_EXT 0x8F4B
+#define GL_DOUBLE_MAT3x4_EXT 0x8F4C
+#define GL_DOUBLE_MAT4x2_EXT 0x8F4D
+#define GL_DOUBLE_MAT4x3_EXT 0x8F4E
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFrameZoomSGIX (GLint factor);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
+GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
+GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params);
#endif
+#endif /* GL_EXT_vertex_attrib_64bit */
-#ifndef GL_SGIX_tag_sample_buffer
-#define GL_SGIX_tag_sample_buffer 1
+#ifndef GL_EXT_vertex_shader
+#define GL_EXT_vertex_shader 1
+#define GL_VERTEX_SHADER_EXT 0x8780
+#define GL_VERTEX_SHADER_BINDING_EXT 0x8781
+#define GL_OP_INDEX_EXT 0x8782
+#define GL_OP_NEGATE_EXT 0x8783
+#define GL_OP_DOT3_EXT 0x8784
+#define GL_OP_DOT4_EXT 0x8785
+#define GL_OP_MUL_EXT 0x8786
+#define GL_OP_ADD_EXT 0x8787
+#define GL_OP_MADD_EXT 0x8788
+#define GL_OP_FRAC_EXT 0x8789
+#define GL_OP_MAX_EXT 0x878A
+#define GL_OP_MIN_EXT 0x878B
+#define GL_OP_SET_GE_EXT 0x878C
+#define GL_OP_SET_LT_EXT 0x878D
+#define GL_OP_CLAMP_EXT 0x878E
+#define GL_OP_FLOOR_EXT 0x878F
+#define GL_OP_ROUND_EXT 0x8790
+#define GL_OP_EXP_BASE_2_EXT 0x8791
+#define GL_OP_LOG_BASE_2_EXT 0x8792
+#define GL_OP_POWER_EXT 0x8793
+#define GL_OP_RECIP_EXT 0x8794
+#define GL_OP_RECIP_SQRT_EXT 0x8795
+#define GL_OP_SUB_EXT 0x8796
+#define GL_OP_CROSS_PRODUCT_EXT 0x8797
+#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798
+#define GL_OP_MOV_EXT 0x8799
+#define GL_OUTPUT_VERTEX_EXT 0x879A
+#define GL_OUTPUT_COLOR0_EXT 0x879B
+#define GL_OUTPUT_COLOR1_EXT 0x879C
+#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D
+#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E
+#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F
+#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0
+#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1
+#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2
+#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3
+#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4
+#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5
+#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6
+#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7
+#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8
+#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9
+#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA
+#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB
+#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC
+#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD
+#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE
+#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF
+#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0
+#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1
+#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2
+#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3
+#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4
+#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5
+#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6
+#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7
+#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8
+#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9
+#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA
+#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB
+#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC
+#define GL_OUTPUT_FOG_EXT 0x87BD
+#define GL_SCALAR_EXT 0x87BE
+#define GL_VECTOR_EXT 0x87BF
+#define GL_MATRIX_EXT 0x87C0
+#define GL_VARIANT_EXT 0x87C1
+#define GL_INVARIANT_EXT 0x87C2
+#define GL_LOCAL_CONSTANT_EXT 0x87C3
+#define GL_LOCAL_EXT 0x87C4
+#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
+#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
+#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
+#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
+#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
+#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
+#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0
+#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1
+#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
+#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3
+#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4
+#define GL_X_EXT 0x87D5
+#define GL_Y_EXT 0x87D6
+#define GL_Z_EXT 0x87D7
+#define GL_W_EXT 0x87D8
+#define GL_NEGATIVE_X_EXT 0x87D9
+#define GL_NEGATIVE_Y_EXT 0x87DA
+#define GL_NEGATIVE_Z_EXT 0x87DB
+#define GL_NEGATIVE_W_EXT 0x87DC
+#define GL_ZERO_EXT 0x87DD
+#define GL_ONE_EXT 0x87DE
+#define GL_NEGATIVE_ONE_EXT 0x87DF
+#define GL_NORMALIZED_RANGE_EXT 0x87E0
+#define GL_FULL_RANGE_EXT 0x87E1
+#define GL_CURRENT_VERTEX_EXT 0x87E2
+#define GL_MVP_MATRIX_EXT 0x87E3
+#define GL_VARIANT_VALUE_EXT 0x87E4
+#define GL_VARIANT_DATATYPE_EXT 0x87E5
+#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6
+#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7
+#define GL_VARIANT_ARRAY_EXT 0x87E8
+#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9
+#define GL_INVARIANT_VALUE_EXT 0x87EA
+#define GL_INVARIANT_DATATYPE_EXT 0x87EB
+#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC
+#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED
+typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
+typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
+typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
+typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
+typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const void *addr);
+typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const void *addr);
+typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr);
+typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr);
+typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr);
+typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr);
+typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr);
+typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr);
+typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const void *addr);
+typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value);
+typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
+typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, void **data);
+typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTagSampleBufferSGIX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
+GLAPI void APIENTRY glBeginVertexShaderEXT (void);
+GLAPI void APIENTRY glEndVertexShaderEXT (void);
+GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id);
+GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range);
+GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id);
+GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1);
+GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
+GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
+GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num);
+GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num);
+GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
+GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const void *addr);
+GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const void *addr);
+GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr);
+GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr);
+GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr);
+GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr);
+GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr);
+GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr);
+GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr);
+GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr);
+GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const void *addr);
+GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id);
+GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id);
+GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value);
+GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value);
+GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value);
+GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value);
+GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value);
+GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap);
+GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
+GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data);
+GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
+GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, void **data);
+GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
+GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data);
+GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
+GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
+GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data);
+GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
#endif
+#endif /* GL_EXT_vertex_shader */
-#ifndef GL_SGIX_polynomial_ffd
-#define GL_SGIX_polynomial_ffd 1
+#ifndef GL_EXT_vertex_weighting
+#define GL_EXT_vertex_weighting 1
+#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3
+#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502
+#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6
+#define GL_MODELVIEW1_MATRIX_EXT 0x8506
+#define GL_VERTEX_WEIGHTING_EXT 0x8509
+#define GL_MODELVIEW0_EXT 0x1700
+#define GL_MODELVIEW1_EXT 0x850A
+#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B
+#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C
+#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D
+#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E
+#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
+#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
-GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
-GLAPI void APIENTRY glDeformSGIX (GLbitfield mask);
-GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
-typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
-typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask);
-typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);
+GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight);
+GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight);
+GLAPI void APIENTRY glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer);
#endif
+#endif /* GL_EXT_vertex_weighting */
-#ifndef GL_SGIX_reference_plane
-#define GL_SGIX_reference_plane 1
+#ifndef GL_EXT_x11_sync_object
+#define GL_EXT_x11_sync_object 1
+#define GL_SYNC_X11_FENCE_EXT 0x90E1
+typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
+GLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
#endif
+#endif /* GL_EXT_x11_sync_object */
-#ifndef GL_SGIX_flush_raster
-#define GL_SGIX_flush_raster 1
+#ifndef GL_GREMEDY_frame_terminator
+#define GL_GREMEDY_frame_terminator 1
+typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFlushRasterSGIX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);
-#endif
-
-#ifndef GL_SGIX_depth_texture
-#define GL_SGIX_depth_texture 1
+GLAPI void APIENTRY glFrameTerminatorGREMEDY (void);
#endif
+#endif /* GL_GREMEDY_frame_terminator */
-#ifndef GL_SGIS_fog_function
-#define GL_SGIS_fog_function 1
+#ifndef GL_GREMEDY_string_marker
+#define GL_GREMEDY_string_marker 1
+typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void *string);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points);
-GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);
+GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const void *string);
#endif
+#endif /* GL_GREMEDY_string_marker */
-#ifndef GL_SGIX_fog_offset
-#define GL_SGIX_fog_offset 1
-#endif
+#ifndef GL_HP_convolution_border_modes
+#define GL_HP_convolution_border_modes 1
+#define GL_IGNORE_BORDER_HP 0x8150
+#define GL_CONSTANT_BORDER_HP 0x8151
+#define GL_REPLICATE_BORDER_HP 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154
+#endif /* GL_HP_convolution_border_modes */
#ifndef GL_HP_image_transform
#define GL_HP_image_transform 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
+#define GL_IMAGE_SCALE_X_HP 0x8155
+#define GL_IMAGE_SCALE_Y_HP 0x8156
+#define GL_IMAGE_TRANSLATE_X_HP 0x8157
+#define GL_IMAGE_TRANSLATE_Y_HP 0x8158
+#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159
+#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A
+#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B
+#define GL_IMAGE_MAG_FILTER_HP 0x815C
+#define GL_IMAGE_MIN_FILTER_HP 0x815D
+#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E
+#define GL_CUBIC_HP 0x815F
+#define GL_AVERAGE_HP 0x8160
+#define GL_IMAGE_TRANSFORM_2D_HP 0x8161
+#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162
+#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163
typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);
typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_HP_convolution_border_modes
-#define GL_HP_convolution_border_modes 1
-#endif
-
-#ifndef GL_SGIX_texture_add_env
-#define GL_SGIX_texture_add_env 1
-#endif
-
-#ifndef GL_EXT_color_subtable
-#define GL_EXT_color_subtable 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-#endif
-
-#ifndef GL_PGI_vertex_hints
-#define GL_PGI_vertex_hints 1
-#endif
-
-#ifndef GL_PGI_misc_hints
-#define GL_PGI_misc_hints 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);
-#endif
-
-#ifndef GL_EXT_paletted_texture
-#define GL_EXT_paletted_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, GLvoid *data);
-GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_EXT_clip_volume_hint
-#define GL_EXT_clip_volume_hint 1
-#endif
-
-#ifndef GL_SGIX_list_priority
-#define GL_SGIX_list_priority 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params);
-GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param);
-GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_SGIX_ir_instrument1
-#define GL_SGIX_ir_instrument1 1
-#endif
-
-#ifndef GL_SGIX_calligraphic_fragment
-#define GL_SGIX_calligraphic_fragment 1
-#endif
-
-#ifndef GL_SGIX_texture_lod_bias
-#define GL_SGIX_texture_lod_bias 1
-#endif
-
-#ifndef GL_SGIX_shadow_ambient
-#define GL_SGIX_shadow_ambient 1
-#endif
-
-#ifndef GL_EXT_index_texture
-#define GL_EXT_index_texture 1
-#endif
-
-#ifndef GL_EXT_index_material
-#define GL_EXT_index_material 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
-#endif
-
-#ifndef GL_EXT_index_func
-#define GL_EXT_index_func 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
-#endif
-
-#ifndef GL_EXT_index_array_formats
-#define GL_EXT_index_array_formats 1
-#endif
-
-#ifndef GL_EXT_compiled_vertex_array
-#define GL_EXT_compiled_vertex_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count);
-GLAPI void APIENTRY glUnlockArraysEXT (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);
-#endif
-
-#ifndef GL_EXT_cull_vertex
-#define GL_EXT_cull_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_SGIX_ycrcb
-#define GL_SGIX_ycrcb 1
-#endif
-
-#ifndef GL_SGIX_fragment_lighting
-#define GL_SGIX_fragment_lighting 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode);
-GLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum light, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param);
-GLAPI void APIENTRY glFragmentLightivSGIX (GLenum light, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum pname, GLint param);
-GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum pname, const GLint *params);
-GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum face, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum face, GLenum pname, GLint param);
-GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params);
-GLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);
-#endif
-
-#ifndef GL_IBM_rasterpos_clip
-#define GL_IBM_rasterpos_clip 1
-#endif
-
-#ifndef GL_HP_texture_lighting
-#define GL_HP_texture_lighting 1
-#endif
-
-#ifndef GL_EXT_draw_range_elements
-#define GL_EXT_draw_range_elements 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-#endif
-
-#ifndef GL_WIN_phong_shading
-#define GL_WIN_phong_shading 1
-#endif
-
-#ifndef GL_WIN_specular_fog
-#define GL_WIN_specular_fog 1
-#endif
-
-#ifndef GL_EXT_light_texture
-#define GL_EXT_light_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glApplyTextureEXT (GLenum mode);
-GLAPI void APIENTRY glTextureLightEXT (GLenum pname);
-GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
-typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
-#endif
-
-#ifndef GL_SGIX_blend_alpha_minmax
-#define GL_SGIX_blend_alpha_minmax 1
-#endif
-
-#ifndef GL_EXT_bgra
-#define GL_EXT_bgra 1
-#endif
-
-#ifndef GL_SGIX_async
-#define GL_SGIX_async 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker);
-GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp);
-GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp);
-GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range);
-GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range);
-GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
-typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
-typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);
-typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
-typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
-typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
-#endif
-
-#ifndef GL_SGIX_async_pixel
-#define GL_SGIX_async_pixel 1
-#endif
-
-#ifndef GL_SGIX_async_histogram
-#define GL_SGIX_async_histogram 1
-#endif
-
-#ifndef GL_INTEL_parallel_arrays
-#define GL_INTEL_parallel_arrays 1
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);
-GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const GLvoid* *pointer);
-GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);
-GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params);
#endif
+#endif /* GL_HP_image_transform */
#ifndef GL_HP_occlusion_test
#define GL_HP_occlusion_test 1
-#endif
-
-#ifndef GL_EXT_pixel_transform
-#define GL_EXT_pixel_transform 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_EXT_pixel_transform_color_table
-#define GL_EXT_pixel_transform_color_table 1
-#endif
-
-#ifndef GL_EXT_shared_texture_palette
-#define GL_EXT_shared_texture_palette 1
-#endif
-
-#ifndef GL_EXT_separate_specular_color
-#define GL_EXT_separate_specular_color 1
-#endif
-
-#ifndef GL_EXT_secondary_color
-#define GL_EXT_secondary_color 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue);
-GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v);
-GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue);
-GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v);
-GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue);
-GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v);
-GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue);
-GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v);
-GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue);
-GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v);
-GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue);
-GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v);
-GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue);
-GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v);
-GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue);
-GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v);
-GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_texture_perturb_normal
-#define GL_EXT_texture_perturb_normal 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureNormalEXT (GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
-#endif
-
-#ifndef GL_EXT_multi_draw_arrays
-#define GL_EXT_multi_draw_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-#endif
-
-#ifndef GL_EXT_fog_coord
-#define GL_EXT_fog_coord 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord);
-GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord);
-GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord);
-GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord);
-GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
-typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_REND_screen_coordinates
-#define GL_REND_screen_coordinates 1
-#endif
-
-#ifndef GL_EXT_coordinate_frame
-#define GL_EXT_coordinate_frame 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz);
-GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v);
-GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz);
-GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v);
-GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz);
-GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v);
-GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz);
-GLAPI void APIENTRY glTangent3ivEXT (const GLint *v);
-GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz);
-GLAPI void APIENTRY glTangent3svEXT (const GLshort *v);
-GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz);
-GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v);
-GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz);
-GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v);
-GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz);
-GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v);
-GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz);
-GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v);
-GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz);
-GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v);
-GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
-typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);
-typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);
-typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);
-typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);
-typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);
-typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);
-typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);
-typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);
-typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);
-typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_texture_env_combine
-#define GL_EXT_texture_env_combine 1
-#endif
-
-#ifndef GL_APPLE_specular_vector
-#define GL_APPLE_specular_vector 1
-#endif
+#define GL_OCCLUSION_TEST_HP 0x8165
+#define GL_OCCLUSION_TEST_RESULT_HP 0x8166
+#endif /* GL_HP_occlusion_test */
-#ifndef GL_APPLE_transform_hint
-#define GL_APPLE_transform_hint 1
-#endif
+#ifndef GL_HP_texture_lighting
+#define GL_HP_texture_lighting 1
+#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167
+#define GL_TEXTURE_POST_SPECULAR_HP 0x8168
+#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169
+#endif /* GL_HP_texture_lighting */
-#ifndef GL_SGIX_fog_scale
-#define GL_SGIX_fog_scale 1
-#endif
+#ifndef GL_IBM_cull_vertex
+#define GL_IBM_cull_vertex 1
+#define GL_CULL_VERTEX_IBM 103050
+#endif /* GL_IBM_cull_vertex */
-#ifndef GL_SUNX_constant_data
-#define GL_SUNX_constant_data 1
+#ifndef GL_IBM_multimode_draw_arrays
+#define GL_IBM_multimode_draw_arrays 1
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFinishTextureSUNX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void);
+GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
+GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride);
#endif
+#endif /* GL_IBM_multimode_draw_arrays */
-#ifndef GL_SUN_global_alpha
-#define GL_SUN_global_alpha 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor);
-GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor);
-GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint factor);
-GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat factor);
-GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor);
-GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor);
-GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor);
-GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
-#endif
+#ifndef GL_IBM_rasterpos_clip
+#define GL_IBM_rasterpos_clip 1
+#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262
+#endif /* GL_IBM_rasterpos_clip */
-#ifndef GL_SUN_triangle_list
-#define GL_SUN_triangle_list 1
+#ifndef GL_IBM_static_data
+#define GL_IBM_static_data 1
+#define GL_ALL_STATIC_DATA_IBM 103060
+#define GL_STATIC_VERTEX_ARRAY_IBM 103061
+typedef void (APIENTRYP PFNGLFLUSHSTATICDATAIBMPROC) (GLenum target);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code);
-GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code);
-GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code);
-GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code);
-GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code);
-GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code);
-GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const GLvoid* *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer);
+GLAPI void APIENTRY glFlushStaticDataIBM (GLenum target);
#endif
+#endif /* GL_IBM_static_data */
-#ifndef GL_SUN_vertex
-#define GL_SUN_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
-GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v);
-GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v);
-GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *c, const GLfloat *v);
-GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *c, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *rc, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *rc, const GLubyte *c, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-#endif
+#ifndef GL_IBM_texture_mirrored_repeat
+#define GL_IBM_texture_mirrored_repeat 1
+#define GL_MIRRORED_REPEAT_IBM 0x8370
+#endif /* GL_IBM_texture_mirrored_repeat */
-#ifndef GL_EXT_blend_func_separate
-#define GL_EXT_blend_func_separate 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#endif
+#ifndef GL_IBM_vertex_array_lists
+#define GL_IBM_vertex_array_lists 1
+#define GL_VERTEX_ARRAY_LIST_IBM 103070
+#define GL_NORMAL_ARRAY_LIST_IBM 103071
+#define GL_COLOR_ARRAY_LIST_IBM 103072
+#define GL_INDEX_ARRAY_LIST_IBM 103073
+#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074
+#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075
+#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076
+#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
+#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080
+#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081
+#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082
+#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083
+#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
+#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
+#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
+#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
+typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean **pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride);
+GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride);
+GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean **pointer, GLint ptrstride);
+GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride);
+GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride);
+GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride);
+GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride);
+GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride);
+#endif
+#endif /* GL_IBM_vertex_array_lists */
#ifndef GL_INGR_blend_func_separate
#define GL_INGR_blend_func_separate 1
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
#endif
+#endif /* GL_INGR_blend_func_separate */
#ifndef GL_INGR_color_clamp
#define GL_INGR_color_clamp 1
-#endif
+#define GL_RED_MIN_CLAMP_INGR 0x8560
+#define GL_GREEN_MIN_CLAMP_INGR 0x8561
+#define GL_BLUE_MIN_CLAMP_INGR 0x8562
+#define GL_ALPHA_MIN_CLAMP_INGR 0x8563
+#define GL_RED_MAX_CLAMP_INGR 0x8564
+#define GL_GREEN_MAX_CLAMP_INGR 0x8565
+#define GL_BLUE_MAX_CLAMP_INGR 0x8566
+#define GL_ALPHA_MAX_CLAMP_INGR 0x8567
+#endif /* GL_INGR_color_clamp */
#ifndef GL_INGR_interlace_read
#define GL_INGR_interlace_read 1
-#endif
-
-#ifndef GL_EXT_stencil_wrap
-#define GL_EXT_stencil_wrap 1
-#endif
-
-#ifndef GL_EXT_422_pixels
-#define GL_EXT_422_pixels 1
-#endif
-
-#ifndef GL_NV_texgen_reflection
-#define GL_NV_texgen_reflection 1
-#endif
-
-#ifndef GL_SUN_convolution_border_modes
-#define GL_SUN_convolution_border_modes 1
-#endif
-
-#ifndef GL_EXT_texture_env_add
-#define GL_EXT_texture_env_add 1
-#endif
-
-#ifndef GL_EXT_texture_lod_bias
-#define GL_EXT_texture_lod_bias 1
-#endif
-
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_EXT_texture_filter_anisotropic 1
-#endif
-
-#ifndef GL_EXT_vertex_weighting
-#define GL_EXT_vertex_weighting 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight);
-GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight);
-GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_NV_light_max_exponent
-#define GL_NV_light_max_exponent 1
-#endif
+#define GL_INTERLACE_READ_INGR 0x8568
+#endif /* GL_INGR_interlace_read */
-#ifndef GL_NV_vertex_array_range
-#define GL_NV_vertex_array_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFlushVertexArrayRangeNV (void);
-GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const GLvoid *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
-typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer);
-#endif
+#ifndef GL_INTEL_fragment_shader_ordering
+#define GL_INTEL_fragment_shader_ordering 1
+#endif /* GL_INTEL_fragment_shader_ordering */
-#ifndef GL_NV_register_combiners
-#define GL_NV_register_combiners 1
+#ifndef GL_INTEL_map_texture
+#define GL_INTEL_map_texture 1
+#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF
+#define GL_LAYOUT_DEFAULT_INTEL 0
+#define GL_LAYOUT_LINEAR_INTEL 1
+#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2
+typedef void (APIENTRYP PFNGLSYNCTEXTUREINTELPROC) (GLuint texture);
+typedef void (APIENTRYP PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level);
+typedef void *(APIENTRYP PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params);
-GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param);
-GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
-GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
-typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_NV_fog_distance
-#define GL_NV_fog_distance 1
+GLAPI void APIENTRY glSyncTextureINTEL (GLuint texture);
+GLAPI void APIENTRY glUnmapTexture2DINTEL (GLuint texture, GLint level);
+GLAPI void *APIENTRY glMapTexture2DINTEL (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout);
#endif
+#endif /* GL_INTEL_map_texture */
-#ifndef GL_NV_texgen_emboss
-#define GL_NV_texgen_emboss 1
-#endif
+#ifndef GL_INTEL_parallel_arrays
+#define GL_INTEL_parallel_arrays 1
+#define GL_PARALLEL_ARRAYS_INTEL 0x83F4
+#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
+#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
+#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
+#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
+typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void **pointer);
+typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const void **pointer);
+GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const void **pointer);
+GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const void **pointer);
+GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const void **pointer);
+#endif
+#endif /* GL_INTEL_parallel_arrays */
+
+#ifndef GL_INTEL_performance_query
+#define GL_INTEL_performance_query 1
+#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000
+#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001
+#define GL_PERFQUERY_WAIT_INTEL 0x83FB
+#define GL_PERFQUERY_FLUSH_INTEL 0x83FA
+#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9
+#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0
+#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1
+#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2
+#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3
+#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4
+#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5
+#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8
+#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9
+#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA
+#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB
+#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC
+#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD
+#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE
+#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF
+#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500
+typedef void (APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle);
+typedef void (APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle);
+typedef void (APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle);
+typedef void (APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle);
+typedef void (APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId);
+typedef void (APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId);
+typedef void (APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
+typedef void (APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten);
+typedef void (APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId);
+typedef void (APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle);
+GLAPI void APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle);
+GLAPI void APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle);
+GLAPI void APIENTRY glEndPerfQueryINTEL (GLuint queryHandle);
+GLAPI void APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId);
+GLAPI void APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId);
+GLAPI void APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
+GLAPI void APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten);
+GLAPI void APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId);
+GLAPI void APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
+#endif
+#endif /* GL_INTEL_performance_query */
-#ifndef GL_NV_blend_square
-#define GL_NV_blend_square 1
-#endif
+#ifndef GL_MESAX_texture_stack
+#define GL_MESAX_texture_stack 1
+#define GL_TEXTURE_1D_STACK_MESAX 0x8759
+#define GL_TEXTURE_2D_STACK_MESAX 0x875A
+#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B
+#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C
+#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D
+#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E
+#endif /* GL_MESAX_texture_stack */
-#ifndef GL_NV_texture_env_combine4
-#define GL_NV_texture_env_combine4 1
-#endif
+#ifndef GL_MESA_pack_invert
+#define GL_MESA_pack_invert 1
+#define GL_PACK_INVERT_MESA 0x8758
+#endif /* GL_MESA_pack_invert */
#ifndef GL_MESA_resize_buffers
#define GL_MESA_resize_buffers 1
+typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glResizeBuffersMESA (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);
#endif
+#endif /* GL_MESA_resize_buffers */
#ifndef GL_MESA_window_pos
#define GL_MESA_window_pos 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y);
-GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y);
-GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y);
-GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v);
-GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y);
-GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v);
-GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v);
-GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v);
-GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v);
-GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v);
-#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
@@ -8544,846 +8338,554 @@ typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GL
typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v);
typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v);
-#endif
-
-#ifndef GL_IBM_cull_vertex
-#define GL_IBM_cull_vertex 1
-#endif
-
-#ifndef GL_IBM_multimode_draw_arrays
-#define GL_IBM_multimode_draw_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
-GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
-typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
-#endif
-
-#ifndef GL_IBM_vertex_array_lists
-#define GL_IBM_vertex_array_lists 1
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean* *pointer, GLint ptrstride);
-GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-#endif
-
-#ifndef GL_SGIX_subsample
-#define GL_SGIX_subsample 1
-#endif
-
-#ifndef GL_SGIX_ycrcba
-#define GL_SGIX_ycrcba 1
-#endif
-
-#ifndef GL_SGIX_ycrcb_subsample
-#define GL_SGIX_ycrcb_subsample 1
-#endif
-
-#ifndef GL_SGIX_depth_pass_instrument
-#define GL_SGIX_depth_pass_instrument 1
+GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y);
+GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y);
+GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y);
+GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v);
+GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y);
+GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v);
+GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v);
+GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v);
+GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v);
+GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v);
#endif
+#endif /* GL_MESA_window_pos */
-#ifndef GL_3DFX_texture_compression_FXT1
-#define GL_3DFX_texture_compression_FXT1 1
-#endif
+#ifndef GL_MESA_ycbcr_texture
+#define GL_MESA_ycbcr_texture 1
+#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB
+#define GL_YCBCR_MESA 0x8757
+#endif /* GL_MESA_ycbcr_texture */
+
+#ifndef GL_NVX_conditional_render
+#define GL_NVX_conditional_render 1
+typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVXPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginConditionalRenderNVX (GLuint id);
+GLAPI void APIENTRY glEndConditionalRenderNVX (void);
+#endif
+#endif /* GL_NVX_conditional_render */
+
+#ifndef GL_NVX_gpu_memory_info
+#define GL_NVX_gpu_memory_info 1
+#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047
+#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048
+#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049
+#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A
+#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B
+#endif /* GL_NVX_gpu_memory_info */
+
+#ifndef GL_NV_bindless_multi_draw_indirect
+#define GL_NV_bindless_multi_draw_indirect 1
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiDrawArraysIndirectBindlessNV (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount);
+GLAPI void APIENTRY glMultiDrawElementsIndirectBindlessNV (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount);
+#endif
+#endif /* GL_NV_bindless_multi_draw_indirect */
+
+#ifndef GL_NV_bindless_texture
+#define GL_NV_bindless_texture 1
+typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture);
+typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler);
+typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle);
+typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle);
+typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
+typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access);
+typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle);
+typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value);
+typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values);
+typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle);
+typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint64 APIENTRY glGetTextureHandleNV (GLuint texture);
+GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler);
+GLAPI void APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle);
+GLAPI void APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle);
+GLAPI GLuint64 APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
+GLAPI void APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access);
+GLAPI void APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle);
+GLAPI void APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value);
+GLAPI void APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value);
+GLAPI void APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value);
+GLAPI void APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values);
+GLAPI GLboolean APIENTRY glIsTextureHandleResidentNV (GLuint64 handle);
+GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle);
+#endif
+#endif /* GL_NV_bindless_texture */
+
+#ifndef GL_NV_blend_equation_advanced
+#define GL_NV_blend_equation_advanced 1
+#define GL_BLEND_OVERLAP_NV 0x9281
+#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280
+#define GL_BLUE_NV 0x1905
+#define GL_COLORBURN_NV 0x929A
+#define GL_COLORDODGE_NV 0x9299
+#define GL_CONJOINT_NV 0x9284
+#define GL_CONTRAST_NV 0x92A1
+#define GL_DARKEN_NV 0x9297
+#define GL_DIFFERENCE_NV 0x929E
+#define GL_DISJOINT_NV 0x9283
+#define GL_DST_ATOP_NV 0x928F
+#define GL_DST_IN_NV 0x928B
+#define GL_DST_NV 0x9287
+#define GL_DST_OUT_NV 0x928D
+#define GL_DST_OVER_NV 0x9289
+#define GL_EXCLUSION_NV 0x92A0
+#define GL_GREEN_NV 0x1904
+#define GL_HARDLIGHT_NV 0x929B
+#define GL_HARDMIX_NV 0x92A9
+#define GL_HSL_COLOR_NV 0x92AF
+#define GL_HSL_HUE_NV 0x92AD
+#define GL_HSL_LUMINOSITY_NV 0x92B0
+#define GL_HSL_SATURATION_NV 0x92AE
+#define GL_INVERT_OVG_NV 0x92B4
+#define GL_INVERT_RGB_NV 0x92A3
+#define GL_LIGHTEN_NV 0x9298
+#define GL_LINEARBURN_NV 0x92A5
+#define GL_LINEARDODGE_NV 0x92A4
+#define GL_LINEARLIGHT_NV 0x92A7
+#define GL_MINUS_CLAMPED_NV 0x92B3
+#define GL_MINUS_NV 0x929F
+#define GL_MULTIPLY_NV 0x9294
+#define GL_OVERLAY_NV 0x9296
+#define GL_PINLIGHT_NV 0x92A8
+#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2
+#define GL_PLUS_CLAMPED_NV 0x92B1
+#define GL_PLUS_DARKER_NV 0x9292
+#define GL_PLUS_NV 0x9291
+#define GL_RED_NV 0x1903
+#define GL_SCREEN_NV 0x9295
+#define GL_SOFTLIGHT_NV 0x929C
+#define GL_SRC_ATOP_NV 0x928E
+#define GL_SRC_IN_NV 0x928A
+#define GL_SRC_NV 0x9286
+#define GL_SRC_OUT_NV 0x928C
+#define GL_SRC_OVER_NV 0x9288
+#define GL_UNCORRELATED_NV 0x9282
+#define GL_VIVIDLIGHT_NV 0x92A6
+#define GL_XOR_NV 0x1506
+typedef void (APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value);
+typedef void (APIENTRYP PFNGLBLENDBARRIERNVPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendParameteriNV (GLenum pname, GLint value);
+GLAPI void APIENTRY glBlendBarrierNV (void);
+#endif
+#endif /* GL_NV_blend_equation_advanced */
+
+#ifndef GL_NV_blend_equation_advanced_coherent
+#define GL_NV_blend_equation_advanced_coherent 1
+#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285
+#endif /* GL_NV_blend_equation_advanced_coherent */
-#ifndef GL_3DFX_multisample
-#define GL_3DFX_multisample 1
-#endif
+#ifndef GL_NV_blend_square
+#define GL_NV_blend_square 1
+#endif /* GL_NV_blend_square */
-#ifndef GL_3DFX_tbuffer
-#define GL_3DFX_tbuffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
-#endif
+#ifndef GL_NV_compute_program5
+#define GL_NV_compute_program5 1
+#define GL_COMPUTE_PROGRAM_NV 0x90FB
+#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC
+#endif /* GL_NV_compute_program5 */
-#ifndef GL_EXT_multisample
-#define GL_EXT_multisample 1
+#ifndef GL_NV_conditional_render
+#define GL_NV_conditional_render 1
+#define GL_QUERY_WAIT_NV 0x8E13
+#define GL_QUERY_NO_WAIT_NV 0x8E14
+#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15
+#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16
+typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode);
+typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert);
-GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
-#endif
-
-#ifndef GL_SGIX_vertex_preclip
-#define GL_SGIX_vertex_preclip 1
-#endif
-
-#ifndef GL_SGIX_convolution_accuracy
-#define GL_SGIX_convolution_accuracy 1
-#endif
-
-#ifndef GL_SGIX_resample
-#define GL_SGIX_resample 1
+GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode);
+GLAPI void APIENTRY glEndConditionalRenderNV (void);
#endif
+#endif /* GL_NV_conditional_render */
-#ifndef GL_SGIS_point_line_texgen
-#define GL_SGIS_point_line_texgen 1
-#endif
+#ifndef GL_NV_copy_depth_to_color
+#define GL_NV_copy_depth_to_color 1
+#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
+#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F
+#endif /* GL_NV_copy_depth_to_color */
-#ifndef GL_SGIS_texture_color_mask
-#define GL_SGIS_texture_color_mask 1
+#ifndef GL_NV_copy_image
+#define GL_NV_copy_image 1
+typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
#endif
+#endif /* GL_NV_copy_image */
-#ifndef GL_SGIX_igloo_interface
-#define GL_SGIX_igloo_interface 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const GLvoid *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params);
-#endif
+#ifndef GL_NV_deep_texture3D
+#define GL_NV_deep_texture3D 1
+#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0
+#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1
+#endif /* GL_NV_deep_texture3D */
-#ifndef GL_EXT_texture_env_dot3
-#define GL_EXT_texture_env_dot3 1
+#ifndef GL_NV_depth_buffer_float
+#define GL_NV_depth_buffer_float 1
+#define GL_DEPTH_COMPONENT32F_NV 0x8DAB
+#define GL_DEPTH32F_STENCIL8_NV 0x8DAC
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD
+#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF
+typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);
+typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);
+typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar);
+GLAPI void APIENTRY glClearDepthdNV (GLdouble depth);
+GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax);
#endif
+#endif /* GL_NV_depth_buffer_float */
-#ifndef GL_ATI_texture_mirror_once
-#define GL_ATI_texture_mirror_once 1
-#endif
+#ifndef GL_NV_depth_clamp
+#define GL_NV_depth_clamp 1
+#define GL_DEPTH_CLAMP_NV 0x864F
+#endif /* GL_NV_depth_clamp */
-#ifndef GL_NV_fence
-#define GL_NV_fence 1
+#ifndef GL_NV_draw_texture
+#define GL_NV_draw_texture 1
+typedef void (APIENTRYP PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences);
-GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences);
-GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence);
-GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence);
-GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params);
-GLAPI void APIENTRY glFinishFenceNV (GLuint fence);
-GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
-typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
-typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
+GLAPI void APIENTRY glDrawTextureNV (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1);
#endif
+#endif /* GL_NV_draw_texture */
#ifndef GL_NV_evaluators
#define GL_NV_evaluators 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
-GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
-GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
+#define GL_EVAL_2D_NV 0x86C0
+#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1
+#define GL_MAP_TESSELLATION_NV 0x86C2
+#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3
+#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4
+#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
+#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6
+#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7
+#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8
+#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9
+#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA
+#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB
+#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC
+#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD
+#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE
+#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF
+#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0
+#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1
+#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2
+#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3
+#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4
+#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5
+#define GL_MAX_MAP_TESSELLATION_NV 0x86D6
+#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7
+typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points);
typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
+typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points);
typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
-#endif
-
-#ifndef GL_NV_packed_depth_stencil
-#define GL_NV_packed_depth_stencil 1
-#endif
-
-#ifndef GL_NV_register_combiners2
-#define GL_NV_register_combiners2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_NV_texture_compression_vtc
-#define GL_NV_texture_compression_vtc 1
-#endif
-
-#ifndef GL_NV_texture_rectangle
-#define GL_NV_texture_rectangle 1
-#endif
-
-#ifndef GL_NV_texture_shader
-#define GL_NV_texture_shader 1
-#endif
-
-#ifndef GL_NV_texture_shader2
-#define GL_NV_texture_shader2 1
-#endif
-
-#ifndef GL_NV_vertex_array_range2
-#define GL_NV_vertex_array_range2 1
-#endif
-
-#ifndef GL_NV_vertex_program
-#define GL_NV_vertex_program 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences);
-GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id);
-GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs);
-GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params);
-GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs);
-GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program);
-GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, GLvoid* *pointer);
-GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id);
-GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
-GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLuint count, const GLdouble *v);
-GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLuint count, const GLfloat *v);
-GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs);
-GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform);
-GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x);
-GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x);
-GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x);
-GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y);
-GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y);
-GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
-typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
-typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
-typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
-#endif
-
-#ifndef GL_SGIX_texture_coordinate_clamp
-#define GL_SGIX_texture_coordinate_clamp 1
-#endif
-
-#ifndef GL_SGIX_scalebias_hint
-#define GL_SGIX_scalebias_hint 1
-#endif
-
-#ifndef GL_OML_interlace
-#define GL_OML_interlace 1
-#endif
-
-#ifndef GL_OML_subsample
-#define GL_OML_subsample 1
-#endif
-
-#ifndef GL_OML_resample
-#define GL_OML_resample 1
-#endif
-
-#ifndef GL_NV_copy_depth_to_color
-#define GL_NV_copy_depth_to_color 1
-#endif
-
-#ifndef GL_ATI_envmap_bumpmap
-#define GL_ATI_envmap_bumpmap 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param);
-GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param);
-GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param);
-GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);
-typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);
-typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
-typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
-#endif
-
-#ifndef GL_ATI_fragment_shader
-#define GL_ATI_fragment_shader 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range);
-GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id);
-GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id);
-GLAPI void APIENTRY glBeginFragmentShaderATI (void);
-GLAPI void APIENTRY glEndFragmentShaderATI (void);
-GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle);
-GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle);
-GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
-typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
-typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void);
-typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
-typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value);
-#endif
-
-#ifndef GL_ATI_pn_triangles
-#define GL_ATI_pn_triangles 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param);
-GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
-#endif
-
-#ifndef GL_ATI_vertex_array_object
-#define GL_ATI_vertex_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const GLvoid *pointer, GLenum usage);
-GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer);
-GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
-GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params);
-GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer);
-GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params);
-GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage);
-typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
-typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_EXT_vertex_shader
-#define GL_EXT_vertex_shader 1
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginVertexShaderEXT (void);
-GLAPI void APIENTRY glEndVertexShaderEXT (void);
-GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id);
-GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range);
-GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id);
-GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1);
-GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
-GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
-GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num);
-GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num);
-GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
-GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const GLvoid *addr);
-GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const GLvoid *addr);
-GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr);
-GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr);
-GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr);
-GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr);
-GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr);
-GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr);
-GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr);
-GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr);
-GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
-GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id);
-GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id);
-GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value);
-GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value);
-GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value);
-GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value);
-GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value);
-GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap);
-GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
-GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data);
-GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
-GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, GLvoid* *data);
-GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
-GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data);
-GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
-GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
-GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data);
-GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);
-typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);
-typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
-typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
-typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
-typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
-typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
-typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
-typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
-typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
-typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
-typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
-typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr);
-typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr);
-typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr);
-typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr);
-typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr);
-typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr);
-typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr);
-typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr);
-typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
-typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
-typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value);
-typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
-typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data);
-typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-#endif
-
-#ifndef GL_ATI_vertex_streams
-#define GL_ATI_vertex_streams 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x);
-GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords);
-GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x);
-GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords);
-GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x);
-GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords);
-GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x);
-GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords);
-GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y);
-GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords);
-GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y);
-GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords);
-GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y);
-GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords);
-GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords);
-GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords);
-GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords);
-GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords);
-GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords);
-GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords);
-GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords);
-GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords);
-GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords);
-GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
-GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords);
-GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
-GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords);
-GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz);
-GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords);
-GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
-GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords);
-GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
-GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords);
-GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream);
-GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param);
-GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
-typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points);
+GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points);
+GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode);
#endif
+#endif /* GL_NV_evaluators */
-#ifndef GL_ATI_element_array
-#define GL_ATI_element_array 1
+#ifndef GL_NV_explicit_multisample
+#define GL_NV_explicit_multisample 1
+#define GL_SAMPLE_POSITION_NV 0x8E50
+#define GL_SAMPLE_MASK_NV 0x8E51
+#define GL_SAMPLE_MASK_VALUE_NV 0x8E52
+#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53
+#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54
+#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55
+#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56
+#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57
+#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58
+#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59
+typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val);
+typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask);
+typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glElementPointerATI (GLenum type, const GLvoid *pointer);
-GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count);
-GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
+GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val);
+GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask);
+GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer);
#endif
+#endif /* GL_NV_explicit_multisample */
-#ifndef GL_SUN_mesh_array
-#define GL_SUN_mesh_array 1
+#ifndef GL_NV_fence
+#define GL_NV_fence 1
+#define GL_ALL_COMPLETED_NV 0x84F2
+#define GL_FENCE_STATUS_NV 0x84F3
+#define GL_FENCE_CONDITION_NV 0x84F4
+typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
+typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
-#endif
-
-#ifndef GL_SUN_slice_accum
-#define GL_SUN_slice_accum 1
-#endif
-
-#ifndef GL_NV_multisample_filter_hint
-#define GL_NV_multisample_filter_hint 1
+GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences);
+GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences);
+GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence);
+GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence);
+GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params);
+GLAPI void APIENTRY glFinishFenceNV (GLuint fence);
+GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition);
#endif
+#endif /* GL_NV_fence */
-#ifndef GL_NV_depth_clamp
-#define GL_NV_depth_clamp 1
-#endif
+#ifndef GL_NV_float_buffer
+#define GL_NV_float_buffer 1
+#define GL_FLOAT_R_NV 0x8880
+#define GL_FLOAT_RG_NV 0x8881
+#define GL_FLOAT_RGB_NV 0x8882
+#define GL_FLOAT_RGBA_NV 0x8883
+#define GL_FLOAT_R16_NV 0x8884
+#define GL_FLOAT_R32_NV 0x8885
+#define GL_FLOAT_RG16_NV 0x8886
+#define GL_FLOAT_RG32_NV 0x8887
+#define GL_FLOAT_RGB16_NV 0x8888
+#define GL_FLOAT_RGB32_NV 0x8889
+#define GL_FLOAT_RGBA16_NV 0x888A
+#define GL_FLOAT_RGBA32_NV 0x888B
+#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C
+#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D
+#define GL_FLOAT_RGBA_MODE_NV 0x888E
+#endif /* GL_NV_float_buffer */
-#ifndef GL_NV_occlusion_query
-#define GL_NV_occlusion_query 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids);
-GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids);
-GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id);
-GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id);
-GLAPI void APIENTRY glEndOcclusionQueryNV (void);
-GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void);
-typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
-#endif
+#ifndef GL_NV_fog_distance
+#define GL_NV_fog_distance 1
+#define GL_FOG_DISTANCE_MODE_NV 0x855A
+#define GL_EYE_RADIAL_NV 0x855B
+#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C
+#endif /* GL_NV_fog_distance */
-#ifndef GL_NV_point_sprite
-#define GL_NV_point_sprite 1
+#ifndef GL_NV_fragment_program
+#define GL_NV_fragment_program 1
+#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
+#define GL_FRAGMENT_PROGRAM_NV 0x8870
+#define GL_MAX_TEXTURE_COORDS_NV 0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872
+#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873
+#define GL_PROGRAM_ERROR_STRING_NV 0x8874
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param);
-GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_NV_texture_shader3
-#define GL_NV_texture_shader3 1
-#endif
-
-#ifndef GL_NV_vertex_program1_1
-#define GL_NV_vertex_program1_1 1
-#endif
-
-#ifndef GL_EXT_shadow_funcs
-#define GL_EXT_shadow_funcs 1
+GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
+GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
+GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
+GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
#endif
+#endif /* GL_NV_fragment_program */
-#ifndef GL_EXT_stencil_two_side
-#define GL_EXT_stencil_two_side 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
-#endif
+#ifndef GL_NV_fragment_program2
+#define GL_NV_fragment_program2 1
+#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
+#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5
+#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6
+#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7
+#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8
+#endif /* GL_NV_fragment_program2 */
-#ifndef GL_ATI_text_fragment_shader
-#define GL_ATI_text_fragment_shader 1
-#endif
+#ifndef GL_NV_fragment_program4
+#define GL_NV_fragment_program4 1
+#endif /* GL_NV_fragment_program4 */
-#ifndef GL_APPLE_client_storage
-#define GL_APPLE_client_storage 1
-#endif
+#ifndef GL_NV_fragment_program_option
+#define GL_NV_fragment_program_option 1
+#endif /* GL_NV_fragment_program_option */
-#ifndef GL_APPLE_element_array
-#define GL_APPLE_element_array 1
+#ifndef GL_NV_framebuffer_multisample_coverage
+#define GL_NV_framebuffer_multisample_coverage 1
+#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB
+#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10
+#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11
+#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const GLvoid *pointer);
-GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count);
-GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
-GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
+GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
#endif
+#endif /* GL_NV_framebuffer_multisample_coverage */
-#ifndef GL_APPLE_fence
-#define GL_APPLE_fence 1
+#ifndef GL_NV_geometry_program4
+#define GL_NV_geometry_program4 1
+#define GL_GEOMETRY_PROGRAM_NV 0x8C26
+#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27
+#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28
+typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences);
-GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences);
-GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence);
-GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence);
-GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence);
-GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence);
-GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name);
-GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);
-typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);
-typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
-typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
+GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit);
+GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
#endif
+#endif /* GL_NV_geometry_program4 */
-#ifndef GL_APPLE_vertex_array_object
-#define GL_APPLE_vertex_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array);
-GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays);
-GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays);
-GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
-typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
-typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
-typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
-#endif
+#ifndef GL_NV_geometry_shader4
+#define GL_NV_geometry_shader4 1
+#endif /* GL_NV_geometry_shader4 */
-#ifndef GL_APPLE_vertex_array_range
-#define GL_APPLE_vertex_array_range 1
+#ifndef GL_NV_gpu_program4
+#define GL_NV_gpu_program4 1
+#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904
+#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905
+#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906
+#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907
+#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908
+#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909
+#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5
+#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer);
-GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer);
-GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
-typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
-#endif
-
-#ifndef GL_APPLE_ycbcr_422
-#define GL_APPLE_ycbcr_422 1
-#endif
-
-#ifndef GL_S3_s3tc
-#define GL_S3_s3tc 1
+GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params);
+GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);
+GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params);
+GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);
+GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params);
+GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params);
+GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params);
+GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params);
#endif
+#endif /* GL_NV_gpu_program4 */
-#ifndef GL_ATI_draw_buffers
-#define GL_ATI_draw_buffers 1
+#ifndef GL_NV_gpu_program5
+#define GL_NV_gpu_program5 1
+#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A
+#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B
+#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C
+#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D
+#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E
+#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F
+#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44
+#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45
+typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);
-#endif
-
-#ifndef GL_ATI_pixel_format_float
-#define GL_ATI_pixel_format_float 1
-/* This is really a WGL extension, but defines some associated GL enums.
- * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string.
- */
-#endif
-
-#ifndef GL_ATI_texture_env_combine3
-#define GL_ATI_texture_env_combine3 1
-#endif
-
-#ifndef GL_ATI_texture_float
-#define GL_ATI_texture_float 1
+GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param);
#endif
+#endif /* GL_NV_gpu_program5 */
-#ifndef GL_NV_float_buffer
-#define GL_NV_float_buffer 1
-#endif
+#ifndef GL_NV_gpu_program5_mem_extended
+#define GL_NV_gpu_program5_mem_extended 1
+#endif /* GL_NV_gpu_program5_mem_extended */
-#ifndef GL_NV_fragment_program
-#define GL_NV_fragment_program 1
-/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
-GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
-GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
-GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
-typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
-#endif
+#ifndef GL_NV_gpu_shader5
+#define GL_NV_gpu_shader5 1
+#endif /* GL_NV_gpu_shader5 */
#ifndef GL_NV_half_float
#define GL_NV_half_float 1
+typedef unsigned short GLhalfNV;
+#define GL_HALF_FLOAT_NV 0x140B
+typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
+typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
+typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s);
+typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
+typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y);
GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v);
@@ -9431,343 +8933,1202 @@ GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfN
GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);
-typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z);
-typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
-typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
-typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s);
-typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t);
-typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r);
-typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
-typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
#endif
+#endif /* GL_NV_half_float */
-#ifndef GL_NV_pixel_data_range
-#define GL_NV_pixel_data_range 1
+#ifndef GL_NV_light_max_exponent
+#define GL_NV_light_max_exponent 1
+#define GL_MAX_SHININESS_NV 0x8504
+#define GL_MAX_SPOT_EXPONENT_NV 0x8505
+#endif /* GL_NV_light_max_exponent */
+
+#ifndef GL_NV_multisample_coverage
+#define GL_NV_multisample_coverage 1
+#define GL_COLOR_SAMPLES_NV 0x8E20
+#endif /* GL_NV_multisample_coverage */
+
+#ifndef GL_NV_multisample_filter_hint
+#define GL_NV_multisample_filter_hint 1
+#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
+#endif /* GL_NV_multisample_filter_hint */
+
+#ifndef GL_NV_occlusion_query
+#define GL_NV_occlusion_query 1
+#define GL_PIXEL_COUNTER_BITS_NV 0x8864
+#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865
+#define GL_PIXEL_COUNT_NV 0x8866
+#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867
+typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, GLvoid *pointer);
-GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer);
-typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
+GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids);
+GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids);
+GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id);
+GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id);
+GLAPI void APIENTRY glEndOcclusionQueryNV (void);
+GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params);
#endif
+#endif /* GL_NV_occlusion_query */
-#ifndef GL_NV_primitive_restart
-#define GL_NV_primitive_restart 1
+#ifndef GL_NV_packed_depth_stencil
+#define GL_NV_packed_depth_stencil 1
+#define GL_DEPTH_STENCIL_NV 0x84F9
+#define GL_UNSIGNED_INT_24_8_NV 0x84FA
+#endif /* GL_NV_packed_depth_stencil */
+
+#ifndef GL_NV_parameter_buffer_object
+#define GL_NV_parameter_buffer_object 1
+#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0
+#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1
+#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2
+#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3
+#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4
+typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint *params);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPrimitiveRestartNV (void);
-GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);
-typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
+GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat *params);
+GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint *params);
#endif
+#endif /* GL_NV_parameter_buffer_object */
-#ifndef GL_NV_texture_expand_normal
-#define GL_NV_texture_expand_normal 1
-#endif
+#ifndef GL_NV_parameter_buffer_object2
+#define GL_NV_parameter_buffer_object2 1
+#endif /* GL_NV_parameter_buffer_object2 */
+
+#ifndef GL_NV_path_rendering
+#define GL_NV_path_rendering 1
+#define GL_PATH_FORMAT_SVG_NV 0x9070
+#define GL_PATH_FORMAT_PS_NV 0x9071
+#define GL_STANDARD_FONT_NAME_NV 0x9072
+#define GL_SYSTEM_FONT_NAME_NV 0x9073
+#define GL_FILE_NAME_NV 0x9074
+#define GL_PATH_STROKE_WIDTH_NV 0x9075
+#define GL_PATH_END_CAPS_NV 0x9076
+#define GL_PATH_INITIAL_END_CAP_NV 0x9077
+#define GL_PATH_TERMINAL_END_CAP_NV 0x9078
+#define GL_PATH_JOIN_STYLE_NV 0x9079
+#define GL_PATH_MITER_LIMIT_NV 0x907A
+#define GL_PATH_DASH_CAPS_NV 0x907B
+#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C
+#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D
+#define GL_PATH_DASH_OFFSET_NV 0x907E
+#define GL_PATH_CLIENT_LENGTH_NV 0x907F
+#define GL_PATH_FILL_MODE_NV 0x9080
+#define GL_PATH_FILL_MASK_NV 0x9081
+#define GL_PATH_FILL_COVER_MODE_NV 0x9082
+#define GL_PATH_STROKE_COVER_MODE_NV 0x9083
+#define GL_PATH_STROKE_MASK_NV 0x9084
+#define GL_COUNT_UP_NV 0x9088
+#define GL_COUNT_DOWN_NV 0x9089
+#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A
+#define GL_CONVEX_HULL_NV 0x908B
+#define GL_BOUNDING_BOX_NV 0x908D
+#define GL_TRANSLATE_X_NV 0x908E
+#define GL_TRANSLATE_Y_NV 0x908F
+#define GL_TRANSLATE_2D_NV 0x9090
+#define GL_TRANSLATE_3D_NV 0x9091
+#define GL_AFFINE_2D_NV 0x9092
+#define GL_AFFINE_3D_NV 0x9094
+#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096
+#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098
+#define GL_UTF8_NV 0x909A
+#define GL_UTF16_NV 0x909B
+#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C
+#define GL_PATH_COMMAND_COUNT_NV 0x909D
+#define GL_PATH_COORD_COUNT_NV 0x909E
+#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F
+#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0
+#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1
+#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2
+#define GL_SQUARE_NV 0x90A3
+#define GL_ROUND_NV 0x90A4
+#define GL_TRIANGULAR_NV 0x90A5
+#define GL_BEVEL_NV 0x90A6
+#define GL_MITER_REVERT_NV 0x90A7
+#define GL_MITER_TRUNCATE_NV 0x90A8
+#define GL_SKIP_MISSING_GLYPH_NV 0x90A9
+#define GL_USE_MISSING_GLYPH_NV 0x90AA
+#define GL_PATH_ERROR_POSITION_NV 0x90AB
+#define GL_PATH_FOG_GEN_MODE_NV 0x90AC
+#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD
+#define GL_ADJACENT_PAIRS_NV 0x90AE
+#define GL_FIRST_TO_REST_NV 0x90AF
+#define GL_PATH_GEN_MODE_NV 0x90B0
+#define GL_PATH_GEN_COEFF_NV 0x90B1
+#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2
+#define GL_PATH_GEN_COMPONENTS_NV 0x90B3
+#define GL_PATH_STENCIL_FUNC_NV 0x90B7
+#define GL_PATH_STENCIL_REF_NV 0x90B8
+#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9
+#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD
+#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE
+#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF
+#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4
+#define GL_MOVE_TO_RESETS_NV 0x90B5
+#define GL_MOVE_TO_CONTINUES_NV 0x90B6
+#define GL_CLOSE_PATH_NV 0x00
+#define GL_MOVE_TO_NV 0x02
+#define GL_RELATIVE_MOVE_TO_NV 0x03
+#define GL_LINE_TO_NV 0x04
+#define GL_RELATIVE_LINE_TO_NV 0x05
+#define GL_HORIZONTAL_LINE_TO_NV 0x06
+#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07
+#define GL_VERTICAL_LINE_TO_NV 0x08
+#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09
+#define GL_QUADRATIC_CURVE_TO_NV 0x0A
+#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B
+#define GL_CUBIC_CURVE_TO_NV 0x0C
+#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D
+#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E
+#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F
+#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10
+#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11
+#define GL_SMALL_CCW_ARC_TO_NV 0x12
+#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13
+#define GL_SMALL_CW_ARC_TO_NV 0x14
+#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15
+#define GL_LARGE_CCW_ARC_TO_NV 0x16
+#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17
+#define GL_LARGE_CW_ARC_TO_NV 0x18
+#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19
+#define GL_RESTART_PATH_NV 0xF0
+#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2
+#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4
+#define GL_RECT_NV 0xF6
+#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8
+#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA
+#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC
+#define GL_ARC_TO_NV 0xFE
+#define GL_RELATIVE_ARC_TO_NV 0xFF
+#define GL_BOLD_BIT_NV 0x01
+#define GL_ITALIC_BIT_NV 0x02
+#define GL_GLYPH_WIDTH_BIT_NV 0x01
+#define GL_GLYPH_HEIGHT_BIT_NV 0x02
+#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04
+#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08
+#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10
+#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20
+#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40
+#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80
+#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100
+#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000
+#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000
+#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000
+#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000
+#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000
+#define GL_FONT_ASCENDER_BIT_NV 0x00200000
+#define GL_FONT_DESCENDER_BIT_NV 0x00400000
+#define GL_FONT_HEIGHT_BIT_NV 0x00800000
+#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000
+#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000
+#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000
+#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000
+#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000
+#define GL_PRIMARY_COLOR_NV 0x852C
+#define GL_SECONDARY_COLOR_NV 0x852D
+typedef GLuint (APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range);
+typedef void (APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range);
+typedef GLboolean (APIENTRYP PFNGLISPATHNVPROC) (GLuint path);
+typedef void (APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
+typedef void (APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords);
+typedef void (APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
+typedef void (APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords);
+typedef void (APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString);
+typedef void (APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+typedef void (APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+typedef void (APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights);
+typedef void (APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath);
+typedef void (APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight);
+typedef void (APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues);
+typedef void (APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value);
+typedef void (APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value);
+typedef void (APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value);
+typedef void (APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray);
+typedef void (APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask);
+typedef void (APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units);
+typedef void (APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask);
+typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask);
+typedef void (APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues);
+typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues);
+typedef void (APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func);
+typedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs);
+typedef void (APIENTRYP PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs);
+typedef void (APIENTRYP PFNGLPATHFOGGENNVPROC) (GLenum genMode);
+typedef void (APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode);
+typedef void (APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode);
+typedef void (APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
+typedef void (APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
+typedef void (APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value);
+typedef void (APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value);
+typedef void (APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands);
+typedef void (APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords);
+typedef void (APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray);
+typedef void (APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics);
+typedef void (APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics);
+typedef void (APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing);
+typedef void (APIENTRYP PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint *value);
+typedef void (APIENTRYP PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat *value);
+typedef void (APIENTRYP PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint *value);
+typedef void (APIENTRYP PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat *value);
+typedef GLboolean (APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y);
+typedef GLboolean (APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y);
+typedef GLfloat (APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments);
+typedef GLboolean (APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glGenPathsNV (GLsizei range);
+GLAPI void APIENTRY glDeletePathsNV (GLuint path, GLsizei range);
+GLAPI GLboolean APIENTRY glIsPathNV (GLuint path);
+GLAPI void APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
+GLAPI void APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords);
+GLAPI void APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
+GLAPI void APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords);
+GLAPI void APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const void *pathString);
+GLAPI void APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+GLAPI void APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+GLAPI void APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights);
+GLAPI void APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath);
+GLAPI void APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight);
+GLAPI void APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues);
+GLAPI void APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value);
+GLAPI void APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value);
+GLAPI void APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value);
+GLAPI void APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value);
+GLAPI void APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray);
+GLAPI void APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask);
+GLAPI void APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units);
+GLAPI void APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask);
+GLAPI void APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask);
+GLAPI void APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues);
+GLAPI void APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues);
+GLAPI void APIENTRY glPathCoverDepthFuncNV (GLenum func);
+GLAPI void APIENTRY glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs);
+GLAPI void APIENTRY glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs);
+GLAPI void APIENTRY glPathFogGenNV (GLenum genMode);
+GLAPI void APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode);
+GLAPI void APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode);
+GLAPI void APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
+GLAPI void APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
+GLAPI void APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value);
+GLAPI void APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value);
+GLAPI void APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands);
+GLAPI void APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords);
+GLAPI void APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray);
+GLAPI void APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics);
+GLAPI void APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics);
+GLAPI void APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing);
+GLAPI void APIENTRY glGetPathColorGenivNV (GLenum color, GLenum pname, GLint *value);
+GLAPI void APIENTRY glGetPathColorGenfvNV (GLenum color, GLenum pname, GLfloat *value);
+GLAPI void APIENTRY glGetPathTexGenivNV (GLenum texCoordSet, GLenum pname, GLint *value);
+GLAPI void APIENTRY glGetPathTexGenfvNV (GLenum texCoordSet, GLenum pname, GLfloat *value);
+GLAPI GLboolean APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y);
+GLAPI GLboolean APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y);
+GLAPI GLfloat APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments);
+GLAPI GLboolean APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);
+#endif
+#endif /* GL_NV_path_rendering */
-#ifndef GL_NV_vertex_program2
-#define GL_NV_vertex_program2 1
+#ifndef GL_NV_pixel_data_range
+#define GL_NV_pixel_data_range 1
+#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878
+#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879
+#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
+#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
+#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
+#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
+typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, const void *pointer);
+typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, const void *pointer);
+GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target);
#endif
+#endif /* GL_NV_pixel_data_range */
-#ifndef GL_ATI_map_object_buffer
-#define GL_ATI_map_object_buffer 1
+#ifndef GL_NV_point_sprite
+#define GL_NV_point_sprite 1
+#define GL_POINT_SPRITE_NV 0x8861
+#define GL_COORD_REPLACE_NV 0x8862
+#define GL_POINT_SPRITE_R_MODE_NV 0x8863
+typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint buffer);
-GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param);
+GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params);
#endif
+#endif /* GL_NV_point_sprite */
-#ifndef GL_ATI_separate_stencil
-#define GL_ATI_separate_stencil 1
+#ifndef GL_NV_present_video
+#define GL_NV_present_video 1
+#define GL_FRAME_NV 0x8E26
+#define GL_FIELDS_NV 0x8E27
+#define GL_CURRENT_TIME_NV 0x8E28
+#define GL_NUM_FILL_STREAMS_NV 0x8E29
+#define GL_PRESENT_TIME_NV 0x8E2A
+#define GL_PRESENT_DURATION_NV 0x8E2B
+typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
+typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
+typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
+GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
+GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params);
+GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params);
#endif
+#endif /* GL_NV_present_video */
-#ifndef GL_ATI_vertex_attrib_array_object
-#define GL_ATI_vertex_attrib_array_object 1
+#ifndef GL_NV_primitive_restart
+#define GL_NV_primitive_restart 1
+#define GL_PRIMITIVE_RESTART_NV 0x8558
+#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
-GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glPrimitiveRestartNV (void);
+GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index);
#endif
+#endif /* GL_NV_primitive_restart */
-#ifndef GL_OES_read_format
-#define GL_OES_read_format 1
+#ifndef GL_NV_register_combiners
+#define GL_NV_register_combiners 1
+#define GL_REGISTER_COMBINERS_NV 0x8522
+#define GL_VARIABLE_A_NV 0x8523
+#define GL_VARIABLE_B_NV 0x8524
+#define GL_VARIABLE_C_NV 0x8525
+#define GL_VARIABLE_D_NV 0x8526
+#define GL_VARIABLE_E_NV 0x8527
+#define GL_VARIABLE_F_NV 0x8528
+#define GL_VARIABLE_G_NV 0x8529
+#define GL_CONSTANT_COLOR0_NV 0x852A
+#define GL_CONSTANT_COLOR1_NV 0x852B
+#define GL_SPARE0_NV 0x852E
+#define GL_SPARE1_NV 0x852F
+#define GL_DISCARD_NV 0x8530
+#define GL_E_TIMES_F_NV 0x8531
+#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
+#define GL_UNSIGNED_IDENTITY_NV 0x8536
+#define GL_UNSIGNED_INVERT_NV 0x8537
+#define GL_EXPAND_NORMAL_NV 0x8538
+#define GL_EXPAND_NEGATE_NV 0x8539
+#define GL_HALF_BIAS_NORMAL_NV 0x853A
+#define GL_HALF_BIAS_NEGATE_NV 0x853B
+#define GL_SIGNED_IDENTITY_NV 0x853C
+#define GL_SIGNED_NEGATE_NV 0x853D
+#define GL_SCALE_BY_TWO_NV 0x853E
+#define GL_SCALE_BY_FOUR_NV 0x853F
+#define GL_SCALE_BY_ONE_HALF_NV 0x8540
+#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541
+#define GL_COMBINER_INPUT_NV 0x8542
+#define GL_COMBINER_MAPPING_NV 0x8543
+#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544
+#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545
+#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546
+#define GL_COMBINER_MUX_SUM_NV 0x8547
+#define GL_COMBINER_SCALE_NV 0x8548
+#define GL_COMBINER_BIAS_NV 0x8549
+#define GL_COMBINER_AB_OUTPUT_NV 0x854A
+#define GL_COMBINER_CD_OUTPUT_NV 0x854B
+#define GL_COMBINER_SUM_OUTPUT_NV 0x854C
+#define GL_MAX_GENERAL_COMBINERS_NV 0x854D
+#define GL_NUM_GENERAL_COMBINERS_NV 0x854E
+#define GL_COLOR_SUM_CLAMP_NV 0x854F
+#define GL_COMBINER0_NV 0x8550
+#define GL_COMBINER1_NV 0x8551
+#define GL_COMBINER2_NV 0x8552
+#define GL_COMBINER3_NV 0x8553
+#define GL_COMBINER4_NV 0x8554
+#define GL_COMBINER5_NV 0x8555
+#define GL_COMBINER6_NV 0x8556
+#define GL_COMBINER7_NV 0x8557
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
+typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param);
+GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
+GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params);
#endif
+#endif /* GL_NV_register_combiners */
-#ifndef GL_EXT_depth_bounds_test
-#define GL_EXT_depth_bounds_test 1
+#ifndef GL_NV_register_combiners2
+#define GL_NV_register_combiners2 1
+#define GL_PER_STAGE_CONSTANTS_NV 0x8535
+typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
+GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params);
#endif
+#endif /* GL_NV_register_combiners2 */
-#ifndef GL_EXT_texture_mirror_clamp
-#define GL_EXT_texture_mirror_clamp 1
-#endif
+#ifndef GL_NV_shader_atomic_counters
+#define GL_NV_shader_atomic_counters 1
+#endif /* GL_NV_shader_atomic_counters */
-#ifndef GL_EXT_blend_equation_separate
-#define GL_EXT_blend_equation_separate 1
+#ifndef GL_NV_shader_atomic_float
+#define GL_NV_shader_atomic_float 1
+#endif /* GL_NV_shader_atomic_float */
+
+#ifndef GL_NV_shader_buffer_load
+#define GL_NV_shader_buffer_load 1
+#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D
+#define GL_GPU_ADDRESS_NV 0x8F34
+#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35
+typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access);
+typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access);
+typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer);
+typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params);
+typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params);
+typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result);
+typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value);
+typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
+GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access);
+GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target);
+GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target);
+GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access);
+GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer);
+GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer);
+GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params);
+GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params);
+GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result);
+GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value);
+GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value);
+GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
#endif
+#endif /* GL_NV_shader_buffer_load */
-#ifndef GL_MESA_pack_invert
-#define GL_MESA_pack_invert 1
-#endif
+#ifndef GL_NV_shader_buffer_store
+#define GL_NV_shader_buffer_store 1
+#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010
+#endif /* GL_NV_shader_buffer_store */
-#ifndef GL_MESA_ycbcr_texture
-#define GL_MESA_ycbcr_texture 1
-#endif
+#ifndef GL_NV_shader_storage_buffer_object
+#define GL_NV_shader_storage_buffer_object 1
+#endif /* GL_NV_shader_storage_buffer_object */
-#ifndef GL_EXT_pixel_buffer_object
-#define GL_EXT_pixel_buffer_object 1
-#endif
+#ifndef GL_NV_shader_thread_group
+#define GL_NV_shader_thread_group 1
+#define GL_WARP_SIZE_NV 0x9339
+#define GL_WARPS_PER_SM_NV 0x933A
+#define GL_SM_COUNT_NV 0x933B
+#endif /* GL_NV_shader_thread_group */
-#ifndef GL_NV_fragment_program_option
-#define GL_NV_fragment_program_option 1
-#endif
+#ifndef GL_NV_shader_thread_shuffle
+#define GL_NV_shader_thread_shuffle 1
+#endif /* GL_NV_shader_thread_shuffle */
-#ifndef GL_NV_fragment_program2
-#define GL_NV_fragment_program2 1
-#endif
+#ifndef GL_NV_tessellation_program5
+#define GL_NV_tessellation_program5 1
+#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8
+#define GL_TESS_CONTROL_PROGRAM_NV 0x891E
+#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F
+#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74
+#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75
+#endif /* GL_NV_tessellation_program5 */
-#ifndef GL_NV_vertex_program2_option
-#define GL_NV_vertex_program2_option 1
-#endif
+#ifndef GL_NV_texgen_emboss
+#define GL_NV_texgen_emboss 1
+#define GL_EMBOSS_LIGHT_NV 0x855D
+#define GL_EMBOSS_CONSTANT_NV 0x855E
+#define GL_EMBOSS_MAP_NV 0x855F
+#endif /* GL_NV_texgen_emboss */
-#ifndef GL_NV_vertex_program3
-#define GL_NV_vertex_program3 1
-#endif
+#ifndef GL_NV_texgen_reflection
+#define GL_NV_texgen_reflection 1
+#define GL_NORMAL_MAP_NV 0x8511
+#define GL_REFLECTION_MAP_NV 0x8512
+#endif /* GL_NV_texgen_reflection */
-#ifndef GL_EXT_framebuffer_object
-#define GL_EXT_framebuffer_object 1
+#ifndef GL_NV_texture_barrier
+#define GL_NV_texture_barrier 1
+typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer);
-GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer);
-GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers);
-GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers);
-GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer);
-GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer);
-GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers);
-GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers);
-GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target);
-GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
-typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
-typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
-typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
-typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
+GLAPI void APIENTRY glTextureBarrierNV (void);
#endif
+#endif /* GL_NV_texture_barrier */
-#ifndef GL_GREMEDY_string_marker
-#define GL_GREMEDY_string_marker 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const GLvoid *string);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
-#endif
+#ifndef GL_NV_texture_compression_vtc
+#define GL_NV_texture_compression_vtc 1
+#endif /* GL_NV_texture_compression_vtc */
-#ifndef GL_EXT_packed_depth_stencil
-#define GL_EXT_packed_depth_stencil 1
-#endif
+#ifndef GL_NV_texture_env_combine4
+#define GL_NV_texture_env_combine4 1
+#define GL_COMBINE4_NV 0x8503
+#define GL_SOURCE3_RGB_NV 0x8583
+#define GL_SOURCE3_ALPHA_NV 0x858B
+#define GL_OPERAND3_RGB_NV 0x8593
+#define GL_OPERAND3_ALPHA_NV 0x859B
+#endif /* GL_NV_texture_env_combine4 */
-#ifndef GL_EXT_stencil_clear_tag
-#define GL_EXT_stencil_clear_tag 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag);
-#endif
+#ifndef GL_NV_texture_expand_normal
+#define GL_NV_texture_expand_normal 1
+#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
+#endif /* GL_NV_texture_expand_normal */
+
+#ifndef GL_NV_texture_multisample
+#define GL_NV_texture_multisample 1
+#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045
+#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046
+typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+GLAPI void APIENTRY glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+GLAPI void APIENTRY glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+GLAPI void APIENTRY glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+GLAPI void APIENTRY glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+#endif
+#endif /* GL_NV_texture_multisample */
-#ifndef GL_EXT_texture_sRGB
-#define GL_EXT_texture_sRGB 1
-#endif
+#ifndef GL_NV_texture_rectangle
+#define GL_NV_texture_rectangle 1
+#define GL_TEXTURE_RECTANGLE_NV 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8
+#endif /* GL_NV_texture_rectangle */
-#ifndef GL_EXT_framebuffer_blit
-#define GL_EXT_framebuffer_blit 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-#endif
+#ifndef GL_NV_texture_shader
+#define GL_NV_texture_shader 1
+#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C
+#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
+#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
+#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
+#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
+#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
+#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
+#define GL_SHADER_CONSISTENT_NV 0x86DD
+#define GL_TEXTURE_SHADER_NV 0x86DE
+#define GL_SHADER_OPERATION_NV 0x86DF
+#define GL_CULL_MODES_NV 0x86E0
+#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1
+#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2
+#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3
+#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1
+#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2
+#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3
+#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4
+#define GL_CONST_EYE_NV 0x86E5
+#define GL_PASS_THROUGH_NV 0x86E6
+#define GL_CULL_FRAGMENT_NV 0x86E7
+#define GL_OFFSET_TEXTURE_2D_NV 0x86E8
+#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9
+#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA
+#define GL_DOT_PRODUCT_NV 0x86EC
+#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED
+#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE
+#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
+#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
+#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
+#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
+#define GL_HILO_NV 0x86F4
+#define GL_DSDT_NV 0x86F5
+#define GL_DSDT_MAG_NV 0x86F6
+#define GL_DSDT_MAG_VIB_NV 0x86F7
+#define GL_HILO16_NV 0x86F8
+#define GL_SIGNED_HILO_NV 0x86F9
+#define GL_SIGNED_HILO16_NV 0x86FA
+#define GL_SIGNED_RGBA_NV 0x86FB
+#define GL_SIGNED_RGBA8_NV 0x86FC
+#define GL_SIGNED_RGB_NV 0x86FE
+#define GL_SIGNED_RGB8_NV 0x86FF
+#define GL_SIGNED_LUMINANCE_NV 0x8701
+#define GL_SIGNED_LUMINANCE8_NV 0x8702
+#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
+#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
+#define GL_SIGNED_ALPHA_NV 0x8705
+#define GL_SIGNED_ALPHA8_NV 0x8706
+#define GL_SIGNED_INTENSITY_NV 0x8707
+#define GL_SIGNED_INTENSITY8_NV 0x8708
+#define GL_DSDT8_NV 0x8709
+#define GL_DSDT8_MAG8_NV 0x870A
+#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
+#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
+#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
+#define GL_HI_SCALE_NV 0x870E
+#define GL_LO_SCALE_NV 0x870F
+#define GL_DS_SCALE_NV 0x8710
+#define GL_DT_SCALE_NV 0x8711
+#define GL_MAGNITUDE_SCALE_NV 0x8712
+#define GL_VIBRANCE_SCALE_NV 0x8713
+#define GL_HI_BIAS_NV 0x8714
+#define GL_LO_BIAS_NV 0x8715
+#define GL_DS_BIAS_NV 0x8716
+#define GL_DT_BIAS_NV 0x8717
+#define GL_MAGNITUDE_BIAS_NV 0x8718
+#define GL_VIBRANCE_BIAS_NV 0x8719
+#define GL_TEXTURE_BORDER_VALUES_NV 0x871A
+#define GL_TEXTURE_HI_SIZE_NV 0x871B
+#define GL_TEXTURE_LO_SIZE_NV 0x871C
+#define GL_TEXTURE_DS_SIZE_NV 0x871D
+#define GL_TEXTURE_DT_SIZE_NV 0x871E
+#define GL_TEXTURE_MAG_SIZE_NV 0x871F
+#endif /* GL_NV_texture_shader */
-#ifndef GL_EXT_framebuffer_multisample
-#define GL_EXT_framebuffer_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-#endif
+#ifndef GL_NV_texture_shader2
+#define GL_NV_texture_shader2 1
+#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF
+#endif /* GL_NV_texture_shader2 */
-#ifndef GL_MESAX_texture_stack
-#define GL_MESAX_texture_stack 1
+#ifndef GL_NV_texture_shader3
+#define GL_NV_texture_shader3 1
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
+#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854
+#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
+#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858
+#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859
+#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
+#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B
+#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C
+#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
+#define GL_HILO8_NV 0x885E
+#define GL_SIGNED_HILO8_NV 0x885F
+#define GL_FORCE_BLUE_TO_ONE_NV 0x8860
+#endif /* GL_NV_texture_shader3 */
+
+#ifndef GL_NV_transform_feedback
+#define GL_NV_transform_feedback 1
+#define GL_BACK_PRIMARY_COLOR_NV 0x8C77
+#define GL_BACK_SECONDARY_COLOR_NV 0x8C78
+#define GL_TEXTURE_COORD_NV 0x8C79
+#define GL_CLIP_DISTANCE_NV 0x8C7A
+#define GL_VERTEX_ID_NV 0x8C7B
+#define GL_PRIMITIVE_ID_NV 0x8C7C
+#define GL_GENERIC_ATTRIB_NV 0x8C7D
+#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80
+#define GL_ACTIVE_VARYINGS_NV 0x8C81
+#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82
+#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85
+#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86
+#define GL_PRIMITIVES_GENERATED_NV 0x8C87
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88
+#define GL_RASTERIZER_DISCARD_NV 0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B
+#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C
+#define GL_SEPARATE_ATTRIBS_NV 0x8C8D
+#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F
+#define GL_LAYER_NV 0x8DAA
+#define GL_NEXT_BUFFER_NV -2
+#define GL_SKIP_COMPONENTS4_NV -3
+#define GL_SKIP_COMPONENTS3_NV -4
+#define GL_SKIP_COMPONENTS2_NV -5
+#define GL_SKIP_COMPONENTS1_NV -6
+typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode);
+typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode);
+GLAPI void APIENTRY glEndTransformFeedbackNV (void);
+GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode);
+GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer);
+GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
+GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name);
+GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location);
+GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode);
#endif
+#endif /* GL_NV_transform_feedback */
-#ifndef GL_EXT_timer_query
-#define GL_EXT_timer_query 1
+#ifndef GL_NV_transform_feedback2
+#define GL_NV_transform_feedback2 1
+#define GL_TRANSFORM_FEEDBACK_NV 0x8E22
+#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23
+#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24
+#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25
+typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids);
+typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void);
+typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void);
+typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64EXT *params);
-GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64EXT *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);
+GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id);
+GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids);
+GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids);
+GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id);
+GLAPI void APIENTRY glPauseTransformFeedbackNV (void);
+GLAPI void APIENTRY glResumeTransformFeedbackNV (void);
+GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id);
#endif
+#endif /* GL_NV_transform_feedback2 */
-#ifndef GL_EXT_gpu_program_parameters
-#define GL_EXT_gpu_program_parameters 1
+#ifndef GL_NV_vdpau_interop
+#define GL_NV_vdpau_interop 1
+typedef GLintptr GLvdpauSurfaceNV;
+#define GL_SURFACE_STATE_NV 0x86EB
+#define GL_SURFACE_REGISTERED_NV 0x86FD
+#define GL_SURFACE_MAPPED_NV 0x8700
+#define GL_WRITE_DISCARD_NV 0x88BE
+typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const void *vdpDevice, const void *getProcAddress);
+typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void);
+typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
+typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
+typedef GLboolean (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface);
+typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface);
+typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access);
+typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);
+typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+GLAPI void APIENTRY glVDPAUInitNV (const void *vdpDevice, const void *getProcAddress);
+GLAPI void APIENTRY glVDPAUFiniNV (void);
+GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
+GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
+GLAPI GLboolean APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface);
+GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface);
+GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access);
+GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);
+GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);
#endif
+#endif /* GL_NV_vdpau_interop */
-#ifndef GL_APPLE_flush_buffer_range
-#define GL_APPLE_flush_buffer_range 1
+#ifndef GL_NV_vertex_array_range
+#define GL_NV_vertex_array_range 1
+#define GL_VERTEX_ARRAY_RANGE_NV 0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E
+#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F
+#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
+#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const void *pointer);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY glFlushVertexArrayRangeNV (void);
+GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const void *pointer);
#endif
+#endif /* GL_NV_vertex_array_range */
-#ifndef GL_NV_gpu_program4
-#define GL_NV_gpu_program4 1
+#ifndef GL_NV_vertex_array_range2
+#define GL_NV_vertex_array_range2 1
+#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
+#endif /* GL_NV_vertex_array_range2 */
+
+#ifndef GL_NV_vertex_attrib_integer_64bit
+#define GL_NV_vertex_attrib_integer_64bit 1
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params);
-GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);
-GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);
-GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params);
-GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);
-GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);
-GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params);
-GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params);
-GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params);
-GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
+GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x);
+GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y);
+GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x);
+GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y);
+GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v);
+GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params);
+GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params);
+GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride);
#endif
+#endif /* GL_NV_vertex_attrib_integer_64bit */
-#ifndef GL_NV_geometry_program4
-#define GL_NV_geometry_program4 1
+#ifndef GL_NV_vertex_buffer_unified_memory
+#define GL_NV_vertex_buffer_unified_memory 1
+#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E
+#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F
+#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20
+#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21
+#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22
+#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23
+#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24
+#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25
+#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26
+#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27
+#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28
+#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29
+#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A
+#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B
+#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C
+#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D
+#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E
+#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F
+#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30
+#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31
+#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32
+#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33
+#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40
+#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41
+#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42
+typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
+typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit);
-GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
+GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride);
+GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride);
+GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride);
+GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride);
+GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
+GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result);
#endif
+#endif /* GL_NV_vertex_buffer_unified_memory */
-#ifndef GL_EXT_geometry_shader4
-#define GL_EXT_geometry_shader4 1
+#ifndef GL_NV_vertex_program
+#define GL_NV_vertex_program 1
+#define GL_VERTEX_PROGRAM_NV 0x8620
+#define GL_VERTEX_STATE_PROGRAM_NV 0x8621
+#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623
+#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624
+#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625
+#define GL_CURRENT_ATTRIB_NV 0x8626
+#define GL_PROGRAM_LENGTH_NV 0x8627
+#define GL_PROGRAM_STRING_NV 0x8628
+#define GL_MODELVIEW_PROJECTION_NV 0x8629
+#define GL_IDENTITY_NV 0x862A
+#define GL_INVERSE_NV 0x862B
+#define GL_TRANSPOSE_NV 0x862C
+#define GL_INVERSE_TRANSPOSE_NV 0x862D
+#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
+#define GL_MAX_TRACK_MATRICES_NV 0x862F
+#define GL_MATRIX0_NV 0x8630
+#define GL_MATRIX1_NV 0x8631
+#define GL_MATRIX2_NV 0x8632
+#define GL_MATRIX3_NV 0x8633
+#define GL_MATRIX4_NV 0x8634
+#define GL_MATRIX5_NV 0x8635
+#define GL_MATRIX6_NV 0x8636
+#define GL_MATRIX7_NV 0x8637
+#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640
+#define GL_CURRENT_MATRIX_NV 0x8641
+#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643
+#define GL_PROGRAM_PARAMETER_NV 0x8644
+#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645
+#define GL_PROGRAM_TARGET_NV 0x8646
+#define GL_PROGRAM_RESIDENT_NV 0x8647
+#define GL_TRACK_MATRIX_NV 0x8648
+#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649
+#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A
+#define GL_PROGRAM_ERROR_POSITION_NV 0x864B
+#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650
+#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651
+#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652
+#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653
+#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654
+#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655
+#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656
+#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657
+#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658
+#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659
+#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A
+#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B
+#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C
+#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D
+#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E
+#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F
+#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660
+#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661
+#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662
+#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663
+#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664
+#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665
+#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666
+#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667
+#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668
+#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669
+#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A
+#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B
+#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C
+#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D
+#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E
+#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F
+#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670
+#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671
+#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672
+#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673
+#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674
+#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675
+#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676
+#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677
+#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678
+#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679
+#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A
+#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B
+#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C
+#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D
+#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E
+#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F
+typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
+typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, void **pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
+GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences);
+GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id);
+GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs);
+GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params);
+GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs);
+GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program);
+GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, void **pointer);
+GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id);
+GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
+GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs);
+GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform);
+GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer);
+GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x);
+GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x);
+GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y);
+GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v);
#endif
+#endif /* GL_NV_vertex_program */
+
+#ifndef GL_NV_vertex_program1_1
+#define GL_NV_vertex_program1_1 1
+#endif /* GL_NV_vertex_program1_1 */
+
+#ifndef GL_NV_vertex_program2
+#define GL_NV_vertex_program2 1
+#endif /* GL_NV_vertex_program2 */
+
+#ifndef GL_NV_vertex_program2_option
+#define GL_NV_vertex_program2_option 1
+#endif /* GL_NV_vertex_program2_option */
+
+#ifndef GL_NV_vertex_program3
+#define GL_NV_vertex_program3 1
+#endif /* GL_NV_vertex_program3 */
#ifndef GL_NV_vertex_program4
#define GL_NV_vertex_program4 1
+#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x);
GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y);
@@ -9789,1237 +10150,1010 @@ GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v);
GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v);
GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v);
GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params);
GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params);
#endif
+#endif /* GL_NV_vertex_program4 */
-#ifndef GL_EXT_gpu_shader4
-#define GL_EXT_gpu_shader4 1
+#ifndef GL_NV_video_capture
+#define GL_NV_video_capture 1
+#define GL_VIDEO_BUFFER_NV 0x9020
+#define GL_VIDEO_BUFFER_BINDING_NV 0x9021
+#define GL_FIELD_UPPER_NV 0x9022
+#define GL_FIELD_LOWER_NV 0x9023
+#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024
+#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025
+#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026
+#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027
+#define GL_VIDEO_BUFFER_PITCH_NV 0x9028
+#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029
+#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A
+#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B
+#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C
+#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D
+#define GL_PARTIAL_SUCCESS_NV 0x902E
+#define GL_SUCCESS_NV 0x902F
+#define GL_FAILURE_NV 0x9030
+#define GL_YCBYCR8_422_NV 0x9031
+#define GL_YCBAYCR8A_4224_NV 0x9032
+#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033
+#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034
+#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035
+#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036
+#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037
+#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038
+#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039
+#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A
+#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B
+#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C
+typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
+typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
+typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
+typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
+typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);
+typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);
+typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params);
-GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name);
-GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0);
-GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1);
-GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2);
-GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params);
-typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot);
+GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
+GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
+GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot);
+GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);
+GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);
+GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);
#endif
+#endif /* GL_NV_video_capture */
-#ifndef GL_EXT_draw_instanced
-#define GL_EXT_draw_instanced 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
-GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-#endif
+#ifndef GL_OML_interlace
+#define GL_OML_interlace 1
+#define GL_INTERLACE_OML 0x8980
+#define GL_INTERLACE_READ_OML 0x8981
+#endif /* GL_OML_interlace */
-#ifndef GL_EXT_packed_float
-#define GL_EXT_packed_float 1
-#endif
+#ifndef GL_OML_resample
+#define GL_OML_resample 1
+#define GL_PACK_RESAMPLE_OML 0x8984
+#define GL_UNPACK_RESAMPLE_OML 0x8985
+#define GL_RESAMPLE_REPLICATE_OML 0x8986
+#define GL_RESAMPLE_ZERO_FILL_OML 0x8987
+#define GL_RESAMPLE_AVERAGE_OML 0x8988
+#define GL_RESAMPLE_DECIMATE_OML 0x8989
+#endif /* GL_OML_resample */
-#ifndef GL_EXT_texture_array
-#define GL_EXT_texture_array 1
-#endif
+#ifndef GL_OML_subsample
+#define GL_OML_subsample 1
+#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982
+#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983
+#endif /* GL_OML_subsample */
-#ifndef GL_EXT_texture_buffer_object
-#define GL_EXT_texture_buffer_object 1
+#ifndef GL_PGI_misc_hints
+#define GL_PGI_misc_hints 1
+#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8
+#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD
+#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE
+#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202
+#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203
+#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204
+#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C
+#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D
+#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E
+#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F
+#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210
+#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211
+#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216
+#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217
+#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218
+#define GL_FULL_STIPPLE_HINT_PGI 0x1A219
+#define GL_CLIP_NEAR_HINT_PGI 0x1A220
+#define GL_CLIP_FAR_HINT_PGI 0x1A221
+#define GL_WIDE_LINE_HINT_PGI 0x1A222
+#define GL_BACK_NORMALS_HINT_PGI 0x1A223
+typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode);
#endif
+#endif /* GL_PGI_misc_hints */
-#ifndef GL_EXT_texture_compression_latc
-#define GL_EXT_texture_compression_latc 1
-#endif
+#ifndef GL_PGI_vertex_hints
+#define GL_PGI_vertex_hints 1
+#define GL_VERTEX_DATA_HINT_PGI 0x1A22A
+#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B
+#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C
+#define GL_MAX_VERTEX_HINT_PGI 0x1A22D
+#define GL_COLOR3_BIT_PGI 0x00010000
+#define GL_COLOR4_BIT_PGI 0x00020000
+#define GL_EDGEFLAG_BIT_PGI 0x00040000
+#define GL_INDEX_BIT_PGI 0x00080000
+#define GL_MAT_AMBIENT_BIT_PGI 0x00100000
+#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
+#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000
+#define GL_MAT_EMISSION_BIT_PGI 0x00800000
+#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000
+#define GL_MAT_SHININESS_BIT_PGI 0x02000000
+#define GL_MAT_SPECULAR_BIT_PGI 0x04000000
+#define GL_NORMAL_BIT_PGI 0x08000000
+#define GL_TEXCOORD1_BIT_PGI 0x10000000
+#define GL_TEXCOORD2_BIT_PGI 0x20000000
+#define GL_TEXCOORD3_BIT_PGI 0x40000000
+#define GL_TEXCOORD4_BIT_PGI 0x80000000
+#define GL_VERTEX23_BIT_PGI 0x00000004
+#define GL_VERTEX4_BIT_PGI 0x00000008
+#endif /* GL_PGI_vertex_hints */
-#ifndef GL_EXT_texture_compression_rgtc
-#define GL_EXT_texture_compression_rgtc 1
-#endif
+#ifndef GL_REND_screen_coordinates
+#define GL_REND_screen_coordinates 1
+#define GL_SCREEN_COORDINATES_REND 0x8490
+#define GL_INVERTED_SCREEN_W_REND 0x8491
+#endif /* GL_REND_screen_coordinates */
-#ifndef GL_EXT_texture_shared_exponent
-#define GL_EXT_texture_shared_exponent 1
-#endif
+#ifndef GL_S3_s3tc
+#define GL_S3_s3tc 1
+#define GL_RGB_S3TC 0x83A0
+#define GL_RGB4_S3TC 0x83A1
+#define GL_RGBA_S3TC 0x83A2
+#define GL_RGBA4_S3TC 0x83A3
+#define GL_RGBA_DXT5_S3TC 0x83A4
+#define GL_RGBA4_DXT5_S3TC 0x83A5
+#endif /* GL_S3_s3tc */
-#ifndef GL_NV_depth_buffer_float
-#define GL_NV_depth_buffer_float 1
+#ifndef GL_SGIS_detail_texture
+#define GL_SGIS_detail_texture 1
+#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095
+#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
+#define GL_LINEAR_DETAIL_SGIS 0x8097
+#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098
+#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099
+#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A
+#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B
+#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
+typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar);
-GLAPI void APIENTRY glClearDepthdNV (GLdouble depth);
-GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);
-typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);
-typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax);
-#endif
-
-#ifndef GL_NV_fragment_program4
-#define GL_NV_fragment_program4 1
+GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);
+GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points);
#endif
+#endif /* GL_SGIS_detail_texture */
-#ifndef GL_NV_framebuffer_multisample_coverage
-#define GL_NV_framebuffer_multisample_coverage 1
+#ifndef GL_SGIS_fog_function
+#define GL_SGIS_fog_function 1
+#define GL_FOG_FUNC_SGIS 0x812A
+#define GL_FOG_FUNC_POINTS_SGIS 0x812B
+#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C
+typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_EXT_framebuffer_sRGB
-#define GL_EXT_framebuffer_sRGB 1
+GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points);
+GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points);
#endif
+#endif /* GL_SGIS_fog_function */
-#ifndef GL_NV_geometry_shader4
-#define GL_NV_geometry_shader4 1
-#endif
+#ifndef GL_SGIS_generate_mipmap
+#define GL_SGIS_generate_mipmap 1
+#define GL_GENERATE_MIPMAP_SGIS 0x8191
+#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
+#endif /* GL_SGIS_generate_mipmap */
-#ifndef GL_NV_parameter_buffer_object
-#define GL_NV_parameter_buffer_object 1
+#ifndef GL_SGIS_multisample
+#define GL_SGIS_multisample 1
+#define GL_MULTISAMPLE_SGIS 0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F
+#define GL_SAMPLE_MASK_SGIS 0x80A0
+#define GL_1PASS_SGIS 0x80A1
+#define GL_2PASS_0_SGIS 0x80A2
+#define GL_2PASS_1_SGIS 0x80A3
+#define GL_4PASS_0_SGIS 0x80A4
+#define GL_4PASS_1_SGIS 0x80A5
+#define GL_4PASS_2_SGIS 0x80A6
+#define GL_4PASS_3_SGIS 0x80A7
+#define GL_SAMPLE_BUFFERS_SGIS 0x80A8
+#define GL_SAMPLES_SGIS 0x80A9
+#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA
+#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB
+#define GL_SAMPLE_PATTERN_SGIS 0x80AC
+typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
-GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
-GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert);
+GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern);
#endif
+#endif /* GL_SGIS_multisample */
-#ifndef GL_EXT_draw_buffers2
-#define GL_EXT_draw_buffers2 1
+#ifndef GL_SGIS_pixel_texture
+#define GL_SGIS_pixel_texture 1
+#define GL_PIXEL_TEXTURE_SGIS 0x8353
+#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354
+#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355
+#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data);
-GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data);
-GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index);
-GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index);
-GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data);
-typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
-typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
-typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index);
+GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param);
+GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params);
+GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params);
#endif
+#endif /* GL_SGIS_pixel_texture */
-#ifndef GL_NV_transform_feedback
-#define GL_NV_transform_feedback 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode);
-GLAPI void APIENTRY glEndTransformFeedbackNV (void);
-GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode);
-GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer);
-GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
-GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name);
-GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location);
-GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode);
-typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode);
-typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
-typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode);
-#endif
+#ifndef GL_SGIS_point_line_texgen
+#define GL_SGIS_point_line_texgen 1
+#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0
+#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1
+#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2
+#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3
+#define GL_EYE_POINT_SGIS 0x81F4
+#define GL_OBJECT_POINT_SGIS 0x81F5
+#define GL_EYE_LINE_SGIS 0x81F6
+#define GL_OBJECT_LINE_SGIS 0x81F7
+#endif /* GL_SGIS_point_line_texgen */
-#ifndef GL_EXT_bindable_uniform
-#define GL_EXT_bindable_uniform 1
+#ifndef GL_SGIS_point_parameters
+#define GL_SGIS_point_parameters 1
+#define GL_POINT_SIZE_MIN_SGIS 0x8126
+#define GL_POINT_SIZE_MAX_SGIS 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128
+#define GL_DISTANCE_ATTENUATION_SGIS 0x8129
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer);
-GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location);
-GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer);
-typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location);
-typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location);
+GLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params);
#endif
+#endif /* GL_SGIS_point_parameters */
-#ifndef GL_EXT_texture_integer
-#define GL_EXT_texture_integer 1
+#ifndef GL_SGIS_sharpen_texture
+#define GL_SGIS_sharpen_texture 1
+#define GL_LINEAR_SHARPEN_SGIS 0x80AD
+#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE
+#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF
+#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0
+typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params);
-GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha);
-GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha);
-typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha);
+GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);
+GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points);
#endif
+#endif /* GL_SGIS_sharpen_texture */
-#ifndef GL_GREMEDY_frame_terminator
-#define GL_GREMEDY_frame_terminator 1
+#ifndef GL_SGIS_texture4D
+#define GL_SGIS_texture4D 1
+#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130
+#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131
+#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132
+#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133
+#define GL_TEXTURE_4D_SGIS 0x8134
+#define GL_PROXY_TEXTURE_4D_SGIS 0x8135
+#define GL_TEXTURE_4DSIZE_SGIS 0x8136
+#define GL_TEXTURE_WRAP_Q_SGIS 0x8137
+#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138
+#define GL_TEXTURE_4D_BINDING_SGIS 0x814F
+typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFrameTerminatorGREMEDY (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void);
+GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels);
+GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels);
#endif
+#endif /* GL_SGIS_texture4D */
-#ifndef GL_NV_conditional_render
-#define GL_NV_conditional_render 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode);
-GLAPI void APIENTRY glEndConditionalRenderNV (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode);
-typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void);
-#endif
+#ifndef GL_SGIS_texture_border_clamp
+#define GL_SGIS_texture_border_clamp 1
+#define GL_CLAMP_TO_BORDER_SGIS 0x812D
+#endif /* GL_SGIS_texture_border_clamp */
-#ifndef GL_NV_present_video
-#define GL_NV_present_video 1
+#ifndef GL_SGIS_texture_color_mask
+#define GL_SGIS_texture_color_mask 1
+#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF
+typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
-GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
-GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params);
-GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
-typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
-typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params);
-typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params);
+GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
#endif
+#endif /* GL_SGIS_texture_color_mask */
-#ifndef GL_EXT_transform_feedback
-#define GL_EXT_transform_feedback 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode);
-GLAPI void APIENTRY glEndTransformFeedbackEXT (void);
-GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer);
-GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
-GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode);
-typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void);
-typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
-typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-#endif
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_SGIS_texture_edge_clamp 1
+#define GL_CLAMP_TO_EDGE_SGIS 0x812F
+#endif /* GL_SGIS_texture_edge_clamp */
-#ifndef GL_EXT_direct_state_access
-#define GL_EXT_direct_state_access 1
+#ifndef GL_SGIS_texture_filter4
+#define GL_SGIS_texture_filter4 1
+#define GL_FILTER4_SGIS 0x8146
+#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147
+typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);
+typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask);
-GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask);
-GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m);
-GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m);
-GLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m);
-GLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m);
-GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode);
-GLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-GLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-GLAPI void APIENTRY glMatrixPopEXT (GLenum mode);
-GLAPI void APIENTRY glMatrixPushEXT (GLenum mode);
-GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m);
-GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m);
-GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m);
-GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m);
-GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);
-GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);
-GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture);
-GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index);
-GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index);
-GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
-GLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);
-GLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param);
-GLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data);
-GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data);
-GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, GLvoid* *data);
-GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, GLvoid *img);
-GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, GLvoid *img);
-GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string);
-GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params);
-GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params);
-GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params);
-GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params);
-GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, GLvoid *string);
-GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params);
-GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params);
-GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params);
-GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params);
-GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params);
-GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params);
-GLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params);
-GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params);
-GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0);
-GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0);
-GLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1);
-GLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-GLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0);
-GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1);
-GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage);
-GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);
-GLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access);
-GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer);
-GLAPI GLvoid* APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
-GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length);
-GLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, GLvoid* *params);
-GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data);
-GLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);
-GLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);
-GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params);
-GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target);
-GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target);
-GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target);
-GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode);
-GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs);
-GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode);
-GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params);
-GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
-GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
-GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);
-GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer);
-GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer);
-GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x);
-GLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
-typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
-typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m);
-typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m);
-typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
-typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture);
-typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
-typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
-typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);
-typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data);
-typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid* *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, GLvoid *img);
-typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, GLvoid *img);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params);
-typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage);
-typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);
-typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access);
-typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer);
-typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
-typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
-typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* *params);
-typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data);
-typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);
-typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);
-typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params);
-typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target);
-typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
-typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);
-typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights);
+GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
#endif
+#endif /* GL_SGIS_texture_filter4 */
-#ifndef GL_EXT_vertex_array_bgra
-#define GL_EXT_vertex_array_bgra 1
-#endif
+#ifndef GL_SGIS_texture_lod
+#define GL_SGIS_texture_lod 1
+#define GL_TEXTURE_MIN_LOD_SGIS 0x813A
+#define GL_TEXTURE_MAX_LOD_SGIS 0x813B
+#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C
+#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D
+#endif /* GL_SGIS_texture_lod */
-#ifndef GL_EXT_texture_swizzle
-#define GL_EXT_texture_swizzle 1
-#endif
+#ifndef GL_SGIS_texture_select
+#define GL_SGIS_texture_select 1
+#define GL_DUAL_ALPHA4_SGIS 0x8110
+#define GL_DUAL_ALPHA8_SGIS 0x8111
+#define GL_DUAL_ALPHA12_SGIS 0x8112
+#define GL_DUAL_ALPHA16_SGIS 0x8113
+#define GL_DUAL_LUMINANCE4_SGIS 0x8114
+#define GL_DUAL_LUMINANCE8_SGIS 0x8115
+#define GL_DUAL_LUMINANCE12_SGIS 0x8116
+#define GL_DUAL_LUMINANCE16_SGIS 0x8117
+#define GL_DUAL_INTENSITY4_SGIS 0x8118
+#define GL_DUAL_INTENSITY8_SGIS 0x8119
+#define GL_DUAL_INTENSITY12_SGIS 0x811A
+#define GL_DUAL_INTENSITY16_SGIS 0x811B
+#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C
+#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D
+#define GL_QUAD_ALPHA4_SGIS 0x811E
+#define GL_QUAD_ALPHA8_SGIS 0x811F
+#define GL_QUAD_LUMINANCE4_SGIS 0x8120
+#define GL_QUAD_LUMINANCE8_SGIS 0x8121
+#define GL_QUAD_INTENSITY4_SGIS 0x8122
+#define GL_QUAD_INTENSITY8_SGIS 0x8123
+#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124
+#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125
+#endif /* GL_SGIS_texture_select */
-#ifndef GL_NV_explicit_multisample
-#define GL_NV_explicit_multisample 1
+#ifndef GL_SGIX_async
+#define GL_SGIX_async 1
+#define GL_ASYNC_MARKER_SGIX 0x8329
+typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
+typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
+typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);
+typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
+typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
+typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val);
-GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask);
-GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val);
-typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask);
-typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker);
+GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp);
+GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp);
+GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range);
+GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range);
+GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker);
#endif
+#endif /* GL_SGIX_async */
-#ifndef GL_NV_transform_feedback2
-#define GL_NV_transform_feedback2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id);
-GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids);
-GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids);
-GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id);
-GLAPI void APIENTRY glPauseTransformFeedbackNV (void);
-GLAPI void APIENTRY glResumeTransformFeedbackNV (void);
-GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids);
-typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void);
-typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void);
-typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id);
-#endif
+#ifndef GL_SGIX_async_histogram
+#define GL_SGIX_async_histogram 1
+#define GL_ASYNC_HISTOGRAM_SGIX 0x832C
+#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D
+#endif /* GL_SGIX_async_histogram */
-#ifndef GL_ATI_meminfo
-#define GL_ATI_meminfo 1
-#endif
+#ifndef GL_SGIX_async_pixel
+#define GL_SGIX_async_pixel 1
+#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C
+#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D
+#define GL_ASYNC_READ_PIXELS_SGIX 0x835E
+#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F
+#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360
+#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361
+#endif /* GL_SGIX_async_pixel */
-#ifndef GL_AMD_performance_monitor
-#define GL_AMD_performance_monitor 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
-GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
-GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
-GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
-GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
-GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);
-GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);
-GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
-GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor);
-GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor);
-GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
-typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
-typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
-typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
-typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
-typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
-typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
-typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
-typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
-typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
-typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
-#endif
+#ifndef GL_SGIX_blend_alpha_minmax
+#define GL_SGIX_blend_alpha_minmax 1
+#define GL_ALPHA_MIN_SGIX 0x8320
+#define GL_ALPHA_MAX_SGIX 0x8321
+#endif /* GL_SGIX_blend_alpha_minmax */
-#ifndef GL_AMD_texture_texture4
-#define GL_AMD_texture_texture4 1
-#endif
+#ifndef GL_SGIX_calligraphic_fragment
+#define GL_SGIX_calligraphic_fragment 1
+#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183
+#endif /* GL_SGIX_calligraphic_fragment */
-#ifndef GL_AMD_vertex_shader_tesselator
-#define GL_AMD_vertex_shader_tesselator 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor);
-GLAPI void APIENTRY glTessellationModeAMD (GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor);
-typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode);
-#endif
+#ifndef GL_SGIX_clipmap
+#define GL_SGIX_clipmap 1
+#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170
+#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171
+#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172
+#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173
+#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174
+#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175
+#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176
+#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177
+#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178
+#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D
+#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E
+#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F
+#endif /* GL_SGIX_clipmap */
-#ifndef GL_EXT_provoking_vertex
-#define GL_EXT_provoking_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode);
-#endif
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_SGIX_convolution_accuracy 1
+#define GL_CONVOLUTION_HINT_SGIX 0x8316
+#endif /* GL_SGIX_convolution_accuracy */
-#ifndef GL_EXT_texture_snorm
-#define GL_EXT_texture_snorm 1
-#endif
+#ifndef GL_SGIX_depth_pass_instrument
+#define GL_SGIX_depth_pass_instrument 1
+#endif /* GL_SGIX_depth_pass_instrument */
-#ifndef GL_AMD_draw_buffers_blend
-#define GL_AMD_draw_buffers_blend 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst);
-GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode);
-GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-#endif
+#ifndef GL_SGIX_depth_texture
+#define GL_SGIX_depth_texture 1
+#define GL_DEPTH_COMPONENT16_SGIX 0x81A5
+#define GL_DEPTH_COMPONENT24_SGIX 0x81A6
+#define GL_DEPTH_COMPONENT32_SGIX 0x81A7
+#endif /* GL_SGIX_depth_texture */
-#ifndef GL_APPLE_texture_range
-#define GL_APPLE_texture_range 1
+#ifndef GL_SGIX_flush_raster
+#define GL_SGIX_flush_raster 1
+typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const GLvoid *pointer);
-GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, GLvoid* *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid* *params);
+GLAPI void APIENTRY glFlushRasterSGIX (void);
#endif
+#endif /* GL_SGIX_flush_raster */
-#ifndef GL_APPLE_float_pixels
-#define GL_APPLE_float_pixels 1
-#endif
+#ifndef GL_SGIX_fog_offset
+#define GL_SGIX_fog_offset 1
+#define GL_FOG_OFFSET_SGIX 0x8198
+#define GL_FOG_OFFSET_VALUE_SGIX 0x8199
+#endif /* GL_SGIX_fog_offset */
-#ifndef GL_APPLE_vertex_program_evaluators
-#define GL_APPLE_vertex_program_evaluators 1
+#ifndef GL_SGIX_fragment_lighting
+#define GL_SGIX_fragment_lighting 1
+#define GL_FRAGMENT_LIGHTING_SGIX 0x8400
+#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401
+#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
+#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
+#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404
+#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405
+#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406
+#define GL_LIGHT_ENV_MODE_SGIX 0x8407
+#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
+#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
+#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
+#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
+#define GL_FRAGMENT_LIGHT0_SGIX 0x840C
+#define GL_FRAGMENT_LIGHT1_SGIX 0x840D
+#define GL_FRAGMENT_LIGHT2_SGIX 0x840E
+#define GL_FRAGMENT_LIGHT3_SGIX 0x840F
+#define GL_FRAGMENT_LIGHT4_SGIX 0x8410
+#define GL_FRAGMENT_LIGHT5_SGIX 0x8411
+#define GL_FRAGMENT_LIGHT6_SGIX 0x8412
+#define GL_FRAGMENT_LIGHT7_SGIX 0x8413
+typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname);
-GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname);
-GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname);
-GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
-GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
-GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
-GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
-typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
-typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname);
-typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
-typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
-typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
-typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
+GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode);
+GLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum light, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param);
+GLAPI void APIENTRY glFragmentLightivSGIX (GLenum light, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum pname, GLint param);
+GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum pname, const GLint *params);
+GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum face, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum face, GLenum pname, GLint param);
+GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params);
+GLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param);
#endif
+#endif /* GL_SGIX_fragment_lighting */
-#ifndef GL_APPLE_aux_depth_stencil
-#define GL_APPLE_aux_depth_stencil 1
+#ifndef GL_SGIX_framezoom
+#define GL_SGIX_framezoom 1
+#define GL_FRAMEZOOM_SGIX 0x818B
+#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C
+#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D
+typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFrameZoomSGIX (GLint factor);
#endif
+#endif /* GL_SGIX_framezoom */
-#ifndef GL_APPLE_object_purgeable
-#define GL_APPLE_object_purgeable 1
+#ifndef GL_SGIX_igloo_interface
+#define GL_SGIX_igloo_interface 1
+typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const void *params);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option);
-GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option);
-GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
-typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
-typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params);
+GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const void *params);
#endif
+#endif /* GL_SGIX_igloo_interface */
-#ifndef GL_APPLE_row_bytes
-#define GL_APPLE_row_bytes 1
+#ifndef GL_SGIX_instruments
+#define GL_SGIX_instruments 1
+#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
+#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181
+typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
+typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);
+typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);
+typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLint APIENTRY glGetInstrumentsSGIX (void);
+GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer);
+GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p);
+GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker);
+GLAPI void APIENTRY glStartInstrumentsSGIX (void);
+GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker);
#endif
+#endif /* GL_SGIX_instruments */
-#ifndef GL_APPLE_rgb_422
-#define GL_APPLE_rgb_422 1
-#endif
+#ifndef GL_SGIX_interlace
+#define GL_SGIX_interlace 1
+#define GL_INTERLACE_SGIX 0x8094
+#endif /* GL_SGIX_interlace */
-#ifndef GL_NV_video_capture
-#define GL_NV_video_capture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot);
-GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
-GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
-GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot);
-GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);
-GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);
-GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
-typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
-typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
-typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
-typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);
-typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);
-typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);
-#endif
+#ifndef GL_SGIX_ir_instrument1
+#define GL_SGIX_ir_instrument1 1
+#define GL_IR_INSTRUMENT1_SGIX 0x817F
+#endif /* GL_SGIX_ir_instrument1 */
-#ifndef GL_NV_copy_image
-#define GL_NV_copy_image 1
+#ifndef GL_SGIX_list_priority
+#define GL_SGIX_list_priority 1
+#define GL_LIST_PRIORITY_SGIX 0x8182
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
+GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params);
+GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param);
+GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params);
#endif
+#endif /* GL_SGIX_list_priority */
-#ifndef GL_EXT_separate_shader_objects
-#define GL_EXT_separate_shader_objects 1
+#ifndef GL_SGIX_pixel_texture
+#define GL_SGIX_pixel_texture 1
+#define GL_PIXEL_TEX_GEN_SGIX 0x8139
+#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B
+typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program);
-GLAPI void APIENTRY glActiveProgramEXT (GLuint program);
-GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program);
-typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program);
-typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string);
+GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode);
#endif
+#endif /* GL_SGIX_pixel_texture */
-#ifndef GL_NV_parameter_buffer_object2
-#define GL_NV_parameter_buffer_object2 1
-#endif
+#ifndef GL_SGIX_pixel_tiles
+#define GL_SGIX_pixel_tiles 1
+#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E
+#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F
+#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140
+#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141
+#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142
+#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143
+#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144
+#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145
+#endif /* GL_SGIX_pixel_tiles */
-#ifndef GL_NV_shader_buffer_load
-#define GL_NV_shader_buffer_load 1
+#ifndef GL_SGIX_polynomial_ffd
+#define GL_SGIX_polynomial_ffd 1
+#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001
+#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002
+#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194
+#define GL_TEXTURE_DEFORMATION_SGIX 0x8195
+#define GL_DEFORMATIONS_MASK_SGIX 0x8196
+#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
+typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask);
+typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access);
-GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target);
-GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target);
-GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access);
-GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer);
-GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer);
-GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params);
-GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params);
-GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result);
-GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value);
-GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params);
-GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value);
-GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access);
-typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target);
-typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access);
-typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer);
-typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params);
-typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params);
-typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result);
-typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value);
-typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
+GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
+GLAPI void APIENTRY glDeformSGIX (GLbitfield mask);
+GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask);
#endif
+#endif /* GL_SGIX_polynomial_ffd */
-#ifndef GL_NV_vertex_buffer_unified_memory
-#define GL_NV_vertex_buffer_unified_memory 1
+#ifndef GL_SGIX_reference_plane
+#define GL_SGIX_reference_plane 1
+#define GL_REFERENCE_PLANE_SGIX 0x817D
+#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E
+typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
-GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride);
-GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride);
-GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride);
-GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride);
-GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride);
-GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride);
-GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride);
-GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride);
-GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
-GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride);
-GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
-typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result);
+GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation);
#endif
+#endif /* GL_SGIX_reference_plane */
-#ifndef GL_NV_texture_barrier
-#define GL_NV_texture_barrier 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureBarrierNV (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void);
-#endif
+#ifndef GL_SGIX_resample
+#define GL_SGIX_resample 1
+#define GL_PACK_RESAMPLE_SGIX 0x842C
+#define GL_UNPACK_RESAMPLE_SGIX 0x842D
+#define GL_RESAMPLE_REPLICATE_SGIX 0x842E
+#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F
+#define GL_RESAMPLE_DECIMATE_SGIX 0x8430
+#endif /* GL_SGIX_resample */
-#ifndef GL_AMD_shader_stencil_export
-#define GL_AMD_shader_stencil_export 1
-#endif
+#ifndef GL_SGIX_scalebias_hint
+#define GL_SGIX_scalebias_hint 1
+#define GL_SCALEBIAS_HINT_SGIX 0x8322
+#endif /* GL_SGIX_scalebias_hint */
-#ifndef GL_AMD_seamless_cubemap_per_texture
-#define GL_AMD_seamless_cubemap_per_texture 1
-#endif
+#ifndef GL_SGIX_shadow
+#define GL_SGIX_shadow 1
+#define GL_TEXTURE_COMPARE_SGIX 0x819A
+#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B
+#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C
+#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D
+#endif /* GL_SGIX_shadow */
-#ifndef GL_AMD_conservative_depth
-#define GL_AMD_conservative_depth 1
-#endif
+#ifndef GL_SGIX_shadow_ambient
+#define GL_SGIX_shadow_ambient 1
+#define GL_SHADOW_AMBIENT_SGIX 0x80BF
+#endif /* GL_SGIX_shadow_ambient */
-#ifndef GL_EXT_shader_image_load_store
-#define GL_EXT_shader_image_load_store 1
+#ifndef GL_SGIX_sprite
+#define GL_SGIX_sprite 1
+#define GL_SPRITE_SGIX 0x8148
+#define GL_SPRITE_MODE_SGIX 0x8149
+#define GL_SPRITE_AXIS_SGIX 0x814A
+#define GL_SPRITE_TRANSLATION_SGIX 0x814B
+#define GL_SPRITE_AXIAL_SGIX 0x814C
+#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D
+#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
-GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
-typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers);
+GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param);
+GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params);
#endif
+#endif /* GL_SGIX_sprite */
-#ifndef GL_EXT_vertex_attrib_64bit
-#define GL_EXT_vertex_attrib_64bit 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x);
-GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-#endif
+#ifndef GL_SGIX_subsample
+#define GL_SGIX_subsample 1
+#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0
+#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1
+#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2
+#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3
+#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4
+#endif /* GL_SGIX_subsample */
-#ifndef GL_NV_gpu_program5
-#define GL_NV_gpu_program5 1
+#ifndef GL_SGIX_tag_sample_buffer
+#define GL_SGIX_tag_sample_buffer 1
+typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params);
-GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param);
+GLAPI void APIENTRY glTagSampleBufferSGIX (void);
#endif
+#endif /* GL_SGIX_tag_sample_buffer */
-#ifndef GL_NV_gpu_shader5
-#define GL_NV_gpu_shader5 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x);
-GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y);
-GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x);
-GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y);
-GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params);
-GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x);
-GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
-GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x);
-GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
-GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x);
-typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y);
-typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x);
-typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y);
-typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-#endif
+#ifndef GL_SGIX_texture_add_env
+#define GL_SGIX_texture_add_env 1
+#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE
+#endif /* GL_SGIX_texture_add_env */
-#ifndef GL_NV_shader_buffer_store
-#define GL_NV_shader_buffer_store 1
-#endif
+#ifndef GL_SGIX_texture_coordinate_clamp
+#define GL_SGIX_texture_coordinate_clamp 1
+#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369
+#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A
+#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B
+#endif /* GL_SGIX_texture_coordinate_clamp */
-#ifndef GL_NV_tessellation_program5
-#define GL_NV_tessellation_program5 1
-#endif
+#ifndef GL_SGIX_texture_lod_bias
+#define GL_SGIX_texture_lod_bias 1
+#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E
+#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F
+#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190
+#endif /* GL_SGIX_texture_lod_bias */
-#ifndef GL_NV_vertex_attrib_integer_64bit
-#define GL_NV_vertex_attrib_integer_64bit 1
+#ifndef GL_SGIX_texture_multi_buffer
+#define GL_SGIX_texture_multi_buffer 1
+#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
+#endif /* GL_SGIX_texture_multi_buffer */
+
+#ifndef GL_SGIX_texture_scale_bias
+#define GL_SGIX_texture_scale_bias 1
+#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179
+#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
+#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
+#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
+#endif /* GL_SGIX_texture_scale_bias */
+
+#ifndef GL_SGIX_vertex_preclip
+#define GL_SGIX_vertex_preclip 1
+#define GL_VERTEX_PRECLIP_SGIX 0x83EE
+#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF
+#endif /* GL_SGIX_vertex_preclip */
+
+#ifndef GL_SGIX_ycrcb
+#define GL_SGIX_ycrcb 1
+#define GL_YCRCB_422_SGIX 0x81BB
+#define GL_YCRCB_444_SGIX 0x81BC
+#endif /* GL_SGIX_ycrcb */
+
+#ifndef GL_SGIX_ycrcb_subsample
+#define GL_SGIX_ycrcb_subsample 1
+#endif /* GL_SGIX_ycrcb_subsample */
+
+#ifndef GL_SGIX_ycrcba
+#define GL_SGIX_ycrcba 1
+#define GL_YCRCB_SGIX 0x8318
+#define GL_YCRCBA_SGIX 0x8319
+#endif /* GL_SGIX_ycrcba */
+
+#ifndef GL_SGI_color_matrix
+#define GL_SGI_color_matrix 1
+#define GL_COLOR_MATRIX_SGI 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
+#endif /* GL_SGI_color_matrix */
+
+#ifndef GL_SGI_color_table
+#define GL_SGI_color_table 1
+#define GL_COLOR_TABLE_SGI 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
+#define GL_PROXY_COLOR_TABLE_SGI 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
+#define GL_COLOR_TABLE_SCALE_SGI 0x80D6
+#define GL_COLOR_TABLE_BIAS_SGI 0x80D7
+#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8
+#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
+typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x);
-GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y);
-GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x);
-GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y);
-GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v);
-GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params);
-GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params);
-GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table);
+GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, void *table);
+GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params);
#endif
+#endif /* GL_SGI_color_table */
-#ifndef GL_NV_multisample_coverage
-#define GL_NV_multisample_coverage 1
+#ifndef GL_SGI_texture_color_table
+#define GL_SGI_texture_color_table 1
+#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC
+#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD
+#endif /* GL_SGI_texture_color_table */
+
+#ifndef GL_SUNX_constant_data
+#define GL_SUNX_constant_data 1
+#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5
+#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6
+typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFinishTextureSUNX (void);
#endif
+#endif /* GL_SUNX_constant_data */
-#ifndef GL_AMD_name_gen_delete
-#define GL_AMD_name_gen_delete 1
+#ifndef GL_SUN_convolution_border_modes
+#define GL_SUN_convolution_border_modes 1
+#define GL_WRAP_BORDER_SUN 0x81D4
+#endif /* GL_SUN_convolution_border_modes */
+
+#ifndef GL_SUN_global_alpha
+#define GL_SUN_global_alpha 1
+#define GL_GLOBAL_ALPHA_SUN 0x81D9
+#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names);
-GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names);
-GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names);
-typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names);
-typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name);
+GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor);
+GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor);
+GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint factor);
+GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat factor);
+GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor);
+GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor);
+GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor);
+GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor);
#endif
+#endif /* GL_SUN_global_alpha */
-#ifndef GL_AMD_debug_output
-#define GL_AMD_debug_output 1
+#ifndef GL_SUN_mesh_array
+#define GL_SUN_mesh_array 1
+#define GL_QUAD_MESH_SUN 0x8614
+#define GL_TRIANGLE_MESH_SUN 0x8615
+typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
-GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, GLvoid *userParam);
-GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, GLvoid *userParam);
-typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
+GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width);
#endif
+#endif /* GL_SUN_mesh_array */
-#ifndef GL_NV_vdpau_interop
-#define GL_NV_vdpau_interop 1
+#ifndef GL_SUN_slice_accum
+#define GL_SUN_slice_accum 1
+#define GL_SLICE_ACCUM_SUN 0x85CC
+#endif /* GL_SUN_slice_accum */
+
+#ifndef GL_SUN_triangle_list
+#define GL_SUN_triangle_list 1
+#define GL_RESTART_SUN 0x0001
+#define GL_REPLACE_MIDDLE_SUN 0x0002
+#define GL_REPLACE_OLDEST_SUN 0x0003
+#define GL_TRIANGLE_LIST_SUN 0x81D7
+#define GL_REPLACEMENT_CODE_SUN 0x81D8
+#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0
+#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
+#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
+#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
+#define GL_R1UI_V3F_SUN 0x85C4
+#define GL_R1UI_C4UB_V3F_SUN 0x85C5
+#define GL_R1UI_C3F_V3F_SUN 0x85C6
+#define GL_R1UI_N3F_V3F_SUN 0x85C7
+#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8
+#define GL_R1UI_T2F_V3F_SUN 0x85C9
+#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA
+#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void **pointer);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVDPAUInitNV (const GLvoid *vdpDevice, const GLvoid *getProcAddress);
-GLAPI void APIENTRY glVDPAUFiniNV (void);
-GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
-GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
-GLAPI void APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface);
-GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface);
-GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access);
-GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);
-GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const GLvoid *vdpDevice, const GLvoid *getProcAddress);
-typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void);
-typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
-typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
-typedef void (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface);
-typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface);
-typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access);
-typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);
-typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);
+GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code);
+GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code);
+GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code);
+GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code);
+GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code);
+GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code);
+GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const void **pointer);
#endif
+#endif /* GL_SUN_triangle_list */
-#ifndef GL_AMD_transform_feedback3_lines_triangles
-#define GL_AMD_transform_feedback3_lines_triangles 1
+#ifndef GL_SUN_vertex
+#define GL_SUN_vertex 1
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v);
+GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v);
+GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *c, const GLfloat *v);
+GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *c, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *rc, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *rc, const GLubyte *c, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
#endif
+#endif /* GL_SUN_vertex */
+
+#ifndef GL_WIN_phong_shading
+#define GL_WIN_phong_shading 1
+#define GL_PHONG_WIN 0x80EA
+#define GL_PHONG_HINT_WIN 0x80EB
+#endif /* GL_WIN_phong_shading */
+#ifndef GL_WIN_specular_fog
+#define GL_WIN_specular_fog 1
+#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC
+#endif /* GL_WIN_specular_fog */
#ifdef __cplusplus
}
diff --git a/src/SFML/Window/glext/glxext.h b/src/SFML/Window/glext/glxext.h
deleted file mode 100644
index 3c47dc3..0000000
--- a/src/SFML/Window/glext/glxext.h
+++ /dev/null
@@ -1,993 +0,0 @@
-#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
diff --git a/src/SFML/Window/glext/wglext.h b/src/SFML/Window/glext/wglext.h
index e60c652..e9648c3 100644
--- a/src/SFML/Window/glext/wglext.h
+++ b/src/SFML/Window/glext/wglext.h
@@ -1,13 +1,13 @@
#ifndef __wglext_h_
-#define __wglext_h_
+#define __wglext_h_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
-** Copyright (c) 2007-2010 The Khronos Group Inc.
-**
+** Copyright (c) 2013-2014 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
@@ -15,10 +15,10 @@ extern "C" {
** 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.
@@ -27,676 +27,515 @@ extern "C" {
** 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 */
+/*
+** This header is generated from the Khronos OpenGL / OpenGL ES XML
+** API Registry. The current version of the Registry, generator scripts
+** used to make the header, and the header can be found at
+** http://www.opengl.org/registry/
+**
+** Khronos $Revision: 26290 $ on $Date: 2014-04-16 05:35:38 -0700 (Wed, 16 Apr 2014) $
+*/
#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
-
-/*************************************************************/
+#define WGL_WGLEXT_VERSION 20140416
-/* Header file version number */
-/* wglext.h last updated 2010/08/06 */
-/* Current version at http://www.opengl.org/registry/ */
-#define WGL_WGLEXT_VERSION 22
+/* Generated C header for:
+ * API: wgl
+ * Versions considered: .*
+ * Versions emitted: _nomatch_^
+ * Default extensions included: wgl
+ * Additional extensions included: _nomatch_^
+ * Extensions removed: _nomatch_^
+ */
#ifndef WGL_ARB_buffer_region
-#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
-#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
-#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
-#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
-#endif
-
-#ifndef WGL_ARB_multisample
-#define WGL_SAMPLE_BUFFERS_ARB 0x2041
-#define WGL_SAMPLES_ARB 0x2042
-#endif
-
-#ifndef WGL_ARB_extensions_string
-#endif
-
-#ifndef WGL_ARB_pixel_format
-#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
-#define WGL_DRAW_TO_WINDOW_ARB 0x2001
-#define WGL_DRAW_TO_BITMAP_ARB 0x2002
-#define WGL_ACCELERATION_ARB 0x2003
-#define WGL_NEED_PALETTE_ARB 0x2004
-#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
-#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
-#define WGL_SWAP_METHOD_ARB 0x2007
-#define WGL_NUMBER_OVERLAYS_ARB 0x2008
-#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
-#define WGL_TRANSPARENT_ARB 0x200A
-#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
-#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
-#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
-#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
-#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
-#define WGL_SHARE_DEPTH_ARB 0x200C
-#define WGL_SHARE_STENCIL_ARB 0x200D
-#define WGL_SHARE_ACCUM_ARB 0x200E
-#define WGL_SUPPORT_GDI_ARB 0x200F
-#define WGL_SUPPORT_OPENGL_ARB 0x2010
-#define WGL_DOUBLE_BUFFER_ARB 0x2011
-#define WGL_STEREO_ARB 0x2012
-#define WGL_PIXEL_TYPE_ARB 0x2013
-#define WGL_COLOR_BITS_ARB 0x2014
-#define WGL_RED_BITS_ARB 0x2015
-#define WGL_RED_SHIFT_ARB 0x2016
-#define WGL_GREEN_BITS_ARB 0x2017
-#define WGL_GREEN_SHIFT_ARB 0x2018
-#define WGL_BLUE_BITS_ARB 0x2019
-#define WGL_BLUE_SHIFT_ARB 0x201A
-#define WGL_ALPHA_BITS_ARB 0x201B
-#define WGL_ALPHA_SHIFT_ARB 0x201C
-#define WGL_ACCUM_BITS_ARB 0x201D
-#define WGL_ACCUM_RED_BITS_ARB 0x201E
-#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
-#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
-#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
-#define WGL_DEPTH_BITS_ARB 0x2022
-#define WGL_STENCIL_BITS_ARB 0x2023
-#define WGL_AUX_BUFFERS_ARB 0x2024
-#define WGL_NO_ACCELERATION_ARB 0x2025
-#define WGL_GENERIC_ACCELERATION_ARB 0x2026
-#define WGL_FULL_ACCELERATION_ARB 0x2027
-#define WGL_SWAP_EXCHANGE_ARB 0x2028
-#define WGL_SWAP_COPY_ARB 0x2029
-#define WGL_SWAP_UNDEFINED_ARB 0x202A
-#define WGL_TYPE_RGBA_ARB 0x202B
-#define WGL_TYPE_COLORINDEX_ARB 0x202C
-#endif
-
-#ifndef WGL_ARB_make_current_read
-#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
-#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
-#endif
-
-#ifndef WGL_ARB_pbuffer
-#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
-#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
-#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
-#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
-#define WGL_PBUFFER_LARGEST_ARB 0x2033
-#define WGL_PBUFFER_WIDTH_ARB 0x2034
-#define WGL_PBUFFER_HEIGHT_ARB 0x2035
-#define WGL_PBUFFER_LOST_ARB 0x2036
-#endif
-
-#ifndef WGL_ARB_render_texture
-#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
-#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
-#define WGL_TEXTURE_FORMAT_ARB 0x2072
-#define WGL_TEXTURE_TARGET_ARB 0x2073
-#define WGL_MIPMAP_TEXTURE_ARB 0x2074
-#define WGL_TEXTURE_RGB_ARB 0x2075
-#define WGL_TEXTURE_RGBA_ARB 0x2076
-#define WGL_NO_TEXTURE_ARB 0x2077
-#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
-#define WGL_TEXTURE_1D_ARB 0x2079
-#define WGL_TEXTURE_2D_ARB 0x207A
-#define WGL_MIPMAP_LEVEL_ARB 0x207B
-#define WGL_CUBE_MAP_FACE_ARB 0x207C
-#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
-#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
-#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
-#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
-#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
-#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
-#define WGL_FRONT_LEFT_ARB 0x2083
-#define WGL_FRONT_RIGHT_ARB 0x2084
-#define WGL_BACK_LEFT_ARB 0x2085
-#define WGL_BACK_RIGHT_ARB 0x2086
-#define WGL_AUX0_ARB 0x2087
-#define WGL_AUX1_ARB 0x2088
-#define WGL_AUX2_ARB 0x2089
-#define WGL_AUX3_ARB 0x208A
-#define WGL_AUX4_ARB 0x208B
-#define WGL_AUX5_ARB 0x208C
-#define WGL_AUX6_ARB 0x208D
-#define WGL_AUX7_ARB 0x208E
-#define WGL_AUX8_ARB 0x208F
-#define WGL_AUX9_ARB 0x2090
-#endif
-
-#ifndef WGL_ARB_pixel_format_float
-#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
-#endif
-
-#ifndef WGL_ARB_framebuffer_sRGB
-#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
+#define WGL_ARB_buffer_region 1
+#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
+#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
+#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
+#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
+typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
+typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
+typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
+typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
+#ifdef WGL_WGLEXT_PROTOTYPES
+HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType);
+VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion);
+BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height);
+BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
#endif
+#endif /* WGL_ARB_buffer_region */
#ifndef WGL_ARB_create_context
-#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
+#define WGL_ARB_create_context 1
+#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
-#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
-#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
-#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
-#define WGL_CONTEXT_FLAGS_ARB 0x2094
-#define ERROR_INVALID_VERSION_ARB 0x2095
+#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
+#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
+#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
+#define WGL_CONTEXT_FLAGS_ARB 0x2094
+#define ERROR_INVALID_VERSION_ARB 0x2095
+typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
+#ifdef WGL_WGLEXT_PROTOTYPES
+HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList);
#endif
+#endif /* WGL_ARB_create_context */
#ifndef WGL_ARB_create_context_profile
-#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
-#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
+#define WGL_ARB_create_context_profile 1
+#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
+#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
-#define ERROR_INVALID_PROFILE_ARB 0x2096
-#endif
+#define ERROR_INVALID_PROFILE_ARB 0x2096
+#endif /* WGL_ARB_create_context_profile */
#ifndef WGL_ARB_create_context_robustness
+#define WGL_ARB_create_context_robustness 1
#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
-#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
+#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
-#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
-#endif
-
-#ifndef WGL_EXT_make_current_read
-#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
-#endif
-
-#ifndef WGL_EXT_pixel_format
-#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
-#define WGL_DRAW_TO_WINDOW_EXT 0x2001
-#define WGL_DRAW_TO_BITMAP_EXT 0x2002
-#define WGL_ACCELERATION_EXT 0x2003
-#define WGL_NEED_PALETTE_EXT 0x2004
-#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
-#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
-#define WGL_SWAP_METHOD_EXT 0x2007
-#define WGL_NUMBER_OVERLAYS_EXT 0x2008
-#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
-#define WGL_TRANSPARENT_EXT 0x200A
-#define WGL_TRANSPARENT_VALUE_EXT 0x200B
-#define WGL_SHARE_DEPTH_EXT 0x200C
-#define WGL_SHARE_STENCIL_EXT 0x200D
-#define WGL_SHARE_ACCUM_EXT 0x200E
-#define WGL_SUPPORT_GDI_EXT 0x200F
-#define WGL_SUPPORT_OPENGL_EXT 0x2010
-#define WGL_DOUBLE_BUFFER_EXT 0x2011
-#define WGL_STEREO_EXT 0x2012
-#define WGL_PIXEL_TYPE_EXT 0x2013
-#define WGL_COLOR_BITS_EXT 0x2014
-#define WGL_RED_BITS_EXT 0x2015
-#define WGL_RED_SHIFT_EXT 0x2016
-#define WGL_GREEN_BITS_EXT 0x2017
-#define WGL_GREEN_SHIFT_EXT 0x2018
-#define WGL_BLUE_BITS_EXT 0x2019
-#define WGL_BLUE_SHIFT_EXT 0x201A
-#define WGL_ALPHA_BITS_EXT 0x201B
-#define WGL_ALPHA_SHIFT_EXT 0x201C
-#define WGL_ACCUM_BITS_EXT 0x201D
-#define WGL_ACCUM_RED_BITS_EXT 0x201E
-#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
-#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
-#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
-#define WGL_DEPTH_BITS_EXT 0x2022
-#define WGL_STENCIL_BITS_EXT 0x2023
-#define WGL_AUX_BUFFERS_EXT 0x2024
-#define WGL_NO_ACCELERATION_EXT 0x2025
-#define WGL_GENERIC_ACCELERATION_EXT 0x2026
-#define WGL_FULL_ACCELERATION_EXT 0x2027
-#define WGL_SWAP_EXCHANGE_EXT 0x2028
-#define WGL_SWAP_COPY_EXT 0x2029
-#define WGL_SWAP_UNDEFINED_EXT 0x202A
-#define WGL_TYPE_RGBA_EXT 0x202B
-#define WGL_TYPE_COLORINDEX_EXT 0x202C
-#endif
-
-#ifndef WGL_EXT_pbuffer
-#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
-#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
-#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
-#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
-#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
-#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
-#define WGL_PBUFFER_LARGEST_EXT 0x2033
-#define WGL_PBUFFER_WIDTH_EXT 0x2034
-#define WGL_PBUFFER_HEIGHT_EXT 0x2035
-#endif
-
-#ifndef WGL_EXT_depth_float
-#define WGL_DEPTH_FLOAT_EXT 0x2040
-#endif
-
-#ifndef WGL_3DFX_multisample
-#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
-#define WGL_SAMPLES_3DFX 0x2061
-#endif
-
-#ifndef WGL_EXT_multisample
-#define WGL_SAMPLE_BUFFERS_EXT 0x2041
-#define WGL_SAMPLES_EXT 0x2042
-#endif
-
-#ifndef WGL_I3D_digital_video_control
-#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
-#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
-#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
-#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
-#endif
-
-#ifndef WGL_I3D_gamma
-#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
-#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
-#endif
-
-#ifndef WGL_I3D_genlock
-#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
-#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045
-#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046
-#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047
-#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
-#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
-#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
-#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
-#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
-#endif
-
-#ifndef WGL_I3D_image_buffer
-#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
-#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
-#endif
-
-#ifndef WGL_I3D_swap_frame_lock
-#endif
-
-#ifndef WGL_NV_render_depth_texture
-#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
-#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
-#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
-#define WGL_DEPTH_COMPONENT_NV 0x20A7
-#endif
-
-#ifndef WGL_NV_render_texture_rectangle
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
-#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
-#endif
-
-#ifndef WGL_ATI_pixel_format_float
-#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
-#endif
-
-#ifndef WGL_NV_float_buffer
-#define WGL_FLOAT_COMPONENTS_NV 0x20B0
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
-#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
-#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
-#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
-#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
-#endif
-
-#ifndef WGL_3DL_stereo_control
-#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
-#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
-#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
-#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
-#endif
-
-#ifndef WGL_EXT_pixel_format_packed_float
-#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
-#endif
-
-#ifndef WGL_EXT_framebuffer_sRGB
-#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
-#endif
-
-#ifndef WGL_NV_present_video
-#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
-#endif
-
-#ifndef WGL_NV_video_out
-#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
-#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
-#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
-#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
-#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
-#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
-#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
-#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
-#define WGL_VIDEO_OUT_FRAME 0x20C8
-#define WGL_VIDEO_OUT_FIELD_1 0x20C9
-#define WGL_VIDEO_OUT_FIELD_2 0x20CA
-#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
-#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
-#endif
-
-#ifndef WGL_NV_swap_group
-#endif
-
-#ifndef WGL_NV_gpu_affinity
-#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
-#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
-#endif
-
-#ifndef WGL_AMD_gpu_association
-#define WGL_GPU_VENDOR_AMD 0x1F00
-#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
-#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
-#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
-#define WGL_GPU_RAM_AMD 0x21A3
-#define WGL_GPU_CLOCK_AMD 0x21A4
-#define WGL_GPU_NUM_PIPES_AMD 0x21A5
-#define WGL_GPU_NUM_SIMD_AMD 0x21A6
-#define WGL_GPU_NUM_RB_AMD 0x21A7
-#define WGL_GPU_NUM_SPI_AMD 0x21A8
-#endif
-
-#ifndef WGL_NV_video_capture
-#define WGL_UNIQUE_ID_NV 0x20CE
-#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
-#endif
-
-#ifndef WGL_NV_copy_image
-#endif
-
-#ifndef WGL_NV_multisample_coverage
-#define WGL_COVERAGE_SAMPLES_NV 0x2042
-#define WGL_COLOR_SAMPLES_NV 0x20B9
-#endif
-
-#ifndef WGL_EXT_create_context_es2_profile
-#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
-#endif
-
-
-/*************************************************************/
-
-#ifndef WGL_ARB_pbuffer
-DECLARE_HANDLE(HPBUFFERARB);
-#endif
-#ifndef WGL_EXT_pbuffer
-DECLARE_HANDLE(HPBUFFEREXT);
-#endif
-#ifndef WGL_NV_present_video
-DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
-#endif
-#ifndef WGL_NV_video_output
-DECLARE_HANDLE(HPVIDEODEV);
-#endif
-#ifndef WGL_NV_gpu_affinity
-DECLARE_HANDLE(HPGPUNV);
-DECLARE_HANDLE(HGPUNV);
-
-typedef struct _GPU_DEVICE {
- DWORD cb;
- CHAR DeviceName[32];
- CHAR DeviceString[128];
- DWORD Flags;
- RECT rcVirtualScreen;
-} GPU_DEVICE, *PGPU_DEVICE;
-#endif
-#ifndef WGL_NV_video_capture
-DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
-#endif
-
-#ifndef WGL_ARB_buffer_region
-#define WGL_ARB_buffer_region 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType);
-extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion);
-extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height);
-extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
-typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
-typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
-typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
-#endif
-
-#ifndef WGL_ARB_multisample
-#define WGL_ARB_multisample 1
-#endif
+#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
+#endif /* WGL_ARB_create_context_robustness */
#ifndef WGL_ARB_extensions_string
#define WGL_ARB_extensions_string 1
+typedef const char *(WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
#ifdef WGL_WGLEXT_PROTOTYPES
-extern const char * WINAPI wglGetExtensionsStringARB (HDC hdc);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
+const char *WINAPI wglGetExtensionsStringARB (HDC hdc);
#endif
+#endif /* WGL_ARB_extensions_string */
-#ifndef WGL_ARB_pixel_format
-#define WGL_ARB_pixel_format 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
-extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
-extern BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
-typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
-typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
-#endif
+#ifndef WGL_ARB_framebuffer_sRGB
+#define WGL_ARB_framebuffer_sRGB 1
+#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
+#endif /* WGL_ARB_framebuffer_sRGB */
#ifndef WGL_ARB_make_current_read
#define WGL_ARB_make_current_read 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
-extern HDC WINAPI wglGetCurrentReadDCARB (void);
-#endif /* WGL_WGLEXT_PROTOTYPES */
+#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
+#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
+#ifdef WGL_WGLEXT_PROTOTYPES
+BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+HDC WINAPI wglGetCurrentReadDCARB (void);
#endif
+#endif /* WGL_ARB_make_current_read */
+
+#ifndef WGL_ARB_multisample
+#define WGL_ARB_multisample 1
+#define WGL_SAMPLE_BUFFERS_ARB 0x2041
+#define WGL_SAMPLES_ARB 0x2042
+#endif /* WGL_ARB_multisample */
#ifndef WGL_ARB_pbuffer
#define WGL_ARB_pbuffer 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
-extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer);
-extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC);
-extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer);
-extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
-#endif /* WGL_WGLEXT_PROTOTYPES */
+DECLARE_HANDLE(HPBUFFERARB);
+#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
+#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
+#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
+#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
+#define WGL_PBUFFER_LARGEST_ARB 0x2033
+#define WGL_PBUFFER_WIDTH_ARB 0x2034
+#define WGL_PBUFFER_HEIGHT_ARB 0x2035
+#define WGL_PBUFFER_LOST_ARB 0x2036
typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
+#ifdef WGL_WGLEXT_PROTOTYPES
+HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
+HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer);
+int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC);
+BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer);
+BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
+#endif
+#endif /* WGL_ARB_pbuffer */
+
+#ifndef WGL_ARB_pixel_format
+#define WGL_ARB_pixel_format 1
+#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
+#define WGL_DRAW_TO_WINDOW_ARB 0x2001
+#define WGL_DRAW_TO_BITMAP_ARB 0x2002
+#define WGL_ACCELERATION_ARB 0x2003
+#define WGL_NEED_PALETTE_ARB 0x2004
+#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
+#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
+#define WGL_SWAP_METHOD_ARB 0x2007
+#define WGL_NUMBER_OVERLAYS_ARB 0x2008
+#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
+#define WGL_TRANSPARENT_ARB 0x200A
+#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
+#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
+#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
+#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
+#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
+#define WGL_SHARE_DEPTH_ARB 0x200C
+#define WGL_SHARE_STENCIL_ARB 0x200D
+#define WGL_SHARE_ACCUM_ARB 0x200E
+#define WGL_SUPPORT_GDI_ARB 0x200F
+#define WGL_SUPPORT_OPENGL_ARB 0x2010
+#define WGL_DOUBLE_BUFFER_ARB 0x2011
+#define WGL_STEREO_ARB 0x2012
+#define WGL_PIXEL_TYPE_ARB 0x2013
+#define WGL_COLOR_BITS_ARB 0x2014
+#define WGL_RED_BITS_ARB 0x2015
+#define WGL_RED_SHIFT_ARB 0x2016
+#define WGL_GREEN_BITS_ARB 0x2017
+#define WGL_GREEN_SHIFT_ARB 0x2018
+#define WGL_BLUE_BITS_ARB 0x2019
+#define WGL_BLUE_SHIFT_ARB 0x201A
+#define WGL_ALPHA_BITS_ARB 0x201B
+#define WGL_ALPHA_SHIFT_ARB 0x201C
+#define WGL_ACCUM_BITS_ARB 0x201D
+#define WGL_ACCUM_RED_BITS_ARB 0x201E
+#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
+#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
+#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
+#define WGL_DEPTH_BITS_ARB 0x2022
+#define WGL_STENCIL_BITS_ARB 0x2023
+#define WGL_AUX_BUFFERS_ARB 0x2024
+#define WGL_NO_ACCELERATION_ARB 0x2025
+#define WGL_GENERIC_ACCELERATION_ARB 0x2026
+#define WGL_FULL_ACCELERATION_ARB 0x2027
+#define WGL_SWAP_EXCHANGE_ARB 0x2028
+#define WGL_SWAP_COPY_ARB 0x2029
+#define WGL_SWAP_UNDEFINED_ARB 0x202A
+#define WGL_TYPE_RGBA_ARB 0x202B
+#define WGL_TYPE_COLORINDEX_ARB 0x202C
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
+typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+#ifdef WGL_WGLEXT_PROTOTYPES
+BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
+BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
+BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
#endif
+#endif /* WGL_ARB_pixel_format */
+
+#ifndef WGL_ARB_pixel_format_float
+#define WGL_ARB_pixel_format_float 1
+#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
+#endif /* WGL_ARB_pixel_format_float */
#ifndef WGL_ARB_render_texture
#define WGL_ARB_render_texture 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
-extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
-extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList);
-#endif /* WGL_WGLEXT_PROTOTYPES */
+#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
+#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
+#define WGL_TEXTURE_FORMAT_ARB 0x2072
+#define WGL_TEXTURE_TARGET_ARB 0x2073
+#define WGL_MIPMAP_TEXTURE_ARB 0x2074
+#define WGL_TEXTURE_RGB_ARB 0x2075
+#define WGL_TEXTURE_RGBA_ARB 0x2076
+#define WGL_NO_TEXTURE_ARB 0x2077
+#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
+#define WGL_TEXTURE_1D_ARB 0x2079
+#define WGL_TEXTURE_2D_ARB 0x207A
+#define WGL_MIPMAP_LEVEL_ARB 0x207B
+#define WGL_CUBE_MAP_FACE_ARB 0x207C
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
+#define WGL_FRONT_LEFT_ARB 0x2083
+#define WGL_FRONT_RIGHT_ARB 0x2084
+#define WGL_BACK_LEFT_ARB 0x2085
+#define WGL_BACK_RIGHT_ARB 0x2086
+#define WGL_AUX0_ARB 0x2087
+#define WGL_AUX1_ARB 0x2088
+#define WGL_AUX2_ARB 0x2089
+#define WGL_AUX3_ARB 0x208A
+#define WGL_AUX4_ARB 0x208B
+#define WGL_AUX5_ARB 0x208C
+#define WGL_AUX6_ARB 0x208D
+#define WGL_AUX7_ARB 0x208E
+#define WGL_AUX8_ARB 0x208F
+#define WGL_AUX9_ARB 0x2090
typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
+#ifdef WGL_WGLEXT_PROTOTYPES
+BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
+BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
+BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList);
#endif
+#endif /* WGL_ARB_render_texture */
-#ifndef WGL_ARB_pixel_format_float
-#define WGL_ARB_pixel_format_float 1
-#endif
+#ifndef WGL_ARB_robustness_application_isolation
+#define WGL_ARB_robustness_application_isolation 1
+#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
+#endif /* WGL_ARB_robustness_application_isolation */
-#ifndef WGL_ARB_framebuffer_sRGB
-#define WGL_ARB_framebuffer_sRGB 1
-#endif
+#ifndef WGL_ARB_robustness_share_group_isolation
+#define WGL_ARB_robustness_share_group_isolation 1
+#endif /* WGL_ARB_robustness_share_group_isolation */
-#ifndef WGL_ARB_create_context
-#define WGL_ARB_create_context 1
+#ifndef WGL_3DFX_multisample
+#define WGL_3DFX_multisample 1
+#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
+#define WGL_SAMPLES_3DFX 0x2061
+#endif /* WGL_3DFX_multisample */
+
+#ifndef WGL_3DL_stereo_control
+#define WGL_3DL_stereo_control 1
+#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
+#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
+#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
+#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
+typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
#ifdef WGL_WGLEXT_PROTOTYPES
-extern HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
+BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState);
#endif
+#endif /* WGL_3DL_stereo_control */
-#ifndef WGL_ARB_create_context_profile
-#define WGL_ARB_create_context_profile 1
-#endif
+#ifndef WGL_AMD_gpu_association
+#define WGL_AMD_gpu_association 1
+#define WGL_GPU_VENDOR_AMD 0x1F00
+#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
+#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
+#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
+#define WGL_GPU_RAM_AMD 0x21A3
+#define WGL_GPU_CLOCK_AMD 0x21A4
+#define WGL_GPU_NUM_PIPES_AMD 0x21A5
+#define WGL_GPU_NUM_SIMD_AMD 0x21A6
+#define WGL_GPU_NUM_RB_AMD 0x21A7
+#define WGL_GPU_NUM_SPI_AMD 0x21A8
+typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);
+typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data);
+typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
+typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
+typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList);
+typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
+typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
+typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
+typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#ifdef WGL_WGLEXT_PROTOTYPES
+UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids);
+INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data);
+UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc);
+HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id);
+HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList);
+BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc);
+BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc);
+HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);
+VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+#endif /* WGL_AMD_gpu_association */
-#ifndef WGL_ARB_create_context_robustness
-#define WGL_ARB_create_context_robustness 1
-#endif
+#ifndef WGL_ATI_pixel_format_float
+#define WGL_ATI_pixel_format_float 1
+#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
+#endif /* WGL_ATI_pixel_format_float */
+
+#ifndef WGL_EXT_create_context_es2_profile
+#define WGL_EXT_create_context_es2_profile 1
+#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
+#endif /* WGL_EXT_create_context_es2_profile */
+
+#ifndef WGL_EXT_create_context_es_profile
+#define WGL_EXT_create_context_es_profile 1
+#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004
+#endif /* WGL_EXT_create_context_es_profile */
+
+#ifndef WGL_EXT_depth_float
+#define WGL_EXT_depth_float 1
+#define WGL_DEPTH_FLOAT_EXT 0x2040
+#endif /* WGL_EXT_depth_float */
#ifndef WGL_EXT_display_color_table
#define WGL_EXT_display_color_table 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id);
-extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length);
-extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id);
-extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id);
-#endif /* WGL_WGLEXT_PROTOTYPES */
typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+#ifdef WGL_WGLEXT_PROTOTYPES
+GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id);
+GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length);
+GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id);
+VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id);
#endif
+#endif /* WGL_EXT_display_color_table */
#ifndef WGL_EXT_extensions_string
#define WGL_EXT_extensions_string 1
+typedef const char *(WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
#ifdef WGL_WGLEXT_PROTOTYPES
-extern const char * WINAPI wglGetExtensionsStringEXT (void);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
+const char *WINAPI wglGetExtensionsStringEXT (void);
#endif
+#endif /* WGL_EXT_extensions_string */
+
+#ifndef WGL_EXT_framebuffer_sRGB
+#define WGL_EXT_framebuffer_sRGB 1
+#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
+#endif /* WGL_EXT_framebuffer_sRGB */
#ifndef WGL_EXT_make_current_read
#define WGL_EXT_make_current_read 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
-extern HDC WINAPI wglGetCurrentReadDCEXT (void);
-#endif /* WGL_WGLEXT_PROTOTYPES */
+#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
+#ifdef WGL_WGLEXT_PROTOTYPES
+BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+HDC WINAPI wglGetCurrentReadDCEXT (void);
#endif
+#endif /* WGL_EXT_make_current_read */
+
+#ifndef WGL_EXT_multisample
+#define WGL_EXT_multisample 1
+#define WGL_SAMPLE_BUFFERS_EXT 0x2041
+#define WGL_SAMPLES_EXT 0x2042
+#endif /* WGL_EXT_multisample */
#ifndef WGL_EXT_pbuffer
#define WGL_EXT_pbuffer 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
-extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer);
-extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC);
-extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer);
-extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
-#endif /* WGL_WGLEXT_PROTOTYPES */
+DECLARE_HANDLE(HPBUFFEREXT);
+#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
+#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
+#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
+#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
+#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
+#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
+#define WGL_PBUFFER_LARGEST_EXT 0x2033
+#define WGL_PBUFFER_WIDTH_EXT 0x2034
+#define WGL_PBUFFER_HEIGHT_EXT 0x2035
typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
+#ifdef WGL_WGLEXT_PROTOTYPES
+HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
+HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer);
+int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC);
+BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer);
+BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
#endif
+#endif /* WGL_EXT_pbuffer */
#ifndef WGL_EXT_pixel_format
#define WGL_EXT_pixel_format 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
-extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
-extern BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
-#endif /* WGL_WGLEXT_PROTOTYPES */
+#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
+#define WGL_DRAW_TO_WINDOW_EXT 0x2001
+#define WGL_DRAW_TO_BITMAP_EXT 0x2002
+#define WGL_ACCELERATION_EXT 0x2003
+#define WGL_NEED_PALETTE_EXT 0x2004
+#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
+#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
+#define WGL_SWAP_METHOD_EXT 0x2007
+#define WGL_NUMBER_OVERLAYS_EXT 0x2008
+#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
+#define WGL_TRANSPARENT_EXT 0x200A
+#define WGL_TRANSPARENT_VALUE_EXT 0x200B
+#define WGL_SHARE_DEPTH_EXT 0x200C
+#define WGL_SHARE_STENCIL_EXT 0x200D
+#define WGL_SHARE_ACCUM_EXT 0x200E
+#define WGL_SUPPORT_GDI_EXT 0x200F
+#define WGL_SUPPORT_OPENGL_EXT 0x2010
+#define WGL_DOUBLE_BUFFER_EXT 0x2011
+#define WGL_STEREO_EXT 0x2012
+#define WGL_PIXEL_TYPE_EXT 0x2013
+#define WGL_COLOR_BITS_EXT 0x2014
+#define WGL_RED_BITS_EXT 0x2015
+#define WGL_RED_SHIFT_EXT 0x2016
+#define WGL_GREEN_BITS_EXT 0x2017
+#define WGL_GREEN_SHIFT_EXT 0x2018
+#define WGL_BLUE_BITS_EXT 0x2019
+#define WGL_BLUE_SHIFT_EXT 0x201A
+#define WGL_ALPHA_BITS_EXT 0x201B
+#define WGL_ALPHA_SHIFT_EXT 0x201C
+#define WGL_ACCUM_BITS_EXT 0x201D
+#define WGL_ACCUM_RED_BITS_EXT 0x201E
+#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
+#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
+#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
+#define WGL_DEPTH_BITS_EXT 0x2022
+#define WGL_STENCIL_BITS_EXT 0x2023
+#define WGL_AUX_BUFFERS_EXT 0x2024
+#define WGL_NO_ACCELERATION_EXT 0x2025
+#define WGL_GENERIC_ACCELERATION_EXT 0x2026
+#define WGL_FULL_ACCELERATION_EXT 0x2027
+#define WGL_SWAP_EXCHANGE_EXT 0x2028
+#define WGL_SWAP_COPY_EXT 0x2029
+#define WGL_SWAP_UNDEFINED_EXT 0x202A
+#define WGL_TYPE_RGBA_EXT 0x202B
+#define WGL_TYPE_COLORINDEX_EXT 0x202C
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+#ifdef WGL_WGLEXT_PROTOTYPES
+BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
+BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
+BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
#endif
+#endif /* WGL_EXT_pixel_format */
+
+#ifndef WGL_EXT_pixel_format_packed_float
+#define WGL_EXT_pixel_format_packed_float 1
+#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
+#endif /* WGL_EXT_pixel_format_packed_float */
#ifndef WGL_EXT_swap_control
#define WGL_EXT_swap_control 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglSwapIntervalEXT (int interval);
-extern int WINAPI wglGetSwapIntervalEXT (void);
-#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
-#endif
-
-#ifndef WGL_EXT_depth_float
-#define WGL_EXT_depth_float 1
-#endif
-
-#ifndef WGL_NV_vertex_array_range
-#define WGL_NV_vertex_array_range 1
#ifdef WGL_WGLEXT_PROTOTYPES
-extern void* WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
-extern void WINAPI wglFreeMemoryNV (void *pointer);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
-typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
-#endif
-
-#ifndef WGL_3DFX_multisample
-#define WGL_3DFX_multisample 1
-#endif
-
-#ifndef WGL_EXT_multisample
-#define WGL_EXT_multisample 1
+BOOL WINAPI wglSwapIntervalEXT (int interval);
+int WINAPI wglGetSwapIntervalEXT (void);
#endif
+#endif /* WGL_EXT_swap_control */
-#ifndef WGL_OML_sync_control
-#define WGL_OML_sync_control 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
-extern BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator);
-extern INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
-extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
-extern BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
-extern BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
-typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
-typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
-typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
-typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
-typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
-#endif
+#ifndef WGL_EXT_swap_control_tear
+#define WGL_EXT_swap_control_tear 1
+#endif /* WGL_EXT_swap_control_tear */
#ifndef WGL_I3D_digital_video_control
#define WGL_I3D_digital_video_control 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue);
-extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue);
-#endif /* WGL_WGLEXT_PROTOTYPES */
+#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
+#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
+#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
+#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
+#ifdef WGL_WGLEXT_PROTOTYPES
+BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue);
+BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue);
#endif
+#endif /* WGL_I3D_digital_video_control */
#ifndef WGL_I3D_gamma
#define WGL_I3D_gamma 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue);
-extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue);
-extern BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
-extern BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
-#endif /* WGL_WGLEXT_PROTOTYPES */
+#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
+#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
+#ifdef WGL_WGLEXT_PROTOTYPES
+BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue);
+BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue);
+BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
+BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
#endif
+#endif /* WGL_I3D_gamma */
#ifndef WGL_I3D_genlock
#define WGL_I3D_genlock 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglEnableGenlockI3D (HDC hDC);
-extern BOOL WINAPI wglDisableGenlockI3D (HDC hDC);
-extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag);
-extern BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource);
-extern BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource);
-extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge);
-extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge);
-extern BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate);
-extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate);
-extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay);
-extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay);
-extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
-#endif /* WGL_WGLEXT_PROTOTYPES */
+#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
+#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045
+#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046
+#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047
+#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
+#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
+#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
+#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
+#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
@@ -709,190 +548,283 @@ typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate)
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
-#endif
+#ifdef WGL_WGLEXT_PROTOTYPES
+BOOL WINAPI wglEnableGenlockI3D (HDC hDC);
+BOOL WINAPI wglDisableGenlockI3D (HDC hDC);
+BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag);
+BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource);
+BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource);
+BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge);
+BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge);
+BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate);
+BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate);
+BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay);
+BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay);
+BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
+#endif
+#endif /* WGL_I3D_genlock */
#ifndef WGL_I3D_image_buffer
#define WGL_I3D_image_buffer 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags);
-extern BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress);
-extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
-extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count);
-#endif /* WGL_WGLEXT_PROTOTYPES */
+#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
+#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
+#ifdef WGL_WGLEXT_PROTOTYPES
+LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags);
+BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress);
+BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
+BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count);
#endif
+#endif /* WGL_I3D_image_buffer */
#ifndef WGL_I3D_swap_frame_lock
#define WGL_I3D_swap_frame_lock 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglEnableFrameLockI3D (void);
-extern BOOL WINAPI wglDisableFrameLockI3D (void);
-extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag);
-extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag);
-#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
+#ifdef WGL_WGLEXT_PROTOTYPES
+BOOL WINAPI wglEnableFrameLockI3D (void);
+BOOL WINAPI wglDisableFrameLockI3D (void);
+BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag);
+BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag);
#endif
+#endif /* WGL_I3D_swap_frame_lock */
#ifndef WGL_I3D_swap_frame_usage
#define WGL_I3D_swap_frame_usage 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglGetFrameUsageI3D (float *pUsage);
-extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
-extern BOOL WINAPI wglEndFrameTrackingI3D (void);
-extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
-#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
+#ifdef WGL_WGLEXT_PROTOTYPES
+BOOL WINAPI wglGetFrameUsageI3D (float *pUsage);
+BOOL WINAPI wglBeginFrameTrackingI3D (void);
+BOOL WINAPI wglEndFrameTrackingI3D (void);
+BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
+#endif
+#endif /* WGL_I3D_swap_frame_usage */
+
+#ifndef WGL_NV_DX_interop
+#define WGL_NV_DX_interop 1
+#define WGL_ACCESS_READ_ONLY_NV 0x00000000
+#define WGL_ACCESS_READ_WRITE_NV 0x00000001
+#define WGL_ACCESS_WRITE_DISCARD_NV 0x00000002
+typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void *dxObject, HANDLE shareHandle);
+typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void *dxDevice);
+typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice);
+typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
+typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject);
+typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access);
+typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
+typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
+#ifdef WGL_WGLEXT_PROTOTYPES
+BOOL WINAPI wglDXSetResourceShareHandleNV (void *dxObject, HANDLE shareHandle);
+HANDLE WINAPI wglDXOpenDeviceNV (void *dxDevice);
+BOOL WINAPI wglDXCloseDeviceNV (HANDLE hDevice);
+HANDLE WINAPI wglDXRegisterObjectNV (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
+BOOL WINAPI wglDXUnregisterObjectNV (HANDLE hDevice, HANDLE hObject);
+BOOL WINAPI wglDXObjectAccessNV (HANDLE hObject, GLenum access);
+BOOL WINAPI wglDXLockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
+BOOL WINAPI wglDXUnlockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
#endif
+#endif /* WGL_NV_DX_interop */
-#ifndef WGL_ATI_pixel_format_float
-#define WGL_ATI_pixel_format_float 1
-#endif
+#ifndef WGL_NV_DX_interop2
+#define WGL_NV_DX_interop2 1
+#endif /* WGL_NV_DX_interop2 */
-#ifndef WGL_NV_float_buffer
-#define WGL_NV_float_buffer 1
+#ifndef WGL_NV_copy_image
+#define WGL_NV_copy_image 1
+typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
+#ifdef WGL_WGLEXT_PROTOTYPES
+BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
#endif
+#endif /* WGL_NV_copy_image */
-#ifndef WGL_3DL_stereo_control
-#define WGL_3DL_stereo_control 1
+#ifndef WGL_NV_delay_before_swap
+#define WGL_NV_delay_before_swap 1
+typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds);
#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
+BOOL WINAPI wglDelayBeforeSwapNV (HDC hDC, GLfloat seconds);
#endif
+#endif /* WGL_NV_delay_before_swap */
-#ifndef WGL_EXT_pixel_format_packed_float
-#define WGL_EXT_pixel_format_packed_float 1
-#endif
+#ifndef WGL_NV_float_buffer
+#define WGL_NV_float_buffer 1
+#define WGL_FLOAT_COMPONENTS_NV 0x20B0
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
+#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
+#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
+#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
+#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
+#endif /* WGL_NV_float_buffer */
-#ifndef WGL_EXT_framebuffer_sRGB
-#define WGL_EXT_framebuffer_sRGB 1
+#ifndef WGL_NV_gpu_affinity
+#define WGL_NV_gpu_affinity 1
+DECLARE_HANDLE(HGPUNV);
+struct _GPU_DEVICE {
+ DWORD cb;
+ CHAR DeviceName[32];
+ CHAR DeviceString[128];
+ DWORD Flags;
+ RECT rcVirtualScreen;
+};
+typedef struct _GPU_DEVICE *PGPU_DEVICE;
+#define ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
+#define ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
+typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
+typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
+typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
+typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
+typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
+#ifdef WGL_WGLEXT_PROTOTYPES
+BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu);
+BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
+HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList);
+BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
+BOOL WINAPI wglDeleteDCNV (HDC hdc);
#endif
+#endif /* WGL_NV_gpu_affinity */
+
+#ifndef WGL_NV_multisample_coverage
+#define WGL_NV_multisample_coverage 1
+#define WGL_COVERAGE_SAMPLES_NV 0x2042
+#define WGL_COLOR_SAMPLES_NV 0x20B9
+#endif /* WGL_NV_multisample_coverage */
#ifndef WGL_NV_present_video
#define WGL_NV_present_video 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern int WINAPI wglEnumerateVideoDevicesNV (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
-extern BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
-extern BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue);
-#endif /* WGL_WGLEXT_PROTOTYPES */
+DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
+#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue);
-#endif
-
-#ifndef WGL_NV_video_output
-#define WGL_NV_video_output 1
#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
-extern BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice);
-extern BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
-extern BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer);
-extern BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
-extern BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
-typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
-typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
-typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
-typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
-typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
+int WINAPI wglEnumerateVideoDevicesNV (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
+BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
+BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue);
#endif
+#endif /* WGL_NV_present_video */
+
+#ifndef WGL_NV_render_depth_texture
+#define WGL_NV_render_depth_texture 1
+#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
+#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
+#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
+#define WGL_DEPTH_COMPONENT_NV 0x20A7
+#endif /* WGL_NV_render_depth_texture */
+
+#ifndef WGL_NV_render_texture_rectangle
+#define WGL_NV_render_texture_rectangle 1
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
+#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
+#endif /* WGL_NV_render_texture_rectangle */
#ifndef WGL_NV_swap_group
#define WGL_NV_swap_group 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group);
-extern BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier);
-extern BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier);
-extern BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
-extern BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count);
-extern BOOL WINAPI wglResetFrameCountNV (HDC hDC);
-#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier);
typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count);
typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
-#endif
-
-#ifndef WGL_NV_gpu_affinity
-#define WGL_NV_gpu_affinity 1
#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu);
-extern BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
-extern HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList);
-extern BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
-extern BOOL WINAPI wglDeleteDCNV (HDC hdc);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
-typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
-typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
-typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
-typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
+BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group);
+BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier);
+BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier);
+BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
+BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count);
+BOOL WINAPI wglResetFrameCountNV (HDC hDC);
#endif
+#endif /* WGL_NV_swap_group */
-#ifndef WGL_AMD_gpu_association
-#define WGL_AMD_gpu_association 1
+#ifndef WGL_NV_vertex_array_range
+#define WGL_NV_vertex_array_range 1
+typedef void *(WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
#ifdef WGL_WGLEXT_PROTOTYPES
-extern UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids);
-extern INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data);
-extern UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc);
-extern HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id);
-extern HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList);
-extern BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc);
-extern BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc);
-extern HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);
-extern VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);
-typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data);
-typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
-typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
-typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList);
-typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
-typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
-typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
-typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+void *WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+void WINAPI wglFreeMemoryNV (void *pointer);
#endif
+#endif /* WGL_NV_vertex_array_range */
#ifndef WGL_NV_video_capture
#define WGL_NV_video_capture 1
-#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
-extern UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
-extern BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
-extern BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
-extern BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
-#endif /* WGL_WGLEXT_PROTOTYPES */
+DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
+#define WGL_UNIQUE_ID_NV 0x20CE
+#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
-#endif
-
-#ifndef WGL_NV_copy_image
-#define WGL_NV_copy_image 1
#ifdef WGL_WGLEXT_PROTOTYPES
-extern BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-#endif /* WGL_WGLEXT_PROTOTYPES */
-typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
+BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
+UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
+BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
+BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
+BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
#endif
+#endif /* WGL_NV_video_capture */
-#ifndef WGL_NV_multisample_coverage
-#define WGL_NV_multisample_coverage 1
+#ifndef WGL_NV_video_output
+#define WGL_NV_video_output 1
+DECLARE_HANDLE(HPVIDEODEV);
+#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
+#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
+#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
+#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
+#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
+#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
+#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
+#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
+#define WGL_VIDEO_OUT_FRAME 0x20C8
+#define WGL_VIDEO_OUT_FIELD_1 0x20C9
+#define WGL_VIDEO_OUT_FIELD_2 0x20CA
+#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
+#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
+typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
+typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
+typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
+typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
+typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
+typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
+#ifdef WGL_WGLEXT_PROTOTYPES
+BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
+BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice);
+BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
+BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer);
+BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
+BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
#endif
+#endif /* WGL_NV_video_output */
+#ifndef WGL_OML_sync_control
+#define WGL_OML_sync_control 1
+typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
+typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
+typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
+typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
+typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
+typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
+#ifdef WGL_WGLEXT_PROTOTYPES
+BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
+BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator);
+INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
+INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
+BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
+BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
+#endif
+#endif /* WGL_OML_sync_control */
#ifdef __cplusplus
}
diff --git a/src/SFML/Window/iOS/EaglContext.hpp b/src/SFML/Window/iOS/EaglContext.hpp
new file mode 100644
index 0000000..dfdeae4
--- /dev/null
+++ b/src/SFML/Window/iOS/EaglContext.hpp
@@ -0,0 +1,165 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_EAGLCONTEXT_HPP
+#define SFML_EAGLCONTEXT_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/GlContext.hpp>
+#include <SFML/Window/iOS/ObjCType.hpp>
+#include <SFML/System/Vector2.hpp>
+#include <SFML/System/Clock.hpp>
+#include <OpenGLES/ES1/gl.h>
+
+
+SFML_DECLARE_OBJC_CLASS(EAGLContext);
+SFML_DECLARE_OBJC_CLASS(SFView);
+
+namespace sf
+{
+namespace priv
+{
+class WindowImplUIKit;
+
+////////////////////////////////////////////////////////////
+/// \brief iOS (EAGL) implementation of OpenGL contexts
+///
+////////////////////////////////////////////////////////////
+class EaglContext : public GlContext
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create a new context, not associated to a window
+ ///
+ /// \param shared Context to share the new one with (can be NULL)
+ ///
+ ////////////////////////////////////////////////////////////
+ EaglContext(EaglContext* shared);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create a new context attached to a window
+ ///
+ /// \param shared Context to share the new one with
+ /// \param settings Creation parameters
+ /// \param owner Pointer to the owner window
+ /// \param bitsPerPixel Pixel depth, in bits per pixel
+ ///
+ ////////////////////////////////////////////////////////////
+ EaglContext(EaglContext* shared, const ContextSettings& settings,
+ const WindowImpl* owner, unsigned int bitsPerPixel);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create a new context that embeds its own rendering target
+ ///
+ /// \param shared Context to share the new one with
+ /// \param settings Creation parameters
+ /// \param width Back buffer width, in pixels
+ /// \param height Back buffer height, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ EaglContext(EaglContext* shared, const ContextSettings& settings,
+ unsigned int width, unsigned int height);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~EaglContext();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Recreate the render buffers of the context
+ ///
+ /// This function must be called whenever the containing view
+ /// changes (typically after an orientation change)
+ ///
+ /// \param glView: Container of the context
+ ///
+ ////////////////////////////////////////////////////////////
+ void recreateRenderBuffers(SFView* glView);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Display what has been rendered to the context so far
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void display();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Enable or disable vertical synchronization
+ ///
+ /// Activating vertical synchronization will limit the number
+ /// of frames displayed to the refresh rate of the monitor.
+ /// This can avoid some visual artifacts, and limit the framerate
+ /// to a good value (but not constant across different computers).
+ ///
+ /// \param enabled: True to enable v-sync, false to deactivate
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setVerticalSyncEnabled(bool enabled);
+
+protected:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Activate the context as the current target
+ /// for rendering
+ ///
+ /// \return True on success, false if any error happened
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool makeCurrent();
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create the context
+ ///
+ /// \param shared Context to share the new one with (can be NULL)
+ /// \param window Window to attach the context to (can be NULL)
+ /// \param bitsPerPixel Pixel depth, in bits per pixel
+ /// \param settings Creation parameters
+ ///
+ ////////////////////////////////////////////////////////////
+ void createContext(EaglContext* shared,
+ const WindowImplUIKit* window,
+ unsigned int bitsPerPixel,
+ const ContextSettings& settings);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ EAGLContext* m_context; ///< The internal context
+ GLuint m_framebuffer; ///< Frame buffer associated to the context
+ GLuint m_colorbuffer; ///< Color render buffer
+ GLuint m_depthbuffer; ///< Depth render buffer
+ bool m_vsyncEnabled; ///< Vertical sync activation flag
+ Clock m_clock; ///< Measures the elapsed time for the fake v-sync implementation
+};
+
+} // namespace priv
+
+} // namespace sf
+
+#endif // SFML_EAGLCONTEXT_HPP
diff --git a/src/SFML/Window/iOS/EaglContext.mm b/src/SFML/Window/iOS/EaglContext.mm
new file mode 100644
index 0000000..450c9e6
--- /dev/null
+++ b/src/SFML/Window/iOS/EaglContext.mm
@@ -0,0 +1,234 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/iOS/EaglContext.hpp>
+#include <SFML/Window/iOS/WindowImplUIKit.hpp>
+#include <SFML/Window/iOS/SFView.hpp>
+#include <SFML/System/Err.hpp>
+#include <SFML/System/Sleep.hpp>
+#include <OpenGLES/EAGL.h>
+#include <OpenGLES/EAGLDrawable.h>
+#include <OpenGLES/ES1/glext.h>
+#include <QuartzCore/CAEAGLLayer.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+EaglContext::EaglContext(EaglContext* shared) :
+m_context (nil),
+m_framebuffer (0),
+m_colorbuffer (0),
+m_depthbuffer (0),
+m_vsyncEnabled(false),
+m_clock ()
+{
+ // Create the context
+ if (shared)
+ m_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1 sharegroup:[shared->m_context sharegroup]];
+ else
+ m_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1];
+}
+
+
+////////////////////////////////////////////////////////////
+EaglContext::EaglContext(EaglContext* shared, const ContextSettings& settings,
+ const WindowImpl* owner, unsigned int bitsPerPixel) :
+m_context (nil),
+m_framebuffer (0),
+m_colorbuffer (0),
+m_depthbuffer (0),
+m_vsyncEnabled(false),
+m_clock ()
+{
+ const WindowImplUIKit* window = static_cast<const WindowImplUIKit*>(owner);
+
+ createContext(shared, window, bitsPerPixel, settings);
+}
+
+
+////////////////////////////////////////////////////////////
+EaglContext::EaglContext(EaglContext* shared, const ContextSettings& settings,
+ unsigned int width, unsigned int height) :
+m_context (nil),
+m_framebuffer (0),
+m_colorbuffer (0),
+m_depthbuffer (0),
+m_vsyncEnabled(false),
+m_clock ()
+{
+ // This constructor should never be used by implementation
+ err() << "Calling bad EaglContext constructor, please contact your developer :)" << std::endl;
+}
+
+
+////////////////////////////////////////////////////////////
+EaglContext::~EaglContext()
+{
+ if (m_context)
+ {
+ // Activate the context, so that we can destroy the buffers
+ EAGLContext* previousContext = [EAGLContext currentContext];
+ [EAGLContext setCurrentContext:m_context];
+
+ // Destroy the buffers
+ if (m_framebuffer)
+ glDeleteFramebuffersOES(1, &m_framebuffer);
+ if (m_colorbuffer)
+ glDeleteRenderbuffersOES(1, &m_colorbuffer);
+ if (m_depthbuffer)
+ glDeleteRenderbuffersOES(1, &m_depthbuffer);
+
+ // Restore the previous context
+ [EAGLContext setCurrentContext:previousContext];
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void EaglContext::recreateRenderBuffers(SFView* glView)
+{
+ // Activate the context
+ EAGLContext* previousContext = [EAGLContext currentContext];
+ [EAGLContext setCurrentContext:m_context];
+
+ // Bind the frame buffer
+ glBindFramebufferOES(GL_FRAMEBUFFER_OES, m_framebuffer);
+
+ // Destroy previous render-buffers
+ if (m_colorbuffer)
+ glDeleteRenderbuffersOES(1, &m_colorbuffer);
+ if (m_depthbuffer)
+ glDeleteRenderbuffersOES(1, &m_depthbuffer);
+
+ // Create the color buffer
+ glGenRenderbuffersOES(1, &m_colorbuffer);
+ glBindRenderbufferOES(GL_RENDERBUFFER_OES, m_colorbuffer);
+ if (glView)
+ [m_context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(CAEAGLLayer*)glView.layer];
+ glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, m_colorbuffer);
+
+ // Create a depth buffer if requested
+ if (m_settings.depthBits > 0)
+ {
+ // Find the best internal format
+ GLenum format = m_settings.depthBits > 16 ? GL_DEPTH_COMPONENT24_OES : GL_DEPTH_COMPONENT16_OES;
+
+ // Get the size of the color-buffer (which fits the current size of the GL view)
+ GLint width, height;
+ glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &width);
+ glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &height);
+
+ // Create the depth buffer
+ glGenRenderbuffersOES(1, &m_depthbuffer);
+ glBindRenderbufferOES(GL_RENDERBUFFER_OES, m_depthbuffer);
+ glRenderbufferStorageOES(GL_RENDERBUFFER_OES, format, width, height);
+ glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, m_depthbuffer);
+ }
+
+ // Make sure that everything's ok
+ GLenum status = glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES);
+ if (status != GL_FRAMEBUFFER_COMPLETE_OES)
+ err() << "Failed to create a valid frame buffer (error code: " << status << ")" << std::endl;
+
+ // Restore the previous context
+ [EAGLContext setCurrentContext:previousContext];
+}
+
+
+////////////////////////////////////////////////////////////
+bool EaglContext::makeCurrent()
+{
+ return [EAGLContext setCurrentContext:m_context];
+}
+
+
+////////////////////////////////////////////////////////////
+void EaglContext::display()
+{
+ glBindRenderbufferOES(GL_RENDERBUFFER_OES, m_colorbuffer);
+ [m_context presentRenderbuffer:GL_RENDERBUFFER_OES];
+
+ // The proper way of doing v-sync on iOS would be to use CADisplayLink
+ // notifications, but it is not compatible with the way SFML is designed;
+ // therefore we fake it with a manual framerate limit
+ if (m_vsyncEnabled)
+ {
+ static const Time frameDuration = seconds(1.f / 60.f);
+ sleep(frameDuration - m_clock.getElapsedTime());
+ m_clock.restart();
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void EaglContext::setVerticalSyncEnabled(bool enabled)
+{
+ m_vsyncEnabled = enabled;
+}
+
+
+////////////////////////////////////////////////////////////
+void EaglContext::createContext(EaglContext* shared,
+ const WindowImplUIKit* window,
+ unsigned int bitsPerPixel,
+ const ContextSettings& settings)
+{
+ // Save the settings
+ m_settings = settings;
+
+ // Adjust the depth buffer format to those available
+ if (m_settings.depthBits > 16)
+ m_settings.depthBits = 24;
+ else if (m_settings.depthBits > 0)
+ m_settings.depthBits = 16;
+
+ // Create the context
+ if (shared)
+ m_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1 sharegroup:[shared->m_context sharegroup]];
+ else
+ m_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1];
+
+ // Activate it
+ makeCurrent();
+
+ // Create the framebuffer (this is the only allowed drawable on iOS)
+ glGenFramebuffersOES(1, &m_framebuffer);
+
+ // Create the render buffers
+ recreateRenderBuffers(window->getGlView());
+
+ // Attach the context to the GL view for future updates
+ window->getGlView().context = this;
+}
+
+} // namespace priv
+
+} // namespace sf
+
diff --git a/src/SFML/Window/iOS/InputImpl.hpp b/src/SFML/Window/iOS/InputImpl.hpp
new file mode 100644
index 0000000..1c01fa3
--- /dev/null
+++ b/src/SFML/Window/iOS/InputImpl.hpp
@@ -0,0 +1,168 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_INPUTIMPLIOS_HPP
+#define SFML_INPUTIMPLIOS_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/Keyboard.hpp>
+#include <SFML/Window/Mouse.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief iOS implementation of inputs (keyboard + mouse)
+///
+////////////////////////////////////////////////////////////
+class InputImpl
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a key is pressed
+ ///
+ /// \param key Key to check
+ ///
+ /// \return True if the key is pressed, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isKeyPressed(Keyboard::Key key);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Show or hide the virtual keyboard
+ ///
+ /// \param visible True to show, false to hide
+ ///
+ ////////////////////////////////////////////////////////////
+ static void setVirtualKeyboardVisible(bool visible);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a mouse button is pressed
+ ///
+ /// \param button Button to check
+ ///
+ /// \return True if the button is pressed, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isMouseButtonPressed(Mouse::Button button);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current position of the mouse in desktop coordinates
+ ///
+ /// This function returns the current position of the mouse
+ /// cursor, in global (desktop) coordinates.
+ ///
+ /// \return Current position of the mouse
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector2i getMousePosition();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current position of the mouse in window coordinates
+ ///
+ /// This function returns the current position of the mouse
+ /// cursor, relative to the given window.
+ /// If no window is used, it returns desktop coordinates.
+ ///
+ /// \param relativeTo Reference window
+ ///
+ /// \return Current position of the mouse
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector2i getMousePosition(const Window& relativeTo);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Set the current position of the mouse in desktop coordinates
+ ///
+ /// This function sets the current position of the mouse
+ /// cursor in global (desktop) coordinates.
+ /// If no window is used, it sets the position in desktop coordinates.
+ ///
+ /// \param position New position of the mouse
+ ///
+ ////////////////////////////////////////////////////////////
+ static void setMousePosition(const Vector2i& position);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Set the current position of the mouse in window coordinates
+ ///
+ /// This function sets the current position of the mouse
+ /// cursor, relative to the given window.
+ /// If no window is used, it sets the position in desktop coordinates.
+ ///
+ /// \param position New position of the mouse
+ /// \param relativeTo Reference window
+ ///
+ ////////////////////////////////////////////////////////////
+ static void setMousePosition(const Vector2i& position, const Window& relativeTo);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a touch event is currently down
+ ///
+ /// \param finger Finger index
+ ///
+ /// \return True if \a finger is currently touching the screen, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isTouchDown(unsigned int finger);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current position of a touch in desktop coordinates
+ ///
+ /// This function returns the current touch position
+ /// in global (desktop) coordinates.
+ ///
+ /// \param finger Finger index
+ ///
+ /// \return Current position of \a finger, or undefined if it's not down
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector2i getTouchPosition(unsigned int finger);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current position of a touch in window coordinates
+ ///
+ /// This function returns the current touch position
+ /// in global (desktop) coordinates.
+ ///
+ /// \param finger Finger index
+ /// \param relativeTo Reference window
+ ///
+ /// \return Current position of \a finger, or undefined if it's not down
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector2i getTouchPosition(unsigned int finger, const Window& relativeTo);
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_INPUTIMPLIOS_HPP
diff --git a/src/SFML/Window/iOS/InputImpl.mm b/src/SFML/Window/iOS/InputImpl.mm
new file mode 100644
index 0000000..35b61e5
--- /dev/null
+++ b/src/SFML/Window/iOS/InputImpl.mm
@@ -0,0 +1,116 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/iOS/InputImpl.hpp>
+#include <SFML/Window/iOS/SFAppDelegate.hpp>
+#include <SFML/Window/VideoMode.hpp>
+#include <SFML/Window/Window.hpp>
+#include <SFML/System/Err.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+bool InputImpl::isKeyPressed(Keyboard::Key key)
+{
+ // Not applicable
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+void InputImpl::setVirtualKeyboardVisible(bool visible)
+{
+ [[SFAppDelegate getInstance] setVirtualKeyboardVisible:visible];
+}
+
+
+////////////////////////////////////////////////////////////
+bool InputImpl::isMouseButtonPressed(Mouse::Button button)
+{
+ // Not applicable
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i InputImpl::getMousePosition()
+{
+ return Vector2i(0, 0);
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i InputImpl::getMousePosition(const Window& relativeTo)
+{
+ (void)relativeTo;
+
+ return getMousePosition();
+}
+
+
+////////////////////////////////////////////////////////////
+void InputImpl::setMousePosition(const Vector2i& position)
+{
+ // Not applicable
+}
+
+
+////////////////////////////////////////////////////////////
+void InputImpl::setMousePosition(const Vector2i& position, const Window& relativeTo)
+{
+ // Not applicable
+}
+
+
+////////////////////////////////////////////////////////////
+bool InputImpl::isTouchDown(unsigned int finger)
+{
+ return [[SFAppDelegate getInstance] getTouchPosition:finger] != Vector2i(-1, -1);
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i InputImpl::getTouchPosition(unsigned int finger)
+{
+ return [[SFAppDelegate getInstance] getTouchPosition:finger];
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i InputImpl::getTouchPosition(unsigned int finger, const Window& relativeTo)
+{
+ (void)relativeTo;
+
+ return getTouchPosition(finger);
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/Linux/JoystickImpl.hpp b/src/SFML/Window/iOS/JoystickImpl.hpp
index 869f185..a0890c8 100644
--- a/src/SFML/Window/Linux/JoystickImpl.hpp
+++ b/src/SFML/Window/iOS/JoystickImpl.hpp
@@ -22,19 +22,13 @@
//
////////////////////////////////////////////////////////////
-#ifndef SFML_JOYSTICKIMPLLINUX_HPP
-#define SFML_JOYSTICKIMPLLINUX_HPP
+#ifndef SFML_JOYSTICKIMPLIOS_HPP
+#define SFML_JOYSTICKIMPLIOS_HPP
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#if defined(SFML_SYSTEM_LINUX)
- #include <linux/joystick.h>
- #include <fcntl.h>
-#elif defined(SFML_SYSTEM_FREEBSD)
- // #include <sys/joystick.h> ?
- #define ABS_MAX 1
-#endif
+#include <SFML/Window/JoystickImpl.hpp>
namespace sf
@@ -42,12 +36,12 @@ namespace sf
namespace priv
{
////////////////////////////////////////////////////////////
-/// \brief Linux implementation of joysticks
+/// \brief iOS implementation of joysticks
///
////////////////////////////////////////////////////////////
class JoystickImpl
{
-public :
+public:
////////////////////////////////////////////////////////////
/// \brief Perform the global initialization of the joystick module
@@ -96,21 +90,20 @@ public :
JoystickCaps getCapabilities() const;
////////////////////////////////////////////////////////////
- /// \brief Update the joystick and get its new state
+ /// \brief Get the joystick identification
///
- /// \return Joystick state
+ /// \return Joystick identification
///
////////////////////////////////////////////////////////////
- JoystickState update();
-
-private :
+ Joystick::Identification getIdentification() const;
////////////////////////////////////////////////////////////
- // Member data
+ /// \brief Update the joystick and get its new state
+ ///
+ /// \return Joystick state
+ ///
////////////////////////////////////////////////////////////
- int m_file; ///< File descriptor of the joystick
- char m_mapping[ABS_MAX + 1]; ///< Axes mapping (index to axis id)
- JoystickState m_state; ///< Current state of the joystick
+ JoystickState update();
};
} // namespace priv
@@ -118,4 +111,4 @@ private :
} // namespace sf
-#endif // SFML_JOYSTICKIMPLLINUX_HPP
+#endif // SFML_JOYSTICKIMPLIOS_HPP
diff --git a/src/SFML/Window/iOS/JoystickImpl.mm b/src/SFML/Window/iOS/JoystickImpl.mm
new file mode 100644
index 0000000..9fc45e9
--- /dev/null
+++ b/src/SFML/Window/iOS/JoystickImpl.mm
@@ -0,0 +1,97 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/JoystickImpl.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+void JoystickImpl::initialize()
+{
+ // Not implemented
+}
+
+
+////////////////////////////////////////////////////////////
+void JoystickImpl::cleanup()
+{
+ // Not implemented
+}
+
+
+////////////////////////////////////////////////////////////
+bool JoystickImpl::isConnected(unsigned int index)
+{
+ // Not implemented
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+bool JoystickImpl::open(unsigned int index)
+{
+ // Not implemented
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////
+void JoystickImpl::close()
+{
+ // Not implemented
+}
+
+
+////////////////////////////////////////////////////////////
+JoystickCaps JoystickImpl::getCapabilities() const
+{
+ // Not implemented
+ return JoystickCaps();
+}
+
+
+////////////////////////////////////////////////////////////
+Joystick::Identification JoystickImpl::getIdentification() const
+{
+ // Not implemented
+ return Joystick::Identification();
+}
+
+
+////////////////////////////////////////////////////////////
+JoystickState JoystickImpl::update()
+{
+ // Not implemented
+ return JoystickState();
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/iOS/ObjCType.hpp b/src/SFML/Window/iOS/ObjCType.hpp
new file mode 100644
index 0000000..29283e4
--- /dev/null
+++ b/src/SFML/Window/iOS/ObjCType.hpp
@@ -0,0 +1,37 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_OBJCTYPE_HPP
+#define SFML_OBJCTYPE_HPP
+
+
+// Forward declare an Objective-C class
+#ifdef __OBJC__
+ #define SFML_DECLARE_OBJC_CLASS(c) @class c
+#else
+ #define SFML_DECLARE_OBJC_CLASS(c) typedef struct objc_object c
+#endif
+
+
+#endif // SFML_OBJCTYPE_HPP
diff --git a/src/SFML/Window/iOS/SFAppDelegate.hpp b/src/SFML/Window/iOS/SFAppDelegate.hpp
new file mode 100644
index 0000000..77f1a63
--- /dev/null
+++ b/src/SFML/Window/iOS/SFAppDelegate.hpp
@@ -0,0 +1,112 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SFAPPDELEGATE_HPP
+#define SFML_SFAPPDELEGATE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/iOS/WindowImplUIKit.hpp>
+#include <UIKit/UIKit.h>
+#include <CoreMotion/CoreMotion.h>
+
+
+////////////////////////////////////////////////////////////
+/// \brief Our custom application delegate
+///
+/// This class handles global application events.
+///
+////////////////////////////////////////////////////////////
+@interface SFAppDelegate : NSObject<UIApplicationDelegate>
+
+////////////////////////////////////////////////////////////
+/// \brief Return the instance of the application delegate
+///
+////////////////////////////////////////////////////////////
++(SFAppDelegate*)getInstance;
+
+////////////////////////////////////////////////////////////
+/// \brief Show or hide the virtual keyboard
+///
+/// \param visible True to show, false to hide
+///
+////////////////////////////////////////////////////////////
+- (void)setVirtualKeyboardVisible:(bool)visible;
+
+////////////////////////////////////////////////////////////
+/// \brief Get the current touch position for a given finger
+///
+/// \param index Finger index
+///
+/// \return Current touch position, or (-1, -1) if no touch
+///
+////////////////////////////////////////////////////////////
+- (sf::Vector2i)getTouchPosition:(unsigned int)index;
+
+////////////////////////////////////////////////////////////
+/// \brief Receive an external touch begin notification
+///
+/// \param index Finger index
+/// \param position Position of the touch
+///
+////////////////////////////////////////////////////////////
+- (void)notifyTouchBegin:(unsigned int)index atPosition:(sf::Vector2i)position;
+
+////////////////////////////////////////////////////////////
+/// \brief Receive an external touch move notification
+///
+/// \param index Finger index
+/// \param position Position of the touch
+///
+////////////////////////////////////////////////////////////
+- (void)notifyTouchMove:(unsigned int)index atPosition:(sf::Vector2i)position;
+
+////////////////////////////////////////////////////////////
+/// \brief Receive an external touch end notification
+///
+/// \param index Finger index
+/// \param position Position of the touch
+///
+////////////////////////////////////////////////////////////
+- (void)notifyTouchEnd:(unsigned int)index atPosition:(sf::Vector2i)position;
+
+////////////////////////////////////////////////////////////
+/// \brief Receive an external character notification
+///
+/// \param character The typed character
+///
+////////////////////////////////////////////////////////////
+- (void)notifyCharacter:(sf::Uint32)character;
+
+////////////////////////////////////////////////////////////
+// Member data
+////////////////////////////////////////////////////////////
+@property (nonatomic) sf::priv::WindowImplUIKit* sfWindow; ///< Main window of the application
+@property (readonly, nonatomic) CMMotionManager* motionManager; ///< Instance of the motion manager
+
+@end
+
+#endif // SFML_SFAPPDELEGATE_HPP
+
diff --git a/src/SFML/Window/iOS/SFAppDelegate.mm b/src/SFML/Window/iOS/SFAppDelegate.mm
new file mode 100644
index 0000000..f63060b
--- /dev/null
+++ b/src/SFML/Window/iOS/SFAppDelegate.mm
@@ -0,0 +1,277 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/iOS/SFAppDelegate.hpp>
+#include <SFML/Window/iOS/SFMain.hpp>
+#include <vector>
+
+
+namespace
+{
+ // Save the global instance of the delegate
+ SFAppDelegate* delegateInstance = NULL;
+
+ // Current touches positions
+ std::vector<sf::Vector2i> touchPositions;
+}
+
+
+@interface SFAppDelegate()
+
+@property (nonatomic) CMMotionManager* motionManager;
+
+@end
+
+
+@implementation SFAppDelegate
+
+@synthesize sfWindow;
+
+
+////////////////////////////////////////////////////////////
++(SFAppDelegate*)getInstance
+{
+ return delegateInstance;
+}
+
+
+////////////////////////////////////////////////////////////
+-(void)runUserMain
+{
+ // Arguments intentionally dropped, see comments in main in sfml-main
+ sfmlMain(0, NULL);
+}
+
+
+////////////////////////////////////////////////////////////
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ // Save the delegate instance
+ delegateInstance = self;
+
+ // Instantiate the motion manager
+ self.motionManager = [[CMMotionManager alloc] init];
+
+ // Register orientation changes notifications
+ [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceOrientationDidChange:) name:UIDeviceOrientationDidChangeNotification object: nil];
+
+ // Change the working directory to the resources directory
+ [[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle mainBundle] resourcePath]];
+
+ // Schedule an indirect call to the user main, so that this call (and the whole
+ // init sequence) can end, and the default splashscreen can be destroyed
+ [self performSelector:@selector(runUserMain) withObject:nil afterDelay:0.0];
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ // Called when:
+ // - the application is sent to background
+ // - the application is interrupted by a call or message
+
+ // Generate a LostFocus event
+ if (self.sfWindow)
+ {
+ sf::Event event;
+ event.type = sf::Event::LostFocus;
+ sfWindow->forwardEvent(event);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+ // Called when the application is sent to background (home button pressed)
+}
+
+
+////////////////////////////////////////////////////////////
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+ // Called when:
+ // - the application is sent to foreground
+ // - the application was interrupted by a call or message
+
+ // Generate a GainedFocus event
+ if (self.sfWindow)
+ {
+ sf::Event event;
+ event.type = sf::Event::GainedFocus;
+ sfWindow->forwardEvent(event);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+ // Called when the application is sent to foreground (app icon pressed)
+}
+
+
+////////////////////////////////////////////////////////////
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+ // Generate a Closed event
+ if (self.sfWindow)
+ {
+ sf::Event event;
+ event.type = sf::Event::Closed;
+ sfWindow->forwardEvent(event);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+- (void)deviceOrientationDidChange:(NSNotification *)notification
+{
+ if (self.sfWindow)
+ {
+ // Get the new orientation
+ UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
+
+ // Filter interesting orientations
+ if ((orientation == UIDeviceOrientationLandscapeLeft) ||
+ (orientation == UIDeviceOrientationLandscapeRight) ||
+ (orientation == UIDeviceOrientationPortrait) ||
+ (orientation == UIDeviceOrientationPortraitUpsideDown))
+ {
+ // Get the new size
+ sf::Vector2u size = self.sfWindow->getSize();
+ if (UIDeviceOrientationIsLandscape(orientation))
+ std::swap(size.x, size.y);
+
+ // Send a Resized event to the current window
+ sf::Event event;
+ event.type = sf::Event::Resized;
+ event.size.width = size.x;
+ event.size.height = size.y;
+ sfWindow->forwardEvent(event);
+ }
+ }
+}
+
+////////////////////////////////////////////////////////////
+- (void)setVirtualKeyboardVisible:(bool)visible
+{
+ if (self.sfWindow)
+ self.sfWindow->setVirtualKeyboardVisible(visible);
+}
+
+
+////////////////////////////////////////////////////////////
+- (sf::Vector2i)getTouchPosition:(unsigned int)index
+{
+ if (index < touchPositions.size())
+ return touchPositions[index];
+ else
+ return sf::Vector2i(-1, -1);
+}
+
+
+////////////////////////////////////////////////////////////
+- (void)notifyTouchBegin:(unsigned int)index atPosition:(sf::Vector2i)position;
+{
+ // save the touch position
+ if (index >= touchPositions.size())
+ touchPositions.resize(index + 1, sf::Vector2i(-1, -1));
+ touchPositions[index] = position;
+
+ // notify the event to the application window
+ if (self.sfWindow)
+ {
+ sf::Event event;
+ event.type = sf::Event::TouchBegan;
+ event.touch.finger = index;
+ event.touch.x = position.x;
+ event.touch.y = position.y;
+ sfWindow->forwardEvent(event);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+- (void)notifyTouchMove:(unsigned int)index atPosition:(sf::Vector2i)position;
+{
+ // save the touch position
+ if (index >= touchPositions.size())
+ touchPositions.resize(index + 1, sf::Vector2i(-1, -1));
+ touchPositions[index] = position;
+
+ // notify the event to the application window
+ if (self.sfWindow)
+ {
+ sf::Event event;
+ event.type = sf::Event::TouchMoved;
+ event.touch.finger = index;
+ event.touch.x = position.x;
+ event.touch.y = position.y;
+ sfWindow->forwardEvent(event);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+- (void)notifyTouchEnd:(unsigned int)index atPosition:(sf::Vector2i)position;
+{
+ // clear the touch position
+ if (index < touchPositions.size())
+ touchPositions[index] = sf::Vector2i(-1, -1);
+
+ // notify the event to the application window
+ if (self.sfWindow)
+ {
+ sf::Event event;
+ event.type = sf::Event::TouchEnded;
+ event.touch.finger = index;
+ event.touch.x = position.x;
+ event.touch.y = position.y;
+ sfWindow->forwardEvent(event);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+- (void)notifyCharacter:(sf::Uint32)character
+{
+ if (self.sfWindow)
+ {
+ sf::Event event;
+ event.type = sf::Event::TextEntered;
+ event.text.unicode = character;
+ sfWindow->forwardEvent(event);
+ }
+}
+
+
+@end
diff --git a/src/SFML/Window/iOS/SFMain.hpp b/src/SFML/Window/iOS/SFMain.hpp
new file mode 100644
index 0000000..e80d820
--- /dev/null
+++ b/src/SFML/Window/iOS/SFMain.hpp
@@ -0,0 +1,35 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SFMAIN_HPP
+#define SFML_SFMAIN_HPP
+
+
+int sfmlMain(int argc, char** argv);
+
+int sfmlMain();
+
+
+#endif // SFML_SFMAIN_HPP
+
diff --git a/src/SFML/Window/iOS/SFMain.mm b/src/SFML/Window/iOS/SFMain.mm
new file mode 100644
index 0000000..7d793a3
--- /dev/null
+++ b/src/SFML/Window/iOS/SFMain.mm
@@ -0,0 +1,61 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/iOS/SFMain.hpp>
+
+
+// sfmlMain is called by the application delegate (SFAppDelegate).
+//
+// Since we don't know which prototype of main the user
+// defines, we declare both versions of sfmlMain, but with
+// the 'weak' attribute (GCC extension) so that the
+// user-declared one will replace SFML's one at linking stage.
+//
+// If user defines main(argc, argv) then it will be called
+// directly, if he defines main() then it will be called by
+// our placeholder.
+//
+// The sfmlMain() version is never called, it is just defined
+// to avoid a linker error if the user directly defines the
+// version with arguments.
+//
+// See the sfml-main module for the other half of this
+// initialization trick.
+
+
+////////////////////////////////////////////////////////////
+__attribute__((weak)) int sfmlMain(int, char**)
+{
+ return sfmlMain();
+}
+
+
+////////////////////////////////////////////////////////////
+__attribute__((weak)) int sfmlMain()
+{
+ return 0;
+}
diff --git a/src/SFML/Window/iOS/SFView.hpp b/src/SFML/Window/iOS/SFView.hpp
new file mode 100644
index 0000000..1720a60
--- /dev/null
+++ b/src/SFML/Window/iOS/SFView.hpp
@@ -0,0 +1,59 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SFVIEW_HPP
+#define SFML_SFVIEW_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/iOS/EaglContext.hpp>
+#include <UIKit/UIKit.h>
+
+
+////////////////////////////////////////////////////////////
+/// \brief Our custom implementation of the window's view
+/// (supports OpenGL and reports events)
+///
+////////////////////////////////////////////////////////////
+@interface SFView : UIView<UIKeyInput>
+
+////////////////////////////////////////////////////////////
+/// \brief Construct the view with its initial size
+///
+/// \param frame Dimensions of the view
+///
+/// \return Id of the view
+///
+////////////////////////////////////////////////////////////
+-(id)initWithFrame:(CGRect)frame;
+
+////////////////////////////////////////////////////////////
+// Member data
+////////////////////////////////////////////////////////////
+@property (nonatomic) sf::priv::EaglContext* context; ///< The attached EAGL context
+
+@end
+
+#endif // SFML_SFVIEW_HPP
diff --git a/src/SFML/Window/iOS/SFView.mm b/src/SFML/Window/iOS/SFView.mm
new file mode 100644
index 0000000..bac46c8
--- /dev/null
+++ b/src/SFML/Window/iOS/SFView.mm
@@ -0,0 +1,205 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/iOS/SFView.hpp>
+#include <SFML/Window/iOS/SFAppDelegate.hpp>
+#include <SFML/System/Utf.hpp>
+#include <QuartzCore/CAEAGLLayer.h>
+#include <cstring>
+
+
+@interface SFView()
+
+@property (nonatomic) NSMutableArray* touches;
+
+@end
+
+
+@implementation SFView
+
+@synthesize context;
+
+
+////////////////////////////////////////////////////////////
+-(BOOL)canBecomeFirstResponder
+{
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+- (BOOL)hasText
+{
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+- (void)deleteBackward
+{
+ [[SFAppDelegate getInstance] notifyCharacter:'\b'];
+}
+
+
+////////////////////////////////////////////////////////////
+- (void)insertText:(NSString*)text
+{
+ // Convert the NSString to UTF-8
+ const char* utf8 = [text UTF8String];
+
+ // Then convert to UTF-32 and notify the application delegate of each new character
+ const char* end = utf8 + std::strlen(utf8);
+ while (utf8 < end)
+ {
+ sf::Uint32 character;
+ utf8 = sf::Utf8::decode(utf8, end, character);
+ [[SFAppDelegate getInstance] notifyCharacter:character];
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
+{
+ for (UITouch* touch in touches)
+ {
+ // find an empty slot for the new touch
+ NSUInteger index = [self.touches indexOfObject:[NSNull null]];
+ if (index != NSNotFound)
+ {
+ [self.touches replaceObjectAtIndex:index withObject:touch];
+ }
+ else
+ {
+ [self.touches addObject:touch];
+ index = [self.touches count] - 1;
+ }
+
+ // get the touch position
+ CGPoint point = [touch locationInView:self];
+ sf::Vector2i position(static_cast<int>(point.x), static_cast<int>(point.y));
+
+ // notify the application delegate
+ [[SFAppDelegate getInstance] notifyTouchBegin:index atPosition:position];
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+- (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event
+{
+ for (UITouch* touch in touches)
+ {
+ // find the touch
+ NSUInteger index = [self.touches indexOfObject:touch];
+ if (index != NSNotFound)
+ {
+ // get the touch position
+ CGPoint point = [touch locationInView:self];
+ sf::Vector2i position(static_cast<int>(point.x), static_cast<int>(point.y));
+
+ // notify the application delegate
+ [[SFAppDelegate getInstance] notifyTouchMove:index atPosition:position];
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+- (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event
+{
+ for (UITouch* touch in touches)
+ {
+ // find the touch
+ NSUInteger index = [self.touches indexOfObject:touch];
+ if (index != NSNotFound)
+ {
+ // get the touch position
+ CGPoint point = [touch locationInView:self];
+ sf::Vector2i position(static_cast<int>(point.x), static_cast<int>(point.y));
+
+ // notify the application delegate
+ [[SFAppDelegate getInstance] notifyTouchEnd:index atPosition:position];
+
+ // remove the touch
+ [self.touches replaceObjectAtIndex:index withObject:[NSNull null]];
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+- (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event
+{
+ // Treat touch cancel events the same way as touch end
+ [self touchesEnded:touches withEvent:event];
+}
+
+
+////////////////////////////////////////////////////////////
+- (void)layoutSubviews
+{
+ // update the attached context's buffers
+ if (self.context)
+ self.context->recreateRenderBuffers(self);
+}
+
+
+////////////////////////////////////////////////////////////
++(Class)layerClass
+{
+ return [CAEAGLLayer class];
+}
+
+
+////////////////////////////////////////////////////////////
+-(id)initWithFrame:(CGRect)frame
+{
+ self = [super initWithFrame:frame];
+ if (self)
+ {
+ self.context = NULL;
+ self.touches = [NSMutableArray array];
+
+ // Configure the EAGL layer
+ CAEAGLLayer* eaglLayer = (CAEAGLLayer*)self.layer;
+ eaglLayer.opaque = YES;
+ eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithBool:FALSE], kEAGLDrawablePropertyRetainedBacking,
+ kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat,
+ nil];
+
+ // Enable user interactions on the view (multi-touch events)
+ self.userInteractionEnabled = true;
+ self.multipleTouchEnabled = true;
+ }
+
+ return self;
+}
+
+
+@end
diff --git a/src/SFML/Window/iOS/SFViewController.hpp b/src/SFML/Window/iOS/SFViewController.hpp
new file mode 100644
index 0000000..b65688f
--- /dev/null
+++ b/src/SFML/Window/iOS/SFViewController.hpp
@@ -0,0 +1,73 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SFVIEWCONTROLLER_HPP
+#define SFML_SFVIEWCONTROLLER_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <UIKit/UIKit.h>
+
+
+////////////////////////////////////////////////////////////
+/// \brief The view controller handles the view's orientation
+///
+////////////////////////////////////////////////////////////
+@interface SFViewController : UIViewController
+
+////////////////////////////////////////////////////////////
+/// \brief Tells if the controller supports auto-rotation (iOS < 6)
+///
+/// \param interfaceOrientation Orientation to check
+///
+/// \return True if auto-rotation is supported, false otherwise
+///
+////////////////////////////////////////////////////////////
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
+
+////////////////////////////////////////////////////////////
+/// \brief Tells if the controller supports auto-rotation (iOS >= 6)
+///
+/// \return True if auto-rotation is supported, false otherwise
+///
+////////////////////////////////////////////////////////////
+- (BOOL)shouldAutorotate;
+
+////////////////////////////////////////////////////////////
+/// \brief Returns the supported orientations (iOS >= 6)
+///
+/// \return A combination of all the supported orientations
+///
+////////////////////////////////////////////////////////////
+- (NSUInteger)supportedInterfaceOrientations;
+
+////////////////////////////////////////////////////////////
+// Member data
+////////////////////////////////////////////////////////////
+@property (nonatomic) bool orientationCanChange; ///< Tells whether the controller's view can rotate or not
+
+@end
+
+#endif // SFML_SFVIEWCONTROLLER_HPP
diff --git a/src/SFML/Window/iOS/SFViewController.mm b/src/SFML/Window/iOS/SFViewController.mm
new file mode 100644
index 0000000..748ced1
--- /dev/null
+++ b/src/SFML/Window/iOS/SFViewController.mm
@@ -0,0 +1,59 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/iOS/SFViewController.hpp>
+
+
+@implementation SFViewController
+
+@synthesize orientationCanChange;
+
+
+////////////////////////////////////////////////////////////
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ (void)interfaceOrientation;
+
+ return self.orientationCanChange;
+}
+
+
+////////////////////////////////////////////////////////////
+- (BOOL)shouldAutorotate
+{
+ return self.orientationCanChange;
+}
+
+
+////////////////////////////////////////////////////////////
+- (NSUInteger)supportedInterfaceOrientations
+{
+ return UIInterfaceOrientationMaskAll;
+}
+
+
+@end
diff --git a/src/SFML/Window/iOS/SensorImpl.hpp b/src/SFML/Window/iOS/SensorImpl.hpp
new file mode 100644
index 0000000..b9dd5c2
--- /dev/null
+++ b/src/SFML/Window/iOS/SensorImpl.hpp
@@ -0,0 +1,114 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SENSORIMPLIOS_HPP
+#define SFML_SENSORIMPLIOS_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/Sensor.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief iOS implementation of sensors
+///
+////////////////////////////////////////////////////////////
+class SensorImpl
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global initialization of the sensor module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void initialize();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Perform the global cleanup of the sensor module
+ ///
+ ////////////////////////////////////////////////////////////
+ static void cleanup();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if a sensor is available
+ ///
+ /// \param sensor Sensor to check
+ ///
+ /// \return True if the sensor is available, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isAvailable(Sensor::Type sensor);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open the sensor
+ ///
+ /// \param sensor Type of the sensor
+ ///
+ /// \return True on success, false on failure
+ ///
+ ////////////////////////////////////////////////////////////
+ bool open(Sensor::Type sensor);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Close the sensor
+ ///
+ ////////////////////////////////////////////////////////////
+ void close();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Update the sensor and get its new value
+ ///
+ /// \return Sensor value
+ ///
+ ////////////////////////////////////////////////////////////
+ Vector3f update();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Enable or disable the sensor
+ ///
+ /// \param enabled True to enable, false to disable
+ ///
+ ////////////////////////////////////////////////////////////
+ void setEnabled(bool enabled);
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ Sensor::Type m_sensor; ///< Type of the sensor
+ bool m_enabled; ///< Enable state of the sensor
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_SENSORIMPLIOS_HPP
diff --git a/src/SFML/Window/iOS/SensorImpl.mm b/src/SFML/Window/iOS/SensorImpl.mm
new file mode 100644
index 0000000..1278ee1
--- /dev/null
+++ b/src/SFML/Window/iOS/SensorImpl.mm
@@ -0,0 +1,242 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/SensorImpl.hpp>
+#include <SFML/Window/iOS/SFAppDelegate.hpp>
+
+
+namespace
+{
+ unsigned int deviceMotionEnabledCount = 0;
+
+ float toDegrees(float radians)
+ {
+ return radians * 180.f / 3.141592654f;
+ }
+}
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+void SensorImpl::initialize()
+{
+ // Nothing to do
+}
+
+
+////////////////////////////////////////////////////////////
+void SensorImpl::cleanup()
+{
+ // Nothing to do
+}
+
+
+////////////////////////////////////////////////////////////
+bool SensorImpl::isAvailable(Sensor::Type sensor)
+{
+ switch (sensor)
+ {
+ case Sensor::Accelerometer:
+ return [SFAppDelegate getInstance].motionManager.accelerometerAvailable;
+
+ case Sensor::Gyroscope:
+ return [SFAppDelegate getInstance].motionManager.gyroAvailable;
+
+ case Sensor::Magnetometer:
+ return [SFAppDelegate getInstance].motionManager.magnetometerAvailable;
+
+ case Sensor::Gravity:
+ case Sensor::UserAcceleration:
+ case Sensor::Orientation:
+ return [SFAppDelegate getInstance].motionManager.deviceMotionAvailable;
+
+ default:
+ return false;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+bool SensorImpl::open(Sensor::Type sensor)
+{
+ // Store the sensor type
+ m_sensor = sensor;
+
+ // The sensor is disabled by default
+ m_enabled = false;
+
+ // Set the refresh rate (use the maximum allowed)
+ static const NSTimeInterval updateInterval = 1. / 60.;
+ switch (sensor)
+ {
+ case Sensor::Accelerometer:
+ [SFAppDelegate getInstance].motionManager.accelerometerUpdateInterval = updateInterval;
+ break;
+
+ case Sensor::Gyroscope:
+ [SFAppDelegate getInstance].motionManager.gyroUpdateInterval = updateInterval;
+ break;
+
+ case Sensor::Magnetometer:
+ [SFAppDelegate getInstance].motionManager.magnetometerUpdateInterval = updateInterval;
+ break;
+
+ case Sensor::Gravity:
+ case Sensor::UserAcceleration:
+ case Sensor::Orientation:
+ [SFAppDelegate getInstance].motionManager.deviceMotionUpdateInterval = updateInterval;
+ break;
+
+ default:
+ break;
+ }
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+void SensorImpl::close()
+{
+ // Nothing to do
+}
+
+
+////////////////////////////////////////////////////////////
+Vector3f SensorImpl::update()
+{
+ Vector3f value;
+ CMMotionManager* manager = [SFAppDelegate getInstance].motionManager;
+
+ switch (m_sensor)
+ {
+ case Sensor::Accelerometer:
+ // Acceleration is given in G, convert to m/sē
+ value.x = manager.accelerometerData.acceleration.x * 9.81f;
+ value.y = manager.accelerometerData.acceleration.y * 9.81f;
+ value.z = manager.accelerometerData.acceleration.z * 9.81f;
+ break;
+
+ case Sensor::Gyroscope:
+ // Rotation rates are given in rad/s, convert to deg/s
+ value.x = toDegrees(manager.gyroData.rotationRate.x);
+ value.y = toDegrees(manager.gyroData.rotationRate.y);
+ value.z = toDegrees(manager.gyroData.rotationRate.z);
+ break;
+
+ case Sensor::Magnetometer:
+ // Magnetic field is given in microteslas
+ value.x = manager.magnetometerData.magneticField.x;
+ value.y = manager.magnetometerData.magneticField.y;
+ value.z = manager.magnetometerData.magneticField.z;
+ break;
+
+ case Sensor::UserAcceleration:
+ // User acceleration is given in G, convert to m/sē
+ value.x = manager.deviceMotion.userAcceleration.x * 9.81f;
+ value.y = manager.deviceMotion.userAcceleration.y * 9.81f;
+ value.z = manager.deviceMotion.userAcceleration.z * 9.81f;
+ break;
+
+ case Sensor::Orientation:
+ // Absolute rotation (Euler) angles are given in radians, convert to degrees
+ value.x = toDegrees(manager.deviceMotion.attitude.yaw);
+ value.y = toDegrees(manager.deviceMotion.attitude.pitch);
+ value.z = toDegrees(manager.deviceMotion.attitude.roll);
+ break;
+
+ default:
+ break;
+ }
+
+ return value;
+}
+
+
+////////////////////////////////////////////////////////////
+void SensorImpl::setEnabled(bool enabled)
+{
+ // Don't do anything if the state is the same
+ if (enabled == m_enabled)
+ return;
+
+ switch (m_sensor)
+ {
+ case Sensor::Accelerometer:
+ if (enabled)
+ [[SFAppDelegate getInstance].motionManager startAccelerometerUpdates];
+ else
+ [[SFAppDelegate getInstance].motionManager stopAccelerometerUpdates];
+ break;
+
+ case Sensor::Gyroscope:
+ if (enabled)
+ [[SFAppDelegate getInstance].motionManager startGyroUpdates];
+ else
+ [[SFAppDelegate getInstance].motionManager stopGyroUpdates];
+ break;
+
+ case Sensor::Magnetometer:
+ if (enabled)
+ [[SFAppDelegate getInstance].motionManager startMagnetometerUpdates];
+ else
+ [[SFAppDelegate getInstance].motionManager stopMagnetometerUpdates];
+ break;
+
+ case Sensor::Gravity:
+ case Sensor::UserAcceleration:
+ case Sensor::Orientation:
+ // these 3 sensors all share the same implementation, so we must disable
+ // it only if the three sensors are disabled
+ if (enabled)
+ {
+ if (deviceMotionEnabledCount == 0)
+ [[SFAppDelegate getInstance].motionManager startDeviceMotionUpdates];
+ deviceMotionEnabledCount++;
+ }
+ else
+ {
+ deviceMotionEnabledCount--;
+ if (deviceMotionEnabledCount == 0)
+ [[SFAppDelegate getInstance].motionManager stopDeviceMotionUpdates];
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ // Update the enable state
+ m_enabled = enabled;
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/iOS/VideoModeImpl.mm b/src/SFML/Window/iOS/VideoModeImpl.mm
new file mode 100644
index 0000000..96adb7b
--- /dev/null
+++ b/src/SFML/Window/iOS/VideoModeImpl.mm
@@ -0,0 +1,58 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/VideoModeImpl.hpp>
+#include <UIKit/UIKit.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+std::vector<VideoMode> VideoModeImpl::getFullscreenModes()
+{
+ VideoMode desktop = getDesktopMode();
+
+ // Return both portrait and landscape resolutions
+ std::vector<VideoMode> modes;
+ modes.push_back(desktop);
+ modes.push_back(VideoMode(desktop.height, desktop.width, desktop.bitsPerPixel));
+ return modes;
+}
+
+
+////////////////////////////////////////////////////////////
+VideoMode VideoModeImpl::getDesktopMode()
+{
+ CGRect bounds = [[UIScreen mainScreen] bounds];
+ return VideoMode(bounds.size.width, bounds.size.height);
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Window/iOS/WindowImplUIKit.hpp b/src/SFML/Window/iOS/WindowImplUIKit.hpp
new file mode 100644
index 0000000..5bb98ed
--- /dev/null
+++ b/src/SFML/Window/iOS/WindowImplUIKit.hpp
@@ -0,0 +1,225 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_WINDOWIMPLUIKIT_HPP
+#define SFML_WINDOWIMPLUIKIT_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/Event.hpp>
+#include <SFML/Window/WindowImpl.hpp>
+#include <SFML/Window/iOS/ObjCType.hpp>
+
+
+SFML_DECLARE_OBJC_CLASS(UIWindow);
+SFML_DECLARE_OBJC_CLASS(SFView);
+SFML_DECLARE_OBJC_CLASS(SFViewController);
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief iOS (UIKit) implementation of WindowImpl
+///
+////////////////////////////////////////////////////////////
+class WindowImplUIKit : public WindowImpl
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Construct the window implementation from an existing control
+ ///
+ /// \param handle Platform-specific handle of the control
+ ///
+ ////////////////////////////////////////////////////////////
+ WindowImplUIKit(WindowHandle handle);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Create the window implementation
+ ///
+ /// \param mode Video mode to use
+ /// \param title Title of the window
+ /// \param style Window style (resizable, fixed, or fullscren)
+ /// \param settings Additional settings for the underlying OpenGL context
+ ///
+ ////////////////////////////////////////////////////////////
+ WindowImplUIKit(VideoMode mode, const String& title, unsigned long style, const ContextSettings& settings);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~WindowImplUIKit();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the OS-specific handle of the window
+ ///
+ /// \return Handle of the window
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual WindowHandle getSystemHandle() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the position of the window
+ ///
+ /// \return Position of the window, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Vector2i getPosition() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the position of the window on screen
+ ///
+ /// \param position New position of the window, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setPosition(const Vector2i& position);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the client size of the window
+ ///
+ /// \return Size of the window, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Vector2u getSize() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the size of the rendering region of the window
+ ///
+ /// \param size New size, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setSize(const Vector2u& size);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the title of the window
+ ///
+ /// \param title New title
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setTitle(const String& title);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the window's icon
+ ///
+ /// \param width Icon's width, in pixels
+ /// \param height Icon's height, in pixels
+ /// \param pixels Pointer to the pixels in memory, format must be RGBA 32 bits
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setIcon(unsigned int width, unsigned int height, const Uint8* pixels);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Show or hide the window
+ ///
+ /// \param visible True to show, false to hide
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setVisible(bool visible);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Show or hide the mouse cursor
+ ///
+ /// \param visible True to show, false to hide
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setMouseCursorVisible(bool visible);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Enable or disable automatic key-repeat
+ ///
+ /// \param enabled True to enable, false to disable
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void setKeyRepeatEnabled(bool enabled);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Request the current window to be made the active
+ /// foreground window
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void requestFocus();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check whether the window has the input focus
+ ///
+ /// \return True if window has focus, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool hasFocus() const;
+
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Notify an event
+ ///
+ /// \param event Event to forward
+ ///
+ ////////////////////////////////////////////////////////////
+ void forwardEvent(Event event);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the window's view
+ ///
+ /// \return Pointer to the window's view
+ ///
+ ////////////////////////////////////////////////////////////
+ SFView* getGlView() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Show or hide the virtual keyboard
+ ///
+ /// \param visible True to show, false to hide
+ ///
+ ////////////////////////////////////////////////////////////
+ void setVirtualKeyboardVisible(bool visible);
+
+protected:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Process incoming events from the operating system
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void processEvents();
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ UIWindow* m_window; ///< Pointer to the internal UIKit window
+ SFView* m_view; ///< OpenGL view of the window
+ SFViewController* m_viewController; ///< Controller attached to the view
+ bool m_hasFocus; ///< Current focus state of the window
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_WINDOWIMPLUIKIT_HPP
diff --git a/src/SFML/Window/iOS/WindowImplUIKit.mm b/src/SFML/Window/iOS/WindowImplUIKit.mm
new file mode 100644
index 0000000..4d401b8
--- /dev/null
+++ b/src/SFML/Window/iOS/WindowImplUIKit.mm
@@ -0,0 +1,219 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/iOS/WindowImplUIKit.hpp>
+#include <SFML/Window/iOS/SFView.hpp>
+#include <SFML/Window/iOS/SFViewController.hpp>
+#include <SFML/Window/iOS/SFAppDelegate.hpp>
+#include <SFML/Window/WindowStyle.hpp>
+#include <SFML/System/Err.hpp>
+#include <UIKit/UIKit.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+WindowImplUIKit::WindowImplUIKit(WindowHandle handle)
+{
+ // Not implemented
+}
+
+
+////////////////////////////////////////////////////////////
+WindowImplUIKit::WindowImplUIKit(VideoMode mode,
+ const String& title,
+ unsigned long style,
+ const ContextSettings& /*settings*/)
+{
+ // Apply the fullscreen flag
+ [UIApplication sharedApplication].statusBarHidden = !(style & Style::Titlebar) || (style & Style::Fullscreen);
+
+ // Set the orientation according to the requested size
+ if (mode.width > mode.height)
+ [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft];
+ else
+ [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait];
+
+ // Create the window
+ CGRect frame = [UIScreen mainScreen].bounds; // Ignore user size, it wouldn't make sense to use something else
+ m_window = [[UIWindow alloc] initWithFrame:frame];
+ m_hasFocus = true;
+
+ // Assign it to the application delegate
+ [SFAppDelegate getInstance].sfWindow = this;
+
+ // Create the view
+ m_view = [[SFView alloc] initWithFrame:frame];
+ [m_view resignFirstResponder];
+
+ // Create the view controller
+ m_viewController = [SFViewController alloc];
+ m_viewController.view = m_view;
+ m_viewController.orientationCanChange = style & Style::Resize;
+ m_window.rootViewController = m_viewController;
+
+ // Make it the current window
+ [m_window makeKeyAndVisible];
+}
+
+
+////////////////////////////////////////////////////////////
+WindowImplUIKit::~WindowImplUIKit()
+{
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplUIKit::processEvents()
+{
+ while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.0001, true) == kCFRunLoopRunHandledSource)
+ ;
+}
+
+
+////////////////////////////////////////////////////////////
+WindowHandle WindowImplUIKit::getSystemHandle() const
+{
+ return (__bridge WindowHandle)m_window;
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2i WindowImplUIKit::getPosition() const
+{
+ return Vector2i(m_window.frame.origin.x, m_window.frame.origin.y);
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplUIKit::setPosition(const Vector2i& position)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+Vector2u WindowImplUIKit::getSize() const
+{
+ return Vector2u(m_window.frame.size.width, m_window.frame.size.height);
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplUIKit::setSize(const Vector2u& size)
+{
+ // @todo ...
+
+ // Set the orientation according to the requested size
+ if (size.x > size.y)
+ [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft];
+ else
+ [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait];
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplUIKit::setTitle(const String& title)
+{
+ // Not applicable
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplUIKit::setIcon(unsigned int width, unsigned int height, const Uint8* pixels)
+{
+ // Not applicable
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplUIKit::setVisible(bool visible)
+{
+ // Not applicable
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplUIKit::setMouseCursorVisible(bool visible)
+{
+ // Not applicable
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplUIKit::setKeyRepeatEnabled(bool enabled)
+{
+ // Not applicable
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplUIKit::requestFocus()
+{
+ // To implement
+}
+
+
+////////////////////////////////////////////////////////////
+bool WindowImplUIKit::hasFocus() const
+{
+ return m_hasFocus;
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplUIKit::forwardEvent(Event event)
+{
+ if (event.type == Event::GainedFocus)
+ m_hasFocus = true;
+ else if (event.type == Event::LostFocus)
+ m_hasFocus = false;
+
+ pushEvent(event);
+}
+
+
+////////////////////////////////////////////////////////////
+SFView* WindowImplUIKit::getGlView() const
+{
+ return m_view;
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplUIKit::setVirtualKeyboardVisible(bool visible)
+{
+ if (visible)
+ [m_view becomeFirstResponder];
+ else
+ [m_view resignFirstResponder];
+}
+
+} // namespace priv
+
+} // namespace sf