summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cowgill <james410@cowgill.org.uk>2015-05-08 21:14:39 +0100
committerJames Cowgill <james410@cowgill.org.uk>2015-05-08 21:14:39 +0100
commitebd1b636e5bf0f8fa6d210690582757e8b47f141 (patch)
tree02dc3aacf1c6f351154432247be0b4347fb14330
parentfa21c65d0c764705cfc377bf0d0de08fac26874e (diff)
Imported Upstream version 2.3+dfsg
-rw-r--r--.editorconfig18
-rw-r--r--.gitattributes7
-rw-r--r--CMakeLists.txt109
-rw-r--r--changelog.txt174
-rw-r--r--cmake/Config.cmake2
-rw-r--r--cmake/Macros.cmake35
-rw-r--r--cmake/Modules/FindEGL.cmake2
-rw-r--r--cmake/Modules/FindFLAC.cmake18
-rw-r--r--cmake/Modules/FindFreetype.cmake158
-rw-r--r--cmake/Modules/FindGLES.cmake2
-rw-r--r--cmake/Modules/FindGLEW.cmake65
-rw-r--r--cmake/Modules/FindSFML.cmake47
-rw-r--r--cmake/Modules/FindSndfile.cmake28
-rw-r--r--cmake/Modules/FindUDev.cmake4
-rw-r--r--cmake/Modules/FindVorbis.cmake24
-rw-r--r--cmake/Modules/FindXCB.cmake97
-rw-r--r--cmake/toolchains/android.toolchain.cmake1832
-rw-r--r--doc/CMakeLists.txt17
-rw-r--r--doc/doxyfile.in2418
-rw-r--r--doc/doxygen.css1415
-rw-r--r--doc/footer.html (renamed from doc/footer.htm)3
-rw-r--r--doc/header.html.in (renamed from doc/header.htm)7
-rw-r--r--doc/mainpage.hpp20
-rw-r--r--examples/X11/CMakeLists.txt2
-rw-r--r--examples/X11/X11.cpp249
-rw-r--r--examples/android/AndroidManifest.xml4
-rw-r--r--examples/android/jni/Application.mk2
-rw-r--r--examples/android/jni/main.cpp2
-rw-r--r--examples/android/project.properties1
-rw-r--r--examples/cocoa/CMakeLists.txt8
-rw-r--r--examples/cocoa/CocoaAppDelegate.h4
-rw-r--r--examples/cocoa/CocoaAppDelegate.mm4
-rw-r--r--examples/cocoa/NSString+stdstring.h4
-rw-r--r--examples/cocoa/NSString+stdstring.mm4
-rw-r--r--examples/cocoa/main.m4
-rw-r--r--examples/cocoa/readme.txt6
-rw-r--r--examples/cocoa/resources/Cocoa-Info.plist2
-rw-r--r--examples/opengl/CMakeLists.txt2
-rw-r--r--examples/opengl/OpenGL.cpp10
-rw-r--r--examples/pong/Pong.cpp4
-rw-r--r--examples/shader/resources/blink.frag2
-rw-r--r--examples/shader/resources/blur.frag8
-rw-r--r--examples/shader/resources/edge.frag10
-rw-r--r--examples/shader/resources/pixelate.frag4
-rw-r--r--examples/shader/resources/storm.vert6
-rw-r--r--examples/shader/resources/wave.vert6
-rw-r--r--examples/sound/Sound.cpp16
-rw-r--r--examples/win32/Win32.cpp4
-rw-r--r--examples/window/CMakeLists.txt2
-rw-r--r--examples/window/Window.cpp4
-rw-r--r--extlibs/Android.mk19
-rw-r--r--extlibs/headers/stb_image/stb_image.h6326
-rw-r--r--extlibs/headers/stb_image/stb_image_write.h (renamed from src/SFML/Graphics/stb_image/stb_image_write.h)393
-rw-r--r--include/SFML/Audio.hpp10
-rw-r--r--include/SFML/Audio/AlResource.hpp70
-rw-r--r--include/SFML/Audio/Export.hpp2
-rw-r--r--include/SFML/Audio/InputSoundFile.hpp (renamed from src/SFML/Audio/SoundFile.hpp)211
-rw-r--r--include/SFML/Audio/Listener.hpp4
-rw-r--r--include/SFML/Audio/Music.hpp33
-rw-r--r--include/SFML/Audio/OutputSoundFile.hpp133
-rw-r--r--include/SFML/Audio/Sound.hpp2
-rw-r--r--include/SFML/Audio/SoundBuffer.hpp49
-rw-r--r--include/SFML/Audio/SoundBufferRecorder.hpp2
-rw-r--r--include/SFML/Audio/SoundFileFactory.hpp197
-rw-r--r--include/SFML/Audio/SoundFileFactory.inl100
-rw-r--r--include/SFML/Audio/SoundFileReader.hpp161
-rw-r--r--include/SFML/Audio/SoundFileWriter.hpp125
-rw-r--r--include/SFML/Audio/SoundRecorder.hpp5
-rw-r--r--include/SFML/Audio/SoundSource.hpp5
-rw-r--r--include/SFML/Audio/SoundStream.hpp2
-rw-r--r--include/SFML/Config.hpp4
-rw-r--r--include/SFML/Graphics.hpp13
-rw-r--r--include/SFML/Graphics/BlendMode.hpp8
-rw-r--r--include/SFML/Graphics/CircleShape.hpp14
-rw-r--r--include/SFML/Graphics/Color.hpp18
-rw-r--r--include/SFML/Graphics/ConvexShape.hpp12
-rw-r--r--include/SFML/Graphics/Drawable.hpp2
-rw-r--r--include/SFML/Graphics/Export.hpp2
-rw-r--r--include/SFML/Graphics/Font.hpp2
-rw-r--r--include/SFML/Graphics/Glyph.hpp2
-rw-r--r--include/SFML/Graphics/Image.hpp4
-rw-r--r--include/SFML/Graphics/PrimitiveType.hpp2
-rw-r--r--include/SFML/Graphics/Rect.hpp2
-rw-r--r--include/SFML/Graphics/Rect.inl2
-rw-r--r--include/SFML/Graphics/RectangleShape.hpp6
-rw-r--r--include/SFML/Graphics/RenderStates.hpp2
-rw-r--r--include/SFML/Graphics/RenderTarget.hpp4
-rw-r--r--include/SFML/Graphics/RenderTexture.hpp2
-rw-r--r--include/SFML/Graphics/RenderWindow.hpp2
-rw-r--r--include/SFML/Graphics/Shader.hpp14
-rw-r--r--include/SFML/Graphics/Shape.hpp19
-rw-r--r--include/SFML/Graphics/Sprite.hpp6
-rw-r--r--include/SFML/Graphics/Text.hpp10
-rw-r--r--include/SFML/Graphics/Texture.hpp14
-rw-r--r--include/SFML/Graphics/Transform.hpp2
-rw-r--r--include/SFML/Graphics/Transformable.hpp6
-rw-r--r--include/SFML/Graphics/Vertex.hpp2
-rw-r--r--include/SFML/Graphics/VertexArray.hpp16
-rw-r--r--include/SFML/Graphics/View.hpp4
-rw-r--r--include/SFML/Main.hpp2
-rw-r--r--include/SFML/Network.hpp4
-rw-r--r--include/SFML/Network/Export.hpp2
-rw-r--r--include/SFML/Network/Ftp.hpp15
-rw-r--r--include/SFML/Network/Http.hpp2
-rw-r--r--include/SFML/Network/IpAddress.hpp2
-rw-r--r--include/SFML/Network/Packet.hpp3
-rw-r--r--include/SFML/Network/Socket.hpp3
-rw-r--r--include/SFML/Network/SocketHandle.hpp2
-rw-r--r--include/SFML/Network/SocketSelector.hpp2
-rw-r--r--include/SFML/Network/TcpListener.hpp2
-rw-r--r--include/SFML/Network/TcpSocket.hpp25
-rw-r--r--include/SFML/Network/UdpSocket.hpp4
-rw-r--r--include/SFML/OpenGL.hpp7
-rw-r--r--include/SFML/System.hpp8
-rw-r--r--include/SFML/System/Clock.hpp2
-rw-r--r--include/SFML/System/Err.hpp2
-rw-r--r--include/SFML/System/Export.hpp2
-rw-r--r--include/SFML/System/FileInputStream.hpp169
-rw-r--r--include/SFML/System/InputStream.hpp15
-rw-r--r--include/SFML/System/Lock.hpp16
-rw-r--r--include/SFML/System/MemoryInputStream.hpp148
-rw-r--r--include/SFML/System/Mutex.hpp4
-rw-r--r--include/SFML/System/NonCopyable.hpp2
-rw-r--r--include/SFML/System/Sleep.hpp2
-rw-r--r--include/SFML/System/String.hpp2
-rw-r--r--include/SFML/System/String.inl2
-rw-r--r--include/SFML/System/Thread.hpp2
-rw-r--r--include/SFML/System/Thread.inl2
-rw-r--r--include/SFML/System/ThreadLocal.hpp2
-rw-r--r--include/SFML/System/ThreadLocalPtr.hpp2
-rw-r--r--include/SFML/System/ThreadLocalPtr.inl2
-rw-r--r--include/SFML/System/Time.hpp2
-rw-r--r--include/SFML/System/Utf.hpp2
-rw-r--r--include/SFML/System/Utf.inl2
-rw-r--r--include/SFML/System/Vector2.hpp2
-rw-r--r--include/SFML/System/Vector2.inl2
-rw-r--r--include/SFML/System/Vector3.hpp2
-rw-r--r--include/SFML/System/Vector3.inl2
-rw-r--r--include/SFML/Window.hpp5
-rw-r--r--include/SFML/Window/Context.hpp13
-rw-r--r--include/SFML/Window/ContextSettings.hpp55
-rw-r--r--include/SFML/Window/Event.hpp53
-rw-r--r--include/SFML/Window/Export.hpp2
-rw-r--r--include/SFML/Window/GlResource.hpp2
-rw-r--r--include/SFML/Window/Joystick.hpp4
-rw-r--r--include/SFML/Window/Keyboard.hpp2
-rw-r--r--include/SFML/Window/Mouse.hpp12
-rw-r--r--include/SFML/Window/Sensor.hpp12
-rw-r--r--include/SFML/Window/Touch.hpp2
-rw-r--r--include/SFML/Window/VideoMode.hpp2
-rw-r--r--include/SFML/Window/Window.hpp2
-rw-r--r--include/SFML/Window/WindowHandle.hpp2
-rw-r--r--include/SFML/Window/WindowStyle.hpp2
-rw-r--r--license.txt7
-rw-r--r--readme.txt13
-rw-r--r--src/SFML/Android.mk4
-rw-r--r--src/SFML/Audio/ALCheck.cpp15
-rw-r--r--src/SFML/Audio/ALCheck.hpp17
-rw-r--r--src/SFML/Audio/AlResource.cpp78
-rw-r--r--src/SFML/Audio/AudioDevice.cpp111
-rw-r--r--src/SFML/Audio/AudioDevice.hpp103
-rw-r--r--src/SFML/Audio/CMakeLists.txt63
-rw-r--r--src/SFML/Audio/InputSoundFile.cpp257
-rw-r--r--src/SFML/Audio/Listener.cpp55
-rw-r--r--src/SFML/Audio/Music.cpp23
-rw-r--r--src/SFML/Audio/OutputSoundFile.cpp92
-rw-r--r--src/SFML/Audio/Sound.cpp2
-rw-r--r--src/SFML/Audio/SoundBuffer.cpp43
-rw-r--r--src/SFML/Audio/SoundBufferRecorder.cpp2
-rw-r--r--src/SFML/Audio/SoundFile.cpp451
-rw-r--r--src/SFML/Audio/SoundFileFactory.cpp147
-rw-r--r--src/SFML/Audio/SoundFileReaderFlac.cpp327
-rw-r--r--src/SFML/Audio/SoundFileReaderFlac.hpp140
-rw-r--r--src/SFML/Audio/SoundFileReaderOgg.cpp179
-rw-r--r--src/SFML/Audio/SoundFileReaderOgg.hpp124
-rw-r--r--src/SFML/Audio/SoundFileReaderWav.cpp285
-rw-r--r--src/SFML/Audio/SoundFileReaderWav.hpp121
-rw-r--r--src/SFML/Audio/SoundFileWriterFlac.cpp133
-rw-r--r--src/SFML/Audio/SoundFileWriterFlac.hpp114
-rw-r--r--src/SFML/Audio/SoundFileWriterOgg.cpp206
-rw-r--r--src/SFML/Audio/SoundFileWriterOgg.hpp122
-rw-r--r--src/SFML/Audio/SoundFileWriterWav.cpp207
-rw-r--r--src/SFML/Audio/SoundFileWriterWav.hpp125
-rw-r--r--src/SFML/Audio/SoundRecorder.cpp4
-rw-r--r--src/SFML/Audio/SoundSource.cpp6
-rw-r--r--src/SFML/Audio/SoundStream.cpp22
-rw-r--r--src/SFML/CMakeLists.txt4
-rw-r--r--src/SFML/Graphics/BlendMode.cpp2
-rw-r--r--src/SFML/Graphics/CMakeLists.txt39
-rw-r--r--src/SFML/Graphics/CircleShape.cpp10
-rw-r--r--src/SFML/Graphics/Color.cpp20
-rw-r--r--src/SFML/Graphics/ConvexShape.cpp14
-rw-r--r--src/SFML/Graphics/Font.cpp2
-rw-r--r--src/SFML/Graphics/GLCheck.cpp2
-rw-r--r--src/SFML/Graphics/GLCheck.hpp2
-rw-r--r--src/SFML/Graphics/GLExtensions.cpp16
-rw-r--r--src/SFML/Graphics/GLExtensions.hpp246
-rw-r--r--src/SFML/Graphics/GLExtensions.txt17
-rw-r--r--src/SFML/Graphics/GLLoader.cpp551
-rw-r--r--src/SFML/Graphics/GLLoader.hpp1050
-rw-r--r--src/SFML/Graphics/Image.cpp2
-rw-r--r--src/SFML/Graphics/ImageLoader.cpp9
-rw-r--r--src/SFML/Graphics/ImageLoader.hpp2
-rw-r--r--src/SFML/Graphics/RectangleShape.cpp6
-rw-r--r--src/SFML/Graphics/RenderStates.cpp2
-rw-r--r--src/SFML/Graphics/RenderTarget.cpp36
-rw-r--r--src/SFML/Graphics/RenderTexture.cpp2
-rw-r--r--src/SFML/Graphics/RenderTextureImpl.cpp2
-rw-r--r--src/SFML/Graphics/RenderTextureImpl.hpp2
-rw-r--r--src/SFML/Graphics/RenderTextureImplDefault.cpp2
-rw-r--r--src/SFML/Graphics/RenderTextureImplDefault.hpp2
-rw-r--r--src/SFML/Graphics/RenderTextureImplFBO.cpp2
-rw-r--r--src/SFML/Graphics/RenderTextureImplFBO.hpp2
-rw-r--r--src/SFML/Graphics/RenderWindow.cpp2
-rw-r--r--src/SFML/Graphics/Shader.cpp160
-rw-r--r--src/SFML/Graphics/Shape.cpp18
-rw-r--r--src/SFML/Graphics/Sprite.cpp2
-rw-r--r--src/SFML/Graphics/Text.cpp4
-rw-r--r--src/SFML/Graphics/Texture.cpp49
-rw-r--r--src/SFML/Graphics/TextureSaver.cpp2
-rw-r--r--src/SFML/Graphics/TextureSaver.hpp2
-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.cpp16
-rw-r--r--src/SFML/Graphics/View.cpp2
-rw-r--r--src/SFML/Graphics/stb_image/stb_image.h4673
-rw-r--r--src/SFML/Main/CMakeLists.txt2
-rw-r--r--src/SFML/Main/MainAndroid.cpp2
-rw-r--r--src/SFML/Main/MainWin32.cpp2
-rw-r--r--src/SFML/Main/MainiOS.mm2
-rw-r--r--src/SFML/Main/SFMLActivity.cpp30
-rw-r--r--src/SFML/Network/Ftp.cpp2
-rw-r--r--src/SFML/Network/Http.cpp3
-rw-r--r--src/SFML/Network/IpAddress.cpp2
-rw-r--r--src/SFML/Network/Packet.cpp3
-rw-r--r--src/SFML/Network/Socket.cpp2
-rw-r--r--src/SFML/Network/SocketImpl.hpp2
-rw-r--r--src/SFML/Network/SocketSelector.cpp2
-rw-r--r--src/SFML/Network/TcpListener.cpp2
-rw-r--r--src/SFML/Network/TcpSocket.cpp51
-rw-r--r--src/SFML/Network/UdpSocket.cpp2
-rw-r--r--src/SFML/Network/Unix/SocketImpl.cpp2
-rw-r--r--src/SFML/Network/Unix/SocketImpl.hpp2
-rw-r--r--src/SFML/Network/Win32/SocketImpl.cpp2
-rw-r--r--src/SFML/Network/Win32/SocketImpl.hpp2
-rw-r--r--src/SFML/System/Android/Activity.cpp2
-rw-r--r--src/SFML/System/CMakeLists.txt4
-rw-r--r--src/SFML/System/Clock.cpp2
-rw-r--r--src/SFML/System/Err.cpp6
-rw-r--r--src/SFML/System/FileInputStream.cpp143
-rw-r--r--src/SFML/System/Lock.cpp2
-rw-r--r--src/SFML/System/MemoryInputStream.cpp101
-rw-r--r--src/SFML/System/Mutex.cpp2
-rw-r--r--src/SFML/System/Sleep.cpp2
-rw-r--r--src/SFML/System/String.cpp2
-rw-r--r--src/SFML/System/Thread.cpp2
-rw-r--r--src/SFML/System/ThreadLocal.cpp2
-rw-r--r--src/SFML/System/Time.cpp2
-rw-r--r--src/SFML/System/Unix/ClockImpl.cpp2
-rw-r--r--src/SFML/System/Unix/ClockImpl.hpp2
-rw-r--r--src/SFML/System/Unix/MutexImpl.cpp2
-rw-r--r--src/SFML/System/Unix/MutexImpl.hpp2
-rw-r--r--src/SFML/System/Unix/SleepImpl.cpp2
-rw-r--r--src/SFML/System/Unix/SleepImpl.hpp2
-rw-r--r--src/SFML/System/Unix/ThreadImpl.cpp2
-rw-r--r--src/SFML/System/Unix/ThreadImpl.hpp2
-rw-r--r--src/SFML/System/Unix/ThreadLocalImpl.cpp2
-rw-r--r--src/SFML/System/Unix/ThreadLocalImpl.hpp2
-rw-r--r--src/SFML/System/Win32/ClockImpl.cpp2
-rw-r--r--src/SFML/System/Win32/ClockImpl.hpp2
-rw-r--r--src/SFML/System/Win32/MutexImpl.cpp2
-rw-r--r--src/SFML/System/Win32/MutexImpl.hpp2
-rw-r--r--src/SFML/System/Win32/SleepImpl.cpp2
-rw-r--r--src/SFML/System/Win32/SleepImpl.hpp2
-rw-r--r--src/SFML/System/Win32/ThreadImpl.cpp2
-rw-r--r--src/SFML/System/Win32/ThreadImpl.hpp2
-rw-r--r--src/SFML/System/Win32/ThreadLocalImpl.cpp2
-rw-r--r--src/SFML/System/Win32/ThreadLocalImpl.hpp2
-rw-r--r--src/SFML/Window/Android/SensorImpl.cpp2
-rw-r--r--src/SFML/Window/Android/SensorImpl.hpp2
-rw-r--r--src/SFML/Window/CMakeLists.txt26
-rw-r--r--src/SFML/Window/Context.cpp9
-rw-r--r--src/SFML/Window/EglContext.cpp50
-rw-r--r--src/SFML/Window/EglContext.hpp2
-rw-r--r--src/SFML/Window/FreeBSD/JoystickImpl.cpp2
-rw-r--r--src/SFML/Window/FreeBSD/JoystickImpl.hpp2
-rw-r--r--src/SFML/Window/GlContext.cpp260
-rw-r--r--src/SFML/Window/GlContext.hpp22
-rw-r--r--src/SFML/Window/GlResource.cpp2
-rw-r--r--src/SFML/Window/InputImpl.hpp2
-rw-r--r--src/SFML/Window/Joystick.cpp2
-rw-r--r--src/SFML/Window/JoystickImpl.hpp2
-rw-r--r--src/SFML/Window/JoystickManager.cpp2
-rw-r--r--src/SFML/Window/JoystickManager.hpp2
-rw-r--r--src/SFML/Window/Keyboard.cpp4
-rw-r--r--src/SFML/Window/Mouse.cpp2
-rw-r--r--src/SFML/Window/OSX/AutoreleasePoolWrapper.h4
-rw-r--r--src/SFML/Window/OSX/AutoreleasePoolWrapper.mm4
-rw-r--r--src/SFML/Window/OSX/HIDInputManager.hpp4
-rw-r--r--src/SFML/Window/OSX/HIDInputManager.mm10
-rw-r--r--src/SFML/Window/OSX/HIDJoystickManager.cpp4
-rw-r--r--src/SFML/Window/OSX/HIDJoystickManager.hpp4
-rw-r--r--src/SFML/Window/OSX/InputImpl.hpp4
-rw-r--r--src/SFML/Window/OSX/InputImpl.mm27
-rw-r--r--src/SFML/Window/OSX/JoystickImpl.cpp9
-rw-r--r--src/SFML/Window/OSX/JoystickImpl.hpp4
-rw-r--r--src/SFML/Window/OSX/SFApplication.h4
-rw-r--r--src/SFML/Window/OSX/SFApplication.m16
-rw-r--r--src/SFML/Window/OSX/SFApplicationDelegate.h4
-rw-r--r--src/SFML/Window/OSX/SFApplicationDelegate.m4
-rw-r--r--src/SFML/Window/OSX/SFContext.hpp14
-rw-r--r--src/SFML/Window/OSX/SFContext.mm55
-rw-r--r--src/SFML/Window/OSX/SFKeyboardModifiersHelper.h4
-rw-r--r--src/SFML/Window/OSX/SFKeyboardModifiersHelper.mm4
-rw-r--r--src/SFML/Window/OSX/SFOpenGLView.h4
-rw-r--r--src/SFML/Window/OSX/SFOpenGLView.mm13
-rw-r--r--src/SFML/Window/OSX/SFSilentResponder.h4
-rw-r--r--src/SFML/Window/OSX/SFSilentResponder.m4
-rw-r--r--src/SFML/Window/OSX/SFViewController.h4
-rw-r--r--src/SFML/Window/OSX/SFViewController.mm4
-rw-r--r--src/SFML/Window/OSX/SFWindow.h6
-rw-r--r--src/SFML/Window/OSX/SFWindow.m12
-rw-r--r--src/SFML/Window/OSX/SFWindowController.h4
-rw-r--r--src/SFML/Window/OSX/SFWindowController.mm4
-rw-r--r--src/SFML/Window/OSX/SensorImpl.cpp2
-rw-r--r--src/SFML/Window/OSX/SensorImpl.hpp2
-rw-r--r--src/SFML/Window/OSX/VideoModeImpl.cpp4
-rw-r--r--src/SFML/Window/OSX/WindowImplCocoa.hpp35
-rw-r--r--src/SFML/Window/OSX/WindowImplCocoa.mm24
-rw-r--r--src/SFML/Window/OSX/WindowImplDelegateProtocol.h4
-rw-r--r--src/SFML/Window/OSX/cg_sf_conversion.cpp4
-rw-r--r--src/SFML/Window/OSX/cg_sf_conversion.hpp4
-rw-r--r--src/SFML/Window/OSX/cpp_objc_conversion.h4
-rw-r--r--src/SFML/Window/OSX/cpp_objc_conversion.mm4
-rw-r--r--src/SFML/Window/Sensor.cpp4
-rw-r--r--src/SFML/Window/SensorImpl.hpp2
-rw-r--r--src/SFML/Window/SensorManager.cpp2
-rw-r--r--src/SFML/Window/SensorManager.hpp6
-rw-r--r--src/SFML/Window/Touch.cpp2
-rw-r--r--src/SFML/Window/Unix/Display.cpp278
-rw-r--r--src/SFML/Window/Unix/Display.hpp79
-rw-r--r--src/SFML/Window/Unix/GlxContext.cpp509
-rw-r--r--src/SFML/Window/Unix/GlxContext.hpp25
-rw-r--r--src/SFML/Window/Unix/GlxExtensions.cpp197
-rw-r--r--src/SFML/Window/Unix/GlxExtensions.hpp203
-rw-r--r--src/SFML/Window/Unix/GlxExtensions.txt11
-rw-r--r--src/SFML/Window/Unix/InputImpl.cpp442
-rw-r--r--src/SFML/Window/Unix/InputImpl.hpp2
-rw-r--r--src/SFML/Window/Unix/JoystickImpl.cpp568
-rw-r--r--src/SFML/Window/Unix/JoystickImpl.hpp7
-rw-r--r--src/SFML/Window/Unix/ScopedXcbPtr.hpp102
-rw-r--r--src/SFML/Window/Unix/ScopedXcbPtr.inl72
-rw-r--r--src/SFML/Window/Unix/SensorImpl.cpp2
-rw-r--r--src/SFML/Window/Unix/SensorImpl.hpp2
-rw-r--r--src/SFML/Window/Unix/VideoModeImpl.cpp262
-rw-r--r--src/SFML/Window/Unix/WindowImplX11.cpp2361
-rw-r--r--src/SFML/Window/Unix/WindowImplX11.hpp135
-rw-r--r--src/SFML/Window/VideoMode.cpp2
-rw-r--r--src/SFML/Window/VideoModeImpl.hpp2
-rw-r--r--src/SFML/Window/Win32/InputImpl.cpp2
-rw-r--r--src/SFML/Window/Win32/InputImpl.hpp2
-rw-r--r--src/SFML/Window/Win32/JoystickImpl.cpp2
-rw-r--r--src/SFML/Window/Win32/JoystickImpl.hpp2
-rw-r--r--src/SFML/Window/Win32/SensorImpl.cpp2
-rw-r--r--src/SFML/Window/Win32/SensorImpl.hpp2
-rw-r--r--src/SFML/Window/Win32/VideoModeImpl.cpp2
-rw-r--r--src/SFML/Window/Win32/WglContext.cpp363
-rw-r--r--src/SFML/Window/Win32/WglContext.hpp24
-rw-r--r--src/SFML/Window/Win32/WglExtensions.cpp198
-rw-r--r--src/SFML/Window/Win32/WglExtensions.hpp206
-rw-r--r--src/SFML/Window/Win32/WglExtensions.txt10
-rw-r--r--src/SFML/Window/Win32/WindowImplWin32.cpp48
-rw-r--r--src/SFML/Window/Win32/WindowImplWin32.hpp2
-rw-r--r--src/SFML/Window/Window.cpp2
-rw-r--r--src/SFML/Window/WindowImpl.cpp2
-rw-r--r--src/SFML/Window/WindowImpl.hpp2
-rw-r--r--src/SFML/Window/glext/glext.h11162
-rw-r--r--src/SFML/Window/glext/wglext.h833
-rw-r--r--src/SFML/Window/iOS/EaglContext.hpp2
-rw-r--r--src/SFML/Window/iOS/EaglContext.mm10
-rw-r--r--src/SFML/Window/iOS/InputImpl.hpp2
-rw-r--r--src/SFML/Window/iOS/InputImpl.mm2
-rw-r--r--src/SFML/Window/iOS/JoystickImpl.hpp2
-rw-r--r--src/SFML/Window/iOS/JoystickImpl.mm2
-rw-r--r--src/SFML/Window/iOS/ObjCType.hpp2
-rw-r--r--src/SFML/Window/iOS/SFAppDelegate.hpp25
-rw-r--r--src/SFML/Window/iOS/SFAppDelegate.mm72
-rw-r--r--src/SFML/Window/iOS/SFMain.hpp2
-rw-r--r--src/SFML/Window/iOS/SFMain.mm2
-rw-r--r--src/SFML/Window/iOS/SFView.hpp4
-rw-r--r--src/SFML/Window/iOS/SFView.mm19
-rw-r--r--src/SFML/Window/iOS/SFViewController.hpp2
-rw-r--r--src/SFML/Window/iOS/SFViewController.mm4
-rw-r--r--src/SFML/Window/iOS/SensorImpl.hpp2
-rw-r--r--src/SFML/Window/iOS/SensorImpl.mm6
-rw-r--r--src/SFML/Window/iOS/VideoModeImpl.mm7
-rw-r--r--src/SFML/Window/iOS/WindowImplUIKit.hpp3
-rw-r--r--src/SFML/Window/iOS/WindowImplUIKit.mm28
-rwxr-xr-xtools/android/compile_libs.sh16
-rwxr-xr-xtools/android/create_toolchains.sh74
-rwxr-xr-xtools/android/download_sources.sh14
-rwxr-xr-xtools/android/make_all.sh12
-rw-r--r--tools/android/patches/remove-so-version-suffix.diff4
404 files changed, 23792 insertions, 21962 deletions
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..3af2b9d
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,18 @@
+# Configuration file for EditorConfig
+# More information is available under http://EditorConfig.org
+
+# Ignore any other files further up in the file system
+root = true
+
+# Configuration for all files
+[*]
+# Enforce Unix style line endings (\n only)
+end_of_line = lf
+# Always end files with a blank line
+insert_final_newline = true
+# Force space characters for indentation
+indent_style = space
+# Always indent by 4 characters
+indent_size = 4
+# Remove whitespace characters at the end of line
+trim_trailing_whitespace = true
diff --git a/.gitattributes b/.gitattributes
index 0db64f4..2f88bea 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,12 +1,13 @@
* text=auto eol=lf
-extlibs/**/* -text -eol
-src/SFML/Graphics/stb_image/**/* -text -eol
+extlibs/**/* -text -eol linguist-vendored
+cmake/toolchains/android.toolchain.cmake -text -eol
*.png -text -eol
*.jpg -text -eol
*.wav -text -eol
*.ogg -text -eol
+*.flac -text -eol
*.tff -text -eol
*.icns -text -eol
-*.rtf -text -eol \ No newline at end of file
+*.rtf -text -eol
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b7a99ee..8ac15c3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.3)
# define a macro that helps defining an option
macro(sfml_set_option var default type docstring)
@@ -8,10 +8,29 @@ macro(sfml_set_option var default type docstring)
set(${var} ${${var}} CACHE ${type} ${docstring} FORCE)
endmacro()
-# set a default build type if none was provided
-# this has to be done before the project() instruction!
+# these options have to be set before CMake detects/configures the toolchain
+
+# determine whether to create a debug or release build
sfml_set_option(CMAKE_BUILD_TYPE Release STRING "Choose the type of build (Debug or Release)")
+# set Android specific options
+
+# define the minimum API level to be used
+sfml_set_option(ANDROID_API_MIN 9 STRING "Choose the Android API level to be used (minimum 9)")
+# mirror the setting for the toolchain file
+set(ANDROID_NATIVE_API_LEVEL ${ANDROID_API_MIN})
+
+# define the path to the Android NDK
+sfml_set_option(ANDROID_NDK "$ENV{ANDROID_NDK}" PATH "Path to the Android NDK")
+
+# define the STL implementation to be used
+sfml_set_option(ANDROID_STL c++_shared STRING "Choose the STL implementation to be used (experimental)")
+
+# default the ABI to ARM v7a for hardware floating point
+if(NOT ANDROID_ABI)
+ set(ANDROID_ABI armeabi-v7a)
+endif()
+
# project name
project(SFML)
@@ -20,7 +39,7 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake)
# setup version numbers
set(VERSION_MAJOR 2)
-set(VERSION_MINOR 2)
+set(VERSION_MINOR 3)
set(VERSION_PATCH 0)
# add the SFML header path
@@ -55,7 +74,7 @@ if(SFML_OS_MACOSX)
# add an option to build frameworks instead of dylibs (release only)
sfml_set_option(SFML_BUILD_FRAMEWORKS FALSE BOOL "TRUE to build SFML as frameworks libraries (release only), FALSE to build according to BUILD_SHARED_LIBS")
- # add an option to let the user specify a custom directory for frameworks installation (SFML, sndfile, ...)
+ # add an option to let the user specify a custom directory for frameworks installation (SFML, FLAC, ...)
sfml_set_option(CMAKE_INSTALL_FRAMEWORK_PREFIX "/Library/Frameworks" STRING "Frameworks installation directory")
# add an option to automatically install Xcode templates
@@ -64,12 +83,18 @@ endif()
# Android options
if(SFML_OS_ANDROID)
- # force usage of the STL port
- set(ANDROID_USE_STLPORT TRUE)
-
# make sure there's the android library available
- if (${ANDROID_NATIVE_API_LEVEL} LESS 9)
- message(FATAL_ERROR "API level must be equal or greater than 9")
+ if (${ANDROID_API_MIN} LESS 9)
+ message(FATAL_ERROR "Android API level must be equal or greater than 9. Please adjust the CMake variable 'ANDROID_API_MIN'.")
+ endif()
+
+ if(NOT ANDROID_NDK)
+ message(FATAL_ERROR "The Android NDK couldn't be found. Please adjust the CMake variable 'ANDROID_NDK' to point to the NDK directory.")
+ endif()
+
+ # CMake doesn't support defining the STL to be used with Nsight Tegra, so warn the user
+ if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android")
+ message(WARNING "CMake might not properly support setting the STL. Make sure to adjust all generated library projects!")
endif()
# install everything in $NDK/sources/ because this path is appended by the NDK (convenient)
@@ -78,10 +103,21 @@ if(SFML_OS_ANDROID)
# we install libs in a subdirectory named after the ABI (lib/mips/*.so)
set(LIB_SUFFIX "/${ANDROID_ABI}")
- # this is a workaround to compile sfml-activity without stlport_shared as dependency
+ # pass shared STL configuration (if any)
+ if (ANDROID_STL MATCHES "_shared")
+ add_definitions("-DSTL_LIBRARY=${ANDROID_STL}")
+ endif()
+
+ # this is a workaround to compile sfml-activity without the stl library as a dependency
# we save the original compilation command line to restore it later in Macro.cmake
- set(CMAKE_CXX_CREATE_SHARED_LIBRARY_WITH_STLPORT ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
- set(CMAKE_CXX_CREATE_SHARED_LIBRARY_WITHOUT_STLPORT "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+ set(CMAKE_CXX_CREATE_SHARED_LIBRARY_WITH_STL ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
+ set(CMAKE_CXX_CREATE_SHARED_LIBRARY_WITHOUT_STL "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+else()
+ unset(ANDROID_ABI CACHE)
+ unset(ANDROID_API_MIN CACHE)
+ unset(ANDROID_STL CACHE)
+ unset(ANDROID_NATIVE_API_LEVEL CACHE)
+ unset(ANDROID_NDK CACHE)
endif()
# define SFML_STATIC if the build type is not set to 'shared'
@@ -227,7 +263,7 @@ else()
POST_BUILD
COMMAND cp -r ${PROJECT_SOURCE_DIR}/include/SFML/* $<TARGET_FILE_DIR:SFML>/Headers)
- # adapt install directory to allow distributing dylibs/frameworks in user’s frameworks/application bundle
+ # adapt install directory to allow distributing dylibs/frameworks in user's frameworks/application bundle
# NOTE: it's not required to link agains SFML.framework
set_target_properties(SFML PROPERTIES
BUILD_WITH_INSTALL_RPATH 1
@@ -267,19 +303,48 @@ if(SFML_OS_WINDOWS)
elseif(SFML_OS_MACOSX)
- # install the non-standard frameworks SFML depends on
- install(DIRECTORY extlibs/libs-osx/Frameworks/sndfile.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX})
- install(DIRECTORY extlibs/libs-osx/Frameworks/freetype.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX})
+ # install extlibs dependencies only when used
+ if("${FLAC_LIBRARY}" STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/FLAC.framework")
+ install(DIRECTORY extlibs/libs-osx/Frameworks/FLAC.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX})
+ endif()
+
+ if("${FREETYPE_LIBRARY}" STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/freetype.framework")
+ install(DIRECTORY extlibs/libs-osx/Frameworks/freetype.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX})
+ endif()
+
+ if("${OGG_LIBRARY}" STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/ogg.framework")
+ install(DIRECTORY extlibs/libs-osx/Frameworks/ogg.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX})
+ endif()
+
+ if("${VORBIS_LIBRARY}" STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/vorbis.framework")
+ install(DIRECTORY extlibs/libs-osx/Frameworks/vorbis.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX})
+ endif()
+
+ if("${VORBISENC_LIBRARY}" STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/vorbisenc.framework")
+ install(DIRECTORY extlibs/libs-osx/Frameworks/vorbisenc.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX})
+ endif()
+
+ if("${VORBISFILE_LIBRARY}" STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/vorbisfile.framework")
+ install(DIRECTORY extlibs/libs-osx/Frameworks/vorbisfile.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX})
+ endif()
+
+ if("${OPENAL_LIBRARY}" STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/OpenAL.framework")
+ install(DIRECTORY "${OPENAL_LIBRARY}" DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX})
+ endif()
# install the Xcode templates if requested
if(SFML_INSTALL_XCODE_TEMPLATES)
- configure_file(
- "tools/xcode/templates/SFML/SFML Compiler.xctemplate/TemplateInfo.plist.in"
- "${CMAKE_CURRENT_BINARY_DIR}/tools/xcode/templates/SFML/SFML Compiler.xctemplate/TemplateInfo.plist"
- @ONLY)
+ # configure the templates plist files
+ foreach(TEMPLATE "SFML Compiler" "SFML App")
+ configure_file(
+ "tools/xcode/templates/SFML/${TEMPLATE}.xctemplate/TemplateInfo.plist.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/tools/xcode/templates/SFML/${TEMPLATE}.xctemplate/TemplateInfo.plist"
+ @ONLY)
+ endforeach()
install(DIRECTORY "tools/xcode/templates/SFML" "${CMAKE_CURRENT_BINARY_DIR}/tools/xcode/templates/SFML"
DESTINATION /Library/Developer/Xcode/Templates
- PATTERN "*.in" EXCLUDE)
+ PATTERN "*.in" EXCLUDE
+ PATTERN ".DS_Store" EXCLUDE)
endif()
elseif(SFML_OS_IOS)
diff --git a/changelog.txt b/changelog.txt
index dc73ee2..b4944c3 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,3 +1,85 @@
+SFML 2.3
+========
+
+Also available on the website: http://www.sfml-dev.org/changelog.php#sfml-2.3
+
+General
+=======
+
+* Examples only link against sfml-main in release mode (#610, #766)
+* Replaced unsigned int with std::size_t for array indices and sizes (#739)
+* Fixed some issues with the Doxygen documentation (#750)
+* Added support for EditorConfig (#751)
+* Hide success message for CMake in quiet mode (#753)
+* Improved documentation for statuses with sf::Ftp (#763)
+* Moved stb_image into the extlibs directory (#795)
+* Changed the SOVERSION to major.minor (#812)
+* Fixed warnings about switch-statements (#863)
+* Added missing includes in the general headers (#851)
+* [Android] Updated toolchain file and dependencies (#791)
+* [Linux] Fixed missing pthread dependency (#794)
+* [OS X] Relaxed CMake installation rules regarding framework dependencies (#767)
+
+Window
+======
+
+Features
+--------
+* Added new events for handling high-precision scrolling (#95, #810, #837)
+* Switched from Xlib to XCB (#200, #319, #694, #780, #813, #825)
+* Added support for OpenGL 3 core context creation (#654, #779)
+
+Bugfixes
+--------
+* Fixed glXSwapIntervalSGI being broken for some driver implementations (#727, #779)
+* Fixed simultaneous context operations causing crashes on some AMD hardware (#778, #779)
+* Fixed joystick identification (#809, #811)
+* [iOS] Fixed various issues including stencil bits, device orientation and retina support (#748)
+* [iOS] Fixed inconsistency between sf::Touch::getPosition and touch events (#875)
+* [Linux] Fixed Alt+F4 not getting triggered in window mode (#274)
+* [Linux] Fixed Unix joystick stuff (#838)
+* [OS X] Fixed typo in JoystickImpl.cpp to prevent a crash (#762, #765)
+* [OS X] Fixed an issue in InputImpl::getSFOpenGLViewFromSFMLWindow (#782, #792)
+
+Graphics
+========
+
+Features
+--------
+* Replaced GLEW with loader generated by glLoadGen (#779)
+* Added a new constructor to sf::Color that takes an sf::Uint32 (#722)
+* Updated stb_image to v2.02 (#777)
+* Updated FreeType to v2.5.5 (#799, #804)
+* Added checks for software OpenGL (#870)
+
+Bugfixes
+--------
+* Fixed GL_ARB_compatibility not being detected (#859)
+* Fixed pixel format selection (#862)
+* Bumped back the OpenGL version requirement to 1.1 (#858)
+
+Audio
+=====
+
+Features
+--------
+* Dropped libsndfile and started using Vorbis, FLAC and OGG directly (#604, #757)
+* Added a FLAC file to the sound example (#815)
+
+Bugfixes
+--------
+* Fixed access violation error in the destructor of sf::AudioDevice (#30, #602)
+* [OS X] Fixed threading issue with sf::SoundStream and OpenAL (#541, #831)
+
+Network
+=======
+
+Bugfixes
+--------
+* Fixed sf::TcpSocket not handling partial sends properly (#749, #796)
+
+
+
SFML 2.2
========
@@ -54,7 +136,7 @@ Features
--------
* Added window methods to request and to check focus (#518, #525, #613, #723, #735)
* Provide name, manufacturer ID and product ID via sf::Joystick (#152, #528)
-* [FreeBDS] Joystick support (#477)
+* [FreeBSD] Joystick support (#477)
* [OS X] Improved integration with menus and dock actions (#11)
* [OS X] Support for OpenGL 3.2 (#84)
* [OS X] Improved fullscreen support (#343)
@@ -162,11 +244,97 @@ Bugfixes
SFML 2.1
========
-Please refer to the release announcement: http://en.sfml-dev.org/forums/index.php?topic=76.msg86454#msg86454
+Also available on the website: http://www.sfml-dev.org/changelog.php#sfml-2.1
+
+General
+=======
+
+* Updated the Window and OpenGL examples (got rid of GLU and immediate mode)
+
+Window
+======
+
+Features
+--------
+* Now using inotify on Linux to avoid constantly polling joystick connections (#96)
+* Add keypad return, equal and period keys support for OS X
+* Improved mouse events on OS X regarding fullscreen mode
+* Improved mouse events on OS X (#213, #277)
+* Improved reactivity of setMousePosition on OS X (#290)
+* Added support for right control key on OS X
+* Improved TextEntered for OS X (#377)
+* Improved the performances of Window::getSize() (the size is now cached)
+* Added the WM_CLASS property to SFML windows on Linux
+* Fake resize events are no longer sent when the window is moved, on Linux
+* Pressing ALT or F10 on Windows no longer steals the focus
+
+Bugfixes
+--------
+* Fixed MouseMove event sometimes not generated when holding left button on Windows (#225)
+* Fixed ContextSettings ignored when creating a 3.x/4.x OpenGL context on Linux (#258)
+* Fixed ContextSettings ignored on Linux when creating a window (#35)
+* Fixed windows bigger than the desktop not appearing on Windows (#215)
+* Fixed KeyRelease events sometimes not reported on Linux (#404)
+* Fixed mouse moved event on OS X when dragging the cursor (#277)
+* Fixed KeyRelease event with CMD key pressed (#381)
+* Fixed taskbar bugs on Windows (#328, #69)
+* Fixed Window::getPosition() on Linux (#346)
+* Unicode characters outside the BMP (> 0xFFFF) are now correctly handled on Windows (#366)
+
+Graphics
+========
+
+Features
+--------
+* Checking errors in RenderTarget::pushGLStates() to avoid generating false error messages when user leaves unchecked OpenGL errors (#340)
+* Optimized Shader::setParameter functions, by using a cache internally (#316, #358)
+
+Bugfixes
+--------
+* Fixed bounding rect of sf::Text ignoring whitespaces (#216)
+* Solved graphics resources not updated or corrupted when loaded in a thread (#411)
+* Fixed white pixel showing on first character of sf::Text (#414)
+* sf::Rect::contains and sf::Rect::intersects now handle rectangles with negative dimensions correctly (#219)
+* Fixed Shape::setTextureRect not working when called before setTexture
+
+Audio
+=====
+
+Features
+--------
+* loadFromStream functions now explicitly reset the stream (seek(0)) before starting to read (#349)
+
+Bugfixes
+--------
+* Added a workaround for a bug in the OS X implementation of OpenAL (unsupported channel count no properly detected) (#201)
+* Fixed SoundBuffer::loadFromStream reading past the end of the stream (#214)
+
+Network
+=======
+
+Features
+--------
+* Replaced the deprecated gethostbyname with getaddrinfo (#47)
+* Minor improvements to sf::Packet operators (now using strlen and wcslen instead of explicit loops) (#118)
+
+Bugfixes
+--------
+* Fixed non-blocking connection with a sf::TcpSocket on Windows
+* Fixed TCP packet data corruption in non-blocking mode (#402, #119)
+* On Unix systems, a socket disconnection no longer stops the program with signal SIGPIPE (#72)
SFML 2.0
========
-Please refer to the release announcement: http://en.sfml-dev.org/forums/index.php?topic=76.msg78424#msg78424
+Also available on the website: http://www.sfml-dev.org/changelog.php#sfml-2.0
+
+No changelog available. Everything changed.
+
+
+
+Older Releases
+==============
+
+See the website for changelogs of older releases: http://www.sfml-dev.org/changelog.php
diff --git a/cmake/Config.cmake b/cmake/Config.cmake
index bb726ba..08c83ef 100644
--- a/cmake/Config.cmake
+++ b/cmake/Config.cmake
@@ -60,7 +60,7 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif()
endif()
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Android")
- set(SFML_OS_ANDROID 1)
+ set(SFML_OS_ANDROID 1)
# use the OpenGL ES implementation on Android
set(OPENGL_ES 1)
diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake
index 49ad2c3..0cf8826 100644
--- a/cmake/Macros.cmake
+++ b/cmake/Macros.cmake
@@ -42,7 +42,7 @@ macro(sfml_add_library target)
# set the version and soversion of the target (for compatible systems -- mostly Linuxes)
# except for Android which strips soversion suffixes
if(NOT SFML_OS_ANDROID)
- set_target_properties(${target} PROPERTIES SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
+ set_target_properties(${target} PROPERTIES SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR})
set_target_properties(${target} PROPERTIES VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
endif()
@@ -81,7 +81,7 @@ macro(sfml_add_library target)
MACOSX_FRAMEWORK_BUNDLE_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
endif()
- # adapt install directory to allow distributing dylibs/frameworks in user’s frameworks/application bundle
+ # adapt install directory to allow distributing dylibs/frameworks in user's frameworks/application bundle
set_target_properties(${target} PROPERTIES
BUILD_WITH_INSTALL_RPATH 1
INSTALL_NAME_DIR "@rpath")
@@ -98,9 +98,9 @@ macro(sfml_add_library target)
if (${target} MATCHES "sfml-activity")
set_target_properties(${target} PROPERTIES COMPILE_FLAGS -fpermissive)
set_target_properties(${target} PROPERTIES LINK_FLAGS "-landroid -llog")
- set(CMAKE_CXX_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY_WITHOUT_STLPORT})
+ set(CMAKE_CXX_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY_WITHOUT_STL})
else()
- set(CMAKE_CXX_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY_WITH_STLPORT})
+ set(CMAKE_CXX_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY_WITH_STL})
endif()
endif()
@@ -130,7 +130,7 @@ macro(sfml_add_example target)
source_group("" FILES ${THIS_SOURCES})
# create the target
- if(THIS_GUI_APP AND SFML_OS_WINDOWS)
+ if(THIS_GUI_APP AND SFML_OS_WINDOWS AND NOT DEFINED CMAKE_CONFIGURATION_TYPES AND ${CMAKE_BUILD_TYPE} STREQUAL "Release")
add_executable(${target} WIN32 ${THIS_SOURCES})
target_link_libraries(${target} sfml-main)
else()
@@ -176,3 +176,28 @@ macro(sfml_add_example target)
endif()
endmacro()
+
+# macro to find packages on the host OS
+# this is the same as in the toolchain file, which is here for Nsight Tegra VS
+# since it won't use the Android toolchain file
+if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android")
+ macro(find_host_package)
+ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
+ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
+ if(CMAKE_HOST_WIN32)
+ set(WIN32 1)
+ set(UNIX)
+ elseif(CMAKE_HOST_APPLE)
+ set(APPLE 1)
+ set(UNIX)
+ endif()
+ find_package(${ARGN})
+ set(WIN32)
+ set(APPLE)
+ set(UNIX 1)
+ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
+ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+ endmacro()
+endif()
diff --git a/cmake/Modules/FindEGL.cmake b/cmake/Modules/FindEGL.cmake
index be9eda0..cde632a 100644
--- a/cmake/Modules/FindEGL.cmake
+++ b/cmake/Modules/FindEGL.cmake
@@ -9,6 +9,6 @@
find_path(EGL_INCLUDE_DIR EGL/egl.h)
find_library(EGL_LIBRARY NAMES EGL)
-
+
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(EGL DEFAULT_MSG EGL_LIBRARY EGL_INCLUDE_DIR)
diff --git a/cmake/Modules/FindFLAC.cmake b/cmake/Modules/FindFLAC.cmake
new file mode 100644
index 0000000..e820cf9
--- /dev/null
+++ b/cmake/Modules/FindFLAC.cmake
@@ -0,0 +1,18 @@
+#
+# Try to find FLAC libraries and include paths.
+# Once done this will define
+#
+# FLAC_FOUND
+# FLAC_INCLUDE_DIR
+# FLAC_LIBRARY
+#
+
+find_path(FLAC_INCLUDE_DIR FLAC/all.h)
+find_path(FLAC_INCLUDE_DIR FLAC/stream_decoder.h)
+
+find_library(FLAC_LIBRARY NAMES FLAC)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(FLAC DEFAULT_MSG FLAC_LIBRARY FLAC_INCLUDE_DIR)
+
+mark_as_advanced(FLAC_INCLUDE_DIR FLAC_LIBRARY)
diff --git a/cmake/Modules/FindFreetype.cmake b/cmake/Modules/FindFreetype.cmake
new file mode 100644
index 0000000..6e3f3f7
--- /dev/null
+++ b/cmake/Modules/FindFreetype.cmake
@@ -0,0 +1,158 @@
+#.rst:
+# FindFreetype
+# ------------
+#
+# Locate FreeType library
+#
+# This module defines
+#
+# ::
+#
+# FREETYPE_LIBRARIES, the library to link against
+# FREETYPE_FOUND, if false, do not try to link to FREETYPE
+# FREETYPE_INCLUDE_DIRS, where to find headers.
+# FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8)
+# This is the concatenation of the paths:
+# FREETYPE_INCLUDE_DIR_ft2build
+# FREETYPE_INCLUDE_DIR_freetype2
+#
+#
+#
+# $FREETYPE_DIR is an environment variable that would correspond to the
+# ./configure --prefix=$FREETYPE_DIR used in building FREETYPE.
+
+#=============================================================================
+# Copyright 2007-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# Created by Eric Wing.
+# Modifications by Alexander Neundorf.
+# This file has been renamed to "FindFreetype.cmake" instead of the correct
+# "FindFreeType.cmake" in order to be compatible with the one from KDE4, Alex.
+
+# Ugh, FreeType seems to use some #include trickery which
+# makes this harder than it should be. It looks like they
+# put ft2build.h in a common/easier-to-find location which
+# then contains a #include to a more specific header in a
+# more specific location (#include <freetype/config/ftheader.h>).
+# Then from there, they need to set a bunch of #define's
+# so you can do something like:
+# #include FT_FREETYPE_H
+# Unfortunately, using CMake's mechanisms like include_directories()
+# wants explicit full paths and this trickery doesn't work too well.
+# I'm going to attempt to cut out the middleman and hope
+# everything still works.
+find_path(
+ FREETYPE_INCLUDE_DIR_ft2build
+ ft2build.h
+ HINTS
+ ENV FREETYPE_DIR
+ PATHS
+ /usr/X11R6
+ /usr/local/X11R6
+ /usr/local/X11
+ /usr/freeware
+ ENV GTKMM_BASEPATH
+ [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
+ PATH_SUFFIXES
+ include/freetype2
+ include
+ freetype2
+)
+
+find_path(
+ FREETYPE_INCLUDE_DIR_freetype2
+ NAMES
+ freetype/config/ftheader.h
+ config/ftheader.h
+ HINTS
+ ENV FREETYPE_DIR
+ PATHS
+ /usr/X11R6
+ /usr/local/X11R6
+ /usr/local/X11
+ /usr/freeware
+ ENV GTKMM_BASEPATH
+ [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
+ PATH_SUFFIXES
+ include/freetype2
+ include
+ freetype2
+)
+
+find_library(FREETYPE_LIBRARY
+ NAMES
+ freetype
+ libfreetype
+ freetype219
+ HINTS
+ ENV FREETYPE_DIR
+ PATHS
+ /usr/X11R6
+ /usr/local/X11R6
+ /usr/local/X11
+ /usr/freeware
+ ENV GTKMM_BASEPATH
+ [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
+ PATH_SUFFIXES
+ lib
+)
+
+# set the user variables
+if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
+ set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
+ list(REMOVE_DUPLICATES FREETYPE_INCLUDE_DIRS)
+endif()
+set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
+
+if(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
+ set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
+elseif(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h")
+ set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h")
+endif()
+
+if(FREETYPE_INCLUDE_DIR_freetype2 AND FREETYPE_H)
+ file(STRINGS "${FREETYPE_H}" freetype_version_str
+ REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
+
+ unset(FREETYPE_VERSION_STRING)
+ foreach(VPART MAJOR MINOR PATCH)
+ foreach(VLINE ${freetype_version_str})
+ if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$")
+ set(FREETYPE_VERSION_PART "${CMAKE_MATCH_1}")
+ if(FREETYPE_VERSION_STRING)
+ set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}")
+ else()
+ set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}")
+ endif()
+ unset(FREETYPE_VERSION_PART)
+ endif()
+ endforeach()
+ endforeach()
+endif()
+
+
+# set FREETYPE_FOUND to TRUE if all listed variables are TRUE
+if(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS AND FREETYPE_VERSION_STRING)
+ set(FREETYPE_FOUND TRUE)
+else()
+ set(FREETYPE_FOUND FALSE)
+endif()
+
+mark_as_advanced(
+ FREETYPE_LIBRARY
+ FREETYPE_INCLUDE_DIR_freetype2
+ FREETYPE_INCLUDE_DIR_ft2build
+)
diff --git a/cmake/Modules/FindGLES.cmake b/cmake/Modules/FindGLES.cmake
index 948e9bf..f34f2cd 100644
--- a/cmake/Modules/FindGLES.cmake
+++ b/cmake/Modules/FindGLES.cmake
@@ -9,6 +9,6 @@
find_path(GLES_INCLUDE_DIR GLES/gl.h)
find_library(GLES_LIBRARY NAMES GLESv1_CM)
-
+
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLES DEFAULT_MSG GLES_LIBRARY GLES_INCLUDE_DIR)
diff --git a/cmake/Modules/FindGLEW.cmake b/cmake/Modules/FindGLEW.cmake
deleted file mode 100644
index 17c3c39..0000000
--- a/cmake/Modules/FindGLEW.cmake
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# Try to find GLEW library and include path.
-# Once done this will define
-#
-# GLEW_FOUND
-# GLEW_INCLUDE_PATH
-# GLEW_LIBRARY
-#
-
-IF (WIN32)
- FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
- $ENV{PROGRAMFILES}/GLEW/include
- ${GLEW_ROOT_DIR}/include
- DOC "The directory where GL/glew.h resides")
-
- IF (NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
- FIND_LIBRARY( GLEW_LIBRARY
- NAMES glew64 glew64s
- PATHS
- $ENV{PROGRAMFILES}/GLEW/lib
- ${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
- ${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
- DOC "The GLEW library (64-bit)"
- )
- ELSE(NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
- FIND_LIBRARY( GLEW_LIBRARY
- NAMES glew GLEW glew32 glew32s
- PATHS
- $ENV{PROGRAMFILES}/GLEW/lib
- ${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
- ${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
- DOC "The GLEW library"
- )
- ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
-ELSE (WIN32)
- FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
- /usr/include
- /usr/local/include
- /sw/include
- /opt/local/include
- ${GLEW_ROOT_DIR}/include
- DOC "The directory where GL/glew.h resides")
-
- FIND_LIBRARY( GLEW_LIBRARY
- NAMES GLEW glew
- PATHS
- /usr/lib64
- /usr/lib
- /usr/local/lib64
- /usr/local/lib
- /sw/lib
- /opt/local/lib
- ${GLEW_ROOT_DIR}/lib
- DOC "The GLEW library")
-ENDIF (WIN32)
-
-SET(GLEW_FOUND "NO")
-IF (GLEW_INCLUDE_PATH AND GLEW_LIBRARY)
- SET(GLEW_LIBRARIES ${GLEW_LIBRARY})
- SET(GLEW_FOUND "YES")
-ENDIF (GLEW_INCLUDE_PATH AND GLEW_LIBRARY)
-
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_LIBRARY GLEW_INCLUDE_PATH)
diff --git a/cmake/Modules/FindSFML.cmake b/cmake/Modules/FindSFML.cmake
index 93e94e5..48873ef 100644
--- a/cmake/Modules/FindSFML.cmake
+++ b/cmake/Modules/FindSFML.cmake
@@ -181,7 +181,7 @@ foreach(FIND_SFML_COMPONENT ${SFML_FIND_COMPONENTS})
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG OR SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
# library found
set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND TRUE)
-
+
# if both are found, set SFML_XXX_LIBRARY to contain both
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY debug ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG}
@@ -240,7 +240,8 @@ if(SFML_STATIC_LIBRARIES)
# macro that searches for a 3rd-party library
macro(find_sfml_dependency output friendlyname)
- find_library(${output} NAMES ${ARGN} PATHS ${FIND_SFML_PATHS} PATH_SUFFIXES lib)
+ # No lookup in environment variables (PATH on Windows), as they may contain wrong library versions
+ find_library(${output} NAMES ${ARGN} PATHS ${FIND_SFML_PATHS} PATH_SUFFIXES lib NO_SYSTEM_ENVIRONMENT_PATH)
if(${${output}} STREQUAL "${output}-NOTFOUND")
unset(output)
set(FIND_SFML_DEPENDENCIES_NOTFOUND "${FIND_SFML_DEPENDENCIES_NOTFOUND} ${friendlyname}")
@@ -256,7 +257,7 @@ if(SFML_STATIC_LIBRARIES)
set(SFML_SYSTEM_DEPENDENCIES "pthread")
endif()
if(FIND_SFML_OS_LINUX)
- set(SFML_SYSTEM_DEPENDENCIES "rt")
+ set(SFML_SYSTEM_DEPENDENCIES ${SFML_SYSTEM_DEPENDENCIES} "rt")
endif()
if(FIND_SFML_OS_WINDOWS)
set(SFML_SYSTEM_DEPENDENCIES "winmm")
@@ -280,22 +281,25 @@ if(SFML_STATIC_LIBRARIES)
if(NOT ${FIND_SFML_WINDOW_COMPONENT} EQUAL -1)
# find libraries
- if(FIND_SFML_OS_LINUX)
+ if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD)
find_sfml_dependency(X11_LIBRARY "X11" X11)
- find_sfml_dependency(XRANDR_LIBRARY "Xrandr" Xrandr)
- find_sfml_dependency(UDEV_LIBRARIES "UDev" udev)
+ find_sfml_dependency(LIBXCB_LIBRARIES "XCB" xcb libxcb)
+ find_sfml_dependency(X11_XCB_LIBRARY "X11-xcb" X11-xcb libX11-xcb)
+ find_sfml_dependency(XCB_RANDR_LIBRARY "xcb-randr" xcb-randr libxcb-randr)
+ find_sfml_dependency(XCB_IMAGE_LIBRARY "xcb-image" xcb-image libxcb-image)
+ endif()
+
+ if(FIND_SFML_OS_LINUX)
+ find_sfml_dependency(UDEV_LIBRARIES "UDev" udev libudev)
endif()
# update the list
if(FIND_SFML_OS_WINDOWS)
set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "opengl32" "winmm" "gdi32")
- elseif(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD)
- set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "GL" ${X11_LIBRARY} ${XRANDR_LIBRARY})
- if(FIND_SFML_OS_FREEBSD)
- set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "usbhid")
- else()
- set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} ${UDEV_LIBRARIES})
- endif()
+ elseif(FIND_SFML_OS_LINUX)
+ set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "GL" ${X11_LIBRARY} ${LIBXCB_LIBRARIES} ${X11_XCB_LIBRARY} ${XCB_RANDR_LIBRARY} ${XCB_IMAGE_LIBRARY} ${UDEV_LIBRARIES})
+ elseif(FIND_SFML_OS_FREEBSD)
+ set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "GL" ${X11_LIBRARY} ${LIBXCB_LIBRARIES} ${X11_XCB_LIBRARY} ${XCB_RANDR_LIBRARY} ${XCB_IMAGE_LIBRARY} "usbhid")
elseif(FIND_SFML_OS_MACOSX)
set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "-framework OpenGL -framework Foundation -framework AppKit -framework IOKit -framework Carbon")
endif()
@@ -305,14 +309,13 @@ if(SFML_STATIC_LIBRARIES)
# sfml-graphics
list(FIND SFML_FIND_COMPONENTS "graphics" FIND_SFML_GRAPHICS_COMPONENT)
if(NOT ${FIND_SFML_GRAPHICS_COMPONENT} EQUAL -1)
-
+
# find libraries
find_sfml_dependency(FREETYPE_LIBRARY "FreeType" freetype)
- find_sfml_dependency(GLEW_LIBRARY "GLEW" glew GLEW glew32 glew32s glew64 glew64s)
find_sfml_dependency(JPEG_LIBRARY "libjpeg" jpeg)
# update the list
- set(SFML_GRAPHICS_DEPENDENCIES ${FREETYPE_LIBRARY} ${GLEW_LIBRARY} ${JPEG_LIBRARY})
+ set(SFML_GRAPHICS_DEPENDENCIES ${FREETYPE_LIBRARY} ${JPEG_LIBRARY})
set(SFML_DEPENDENCIES ${SFML_GRAPHICS_DEPENDENCIES} ${SFML_DEPENDENCIES})
endif()
@@ -322,11 +325,15 @@ if(SFML_STATIC_LIBRARIES)
# find libraries
find_sfml_dependency(OPENAL_LIBRARY "OpenAL" openal openal32)
- find_sfml_dependency(SNDFILE_LIBRARY "libsndfile" sndfile)
+ find_sfml_dependency(OGG_LIBRARY "Ogg" ogg)
+ find_sfml_dependency(VORBIS_LIBRARY "Vorbis" vorbis)
+ find_sfml_dependency(VORBISFILE_LIBRARY "VorbisFile" vorbisfile)
+ find_sfml_dependency(VORBISENC_LIBRARY "VorbisEnc" vorbisenc)
+ find_sfml_dependency(FLAC_LIBRARY "FLAC" flac)
# update the list
- set(SFML_AUDIO_DEPENDENCIES ${OPENAL_LIBRARY} ${SNDFILE_LIBRARY})
- set(SFML_DEPENDENCIES ${SFML_AUDIO_DEPENDENCIES} ${SFML_DEPENDENCIES})
+ set(SFML_AUDIO_DEPENDENCIES ${OPENAL_LIBRARY} ${FLAC_LIBRARY} ${VORBISENC_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY})
+ set(SFML_DEPENDENCIES ${SFML_DEPENDENCIES} ${SFML_AUDIO_DEPENDENCIES})
endif()
endif()
@@ -354,6 +361,6 @@ if (NOT SFML_FOUND)
endif()
# handle success
-if(SFML_FOUND)
+if(SFML_FOUND AND NOT SFML_FIND_QUIETLY)
message(STATUS "Found SFML ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR}.${SFML_VERSION_PATCH} in ${SFML_INCLUDE_DIR}")
endif()
diff --git a/cmake/Modules/FindSndfile.cmake b/cmake/Modules/FindSndfile.cmake
deleted file mode 100644
index ac8a635..0000000
--- a/cmake/Modules/FindSndfile.cmake
+++ /dev/null
@@ -1,28 +0,0 @@
-# - Find sndfile
-# Find the native sndfile includes and libraries
-#
-# SNDFILE_INCLUDE_DIR - where to find sndfile.h, etc.
-# SNDFILE_LIBRARIES - List of libraries when using libsndfile.
-# SNDFILE_FOUND - True if libsndfile found.
-
-if(SNDFILE_INCLUDE_DIR)
- # Already in cache, be silent
- set(SNDFILE_FIND_QUIETLY TRUE)
-endif(SNDFILE_INCLUDE_DIR)
-
-find_path(SNDFILE_INCLUDE_DIR sndfile.h)
-
-find_library(SNDFILE_LIBRARY NAMES sndfile sndfile-1)
-
-# Handle the QUIETLY and REQUIRED arguments and set SNDFILE_FOUND to TRUE if
-# all listed variables are TRUE.
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(SNDFILE DEFAULT_MSG SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR)
-
-if(SNDFILE_FOUND)
- set(SNDFILE_LIBRARIES ${SNDFILE_LIBRARY})
-else(SNDFILE_FOUND)
- set(SNDFILE_LIBRARIES)
-endif(SNDFILE_FOUND)
-
-mark_as_advanced(SNDFILE_INCLUDE_DIR SNDFILE_LIBRARY)
diff --git a/cmake/Modules/FindUDev.cmake b/cmake/Modules/FindUDev.cmake
index e3c6e70..9ae3cf8 100644
--- a/cmake/Modules/FindUDev.cmake
+++ b/cmake/Modules/FindUDev.cmake
@@ -29,9 +29,9 @@ IF (UDEV_LIBRARIES AND UDEV_INCLUDE_DIR)
execute_process(COMMAND pkg-config --atleast-version=143 libudev RESULT_VARIABLE UDEV_STABLE)
# retvale is 0 of the condition is "true" so we need to negate the value...
if (UDEV_STABLE)
- set(UDEV_STABLE 0)
+ set(UDEV_STABLE 0)
else (UDEV_STABLE)
- set(UDEV_STABLE 1)
+ set(UDEV_STABLE 1)
endif (UDEV_STABLE)
message(STATUS "libudev stable: ${UDEV_STABLE}")
ENDIF (UDEV_LIBRARIES AND UDEV_INCLUDE_DIR)
diff --git a/cmake/Modules/FindVorbis.cmake b/cmake/Modules/FindVorbis.cmake
new file mode 100644
index 0000000..645bba7
--- /dev/null
+++ b/cmake/Modules/FindVorbis.cmake
@@ -0,0 +1,24 @@
+#
+# Try to find Ogg/Vorbis libraries and include paths.
+# Once done this will define
+#
+# VORBIS_FOUND
+# VORBIS_INCLUDE_DIRS
+# VORBIS_LIBRARIES
+#
+
+find_path(OGG_INCLUDE_DIR ogg/ogg.h)
+find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
+
+find_library(OGG_LIBRARY NAMES ogg)
+find_library(VORBIS_LIBRARY NAMES vorbis)
+find_library(VORBISFILE_LIBRARY NAMES vorbisfile)
+find_library(VORBISENC_LIBRARY NAMES vorbisenc)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(VORBIS DEFAULT_MSG VORBIS_LIBRARY VORBISFILE_LIBRARY VORBISENC_LIBRARY OGG_LIBRARY VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR)
+
+set(VORBIS_INCLUDE_DIRS ${OGG_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR})
+set(VORBIS_LIBRARIES ${VORBISENC_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY})
+
+mark_as_advanced(OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY VORBISENC_LIBRARY)
diff --git a/cmake/Modules/FindXCB.cmake b/cmake/Modules/FindXCB.cmake
new file mode 100644
index 0000000..d691461
--- /dev/null
+++ b/cmake/Modules/FindXCB.cmake
@@ -0,0 +1,97 @@
+# Try to find libxcb
+#
+#
+# Once done this will define:
+# LIBXCB_FOUND - True if xcb was found
+# LIBXCB_INCLUDE_DIRS - Directories containing the headers
+# LIBXCB_LIBRARIES - List of libraries to link to
+#
+# Also for each requested component:
+# LIBXCB_${UPPER_COMPONENT_NAME}_FOUND
+# LIBXCB_${UPPER_COMPONENT_NAME}_INCLUDE_DIRS
+# LIBXCB_${UPPER_COMPONENT_NAME}_LIBRARIES
+
+include(FindPackageHandleStandardArgs)
+
+IF(NOT WIN32)
+ IF(LIBXCB_LIBRARIES AND LIBXCB_INCLUDE_DIR)
+ set(XCB_FIND_QUIETLY TRUE)
+ ENDIF()
+
+ # Find xcb
+ FIND_PATH(LIBXCB_INCLUDE_DIR xcb/xcb.h)
+ FIND_LIBRARY(LIBXCB_LIBRARY NAMES xcb libxcb)
+
+ # Add xcb info to LIBXCB_LIBRARIES and LIBXCB_INCLUDE_DIRS
+ SET(LIBXCB_LIBRARIES ${LIBXCB_LIBRARY})
+ SET(LIBXCB_INCLUDE_DIRS ${LIBXCB_INCLUDE_DIR})
+
+ find_package_handle_standard_args(LIBXCB DEFAULT_MSG
+ LIBXCB_LIBRARY LIBXCB_INCLUDE_DIR)
+
+ mark_as_advanced(LIBXCB_LIBRARY LIBXCB_INCLUDE_DIR)
+
+ # Check whether we should search for XLIB_XCB
+ set(FIND_XLIB_XCB FALSE)
+ FOREACH(XCB_COMPONENT ${XCB_FIND_COMPONENTS})
+ # Generate upper string of the component name
+ string(TOUPPER ${XCB_COMPONENT} XCB_COMPONENT_UPPER)
+
+ IF(${XCB_COMPONENT_UPPER} MATCHES "XLIB_XCB")
+ set(FIND_XLIB_XCB TRUE)
+ ELSE()
+ # XCB_COMPONENTS is generated to be a copy of XCB_FIND_COMPONENTS
+ # without XLIB_XCB (for later component search)
+ set(XCB_COMPONENTS ${XCB_COMPONENTS} ${XCB_COMPONENT})
+ ENDIF()
+ ENDFOREACH()
+
+ # Find XLIB_XCB if requested
+ IF(FIND_XLIB_XCB)
+ FIND_PATH(XLIB_XCB_INCLUDE_DIR X11/Xlib-xcb.h)
+ FIND_LIBRARY(XLIB_XCB_LIBRARY NAMES X11-xcb libX11-xcb)
+
+ SET(XLIB_XCB_LIBRARIES ${XLIB_XCB_LIBRARY})
+ SET(XLIB_XCB_INCLUDE_DIRS ${XLIB_XCB_INCLUDE_DIR})
+
+ find_package_handle_standard_args(XLIB_XCB DEFAULT_MSG
+ XLIB_XCB_LIBRARY LIBXCB_INCLUDE_DIR)
+
+ mark_as_advanced(XLIB_XCB_LIBRARY XLIB_XCB_INCLUDE_DIR)
+
+ # Add xlib_xcb info to LIBXCB_LIBRARIES and LIBXCB_INCLUDE_DIRS
+ set(LIBXCB_LIBRARIES ${LIBXCB_LIBRARIES} ${XLIB_XCB_LIBRARIES})
+ set(LIBXCB_INCLUDE_DIRS ${LIBXCB_INCLUDE_DIRS} ${XLIB_XCB_INCLUDE_DIR})
+
+ if(NOT XLIB_XCB_FOUND)
+ message(FATAL_ERROR "XlibXcb library not found")
+ endif()
+ ELSE()
+ # Add component name to the component list
+ set(${XCB_COMPONENTS} ${XCB_FIND_COMPONENTS})
+ ENDIF()
+
+ # Loop through requested xcb components (does not contain xlib_xcb)
+ FOREACH(XCB_COMPONENT ${XCB_COMPONENTS})
+ # Generate lower and upper string of the component name
+ string(TOLOWER ${XCB_COMPONENT} XCB_COMPONENT_LOWER)
+ string(TOUPPER ${XCB_COMPONENT} XCB_COMPONENT_UPPER)
+
+ # Find the specific component
+ FIND_LIBRARY(LIBXCB_${XCB_COMPONENT_UPPER}_LIBRARY
+ NAMES libxcb-${XCB_COMPONENT_LOWER} xcb-${XCB_COMPONENT_LOWER})
+
+ find_package_handle_standard_args(LIBXCB_${XCB_COMPONENT_UPPER} DEFAULT_MSG
+ LIBXCB_${XCB_COMPONENT_UPPER}_LIBRARY LIBXCB_INCLUDE_DIR)
+
+ mark_as_advanced(LIBXCB_${XCB_COMPONENT_UPPER}_LIBRARY)
+
+ # Append the component's library path to LIBXCB_LIBRARIES
+ set(LIBXCB_LIBRARIES ${LIBXCB_LIBRARIES} ${LIBXCB_${XCB_COMPONENT_UPPER}_LIBRARY})
+
+ if(NOT LIBXCB_${XCB_COMPONENT_UPPER}_FOUND)
+ message(FATAL_ERROR "xcb-${XCB_COMPONENT_LOWER} not found")
+ endif()
+ ENDFOREACH()
+
+endif()
diff --git a/cmake/toolchains/android.toolchain.cmake b/cmake/toolchains/android.toolchain.cmake
index 0b10971..1eeebe5 100644
--- a/cmake/toolchains/android.toolchain.cmake
+++ b/cmake/toolchains/android.toolchain.cmake
@@ -1,12 +1,37 @@
-# ------------------------------------------------------------------------------
-# Android CMake toolchain file, for use with the Android NDK r9d
-# Requires cmake 2.6.3 or newer (2.8.5 or newer is recommended).
-# See home page: http://code.google.com/p/android-cmake/
+# Copyright (c) 2010-2011, Ethan Rublee
+# Copyright (c) 2011-2014, Andrey Kamaev
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
#
-# The file was forked from the OpenCV project. This version is maintained by
-# the SFML project and can be found at http://github.com/LaurentGomila/SFML
-# (cmake/toolchains/android.toolchain.cmake). It brings support for the
-# latest NDK versions.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its
+# contributors may be used to endorse or promote products derived from this
+# software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# ------------------------------------------------------------------------------
+# Android CMake toolchain file, for use with the Android NDK r5-r10d
+# Requires cmake 2.6.3 or newer (2.8.9 or newer is recommended).
+# See home page: https://github.com/taka-no-me/android-cmake
#
# Usage Linux:
# $ export ANDROID_NDK=/absolute/path/to/the/android-ndk
@@ -14,15 +39,9 @@
# $ cmake -DCMAKE_TOOLCHAIN_FILE=path/to/the/android.toolchain.cmake ..
# $ make -j8
#
-# Usage Linux (using standalone toolchain):
-# $ export ANDROID_STANDALONE_TOOLCHAIN=/absolute/path/to/android-toolchain
-# $ mkdir build && cd build
-# $ cmake -DCMAKE_TOOLCHAIN_FILE=path/to/the/android.toolchain.cmake ..
-# $ make -j8
-#
# Usage Windows:
# You need native port of make to build your project.
-# Android NDK r7 (or newer) already has make.exe on board.
+# Android NDK r7 (and newer) already has make.exe on board.
# For older NDK you have to install it separately.
# For example, this one: http://gnuwin32.sourceforge.net/packages/make.htm
#
@@ -31,58 +50,116 @@
# $ cmake.exe -G"MinGW Makefiles"
# -DCMAKE_TOOLCHAIN_FILE=path\to\the\android.toolchain.cmake
# -DCMAKE_MAKE_PROGRAM="%ANDROID_NDK%\prebuilt\windows\bin\make.exe" ..
-# $ "%ANDROID_NDK%\prebuilt\windows\bin\make.exe"
+# $ cmake.exe --build .
#
#
# Options (can be set as cmake parameters: -D<option_name>=<value>):
# ANDROID_NDK=/opt/android-ndk - path to the NDK root.
# Can be set as environment variable. Can be set only at first cmake run.
#
-# ANDROID_STANDALONE_TOOLCHAIN=/opt/android-toolchain - path to the
-# standalone toolchain. This option is not used if full NDK is found
-# (ignored if ANDROID_NDK is set).
-# Can be set as environment variable. Can be set only at first cmake run.
-#
-# ANDROID_ABI=armeabi-v7a - specifies the target Application Binary
+# ANDROID_ABI=armeabi-v7a - specifies the target Application Binary
# Interface (ABI). This option nearly matches to the APP_ABI variable
# used by ndk-build tool from Android NDK.
#
# Possible targets are:
-# "armeabi" - matches to the NDK ABI with the same name.
-# See ${ANDROID_NDK}/docs/CPU-ARCH-ABIS.html for the documentation.
-# "armeabi-v7a" - matches to the NDK ABI with the same name.
-# See ${ANDROID_NDK}/docs/CPU-ARCH-ABIS.html for the documentation.
+# "armeabi" - ARMv5TE based CPU with software floating point operations
+# "armeabi-v7a" - ARMv7 based devices with hardware FPU instructions
+# this ABI target is used by default
# "armeabi-v7a with NEON" - same as armeabi-v7a, but
# sets NEON as floating-point unit
# "armeabi-v7a with VFPV3" - same as armeabi-v7a, but
-# sets VFPV3 as floating-point unit (has 32 registers instead of 16).
-# "armeabi-v6 with VFP" - tuned for ARMv6 processors having VFP.
-# "x86" - matches to the NDK ABI with the same name.
-# See ${ANDROID_NDK}/docs/CPU-ARCH-ABIS.html for the documentation.
-# "mips" - matches to the NDK ABI with the same name
-# (not testes on real devices)
+# sets VFPV3 as floating-point unit (has 32 registers instead of 16)
+# "armeabi-v6 with VFP" - tuned for ARMv6 processors having VFP
+# "x86" - IA-32 instruction set
+# "mips" - MIPS32 instruction set
+#
+# 64-bit ABIs for NDK r10 and newer:
+# "arm64-v8a" - ARMv8 AArch64 instruction set
+# "x86_64" - Intel64 instruction set (r1)
+# "mips64" - MIPS64 instruction set (r6)
#
-# ANDROID_NATIVE_API_LEVEL=android-9 - level of Android API compile for.
-# Option is read-only when standalone toolchain used.
+# ANDROID_NATIVE_API_LEVEL=android-8 - level of Android API compile for.
+# Option is read-only when standalone toolchain is used.
+# Note: building for "android-L" requires explicit configuration.
#
-# ANDROID_FORCE_ARM_BUILD=OFF - set true to generate 32-bit ARM instructions
-# instead of Thumb-1. Is not available for "x86" (inapplicable) and
-# "armeabi-v6 with VFP" (forced) ABIs.
+# ANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.9 - the name of compiler
+# toolchain to be used. The list of possible values depends on the NDK
+# version. For NDK r10c the possible values are:
#
-# ANDROID_NO_UNDEFINED=ON - set true to show all undefined symbols as linker
+# * aarch64-linux-android-4.9
+# * aarch64-linux-android-clang3.4
+# * aarch64-linux-android-clang3.5
+# * arm-linux-androideabi-4.6
+# * arm-linux-androideabi-4.8
+# * arm-linux-androideabi-4.9 (default)
+# * arm-linux-androideabi-clang3.4
+# * arm-linux-androideabi-clang3.5
+# * mips64el-linux-android-4.9
+# * mips64el-linux-android-clang3.4
+# * mips64el-linux-android-clang3.5
+# * mipsel-linux-android-4.6
+# * mipsel-linux-android-4.8
+# * mipsel-linux-android-4.9
+# * mipsel-linux-android-clang3.4
+# * mipsel-linux-android-clang3.5
+# * x86-4.6
+# * x86-4.8
+# * x86-4.9
+# * x86-clang3.4
+# * x86-clang3.5
+# * x86_64-4.9
+# * x86_64-clang3.4
+# * x86_64-clang3.5
+#
+# ANDROID_FORCE_ARM_BUILD=OFF - set ON to generate 32-bit ARM instructions
+# instead of Thumb. Is not available for "armeabi-v6 with VFP"
+# (is forced to be ON) ABI.
+#
+# ANDROID_NO_UNDEFINED=ON - set ON to show all undefined symbols as linker
# errors even if they are not used.
#
-# ANDROID_SO_UNDEFINED=OFF - set true to allow undefined symbols in shared
-# libraries. Automatically turned on for NDK r5x and r6x due to GLESv2
+# ANDROID_SO_UNDEFINED=OFF - set ON to allow undefined symbols in shared
+# libraries. Automatically turned for NDK r5x and r6x due to GLESv2
# problems.
#
-# LIBRARY_OUTPUT_PATH_ROOT=${CMAKE_SOURCE_DIR} - where to output binary
-# files. See additional details below.
+# ANDROID_STL=gnustl_static - specify the runtime to use.
#
-# ANDROID_SET_OBSOLETE_VARIABLES=ON - it set, then toolchain defines some
-# obsolete variables which were set by previous versions of this file for
-# backward compatibility.
+# Possible values are:
+# none -> Do not configure the runtime.
+# system -> Use the default minimal system C++ runtime library.
+# Implies -fno-rtti -fno-exceptions.
+# Is not available for standalone toolchain.
+# system_re -> Use the default minimal system C++ runtime library.
+# Implies -frtti -fexceptions.
+# Is not available for standalone toolchain.
+# gabi++_static -> Use the GAbi++ runtime as a static library.
+# Implies -frtti -fno-exceptions.
+# Available for NDK r7 and newer.
+# Is not available for standalone toolchain.
+# gabi++_shared -> Use the GAbi++ runtime as a shared library.
+# Implies -frtti -fno-exceptions.
+# Available for NDK r7 and newer.
+# Is not available for standalone toolchain.
+# stlport_static -> Use the STLport runtime as a static library.
+# Implies -fno-rtti -fno-exceptions for NDK before r7.
+# Implies -frtti -fno-exceptions for NDK r7 and newer.
+# Is not available for standalone toolchain.
+# stlport_shared -> Use the STLport runtime as a shared library.
+# Implies -fno-rtti -fno-exceptions for NDK before r7.
+# Implies -frtti -fno-exceptions for NDK r7 and newer.
+# Is not available for standalone toolchain.
+# gnustl_static -> Use the GNU STL as a static library.
+# Implies -frtti -fexceptions.
+# gnustl_shared -> Use the GNU STL as a shared library.
+# Implies -frtti -fno-exceptions.
+# Available for NDK r7b and newer.
+# Silently degrades to gnustl_static if not available.
+# c++_static -> Use libc++ as a static library.
+# c++_shared -> Use libc++ as a shared library.
#
+# ANDROID_STL_FORCE_FEATURES=ON - turn rtti and exceptions support based on
+# chosen runtime. If disabled, then the user is responsible for settings
+# these options.
#
# What?:
# android-cmake toolchain searches for NDK/toolchain in the following order:
@@ -96,108 +173,17 @@
# Make sure to do the following in your scripts:
# SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${my_cxx_flags}" )
# SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${my_cxx_flags}" )
-# The flags will be prepopulated with critical flags, so don't loose them.
-# Also be aware that toolchain also sets configuration-specific compiler
-# flags and linker flags.
+# The flags will be prepopulated with critical flags, so don't loose them.
+# Also be aware that toolchain also sets configuration-specific compiler
+# flags and linker flags.
#
# ANDROID and BUILD_ANDROID will be set to true, you may test any of these
# variables to make necessary Android-specific configuration changes.
#
-# Also ARMEABI or ARMEABI_V7A or X86 will be set true, mutually exclusive.
-# NEON option will be set true if VFP is set to NEON.
-#
-# LIBRARY_OUTPUT_PATH_ROOT should be set in cache to determine where Android
-# libraries will be installed.
-# Default is ${CMAKE_SOURCE_DIR}, and the android libs will always be
-# under the ${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}
-# (depending on the target ABI). This is convenient for Android packaging.
+# Also ARMEABI or ARMEABI_V7A or X86 or MIPS or ARM64_V8A or X86_64 or MIPS64
+# will be set true, mutually exclusive. NEON option will be set true
+# if VFP is set to NEON.
#
-# Authors:
-# Ethan Rublee ethan.ruble@gmail.com
-# Andrey Kamaev andrey.kamaev@itseez.com
-#
-# Contributors:
-# Jonathan De Wachter dewachter.jonathan@gmail.com
-#
-# Change Log:
-# - initial version December 2010
-# - modified April 2011
-# [+] added possibility to build with NDK (without standalone toolchain)
-# [+] support cross-compilation on Windows (native, no cygwin support)
-# [+] added compiler option to force "char" type to be signed
-# [+] added toolchain option to compile to 32-bit ARM instructions
-# [+] added toolchain option to disable SWIG search
-# [+] added platform "armeabi-v7a with VFPV3"
-# [~] ARM_TARGETS renamed to ARM_TARGET
-# [+] EXECUTABLE_OUTPUT_PATH is set by toolchain (required on Windows)
-# [~] Fixed bug with ANDROID_API_LEVEL variable
-# [~] turn off SWIG search if it is not found first time
-# - modified May 2011
-# [~] ANDROID_LEVEL is renamed to ANDROID_API_LEVEL
-# [+] ANDROID_API_LEVEL is detected by toolchain if not specified
-# [~] added guard to prevent changing of output directories on the first
-# cmake pass
-# [~] toolchain exits with error if ARM_TARGET is not recognized
-# - modified June 2011
-# [~] default NDK path is updated for version r5c
-# [+] variable CMAKE_SYSTEM_PROCESSOR is set based on ARM_TARGET
-# [~] toolchain install directory is added to linker paths
-# [-] removed SWIG-related stuff from toolchain
-# [+] added macro find_host_package, find_host_program to search
-# packages/programs on the host system
-# [~] fixed path to STL library
-# - modified July 2011
-# [~] fixed options caching
-# [~] search for all supported NDK versions
-# [~] allowed spaces in NDK path
-# - modified September 2011
-# [~] updated for NDK r6b
-# - modified November 2011
-# [*] rewritten for NDK r7
-# [+] x86 toolchain support (experimental)
-# [+] added "armeabi-v6 with VFP" ABI for ARMv6 processors.
-# [~] improved compiler and linker flags management
-# [+] support different build flags for Release and Debug configurations
-# [~] by default compiler flags the same as used by ndk-build (but only
-# where reasonable)
-# [~] ANDROID_NDK_TOOLCHAIN_ROOT is splitted to ANDROID_STANDALONE_TOOLCHAIN
-# and ANDROID_TOOLCHAIN_ROOT
-# [~] ARM_TARGET is renamed to ANDROID_ABI
-# [~] ARMEABI_NDK_NAME is renamed to ANDROID_NDK_ABI_NAME
-# [~] ANDROID_API_LEVEL is renamed to ANDROID_NATIVE_API_LEVEL
-# - modified January 2012
-# [+] added stlport_static support (experimental)
-# [+] added special check for cygwin
-# [+] filtered out hidden files (starting with .) while globbing inside NDK
-# [+] automatically applied GLESv2 linkage fix for NDK revisions 5-6
-# [+] added ANDROID_GET_ABI_RAWNAME to get NDK ABI names by CMake flags
-# - modified February 2012
-# [+] updated for NDK r7b
-# [~] fixed cmake try_compile() command
-# [~] Fix for missing install_name_tool on OS X
-# - modified March 2012
-# [~] fixed incorrect C compiler flags
-# [~] fixed CMAKE_SYSTEM_PROCESSOR change on ANDROID_ABI change
-# [+] improved toolchain loading speed
-# [+] added assembler language support (.S)
-# [+] allowed preset search paths and extra search suffixes
-# - modified April 2012
-# [+] updated for NDK r7c
-# [~] fixed most of problems with compiler/linker flags and caching
-# [+] added option ANDROID_FUNCTION_LEVEL_LINKING
-# - modified May 2012
-# [+] updated for NDK r8
-# [+] added mips architecture support
-# - modified August 2012
-# [+] updated for NDK r8b
-# [~] all intermediate files generated by toolchain are moved into CMakeFiles
-# [~] libstdc++ and libsupc are removed from explicit link libraries
-# - modified September 2013
-# [+] updated for NDK r9
-# [+] support 64-bits toolchains
-# - modified March 2014
-# [+] updated for NDK r9d and dropped earlier versions
-# [+] replaced stlport with libc++
# ------------------------------------------------------------------------------
cmake_minimum_required( VERSION 2.6.3 )
@@ -207,149 +193,150 @@ if( DEFINED CMAKE_CROSSCOMPILING )
return()
endif()
-get_property(_CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE)
+if( CMAKE_TOOLCHAIN_FILE )
+ # touch toolchain variable to suppress "unused variable" warning
+endif()
+
+# inherit settings in recursive loads
+get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
if( _CMAKE_IN_TRY_COMPILE )
include( "${CMAKE_CURRENT_SOURCE_DIR}/../android.toolchain.config.cmake" OPTIONAL )
endif()
# this one is important
-set( CMAKE_SYSTEM_NAME Linux )
+if( CMAKE_VERSION VERSION_GREATER "3.0.99" )
+ set( CMAKE_SYSTEM_NAME Android )
+else()
+ set( CMAKE_SYSTEM_NAME Linux )
+endif()
+
# this one not so much
set( CMAKE_SYSTEM_VERSION 1 )
-set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r9d "" )
-if(NOT DEFINED ANDROID_NDK_SEARCH_PATHS)
+# rpath makes low sense for Android
+set( CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "" )
+set( CMAKE_SKIP_RPATH TRUE CACHE BOOL "If set, runtime paths are not added when using shared libraries." )
+
+# NDK search paths
+set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r10d -r10c -r10b -r10 -r9d -r9c -r9b -r9 -r8e -r8d -r8c -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
+if( NOT DEFINED ANDROID_NDK_SEARCH_PATHS )
if( CMAKE_HOST_WIN32 )
file( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_NDK_SEARCH_PATHS )
- set( ANDROID_NDK_SEARCH_PATHS "${ANDROID_NDK_SEARCH_PATHS}/android-ndk" "$ENV{SystemDrive}/NVPACK/android-ndk" )
+ set( ANDROID_NDK_SEARCH_PATHS "${ANDROID_NDK_SEARCH_PATHS}" "$ENV{SystemDrive}/NVPACK" )
else()
file( TO_CMAKE_PATH "$ENV{HOME}" ANDROID_NDK_SEARCH_PATHS )
- set( ANDROID_NDK_SEARCH_PATHS /opt/android-ndk "${ANDROID_NDK_SEARCH_PATHS}/NVPACK/android-ndk" )
+ set( ANDROID_NDK_SEARCH_PATHS /opt "${ANDROID_NDK_SEARCH_PATHS}/NVPACK" )
endif()
endif()
-if(NOT DEFINED ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH)
+if( NOT DEFINED ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH )
set( ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH /opt/android-toolchain )
endif()
-set( ANDROID_SUPPORTED_ABIS_arm "armeabi;armeabi-v7a;armeabi-v7a with NEON;armeabi-v7a with VFPV3;armeabi-v6 with VFP" )
+# known ABIs
+set( ANDROID_SUPPORTED_ABIS_arm "armeabi-v7a;armeabi;armeabi-v7a with NEON;armeabi-v7a with VFPV3;armeabi-v6 with VFP" )
+set( ANDROID_SUPPORTED_ABIS_arm64 "arm64-v8a" )
set( ANDROID_SUPPORTED_ABIS_x86 "x86" )
-set( ANDROID_SUPPORTED_ABIS_mipsel "mips" )
+set( ANDROID_SUPPORTED_ABIS_x86_64 "x86_64" )
+set( ANDROID_SUPPORTED_ABIS_mips "mips" )
+set( ANDROID_SUPPORTED_ABIS_mips64 "mips64" )
-set( ANDROID_DEFAULT_NDK_API_LEVEL 9 )
+# API level defaults
+set( ANDROID_DEFAULT_NDK_API_LEVEL 8 )
+set( ANDROID_DEFAULT_NDK_API_LEVEL_arm64 21 )
set( ANDROID_DEFAULT_NDK_API_LEVEL_x86 9 )
+set( ANDROID_DEFAULT_NDK_API_LEVEL_x86_64 21 )
set( ANDROID_DEFAULT_NDK_API_LEVEL_mips 9 )
+set( ANDROID_DEFAULT_NDK_API_LEVEL_mips64 21 )
macro( __LIST_FILTER listvar regex )
- if( ${listvar} )
- foreach( __val ${${listvar}} )
- if( __val MATCHES "${regex}" )
- list( REMOVE_ITEM ${listvar} "${__val}" )
- endif()
- endforeach()
- endif()
+ if( ${listvar} )
+ foreach( __val ${${listvar}} )
+ if( __val MATCHES "${regex}" )
+ list( REMOVE_ITEM ${listvar} "${__val}" )
+ endif()
+ endforeach()
+ endif()
endmacro()
macro( __INIT_VARIABLE var_name )
- set( __test_path 0 )
- foreach( __var ${ARGN} )
- if( __var STREQUAL "PATH" )
- set( __test_path 1 )
- break()
- endif()
- endforeach()
- if( __test_path AND NOT EXISTS "${${var_name}}" )
- unset( ${var_name} CACHE )
- endif()
- if( "${${var_name}}" STREQUAL "" )
- set( __values 0 )
+ set( __test_path 0 )
foreach( __var ${ARGN} )
- if( __var STREQUAL "VALUES" )
- set( __values 1 )
- elseif( NOT __var STREQUAL "PATH" )
- set( __obsolete 0 )
- if( __var MATCHES "^OBSOLETE_.*$" )
- string( REPLACE "OBSOLETE_" "" __var "${__var}" )
- set( __obsolete 1 )
- endif()
- if( __var MATCHES "^ENV_.*$" )
- string( REPLACE "ENV_" "" __var "${__var}" )
- set( __value "$ENV{${__var}}" )
- elseif( DEFINED ${__var} )
- set( __value "${${__var}}" )
- else()
- if( __values )
- set( __value "${__var}" )
- else()
- set( __value "" )
- endif()
- endif()
- if( NOT "${__value}" STREQUAL "" )
- if( __test_path )
- if( EXISTS "${__value}" )
- set( ${var_name} "${__value}" )
- if( __obsolete )
- message( WARNING "Using value of obsolete variable ${__var} as initial value for ${var_name}. Please note, that ${__var} can be completely removed in future versions of the toolchain." )
- endif()
- break()
- endif()
- else()
- set( ${var_name} "${__value}" )
- if( __obsolete )
- message( WARNING "Using value of obsolete variable ${__var} as initial value for ${var_name}. Please note, that ${__var} can be completely removed in future versions of the toolchain." )
- endif()
+ if( __var STREQUAL "PATH" )
+ set( __test_path 1 )
break()
- endif()
endif()
- endif()
endforeach()
- unset( __value )
- unset( __values )
- unset( __obsolete )
- endif()
- unset( __test_path )
+
+ if( __test_path AND NOT EXISTS "${${var_name}}" )
+ unset( ${var_name} CACHE )
+ endif()
+
+ if( " ${${var_name}}" STREQUAL " " )
+ set( __values 0 )
+ foreach( __var ${ARGN} )
+ if( __var STREQUAL "VALUES" )
+ set( __values 1 )
+ elseif( NOT __var STREQUAL "PATH" )
+ if( __var MATCHES "^ENV_.*$" )
+ string( REPLACE "ENV_" "" __var "${__var}" )
+ set( __value "$ENV{${__var}}" )
+ elseif( DEFINED ${__var} )
+ set( __value "${${__var}}" )
+ elseif( __values )
+ set( __value "${__var}" )
+ else()
+ set( __value "" )
+ endif()
+
+ if( NOT " ${__value}" STREQUAL " " AND (NOT __test_path OR EXISTS "${__value}") )
+ set( ${var_name} "${__value}" )
+ break()
+ endif()
+ endif()
+ endforeach()
+ unset( __value )
+ unset( __values )
+ endif()
+
+ if( __test_path )
+ file( TO_CMAKE_PATH "${${var_name}}" ${var_name} )
+ endif()
+ unset( __test_path )
endmacro()
macro( __DETECT_NATIVE_API_LEVEL _var _path )
- SET( __ndkApiLevelRegex "^[\t ]*#define[\t ]+__ANDROID_API__[\t ]+([0-9]+)[\t ]*$" )
- FILE( STRINGS ${_path} __apiFileContent REGEX "${__ndkApiLevelRegex}" )
- if( NOT __apiFileContent )
- message( SEND_ERROR "Could not get Android native API level. Probably you have specified invalid level value, or your copy of NDK/toolchain is broken." )
- endif()
- string( REGEX REPLACE "${__ndkApiLevelRegex}" "\\1" ${_var} "${__apiFileContent}" )
- unset( __apiFileContent )
- unset( __ndkApiLevelRegex )
+ set( __ndkApiLevelRegex "^[\t ]*#define[\t ]+__ANDROID_API__[\t ]+([0-9]+)[\t ]*.*$" )
+ file( STRINGS ${_path} __apiFileContent REGEX "${__ndkApiLevelRegex}" )
+ if( NOT __apiFileContent )
+ message( SEND_ERROR "Could not get Android native API level. Probably you have specified invalid level value, or your copy of NDK/toolchain is broken." )
+ endif()
+ string( REGEX REPLACE "${__ndkApiLevelRegex}" "\\1" ${_var} "${__apiFileContent}" )
+ unset( __apiFileContent )
+ unset( __ndkApiLevelRegex )
endmacro()
macro( __DETECT_TOOLCHAIN_MACHINE_NAME _var _root )
- file( GLOB __gccExePath "${_root}/bin/*-gcc${TOOL_OS_SUFFIX}" )
- __LIST_FILTER( __gccExePath "bin/[.].*-gcc${TOOL_OS_SUFFIX}$" )
- list( LENGTH __gccExePath __gccExePathsCount )
- if( NOT __gccExePathsCount EQUAL 1 )
- message( WARNING "Could not uniquely determine machine name for compiler from ${_root}." )
- set( ${_var} "" )
- else()
- get_filename_component( __gccExeName "${__gccExePath}" NAME_WE )
- string( REPLACE "-gcc" "" ${_var} "${__gccExeName}" )
- endif()
- unset( __gccExePath )
- unset( __gccExePathsCount )
- unset( __gccExeName )
-endmacro()
-
-macro( __COPY_IF_DIFFERENT _source _destination )
- execute_process( COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${_source}" "${_destination}" RESULT_VARIABLE __fileCopyProcess )
- if( NOT __fileCopyProcess EQUAL 0 OR NOT EXISTS "${_destination}")
- message( SEND_ERROR "Failed copying of ${_source} to the ${_destination}" )
- endif()
- unset( __fileCopyProcess )
+ if( EXISTS "${_root}" )
+ file( GLOB __gccExePath RELATIVE "${_root}/bin/" "${_root}/bin/*-gcc${TOOL_OS_SUFFIX}" )
+ __LIST_FILTER( __gccExePath "^[.].*" )
+ list( LENGTH __gccExePath __gccExePathsCount )
+ if( NOT __gccExePathsCount EQUAL 1 AND NOT _CMAKE_IN_TRY_COMPILE )
+ message( WARNING "Could not determine machine name for compiler from ${_root}" )
+ set( ${_var} "" )
+ else()
+ get_filename_component( __gccExeName "${__gccExePath}" NAME_WE )
+ string( REPLACE "-gcc" "" ${_var} "${__gccExeName}" )
+ endif()
+ unset( __gccExePath )
+ unset( __gccExePathsCount )
+ unset( __gccExeName )
+ else()
+ set( ${_var} "" )
+ endif()
endmacro()
-# stl version: by default gnustl_static will be used
-set( ANDROID_USE_STLPORT TRUE CACHE BOOL "Experimental: use stlport_static instead of gnustl_static")
-mark_as_advanced( ANDROID_USE_STLPORT )
-
# fight against cygwin
set( ANDROID_FORBID_SYGWIN TRUE CACHE BOOL "Prevent cmake from working under cygwin and using cygwin tools")
mark_as_advanced( ANDROID_FORBID_SYGWIN )
@@ -367,18 +354,46 @@ if( ANDROID_FORBID_SYGWIN )
endif()
endif()
+
+# detect current host platform
+if( NOT DEFINED ANDROID_NDK_HOST_X64 AND (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64|x86_64|AMD64" OR CMAKE_HOST_APPLE) )
+ set( ANDROID_NDK_HOST_X64 1 CACHE BOOL "Try to use 64-bit compiler toolchain" )
+ mark_as_advanced( ANDROID_NDK_HOST_X64 )
+endif()
+
+set( TOOL_OS_SUFFIX "" )
+if( CMAKE_HOST_APPLE )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME "darwin-x86_64" )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME2 "darwin-x86" )
+elseif( CMAKE_HOST_WIN32 )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME "windows-x86_64" )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME2 "windows" )
+ set( TOOL_OS_SUFFIX ".exe" )
+elseif( CMAKE_HOST_UNIX )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME "linux-x86_64" )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME2 "linux-x86" )
+else()
+ message( FATAL_ERROR "Cross-compilation on your platform is not supported by this cmake toolchain" )
+endif()
+
+if( NOT ANDROID_NDK_HOST_X64 )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} )
+endif()
+
# see if we have path to Android NDK
-__INIT_VARIABLE( ANDROID_NDK PATH ENV_ANDROID_NDK )
+if( NOT ANDROID_NDK AND NOT ANDROID_STANDALONE_TOOLCHAIN )
+ __INIT_VARIABLE( ANDROID_NDK PATH ENV_ANDROID_NDK )
+endif()
if( NOT ANDROID_NDK )
# see if we have path to Android standalone toolchain
- __INIT_VARIABLE( ANDROID_STANDALONE_TOOLCHAIN PATH ENV_ANDROID_STANDALONE_TOOLCHAIN OBSOLETE_ANDROID_NDK_TOOLCHAIN_ROOT OBSOLETE_ENV_ANDROID_NDK_TOOLCHAIN_ROOT )
+ __INIT_VARIABLE( ANDROID_STANDALONE_TOOLCHAIN PATH ENV_ANDROID_STANDALONE_TOOLCHAIN )
if( NOT ANDROID_STANDALONE_TOOLCHAIN )
#try to find Android NDK in one of the the default locations
set( __ndkSearchPaths )
foreach( __ndkSearchPath ${ANDROID_NDK_SEARCH_PATHS} )
foreach( suffix ${ANDROID_SUPPORTED_NDK_VERSIONS} )
- list( APPEND __ndkSearchPaths "${__ndkSearchPath}${suffix}" )
+ list( APPEND __ndkSearchPaths "${__ndkSearchPath}/android-ndk${suffix}" )
endforeach()
endforeach()
__INIT_VARIABLE( ANDROID_NDK PATH VALUES ${__ndkSearchPaths} )
@@ -402,18 +417,18 @@ endif( NOT ANDROID_NDK )
# remember found paths
if( ANDROID_NDK )
get_filename_component( ANDROID_NDK "${ANDROID_NDK}" ABSOLUTE )
- # try to detect change
- if( CMAKE_AR )
- string( LENGTH "${ANDROID_NDK}" __length )
- string( SUBSTRING "${CMAKE_AR}" 0 ${__length} __androidNdkPreviousPath )
- if( NOT __androidNdkPreviousPath STREQUAL ANDROID_NDK )
- message( FATAL_ERROR "It is not possible to change path to the NDK on subsequent run." )
- endif()
- unset( __androidNdkPreviousPath )
- unset( __length )
- endif()
- set( ANDROID_NDK "${ANDROID_NDK}" CACHE INTERNAL "Path of the Android NDK" )
+ set( ANDROID_NDK "${ANDROID_NDK}" CACHE INTERNAL "Path of the Android NDK" FORCE )
set( BUILD_WITH_ANDROID_NDK True )
+ if( EXISTS "${ANDROID_NDK}/RELEASE.TXT" )
+ file( STRINGS "${ANDROID_NDK}/RELEASE.TXT" ANDROID_NDK_RELEASE_FULL LIMIT_COUNT 1 REGEX "r[0-9]+[a-z]?" )
+ string( REGEX MATCH "r([0-9]+)([a-z]?)" ANDROID_NDK_RELEASE "${ANDROID_NDK_RELEASE_FULL}" )
+ else()
+ set( ANDROID_NDK_RELEASE "r1x" )
+ set( ANDROID_NDK_RELEASE_FULL "unreleased" )
+ endif()
+ string( REGEX REPLACE "r([0-9]+)([a-z]?)" "\\1*1000" ANDROID_NDK_RELEASE_NUM "${ANDROID_NDK_RELEASE}" )
+ string( FIND " abcdefghijklmnopqastuvwxyz" "${CMAKE_MATCH_2}" __ndkReleaseLetterNum )
+ math( EXPR ANDROID_NDK_RELEASE_NUM "${ANDROID_NDK_RELEASE_NUM}+${__ndkReleaseLetterNum}" )
elseif( ANDROID_STANDALONE_TOOLCHAIN )
get_filename_component( ANDROID_STANDALONE_TOOLCHAIN "${ANDROID_STANDALONE_TOOLCHAIN}" ABSOLUTE )
# try to detect change
@@ -426,46 +441,65 @@ elseif( ANDROID_STANDALONE_TOOLCHAIN )
unset( __androidStandaloneToolchainPreviousPath )
unset( __length )
endif()
- set( ANDROID_STANDALONE_TOOLCHAIN "${ANDROID_STANDALONE_TOOLCHAIN}" CACHE INTERNAL "Path of the Android standalone toolchain" )
+ set( ANDROID_STANDALONE_TOOLCHAIN "${ANDROID_STANDALONE_TOOLCHAIN}" CACHE INTERNAL "Path of the Android standalone toolchain" FORCE )
set( BUILD_WITH_STANDALONE_TOOLCHAIN True )
else()
list(GET ANDROID_NDK_SEARCH_PATHS 0 ANDROID_NDK_SEARCH_PATH)
- message( FATAL_ERROR "Could not find neither Android NDK nor Android standalone toolcahin.
+ message( FATAL_ERROR "Could not find neither Android NDK nor Android standalone toolchain.
You should either set an environment variable:
export ANDROID_NDK=~/my-android-ndk
or
export ANDROID_STANDALONE_TOOLCHAIN=~/my-android-toolchain
or put the toolchain or NDK in the default path:
- sudo ln -s ~/my-android-ndk ${ANDROID_NDK_SEARCH_PATH}
+ sudo ln -s ~/my-android-ndk ${ANDROID_NDK_SEARCH_PATH}/android-ndk
sudo ln -s ~/my-android-toolchain ${ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH}" )
endif()
-# detect current host platform
-set( ANDROID_NDK_HOST_SYSTEM_ARCH "x86" )
-set( TOOL_OS_SUFFIX "" )
-if( CMAKE_HOST_APPLE )
- set( ANDROID_NDK_HOST_SYSTEM_NAME "darwin-x86" )
- if(NOT EXISTS "${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.6/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}")
- set( ANDROID_NDK_HOST_SYSTEM_NAME "darwin-x86_64" )
- set( ANDROID_NDK_HOST_SYSTEM_ARCH "x64" )
+# android NDK layout
+if( BUILD_WITH_ANDROID_NDK )
+ if( NOT DEFINED ANDROID_NDK_LAYOUT )
+ # try to automatically detect the layout
+ if( EXISTS "${ANDROID_NDK}/RELEASE.TXT")
+ set( ANDROID_NDK_LAYOUT "RELEASE" )
+ elseif( EXISTS "${ANDROID_NDK}/../../linux-x86/toolchain/" )
+ set( ANDROID_NDK_LAYOUT "LINARO" )
+ elseif( EXISTS "${ANDROID_NDK}/../../gcc/" )
+ set( ANDROID_NDK_LAYOUT "ANDROID" )
+ endif()
endif()
-elseif( CMAKE_HOST_WIN32 )
- set( ANDROID_NDK_HOST_SYSTEM_NAME "windows" )
- set( TOOL_OS_SUFFIX ".exe" )
- if(NOT EXISTS "${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.6/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}")
- set( ANDROID_NDK_HOST_SYSTEM_NAME "windows-x86_64" )
- set( ANDROID_NDK_HOST_SYSTEM_ARCH "x64" )
+ set( ANDROID_NDK_LAYOUT "${ANDROID_NDK_LAYOUT}" CACHE STRING "The inner layout of NDK" )
+ mark_as_advanced( ANDROID_NDK_LAYOUT )
+ if( ANDROID_NDK_LAYOUT STREQUAL "LINARO" )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} ) # only 32-bit at the moment
+ set( ANDROID_NDK_TOOLCHAINS_PATH "${ANDROID_NDK}/../../${ANDROID_NDK_HOST_SYSTEM_NAME}/toolchain" )
+ set( ANDROID_NDK_TOOLCHAINS_SUBPATH "" )
+ set( ANDROID_NDK_TOOLCHAINS_SUBPATH2 "" )
+ elseif( ANDROID_NDK_LAYOUT STREQUAL "ANDROID" )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} ) # only 32-bit at the moment
+ set( ANDROID_NDK_TOOLCHAINS_PATH "${ANDROID_NDK}/../../gcc/${ANDROID_NDK_HOST_SYSTEM_NAME}/arm" )
+ set( ANDROID_NDK_TOOLCHAINS_SUBPATH "" )
+ set( ANDROID_NDK_TOOLCHAINS_SUBPATH2 "" )
+ else() # ANDROID_NDK_LAYOUT STREQUAL "RELEASE"
+ set( ANDROID_NDK_TOOLCHAINS_PATH "${ANDROID_NDK}/toolchains" )
+ set( ANDROID_NDK_TOOLCHAINS_SUBPATH "/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
+ set( ANDROID_NDK_TOOLCHAINS_SUBPATH2 "/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME2}" )
endif()
-elseif( CMAKE_HOST_UNIX )
- set( ANDROID_NDK_HOST_SYSTEM_NAME "linux-x86" )
- if(NOT EXISTS "${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.6/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}")
- set( ANDROID_NDK_HOST_SYSTEM_NAME "linux-x86_64" )
- set( ANDROID_NDK_HOST_SYSTEM_ARCH "x64" )
+ get_filename_component( ANDROID_NDK_TOOLCHAINS_PATH "${ANDROID_NDK_TOOLCHAINS_PATH}" ABSOLUTE )
+
+ # try to detect change of NDK
+ if( CMAKE_AR )
+ string( LENGTH "${ANDROID_NDK_TOOLCHAINS_PATH}" __length )
+ string( SUBSTRING "${CMAKE_AR}" 0 ${__length} __androidNdkPreviousPath )
+ if( NOT __androidNdkPreviousPath STREQUAL ANDROID_NDK_TOOLCHAINS_PATH )
+ message( FATAL_ERROR "It is not possible to change the path to the NDK on subsequent CMake run. You must remove all generated files from your build folder first.
+ " )
+ endif()
+ unset( __androidNdkPreviousPath )
+ unset( __length )
endif()
-else()
- message( FATAL_ERROR "Cross-compilation on your platform is not supported by this cmake toolchain" )
endif()
+
# get all the details about standalone toolchain
if( BUILD_WITH_STANDALONE_TOOLCHAIN )
__DETECT_NATIVE_API_LEVEL( ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_STANDALONE_TOOLCHAIN}/sysroot/usr/include/android/api-level.h" )
@@ -475,66 +509,131 @@ if( BUILD_WITH_STANDALONE_TOOLCHAIN )
if( NOT __availableToolchainMachines )
message( FATAL_ERROR "Could not determine machine name of your toolchain. Probably your Android standalone toolchain is broken." )
endif()
- if( __availableToolchainMachines MATCHES i686 )
+ if( __availableToolchainMachines MATCHES x86_64 )
+ set( __availableToolchainArchs "x86_64" )
+ elseif( __availableToolchainMachines MATCHES i686 )
set( __availableToolchainArchs "x86" )
+ elseif( __availableToolchainMachines MATCHES aarch64 )
+ set( __availableToolchainArchs "arm64" )
elseif( __availableToolchainMachines MATCHES arm )
set( __availableToolchainArchs "arm" )
+ elseif( __availableToolchainMachines MATCHES mips64el )
+ set( __availableToolchainArchs "mips64" )
elseif( __availableToolchainMachines MATCHES mipsel )
- set( __availableToolchainArchs "mipsel" )
+ set( __availableToolchainArchs "mips" )
endif()
- if( ANDROID_COMPILER_VERSION )
- # do not run gcc every time because it is relatevely expencive
- set( __availableToolchainCompilerVersions "${ANDROID_COMPILER_VERSION}" )
- else()
- execute_process( COMMAND "${ANDROID_STANDALONE_TOOLCHAIN}/bin/${__availableToolchainMachines}-gcc${TOOL_OS_SUFFIX}" --version
- OUTPUT_VARIABLE __availableToolchainCompilerVersions OUTPUT_STRIP_TRAILING_WHITESPACE )
- string( REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" __availableToolchainCompilerVersions "${__availableToolchainCompilerVersions}" )
+ execute_process( COMMAND "${ANDROID_STANDALONE_TOOLCHAIN}/bin/${__availableToolchainMachines}-gcc${TOOL_OS_SUFFIX}" -dumpversion
+ OUTPUT_VARIABLE __availableToolchainCompilerVersions OUTPUT_STRIP_TRAILING_WHITESPACE )
+ string( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9]+)?" __availableToolchainCompilerVersions "${__availableToolchainCompilerVersions}" )
+ if( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/bin/clang${TOOL_OS_SUFFIX}" )
+ list( APPEND __availableToolchains "standalone-clang" )
+ list( APPEND __availableToolchainMachines ${__availableToolchainMachines} )
+ list( APPEND __availableToolchainArchs ${__availableToolchainArchs} )
+ list( APPEND __availableToolchainCompilerVersions ${__availableToolchainCompilerVersions} )
endif()
endif()
+macro( __GLOB_NDK_TOOLCHAINS __availableToolchainsVar __availableToolchainsLst __toolchain_subpath )
+ foreach( __toolchain ${${__availableToolchainsLst}} )
+ if( "${__toolchain}" MATCHES "-clang3[.][0-9]$" AND NOT EXISTS "${ANDROID_NDK_TOOLCHAINS_PATH}/${__toolchain}${__toolchain_subpath}" )
+ SET( __toolchainVersionRegex "^TOOLCHAIN_VERSION[\t ]+:=[\t ]+(.*)$" )
+ FILE( STRINGS "${ANDROID_NDK_TOOLCHAINS_PATH}/${__toolchain}/setup.mk" __toolchainVersionStr REGEX "${__toolchainVersionRegex}" )
+ if( __toolchainVersionStr )
+ string( REGEX REPLACE "${__toolchainVersionRegex}" "\\1" __toolchainVersionStr "${__toolchainVersionStr}" )
+ string( REGEX REPLACE "-clang3[.][0-9]$" "-${__toolchainVersionStr}" __gcc_toolchain "${__toolchain}" )
+ else()
+ string( REGEX REPLACE "-clang3[.][0-9]$" "-4.6" __gcc_toolchain "${__toolchain}" )
+ endif()
+ unset( __toolchainVersionStr )
+ unset( __toolchainVersionRegex )
+ else()
+ set( __gcc_toolchain "${__toolchain}" )
+ endif()
+ __DETECT_TOOLCHAIN_MACHINE_NAME( __machine "${ANDROID_NDK_TOOLCHAINS_PATH}/${__gcc_toolchain}${__toolchain_subpath}" )
+ if( __machine )
+ string( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9x]+)?$" __version "${__gcc_toolchain}" )
+ if( __machine MATCHES x86_64 )
+ set( __arch "x86_64" )
+ elseif( __machine MATCHES i686 )
+ set( __arch "x86" )
+ elseif( __machine MATCHES aarch64 )
+ set( __arch "arm64" )
+ elseif( __machine MATCHES arm )
+ set( __arch "arm" )
+ elseif( __machine MATCHES mips64el )
+ set( __arch "mips64" )
+ elseif( __machine MATCHES mipsel )
+ set( __arch "mips" )
+ else()
+ set( __arch "" )
+ endif()
+ #message("machine: !${__machine}!\narch: !${__arch}!\nversion: !${__version}!\ntoolchain: !${__toolchain}!\n")
+ if (__arch)
+ list( APPEND __availableToolchainMachines "${__machine}" )
+ list( APPEND __availableToolchainArchs "${__arch}" )
+ list( APPEND __availableToolchainCompilerVersions "${__version}" )
+ list( APPEND ${__availableToolchainsVar} "${__toolchain}" )
+ endif()
+ endif()
+ unset( __gcc_toolchain )
+ endforeach()
+endmacro()
+
# get all the details about NDK
if( BUILD_WITH_ANDROID_NDK )
file( GLOB ANDROID_SUPPORTED_NATIVE_API_LEVELS RELATIVE "${ANDROID_NDK}/platforms" "${ANDROID_NDK}/platforms/android-*" )
string( REPLACE "android-" "" ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_SUPPORTED_NATIVE_API_LEVELS}" )
- file( GLOB __availableToolchains RELATIVE "${ANDROID_NDK}/toolchains" "${ANDROID_NDK}/toolchains/*" )
- __LIST_FILTER( __availableToolchains "^[.]" )
+ set( __availableToolchains "" )
set( __availableToolchainMachines "" )
set( __availableToolchainArchs "" )
set( __availableToolchainCompilerVersions "" )
- foreach( __toolchain ${__availableToolchains} )
- __DETECT_TOOLCHAIN_MACHINE_NAME( __machine "${ANDROID_NDK}/toolchains/${__toolchain}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
- if( __machine )
- string( REGEX MATCH "[0-9]+[.][0-9]+[.]*[0-9]*$" __version "${__toolchain}" )
- string( REGEX MATCH "^[^-]+" __arch "${__toolchain}" )
- list( APPEND __availableToolchainMachines "${__machine}" )
- list( APPEND __availableToolchainArchs "${__arch}" )
- list( APPEND __availableToolchainCompilerVersions "${__version}" )
- else()
- list( REMOVE_ITEM __availableToolchains "${__toolchain}" )
+ if( ANDROID_TOOLCHAIN_NAME AND EXISTS "${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_TOOLCHAIN_NAME}/" )
+ # do not go through all toolchains if we know the name
+ set( __availableToolchainsLst "${ANDROID_TOOLCHAIN_NAME}" )
+ __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst "${ANDROID_NDK_TOOLCHAINS_SUBPATH}" )
+ if( NOT __availableToolchains AND NOT ANDROID_NDK_TOOLCHAINS_SUBPATH STREQUAL ANDROID_NDK_TOOLCHAINS_SUBPATH2 )
+ __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst "${ANDROID_NDK_TOOLCHAINS_SUBPATH2}" )
+ if( __availableToolchains )
+ set( ANDROID_NDK_TOOLCHAINS_SUBPATH ${ANDROID_NDK_TOOLCHAINS_SUBPATH2} )
+ endif()
endif()
- endforeach()
+ endif()
+ if( NOT __availableToolchains )
+ file( GLOB __availableToolchainsLst RELATIVE "${ANDROID_NDK_TOOLCHAINS_PATH}" "${ANDROID_NDK_TOOLCHAINS_PATH}/*" )
+ if( __availableToolchains )
+ list(SORT __availableToolchainsLst) # we need clang to go after gcc
+ endif()
+ __LIST_FILTER( __availableToolchainsLst "^[.]" )
+ __LIST_FILTER( __availableToolchainsLst "llvm" )
+ __LIST_FILTER( __availableToolchainsLst "renderscript" )
+ __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst "${ANDROID_NDK_TOOLCHAINS_SUBPATH}" )
+ if( NOT __availableToolchains AND NOT ANDROID_NDK_TOOLCHAINS_SUBPATH STREQUAL ANDROID_NDK_TOOLCHAINS_SUBPATH2 )
+ __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst "${ANDROID_NDK_TOOLCHAINS_SUBPATH2}" )
+ if( __availableToolchains )
+ set( ANDROID_NDK_TOOLCHAINS_SUBPATH ${ANDROID_NDK_TOOLCHAINS_SUBPATH2} )
+ endif()
+ endif()
+ endif()
if( NOT __availableToolchains )
- message( FATAL_ERROR "Could not any working toolchain in the NDK. Probably your Android NDK is broken." )
+ message( FATAL_ERROR "Could not find any working toolchain in the NDK. Probably your Android NDK is broken." )
endif()
endif()
# build list of available ABIs
+set( ANDROID_SUPPORTED_ABIS "" )
+set( __uniqToolchainArchNames ${__availableToolchainArchs} )
+list( REMOVE_DUPLICATES __uniqToolchainArchNames )
+list( SORT __uniqToolchainArchNames )
+foreach( __arch ${__uniqToolchainArchNames} )
+ list( APPEND ANDROID_SUPPORTED_ABIS ${ANDROID_SUPPORTED_ABIS_${__arch}} )
+endforeach()
+unset( __uniqToolchainArchNames )
if( NOT ANDROID_SUPPORTED_ABIS )
- set( ANDROID_SUPPORTED_ABIS "" )
- set( __uniqToolchainArchNames ${__availableToolchainArchs} )
- list( REMOVE_DUPLICATES __uniqToolchainArchNames )
- list( SORT __uniqToolchainArchNames )
- foreach( __arch ${__uniqToolchainArchNames} )
- list( APPEND ANDROID_SUPPORTED_ABIS ${ANDROID_SUPPORTED_ABIS_${__arch}} )
- endforeach()
- unset( __uniqToolchainArchNames )
- if( NOT ANDROID_SUPPORTED_ABIS )
- message( FATAL_ERROR "No one of known Android ABIs is supported by this cmake toolchain." )
- endif()
+ message( FATAL_ERROR "No one of known Android ABIs is supported by this cmake toolchain." )
endif()
# choose target ABI
-__INIT_VARIABLE( ANDROID_ABI OBSOLETE_ARM_TARGET OBSOLETE_ARM_TARGETS VALUES ${ANDROID_SUPPORTED_ABIS} )
+__INIT_VARIABLE( ANDROID_ABI VALUES ${ANDROID_SUPPORTED_ABIS} )
# verify that target ABI is supported
list( FIND ANDROID_SUPPORTED_ABIS "${ANDROID_ABI}" __androidAbiIdx )
if( __androidAbiIdx EQUAL -1 )
@@ -545,33 +644,51 @@ if( __androidAbiIdx EQUAL -1 )
endif()
unset( __androidAbiIdx )
-# remember target ABI
-set( ANDROID_ABI "${ANDROID_ABI}" CACHE STRING "The target ABI for Android. If arm, then armeabi-v7a is recommended for hardware floating point." FORCE )
-
# set target ABI options
if( ANDROID_ABI STREQUAL "x86" )
set( X86 true )
set( ANDROID_NDK_ABI_NAME "x86" )
set( ANDROID_ARCH_NAME "x86" )
- set( ANDROID_ARCH_FULLNAME "x86" )
+ set( ANDROID_LLVM_TRIPLE "i686-none-linux-android" )
set( CMAKE_SYSTEM_PROCESSOR "i686" )
+elseif( ANDROID_ABI STREQUAL "x86_64" )
+ set( X86 true )
+ set( X86_64 true )
+ set( ANDROID_NDK_ABI_NAME "x86_64" )
+ set( ANDROID_ARCH_NAME "x86_64" )
+ set( CMAKE_SYSTEM_PROCESSOR "x86_64" )
+ set( ANDROID_LLVM_TRIPLE "x86_64-none-linux-android" )
+elseif( ANDROID_ABI STREQUAL "mips64" )
+ set( MIPS64 true )
+ set( ANDROID_NDK_ABI_NAME "mips64" )
+ set( ANDROID_ARCH_NAME "mips64" )
+ set( ANDROID_LLVM_TRIPLE "mips64el-none-linux-android" )
+ set( CMAKE_SYSTEM_PROCESSOR "mips64" )
elseif( ANDROID_ABI STREQUAL "mips" )
set( MIPS true )
set( ANDROID_NDK_ABI_NAME "mips" )
set( ANDROID_ARCH_NAME "mips" )
- set( ANDROID_ARCH_FULLNAME "mipsel" )
+ set( ANDROID_LLVM_TRIPLE "mipsel-none-linux-android" )
set( CMAKE_SYSTEM_PROCESSOR "mips" )
+elseif( ANDROID_ABI STREQUAL "arm64-v8a" )
+ set( ARM64_V8A true )
+ set( ANDROID_NDK_ABI_NAME "arm64-v8a" )
+ set( ANDROID_ARCH_NAME "arm64" )
+ set( ANDROID_LLVM_TRIPLE "aarch64-none-linux-android" )
+ set( CMAKE_SYSTEM_PROCESSOR "aarch64" )
+ set( VFPV3 true )
+ set( NEON true )
elseif( ANDROID_ABI STREQUAL "armeabi" )
set( ARMEABI true )
set( ANDROID_NDK_ABI_NAME "armeabi" )
set( ANDROID_ARCH_NAME "arm" )
- set( ANDROID_ARCH_FULLNAME "arm" )
+ set( ANDROID_LLVM_TRIPLE "armv5te-none-linux-androideabi" )
set( CMAKE_SYSTEM_PROCESSOR "armv5te" )
elseif( ANDROID_ABI STREQUAL "armeabi-v6 with VFP" )
set( ARMEABI_V6 true )
set( ANDROID_NDK_ABI_NAME "armeabi" )
set( ANDROID_ARCH_NAME "arm" )
- set( ANDROID_ARCH_FULLNAME "arm" )
+ set( ANDROID_LLVM_TRIPLE "armv5te-none-linux-androideabi" )
set( CMAKE_SYSTEM_PROCESSOR "armv6" )
# need always fallback to older platform
set( ARMEABI true )
@@ -579,20 +696,20 @@ elseif( ANDROID_ABI STREQUAL "armeabi-v7a")
set( ARMEABI_V7A true )
set( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
set( ANDROID_ARCH_NAME "arm" )
- set( ANDROID_ARCH_FULLNAME "arm" )
+ set( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" )
set( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
elseif( ANDROID_ABI STREQUAL "armeabi-v7a with VFPV3" )
set( ARMEABI_V7A true )
set( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
set( ANDROID_ARCH_NAME "arm" )
- set( ANDROID_ARCH_FULLNAME "arm" )
+ set( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" )
set( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
set( VFPV3 true )
elseif( ANDROID_ABI STREQUAL "armeabi-v7a with NEON" )
set( ARMEABI_V7A true )
set( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
set( ANDROID_ARCH_NAME "arm" )
- set( ANDROID_ARCH_FULLNAME "arm" )
+ set( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" )
set( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
set( VFPV3 true )
set( NEON true )
@@ -606,14 +723,8 @@ if( CMAKE_BINARY_DIR AND EXISTS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMa
file( APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake" "SET(CMAKE_SYSTEM_PROCESSOR \"${CMAKE_SYSTEM_PROCESSOR}\")\n" )
endif()
-set( ANDROID_SUPPORTED_ABIS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME}} CACHE INTERNAL "ANDROID_ABI can be changed only to one of these ABIs. Changing to any other ABI requires to reset cmake cache." )
-if( CMAKE_VERSION VERSION_GREATER "2.8" )
- list( SORT ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME} )
- set_property( CACHE ANDROID_ABI PROPERTY STRINGS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME}} )
-endif()
-
if( ANDROID_ARCH_NAME STREQUAL "arm" AND NOT ARMEABI_V6 )
- __INIT_VARIABLE( ANDROID_FORCE_ARM_BUILD OBSOLETE_FORCE_ARM VALUES OFF )
+ __INIT_VARIABLE( ANDROID_FORCE_ARM_BUILD VALUES OFF )
set( ANDROID_FORCE_ARM_BUILD ${ANDROID_FORCE_ARM_BUILD} CACHE BOOL "Use 32-bit ARM instructions instead of Thumb-1" FORCE )
mark_as_advanced( ANDROID_FORCE_ARM_BUILD )
else()
@@ -624,11 +735,15 @@ endif()
if( ANDROID_TOOLCHAIN_NAME )
list( FIND __availableToolchains "${ANDROID_TOOLCHAIN_NAME}" __toolchainIdx )
if( __toolchainIdx EQUAL -1 )
- message( FATAL_ERROR "Previously selected toolchain \"${ANDROID_TOOLCHAIN_NAME}\" is missing. You need to remove CMakeCache.txt and rerun cmake manually to change the toolchain" )
+ list( SORT __availableToolchains )
+ string( REPLACE ";" "\n * " toolchains_list "${__availableToolchains}" )
+ set( toolchains_list " * ${toolchains_list}")
+ message( FATAL_ERROR "Specified toolchain \"${ANDROID_TOOLCHAIN_NAME}\" is missing in your NDK or broken. Please verify that your NDK is working or select another compiler toolchain.
+To configure the toolchain set CMake variable ANDROID_TOOLCHAIN_NAME to one of the following values:\n${toolchains_list}\n" )
endif()
list( GET __availableToolchainArchs ${__toolchainIdx} __toolchainArch )
- if( NOT __toolchainArch STREQUAL ANDROID_ARCH_FULLNAME )
- message( SEND_ERROR "Previously selected toolchain \"${ANDROID_TOOLCHAIN_NAME}\" is not able to compile binaries for the \"${ANDROID_ARCH_NAME}\" platform." )
+ if( NOT __toolchainArch STREQUAL ANDROID_ARCH_NAME )
+ message( SEND_ERROR "Selected toolchain \"${ANDROID_TOOLCHAIN_NAME}\" is not able to compile binaries for the \"${ANDROID_ARCH_NAME}\" platform." )
endif()
else()
set( __toolchainIdx -1 )
@@ -638,8 +753,9 @@ else()
math( EXPR __availableToolchainsCount "${__availableToolchainsCount}-1" )
foreach( __idx RANGE ${__availableToolchainsCount} )
list( GET __availableToolchainArchs ${__idx} __toolchainArch )
- if( __toolchainArch STREQUAL ANDROID_ARCH_FULLNAME )
+ if( __toolchainArch STREQUAL ANDROID_ARCH_NAME )
list( GET __availableToolchainCompilerVersions ${__idx} __toolchainVersion )
+ string( REPLACE "x" "99" __toolchainVersion "${__toolchainVersion}")
if( __toolchainVersion VERSION_GREATER __toolchainMaxVersion )
set( __toolchainMaxVersion "${__toolchainVersion}" )
set( __toolchainIdx ${__idx} )
@@ -657,8 +773,7 @@ endif()
list( GET __availableToolchains ${__toolchainIdx} ANDROID_TOOLCHAIN_NAME )
list( GET __availableToolchainMachines ${__toolchainIdx} ANDROID_TOOLCHAIN_MACHINE_NAME )
list( GET __availableToolchainCompilerVersions ${__toolchainIdx} ANDROID_COMPILER_VERSION )
-set( ANDROID_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" CACHE INTERNAL "Name of toolchain used" )
-set( ANDROID_COMPILER_VERSION "${ANDROID_COMPILER_VERSION}" CACHE INTERNAL "compiler version from selected toolchain" )
+
unset( __toolchainIdx )
unset( __availableToolchains )
unset( __availableToolchainMachines )
@@ -667,203 +782,486 @@ unset( __availableToolchainCompilerVersions )
# choose native API level
__INIT_VARIABLE( ANDROID_NATIVE_API_LEVEL ENV_ANDROID_NATIVE_API_LEVEL ANDROID_API_LEVEL ENV_ANDROID_API_LEVEL ANDROID_STANDALONE_TOOLCHAIN_API_LEVEL ANDROID_DEFAULT_NDK_API_LEVEL_${ANDROID_ARCH_NAME} ANDROID_DEFAULT_NDK_API_LEVEL )
-string( REGEX MATCH "[0-9]+" ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" )
+string( REPLACE "android-" "" ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" )
+string( STRIP "${ANDROID_NATIVE_API_LEVEL}" ANDROID_NATIVE_API_LEVEL )
+# adjust API level
+set( __real_api_level ${ANDROID_DEFAULT_NDK_API_LEVEL_${ANDROID_ARCH_NAME}} )
+foreach( __level ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} )
+ if( (__level LESS ANDROID_NATIVE_API_LEVEL OR __level STREQUAL ANDROID_NATIVE_API_LEVEL) AND NOT __level LESS __real_api_level )
+ set( __real_api_level ${__level} )
+ endif()
+endforeach()
+if( __real_api_level AND NOT ANDROID_NATIVE_API_LEVEL STREQUAL __real_api_level )
+ message( STATUS "Adjusting Android API level 'android-${ANDROID_NATIVE_API_LEVEL}' to 'android-${__real_api_level}'")
+ set( ANDROID_NATIVE_API_LEVEL ${__real_api_level} )
+endif()
+unset(__real_api_level)
# validate
list( FIND ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_NATIVE_API_LEVEL}" __levelIdx )
if( __levelIdx EQUAL -1 )
- message( SEND_ERROR "Specified Android native API level (${ANDROID_NATIVE_API_LEVEL}) is not supported by your NDK/toolchain." )
+ message( SEND_ERROR "Specified Android native API level 'android-${ANDROID_NATIVE_API_LEVEL}' is not supported by your NDK/toolchain." )
+else()
+ if( BUILD_WITH_ANDROID_NDK )
+ __DETECT_NATIVE_API_LEVEL( __realApiLevel "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}/usr/include/android/api-level.h" )
+ if( NOT __realApiLevel EQUAL ANDROID_NATIVE_API_LEVEL AND NOT __realApiLevel GREATER 9000 )
+ message( SEND_ERROR "Specified Android API level (${ANDROID_NATIVE_API_LEVEL}) does not match to the level found (${__realApiLevel}). Probably your copy of NDK is broken." )
+ endif()
+ unset( __realApiLevel )
+ endif()
+ set( ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" CACHE STRING "Android API level for native code" FORCE )
+ set( CMAKE_ANDROID_API ${ANDROID_NATIVE_API_LEVEL} )
+ if( CMAKE_VERSION VERSION_GREATER "2.8" )
+ list( SORT ANDROID_SUPPORTED_NATIVE_API_LEVELS )
+ set_property( CACHE ANDROID_NATIVE_API_LEVEL PROPERTY STRINGS ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} )
+ endif()
endif()
unset( __levelIdx )
+
+
+# remember target ABI
+set( ANDROID_ABI "${ANDROID_ABI}" CACHE STRING "The target ABI for Android. If arm, then armeabi-v7a is recommended for hardware floating point." FORCE )
+if( CMAKE_VERSION VERSION_GREATER "2.8" )
+ list( SORT ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_NAME} )
+ set_property( CACHE ANDROID_ABI PROPERTY STRINGS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_NAME}} )
+endif()
+
+
+# runtime choice (STL, rtti, exceptions)
+if( NOT ANDROID_STL )
+ set( ANDROID_STL gnustl_static )
+endif()
+set( ANDROID_STL "${ANDROID_STL}" CACHE STRING "C++ runtime" )
+set( ANDROID_STL_FORCE_FEATURES ON CACHE BOOL "automatically configure rtti and exceptions support based on C++ runtime" )
+mark_as_advanced( ANDROID_STL ANDROID_STL_FORCE_FEATURES )
+
if( BUILD_WITH_ANDROID_NDK )
- __DETECT_NATIVE_API_LEVEL( __realApiLevel "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}/usr/include/android/api-level.h" )
- if( NOT __realApiLevel EQUAL ANDROID_NATIVE_API_LEVEL )
- message( SEND_ERROR "Specified Android API level (${ANDROID_NATIVE_API_LEVEL}) does not match to the level found (${__realApiLevel}). Probably your copy of NDK is broken." )
+ if( NOT "${ANDROID_STL}" MATCHES "^(none|system|system_re|gabi\\+\\+_static|gabi\\+\\+_shared|stlport_static|stlport_shared|gnustl_static|gnustl_shared|c\\+\\+_static|c\\+\\+_shared)$")
+ message( FATAL_ERROR "ANDROID_STL is set to invalid value \"${ANDROID_STL}\".
+The possible values are:
+ none -> Do not configure the runtime.
+ system -> Use the default minimal system C++ runtime library.
+ system_re -> Same as system but with rtti and exceptions.
+ gabi++_static -> Use the GAbi++ runtime as a static library.
+ gabi++_shared -> Use the GAbi++ runtime as a shared library.
+ stlport_static -> Use the STLport runtime as a static library.
+ stlport_shared -> Use the STLport runtime as a shared library.
+ gnustl_static -> (default) Use the GNU STL as a static library.
+ gnustl_shared -> Use the GNU STL as a shared library.
+ c++_static -> Use libc++ as a static library.
+ c++_shared -> Use libc++ as a shared library.
+" )
+ endif()
+elseif( BUILD_WITH_STANDALONE_TOOLCHAIN )
+ if( NOT "${ANDROID_STL}" MATCHES "^(none|gnustl_static|gnustl_shared)$")
+ message( FATAL_ERROR "ANDROID_STL is set to invalid value \"${ANDROID_STL}\".
+The possible values are:
+ none -> Do not configure the runtime.
+ gnustl_static -> (default) Use the GNU STL as a static library.
+ gnustl_shared -> Use the GNU STL as a shared library.
+" )
endif()
- unset( __realApiLevel )
endif()
-set( ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" CACHE STRING "Android API level for native code" FORCE )
-if( CMAKE_VERSION VERSION_GREATER "2.8" )
- list( SORT ANDROID_SUPPORTED_NATIVE_API_LEVELS )
- set_property( CACHE ANDROID_NATIVE_API_LEVEL PROPERTY STRINGS ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} )
+
+unset( ANDROID_RTTI )
+unset( ANDROID_EXCEPTIONS )
+unset( ANDROID_STL_INCLUDE_DIRS )
+unset( __libstl )
+unset( __libsupcxx )
+
+if( NOT _CMAKE_IN_TRY_COMPILE AND ANDROID_NDK_RELEASE STREQUAL "r7b" AND ARMEABI_V7A AND NOT VFPV3 AND ANDROID_STL MATCHES "gnustl" )
+ message( WARNING "The GNU STL armeabi-v7a binaries from NDK r7b can crash non-NEON devices. The files provided with NDK r7b were not configured properly, resulting in crashes on Tegra2-based devices and others when trying to use certain floating-point functions (e.g., cosf, sinf, expf).
+You are strongly recommended to switch to another NDK release.
+" )
endif()
-# setup paths
+if( NOT _CMAKE_IN_TRY_COMPILE AND X86 AND ANDROID_STL MATCHES "gnustl" AND ANDROID_NDK_RELEASE STREQUAL "r6" )
+ message( WARNING "The x86 system header file from NDK r6 has incorrect definition for ptrdiff_t. You are recommended to upgrade to a newer NDK release or manually patch the header:
+See https://android.googlesource.com/platform/development.git f907f4f9d4e56ccc8093df6fee54454b8bcab6c2
+ diff --git a/ndk/platforms/android-9/arch-x86/include/machine/_types.h b/ndk/platforms/android-9/arch-x86/include/machine/_types.h
+ index 5e28c64..65892a1 100644
+ --- a/ndk/platforms/android-9/arch-x86/include/machine/_types.h
+ +++ b/ndk/platforms/android-9/arch-x86/include/machine/_types.h
+ @@ -51,7 +51,11 @@ typedef long int ssize_t;
+ #endif
+ #ifndef _PTRDIFF_T
+ #define _PTRDIFF_T
+ -typedef long ptrdiff_t;
+ +# ifdef __ANDROID__
+ + typedef int ptrdiff_t;
+ +# else
+ + typedef long ptrdiff_t;
+ +# endif
+ #endif
+" )
+endif()
+
+
+# setup paths and STL for standalone toolchain
if( BUILD_WITH_STANDALONE_TOOLCHAIN )
set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_STANDALONE_TOOLCHAIN}" )
+ set( ANDROID_CLANG_TOOLCHAIN_ROOT "${ANDROID_STANDALONE_TOOLCHAIN}" )
set( ANDROID_SYSROOT "${ANDROID_STANDALONE_TOOLCHAIN}/sysroot" )
- set( __stlLibPath "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib" )
-endif()
-if( BUILD_WITH_ANDROID_NDK )
- set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
- set( ANDROID_SYSROOT "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}" )
- if( ANDROID_USE_STLPORT )
- list( APPEND __stlIncludePath "${ANDROID_NDK}/sources/android/support/include" )
- list( APPEND __stlIncludePath "${ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libcxx/include" )
- set( __stlLibPath "${ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${ANDROID_NDK_ABI_NAME}" )
- else()
- if( EXISTS "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}" )
- set( __stlIncludePath "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}/include" )
- set( __stlLibPath "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}/libs/${ANDROID_NDK_ABI_NAME}" )
+
+ if( NOT ANDROID_STL STREQUAL "none" )
+ set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_STANDALONE_TOOLCHAIN}/include/c++/${ANDROID_COMPILER_VERSION}" )
+ if( NOT EXISTS "${ANDROID_STL_INCLUDE_DIRS}" )
+ # old location ( pre r8c )
+ set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}" )
+ endif()
+ if( ARMEABI_V7A AND EXISTS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}/bits" )
+ list( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}" )
+ elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/thumb/bits" )
+ list( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/thumb" )
else()
- set( __stlIncludePath "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/include" )
- set( __stlLibPath "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/libs/${ANDROID_NDK_ABI_NAME}" )
+ list( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" )
+ endif()
+ # always search static GNU STL to get the location of libsupc++.a
+ if( ARMEABI_V7A AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb/libstdc++.a" )
+ set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb" )
+ elseif( ARMEABI_V7A AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libstdc++.a" )
+ set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}" )
+ elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libstdc++.a" )
+ set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb" )
+ elseif( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libstdc++.a" )
+ set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib" )
+ endif()
+ if( __libstl )
+ set( __libsupcxx "${__libstl}/libsupc++.a" )
+ set( __libstl "${__libstl}/libstdc++.a" )
+ endif()
+ if( NOT EXISTS "${__libsupcxx}" )
+ message( FATAL_ERROR "The required libstdsupc++.a is missing in your standalone toolchain.
+ Usually it happens because of bug in make-standalone-toolchain.sh script from NDK r7, r7b and r7c.
+ You need to either upgrade to newer NDK or manually copy
+ $ANDROID_NDK/sources/cxx-stl/gnu-libstdc++/libs/${ANDROID_NDK_ABI_NAME}/libsupc++.a
+ to
+ ${__libsupcxx}
+ " )
+ endif()
+ if( ANDROID_STL STREQUAL "gnustl_shared" )
+ if( ARMEABI_V7A AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libgnustl_shared.so" )
+ set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libgnustl_shared.so" )
+ elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libgnustl_shared.so" )
+ set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libgnustl_shared.so" )
+ elseif( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libgnustl_shared.so" )
+ set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libgnustl_shared.so" )
+ endif()
endif()
endif()
endif()
-# specify the cross compiler
-set( CMAKE_C_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "gcc" )
-set( CMAKE_CXX_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}" CACHE PATH "g++" )
-set( CMAKE_ASM_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "Assembler" )
-if( CMAKE_VERSION VERSION_LESS 2.8.5 )
- set( CMAKE_ASM_COMPILER_ARG1 "-c" )
-endif()
-# there may be a way to make cmake deduce these TODO deduce the rest of the tools
-set( CMAKE_STRIP "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-strip${TOOL_OS_SUFFIX}" CACHE PATH "strip" )
-set( CMAKE_AR "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ar${TOOL_OS_SUFFIX}" CACHE PATH "archive" )
-set( CMAKE_LINKER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ld${TOOL_OS_SUFFIX}" CACHE PATH "linker" )
-set( CMAKE_NM "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-nm${TOOL_OS_SUFFIX}" CACHE PATH "nm" )
-set( CMAKE_OBJCOPY "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-objcopy${TOOL_OS_SUFFIX}" CACHE PATH "objcopy" )
-set( CMAKE_OBJDUMP "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-objdump${TOOL_OS_SUFFIX}" CACHE PATH "objdump" )
-set( CMAKE_RANLIB "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ranlib${TOOL_OS_SUFFIX}" CACHE PATH "ranlib" )
-set( _CMAKE_TOOLCHAIN_PREFIX "${ANDROID_TOOLCHAIN_MACHINE_NAME}-" )
-if( APPLE )
- find_program( CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool )
- if( NOT CMAKE_INSTALL_NAME_TOOL )
- message( FATAL_ERROR "Could not find install_name_tool, please check your installation." )
+# clang
+if( "${ANDROID_TOOLCHAIN_NAME}" STREQUAL "standalone-clang" )
+ set( ANDROID_COMPILER_IS_CLANG 1 )
+ execute_process( COMMAND "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/clang${TOOL_OS_SUFFIX}" --version OUTPUT_VARIABLE ANDROID_CLANG_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE )
+ string( REGEX MATCH "[0-9]+[.][0-9]+" ANDROID_CLANG_VERSION "${ANDROID_CLANG_VERSION}")
+elseif( "${ANDROID_TOOLCHAIN_NAME}" MATCHES "-clang3[.][0-9]?$" )
+ string( REGEX MATCH "3[.][0-9]$" ANDROID_CLANG_VERSION "${ANDROID_TOOLCHAIN_NAME}")
+ string( REGEX REPLACE "-clang${ANDROID_CLANG_VERSION}$" "-${ANDROID_COMPILER_VERSION}" ANDROID_GCC_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" )
+ if( NOT EXISTS "${ANDROID_NDK_TOOLCHAINS_PATH}/llvm-${ANDROID_CLANG_VERSION}${ANDROID_NDK_TOOLCHAINS_SUBPATH}/bin/clang${TOOL_OS_SUFFIX}" )
+ message( FATAL_ERROR "Could not find the Clang compiler driver" )
endif()
- mark_as_advanced( CMAKE_INSTALL_NAME_TOOL )
+ set( ANDROID_COMPILER_IS_CLANG 1 )
+ set( ANDROID_CLANG_TOOLCHAIN_ROOT "${ANDROID_NDK_TOOLCHAINS_PATH}/llvm-${ANDROID_CLANG_VERSION}${ANDROID_NDK_TOOLCHAINS_SUBPATH}" )
+else()
+ set( ANDROID_GCC_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" )
+ unset( ANDROID_COMPILER_IS_CLANG CACHE )
endif()
-# export directories
-set( ANDROID_SYSTEM_INCLUDE_DIRS "" )
-set( ANDROID_SYSTEM_LIB_DIRS "" )
+string( REPLACE "." "" _clang_name "clang${ANDROID_CLANG_VERSION}" )
+if( NOT EXISTS "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}" )
+ set( _clang_name "clang" )
+endif()
-# setup output directories
-set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_SOURCE_DIR} CACHE PATH "root for library output, set this to change where android libs are installed to" )
-set( CMAKE_INSTALL_PREFIX "${ANDROID_TOOLCHAIN_ROOT}/user" CACHE STRING "path for installing" )
+# setup paths and STL for NDK
+if( BUILD_WITH_ANDROID_NDK )
+ set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}${ANDROID_NDK_TOOLCHAINS_SUBPATH}" )
+ set( ANDROID_SYSROOT "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}" )
-if(NOT _CMAKE_IN_TRY_COMPILE)
- if( EXISTS "${CMAKE_SOURCE_DIR}/jni/CMakeLists.txt" )
- set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin/${ANDROID_NDK_ABI_NAME}" CACHE PATH "Output directory for applications" )
+ if( ANDROID_STL STREQUAL "none" )
+ # do nothing
+ elseif( ANDROID_STL STREQUAL "system" )
+ set( ANDROID_RTTI OFF )
+ set( ANDROID_EXCEPTIONS OFF )
+ set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/cxx-stl/system/include" )
+ elseif( ANDROID_STL STREQUAL "system_re" )
+ set( ANDROID_RTTI ON )
+ set( ANDROID_EXCEPTIONS ON )
+ set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/cxx-stl/system/include" )
+ elseif( ANDROID_STL MATCHES "gabi" )
+ if( ANDROID_NDK_RELEASE_NUM LESS 7000 ) # before r7
+ message( FATAL_ERROR "gabi++ is not awailable in your NDK. You have to upgrade to NDK r7 or newer to use gabi++.")
+ endif()
+ set( ANDROID_RTTI ON )
+ set( ANDROID_EXCEPTIONS OFF )
+ set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/cxx-stl/gabi++/include" )
+ set( __libstl "${ANDROID_NDK}/sources/cxx-stl/gabi++/libs/${ANDROID_NDK_ABI_NAME}/libgabi++_static.a" )
+ elseif( ANDROID_STL MATCHES "stlport" )
+ if( NOT ANDROID_NDK_RELEASE_NUM LESS 8004 ) # before r8d
+ set( ANDROID_EXCEPTIONS ON )
+ else()
+ set( ANDROID_EXCEPTIONS OFF )
+ endif()
+ if( ANDROID_NDK_RELEASE_NUM LESS 7000 ) # before r7
+ set( ANDROID_RTTI OFF )
+ else()
+ set( ANDROID_RTTI ON )
+ endif()
+ set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/cxx-stl/stlport/stlport" )
+ set( __libstl "${ANDROID_NDK}/sources/cxx-stl/stlport/libs/${ANDROID_NDK_ABI_NAME}/libstlport_static.a" )
+ elseif( ANDROID_STL MATCHES "gnustl" )
+ set( ANDROID_EXCEPTIONS ON )
+ set( ANDROID_RTTI ON )
+ if( EXISTS "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}" )
+ if( ARMEABI_V7A AND ANDROID_COMPILER_VERSION VERSION_EQUAL "4.7" AND ANDROID_NDK_RELEASE STREQUAL "r8d" )
+ # gnustl binary for 4.7 compiler is buggy :(
+ # TODO: look for right fix
+ set( __libstl "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/4.6" )
+ else()
+ set( __libstl "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}" )
+ endif()
+ else()
+ set( __libstl "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++" )
+ endif()
+ set( ANDROID_STL_INCLUDE_DIRS "${__libstl}/include" "${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/include" "${__libstl}/include/backward" )
+ if( EXISTS "${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/libgnustl_static.a" )
+ set( __libstl "${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/libgnustl_static.a" )
+ else()
+ set( __libstl "${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/libstdc++.a" )
+ endif()
+ elseif( ANDROID_STL MATCHES "c\\+\\+_shared" OR ANDROID_STL MATCHES "c\\+\\+_static" )
+ set( ANDROID_EXCEPTIONS ON )
+ set( ANDROID_RTTI ON )
+ set( ANDROID_CXX_ROOT "${ANDROID_NDK}/sources/cxx-stl/" )
+ set( ANDROID_LLVM_ROOT "${ANDROID_CXX_ROOT}/llvm-libc++" )
+ if( X86 )
+ set( ANDROID_ABI_INCLUDE_DIRS "${ANDROID_CXX_ROOT}/gabi++/include" )
+ else()
+ set( ANDROID_ABI_INCLUDE_DIRS "${ANDROID_CXX_ROOT}/llvm-libc++abi/include" )
+ endif()
+ set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_LLVM_ROOT}/libcxx/include"
+ "${ANDROID_ABI_INCLUDE_DIRS}" )
+ # android support sfiles
+ include_directories ( SYSTEM ${ANDROID_NDK}/sources/android/support/include )
+ if( ANDROID_STL MATCHES "c\\+\\+_shared" AND EXISTS "${ANDROID_LLVM_ROOT}/libs/${ANDROID_NDK_ABI_NAME}/libc++_shared.so" )
+ set( __libstl "${ANDROID_LLVM_ROOT}/libs/${ANDROID_NDK_ABI_NAME}/libc++_shared.so" )
+ elseif( ANDROID_STL MATCHES "c\\+\\+_static" AND EXISTS "${ANDROID_LLVM_ROOT}/libs/${ANDROID_NDK_ABI_NAME}/libc++_static.a" )
+ set( __libstl "${ANDROID_LLVM_ROOT}/libs/${ANDROID_NDK_ABI_NAME}/libc++_static.a" )
+ else()
+ message( "c++ library doesn't exist" )
+ endif()
else()
- set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin" CACHE PATH "Output directory for applications" )
+ message( FATAL_ERROR "Unknown runtime: ${ANDROID_STL}" )
+ endif()
+ # find libsupc++.a - rtti & exceptions
+ if( ANDROID_STL STREQUAL "system_re" OR ANDROID_STL MATCHES "gnustl" )
+ set( __libsupcxx "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}/libs/${ANDROID_NDK_ABI_NAME}/libsupc++.a" ) # r8b or newer
+ if( NOT EXISTS "${__libsupcxx}" )
+ set( __libsupcxx "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/libs/${ANDROID_NDK_ABI_NAME}/libsupc++.a" ) # r7-r8
+ endif()
+ if( NOT EXISTS "${__libsupcxx}" ) # before r7
+ if( ARMEABI_V7A )
+ if( ANDROID_FORCE_ARM_BUILD )
+ set( __libsupcxx "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libsupc++.a" )
+ else()
+ set( __libsupcxx "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb/libsupc++.a" )
+ endif()
+ elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD )
+ set( __libsupcxx "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libsupc++.a" )
+ else()
+ set( __libsupcxx "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libsupc++.a" )
+ endif()
+ endif()
+ if( NOT EXISTS "${__libsupcxx}")
+ message( ERROR "Could not find libsupc++.a for a chosen platform. Either your NDK is not supported or is broken.")
+ endif()
endif()
- set( LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}" CACHE PATH "path for android libs" )
endif()
-# includes
-if( __stlIncludePath )
- list( APPEND ANDROID_SYSTEM_INCLUDE_DIRS "${__stlIncludePath}" )
-endif()
-# c++ bits includes
-if( __stlLibPath AND EXISTS "${__stlLibPath}/include" )
- list( APPEND ANDROID_SYSTEM_INCLUDE_DIRS "${__stlLibPath}/include" )
-endif()
-if( ANDROID_ARCH_NAME STREQUAL "arm" AND EXISTS "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}/thumb/bits" )
- list( APPEND ANDROID_SYSTEM_INCLUDE_DIRS "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}/thumb" )
-elseif( EXISTS "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}/bits" )
- list( APPEND ANDROID_SYSTEM_INCLUDE_DIRS "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}" )
-elseif( ANDROID_ARCH_NAME STREQUAL "arm" AND EXISTS "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/thumb/bits" )
- list( APPEND ANDROID_SYSTEM_INCLUDE_DIRS "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/thumb" )
-elseif( EXISTS "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/bits" )
- list( APPEND ANDROID_SYSTEM_INCLUDE_DIRS "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" )
+# case of shared STL linkage
+if( ANDROID_STL MATCHES "shared" AND DEFINED __libstl )
+ string( REPLACE "_static.a" "_shared.so" __libstl "${__libstl}" )
+ # TODO: check if .so file exists before the renaming
endif()
-# flags and definitions
-if(ANDROID_SYSROOT MATCHES "[ ;\"]")
- set( ANDROID_CXX_FLAGS "--sysroot=\"${ANDROID_SYSROOT}\"" )
- # quotes will break try_compile and compiler identification
- message(WARNING "Your Android system root has non-alphanumeric symbols. It can break compiler features detection and the whole build.")
+
+# ccache support
+__INIT_VARIABLE( _ndk_ccache NDK_CCACHE ENV_NDK_CCACHE )
+if( _ndk_ccache )
+ if( DEFINED NDK_CCACHE AND NOT EXISTS NDK_CCACHE )
+ unset( NDK_CCACHE CACHE )
+ endif()
+ find_program( NDK_CCACHE "${_ndk_ccache}" DOC "The path to ccache binary")
else()
- set( ANDROID_CXX_FLAGS "--sysroot=${ANDROID_SYSROOT}" )
+ unset( NDK_CCACHE CACHE )
endif()
+unset( _ndk_ccache )
-remove_definitions( -DANDROID )
-add_definitions( -DANDROID )
+
+# setup the cross-compiler
+if( NOT CMAKE_C_COMPILER )
+ if( NDK_CCACHE AND NOT ANDROID_SYSROOT MATCHES "[ ;\"]" )
+ set( CMAKE_C_COMPILER "${NDK_CCACHE}" CACHE PATH "ccache as C compiler" )
+ set( CMAKE_CXX_COMPILER "${NDK_CCACHE}" CACHE PATH "ccache as C++ compiler" )
+ if( ANDROID_COMPILER_IS_CLANG )
+ set( CMAKE_C_COMPILER_ARG1 "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}" CACHE PATH "C compiler")
+ set( CMAKE_CXX_COMPILER_ARG1 "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler")
+ else()
+ set( CMAKE_C_COMPILER_ARG1 "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "C compiler")
+ set( CMAKE_CXX_COMPILER_ARG1 "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler")
+ endif()
+ else()
+ if( ANDROID_COMPILER_IS_CLANG )
+ set( CMAKE_C_COMPILER "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}" CACHE PATH "C compiler")
+ set( CMAKE_CXX_COMPILER "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler")
+ else()
+ set( CMAKE_C_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "C compiler" )
+ set( CMAKE_CXX_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler" )
+ endif()
+ endif()
+ set( CMAKE_ASM_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "assembler" )
+ set( CMAKE_STRIP "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-strip${TOOL_OS_SUFFIX}" CACHE PATH "strip" )
+ set( CMAKE_AR "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ar${TOOL_OS_SUFFIX}" CACHE PATH "archive" )
+ set( CMAKE_LINKER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ld${TOOL_OS_SUFFIX}" CACHE PATH "linker" )
+ set( CMAKE_NM "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-nm${TOOL_OS_SUFFIX}" CACHE PATH "nm" )
+ set( CMAKE_OBJCOPY "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-objcopy${TOOL_OS_SUFFIX}" CACHE PATH "objcopy" )
+ set( CMAKE_OBJDUMP "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-objdump${TOOL_OS_SUFFIX}" CACHE PATH "objdump" )
+ set( CMAKE_RANLIB "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ranlib${TOOL_OS_SUFFIX}" CACHE PATH "ranlib" )
+endif()
+
+set( _CMAKE_TOOLCHAIN_PREFIX "${ANDROID_TOOLCHAIN_MACHINE_NAME}-" )
+if( CMAKE_VERSION VERSION_LESS 2.8.5 )
+ set( CMAKE_ASM_COMPILER_ARG1 "-c" )
+endif()
+if( APPLE )
+ find_program( CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool )
+ if( NOT CMAKE_INSTALL_NAME_TOOL )
+ message( FATAL_ERROR "Could not find install_name_tool, please check your installation." )
+ endif()
+ mark_as_advanced( CMAKE_INSTALL_NAME_TOOL )
+endif()
# Force set compilers because standard identification works badly for us
include( CMakeForceCompiler )
CMAKE_FORCE_C_COMPILER( "${CMAKE_C_COMPILER}" GNU )
+if( ANDROID_COMPILER_IS_CLANG )
+ set( CMAKE_C_COMPILER_ID Clang )
+endif()
set( CMAKE_C_PLATFORM_ID Linux )
-set( CMAKE_C_SIZEOF_DATA_PTR 4 )
+if( X86_64 OR MIPS64 OR ARM64_V8A )
+ set( CMAKE_C_SIZEOF_DATA_PTR 8 )
+else()
+ set( CMAKE_C_SIZEOF_DATA_PTR 4 )
+endif()
set( CMAKE_C_HAS_ISYSROOT 1 )
set( CMAKE_C_COMPILER_ABI ELF )
CMAKE_FORCE_CXX_COMPILER( "${CMAKE_CXX_COMPILER}" GNU )
+if( ANDROID_COMPILER_IS_CLANG )
+ set( CMAKE_CXX_COMPILER_ID Clang)
+endif()
set( CMAKE_CXX_PLATFORM_ID Linux )
-set( CMAKE_CXX_SIZEOF_DATA_PTR 4 )
+set( CMAKE_CXX_SIZEOF_DATA_PTR ${CMAKE_C_SIZEOF_DATA_PTR} )
set( CMAKE_CXX_HAS_ISYSROOT 1 )
set( CMAKE_CXX_COMPILER_ABI ELF )
+set( CMAKE_CXX_SOURCE_FILE_EXTENSIONS cc cp cxx cpp CPP c++ C )
# force ASM compiler (required for CMake < 2.8.5)
set( CMAKE_ASM_COMPILER_ID_RUN TRUE )
set( CMAKE_ASM_COMPILER_ID GNU )
set( CMAKE_ASM_COMPILER_WORKS TRUE )
set( CMAKE_ASM_COMPILER_FORCED TRUE )
set( CMAKE_COMPILER_IS_GNUASM 1)
+set( CMAKE_ASM_SOURCE_FILE_EXTENSIONS s S asm )
-# NDK flags
-if( ARMEABI OR ARMEABI_V7A )
- # NDK also defines -ffunction-sections -funwind-tables but they result in worse OpenCV performance
- set( _CMAKE_CXX_FLAGS "-fPIC -Wno-psabi" )
- set( _CMAKE_C_FLAGS "-fPIC -Wno-psabi" )
- remove_definitions( -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ )
- add_definitions( -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ )
- # extra arm-specific flags
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fsigned-char" )
-elseif( X86 )
- set( _CMAKE_CXX_FLAGS "-funwind-tables" )
- set( _CMAKE_C_FLAGS "-funwind-tables" )
-elseif( MIPS )
- set( _CMAKE_CXX_FLAGS "-fpic -Wno-psabi -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers" )
- set( _CMAKE_CXX_FLAGS "-fpic -Wno-psabi -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers" )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fsigned-char" )
-else()
- set( _CMAKE_CXX_FLAGS "" )
- set( _CMAKE_C_FLAGS "" )
-endif()
+foreach( lang C CXX ASM )
+ if( ANDROID_COMPILER_IS_CLANG )
+ set( CMAKE_${lang}_COMPILER_VERSION ${ANDROID_CLANG_VERSION} )
+ else()
+ set( CMAKE_${lang}_COMPILER_VERSION ${ANDROID_COMPILER_VERSION} )
+ endif()
+endforeach()
+
+# flags and definitions
+remove_definitions( -DANDROID )
+add_definitions( -DANDROID )
-if( ANDROID_USE_STLPORT )
- set( _CMAKE_CXX_FLAGS "${_CMAKE_CXX_FLAGS} -frtti -fno-exceptions" )
- set( _CMAKE_C_FLAGS "${_CMAKE_C_FLAGS} -fno-exceptions" )
+if( ANDROID_SYSROOT MATCHES "[ ;\"]" )
+ if( CMAKE_HOST_WIN32 )
+ # try to convert path to 8.3 form
+ file( WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/cvt83.cmd" "@echo %~s1" )
+ execute_process( COMMAND "$ENV{ComSpec}" /c "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/cvt83.cmd" "${ANDROID_SYSROOT}"
+ OUTPUT_VARIABLE __path OUTPUT_STRIP_TRAILING_WHITESPACE
+ RESULT_VARIABLE __result ERROR_QUIET )
+ if( __result EQUAL 0 )
+ file( TO_CMAKE_PATH "${__path}" ANDROID_SYSROOT )
+ set( ANDROID_CXX_FLAGS "--sysroot=${ANDROID_SYSROOT}" )
+ else()
+ set( ANDROID_CXX_FLAGS "--sysroot=\"${ANDROID_SYSROOT}\"" )
+ endif()
+ else()
+ set( ANDROID_CXX_FLAGS "'--sysroot=${ANDROID_SYSROOT}'" )
+ endif()
+ if( NOT _CMAKE_IN_TRY_COMPILE )
+ # quotes can break try_compile and compiler identification
+ message(WARNING "Path to your Android NDK (or toolchain) has non-alphanumeric symbols.\nThe build might be broken.\n")
+ endif()
else()
- set( _CMAKE_CXX_FLAGS "${_CMAKE_CXX_FLAGS} -frtti -fexceptions" )
- set( _CMAKE_C_FLAGS "${_CMAKE_C_FLAGS} -fexceptions" )
+ set( ANDROID_CXX_FLAGS "--sysroot=${ANDROID_SYSROOT}" )
endif()
-# release and debug flags
-if( ARMEABI OR ARMEABI_V7A )
+# NDK flags
+if (ARM64_V8A )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funwind-tables" )
+ set( ANDROID_CXX_FLAGS_RELEASE "-fomit-frame-pointer -fstrict-aliasing" )
+ set( ANDROID_CXX_FLAGS_DEBUG "-fno-omit-frame-pointer -fno-strict-aliasing" )
+ if( NOT ANDROID_COMPILER_IS_CLANG )
+ set( ANDROID_CXX_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE} -funswitch-loops -finline-limit=300" )
+ endif()
+elseif( ARMEABI OR ARMEABI_V7A)
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funwind-tables" )
if( NOT ANDROID_FORCE_ARM_BUILD AND NOT ARMEABI_V6 )
- # It is recommended to use the -mthumb compiler flag to force the generation
- # of 16-bit Thumb-1 instructions (the default being 32-bit ARM ones).
- # O3 instead of O2/Os in release mode - like cmake sets for desktop gcc
- set( _CMAKE_CXX_FLAGS_RELEASE "-mthumb -O3" )
- set( _CMAKE_C_FLAGS_RELEASE "-mthumb -O3" )
- set( _CMAKE_CXX_FLAGS_DEBUG "-marm -Os -finline-limit=64" )
- set( _CMAKE_C_FLAGS_DEBUG "-marm -Os -finline-limit=64" )
+ set( ANDROID_CXX_FLAGS_RELEASE "-mthumb -fomit-frame-pointer -fno-strict-aliasing" )
+ set( ANDROID_CXX_FLAGS_DEBUG "-marm -fno-omit-frame-pointer -fno-strict-aliasing" )
+ if( NOT ANDROID_COMPILER_IS_CLANG )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -finline-limit=64" )
+ endif()
else()
# always compile ARMEABI_V6 in arm mode; otherwise there is no difference from ARMEABI
- # O3 instead of O2/Os in release mode - like cmake sets for desktop gcc
- set( _CMAKE_CXX_FLAGS_RELEASE "-marm -O3 -fstrict-aliasing" )
- set( _CMAKE_C_FLAGS_RELEASE "-marm -O3 -fstrict-aliasing" )
- set( _CMAKE_CXX_FLAGS_DEBUG "-marm -O0 -finline-limit=300" )
- set( _CMAKE_C_FLAGS_DEBUG "-marm -O0 -finline-limit=300" )
+ set( ANDROID_CXX_FLAGS_RELEASE "-marm -fomit-frame-pointer -fstrict-aliasing" )
+ set( ANDROID_CXX_FLAGS_DEBUG "-marm -fno-omit-frame-pointer -fno-strict-aliasing" )
+ if( NOT ANDROID_COMPILER_IS_CLANG )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funswitch-loops -finline-limit=300" )
+ endif()
+ endif()
+elseif( X86 OR X86_64 )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funwind-tables" )
+ if( NOT ANDROID_COMPILER_IS_CLANG )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funswitch-loops -finline-limit=300" )
+ endif()
+ set( ANDROID_CXX_FLAGS_RELEASE "-fomit-frame-pointer -fstrict-aliasing" )
+ set( ANDROID_CXX_FLAGS_DEBUG "-fno-omit-frame-pointer -fno-strict-aliasing" )
+elseif( MIPS OR MIPS64 )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fno-strict-aliasing -finline-functions -funwind-tables -fmessage-length=0" )
+ set( ANDROID_CXX_FLAGS_RELEASE "-fomit-frame-pointer" )
+ set( ANDROID_CXX_FLAGS_DEBUG "-fno-omit-frame-pointer" )
+ if( NOT ANDROID_COMPILER_IS_CLANG )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers" )
+ set( ANDROID_CXX_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE} -funswitch-loops -finline-limit=300" )
endif()
-elseif( X86 )
- set( _CMAKE_CXX_FLAGS_RELEASE "-O3 -fstrict-aliasing" )
- set( _CMAKE_C_FLAGS_RELEASE "-O3 -fstrict-aliasing" )
- set( _CMAKE_CXX_FLAGS_DEBUG "-O0 -finline-limit=300" )
- set( _CMAKE_C_FLAGS_DEBUG "-O0 -finline-limit=300" )
-elseif( MIPS )
- set( _CMAKE_CXX_FLAGS_RELEASE "-O3 -funswitch-loops -finline-limit=300" )
- set( _CMAKE_C_FLAGS_RELEASE "-O3 -funswitch-loops -finline-limit=300" )
- set( _CMAKE_CXX_FLAGS_DEBUG "-O0 -g" )
- set( _CMAKE_C_FLAGS_DEBUG "-O0 -g" )
-endif()
-set( _CMAKE_CXX_FLAGS_RELEASE "${_CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer -DNDEBUG" )
-set( _CMAKE_C_FLAGS_RELEASE "${_CMAKE_C_FLAGS_RELEASE} -fomit-frame-pointer -DNDEBUG" )
-set( _CMAKE_CXX_FLAGS_DEBUG "${_CMAKE_CXX_FLAGS_DEBUG} -fno-strict-aliasing -fno-omit-frame-pointer -DDEBUG -D_DEBUG" )
-set( _CMAKE_C_FLAGS_DEBUG "${_CMAKE_C_FLAGS_DEBUG} -fno-strict-aliasing -fno-omit-frame-pointer -DDEBUG -D_DEBUG" )
+elseif()
+ set( ANDROID_CXX_FLAGS_RELEASE "" )
+ set( ANDROID_CXX_FLAGS_DEBUG "" )
+endif()
+
+set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fsigned-char" ) # good/necessary when porting desktop libraries
+
+if( NOT X86 AND NOT ANDROID_COMPILER_IS_CLANG )
+ set( ANDROID_CXX_FLAGS "-Wno-psabi ${ANDROID_CXX_FLAGS}" )
+endif()
+
+if( NOT ANDROID_COMPILER_VERSION VERSION_LESS "4.6" )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -no-canonical-prefixes" ) # see https://android-review.googlesource.com/#/c/47564/
+endif()
# ABI-specific flags
if( ARMEABI_V7A )
@@ -871,129 +1269,274 @@ if( ARMEABI_V7A )
if( NEON )
set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=neon" )
elseif( VFPV3 )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=vfpv3-d16" )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=vfpv3" )
else()
set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=vfpv3-d16" )
endif()
elseif( ARMEABI_V6 )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv6 -mfloat-abi=softfp -mfpu=vfp" )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv6 -mfloat-abi=softfp -mfpu=vfp" ) # vfp == vfpv2
elseif( ARMEABI )
set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv5te -mtune=xscale -msoft-float" )
-elseif( X86 )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS}" )#sse?
endif()
-# linker flags
-if( NOT DEFINED __ndklibspath )
- set( __ndklibspath "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/ndklibs/${ANDROID_NDK_ABI_NAME}" )
+if( ANDROID_STL MATCHES "gnustl" AND (EXISTS "${__libstl}" OR EXISTS "${__libsupcxx}") )
+ set( CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" )
+ set( CMAKE_CXX_CREATE_SHARED_MODULE "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" )
+ set( CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>" )
+else()
+ set( CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" )
+ set( CMAKE_CXX_CREATE_SHARED_MODULE "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" )
+ set( CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>" )
endif()
-list( APPEND ANDROID_SYSTEM_LIB_DIRS "${CMAKE_INSTALL_PREFIX}/libs/${ANDROID_NDK_ABI_NAME}" )
-set( ANDROID_LINKER_FLAGS "" )
# STL
-if( ANDROID_USE_STLPORT )
- if( EXISTS "${__stlLibPath}/libc++_shared.so" )
- set( CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES> \"${__stlLibPath}/libc++_shared.so\" -latomic")
- set( CMAKE_CXX_CREATE_SHARED_MODULE "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES> \"${__stlLibPath}/libc++_shared.so\" -latomic")
+if( EXISTS "${__libstl}" OR EXISTS "${__libsupcxx}" )
+ if( EXISTS "${__libstl}" )
+ set( CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} \"${__libstl}\"" )
+ set( CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE} \"${__libstl}\"" )
+ set( CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} \"${__libstl}\"" )
endif()
-else( ANDROID_USE_STLPORT )
- if( EXISTS "${__stlLibPath}/libgnustl_static.a" )
- __COPY_IF_DIFFERENT( "${__stlLibPath}/libgnustl_static.a" "${__ndklibspath}/libstdc++.a" )
- elseif( ANDROID_ARCH_NAME STREQUAL "arm" AND EXISTS "${__stlLibPath}/${CMAKE_SYSTEM_PROCESSOR}/thumb/libstdc++.a" )
- __COPY_IF_DIFFERENT( "${__stlLibPath}/${CMAKE_SYSTEM_PROCESSOR}/thumb/libstdc++.a" "${__ndklibspath}/libstdc++.a" )
- elseif( ANDROID_ARCH_NAME STREQUAL "arm" AND EXISTS "${__stlLibPath}/${CMAKE_SYSTEM_PROCESSOR}/libstdc++.a" )
- __COPY_IF_DIFFERENT( "${__stlLibPath}/${CMAKE_SYSTEM_PROCESSOR}/libstdc++.a" "${__ndklibspath}/libstdc++.a" )
- elseif( ANDROID_ARCH_NAME STREQUAL "arm" AND EXISTS "${__stlLibPath}/thumb/libstdc++.a" )
- __COPY_IF_DIFFERENT( "${__stlLibPath}/thumb/libstdc++.a" "${__ndklibspath}/libstdc++.a" )
- elseif( EXISTS "${__stlLibPath}/libstdc++.a" )
- __COPY_IF_DIFFERENT( "${__stlLibPath}/libstdc++.a" "${__ndklibspath}/libstdc++.a" )
+ if( EXISTS "${__libsupcxx}" )
+ set( CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} \"${__libsupcxx}\"" )
+ set( CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE} \"${__libsupcxx}\"" )
+ set( CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} \"${__libsupcxx}\"" )
+ # C objects:
+ set( CMAKE_C_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_C_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" )
+ set( CMAKE_C_CREATE_SHARED_MODULE "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_C_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" )
+ set( CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>" )
+ set( CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_C_CREATE_SHARED_LIBRARY} \"${__libsupcxx}\"" )
+ set( CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_C_CREATE_SHARED_MODULE} \"${__libsupcxx}\"" )
+ set( CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_LINK_EXECUTABLE} \"${__libsupcxx}\"" )
endif()
- if( EXISTS "${__stlLibPath}/libsupc++.a" )
- __COPY_IF_DIFFERENT( "${__stlLibPath}/libsupc++.a" "${__ndklibspath}/libsupc++.a" )
- elseif( ANDROID_ARCH_NAME STREQUAL "arm" AND EXISTS "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb/libsupc++.a" )
- __COPY_IF_DIFFERENT( "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb/libsupc++.a" "${__ndklibspath}/libsupc++.a" )
- elseif( ANDROID_ARCH_NAME STREQUAL "arm" AND EXISTS "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libsupc++.a" )
- __COPY_IF_DIFFERENT( "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libsupc++.a" "${__ndklibspath}/libsupc++.a" )
- elseif( ANDROID_ARCH_NAME STREQUAL "arm" AND EXISTS "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libsupc++.a" )
- __COPY_IF_DIFFERENT( "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libsupc++.a" "${__ndklibspath}/libsupc++.a" )
- elseif( EXISTS "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libsupc++.a" )
- __COPY_IF_DIFFERENT( "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libsupc++.a" "${__ndklibspath}/libsupc++.a" )
+ if( ANDROID_STL MATCHES "gnustl" )
+ if( NOT EXISTS "${ANDROID_LIBM_PATH}" )
+ set( ANDROID_LIBM_PATH -lm )
+ endif()
+ set( CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} ${ANDROID_LIBM_PATH}" )
+ set( CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE} ${ANDROID_LIBM_PATH}" )
+ set( CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} ${ANDROID_LIBM_PATH}" )
endif()
- list( APPEND ANDROID_SYSTEM_LIB_DIRS "${__ndklibspath}" )
-endif( ANDROID_USE_STLPORT )
+endif()
-# cleanup for STL search
-unset( __stlIncludePath )
-unset( __stlLibPath )
+# variables controlling optional build flags
+if( ANDROID_NDK_RELEASE_NUM LESS 7000 ) # before r7
+ # libGLESv2.so in NDK's prior to r7 refers to missing external symbols.
+ # So this flag option is required for all projects using OpenGL from native.
+ __INIT_VARIABLE( ANDROID_SO_UNDEFINED VALUES ON )
+else()
+ __INIT_VARIABLE( ANDROID_SO_UNDEFINED VALUES OFF )
+endif()
+__INIT_VARIABLE( ANDROID_NO_UNDEFINED VALUES ON )
+__INIT_VARIABLE( ANDROID_FUNCTION_LEVEL_LINKING VALUES ON )
+__INIT_VARIABLE( ANDROID_GOLD_LINKER VALUES ON )
+__INIT_VARIABLE( ANDROID_NOEXECSTACK VALUES ON )
+__INIT_VARIABLE( ANDROID_RELRO VALUES ON )
+
+set( ANDROID_NO_UNDEFINED ${ANDROID_NO_UNDEFINED} CACHE BOOL "Show all undefined symbols as linker errors" )
+set( ANDROID_SO_UNDEFINED ${ANDROID_SO_UNDEFINED} CACHE BOOL "Allows or disallows undefined symbols in shared libraries" )
+set( ANDROID_FUNCTION_LEVEL_LINKING ${ANDROID_FUNCTION_LEVEL_LINKING} CACHE BOOL "Put each function in separate section and enable garbage collection of unused input sections at link time" )
+set( ANDROID_GOLD_LINKER ${ANDROID_GOLD_LINKER} CACHE BOOL "Enables gold linker" )
+set( ANDROID_NOEXECSTACK ${ANDROID_NOEXECSTACK} CACHE BOOL "Allows or disallows undefined symbols in shared libraries" )
+set( ANDROID_RELRO ${ANDROID_RELRO} CACHE BOOL "Enables RELRO - a memory corruption mitigation technique" )
+mark_as_advanced( ANDROID_NO_UNDEFINED ANDROID_SO_UNDEFINED ANDROID_FUNCTION_LEVEL_LINKING ANDROID_GOLD_LINKER ANDROID_NOEXECSTACK ANDROID_RELRO )
-# other linker flags
-__INIT_VARIABLE( ANDROID_NO_UNDEFINED OBSOLETE_NO_UNDEFINED VALUES ON )
-set( ANDROID_NO_UNDEFINED ${ANDROID_NO_UNDEFINED} CACHE BOOL "Show all undefined symbols as linker errors" FORCE )
-mark_as_advanced( ANDROID_NO_UNDEFINED )
-if( ANDROID_NO_UNDEFINED )
- set( ANDROID_LINKER_FLAGS "-Wl,--no-undefined ${ANDROID_LINKER_FLAGS}" )
+# linker flags
+set( ANDROID_LINKER_FLAGS "" )
+
+if( ARMEABI_V7A )
+ # this is *required* to use the following linker flags that routes around
+ # a CPU bug in some Cortex-A8 implementations:
+ set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--fix-cortex-a8" )
endif()
-if (ANDROID_NDK MATCHES "-r[56].?$")
- # libGLESv2.so in NDK's prior to r7 refers to exteranal symbols. So this flag option is required for all projects using OpenGL from native.
- __INIT_VARIABLE( ANDROID_SO_UNDEFINED VALUES ON )
-else()
- __INIT_VARIABLE( ANDROID_SO_UNDEFINED VALUES OFF )
+if( ANDROID_NO_UNDEFINED )
+ if( MIPS )
+ # there is some sysroot-related problem in mips linker...
+ if( NOT ANDROID_SYSROOT MATCHES "[ ;\"]" )
+ set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--no-undefined -Wl,-rpath-link,${ANDROID_SYSROOT}/usr/lib" )
+ endif()
+ else()
+ set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--no-undefined" )
+ endif()
endif()
-set( ANDROID_SO_UNDEFINED ${ANDROID_SO_UNDEFINED} CACHE BOOL "Allows or disallows undefined symbols in shared libraries" FORCE )
-mark_as_advanced( ANDROID_SO_UNDEFINED )
if( ANDROID_SO_UNDEFINED )
set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,-allow-shlib-undefined" )
endif()
-__INIT_VARIABLE( ANDROID_FUNCTION_LEVEL_LINKING VALUES ON )
-set( ANDROID_FUNCTION_LEVEL_LINKING ON CACHE BOOL "Allows or disallows undefined symbols in shared libraries" FORCE )
-mark_as_advanced( ANDROID_FUNCTION_LEVEL_LINKING )
if( ANDROID_FUNCTION_LEVEL_LINKING )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fdata-sections -ffunction-sections" )
- set( ANDROID_LINKER_FLAGS "-Wl,--gc-sections ${ANDROID_LINKER_FLAGS}" )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fdata-sections -ffunction-sections" )
+ set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--gc-sections" )
endif()
-if( ARMEABI_V7A )
- # this is *required* to use the following linker flags that routes around
- # a CPU bug in some Cortex-A8 implementations:
- set( ANDROID_LINKER_FLAGS "-Wl,--fix-cortex-a8 ${ANDROID_LINKER_FLAGS}" )
+if( ANDROID_COMPILER_VERSION VERSION_EQUAL "4.6" )
+ if( ANDROID_GOLD_LINKER AND (CMAKE_HOST_UNIX OR ANDROID_NDK_RELEASE_NUM GREATER 8002) AND (ARMEABI OR ARMEABI_V7A OR X86) )
+ set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=gold" )
+ elseif( ANDROID_NDK_RELEASE_NUM GREATER 8002 ) # after r8b
+ set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=bfd" )
+ elseif( ANDROID_NDK_RELEASE STREQUAL "r8b" AND ARMEABI AND NOT _CMAKE_IN_TRY_COMPILE )
+ message( WARNING "The default bfd linker from arm GCC 4.6 toolchain can fail with 'unresolvable R_ARM_THM_CALL relocation' error message. See https://code.google.com/p/android/issues/detail?id=35342
+ On Linux and OS X host platform you can workaround this problem using gold linker (default).
+ Rerun cmake with -DANDROID_GOLD_LINKER=ON option in case of problems.
+" )
+ endif()
+endif() # version 4.6
+
+if( ANDROID_NOEXECSTACK )
+ if( ANDROID_COMPILER_IS_CLANG )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -Xclang -mnoexecstack" )
+ else()
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -Wa,--noexecstack" )
+ endif()
+ set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,-z,noexecstack" )
+endif()
+
+if( ANDROID_RELRO )
+ set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,-z,relro -Wl,-z,now" )
+endif()
+
+if( ANDROID_COMPILER_IS_CLANG )
+ set( ANDROID_CXX_FLAGS "-target ${ANDROID_LLVM_TRIPLE} -Qunused-arguments ${ANDROID_CXX_FLAGS}" )
+ if( BUILD_WITH_ANDROID_NDK )
+ set( ANDROID_CXX_FLAGS "-gcc-toolchain ${ANDROID_TOOLCHAIN_ROOT} ${ANDROID_CXX_FLAGS}" )
+ endif()
endif()
# cache flags
-set( CMAKE_CXX_FLAGS "${_CMAKE_CXX_FLAGS}" CACHE STRING "c++ flags" )
-set( CMAKE_C_FLAGS "${_CMAKE_C_FLAGS}" CACHE STRING "c flags" )
-set( CMAKE_CXX_FLAGS_RELEASE "${_CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "c++ Release flags" )
-set( CMAKE_C_FLAGS_RELEASE "${_CMAKE_C_FLAGS_RELEASE}" CACHE STRING "c Release flags" )
-set( CMAKE_CXX_FLAGS_DEBUG "${_CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING "c++ Debug flags" )
-set( CMAKE_C_FLAGS_DEBUG "${_CMAKE_C_FLAGS_DEBUG}" CACHE STRING "c Debug flags" )
-set( CMAKE_SHARED_LINKER_FLAGS "" CACHE STRING "linker flags" )
-set( CMAKE_MODULE_LINKER_FLAGS "" CACHE STRING "linker flags" )
-set( CMAKE_EXE_LINKER_FLAGS "-Wl,-z,nocopyreloc" CACHE STRING "linker flags" )
-
-include_directories( SYSTEM ${ANDROID_SYSTEM_INCLUDE_DIRS} )
-link_directories( ${ANDROID_SYSTEM_LIB_DIRS} )
+set( CMAKE_CXX_FLAGS "" CACHE STRING "c++ flags" )
+set( CMAKE_C_FLAGS "" CACHE STRING "c flags" )
+set( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "c++ Release flags" )
+set( CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "c Release flags" )
+set( CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DDEBUG -D_DEBUG" CACHE STRING "c++ Debug flags" )
+set( CMAKE_C_FLAGS_DEBUG "-O0 -g -DDEBUG -D_DEBUG" CACHE STRING "c Debug flags" )
+set( CMAKE_SHARED_LINKER_FLAGS "" CACHE STRING "shared linker flags" )
+set( CMAKE_MODULE_LINKER_FLAGS "" CACHE STRING "module linker flags" )
+set( CMAKE_EXE_LINKER_FLAGS "-Wl,-z,nocopyreloc" CACHE STRING "executable linker flags" )
+
+# put flags to cache (for debug purpose only)
+set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS}" CACHE INTERNAL "Android specific c/c++ flags" )
+set( ANDROID_CXX_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE}" CACHE INTERNAL "Android specific c/c++ Release flags" )
+set( ANDROID_CXX_FLAGS_DEBUG "${ANDROID_CXX_FLAGS_DEBUG}" CACHE INTERNAL "Android specific c/c++ Debug flags" )
+set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS}" CACHE INTERNAL "Android specific c/c++ linker flags" )
# finish flags
-set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS}" CACHE INTERNAL "Extra Android compiler flags")
-set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS}" CACHE INTERNAL "Extra Android linker flags")
set( CMAKE_CXX_FLAGS "${ANDROID_CXX_FLAGS} ${CMAKE_CXX_FLAGS}" )
set( CMAKE_C_FLAGS "${ANDROID_CXX_FLAGS} ${CMAKE_C_FLAGS}" )
-if( MIPS AND BUILD_WITH_ANDROID_NDK )
- set( CMAKE_SHARED_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}/mipsel-linux-android/lib/ldscripts/elf32btsmip.xsc ${ANDROID_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}" )
- set( CMAKE_MODULE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}/mipsel-linux-android/lib/ldscripts/elf32btsmip.xsc ${ANDROID_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}" )
- set( CMAKE_EXE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}/mipsel-linux-android/lib/ldscripts/elf32btsmip.x ${ANDROID_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" )
- # todo: should we use elf64btsmip.xsc on x64 host platforms ?
- #set( CMAKE_SHARED_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}/mipsel-linux-android/lib/ldscripts/elf64btsmip.xsc ${ANDROID_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}" )
- #set( CMAKE_MODULE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}/mipsel-linux-android/lib/ldscripts/elf64btsmip.xsc ${ANDROID_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}" )
- #set( CMAKE_EXE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}/mipsel-linux-android/lib/ldscripts/elf64btsmip.x ${ANDROID_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" )
+set( CMAKE_CXX_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELEASE}" )
+set( CMAKE_C_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE} ${CMAKE_C_FLAGS_RELEASE}" )
+set( CMAKE_CXX_FLAGS_DEBUG "${ANDROID_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_DEBUG}" )
+set( CMAKE_C_FLAGS_DEBUG "${ANDROID_CXX_FLAGS_DEBUG} ${CMAKE_C_FLAGS_DEBUG}" )
+set( CMAKE_SHARED_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}" )
+set( CMAKE_MODULE_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}" )
+set( CMAKE_EXE_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" )
+
+if( MIPS AND BUILD_WITH_ANDROID_NDK AND ANDROID_NDK_RELEASE STREQUAL "r8" )
+ set( CMAKE_SHARED_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_SHARED_LINKER_FLAGS}" )
+ set( CMAKE_MODULE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_MODULE_LINKER_FLAGS}" )
+ set( CMAKE_EXE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.x ${CMAKE_EXE_LINKER_FLAGS}" )
+endif()
+
+# pie/pic
+if( NOT (ANDROID_NATIVE_API_LEVEL LESS 16) AND (NOT DEFINED ANDROID_APP_PIE OR ANDROID_APP_PIE) AND (CMAKE_VERSION VERSION_GREATER 2.8.8) )
+ set( CMAKE_POSITION_INDEPENDENT_CODE TRUE )
+ set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIE -pie")
else()
- set( CMAKE_SHARED_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}" )
- set( CMAKE_MODULE_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}" )
- set( CMAKE_EXE_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" )
+ set( CMAKE_POSITION_INDEPENDENT_CODE FALSE )
+ set( CMAKE_CXX_FLAGS "-fpic ${CMAKE_CXX_FLAGS}" )
+ set( CMAKE_C_FLAGS "-fpic ${CMAKE_C_FLAGS}" )
+endif()
+
+# configure rtti
+if( DEFINED ANDROID_RTTI AND ANDROID_STL_FORCE_FEATURES )
+ if( ANDROID_RTTI )
+ set( CMAKE_CXX_FLAGS "-frtti ${CMAKE_CXX_FLAGS}" )
+ else()
+ set( CMAKE_CXX_FLAGS "-fno-rtti ${CMAKE_CXX_FLAGS}" )
+ endif()
+endif()
+
+# configure exceptios
+if( DEFINED ANDROID_EXCEPTIONS AND ANDROID_STL_FORCE_FEATURES )
+ if( ANDROID_EXCEPTIONS )
+ set( CMAKE_CXX_FLAGS "-fexceptions ${CMAKE_CXX_FLAGS}" )
+ set( CMAKE_C_FLAGS "-fexceptions ${CMAKE_C_FLAGS}" )
+ else()
+ set( CMAKE_CXX_FLAGS "-fno-exceptions ${CMAKE_CXX_FLAGS}" )
+ set( CMAKE_C_FLAGS "-fno-exceptions ${CMAKE_C_FLAGS}" )
+ endif()
+endif()
+
+# global includes and link directories
+include_directories( SYSTEM "${ANDROID_SYSROOT}/usr/include" ${ANDROID_STL_INCLUDE_DIRS} )
+get_filename_component(__android_install_path "${CMAKE_INSTALL_PREFIX}/libs/${ANDROID_NDK_ABI_NAME}" ABSOLUTE) # avoid CMP0015 policy warning
+link_directories( "${__android_install_path}" )
+
+# detect if need link crtbegin_so.o explicitly
+if( NOT DEFINED ANDROID_EXPLICIT_CRT_LINK )
+ set( __cmd "${CMAKE_CXX_CREATE_SHARED_LIBRARY}" )
+ string( REPLACE "<CMAKE_CXX_COMPILER>" "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}" __cmd "${__cmd}" )
+ string( REPLACE "<CMAKE_C_COMPILER>" "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}" __cmd "${__cmd}" )
+ string( REPLACE "<CMAKE_SHARED_LIBRARY_CXX_FLAGS>" "${CMAKE_CXX_FLAGS}" __cmd "${__cmd}" )
+ string( REPLACE "<LANGUAGE_COMPILE_FLAGS>" "" __cmd "${__cmd}" )
+ string( REPLACE "<LINK_FLAGS>" "${CMAKE_SHARED_LINKER_FLAGS}" __cmd "${__cmd}" )
+ string( REPLACE "<CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS>" "-shared" __cmd "${__cmd}" )
+ string( REPLACE "<CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG>" "" __cmd "${__cmd}" )
+ string( REPLACE "<TARGET_SONAME>" "" __cmd "${__cmd}" )
+ string( REPLACE "<TARGET>" "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/toolchain_crtlink_test.so" __cmd "${__cmd}" )
+ string( REPLACE "<OBJECTS>" "\"${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o\"" __cmd "${__cmd}" )
+ string( REPLACE "<LINK_LIBRARIES>" "" __cmd "${__cmd}" )
+ separate_arguments( __cmd )
+ foreach( __var ANDROID_NDK ANDROID_NDK_TOOLCHAINS_PATH ANDROID_STANDALONE_TOOLCHAIN )
+ if( ${__var} )
+ set( __tmp "${${__var}}" )
+ separate_arguments( __tmp )
+ string( REPLACE "${__tmp}" "${${__var}}" __cmd "${__cmd}")
+ endif()
+ endforeach()
+ string( REPLACE "'" "" __cmd "${__cmd}" )
+ string( REPLACE "\"" "" __cmd "${__cmd}" )
+ execute_process( COMMAND ${__cmd} RESULT_VARIABLE __cmd_result OUTPUT_QUIET ERROR_QUIET )
+ if( __cmd_result EQUAL 0 )
+ set( ANDROID_EXPLICIT_CRT_LINK ON )
+ else()
+ set( ANDROID_EXPLICIT_CRT_LINK OFF )
+ endif()
+endif()
+
+if( ANDROID_EXPLICIT_CRT_LINK )
+ set( CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} \"${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o\"" )
+ set( CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE} \"${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o\"" )
endif()
+# setup output directories
+set( CMAKE_INSTALL_PREFIX "${ANDROID_TOOLCHAIN_ROOT}/user" CACHE STRING "path for installing" )
+
+if( DEFINED LIBRARY_OUTPUT_PATH_ROOT
+ OR EXISTS "${CMAKE_SOURCE_DIR}/AndroidManifest.xml"
+ OR (EXISTS "${CMAKE_SOURCE_DIR}/../AndroidManifest.xml" AND EXISTS "${CMAKE_SOURCE_DIR}/../jni/") )
+ set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_SOURCE_DIR} CACHE PATH "Root for binaries output, set this to change where Android libs are installed to" )
+ if( NOT _CMAKE_IN_TRY_COMPILE )
+ if( EXISTS "${CMAKE_SOURCE_DIR}/jni/CMakeLists.txt" )
+ set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin/${ANDROID_NDK_ABI_NAME}" CACHE PATH "Output directory for applications" )
+ else()
+ set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin" CACHE PATH "Output directory for applications" )
+ endif()
+ set( LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}" CACHE PATH "Output directory for Android libs" )
+ endif()
+endif()
+
+# copy shaed stl library to build directory
+if( NOT _CMAKE_IN_TRY_COMPILE AND __libstl MATCHES "[.]so$" AND DEFINED LIBRARY_OUTPUT_PATH )
+ get_filename_component( __libstlname "${__libstl}" NAME )
+ execute_process( COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${__libstl}" "${LIBRARY_OUTPUT_PATH}/${__libstlname}" RESULT_VARIABLE __fileCopyProcess )
+ if( NOT __fileCopyProcess EQUAL 0 OR NOT EXISTS "${LIBRARY_OUTPUT_PATH}/${__libstlname}")
+ message( SEND_ERROR "Failed copying of ${__libstl} to the ${LIBRARY_OUTPUT_PATH}/${__libstlname}" )
+ endif()
+ unset( __fileCopyProcess )
+ unset( __libstlname )
+endif()
+
+
# set these global flags for cmake client scripts to change behavior
set( ANDROID True )
set( BUILD_ANDROID True )
@@ -1051,25 +1594,32 @@ macro( find_host_program )
endmacro()
-macro( ANDROID_GET_ABI_RAWNAME TOOLCHAIN_FLAG VAR )
- if( "${TOOLCHAIN_FLAG}" STREQUAL "ARMEABI" )
- set( ${VAR} "armeabi" )
- elseif( "${TOOLCHAIN_FLAG}" STREQUAL "ARMEABI_V7A" )
- set( ${VAR} "armeabi-v7a" )
- elseif( "${TOOLCHAIN_FLAG}" STREQUAL "X86" )
- set( ${VAR} "x86" )
- else()
- set( ${VAR} "unknown" )
- endif()
-endmacro()
-
-
# export toolchain settings for the try_compile() command
-if( NOT PROJECT_NAME STREQUAL "CMAKE_TRY_COMPILE" )
+if( NOT _CMAKE_IN_TRY_COMPILE )
set( __toolchain_config "")
- foreach( __var ANDROID_ABI ANDROID_FORCE_ARM_BUILD ANDROID_NATIVE_API_LEVEL ANDROID_NO_UNDEFINED ANDROID_SO_UNDEFINED ANDROID_SET_OBSOLETE_VARIABLES LIBRARY_OUTPUT_PATH_ROOT ANDROID_USE_STLPORT ANDROID_FORBID_SYGWIN ANDROID_NDK ANDROID_STANDALONE_TOOLCHAIN ANDROID_FUNCTION_LEVEL_LINKING __ndklibspath )
+ foreach( __var NDK_CCACHE LIBRARY_OUTPUT_PATH_ROOT ANDROID_FORBID_SYGWIN
+ ANDROID_NDK_HOST_X64
+ ANDROID_NDK
+ ANDROID_NDK_LAYOUT
+ ANDROID_STANDALONE_TOOLCHAIN
+ ANDROID_TOOLCHAIN_NAME
+ ANDROID_ABI
+ ANDROID_NATIVE_API_LEVEL
+ ANDROID_STL
+ ANDROID_STL_FORCE_FEATURES
+ ANDROID_FORCE_ARM_BUILD
+ ANDROID_NO_UNDEFINED
+ ANDROID_SO_UNDEFINED
+ ANDROID_FUNCTION_LEVEL_LINKING
+ ANDROID_GOLD_LINKER
+ ANDROID_NOEXECSTACK
+ ANDROID_RELRO
+ ANDROID_LIBM_PATH
+ ANDROID_EXPLICIT_CRT_LINK
+ ANDROID_APP_PIE
+ )
if( DEFINED ${__var} )
- if( "${__var}" MATCHES " ")
+ if( ${__var} MATCHES " ")
set( __toolchain_config "${__toolchain_config}set( ${__var} \"${${__var}}\" CACHE INTERNAL \"\" )\n" )
else()
set( __toolchain_config "${__toolchain_config}set( ${__var} ${${__var}} CACHE INTERNAL \"\" )\n" )
@@ -1078,79 +1628,85 @@ if( NOT PROJECT_NAME STREQUAL "CMAKE_TRY_COMPILE" )
endforeach()
file( WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/android.toolchain.config.cmake" "${__toolchain_config}" )
unset( __toolchain_config )
- unset( __ndklibspath )
endif()
-# set some obsolete variables for backward compatibility
-set( ANDROID_SET_OBSOLETE_VARIABLES ON CACHE BOOL "Define obsolete Andrid-specific cmake variables" )
-mark_as_advanced( ANDROID_SET_OBSOLETE_VARIABLES )
-if( ANDROID_SET_OBSOLETE_VARIABLES )
- set( ANDROID_API_LEVEL ${ANDROID_NATIVE_API_LEVEL} )
- set( ARM_TARGET "${ANDROID_ABI}" )
- set( ARMEABI_NDK_NAME "${ANDROID_NDK_ABI_NAME}" )
+# force cmake to produce / instead of \ in build commands for Ninja generator
+if( CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_HOST_WIN32 )
+ # it is a bad hack after all
+ # CMake generates Ninja makefiles with UNIX paths only if it thinks that we are going to build with MinGW
+ set( CMAKE_COMPILER_IS_MINGW TRUE ) # tell CMake that we are MinGW
+ set( CMAKE_CROSSCOMPILING TRUE ) # stop recursion
+ enable_language( C )
+ enable_language( CXX )
+ # unset( CMAKE_COMPILER_IS_MINGW ) # can't unset because CMake does not convert back-slashes in response files without it
+ unset( MINGW )
endif()
-# don't leave libs/ directories in source directory
-set(LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_LIBRARY_DIR})
# Variables controlling behavior or set by cmake toolchain:
-# ANDROID_ABI: "armeabi-v7a" (default), "armeabi", "armeabi-v7a with NEON", "armeabi-v7a with VFPV3", "armeabi-v6 with VFP", "x86", "mips"
-# ANDROID_NATIVE_API_LEVEL: 3,4,5,8,9,14 (depends on NDK version)
-# ANDROID_SET_OBSOLETE_VARIABLES: ON/OFF
-# ANDROID_USE_STLPORT: OFF/ON - EXPERIMENTAL!!!
-# ANDROID_FORBID_SYGWIN: ON/OFF
-# ANDROID_NO_UNDEFINED: ON/OFF
-# ANDROID_SO_UNDEFINED: OFF/ON (default depends on NDK version)
-# ANDROID_FUNCTION_LEVEL_LINKING: ON/OFF
-# Variables that takes effect only at first run:
-# ANDROID_FORCE_ARM_BUILD: ON/OFF
-# LIBRARY_OUTPUT_PATH_ROOT: <any valid path>
+# ANDROID_ABI : "armeabi-v7a" (default), "armeabi", "armeabi-v7a with NEON", "armeabi-v7a with VFPV3", "armeabi-v6 with VFP", "x86", "mips", "arm64-v8a", "x86_64", "mips64"
+# ANDROID_NATIVE_API_LEVEL : 3,4,5,8,9,14,15,16,17,18,19,21 (depends on NDK version)
+# ANDROID_STL : gnustl_static/gnustl_shared/stlport_static/stlport_shared/gabi++_static/gabi++_shared/system_re/system/none
+# ANDROID_FORBID_SYGWIN : ON/OFF
+# ANDROID_NO_UNDEFINED : ON/OFF
+# ANDROID_SO_UNDEFINED : OFF/ON (default depends on NDK version)
+# ANDROID_FUNCTION_LEVEL_LINKING : ON/OFF
+# ANDROID_GOLD_LINKER : ON/OFF
+# ANDROID_NOEXECSTACK : ON/OFF
+# ANDROID_RELRO : ON/OFF
+# ANDROID_FORCE_ARM_BUILD : ON/OFF
+# ANDROID_STL_FORCE_FEATURES : ON/OFF
+# ANDROID_LIBM_PATH : path to libm.so (set to something like $(TOP)/out/target/product/<product_name>/obj/lib/libm.so) to workaround unresolved `sincos`
# Can be set only at the first run:
-# ANDROID_NDK
+# ANDROID_NDK : path to your NDK install
+# NDK_CCACHE : path to your ccache executable
+# ANDROID_TOOLCHAIN_NAME : the NDK name of compiler toolchain
+# ANDROID_NDK_HOST_X64 : try to use x86_64 toolchain (default for x64 host systems)
+# ANDROID_NDK_LAYOUT : the inner NDK structure (RELEASE, LINARO, ANDROID)
+# LIBRARY_OUTPUT_PATH_ROOT : <any valid path>
# ANDROID_STANDALONE_TOOLCHAIN
-# ANDROID_TOOLCHAIN_NAME: "arm-linux-androideabi-4.4.3" or "arm-linux-androideabi-4.6" or "mipsel-linux-android-4.4.3" or "mipsel-linux-android-4.6" or "x86-4.4.3" or "x86-4.6"
-# Obsolete:
-# ANDROID_API_LEVEL: superseded by ANDROID_NATIVE_API_LEVEL
-# ARM_TARGET: superseded by ANDROID_ABI
-# ARM_TARGETS: superseded by ANDROID_ABI (can be set only)
-# ANDROID_NDK_TOOLCHAIN_ROOT: superseded by ANDROID_STANDALONE_TOOLCHAIN (can be set only)
-# ANDROID_LEVEL: superseded by ANDROID_NATIVE_API_LEVEL (completely removed)
#
# Primary read-only variables:
-# ANDROID: always TRUE
-# ARMEABI: TRUE for arm v6 and older devices
-# ARMEABI_V6: TRUE for arm v6
-# ARMEABI_V7A: TRUE for arm v7a
-# NEON: TRUE if NEON unit is enabled
-# VFPV3: TRUE if VFP version 3 is enabled
-# X86: TRUE if configured for x86
-# BUILD_ANDROID: always TRUE
-# BUILD_WITH_ANDROID_NDK: TRUE if NDK is used
-# BUILD_WITH_STANDALONE_TOOLCHAIN: TRUE if standalone toolchain is used
-# ANDROID_NDK_HOST_SYSTEM_NAME: "windows", "linux-x86" or "darwin-x86" depending on host platform
-# ANDROID_NDK_HOST_SYSTEM_ARCH: "x86", "x64" depending on host platform
-# ANDROID_NDK_ABI_NAME: "armeabi", "armeabi-v7a" or "x86" depending on ANDROID_ABI
-# ANDROID_ARCH_NAME: "arm" or "x86" or "mips" depending on ANDROID_ABI
-# TOOL_OS_SUFFIX: "" or ".exe" depending on host platform
-# ANDROID_SYSROOT: path to the compiler sysroot
-# ANDROID_SYSTEM_INCLUDE_DIRS
-# ANDROID_SYSTEM_LIB_DIRS
-# Obsolete:
-# ARMEABI_NDK_NAME: superseded by ANDROID_NDK_ABI_NAME
+# ANDROID : always TRUE
+# ARMEABI : TRUE for arm v6 and older devices
+# ARMEABI_V6 : TRUE for arm v6
+# ARMEABI_V7A : TRUE for arm v7a
+# ARM64_V8A : TRUE for arm64-v8a
+# NEON : TRUE if NEON unit is enabled
+# VFPV3 : TRUE if VFP version 3 is enabled
+# X86 : TRUE if configured for x86
+# X86_64 : TRUE if configured for x86_64
+# MIPS : TRUE if configured for mips
+# MIPS64 : TRUE if configured for mips64
+# BUILD_WITH_ANDROID_NDK : TRUE if NDK is used
+# BUILD_WITH_STANDALONE_TOOLCHAIN : TRUE if standalone toolchain is used
+# ANDROID_NDK_HOST_SYSTEM_NAME : "windows", "linux-x86" or "darwin-x86" depending on host platform
+# ANDROID_NDK_ABI_NAME : "armeabi", "armeabi-v7a", "x86", "mips", "arm64-v8a", "x86_64", "mips64" depending on ANDROID_ABI
+# ANDROID_NDK_RELEASE : from r5 to r10d; set only for NDK
+# ANDROID_NDK_RELEASE_NUM : numeric ANDROID_NDK_RELEASE version (1000*major+minor)
+# ANDROID_ARCH_NAME : "arm", "x86", "mips", "arm64", "x86_64", "mips64" depending on ANDROID_ABI
+# ANDROID_SYSROOT : path to the compiler sysroot
+# TOOL_OS_SUFFIX : "" or ".exe" depending on host platform
+# ANDROID_COMPILER_IS_CLANG : TRUE if clang compiler is used
#
# Secondary (less stable) read-only variables:
-# ANDROID_COMPILER_VERSION: GCC version used
-# ANDROID_CXX_FLAGS: C/C++ compiler flags required by Android platform
-# ANDROID_SUPPORTED_ABIS: list of currently allowed values for ANDROID_ABI
-# ANDROID_TOOLCHAIN_MACHINE_NAME: "arm-linux-androideabi", "arm-eabi" or "i686-android-linux"
-# ANDROID_TOOLCHAIN_ROOT: path to the top level of toolchain (standalone or placed inside NDK)
-# ANDROID_SUPPORTED_NATIVE_API_LEVELS: list of native API levels found inside NDK
+# ANDROID_COMPILER_VERSION : GCC version used (not Clang version)
+# ANDROID_CLANG_VERSION : version of clang compiler if clang is used
+# ANDROID_CXX_FLAGS : C/C++ compiler flags required by Android platform
+# ANDROID_SUPPORTED_ABIS : list of currently allowed values for ANDROID_ABI
+# ANDROID_TOOLCHAIN_MACHINE_NAME : "arm-linux-androideabi", "arm-eabi" or "i686-android-linux"
+# ANDROID_TOOLCHAIN_ROOT : path to the top level of toolchain (standalone or placed inside NDK)
+# ANDROID_CLANG_TOOLCHAIN_ROOT : path to clang tools
+# ANDROID_SUPPORTED_NATIVE_API_LEVELS : list of native API levels found inside NDK
+# ANDROID_STL_INCLUDE_DIRS : stl include paths
+# ANDROID_RTTI : if rtti is enabled by the runtime
+# ANDROID_EXCEPTIONS : if exceptions are enabled by the runtime
+# ANDROID_GCC_TOOLCHAIN_NAME : read-only, differs from ANDROID_TOOLCHAIN_NAME only if clang is used
#
# Defaults:
# ANDROID_DEFAULT_NDK_API_LEVEL
# ANDROID_DEFAULT_NDK_API_LEVEL_${ARCH}
# ANDROID_NDK_SEARCH_PATHS
-# ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH
# ANDROID_SUPPORTED_ABIS_${ARCH}
-# ANDROID_SUPPORTED_NDK_VERSIONS
+# ANDROID_SUPPORTED_NDK_VERSIONS \ No newline at end of file
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 2fa5dae..df02266 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -2,14 +2,14 @@
# find doxygen
if(SFML_OS_MACOSX)
# Add some path to search doxygen in more directories.
- set(ADDITIONAL_PATHS
- /Developer/Applications/Doxygen.app/Contents/Resources
- /Developer/Applications/Doxygen.app/Contents/MacOS
- $ENV{HOME}/Applications/Doxygen.app/Contents/Resources
- $ENV{HOME}/Applications/Doxygen.app/Contents/MacOS
- $ENV{HOME}/Applications/Developer/Doxygen.app/Contents/Resources
+ set(ADDITIONAL_PATHS
+ /Developer/Applications/Doxygen.app/Contents/Resources
+ /Developer/Applications/Doxygen.app/Contents/MacOS
+ $ENV{HOME}/Applications/Doxygen.app/Contents/Resources
+ $ENV{HOME}/Applications/Doxygen.app/Contents/MacOS
+ $ENV{HOME}/Applications/Developer/Doxygen.app/Contents/Resources
$ENV{HOME}/Applications/Developer/Doxygen.app/Contents/MacOS)
-
+
set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${ADDITIONAL_PATHS})
endif()
@@ -24,7 +24,7 @@ if(SFML_OS_WINDOWS)
# if HHC is found, we can generate the CHM (compressed HTML) output
find_program(DOXYGEN_HHC_PROGRAM
NAMES hhc.exe
- PATHS "c:/Program Files/HTML Help Workshop"
+ PATHS "C:/Program Files/HTML Help Workshop" "C:/Program Files (x86)/HTML Help Workshop"
DOC "HTML Help Compiler program")
if(DOXYGEN_HHC_PROGRAM)
set(DOXYGEN_GENERATE_HTMLHELP YES)
@@ -39,6 +39,7 @@ endif()
# configure the source Doxyfile by copying it and replacing all @variables@
set(DOXYGEN_CONFIGURED_INPUT ${DOXYGEN_OUTPUT_DIR}/doxyfile)
configure_file(${DOXYGEN_INPUT_DIR}/doc/doxyfile.in ${DOXYGEN_CONFIGURED_INPUT} @ONLY)
+configure_file(${DOXYGEN_INPUT_DIR}/doc/header.html.in ${DOXYGEN_OUTPUT_DIR}/header.html @ONLY)
# copy the files needed by the documentation
configure_file(${DOXYGEN_INPUT_DIR}/doc/doxygen.css ${DOXYGEN_OUTPUT_DIR}/html/doxygen.css COPYONLY)
diff --git a/doc/doxyfile.in b/doc/doxyfile.in
index 7d291fa..47622e6 100644
--- a/doc/doxyfile.in
+++ b/doc/doxyfile.in
@@ -1,90 +1,122 @@
-# Doxyfile 1.5.8
+# Doxyfile 1.8.8
# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
+# doxygen (www.doxygen.org) for a project.
#
-# All text after a hash (#) is considered a comment and will be ignored
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
+# that follow. The default is UTF-8 which is also the encoding used for all text
+# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
+# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
+# for the list of possible encodings.
+# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
PROJECT_NAME = SFML
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
PROJECT_NUMBER = @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
+# the documentation. The maximum height of the logo should not exceed 55 pixels
+# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
+# to the output directory.
+
+PROJECT_LOGO =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
OUTPUT_DIRECTORY = "@DOXYGEN_OUTPUT_DIR@"
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
CREATE_SUBDIRS = NO
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES = NO
+
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
-# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
-# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
-# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
-# Spanish, Swedish, and Ukrainian.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
OUTPUT_LANGUAGE = English
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
+# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
BRIEF_MEMBER_DESC = YES
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
+# The default value is: YES.
REPEAT_BRIEF = YES
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
@@ -99,8 +131,9 @@ ABBREVIATE_BRIEF = "The $name class" \
the
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
+# doxygen will generate a detailed section even if there is only a brief
# description.
+# The default value is: NO.
ALWAYS_DETAILED_SEC = YES
@@ -108,152 +141,207 @@ ALWAYS_DETAILED_SEC = YES
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
+# The default value is: NO.
INLINE_INHERITED_MEMB = YES
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
+# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
FULL_PATH_NAMES = NO
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
STRIP_FROM_PATH =
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
STRIP_FROM_INC_PATH =
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
SHORT_NAMES = NO
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
JAVADOC_AUTOBRIEF = YES
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
QT_AUTOBRIEF = NO
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
MULTILINE_CPP_IS_BRIEF = NO
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
INHERIT_DOCS = YES
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
+# new page for each member. If set to NO, the documentation of a member will be
+# part of the file/class/namespace that contains it.
+# The default value is: NO.
SEPARATE_MEMBER_PAGES = NO
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
TAB_SIZE = 4
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines.
ALIASES =
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding "class=itcl::class"
+# will allow you to use the command class in the itcl::class meaning.
+
+TCL_SUBST =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
OPTIMIZE_OUTPUT_FOR_C = NO
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
OPTIMIZE_FOR_FORTRAN = NO
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
OPTIMIZE_OUTPUT_VHDL = NO
-# Doxygen selects the parser to use depending on the extension of the files it parses.
-# With this tag you can assign which parser to use for a given extension.
-# Doxygen has a built-in mapping, but you can override or extend it using this tag.
-# The format is ext=language, where ext is a file extension, and language is one of
-# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
-# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
-# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
-# use: inc=Fortran f=C
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
+# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
+# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
+# Fortran. In the later case the parser tries to guess whether the code is fixed
+# or free formatted code, this is the default for Fortran type files), VHDL. For
+# instance to make doxygen treat .inc files as Fortran files (default is PHP),
+# and .f files as C (default is Fortran), use: inc=Fortran f=C.
+#
+# Note For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen.
EXTENSION_MAPPING =
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT = NO
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by by putting a % sign in front of the word
+# or globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT = YES
+
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
BUILTIN_STL_SUPPORT = NO
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
+# The default value is: NO.
CPP_CLI_SUPPORT = NO
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
SIP_SUPPORT = NO
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen to replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
IDL_PROPERTY_SUPPORT = YES
@@ -261,347 +349,455 @@ IDL_PROPERTY_SUPPORT = YES
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
+# The default value is: NO.
DISTRIBUTE_GROUP_DOC = NO
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
SUBGROUPING = YES
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
TYPEDEF_HIDES_STRUCT = NO
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penality.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will rougly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE = 0
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
EXTRACT_ALL = NO
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
EXTRACT_PRIVATE = NO
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
EXTRACT_STATIC = YES
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
EXTRACT_LOCAL_CLASSES = YES
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
+# This flag is only useful for Objective-C code. When set to YES local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO only methods in the interface are
+# included.
+# The default value is: NO.
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespace are hidden.
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
EXTRACT_ANON_NSPACES = NO
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
HIDE_UNDOC_MEMBERS = NO
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO these classes will be included in the various overviews. This option has
+# no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
HIDE_UNDOC_CLASSES = NO
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# (class|struct|union) declarations. If set to NO these declarations will be
+# included in the documentation.
+# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = NO
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
HIDE_IN_BODY_DOCS = NO
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
INTERNAL_DOCS = NO
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
+# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
+# names in lower-case letters. If set to YES upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
+# The default value is: system dependent.
CASE_SENSE_NAMES = YES
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES the
+# scope will be hidden.
+# The default value is: NO.
HIDE_SCOPE_NAMES = NO
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
SHOW_INCLUDE_FILES = YES
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
INLINE_INFO = YES
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO the members will appear in declaration order.
+# The default value is: YES.
SORT_MEMBER_DOCS = YES
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
SORT_BRIEF_DOCS = NO
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
SORT_GROUP_NAMES = NO
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
SORT_BY_SCOPE_NAME = NO
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
+# todo list. This list is created by putting \todo commands in the
+# documentation.
+# The default value is: YES.
GENERATE_TODOLIST = YES
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
+# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
+# test list. This list is created by putting \test commands in the
+# documentation.
+# The default value is: YES.
GENERATE_TESTLIST = YES
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
+# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
GENERATE_BUGLIST = YES
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
+# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
GENERATE_DEPRECATEDLIST= YES
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
ENABLED_SECTIONS =
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
MAX_INITIALIZER_LINES = 30
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES the list
+# will mention the files that were used to generate the documentation.
+# The default value is: YES.
SHOW_USED_FILES = YES
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES = NO
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
SHOW_FILES = YES
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page. This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
SHOW_NAMESPACES = YES
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# doxygen should invoke to get the current version for each file (typically from
# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
FILE_VERSION_FILTER =
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
-# doxygen. The layout file controls the global structure of the generated output files
-# in an output format independent way. The create the layout file that represents
-# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
-# file name after the option, if omitted DoxygenLayout.xml will be used as the name
-# of the layout file.
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
LAYOUT_FILE =
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. See also \cite for info how to create references.
+
+CITE_BIB_FILES =
+
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
QUIET = NO
# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
+# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
WARNINGS = YES
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
+# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
WARN_IF_UNDOCUMENTED = YES
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
WARN_IF_DOC_ERROR = YES
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO doxygen will only warn about wrong or incomplete parameter
+# documentation, but not about the absence of documentation.
+# The default value is: NO.
WARN_NO_PARAMDOC = YES
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
WARN_FORMAT = "$file:$line: $text"
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
WARN_LOGFILE =
#---------------------------------------------------------------------------
-# configuration options related to the input files
+# Configuration options related to the input files
#---------------------------------------------------------------------------
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces.
+# Note: If this tag is empty the current directory is searched.
INPUT = "@DOXYGEN_INPUT_DIR@/include/SFML" \
"@DOXYGEN_INPUT_DIR@/doc/mainpage.hpp"
# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see: http://www.gnu.org/software/libiconv) for the list of
+# possible encodings.
+# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank the
+# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
+# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
+# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
+# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
+# *.qsf, *.as and *.js.
FILE_PATTERNS = *.hpp
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
RECURSIVE = YES
-# The EXCLUDE tag can be used to specify files and/or directories that should
+# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
EXCLUDE =
@@ -613,191 +809,301 @@ EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS = .svn \
- Linux \
- Unix \
- OSX*
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = .git \
+ extlibs \
+ src \
+ examples \
+ install \
+ build \
+ tools \
+ cmake
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS = priv
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
EXAMPLE_PATTERNS = *
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
EXAMPLE_RECURSIVE = NO
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output. If FILTER_PATTERNS is specified, this tag will be
-# ignored.
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
FILTER_PATTERNS =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# INPUT_FILTER ) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
FILTER_SOURCE_FILES = NO
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE =
+
#---------------------------------------------------------------------------
-# configuration options related to source browsing
+# Configuration options related to source browsing
#---------------------------------------------------------------------------
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
SOURCE_BROWSER = YES
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
INLINE_SOURCES = NO
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
STRIP_CODE_COMMENTS = YES
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# function all documented functions referencing it will be listed.
+# The default value is: NO.
REFERENCED_BY_RELATION = NO
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
REFERENCES_RELATION = NO
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code. Otherwise they will link to the documentation.
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
REFERENCES_LINK_SOURCE = NO
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see http://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
USE_HTAGS = NO
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
VERBATIM_HEADERS = YES
+# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the
+# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the
+# cost of reduced performance. This can be particularly helpful with template
+# rich C++ code for which doxygen's built-in parser lacks the necessary type
+# information.
+# Note: The availability of this option depends on whether or not doxygen was
+# compiled with the --with-libclang option.
+# The default value is: NO.
+
+# Generates warnings with Clang
+#CLANG_ASSISTED_PARSING = NO
+
+# If clang assisted parsing is enabled you can provide the compiler with command
+# line options that you would normally use when invoking the compiler. Note that
+# the include paths will already be set by doxygen for the files and directories
+# specified with INPUT and INCLUDE_PATH.
+# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
+
+# Generates warnings with Clang
+#CLANG_OPTIONS =
+
#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
+# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
ALPHABETICAL_INDEX = YES
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
+# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
+# which the alphabetical index list will be split.
+# Minimum value: 1, maximum value: 20, default value: 5.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
COLS_IN_ALPHA_INDEX = 5
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
-# configuration options related to the HTML output
+# Configuration options related to the HTML output
#---------------------------------------------------------------------------
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
+# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
+# The default value is: YES.
GENERATE_HTML = YES
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_OUTPUT = html
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_FILE_EXTENSION = .htm
+HTML_FILE_EXTENSION = .html
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
# standard header.
-
-HTML_HEADER = "@DOXYGEN_INPUT_DIR@/doc/header.htm"
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER = "@DOXYGEN_INPUT_DIR@/doc/footer.htm"
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_HEADER = "@DOXYGEN_OUTPUT_DIR@/header.html"
+
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FOOTER = "@DOXYGEN_INPUT_DIR@/doc/footer.html"
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_STYLESHEET = "@DOXYGEN_INPUT_DIR@/doc/doxygen.css"
@@ -805,400 +1111,831 @@ HTML_STYLESHEET = "@DOXYGEN_INPUT_DIR@/doc/doxygen.css"
# files or namespaces will be aligned in HTML using tables. If set to
# NO a bullet list will be used.
-HTML_ALIGN_MEMBERS = YES
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# cascading style sheets that are included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefor more robust against future updates.
+# Doxygen will copy the style sheet files to the output directory.
+# Note: The order of the extra stylesheet files is of importance (e.g. the last
+# stylesheet in the list overrules the setting of the previous ones in the
+# list). For an example see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the stylesheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_TIMESTAMP = NO
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_SECTIONS = NO
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see: http://developer.apple.com/tools/xcode/), introduced with
+# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
+# Makefile in the HTML output directory. Running make will produce the docset in
+# that directory and running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_DOCSET = NO
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_FEEDNAME = "SFML Documentation"
+
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_BUNDLE_ID = org.sfml-dev.SFML
-DOCSET_FEEDNAME = "Doxygen generated docs"
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
+DOCSET_PUBLISHER_ID = org.sfml-dev.SFML
-DOCSET_BUNDLE_ID = org.doxygen.Project
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
+DOCSET_PUBLISHER_NAME = SFML
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
+# Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_HTMLHELP = @DOXYGEN_GENERATE_HTMLHELP@
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_FILE = ../SFML.chm
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler ( hhc.exe). If non-empty
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
HHC_LOCATION = "@DOXYGEN_HHC_PROGRAM@"
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
+# The GENERATE_CHI flag controls if a separate .chi index file is generated (
+# YES) or that it should be included in the master .chm file ( NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
GENERATE_CHI = NO
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_INDEX_ENCODING =
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
+# The BINARY_TOC flag controls whether a binary table of contents is generated (
+# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
BINARY_TOC = NO
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
TOC_EXPAND = NO
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
-# are set, an additional index file will be generated that can be used as input for
-# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
-# HTML documentation.
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_QHP = NO
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QCH_FILE =
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
-QHP_NAMESPACE =
+QHP_NAMESPACE = org.doxygen.Project
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
+# folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_VIRTUAL_FOLDER = doc
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
-# For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_NAME =
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_ATTRS =
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
-# filter section matches.
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
+# The QHG_LOCATION tag can be used to specify the location of Qt's
+# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
+# generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION =
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
DISABLE_INDEX = NO
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE = 1
-
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to FRAME, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
-# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
-# probably better off using the HTML help feature. Other possible values
-# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
-# and Class Hierarchy pages using a tree view instead of an ordered list;
-# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
-# disables this behavior completely. For backwards compatibility with previous
-# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
-# respectively.
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_TREEVIEW = NO
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
TREEVIEW_WIDTH = 250
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_FONTSIZE = 10
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# http://www.mathjax.org) which uses client side Javascript for the rendering
+# instead of using prerendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from http://www.mathjax.org before deployment.
+# The default value is: http://cdn.mathjax.org/mathjax/latest.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SEARCHENGINE = NO
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using Javascript. There
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SERVER_BASED_SEARCH = NO
+
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer ( doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer ( doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/). See the section "External Indexing and
+# Searching" for details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHENGINE_URL =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHDATA_FILE = searchdata.xml
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH_ID =
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTRA_SEARCH_MAPPINGS =
+
#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
+# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
+# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
+# The default value is: YES.
GENERATE_LATEX = NO
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
+# invoked.
+#
+# Note that when enabling USE_PDFLATEX this option is only used for generating
+# bitmaps for formulas in the HTML output, but not in the Makefile that is
+# written to the output directory.
+# The default file is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = latex
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
MAKEINDEX_CMD_NAME = makeindex
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
+# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
COMPACT_LATEX = NO
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
-PAPER_TYPE = a4wide
+PAPER_TYPE = a4
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. To get the times font for
+# instance you can specify
+# EXTRA_PACKAGES=times
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
EXTRA_PACKAGES =
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
+# generated LaTeX document. The header should contain everything until the first
+# chapter. If it is left blank doxygen will generate a standard header. See
+# section "Doxygen usage" for information on how to let doxygen write the
+# default header to a separate file.
+#
+# Note: Only use a user-defined header if you know what you are doing! The
+# following commands have a special meaning inside the header: $title,
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
+# $projectbrief, $projectlogo. Doxygen will replace $title with the empy string,
+# for the replacement values of the other commands the user is refered to
+# HTML_HEADER.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HEADER =
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
+# generated LaTeX document. The footer should contain everything after the last
+# chapter. If it is left blank doxygen will generate a standard footer. See
+# LATEX_HEADER for more information on how to generate a default footer and what
+# special commands can be used inside the footer.
+#
+# Note: Only use a user-defined footer if you know what you are doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_FOOTER =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
-PDF_HYPERLINKS = NO
+PDF_HYPERLINKS = YES
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
+# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
+# the PDF file directly from the LaTeX files. Set this option to YES to get a
# higher quality PDF documentation.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
-USE_PDFLATEX = NO
+USE_PDFLATEX = YES
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help. This option is also used
+# when generating formulas in HTML.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BATCHMODE = NO
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HIDE_INDICES = NO
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
+# code with syntax highlighting in the LaTeX output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_SOURCE_CODE = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. See
+# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BIB_STYLE = plain
+
#---------------------------------------------------------------------------
-# configuration options related to the RTF output
+# Configuration options related to the RTF output
#---------------------------------------------------------------------------
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
+# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
GENERATE_RTF = NO
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_OUTPUT = rtf
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
+# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
COMPACT_RTF = NO
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_HYPERLINKS = NO
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
+# Load stylesheet definitions from file. Syntax is similar to doxygen's config
+# file, i.e. a series of assignments. You only have to provide replacements,
+# missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_STYLESHEET_FILE =
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's config file. A template extensions file can be generated
+# using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
-# configuration options related to the man page output
+# Configuration options related to the man page output
#---------------------------------------------------------------------------
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
+# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
GENERATE_MAN = NO
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_OUTPUT = man
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_EXTENSION = .3
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_SUBDIR =
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_LINKS = NO
#---------------------------------------------------------------------------
-# configuration options related to the XML output
+# Configuration options related to the XML output
#---------------------------------------------------------------------------
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
+# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
GENERATE_XML = NO
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
XML_OUTPUT = xml
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
+# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
-XML_SCHEMA =
+XML_PROGRAMLISTING = YES
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
-XML_DTD =
+# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
+GENERATE_DOCBOOK = NO
-XML_PROGRAMLISTING = YES
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT = docbook
+
+# If the DOCBOOK_PROGRAMLISTING tag is set to YES doxygen will include the
+# program listings (including syntax highlighting and cross-referencing
+# information) to the DOCBOOK output. Note that enabling this will significantly
+# increase the size of the DOCBOOK output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
+# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
+# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
+# Definitions (see http://autogen.sf.net) file that captures the structure of
+# the code including all documentation. Note that this feature is still
+# experimental and incomplete at the moment.
+# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
+# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
+# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
GENERATE_PERLMOD = NO
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
+# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_LATEX = NO
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader. This is useful
-# if you want to understand what is going on. On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_PRETTY = YES
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_MAKEVAR_PREFIX =
@@ -1206,50 +1943,58 @@ PERLMOD_MAKEVAR_PREFIX =
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
+# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
ENABLE_PREPROCESSING = YES
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
+# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
+# in the source code. If set to NO only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
MACRO_EXPANSION = YES
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_ONLY_PREDEF = YES
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
+# If the SEARCH_INCLUDES tag is set to YES the includes files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
INCLUDE_FILE_PATTERNS =
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED = SFML_SYSTEM_API \
SFML_NETWORK_API \
@@ -1257,61 +2002,73 @@ PREDEFINED = SFML_SYSTEM_API \
SFML_AUDIO_API \
SFML_GRAPHICS_API
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_AS_DEFINED =
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
-# Configuration::additions related to external references
+# Configuration options related to external references
#---------------------------------------------------------------------------
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-# TAGFILES = file1 file2 ...
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
+# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have a unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
TAGFILES =
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
GENERATE_TAGFILE =
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
+# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
+# class index. If set to NO only the inherited external classes will be listed.
+# The default value is: NO.
ALLEXTERNALS = NO
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
+# the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
EXTERNAL_GROUPS = YES
+# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
+
+EXTERNAL_PAGES = YES
+
# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
+# interpreter (i.e. the result of 'which perl').
+# The default file (with absolute path) is: /usr/bin/perl.
PERL_PATH = /usr/bin/perl
@@ -1319,201 +2076,302 @@ PERL_PATH = /usr/bin/perl
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
+# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
# powerful graphs.
+# The default value is: YES.
CLASS_DIAGRAMS = YES
# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# command. Doxygen will then run the mscgen tool (see:
+# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.
MSCGEN_PATH =
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
+
+DIA_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: NO.
HAVE_DOT = NO
-# By default doxygen will write a font called FreeSans.ttf to the output
-# directory and reference it in all dot files that doxygen generates. This
-# font does not include all possible unicode characters however, so when you need
-# these (or just want a differently looking font) you can specify the font name
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
-# which can be done by putting it in a standard location or by setting the
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
-# containing the font.
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_FONTNAME = FreeSans
+DOT_NUM_THREADS = 0
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
-# The default size is 10pt.
+# When you want a differently looking font in the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTNAME = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTSIZE = 10
-# By default doxygen will tell dot to use the output directory to look for the
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
-# different font using DOT_FONTNAME you can set the path where dot
-# can find it using this tag.
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTPATH =
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
CLASS_GRAPH = YES
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
COLLABORATION_GRAPH = YES
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GROUP_GRAPHS = YES
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
UML_LOOK = NO
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LIMIT_NUM_FIELDS = 10
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
TEMPLATE_RELATIONS = NO
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDE_GRAPH = YES
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDED_BY_GRAPH = YES
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
CALL_GRAPH = NO
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
CALLER_GRAPH = NO
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GRAPHICAL_HIERARCHY = YES
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
+# generated by dot.
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, jpg, gif and svg.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_IMAGE_FORMAT = png
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INTERACTIVE_SVG = NO
+
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
DOTFILE_DIRS =
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS =
+
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS =
+
+# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
+# path where java can find the plantuml.jar file. If left blank, it is assumed
+# PlantUML is not used or called during a preprocessing step. Doxygen will
+# generate a warning when it encounters a \startuml command in this case and
+# will not generate output for the diagram.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+PLANTUML_JAR_PATH =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_GRAPH_MAX_NODES = 50
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_TRANSPARENT = NO
# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_MULTI_TARGETS = NO
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GENERATE_LEGEND = YES
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
+# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
+# files that are used to generate the various graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_CLEANUP = YES
-
-#---------------------------------------------------------------------------
-# Options related to the search engine
-#---------------------------------------------------------------------------
-
-# The SEARCHENGINE tag specifies whether or not a search engine should be
-# used. If set to NO the values of all tags below this one will be ignored.
-
-SEARCHENGINE = NO
diff --git a/doc/doxygen.css b/doc/doxygen.css
index d89e3a0..ed4e6e4 100644
--- a/doc/doxygen.css
+++ b/doc/doxygen.css
@@ -2,8 +2,7 @@
/* @group Heading Levels */
-div.contents .textblock h1
-{
+div.contents .textblock h1 {
text-align: left;
font-size: 20pt;
font-weight: normal;
@@ -17,192 +16,190 @@ div.contents .textblock h1
}
h1.groupheader {
- font-size: 150%;
+ font-size: 150%;
}
.title {
- font-size: 20pt;
- font-weight: normal;
- margin: 10px 2px;
+ font-size: 20pt;
+ font-weight: normal;
+ margin: 10px 2px;
}
dt {
- font-weight: bold;
+ font-weight: bold;
}
div.multicol {
- -moz-column-gap: 1em;
- -webkit-column-gap: 1em;
- -moz-column-count: 3;
- -webkit-column-count: 3;
+ -moz-column-gap: 1em;
+ -webkit-column-gap: 1em;
+ -moz-column-count: 3;
+ -webkit-column-count: 3;
}
p.startli, p.startdd, p.starttd {
- margin-top: 2px;
+ margin-top: 2px;
}
p.endli {
- margin-bottom: 0px;
+ margin-bottom: 0px;
}
p.enddd {
- margin-bottom: 4px;
+ margin-bottom: 4px;
}
p.endtd {
- margin-bottom: 2px;
+ margin-bottom: 2px;
}
/* @end */
caption {
- font-weight: bold;
+ font-weight: bold;
}
span.legend {
- font-size: 70%;
- text-align: center;
+ font-size: 70%;
+ text-align: center;
}
h3.version {
- font-size: 90%;
- text-align: center;
+ font-size: 90%;
+ text-align: center;
}
-div.qindex
-{
+div.qindex {
margin-bottom: 1em;
}
div.qindex, div.navtab{
- background-color: #eee;
- border: 1px solid #999;
- text-align: center;
+ background-color: #eee;
+ border: 1px solid #999;
+ text-align: center;
}
div.qindex, div.navpath {
- width: 100%;
- line-height: 140%;
+ width: 100%;
+ line-height: 140%;
}
div.navtab {
- margin-right: 15px;
+ margin-right: 15px;
}
/* @group Link Styling */
a.qindex {
- font-weight: bold;
+ font-weight: bold;
}
a.qindexHL {
- font-weight: bold;
- background-color: #9CAFD4;
- color: #ffffff;
- border: 1px double #869DCA;
+ font-weight: bold;
+ background-color: #9CAFD4;
+ color: #ffffff;
+ border: 1px double #869DCA;
}
/* @end */
dl.el {
- margin-left: -1cm;
+ margin-left: -1cm;
}
-a.el
-{
+a.el {
padding: 1px;
text-decoration: none;
color: #577E25;
}
-a.el:hover
-{
+a.el:hover {
text-decoration: underline;
}
pre.fragment {
- /*border: 1px solid #C4CFE5;
- background-color: #FBFCFD;
- padding: 4px 6px;
- margin: 4px 8px 4px 2px;
- overflow: auto;
- word-wrap: break-word;
- font-size: 9pt;
- line-height: 125%;
- font-family: monospace, fixed;
- font-size: 105%;*/
- font-family: Consolas, "Liberation Mono", Courier, monospace;
- font-size: 10pt;
- padding: 0.5em 1em;
- background-color: #f5f5f5;
- border: 1px solid #bbb;
- .border-radius(5px);
+ /*border: 1px solid #C4CFE5;
+ background-color: #FBFCFD;
+ padding: 4px 6px;
+ margin: 4px 8px 4px 2px;
+ overflow: auto;
+ word-wrap: break-word;
+ font-size: 9pt;
+ line-height: 125%;
+ font-family: monospace, fixed;
+ font-size: 105%;*/
+ font-family: Consolas, "Liberation Mono", Courier, monospace;
+ font-size: 10pt;
+ padding: 0.5em 1em;
+ background-color: #f5f5f5;
+ border: 1px solid #bbb;
+ border-radius(5px);
}
div.fragment {
- /*margin: 0 0 0 5px;
- padding: 0.5em 1em;
- font-family: Consolas, "Liberation Mono", Courier, monospace;
- font-size: 10pt;
- background-color: #eef7e3;
- border-left: 3px solid #8DC841;
- border-right: 0;
- border-bottom: 0;*/
-
- font-family: Consolas, "Liberation Mono", Courier, monospace;
- font-size: 10pt;
- padding: 0.5em 1em;
- background-color: #f5f5f5;
- border: 1px solid #bbb;
- .border-radius(5px);
+ /*margin: 0 0 0 5px;
+ padding: 0.5em 1em;
+ font-family: Consolas, "Liberation Mono", Courier, monospace;
+ font-size: 10pt;
+ background-color: #eef7e3;
+ border-left: 3px solid #8DC841;
+ border-right: 0;
+ border-bottom: 0;*/
+
+ font-family: Consolas, "Liberation Mono", Courier, monospace;
+ font-size: 10pt;
+ padding: 0.5em 1em;
+ background-color: #f5f5f5;
+ border: 1px solid #bbb;
+ border-radius(5px);
}
div.line {
- min-height: 13px;
- text-wrap: unrestricted;
- white-space: -moz-pre-wrap; /* Moz */
- white-space: -pre-wrap; /* Opera 4-6 */
- white-space: -o-pre-wrap; /* Opera 7 */
- white-space: pre-wrap; /* CSS3 */
- word-wrap: break-word; /* IE 5.5+ */
- text-indent: -53px;
- padding-left: 53px;
- padding-bottom: 0px;
- margin: 0px;
+ min-height: 13px;
+ text-wrap: unrestricted;
+ white-space: -moz-pre-wrap; /* Moz */
+ white-space: -pre-wrap; /* Opera 4-6 */
+ white-space: -o-pre-wrap; /* Opera 7 */
+ white-space: pre-wrap; /* CSS3 */
+ word-wrap: break-word; /* IE 5.5+ */
+ text-indent: -53px;
+ padding-left: 53px;
+ padding-bottom: 0px;
+ margin: 0px;
+ line-height: normal;
}
span.lineno {
- padding-right: 4px;
- text-align: right;
- background-color: #E8E8E8;
- white-space: pre;
+ padding-right: 4px;
+ text-align: right;
+ background-color: #E8E8E8;
+ white-space: pre;
}
div.ah {
width: 100%;
- background-color: #eee;
- font-weight: bold;
- color: #000;
- margin-bottom: 1px;
- margin-top: 1px;
- border: solid 1px #999;
+ background-color: #eee;
+ font-weight: bold;
+ color: #000;
+ margin-bottom: 1px;
+ margin-top: 1px;
+ border: solid 1px #999;
}
div.groupHeader {
- margin-left: 16px;
- margin-top: 12px;
- font-weight: bold;
+ margin-left: 16px;
+ margin-top: 12px;
+ font-weight: bold;
}
div.groupText {
- margin-left: 16px;
- font-style: italic;
+ margin-left: 16px;
+ font-style: italic;
}
body {
- background-color: white;
- color: black;
- margin: 0;
+ background-color: white;
+ color: black;
+ margin: 0;
}
div.contents {
@@ -211,198 +208,198 @@ div.contents {
}
td.indexkey {
- background-color: #EBEFF6;
- font-weight: bold;
- border: 1px solid #C4CFE5;
- margin: 2px 0px 2px 0;
- padding: 2px 10px;
- white-space: nowrap;
- vertical-align: top;
+ background-color: #EBEFF6;
+ font-weight: bold;
+ border: 1px solid #C4CFE5;
+ margin: 2px 0px 2px 0;
+ padding: 2px 10px;
+ white-space: nowrap;
+ vertical-align: top;
}
td.indexvalue {
- background-color: #EBEFF6;
- border: 1px solid #C4CFE5;
- padding: 2px 10px;
- margin: 2px 0px;
+ background-color: #EBEFF6;
+ border: 1px solid #C4CFE5;
+ padding: 2px 10px;
+ margin: 2px 0px;
}
tr.memlist {
- background-color: #EEF1F7;
+ background-color: #EEF1F7;
}
p.formulaDsp {
- text-align: center;
+ text-align: center;
}
img.formulaDsp {
-
+
}
img.formulaInl {
- vertical-align: middle;
+ vertical-align: middle;
}
div.center {
- text-align: center;
- margin-top: 0px;
- margin-bottom: 0px;
- padding: 0px;
+ text-align: center;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ padding: 0px;
}
div.center img {
- border: 0px;
+ border: 0px;
}
address.footer {
- text-align: right;
- padding-right: 12px;
+ text-align: right;
+ padding-right: 12px;
}
img.footer {
- border: 0px;
- vertical-align: middle;
+ border: 0px;
+ vertical-align: middle;
}
/* @group Code Colorization */
span.keyword {
- color: #008000
+ color: #008000
}
span.keywordtype {
- color: #604020
+ color: #604020
}
span.keywordflow {
- color: #e08000
+ color: #e08000
}
span.comment {
- color: #800000
+ color: #800000
}
span.preprocessor {
- color: #806020
+ color: #806020
}
span.stringliteral {
- color: #002080
+ color: #002080
}
span.charliteral {
- color: #008080
+ color: #008080
}
-span.vhdldigit {
- color: #ff00ff
+span.vhdldigit {
+ color: #ff00ff
}
-span.vhdlchar {
- color: #000000
+span.vhdlchar {
+ color: #000000
}
-span.vhdlkeyword {
- color: #700070
+span.vhdlkeyword {
+ color: #700070
}
-span.vhdllogic {
- color: #ff0000
+span.vhdllogic {
+ color: #ff0000
}
blockquote {
- background-color: #F7F8FB;
- border-left: 2px solid #9CAFD4;
- margin: 0 24px 0 4px;
- padding: 0 12px 0 16px;
+ background-color: #F7F8FB;
+ border-left: 2px solid #9CAFD4;
+ margin: 0 24px 0 4px;
+ padding: 0 12px 0 16px;
}
/* @end */
td.tiny {
- font-size: 75%;
+ font-size: 75%;
}
.dirtab {
- padding: 4px;
- border-collapse: collapse;
- border: 1px solid #A3B4D7;
+ padding: 4px;
+ border-collapse: collapse;
+ border: 1px solid #A3B4D7;
}
th.dirtab {
- background: #EBEFF6;
- font-weight: bold;
+ background: #EBEFF6;
+ font-weight: bold;
}
hr {
display: none;
- height: 0px;
- border: none;
- border-top: 1px solid #4A6AAA;
+ height: 0px;
+ border: none;
+ border-top: 1px solid #4A6AAA;
}
hr.footer {
- height: 1px;
+ height: 1px;
}
/* @group Member Descriptions */
table.memberdecls {
- border-spacing: 0px;
- padding: 0px;
+ border-spacing: 0px;
+ padding: 0px;
}
.memberdecls td, .fieldtable tr {
- -webkit-transition-property: background-color, box-shadow;
- -webkit-transition-duration: 0.5s;
- -moz-transition-property: background-color, box-shadow;
- -moz-transition-duration: 0.5s;
- -ms-transition-property: background-color, box-shadow;
- -ms-transition-duration: 0.5s;
- -o-transition-property: background-color, box-shadow;
- -o-transition-duration: 0.5s;
- transition-property: background-color, box-shadow;
- transition-duration: 0.5s;
+ -webkit-transition-property: background-color, box-shadow;
+ -webkit-transition-duration: 0.5s;
+ -moz-transition-property: background-color, box-shadow;
+ -moz-transition-duration: 0.5s;
+ -ms-transition-property: background-color, box-shadow;
+ -ms-transition-duration: 0.5s;
+ -o-transition-property: background-color, box-shadow;
+ -o-transition-duration: 0.5s;
+ transition-property: background-color, box-shadow;
+ transition-duration: 0.5s;
}
.memberdecls td.glow, .fieldtable tr.glow {
- background-color: cyan;
- /*box-shadow: 0 0 15px cyan;*/
+ background-color: cyan;
+ /*box-shadow: 0 0 15px cyan;*/
}
.mdescLeft, .mdescRight,
.memItemLeft, .memItemRight,
.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
- background-color: #F9FAFC;
- border: none;
- margin: 4px;
- padding: 1px 0 0 8px;
+ background-color: #F9FAFC;
+ border: none;
+ margin: 4px;
+ padding: 1px 0 0 8px;
}
.mdescLeft, .mdescRight {
- padding: 0px 8px 4px 8px;
- color: #555;
+ padding: 0px 8px 4px 8px;
+ color: #555;
}
.memSeparator {
- border-bottom: 1px solid #DEE4F0;
- line-height: 1px;
- margin: 0px;
- padding: 0px;
+ border-bottom: 1px solid #DEE4F0;
+ line-height: 1px;
+ margin: 0px;
+ padding: 0px;
}
.memItemLeft, .memTemplItemLeft {
- white-space: nowrap;
+ white-space: nowrap;
}
.memItemRight {
- width: 100%;
+ width: 100%;
}
.memTemplParams {
- color: #4665A2;
- white-space: nowrap;
- font-size: 80%;
+ color: #4665A2;
+ white-space: nowrap;
+ font-size: 80%;
}
/* @end */
@@ -412,29 +409,29 @@ table.memberdecls {
/* Styles for detailed member documentation */
.memtemplate {
- font-size: 80%;
- color: #4665A2;
- font-weight: normal;
- margin-left: 9px;
+ font-size: 80%;
+ color: #4665A2;
+ font-weight: normal;
+ margin-left: 9px;
}
.memnav {
- background-color: #EBEFF6;
- border: 1px solid #A3B4D7;
- text-align: center;
- margin: 2px;
- margin-right: 15px;
- padding: 2px;
+ background-color: #EBEFF6;
+ border: 1px solid #A3B4D7;
+ text-align: center;
+ margin: 2px;
+ margin-right: 15px;
+ padding: 2px;
}
.mempage {
- width: 100%;
+ width: 100%;
}
.memitem {
- padding: 0;
- /*margin-bottom: 10px;*/
- margin-right: 5px;
+ padding: 0;
+ /*margin-bottom: 10px;*/
+ margin-right: 5px;
display: table !important;
width: 100%;
}
@@ -445,121 +442,121 @@ table.memberdecls {
}
.memname td {
- vertical-align: bottom;
+ vertical-align: bottom;
}
.memproto, dl.reflist dt {
- border-top: 1px solid #A8B8D9;
- border-left: 1px solid #A8B8D9;
- border-right: 1px solid #A8B8D9;
- padding: 6px 0px 6px 0px;
- color: #000;
- font-weight: bold;
- text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
- background-color: #eee;
- border-top-right-radius: 4px;
- border-top-left-radius: 4px;
- -moz-border-radius-topright: 4px;
- -moz-border-radius-topleft: 4px;
- -webkit-border-top-right-radius: 4px;
- -webkit-border-top-left-radius: 4px;
+ border-top: 1px solid #A8B8D9;
+ border-left: 1px solid #A8B8D9;
+ border-right: 1px solid #A8B8D9;
+ padding: 6px 0px 6px 0px;
+ color: #000;
+ font-weight: bold;
+ text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
+ background-color: #eee;
+ border-top-right-radius: 4px;
+ border-top-left-radius: 4px;
+ -moz-border-radius-topright: 4px;
+ -moz-border-radius-topleft: 4px;
+ -webkit-border-top-right-radius: 4px;
+ -webkit-border-top-left-radius: 4px;
}
.memdoc, dl.reflist dd {
- border: 1px solid #A8B8D9;
- padding: 6px 10px 2px 10px;
- background-color: #FBFCFD;
- background-color: #FFFFFF;
- border-bottom-left-radius: 4px;
- border-bottom-right-radius: 4px;
- -moz-border-radius-bottomleft: 4px;
- -moz-border-radius-bottomright: 4px;
- -webkit-border-bottom-left-radius: 4px;
- -webkit-border-bottom-right-radius: 4px;
+ border: 1px solid #A8B8D9;
+ padding: 6px 10px 2px 10px;
+ background-color: #FBFCFD;
+ background-color: #FFFFFF;
+ border-bottom-left-radius: 4px;
+ border-bottom-right-radius: 4px;
+ -moz-border-radius-bottomleft: 4px;
+ -moz-border-radius-bottomright: 4px;
+ -webkit-border-bottom-left-radius: 4px;
+ -webkit-border-bottom-right-radius: 4px;
}
dl.reflist dt {
- padding: 5px;
+ padding: 5px;
}
dl.reflist dd {
- margin: 0px 0px 10px 0px;
- padding: 5px;
+ margin: 0px 0px 10px 0px;
+ padding: 5px;
}
.paramkey {
- text-align: right;
+ text-align: right;
}
.paramtype {
- white-space: nowrap;
+ white-space: nowrap;
}
.paramname {
- color: #602020;
- white-space: nowrap;
+ color: #602020;
+ white-space: nowrap;
}
.paramname em {
- font-style: normal;
+ font-style: normal;
}
.paramname code {
- line-height: 14px;
+ line-height: 14px;
}
.params, .retval, .exception, .tparams {
- margin-left: 0px;
- padding-left: 0px;
-}
+ margin-left: 0px;
+ padding-left: 0px;
+}
.params .paramname, .retval .paramname {
- font-weight: bold;
- vertical-align: top;
+ font-weight: bold;
+ vertical-align: top;
}
-
+
.params .paramtype {
- font-style: italic;
- vertical-align: top;
-}
-
+ font-style: italic;
+ vertical-align: top;
+}
+
.params .paramdir {
- font-family: "courier new",courier,monospace;
- vertical-align: top;
+ font-family: "courier new",courier,monospace;
+ vertical-align: top;
}
table.mlabels {
- border-spacing: 0px;
+ border-spacing: 0px;
}
td.mlabels-left {
- width: 100%;
- padding: 0px;
+ width: 100%;
+ padding: 0px;
}
td.mlabels-right {
- vertical-align: bottom;
- padding: 0px;
- white-space: nowrap;
+ vertical-align: bottom;
+ padding: 0px;
+ white-space: nowrap;
}
span.mlabels {
- margin-left: 8px;
+ margin-left: 8px;
}
span.mlabel {
- background-color: #728DC1;
- border-top:1px solid #5373B4;
- border-left:1px solid #5373B4;
- border-right:1px solid #C4CFE5;
- border-bottom:1px solid #C4CFE5;
- text-shadow: none;
- color: white;
- margin-right: 4px;
- padding: 2px 3px;
- border-radius: 3px;
- font-size: 7pt;
- white-space: nowrap;
- vertical-align: middle;
+ background-color: #728DC1;
+ border-top:1px solid #5373B4;
+ border-left:1px solid #5373B4;
+ border-right:1px solid #C4CFE5;
+ border-bottom:1px solid #C4CFE5;
+ text-shadow: none;
+ color: white;
+ margin-right: 4px;
+ padding: 2px 3px;
+ border-radius: 3px;
+ font-size: 7pt;
+ white-space: nowrap;
+ vertical-align: middle;
}
@@ -569,508 +566,470 @@ span.mlabel {
/* these are for tree view when not used as main index */
div.directory {
- margin: 10px 0px;
- border-top: 1px solid #bbb;
- width: 100%;
+ margin: 10px 0px;
+ border-top: 1px solid #bbb;
+ width: 100%;
}
.directory table {
- border-collapse:collapse;
+ border-collapse:collapse;
}
.directory td {
- margin: 0px;
- padding: 0px;
- vertical-align: top;
+ margin: 0px;
+ padding: 0px;
+ vertical-align: top;
}
.directory td.entry {
- white-space: nowrap;
- padding: 5px 5px 5px 0;
+ white-space: nowrap;
+ padding: 5px 5px 5px 0;
}
.directory td.entry a {
- outline:none;
+ outline:none;
}
.directory td.entry a img {
- border: none;
+ border: none;
}
.directory td.desc {
- width: 100%;
- padding-left: 6px;
- padding-right: 6px;
- padding-top: 3px;
- /*border-left: 1px solid rgba(0,0,0,0.05);*/
+ width: 100%;
+ padding-left: 6px;
+ padding-right: 6px;
+ padding-top: 3px;
+ /*border-left: 1px solid rgba(0,0,0,0.05);*/
}
.directory tr.even {
- padding-left: 6px;
- background-color: #F7F8FB;
+ padding-left: 6px;
+ background-color: #F7F8FB;
}
.directory img {
- vertical-align: -30%;
+ vertical-align: -30%;
}
.directory .levels {
- white-space: nowrap;
- width: 100%;
- text-align: right;
- font-size: 9pt;
+ white-space: nowrap;
+ width: 100%;
+ text-align: right;
+ font-size: 9pt;
}
.directory .levels span {
- cursor: pointer;
- padding-left: 2px;
- padding-right: 2px;
- color: #3D578C;
+ cursor: pointer;
+ padding-left: 2px;
+ padding-right: 2px;
+ color: #3D578C;
}
div.dynheader {
- margin-top: 8px;
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
+ margin-top: 8px;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
}
address {
- font-style: normal;
- color: #2A3D61;
+ font-style: normal;
+ color: #2A3D61;
}
-table table
-{
+table table {
width: 90%;
}
-.memitem table table
-{
+.memitem table table {
width: auto;
}
table.doxtable {
- border-collapse:collapse;
- margin-top: 4px;
- margin-bottom: 4px;
+ border-collapse:collapse;
+ margin-top: 4px;
+ margin-bottom: 4px;
}
table.doxtable td, table.doxtable th {
- border: 1px solid #2D4068;
- padding: 3px 7px 2px;
+ border: 1px solid #2D4068;
+ padding: 3px 7px 2px;
}
table.doxtable th {
- background-color: #374F7F;
- color: #FFFFFF;
- font-size: 110%;
- padding-bottom: 4px;
- padding-top: 5px;
+ background-color: #374F7F;
+ color: #FFFFFF;
+ font-size: 110%;
+ padding-bottom: 4px;
+ padding-top: 5px;
}
table.fieldtable {
- width: 100%;
- margin-bottom: 10px;
- border: 1px solid #A8B8D9;
- border-spacing: 0px;
- -moz-border-radius: 4px;
- -webkit-border-radius: 4px;
- border-radius: 4px;
+ width: 100%;
+ margin-bottom: 10px;
+ border: 1px solid #A8B8D9;
+ border-spacing: 0px;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ border-radius: 4px;
}
.fieldtable td, .fieldtable th {
- padding: 3px 7px 2px;
+ padding: 3px 7px 2px;
}
.fieldtable td.fieldtype, .fieldtable td.fieldname {
- white-space: nowrap;
- border-right: 1px solid #A8B8D9;
- border-bottom: 1px solid #A8B8D9;
- vertical-align: top;
+ white-space: nowrap;
+ border-right: 1px solid #A8B8D9;
+ border-bottom: 1px solid #A8B8D9;
+ vertical-align: top;
}
.fieldtable td.fielddoc {
- border-bottom: 1px solid #A8B8D9;
- width: 100%;
+ border-bottom: 1px solid #A8B8D9;
+ width: 100%;
}
.fieldtable tr:last-child td {
- border-bottom: none;
+ border-bottom: none;
}
.fieldtable th {
- background-color: #E2E8F2;
- font-size: 90%;
- color: #253555;
- padding-bottom: 4px;
- padding-top: 5px;
- text-align:left;
- -moz-border-radius-topleft: 4px;
- -moz-border-radius-topright: 4px;
- -webkit-border-top-left-radius: 4px;
- -webkit-border-top-right-radius: 4px;
- border-top-left-radius: 4px;
- border-top-right-radius: 4px;
- border-bottom: 1px solid #A8B8D9;
+ background-color: #E2E8F2;
+ font-size: 90%;
+ color: #253555;
+ padding-bottom: 4px;
+ padding-top: 5px;
+ text-align:left;
+ -moz-border-radius-topleft: 4px;
+ -moz-border-radius-topright: 4px;
+ -webkit-border-top-left-radius: 4px;
+ -webkit-border-top-right-radius: 4px;
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+ border-bottom: 1px solid #A8B8D9;
}
.tabsearch {
- top: 0px;
- left: 10px;
- height: 36px;
- z-index: 101;
- overflow: hidden;
- font-size: 13px;
+ top: 0px;
+ left: 10px;
+ height: 36px;
+ z-index: 101;
+ overflow: hidden;
+ font-size: 13px;
}
-.navpath
-{
+.navpath {
display: none;
}
-.navpath ul
-{
- font-size: 11px;
- height:30px;
- line-height:30px;
- color:#8AA0CC;
- border:solid 1px #C2CDE4;
- overflow:hidden;
- margin:0px;
- padding:0px;
-}
-
-.navpath li
-{
- list-style-type:none;
- float:left;
- padding-left:10px;
- padding-right:15px;
- color:#364D7C;
-}
-
-.navpath li.navelem a
-{
- height:32px;
- display:block;
- text-decoration: none;
- outline: none;
- color: #283A5D;
- font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif;
- text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
- text-decoration: none;
-}
-
-.navpath li.navelem a:hover
-{
- color:#6884BD;
-}
-
-.navpath li.footer
-{
- list-style-type:none;
- float:right;
- padding-left:10px;
- padding-right:15px;
- background-image:none;
- background-repeat:no-repeat;
- background-position:right;
- color:#364D7C;
- font-size: 8pt;
-}
-
-
-div.summary
-{
- float: right;
- font-size: 8pt;
- padding-right: 5px;
- width: 50%;
- text-align: right;
-}
-
-div.summary a
-{
- white-space: nowrap;
+.navpath ul {
+ font-size: 11px;
+ height:30px;
+ line-height:30px;
+ color:#8AA0CC;
+ border:solid 1px #C2CDE4;
+ overflow:hidden;
+ margin:0px;
+ padding:0px;
+}
+
+.navpath li {
+ list-style-type:none;
+ float:left;
+ padding-left:10px;
+ padding-right:15px;
+ color:#364D7C;
+}
+
+.navpath li.navelem a {
+ height:32px;
+ display:block;
+ text-decoration: none;
+ outline: none;
+ color: #283A5D;
+ font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif;
+ text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
+ text-decoration: none;
+}
+
+.navpath li.navelem a:hover {
+ color:#6884BD;
+}
+
+.navpath li.footer {
+ list-style-type:none;
+ float:right;
+ padding-left:10px;
+ padding-right:15px;
+ background-image:none;
+ background-repeat:no-repeat;
+ background-position:right;
+ color:#364D7C;
+ font-size: 8pt;
+}
+
+
+div.summary {
+ font-size: 8pt;
+ padding-right: 5px;
+}
+
+div.summary a {
+ white-space: nowrap;
padding: 1px;
text-decoration: none;
color: #577E25;
}
-div.summary a:hover
-{
+div.summary a:hover {
text-decoration: underline;
}
-div.ingroups
-{
- font-size: 8pt;
- width: 50%;
- text-align: left;
+div.ingroups {
+ font-size: 8pt;
+ width: 50%;
+ text-align: left;
}
-div.ingroups a
-{
- white-space: nowrap;
+div.ingroups a {
+ white-space: nowrap;
}
-div.header
-{
- width: 950px;
- margin: 2em auto;
- border-bottom: 1px solid #999;
+div.header {
+ width: 950px;
+ margin: 2em auto;
+ border-bottom: 1px solid #999;
}
-dl
-{
+dl {
padding: 0 0 0 10px;
}
/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */
-dl.section
-{
- margin-left: 0px;
- padding-left: 0px;
+dl.section {
+ margin-left: 0px;
+ padding-left: 0px;
}
-dl.note
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #D0C000;
+dl.note {
+ margin-left:-7px;
+ padding-left: 3px;
+ border-left:4px solid;
+ border-color: #D0C000;
}
-dl.warning, dl.attention
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #FF0000;
+dl.warning, dl.attention {
+ margin-left:-7px;
+ padding-left: 3px;
+ border-left:4px solid;
+ border-color: #FF0000;
}
-dl.pre, dl.post, dl.invariant
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #00D000;
+dl.pre, dl.post, dl.invariant {
+ margin-left:-7px;
+ padding-left: 3px;
+ border-left:4px solid;
+ border-color: #00D000;
}
-dl.deprecated
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #505050;
+dl.deprecated {
+ margin-left:-7px;
+ padding-left: 3px;
+ border-left:4px solid;
+ border-color: #505050;
}
-dl.todo
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #00C0E0;
+dl.todo {
+ margin-left:-7px;
+ padding-left: 3px;
+ border-left:4px solid;
+ border-color: #00C0E0;
}
-dl.test
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #3030E0;
+dl.test {
+ margin-left:-7px;
+ padding-left: 3px;
+ border-left:4px solid;
+ border-color: #3030E0;
}
-dl.bug
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #C08050;
+dl.bug {
+ margin-left:-7px;
+ padding-left: 3px;
+ border-left:4px solid;
+ border-color: #C08050;
}
dl.section dd {
- margin-bottom: 6px;
+ margin-bottom: 6px;
}
-#projectlogo
-{
- text-align: center;
- vertical-align: bottom;
- border-collapse: separate;
+#projectlogo {
+ text-align: center;
+ vertical-align: bottom;
+ border-collapse: separate;
}
-
-#projectlogo img
-{
- border: 0px none;
+
+#projectlogo img {
+ border: 0px none;
}
-
-#projectname
-{
- font: 300% Tahoma, Arial,sans-serif;
- margin: 0px;
- padding: 2px 0px;
+
+#projectname {
+ font: 300% Tahoma, Arial,sans-serif;
+ margin: 0px;
+ padding: 2px 0px;
}
-
-#projectbrief
-{
- font: 120% Tahoma, Arial,sans-serif;
- margin: 0px;
- padding: 0px;
+
+#projectbrief {
+ font: 120% Tahoma, Arial,sans-serif;
+ margin: 0px;
+ padding: 0px;
}
-#projectnumber
-{
- font: 50% Tahoma, Arial,sans-serif;
- margin: 0px;
- padding: 0px;
+#projectnumber {
+ font: 50% Tahoma, Arial,sans-serif;
+ margin: 0px;
+ padding: 0px;
}
-#titlearea
-{
- padding: 0px;
- margin: 0px;
- width: 100%;
- border-bottom: 1px solid #5373B4;
+#titlearea {
+ padding: 0px;
+ margin: 0px;
+ width: 100%;
+ border-bottom: 1px solid #5373B4;
}
-.image
-{
- text-align: center;
+.image {
+ text-align: center;
}
-.dotgraph
-{
- text-align: center;
+.dotgraph {
+ text-align: center;
}
-.mscgraph
-{
- text-align: center;
+.mscgraph {
+ text-align: center;
}
-.caption
-{
- font-weight: bold;
+.caption {
+ font-weight: bold;
}
-div.zoom
-{
- border: 1px solid #90A5CE;
+div.zoom {
+ border: 1px solid #90A5CE;
}
dl.citelist {
- margin-bottom:50px;
+ margin-bottom:50px;
}
dl.citelist dt {
- color:#334975;
- float:left;
- font-weight:bold;
- margin-right:10px;
- padding:5px;
+ color:#334975;
+ float:left;
+ font-weight:bold;
+ margin-right:10px;
+ padding:5px;
}
dl.citelist dd {
- margin:2px 0;
- padding:5px 0;
+ margin:2px 0;
+ padding:5px 0;
}
div.toc {
- padding: 14px 25px;
- background-color: #F4F6FA;
- border: 1px solid #D8DFEE;
- border-radius: 7px 7px 7px 7px;
- float: right;
- height: auto;
- margin: 0 20px 10px 10px;
- width: 200px;
+ padding: 14px 25px;
+ background-color: #F4F6FA;
+ border: 1px solid #D8DFEE;
+ border-radius: 7px 7px 7px 7px;
+ float: right;
+ height: auto;
+ margin: 0 20px 10px 10px;
+ width: 200px;
}
div.toc li {
- font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif;
- margin-top: 5px;
- padding-left: 10px;
- padding-top: 2px;
+ font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif;
+ margin-top: 5px;
+ padding-left: 10px;
+ padding-top: 2px;
}
div.toc h3 {
- font: bold 12px/1.2 Arial,FreeSans,sans-serif;
- color: #4665A2;
- border-bottom: 0 none;
- margin: 0;
+ font: bold 12px/1.2 Arial,FreeSans,sans-serif;
+ color: #4665A2;
+ border-bottom: 0 none;
+ margin: 0;
}
div.toc ul {
- list-style: none outside none;
- border: medium none;
- padding: 0px;
-}
+ list-style: none outside none;
+ border: medium none;
+ padding: 0px;
+}
div.toc li.level1 {
- margin-left: 0px;
+ margin-left: 0px;
}
div.toc li.level2 {
- margin-left: 15px;
+ margin-left: 15px;
}
div.toc li.level3 {
- margin-left: 30px;
+ margin-left: 30px;
}
div.toc li.level4 {
- margin-left: 45px;
+ margin-left: 45px;
}
.inherit_header {
- font-weight: bold;
- color: gray;
- cursor: pointer;
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
+ font-weight: bold;
+ color: gray;
+ cursor: pointer;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
}
.inherit_header td {
- padding: 6px 0px 2px 5px;
+ padding: 6px 0px 2px 5px;
}
.inherit {
- display: none;
+ display: none;
}
tr.heading h2 {
- margin-top: 12px;
- margin-bottom: 4px;
-}
-
-@media print
-{
- #top { display: none; }
- #side-nav { display: none; }
- #nav-path { display: none; }
- body { overflow:visible; }
- h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
- .summary { display: none; }
- .memitem { page-break-inside: avoid; }
- #doc-content
- {
- margin-left:0 !important;
- height:auto !important;
- width:auto !important;
- overflow:inherit;
- display:inline;
- }
+ margin-top: 12px;
+ margin-bottom: 4px;
+}
+
+@media print {
+ #top { display: none; }
+ #side-nav { display: none; }
+ #nav-path { display: none; }
+ body { overflow:visible; }
+ h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
+ .summary { display: none; }
+ .memitem { page-break-inside: avoid; }
+
+ #doc-content {
+ margin-left:0 !important;
+ height:auto !important;
+ width:auto !important;
+ overflow:inherit;
+ display:inline;
+ }
}
/* tabs.css */
@@ -1105,8 +1064,7 @@ tr.heading h2 {
list-style: none;
}
-#navrow1
-{
+#navrow1 {
border-top: 1px solid #999;
margin-top: 2em;
}
@@ -1131,16 +1089,14 @@ tr.heading h2 {
/* SFML css */
-body
-{
+body {
font-family: 'Ubuntu', 'Arial', sans-serif;
line-height: 140%;
margin: 0 0 2em 0;
padding: 0;
}
-#banner-container
-{
+#banner-container {
width: 100%;
margin-top: 25px;
border-top: 2px solid #999;
@@ -1148,8 +1104,7 @@ body
background-color: rgb(140, 200, 65);
}
-#banner
-{
+#banner {
width: 950px;
height: 60px;
line-height: 54px;
@@ -1157,8 +1112,7 @@ body
text-align: center;
}
-#banner #sfml
-{
+#banner #sfml {
display: inline;
vertical-align: top;
margin-left: 15px;
@@ -1167,16 +1121,14 @@ body
text-shadow: rgba(0, 0, 0, 0.5) 1px 1px 5px;
}
-#footer-container
-{
+#footer-container {
clear: both;
width: 100%;
margin-top: 50px;
border-top: 1px solid #999;
}
-#footer
-{
+#footer {
width: 950px;
margin: 10px auto;
text-align: center;
@@ -1184,27 +1136,23 @@ body
color: #555;
}
-#footer a
-{
+#footer a {
padding: 1px;
text-decoration: none;
color: rgb(70, 100, 30);
}
-#footer a:hover
-{
+#footer a:hover {
text-decoration: underline;
}
-div.contents, #content
-{
+div.contents, #content {
width: 950px;
margin: 0 auto;
padding: 0;
}
-div.contents h1
-{
+div.contents h1 {
color: #333;
padding: 0.5em 0;
margin-top: 30px;
@@ -1214,8 +1162,7 @@ div.contents h1
font-weight: normal;
}
-div.contents h2
-{
+div.contents h2 {
font-size: 20pt;
font-weight: normal;
margin-top: 1.5em;
@@ -1223,38 +1170,32 @@ div.contents h2
border-bottom: 1px solid #999;
}
-div.contents h3
-{
+div.contents h3 {
font-size: 16pt;
font-weight: normal;
}
-div.contents p
-{
+div.contents p {
color: #333;
text-align: justify;
}
-div.contents a, #content a
-{
+div.contents a, #content a {
padding: 1px;
text-decoration: none;
color: rgb(70, 100, 30);
}
-div.contents a:hover, #content a:hover
-{
+div.contents a:hover, #content a:hover {
text-decoration: underline;
}
-div.contents code
-{
+div.contents code {
font-size: 11pt;
font-family: Consolas, "Liberation Mono", Courier, monospace;
}
-div.contents pre code
-{
+div.contents pre code {
font-family: Consolas, "Liberation Mono", Courier, monospace;
font-size: 10pt;
padding: 0.5em 1em;
@@ -1262,17 +1203,241 @@ div.contents pre code
border: 1px solid #bbb;
}
-div.contents ul
-{
+div.contents ul {
list-style-type: square;
list-style-position: outside;
margin: 0 0 0 1.5em;
padding: 0;
}
-div.contents ul li
-{
+div.contents ul li {
color: #333;
margin: 0 0 0.3em 0;
}
+
+.icon {
+ font-family: Arial, Helvetica;
+ font-weight: bold;
+ font-size: 12px;
+ height: 14px;
+ width: 16px;
+ display: inline-block;
+ background-color: #8cc445;
+ color: white;
+ text-align: center;
+ border-radius: 4px;
+ margin-left: 2px;
+ margin-right: 2px;
+ line-height: normal;
+}
+
+.icona {
+ width: 24px;
+ height: 22px;
+ display: inline-block;
+}
+
+.iconfopen {
+ width: 24px;
+ height: 18px;
+ margin-bottom: 4px;
+ background-image:url('ftv2folderopen.png');
+ background-position: 0px -4px;
+ background-repeat: repeat-y;
+ vertical-align:top;
+ display: inline-block;
+}
+
+.iconfclosed {
+ width: 24px;
+ height: 18px;
+ margin-bottom: 4px;
+ background-image:url('ftv2folderclosed.png');
+ background-position: 0px -4px;
+ background-repeat: repeat-y;
+ vertical-align:top;
+ display: inline-block;
+}
+
+.icondoc {
+ width: 24px;
+ height: 18px;
+ margin-bottom: 4px;
+ background-image:url('ftv2doc.png');
+ background-position: 0px -4px;
+ background-repeat: repeat-y;
+ vertical-align:top;
+ display: inline-block;
+}
+
+/* tooltip related style info */
+
+.ttc {
+ position: absolute;
+ display: none;
+}
+
+#powerTip {
+ cursor: default;
+ white-space: nowrap;
+ background-color: white;
+ border: 1px solid gray;
+ border-radius: 4px 4px 4px 4px;
+ box-shadow: 1px 1px 7px gray;
+ display: none;
+ font-size: smaller;
+ max-width: 80%;
+ opacity: 0.9;
+ padding: 1ex 1em 1em;
+ position: absolute;
+ z-index: 2147483647;
+}
+
+#powerTip div.ttdoc {
+ color: grey;
+ font-style: italic;
+}
+
+#powerTip div.ttname a {
+ font-weight: bold;
+}
+
+#powerTip div.ttname {
+ font-weight: bold;
+}
+
+#powerTip div.ttdeci {
+ color: #006318;
+}
+
+#powerTip div {
+ margin: 0px;
+ padding: 0px;
+ font: 12px/16px Roboto,sans-serif;
+}
+
+#powerTip:before, #powerTip:after {
+ content: "";
+ position: absolute;
+ margin: 0px;
+}
+
+#powerTip.n:after, #powerTip.n:before,
+#powerTip.s:after, #powerTip.s:before,
+#powerTip.w:after, #powerTip.w:before,
+#powerTip.e:after, #powerTip.e:before,
+#powerTip.ne:after, #powerTip.ne:before,
+#powerTip.se:after, #powerTip.se:before,
+#powerTip.nw:after, #powerTip.nw:before,
+#powerTip.sw:after, #powerTip.sw:before {
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+}
+
+#powerTip.n:after, #powerTip.s:after,
+#powerTip.w:after, #powerTip.e:after,
+#powerTip.nw:after, #powerTip.ne:after,
+#powerTip.sw:after, #powerTip.se:after {
+ border-color: rgba(255, 255, 255, 0);
+}
+
+#powerTip.n:before, #powerTip.s:before,
+#powerTip.w:before, #powerTip.e:before,
+#powerTip.nw:before, #powerTip.ne:before,
+#powerTip.sw:before, #powerTip.se:before {
+ border-color: rgba(128, 128, 128, 0);
+}
+
+#powerTip.n:after, #powerTip.n:before,
+#powerTip.ne:after, #powerTip.ne:before,
+#powerTip.nw:after, #powerTip.nw:before {
+ top: 100%;
+}
+
+#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after {
+ border-top-color: #ffffff;
+ border-width: 10px;
+ margin: 0px -10px;
+}
+#powerTip.n:before {
+ border-top-color: #808080;
+ border-width: 11px;
+ margin: 0px -11px;
+}
+#powerTip.n:after, #powerTip.n:before {
+ left: 50%;
+}
+
+#powerTip.nw:after, #powerTip.nw:before {
+ right: 14px;
+}
+
+#powerTip.ne:after, #powerTip.ne:before {
+ left: 14px;
+}
+
+#powerTip.s:after, #powerTip.s:before,
+#powerTip.se:after, #powerTip.se:before,
+#powerTip.sw:after, #powerTip.sw:before {
+ bottom: 100%;
+}
+
+#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after {
+ border-bottom-color: #ffffff;
+ border-width: 10px;
+ margin: 0px -10px;
+}
+
+#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before {
+ border-bottom-color: #808080;
+ border-width: 11px;
+ margin: 0px -11px;
+}
+
+#powerTip.s:after, #powerTip.s:before {
+ left: 50%;
+}
+
+#powerTip.sw:after, #powerTip.sw:before {
+ right: 14px;
+}
+
+#powerTip.se:after, #powerTip.se:before {
+ left: 14px;
+}
+
+#powerTip.e:after, #powerTip.e:before {
+ left: 100%;
+}
+#powerTip.e:after {
+ border-left-color: #ffffff;
+ border-width: 10px;
+ top: 50%;
+ margin-top: -10px;
+}
+#powerTip.e:before {
+ border-left-color: #808080;
+ border-width: 11px;
+ top: 50%;
+ margin-top: -11px;
+}
+
+#powerTip.w:after, #powerTip.w:before {
+ right: 100%;
+}
+#powerTip.w:after {
+ border-right-color: #ffffff;
+ border-width: 10px;
+ top: 50%;
+ margin-top: -10px;
+}
+#powerTip.w:before {
+ border-right-color: #808080;
+ border-width: 11px;
+ top: 50%;
+ margin-top: -11px;
+} \ No newline at end of file
diff --git a/doc/footer.htm b/doc/footer.html
index bc149df..0e7569a 100644
--- a/doc/footer.htm
+++ b/doc/footer.html
@@ -1,7 +1,8 @@
</div>
<div id="footer-container">
<div id="footer">
- Copyright Đ Laurent Gomila &nbsp;::&nbsp;
+ SFML is licensed under the terms and conditions of the <a href="http://www.sfml-dev.org/license.php">zlib/png license</a>.<br>
+ Copyright &copy; Laurent Gomila &nbsp;::&nbsp;
Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> &nbsp;::&nbsp;
</div>
</div>
diff --git a/doc/header.htm b/doc/header.html.in
index cb749e6..34337fd 100644
--- a/doc/header.htm
+++ b/doc/header.html.in
@@ -2,14 +2,17 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SFML - Simple and Fast Multimedia Library</title>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+ <meta http-equiv="Content-Type" content="text/html;"/>
+ <meta charset="utf-8"/>
<!--<link rel='stylesheet' type='text/css' href="http://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
<link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
+ <script type="text/javascript" src="jquery.js"></script>
+ <script type="text/javascript" src="dynsections.js"></script>
</head>
<body>
<div id="banner-container">
<div id="banner">
- <span id="sfml">SFML</span>
+ <span id="sfml">SFML @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@</span>
</div>
</div>
<div id="content">
diff --git a/doc/mainpage.hpp b/doc/mainpage.hpp
index ed6bea8..7ef4b6f 100644
--- a/doc/mainpage.hpp
+++ b/doc/mainpage.hpp
@@ -14,24 +14,24 @@
///
/// #include <SFML/Audio.hpp>
/// #include <SFML/Graphics.hpp>
-///
+///
/// int main()
/// {
/// // Create the main window
/// sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
-///
+///
/// // Load a sprite to display
/// sf::Texture texture;
/// if (!texture.loadFromFile("cute_image.jpg"))
/// return EXIT_FAILURE;
/// sf::Sprite sprite(texture);
-///
+///
/// // Create a graphical text to display
/// sf::Font font;
/// if (!font.loadFromFile("arial.ttf"))
/// return EXIT_FAILURE;
/// sf::Text text("Hello SFML", font, 50);
-///
+///
/// // Load a music to play
/// sf::Music music;
/// if (!music.openFromFile("nice_music.ogg"))
@@ -39,7 +39,7 @@
///
/// // Play the music
/// music.play();
-///
+///
/// // Start the game loop
/// while (window.isOpen())
/// {
@@ -51,20 +51,20 @@
/// if (event.type == sf::Event::Closed)
/// window.close();
/// }
-///
+///
/// // Clear screen
/// window.clear();
-///
+///
/// // Draw the sprite
/// window.draw(sprite);
-///
+///
/// // Draw the string
/// window.draw(text);
-///
+///
/// // Update the window
/// window.display();
/// }
-///
+///
/// return EXIT_SUCCESS;
/// }
/// \endcode
diff --git a/examples/X11/CMakeLists.txt b/examples/X11/CMakeLists.txt
index 75f3cc3..cc62f48 100644
--- a/examples/X11/CMakeLists.txt
+++ b/examples/X11/CMakeLists.txt
@@ -4,7 +4,7 @@ set(SRCROOT ${PROJECT_SOURCE_DIR}/examples/X11)
# all source files
set(SRC ${SRCROOT}/X11.cpp)
-# find OpenGL, GLU and X11
+# find OpenGL and X11
find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIR})
find_package(X11 REQUIRED)
diff --git a/examples/X11/X11.cpp b/examples/X11/X11.cpp
index 17bb448..2c2419b 100644
--- a/examples/X11/X11.cpp
+++ b/examples/X11/X11.cpp
@@ -3,10 +3,11 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window.hpp>
-#include <X11/Xlib.h>
-#include <GL/gl.h>
-#include <GL/glu.h>
+#include <SFML/System/Err.hpp>
+#include <SFML/OpenGL.hpp>
+#include <X11/Xlib-xcb.h>
#include <iostream>
+#include <cmath>
////////////////////////////////////////////////////////////
@@ -32,7 +33,13 @@ void initialize(sf::Window& window)
// Setup a perspective projection
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
- gluPerspective(90.f, 1.f, 1.f, 500.f);
+ static const double pi = 3.141592654;
+ GLdouble extent = std::tan(90.0 * pi / 360.0);
+ glFrustum(-extent, extent, -extent, extent, 1.0, 500.0);
+
+ // Enable position and texture coordinates vertex components
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_COLOR_ARRAY);
}
////////////////////////////////////////////////////////////
@@ -55,50 +62,61 @@ void draw(sf::Window& window, float elapsedTime)
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.f, 0.f, -200.f);
- glRotatef(elapsedTime * 0.05f, 1.f, 0.f, 0.f);
- glRotatef(elapsedTime * 0.03f, 0.f, 1.f, 0.f);
- glRotatef(elapsedTime * 0.09f, 0.f, 0.f, 1.f);
-
- // Draw a cube
- glBegin(GL_QUADS);
-
- glColor3f(1.f, 1.f, 0.f);
- glVertex3f(-50.f, -50.f, -50.f);
- glVertex3f(-50.f, 50.f, -50.f);
- glVertex3f( 50.f, 50.f, -50.f);
- glVertex3f( 50.f, -50.f, -50.f);
-
- glColor3f(1.f, 1.f, 0.f);
- glVertex3f(-50.f, -50.f, 50.f);
- glVertex3f(-50.f, 50.f, 50.f);
- glVertex3f( 50.f, 50.f, 50.f);
- glVertex3f( 50.f, -50.f, 50.f);
-
- glColor3f(0.f, 1.f, 1.f);
- glVertex3f(-50.f, -50.f, -50.f);
- glVertex3f(-50.f, 50.f, -50.f);
- glVertex3f(-50.f, 50.f, 50.f);
- glVertex3f(-50.f, -50.f, 50.f);
-
- glColor3f(0.f, 1.f, 1.f);
- glVertex3f(50.f, -50.f, -50.f);
- glVertex3f(50.f, 50.f, -50.f);
- glVertex3f(50.f, 50.f, 50.f);
- glVertex3f(50.f, -50.f, 50.f);
-
- glColor3f(1.f, 0.f, 1.f);
- glVertex3f(-50.f, -50.f, 50.f);
- glVertex3f(-50.f, -50.f, -50.f);
- glVertex3f( 50.f, -50.f, -50.f);
- glVertex3f( 50.f, -50.f, 50.f);
-
- glColor3f(1.f, 0.f, 1.f);
- glVertex3f(-50.f, 50.f, 50.f);
- glVertex3f(-50.f, 50.f, -50.f);
- glVertex3f( 50.f, 50.f, -50.f);
- glVertex3f( 50.f, 50.f, 50.f);
-
- glEnd();
+ glRotatef(elapsedTime * 10.f, 1.f, 0.f, 0.f);
+ glRotatef(elapsedTime * 6.f, 0.f, 1.f, 0.f);
+ glRotatef(elapsedTime * 18.f, 0.f, 0.f, 1.f);
+
+ // Define a 3D cube (6 faces made of 2 triangles composed by 3 vertices)
+ static const GLfloat cube[] =
+ {
+ // positions // colors
+ -50, -50, -50, 1, 1, 0,
+ -50, 50, -50, 1, 1, 0,
+ -50, -50, 50, 1, 1, 0,
+ -50, -50, 50, 1, 1, 0,
+ -50, 50, -50, 1, 1, 0,
+ -50, 50, 50, 1, 1, 0,
+
+ 50, -50, -50, 1, 1, 0,
+ 50, 50, -50, 1, 1, 0,
+ 50, -50, 50, 1, 1, 0,
+ 50, -50, 50, 1, 1, 0,
+ 50, 50, -50, 1, 1, 0,
+ 50, 50, 50, 1, 1, 0,
+
+ -50, -50, -50, 1, 0, 1,
+ 50, -50, -50, 1, 0, 1,
+ -50, -50, 50, 1, 0, 1,
+ -50, -50, 50, 1, 0, 1,
+ 50, -50, -50, 1, 0, 1,
+ 50, -50, 50, 1, 0, 1,
+
+ -50, 50, -50, 1, 0, 1,
+ 50, 50, -50, 1, 0, 1,
+ -50, 50, 50, 1, 0, 1,
+ -50, 50, 50, 1, 0, 1,
+ 50, 50, -50, 1, 0, 1,
+ 50, 50, 50, 1, 0, 1,
+
+ -50, -50, -50, 0, 1, 1,
+ 50, -50, -50, 0, 1, 1,
+ -50, 50, -50, 0, 1, 1,
+ -50, 50, -50, 0, 1, 1,
+ 50, -50, -50, 0, 1, 1,
+ 50, 50, -50, 0, 1, 1,
+
+ -50, -50, 50, 0, 1, 1,
+ 50, -50, 50, 0, 1, 1,
+ -50, 50, 50, 0, 1, 1,
+ -50, 50, 50, 0, 1, 1,
+ 50, -50, 50, 0, 1, 1,
+ 50, 50, 50, 0, 1, 1
+ };
+
+ // Draw the cube
+ glVertexPointer(3, GL_FLOAT, 6 * sizeof(GLfloat), cube);
+ glColorPointer(3, GL_FLOAT, 6 * sizeof(GLfloat), cube + 3);
+ glDrawArrays(GL_TRIANGLES, 0, 36);
}
@@ -115,85 +133,104 @@ int main()
if (!display)
return EXIT_FAILURE;
- // Get the default screen
- int screen = DefaultScreen(display);
-
- // Let's create the main window
- XSetWindowAttributes attributes;
- attributes.background_pixel = BlackPixel(display, screen);
- attributes.event_mask = KeyPressMask;
- Window window = XCreateWindow(display, RootWindow(display, screen),
- 0, 0, 650, 330, 0,
- DefaultDepth(display, screen),
- InputOutput,
- DefaultVisual(display, screen),
- CWBackPixel | CWEventMask, &attributes);
- if (!window)
+ // Get the XCB connection for the opened display.
+ xcb_connection_t* xcbConnection = XGetXCBConnection(display);
+
+ if (!xcbConnection)
+ {
+ sf::err() << "Failed to get the XCB connection for opened display." << std::endl;
return EXIT_FAILURE;
+ }
- // Set the window's name
- XStoreName(display, window , "SFML Window");
-
- // Let's create the windows which will serve as containers for our SFML views
- Window view1 = XCreateWindow(display, window,
- 10, 10, 310, 310, 0,
- DefaultDepth(display, screen),
- InputOutput,
- DefaultVisual(display, screen),
- 0, NULL);
- Window view2 = XCreateWindow(display, window,
- 330, 10, 310, 310, 0,
- DefaultDepth(display, screen),
- InputOutput,
- DefaultVisual(display, screen),
- 0, NULL);
-
- // Show our windows
- XMapWindow(display, window);
- XFlush(display);
+ // Get XCB screen.
+ const xcb_setup_t* xcbSetup = xcb_get_setup(xcbConnection);
+ xcb_screen_iterator_t xcbScreenIter = xcb_setup_roots_iterator(xcbSetup);
+ xcb_screen_t* screen = xcbScreenIter.data;
+
+ if (!screen)
+ {
+ sf::err() << "Failed to get the XCB screen." << std::endl;
+ return EXIT_FAILURE;
+ }
+
+ // Generate the XCB window IDs.
+ xcb_window_t rootWindowId = xcb_generate_id(xcbConnection);
+ xcb_window_t view1WindowId = xcb_generate_id(xcbConnection);
+ xcb_window_t view2WindowId = xcb_generate_id(xcbConnection);
+
+ // Create the root window with a black background.
+ uint32_t mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK;
+ uint32_t attributes[2] = {screen->black_pixel, XCB_EVENT_MASK_KEY_PRESS};
+
+ xcb_create_window(xcbConnection,
+ XCB_COPY_FROM_PARENT,
+ rootWindowId,
+ screen->root,
+ 0, 0, 650, 330,
+ 0,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT,
+ screen->root_visual,
+ mask, attributes);
+
+ // Create windows for the SFML views.
+ xcb_create_window(xcbConnection,
+ XCB_COPY_FROM_PARENT,
+ view1WindowId,
+ rootWindowId,
+ 10, 10, 310, 310,
+ 0,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT,
+ screen->root_visual,
+ mask, attributes);
+
+ xcb_create_window(xcbConnection,
+ XCB_COPY_FROM_PARENT,
+ view2WindowId,
+ rootWindowId,
+ 330, 10, 310, 310,
+ 0,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT,
+ screen->root_visual,
+ mask, attributes);
+
+ // Map windows to screen.
+ xcb_map_window(xcbConnection, rootWindowId);
+ xcb_map_window(xcbConnection, view1WindowId);
+ xcb_map_window(xcbConnection, view2WindowId);
+
+ // Flush commands.
+ xcb_flush(xcbConnection);
// Create our SFML views
- sf::Window SFMLView1(view1);
- sf::Window SFMLView2(view2);
+ sf::Window sfmlView1(view1WindowId);
+ sf::Window sfmlView2(view2WindowId);
// Create a clock for measuring elapsed time
sf::Clock clock;
// Initialize our views
- initialize(SFMLView1);
- initialize(SFMLView2);
+ initialize(sfmlView1);
+ initialize(sfmlView2);
// Start the event loop
bool running = true;
+ xcb_generic_event_t* event = NULL;
+
while (running)
{
- while (XPending(display))
+ while ((event = xcb_poll_for_event(xcbConnection)))
{
- // Get the next pending event
- XEvent event;
- XNextEvent(display, &event);
-
- // Process it
- switch (event.type)
- {
- // Any key is pressed: quit
- case KeyPress:
- running = false;
- break;
- }
+ running = false;
}
// Draw something into our views
- draw(SFMLView1, clock.getElapsedTime().asSeconds());
- draw(SFMLView2, clock.getElapsedTime().asSeconds() * 0.3f);
+ draw(sfmlView1, clock.getElapsedTime().asSeconds());
+ draw(sfmlView2, clock.getElapsedTime().asSeconds() * 0.3f);
// Display the views on screen
- SFMLView1.display();
- SFMLView2.display();
+ sfmlView1.display();
+ sfmlView2.display();
}
- // Close the display
- XCloseDisplay(display);
-
return EXIT_SUCCESS;
}
diff --git a/examples/android/AndroidManifest.xml b/examples/android/AndroidManifest.xml
index 3c97c03..beb3538 100644
--- a/examples/android/AndroidManifest.xml
+++ b/examples/android/AndroidManifest.xml
@@ -19,8 +19,8 @@
android:label="@string/app_name"
android:icon="@drawable/sfml_logo"
android:configChanges="keyboardHidden|orientation|screenSize">
-
- <meta-data android:name="android.app.lib_name" android:value="sfml-activity" />
+
+ <meta-data android:name="android.app.lib_name" android:value="sfml-activity" />
<meta-data android:name="sfml.app.lib_name" android:value="sfml-example" />
<intent-filter>
diff --git a/examples/android/jni/Application.mk b/examples/android/jni/Application.mk
index 7c92d5f..a18107b 100644
--- a/examples/android/jni/Application.mk
+++ b/examples/android/jni/Application.mk
@@ -1,5 +1,5 @@
NDK_TOOLCHAIN_VERSION := 4.8
APP_PLATFORM := android-9
APP_STL := c++_shared
-APP_ABI := armeabi
+APP_ABI := armeabi-v7a
APP_MODULES := sfml-activity sfml-example
diff --git a/examples/android/jni/main.cpp b/examples/android/jni/main.cpp
index ee2c537..a8e75de 100644
--- a/examples/android/jni/main.cpp
+++ b/examples/android/jni/main.cpp
@@ -51,7 +51,7 @@ int main(int argc, char *argv[])
}
window.clear(sf::Color::White);
- window.draw(image);
+ window.draw(image);
window.display();
}
}
diff --git a/examples/android/project.properties b/examples/android/project.properties
deleted file mode 100644
index 0a458d4..0000000
--- a/examples/android/project.properties
+++ /dev/null
@@ -1 +0,0 @@
-target=android-19
diff --git a/examples/cocoa/CMakeLists.txt b/examples/cocoa/CMakeLists.txt
index 6eebf8f..5f67a1d 100644
--- a/examples/cocoa/CMakeLists.txt
+++ b/examples/cocoa/CMakeLists.txt
@@ -26,7 +26,7 @@ set_source_files_properties(${RESOURCES} PROPERTIES
MACOSX_PACKAGE_LOCATION Resources)
set_target_properties(cocoa PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${SRCROOT}/resources/Cocoa-Info.plist)
-target_link_libraries(cocoa "-framework Cocoa -framework Foundation"
+target_link_libraries(cocoa "-framework Cocoa -framework Foundation"
sfml-system sfml-window sfml-graphics)
# set the target's folder (for IDEs that support it, e.g. Visual Studio)
@@ -42,10 +42,10 @@ set(XIB_OUTPUT_PATH "${RESOURCE_PATH}/")
set(XIB_INPUT_PATH "${SRCROOT}/")
foreach(XIB ${XIBS})
add_custom_command(TARGET cocoa
- POST_BUILD
+ POST_BUILD
COMMAND ${IBTOOL} --errors
- --output-format human-readable-text
- --compile ${XIB_OUTPUT_PATH}/${XIB}.nib
+ --output-format human-readable-text
+ --compile ${XIB_OUTPUT_PATH}/${XIB}.nib
${XIB_INPUT_PATH}/${XIB}.xib
COMMENT "Compiling ${XIB}.xib")
# deactivated options: --warnings --notices
diff --git a/examples/cocoa/CocoaAppDelegate.h b/examples/cocoa/CocoaAppDelegate.h
index 388b395..b3fe9ca 100644
--- a/examples/cocoa/CocoaAppDelegate.h
+++ b/examples/cocoa/CocoaAppDelegate.h
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/examples/cocoa/CocoaAppDelegate.mm b/examples/cocoa/CocoaAppDelegate.mm
index 092e391..3afadf6 100644
--- a/examples/cocoa/CocoaAppDelegate.mm
+++ b/examples/cocoa/CocoaAppDelegate.mm
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/examples/cocoa/NSString+stdstring.h b/examples/cocoa/NSString+stdstring.h
index 8abb567..0e4195a 100644
--- a/examples/cocoa/NSString+stdstring.h
+++ b/examples/cocoa/NSString+stdstring.h
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/examples/cocoa/NSString+stdstring.mm b/examples/cocoa/NSString+stdstring.mm
index f39e05c..5581f5e 100644
--- a/examples/cocoa/NSString+stdstring.mm
+++ b/examples/cocoa/NSString+stdstring.mm
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/examples/cocoa/main.m b/examples/cocoa/main.m
index 1d0fe08..2609d64 100644
--- a/examples/cocoa/main.m
+++ b/examples/cocoa/main.m
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/examples/cocoa/readme.txt b/examples/cocoa/readme.txt
index 95c3d90..8636b1d 100644
--- a/examples/cocoa/readme.txt
+++ b/examples/cocoa/readme.txt
@@ -6,10 +6,10 @@ This is a small example of the integration of SFML in a Cocoa application.
Features
--------
- * This example shows how basic UI elements can interact with SFML
- render areas such as sf::RenderWindow (you can use sf::Window and
+ * This example shows how basic UI elements can interact with SFML
+ render areas such as sf::RenderWindow (you can use sf::Window and
OpenGL code too, of course).
- * It also provides tools for converting NSString to and from
+ * It also provides tools for converting NSString to and from
std::[w]string in an Objective-C Category of NSString.
* Moreover, it shows how you can prevent annoying the system alerts
produced when the SFML view has focus and the user press a key
diff --git a/examples/cocoa/resources/Cocoa-Info.plist b/examples/cocoa/resources/Cocoa-Info.plist
index ad972db..0e730f2 100644
--- a/examples/cocoa/resources/Cocoa-Info.plist
+++ b/examples/cocoa/resources/Cocoa-Info.plist
@@ -25,7 +25,7 @@
<key>LSMinimumSystemVersion</key>
<string>10.6</string>
<key>NSHumanReadableCopyright</key>
- <string>Copyright ÂĐ 2007-2014 Marco Antognini and Laurent Gomila. Shared under zlib/libpng License.</string>
+ <string>Copyright ÂĐ 2007-2015 Marco Antognini and Laurent Gomila. Shared under zlib/libpng License.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
diff --git a/examples/opengl/CMakeLists.txt b/examples/opengl/CMakeLists.txt
index 5e1571f..3bac2b9 100644
--- a/examples/opengl/CMakeLists.txt
+++ b/examples/opengl/CMakeLists.txt
@@ -4,7 +4,7 @@ set(SRCROOT ${PROJECT_SOURCE_DIR}/examples/opengl)
# all source files
set(SRC ${SRCROOT}/OpenGL.cpp)
-# find OpenGL and GLU
+# find OpenGL
find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIR})
set(ADDITIONAL_LIBRARIES ${OPENGL_LIBRARIES})
diff --git a/examples/opengl/OpenGL.cpp b/examples/opengl/OpenGL.cpp
index c900801..c2d1697 100644
--- a/examples/opengl/OpenGL.cpp
+++ b/examples/opengl/OpenGL.cpp
@@ -14,9 +14,9 @@
////////////////////////////////////////////////////////////
int main()
{
- // Request a 32-bits depth buffer when creating the window
+ // Request a 24-bits depth buffer when creating the window
sf::ContextSettings contextSettings;
- contextSettings.depthBits = 32;
+ contextSettings.depthBits = 24;
// Create the main window
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML graphics with OpenGL", sf::Style::Default, contextSettings);
@@ -53,9 +53,9 @@ int main()
return EXIT_FAILURE;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
- gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, image.getSize().x, image.getSize().y, GL_RGBA, GL_UNSIGNED_BYTE, image.getPixelsPtr());
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.getSize().x, image.getSize().y, 0, GL_RGBA, GL_UNSIGNED_BYTE, image.getPixelsPtr());
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
}
// Enable Z-buffer read and write
@@ -80,7 +80,7 @@ int main()
glBindTexture(GL_TEXTURE_2D, texture);
// Define a 3D cube (6 faces made of 2 triangles composed by 3 vertices)
- GLfloat cube[] =
+ static const GLfloat cube[] =
{
// positions // texture coordinates
-20, -20, -20, 0, 0,
diff --git a/examples/pong/Pong.cpp b/examples/pong/Pong.cpp
index b088e99..e9edf23 100644
--- a/examples/pong/Pong.cpp
+++ b/examples/pong/Pong.cpp
@@ -91,7 +91,7 @@ int main()
while (window.pollEvent(event))
{
// Window closed or escape key pressed: exit
- if ((event.type == sf::Event::Closed) ||
+ if ((event.type == sf::Event::Closed) ||
((event.type == sf::Event::KeyPressed) && (event.key.code == sf::Keyboard::Escape)))
{
window.close();
@@ -188,7 +188,7 @@ int main()
// Check the collisions between the ball and the paddles
// Left Paddle
- if (ball.getPosition().x - ballRadius < leftPaddle.getPosition().x + paddleSize.x / 2 &&
+ if (ball.getPosition().x - ballRadius < leftPaddle.getPosition().x + paddleSize.x / 2 &&
ball.getPosition().x - ballRadius > leftPaddle.getPosition().x &&
ball.getPosition().y + ballRadius >= leftPaddle.getPosition().y - paddleSize.y / 2 &&
ball.getPosition().y - ballRadius <= leftPaddle.getPosition().y + paddleSize.y / 2)
diff --git a/examples/shader/resources/blink.frag b/examples/shader/resources/blink.frag
index 07c8ddb..50a04a5 100644
--- a/examples/shader/resources/blink.frag
+++ b/examples/shader/resources/blink.frag
@@ -5,5 +5,5 @@ void main()
{
vec4 pixel = gl_Color;
pixel.a = blink_alpha;
- gl_FragColor = pixel;
+ gl_FragColor = pixel;
}
diff --git a/examples/shader/resources/blur.frag b/examples/shader/resources/blur.frag
index 8d4261a..b8aba38 100644
--- a/examples/shader/resources/blur.frag
+++ b/examples/shader/resources/blur.frag
@@ -3,10 +3,10 @@ uniform float blur_radius;
void main()
{
- vec2 offx = vec2(blur_radius, 0.0);
- vec2 offy = vec2(0.0, blur_radius);
+ vec2 offx = vec2(blur_radius, 0.0);
+ vec2 offy = vec2(0.0, blur_radius);
- vec4 pixel = texture2D(texture, gl_TexCoord[0].xy) * 4.0 +
+ vec4 pixel = texture2D(texture, gl_TexCoord[0].xy) * 4.0 +
texture2D(texture, gl_TexCoord[0].xy - offx) * 2.0 +
texture2D(texture, gl_TexCoord[0].xy + offx) * 2.0 +
texture2D(texture, gl_TexCoord[0].xy - offy) * 2.0 +
@@ -16,5 +16,5 @@ void main()
texture2D(texture, gl_TexCoord[0].xy + offx - offy) * 1.0 +
texture2D(texture, gl_TexCoord[0].xy + offx + offy) * 1.0;
- gl_FragColor = gl_Color * (pixel / 16.0);
+ gl_FragColor = gl_Color * (pixel / 16.0);
}
diff --git a/examples/shader/resources/edge.frag b/examples/shader/resources/edge.frag
index ad2cd8d..7f869f5 100644
--- a/examples/shader/resources/edge.frag
+++ b/examples/shader/resources/edge.frag
@@ -4,17 +4,17 @@ uniform float edge_threshold;
void main()
{
const float offset = 1.0 / 512.0;
- vec2 offx = vec2(offset, 0.0);
- vec2 offy = vec2(0.0, offset);
+ vec2 offx = vec2(offset, 0.0);
+ vec2 offy = vec2(0.0, offset);
- vec4 hEdge = texture2D(texture, gl_TexCoord[0].xy - offy) * -2.0 +
+ vec4 hEdge = texture2D(texture, gl_TexCoord[0].xy - offy) * -2.0 +
texture2D(texture, gl_TexCoord[0].xy + offy) * 2.0 +
texture2D(texture, gl_TexCoord[0].xy - offx - offy) * -1.0 +
texture2D(texture, gl_TexCoord[0].xy - offx + offy) * 1.0 +
texture2D(texture, gl_TexCoord[0].xy + offx - offy) * -1.0 +
texture2D(texture, gl_TexCoord[0].xy + offx + offy) * 1.0;
- vec4 vEdge = texture2D(texture, gl_TexCoord[0].xy - offx) * 2.0 +
+ vec4 vEdge = texture2D(texture, gl_TexCoord[0].xy - offx) * 2.0 +
texture2D(texture, gl_TexCoord[0].xy + offx) * -2.0 +
texture2D(texture, gl_TexCoord[0].xy - offx - offy) * 1.0 +
texture2D(texture, gl_TexCoord[0].xy - offx + offy) * -1.0 +
@@ -28,5 +28,5 @@ void main()
pixel.rgb = vec3(0.0, 0.0, 0.0);
else
pixel.a = edge_threshold;
- gl_FragColor = pixel;
+ gl_FragColor = pixel;
}
diff --git a/examples/shader/resources/pixelate.frag b/examples/shader/resources/pixelate.frag
index d8d01d0..79f8868 100644
--- a/examples/shader/resources/pixelate.frag
+++ b/examples/shader/resources/pixelate.frag
@@ -4,6 +4,6 @@ uniform float pixel_threshold;
void main()
{
float factor = 1.0 / (pixel_threshold + 0.001);
- vec2 pos = floor(gl_TexCoord[0].xy * factor + 0.5) / factor;
- gl_FragColor = texture2D(texture, pos) * gl_Color;
+ vec2 pos = floor(gl_TexCoord[0].xy * factor + 0.5) / factor;
+ gl_FragColor = texture2D(texture, pos) * gl_Color;
}
diff --git a/examples/shader/resources/storm.vert b/examples/shader/resources/storm.vert
index 442f80a..fab9da4 100644
--- a/examples/shader/resources/storm.vert
+++ b/examples/shader/resources/storm.vert
@@ -13,7 +13,7 @@ void main()
vertex.xy = storm_position + normalize(offset) * push_distance;
}
- gl_Position = gl_ProjectionMatrix * vertex;
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
- gl_FrontColor = gl_Color;
+ gl_Position = gl_ProjectionMatrix * vertex;
+ gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_FrontColor = gl_Color;
}
diff --git a/examples/shader/resources/wave.vert b/examples/shader/resources/wave.vert
index 5089cfb..278a53b 100644
--- a/examples/shader/resources/wave.vert
+++ b/examples/shader/resources/wave.vert
@@ -9,7 +9,7 @@ void main()
vertex.y += sin(gl_Vertex.x * 0.02 + wave_phase * 2.4) * wave_amplitude.y
+ cos(gl_Vertex.x * 0.02 + wave_phase * 5.2) * wave_amplitude.y * 0.3;
- gl_Position = gl_ModelViewProjectionMatrix * vertex;
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
- gl_FrontColor = gl_Color;
+ gl_Position = gl_ModelViewProjectionMatrix * vertex;
+ gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_FrontColor = gl_Color;
}
diff --git a/examples/sound/Sound.cpp b/examples/sound/Sound.cpp
index 7005f64..b579fb5 100644
--- a/examples/sound/Sound.cpp
+++ b/examples/sound/Sound.cpp
@@ -5,6 +5,7 @@
#include <SFML/Audio.hpp>
#include <iomanip>
#include <iostream>
+#include <string>
////////////////////////////////////////////////////////////
@@ -46,15 +47,15 @@ void playSound()
/// Play a music
///
////////////////////////////////////////////////////////////
-void playMusic()
+void playMusic(const std::string& filename)
{
// Load an ogg music file
sf::Music music;
- if (!music.openFromFile("resources/orchestral.ogg"))
+ if (!music.openFromFile("resources/" + filename))
return;
// Display music informations
- std::cout << "orchestral.ogg:" << std::endl;
+ std::cout << filename << ":" << std::endl;
std::cout << " " << music.getDuration().asSeconds() << " seconds" << std::endl;
std::cout << " " << music.getSampleRate() << " samples / sec" << std::endl;
std::cout << " " << music.getChannelCount() << " channels" << std::endl;
@@ -72,7 +73,7 @@ void playMusic()
std::cout << "\rPlaying... " << std::fixed << std::setprecision(2) << music.getPlayingOffset().asSeconds() << " sec ";
std::cout << std::flush;
}
- std::cout << std::endl;
+ std::cout << std::endl << std::endl;
}
@@ -87,8 +88,11 @@ int main()
// Play a sound
playSound();
- // Play a music
- playMusic();
+ // Play music from an ogg file
+ playMusic("orchestral.ogg");
+
+ // Play music from a flac file
+ playMusic("ding.flac");
// Wait until the user presses 'enter' key
std::cout << "Press enter to exit..." << std::endl;
diff --git a/examples/win32/Win32.cpp b/examples/win32/Win32.cpp
index 5df33a8..aedfc76 100644
--- a/examples/win32/Win32.cpp
+++ b/examples/win32/Win32.cpp
@@ -47,8 +47,10 @@ LRESULT CALLBACK onEvent(HWND handle, UINT message, WPARAM wParam, LPARAM lParam
/// \return Error code
///
////////////////////////////////////////////////////////////
-INT WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR, INT)
+int main()
{
+ HINSTANCE instance = GetModuleHandle(NULL);
+
// Define a class for our main window
WNDCLASS windowClass;
windowClass.style = 0;
diff --git a/examples/window/CMakeLists.txt b/examples/window/CMakeLists.txt
index e49340c..2ce61a0 100644
--- a/examples/window/CMakeLists.txt
+++ b/examples/window/CMakeLists.txt
@@ -4,7 +4,7 @@ set(SRCROOT ${PROJECT_SOURCE_DIR}/examples/window)
# all source files
set(SRC ${SRCROOT}/Window.cpp)
-# find OpenGL and GLU
+# find OpenGL
find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIR})
set(ADDITIONAL_LIBRARIES ${OPENGL_LIBRARIES})
diff --git a/examples/window/Window.cpp b/examples/window/Window.cpp
index 46adf0d..3fcea52 100644
--- a/examples/window/Window.cpp
+++ b/examples/window/Window.cpp
@@ -13,9 +13,9 @@
////////////////////////////////////////////////////////////
int main()
{
- // Request a 32-bits depth buffer when creating the window
+ // Request a 24-bits depth buffer when creating the window
sf::ContextSettings contextSettings;
- contextSettings.depthBits = 32;
+ contextSettings.depthBits = 24;
// Create the main window
sf::Window window(sf::VideoMode(640, 480), "SFML window with OpenGL", sf::Style::Default, contextSettings);
diff --git a/extlibs/Android.mk b/extlibs/Android.mk
new file mode 100644
index 0000000..0960e3e
--- /dev/null
+++ b/extlibs/Android.mk
@@ -0,0 +1,19 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := freetype
+LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libfreetype.a
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+include $(PREBUILT_STATIC_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := jpeg
+LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libjpeg.a
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+include $(PREBUILT_STATIC_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := openal
+LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libopenal.so
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+include $(PREBUILT_SHARED_LIBRARY)
diff --git a/extlibs/headers/stb_image/stb_image.h b/extlibs/headers/stb_image/stb_image.h
new file mode 100644
index 0000000..c3945c2
--- /dev/null
+++ b/extlibs/headers/stb_image/stb_image.h
@@ -0,0 +1,6326 @@
+/* stb_image - v2.02 - public domain image loader - http://nothings.org/stb_image.h
+ no warranty implied; use at your own risk
+
+ Do this:
+ #define STB_IMAGE_IMPLEMENTATION
+ before you include this file in *one* C or C++ file to create the implementation.
+
+ // i.e. it should look like this:
+ #include ...
+ #include ...
+ #include ...
+ #define STB_IMAGE_IMPLEMENTATION
+ #include "stb_image.h"
+
+ You can #define STBI_ASSERT(x) before the #include to avoid using assert.h.
+ And #define STBI_MALLOC, STBI_REALLOC, and STBI_FREE to avoid using malloc,realloc,free
+
+
+ QUICK NOTES:
+ Primarily of interest to game developers and other people who can
+ avoid problematic images and only need the trivial interface
+
+ JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib)
+ PNG 1/2/4/8-bit-per-channel (16 bpc not supported)
+
+ TGA (not sure what subset, if a subset)
+ BMP non-1bpp, non-RLE
+ PSD (composited view only, no extra channels)
+
+ GIF (*comp always reports as 4-channel)
+ HDR (radiance rgbE format)
+ PIC (Softimage PIC)
+ PNM (PPM and PGM binary only)
+
+ - decode from memory or through FILE (define STBI_NO_STDIO to remove code)
+ - decode from arbitrary I/O callbacks
+ - SIMD acceleration on x86/x64 (SSE2) and ARM (NEON)
+
+ Full documentation under "DOCUMENTATION" below.
+
+
+ Revision 2.00 release notes:
+
+ - Progressive JPEG is now supported.
+
+ - PPM and PGM binary formats are now supported, thanks to Ken Miller.
+
+ - x86 platforms now make use of SSE2 SIMD instructions for
+ JPEG decoding, and ARM platforms can use NEON SIMD if requested.
+ This work was done by Fabian "ryg" Giesen. SSE2 is used by
+ default, but NEON must be enabled explicitly; see docs.
+
+ With other JPEG optimizations included in this version, we see
+ 2x speedup on a JPEG on an x86 machine, and a 1.5x speedup
+ on a JPEG on an ARM machine, relative to previous versions of this
+ library. The same results will not obtain for all JPGs and for all
+ x86/ARM machines. (Note that progressive JPEGs are significantly
+ slower to decode than regular JPEGs.) This doesn't mean that this
+ is the fastest JPEG decoder in the land; rather, it brings it
+ closer to parity with standard libraries. If you want the fastest
+ decode, look elsewhere. (See "Philosophy" section of docs below.)
+
+ See final bullet items below for more info on SIMD.
+
+ - Added STBI_MALLOC, STBI_REALLOC, and STBI_FREE macros for replacing
+ the memory allocator. Unlike other STBI libraries, these macros don't
+ support a context parameter, so if you need to pass a context in to
+ the allocator, you'll have to store it in a global or a thread-local
+ variable.
+
+ - Split existing STBI_NO_HDR flag into two flags, STBI_NO_HDR and
+ STBI_NO_LINEAR.
+ STBI_NO_HDR: suppress implementation of .hdr reader format
+ STBI_NO_LINEAR: suppress high-dynamic-range light-linear float API
+
+ - You can suppress implementation of any of the decoders to reduce
+ your code footprint by #defining one or more of the following
+ symbols before creating the implementation.
+
+ STBI_NO_JPEG
+ STBI_NO_PNG
+ STBI_NO_BMP
+ STBI_NO_PSD
+ STBI_NO_TGA
+ STBI_NO_GIF
+ STBI_NO_HDR
+ STBI_NO_PIC
+ STBI_NO_PNM (.ppm and .pgm)
+
+ - You can request *only* certain decoders and suppress all other ones
+ (this will be more forward-compatible, as addition of new decoders
+ doesn't require you to disable them explicitly):
+
+ STBI_ONLY_JPEG
+ STBI_ONLY_PNG
+ STBI_ONLY_BMP
+ STBI_ONLY_PSD
+ STBI_ONLY_TGA
+ STBI_ONLY_GIF
+ STBI_ONLY_HDR
+ STBI_ONLY_PIC
+ STBI_ONLY_PNM (.ppm and .pgm)
+
+ Note that you can define multiples of these, and you will get all
+ of them ("only x" and "only y" is interpreted to mean "only x&y").
+
+ - If you use STBI_NO_PNG (or _ONLY_ without PNG), and you still
+ want the zlib decoder to be available, #define STBI_SUPPORT_ZLIB
+
+ - Compilation of all SIMD code can be suppressed with
+ #define STBI_NO_SIMD
+ It should not be necessary to disable SIMD unless you have issues
+ compiling (e.g. using an x86 compiler which doesn't support SSE
+ intrinsics or that doesn't support the method used to detect
+ SSE2 support at run-time), and even those can be reported as
+ bugs so I can refine the built-in compile-time checking to be
+ smarter.
+
+ - The old STBI_SIMD system which allowed installing a user-defined
+ IDCT etc. has been removed. If you need this, don't upgrade. My
+ assumption is that almost nobody was doing this, and those who
+ were will find the built-in SIMD more satisfactory anyway.
+
+ - RGB values computed for JPEG images are slightly different from
+ previous versions of stb_image. (This is due to using less
+ integer precision in SIMD.) The C code has been adjusted so
+ that the same RGB values will be computed regardless of whether
+ SIMD support is available, so your app should always produce
+ consistent results. But these results are slightly different from
+ previous versions. (Specifically, about 3% of available YCbCr values
+ will compute different RGB results from pre-1.49 versions by +-1;
+ most of the deviating values are one smaller in the G channel.)
+
+ - If you must produce consistent results with previous versions of
+ stb_image, #define STBI_JPEG_OLD and you will get the same results
+ you used to; however, you will not get the SIMD speedups for
+ the YCbCr-to-RGB conversion step (although you should still see
+ significant JPEG speedup from the other changes).
+
+ Please note that STBI_JPEG_OLD is a temporary feature; it will be
+ removed in future versions of the library. It is only intended for
+ near-term back-compatibility use.
+
+
+ Latest revision history:
+ 2.02 (2015-01-19) fix incorrect assert, fix warning
+ 2.01 (2015-01-17) fix various warnings
+ 2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG
+ 2.00 (2014-12-25) optimize JPEG, including x86 SSE2 & ARM NEON SIMD
+ progressive JPEG
+ PGM/PPM support
+ STBI_MALLOC,STBI_REALLOC,STBI_FREE
+ STBI_NO_*, STBI_ONLY_*
+ GIF bugfix
+ 1.48 (2014-12-14) fix incorrectly-named assert()
+ 1.47 (2014-12-14) 1/2/4-bit PNG support (both grayscale and paletted)
+ optimize PNG
+ fix bug in interlaced PNG with user-specified channel count
+ 1.46 (2014-08-26) fix broken tRNS chunk in non-paletted PNG
+ 1.45 (2014-08-16) workaround MSVC-ARM internal compiler error by wrapping malloc
+
+ See end of file for full revision history.
+
+
+ ============================ Contributors =========================
+
+ Image formats Bug fixes & warning fixes
+ Sean Barrett (jpeg, png, bmp) Marc LeBlanc
+ Nicolas Schulz (hdr, psd) Christpher Lloyd
+ Jonathan Dummer (tga) Dave Moore
+ Jean-Marc Lienher (gif) Won Chun
+ Tom Seddon (pic) the Horde3D community
+ Thatcher Ulrich (psd) Janez Zemva
+ Ken Miller (pgm, ppm) Jonathan Blow
+ Laurent Gomila
+ Aruelien Pocheville
+ Extensions, features Ryamond Barbiero
+ Jetro Lauha (stbi_info) David Woo
+ Martin "SpartanJ" Golini (stbi_info) Martin Golini
+ James "moose2000" Brown (iPhone PNG) Roy Eltham
+ Ben "Disch" Wenger (io callbacks) Luke Graham
+ Omar Cornut (1/2/4-bit PNG) Thomas Ruf
+ John Bartholomew
+ Ken Hamada
+ Optimizations & bugfixes Cort Stratton
+ Fabian "ryg" Giesen Blazej Dariusz Roszkowski
+ Arseny Kapoulkine Thibault Reuille
+ Paul Du Bois
+ Guillaume George
+ If your name should be here but Jerry Jansson
+ isn't, let Sean know. Hayaki Saito
+ Johan Duparc
+ Ronny Chevalier
+ Michal Cichon
+ Tero Hanninen
+ Sergio Gonzalez
+ Cass Everitt
+ Engin Manap
+
+License:
+ This software is in the public domain. Where that dedication is not
+ recognized, you are granted a perpetual, irrevocable license to copy
+ and modify this file however you want.
+
+*/
+
+#ifndef STBI_INCLUDE_STB_IMAGE_H
+#define STBI_INCLUDE_STB_IMAGE_H
+
+// DOCUMENTATION
+//
+// Limitations:
+// - no 16-bit-per-channel PNG
+// - no 12-bit-per-channel JPEG
+// - no JPEGs with arithmetic coding
+// - no 1-bit BMP
+// - GIF always returns *comp=4
+//
+// Basic usage (see HDR discussion below for HDR usage):
+// int x,y,n;
+// unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
+// // ... process data if not NULL ...
+// // ... x = width, y = height, n = # 8-bit components per pixel ...
+// // ... replace '0' with '1'..'4' to force that many components per pixel
+// // ... but 'n' will always be the number that it would have been if you said 0
+// stbi_image_free(data)
+//
+// Standard parameters:
+// int *x -- outputs image width in pixels
+// int *y -- outputs image height in pixels
+// int *comp -- outputs # of image components in image file
+// int req_comp -- if non-zero, # of image components requested in result
+//
+// The return value from an image loader is an 'unsigned char *' which points
+// to the pixel data, or NULL on an allocation failure or if the image is
+// corrupt or invalid. The pixel data consists of *y scanlines of *x pixels,
+// with each pixel consisting of N interleaved 8-bit components; the first
+// pixel pointed to is top-left-most in the image. There is no padding between
+// image scanlines or between pixels, regardless of format. The number of
+// components N is 'req_comp' if req_comp is non-zero, or *comp otherwise.
+// If req_comp is non-zero, *comp has the number of components that _would_
+// have been output otherwise. E.g. if you set req_comp to 4, you will always
+// get RGBA output, but you can check *comp to see if it's trivially opaque
+// because e.g. there were only 3 channels in the source image.
+//
+// An output image with N components has the following components interleaved
+// in this order in each pixel:
+//
+// N=#comp components
+// 1 grey
+// 2 grey, alpha
+// 3 red, green, blue
+// 4 red, green, blue, alpha
+//
+// If image loading fails for any reason, the return value will be NULL,
+// and *x, *y, *comp will be unchanged. The function stbi_failure_reason()
+// can be queried for an extremely brief, end-user unfriendly explanation
+// of why the load failed. Define STBI_NO_FAILURE_STRINGS to avoid
+// compiling these strings at all, and STBI_FAILURE_USERMSG to get slightly
+// more user-friendly ones.
+//
+// Paletted PNG, BMP, GIF, and PIC images are automatically depalettized.
+//
+// ===========================================================================
+//
+// Philosophy
+//
+// stb libraries are designed with the following priorities:
+//
+// 1. easy to use
+// 2. easy to maintain
+// 3. good performance
+//
+// Sometimes I let "good performance" creep up in priority over "easy to maintain",
+// and for best performance I may provide less-easy-to-use APIs that give higher
+// performance, in addition to the easy to use ones. Nevertheless, it's important
+// to keep in mind that from the standpoint of you, a client of this library,
+// all you care about is #1 and #3, and stb libraries do not emphasize #3 above all.
+//
+// Some secondary priorities arise directly from the first two, some of which
+// make more explicit reasons why performance can't be emphasized.
+//
+// - Portable ("ease of use")
+// - Small footprint ("easy to maintain")
+// - No dependencies ("ease of use")
+//
+// ===========================================================================
+//
+// I/O callbacks
+//
+// I/O callbacks allow you to read from arbitrary sources, like packaged
+// files or some other source. Data read from callbacks are processed
+// through a small internal buffer (currently 128 bytes) to try to reduce
+// overhead.
+//
+// The three functions you must define are "read" (reads some bytes of data),
+// "skip" (skips some bytes of data), "eof" (reports if the stream is at the end).
+//
+// ===========================================================================
+//
+// SIMD support
+//
+// The JPEG decoder will try to automatically use SIMD kernels on x86 when
+// supported by the compiler. For ARM Neon support, you must explicitly
+// request it.
+//
+// (The old do-it-yourself SIMD API is no longer supported in the current
+// code.)
+//
+// On x86, SSE2 will automatically be used when available based on a run-time
+// test; if not, the generic C versions are used as a fall-back. On ARM targets,
+// the typical path is to have separate builds for NEON and non-NEON devices
+// (at least this is true for iOS and Android). Therefore, the NEON support is
+// toggled by a build flag: define STBI_NEON to get NEON loops.
+//
+// The output of the JPEG decoder is slightly different from versions where
+// SIMD support was introduced (that is, for versions before 1.49). The
+// difference is only +-1 in the 8-bit RGB channels, and only on a small
+// fraction of pixels. You can force the pre-1.49 behavior by defining
+// STBI_JPEG_OLD, but this will disable some of the SIMD decoding path
+// and hence cost some performance.
+//
+// If for some reason you do not want to use any of SIMD code, or if
+// you have issues compiling it, you can disable it entirely by
+// defining STBI_NO_SIMD.
+//
+// ===========================================================================
+//
+// HDR image support (disable by defining STBI_NO_HDR)
+//
+// stb_image now supports loading HDR images in general, and currently
+// the Radiance .HDR file format, although the support is provided
+// generically. You can still load any file through the existing interface;
+// if you attempt to load an HDR file, it will be automatically remapped to
+// LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1;
+// both of these constants can be reconfigured through this interface:
+//
+// stbi_hdr_to_ldr_gamma(2.2f);
+// stbi_hdr_to_ldr_scale(1.0f);
+//
+// (note, do not use _inverse_ constants; stbi_image will invert them
+// appropriately).
+//
+// Additionally, there is a new, parallel interface for loading files as
+// (linear) floats to preserve the full dynamic range:
+//
+// float *data = stbi_loadf(filename, &x, &y, &n, 0);
+//
+// If you load LDR images through this interface, those images will
+// be promoted to floating point values, run through the inverse of
+// constants corresponding to the above:
+//
+// stbi_ldr_to_hdr_scale(1.0f);
+// stbi_ldr_to_hdr_gamma(2.2f);
+//
+// Finally, given a filename (or an open file or memory block--see header
+// file for details) containing image data, you can query for the "most
+// appropriate" interface to use (that is, whether the image is HDR or
+// not), using:
+//
+// stbi_is_hdr(char *filename);
+//
+// ===========================================================================
+//
+// iPhone PNG support:
+//
+// By default we convert iphone-formatted PNGs back to RGB, even though
+// they are internally encoded differently. You can disable this conversion
+// by by calling stbi_convert_iphone_png_to_rgb(0), in which case
+// you will always just get the native iphone "format" through (which
+// is BGR stored in RGB).
+//
+// Call stbi_set_unpremultiply_on_load(1) as well to force a divide per
+// pixel to remove any premultiplied alpha *only* if the image file explicitly
+// says there's premultiplied data (currently only happens in iPhone images,
+// and only if iPhone convert-to-rgb processing is on).
+//
+
+
+#ifndef STBI_NO_STDIO
+#include <stdio.h>
+#endif // STBI_NO_STDIO
+
+#define STBI_VERSION 1
+
+enum
+{
+ STBI_default = 0, // only used for req_comp
+
+ STBI_grey = 1,
+ STBI_grey_alpha = 2,
+ STBI_rgb = 3,
+ STBI_rgb_alpha = 4
+};
+
+typedef unsigned char stbi_uc;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef STB_IMAGE_STATIC
+#define STBIDEF static
+#else
+#define STBIDEF extern
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// PRIMARY API - works on images of any type
+//
+
+//
+// load image by filename, open file, or memory buffer
+//
+
+typedef struct
+{
+ int (*read) (void *user,char *data,int size); // fill 'data' with 'size' bytes. return number of bytes actually read
+ void (*skip) (void *user,int n); // skip the next 'n' bytes, or 'unget' the last -n bytes if negative
+ int (*eof) (void *user); // returns nonzero if we are at end of file/data
+} stbi_io_callbacks;
+
+STBIDEF stbi_uc *stbi_load (char const *filename, int *x, int *y, int *comp, int req_comp);
+STBIDEF stbi_uc *stbi_load_from_memory (stbi_uc const *buffer, int len , int *x, int *y, int *comp, int req_comp);
+STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk , void *user, int *x, int *y, int *comp, int req_comp);
+
+#ifndef STBI_NO_STDIO
+STBIDEF stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp);
+// for stbi_load_from_file, file pointer is left pointing immediately after image
+#endif
+
+#ifndef STBI_NO_LINEAR
+ STBIDEF float *stbi_loadf (char const *filename, int *x, int *y, int *comp, int req_comp);
+ STBIDEF float *stbi_loadf_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp);
+ STBIDEF float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp);
+
+ #ifndef STBI_NO_STDIO
+ STBIDEF float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *comp, int req_comp);
+ #endif
+#endif
+
+#ifndef STBI_NO_HDR
+ STBIDEF void stbi_hdr_to_ldr_gamma(float gamma);
+ STBIDEF void stbi_hdr_to_ldr_scale(float scale);
+#endif
+
+#ifndef STBI_NO_LINEAR
+ STBIDEF void stbi_ldr_to_hdr_gamma(float gamma);
+ STBIDEF void stbi_ldr_to_hdr_scale(float scale);
+#endif // STBI_NO_HDR
+
+// stbi_is_hdr is always defined, but always returns false if STBI_NO_HDR
+STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user);
+STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len);
+#ifndef STBI_NO_STDIO
+STBIDEF int stbi_is_hdr (char const *filename);
+STBIDEF int stbi_is_hdr_from_file(FILE *f);
+#endif // STBI_NO_STDIO
+
+
+// get a VERY brief reason for failure
+// NOT THREADSAFE
+STBIDEF const char *stbi_failure_reason (void);
+
+// free the loaded image -- this is just free()
+STBIDEF void stbi_image_free (void *retval_from_stbi_load);
+
+// get image dimensions & components without fully decoding
+STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp);
+STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp);
+
+#ifndef STBI_NO_STDIO
+STBIDEF int stbi_info (char const *filename, int *x, int *y, int *comp);
+STBIDEF int stbi_info_from_file (FILE *f, int *x, int *y, int *comp);
+
+#endif
+
+
+
+// for image formats that explicitly notate that they have premultiplied alpha,
+// we just return the colors as stored in the file. set this flag to force
+// unpremultiplication. results are undefined if the unpremultiply overflow.
+STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply);
+
+// indicate whether we should process iphone images back to canonical format,
+// or just pass them through "as-is"
+STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert);
+
+
+// ZLIB client - used by PNG, available for other purposes
+
+STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen);
+STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header);
+STBIDEF char *stbi_zlib_decode_malloc(const char *buffer, int len, int *outlen);
+STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);
+
+STBIDEF char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len, int *outlen);
+STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+//
+//
+//// end header file /////////////////////////////////////////////////////
+#endif // STBI_INCLUDE_STB_IMAGE_H
+
+#ifdef STB_IMAGE_IMPLEMENTATION
+
+#if defined(STBI_ONLY_JPEG) || defined(STBI_ONLY_PNG) || defined(STBI_ONLY_BMP) \
+ || defined(STBI_ONLY_TGA) || defined(STBI_ONLY_GIF) || defined(STBI_ONLY_PSD) \
+ || defined(STBI_ONLY_HDR) || defined(STBI_ONLY_PIC) || defined(STBI_ONLY_PNM) \
+ || defined(STBI_ONLY_ZLIB)
+ #ifndef STBI_ONLY_JPEG
+ #define STBI_NO_JPEG
+ #endif
+ #ifndef STBI_ONLY_PNG
+ #define STBI_NO_PNG
+ #endif
+ #ifndef STBI_ONLY_BMP
+ #define STBI_NO_BMP
+ #endif
+ #ifndef STBI_ONLY_PSD
+ #define STBI_NO_PSD
+ #endif
+ #ifndef STBI_ONLY_TGA
+ #define STBI_NO_TGA
+ #endif
+ #ifndef STBI_ONLY_GIF
+ #define STBI_NO_GIF
+ #endif
+ #ifndef STBI_ONLY_HDR
+ #define STBI_NO_HDR
+ #endif
+ #ifndef STBI_ONLY_PIC
+ #define STBI_NO_PIC
+ #endif
+ #ifndef STBI_ONLY_PNM
+ #define STBI_NO_PNM
+ #endif
+#endif
+
+#if defined(STBI_NO_PNG) && !defined(STBI_SUPPORT_ZLIB) && !defined(STBI_NO_ZLIB)
+#define STBI_NO_ZLIB
+#endif
+
+
+#include <stdarg.h>
+#include <stddef.h> // ptrdiff_t on osx
+#include <stdlib.h>
+#include <string.h>
+
+#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR)
+#include <math.h> // ldexp
+#endif
+
+#ifndef STBI_NO_STDIO
+#include <stdio.h>
+#endif
+
+#ifndef STBI_ASSERT
+#include <assert.h>
+#define STBI_ASSERT(x) assert(x)
+#endif
+
+
+#ifndef _MSC_VER
+ #ifdef __cplusplus
+ #define stbi_inline inline
+ #else
+ #define stbi_inline
+ #endif
+#else
+ #define stbi_inline __forceinline
+#endif
+
+
+#ifdef _MSC_VER
+typedef unsigned short stbi__uint16;
+typedef signed short stbi__int16;
+typedef unsigned int stbi__uint32;
+typedef signed int stbi__int32;
+#else
+#include <stdint.h>
+typedef uint16_t stbi__uint16;
+typedef int16_t stbi__int16;
+typedef uint32_t stbi__uint32;
+typedef int32_t stbi__int32;
+#endif
+
+// should produce compiler error if size is wrong
+typedef unsigned char validate_uint32[sizeof(stbi__uint32)==4 ? 1 : -1];
+
+#ifdef _MSC_VER
+#define STBI_NOTUSED(v) (void)(v)
+#else
+#define STBI_NOTUSED(v) (void)sizeof(v)
+#endif
+
+#ifdef _MSC_VER
+#define STBI_HAS_LROTL
+#endif
+
+#ifdef STBI_HAS_LROTL
+ #define stbi_lrot(x,y) _lrotl(x,y)
+#else
+ #define stbi_lrot(x,y) (((x) << (y)) | ((x) >> (32 - (y))))
+#endif
+
+#if defined(STBI_MALLOC) && defined(STBI_FREE) && defined(STBI_REALLOC)
+// ok
+#elif !defined(STBI_MALLOC) && !defined(STBI_FREE) && !defined(STBI_REALLOC)
+// ok
+#else
+#error "Must define all or none of STBI_MALLOC, STBI_FREE, and STBI_REALLOC."
+#endif
+
+#ifndef STBI_MALLOC
+#define STBI_MALLOC(sz) malloc(sz)
+#define STBI_REALLOC(p,sz) realloc(p,sz)
+#define STBI_FREE(p) free(p)
+#endif
+
+#if defined(__GNUC__) && !defined(__SSE2__) && !defined(STBI_NO_SIMD)
+// gcc doesn't support sse2 intrinsics unless you compile with -msse2,
+// (but compiling with -msse2 allows the compiler to use SSE2 everywhere;
+// this is just broken and gcc are jerks for not fixing it properly
+// http://www.virtualdub.org/blog/pivot/entry.php?id=363 )
+#define STBI_NO_SIMD
+#endif
+
+#if !defined(STBI_NO_SIMD) && (defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86))
+#define STBI_SSE2
+#include <emmintrin.h>
+
+#ifdef _MSC_VER
+
+#if _MSC_VER >= 1400 // not VC6
+#include <intrin.h> // __cpuid
+static int stbi__cpuid3(void)
+{
+ int info[4];
+ __cpuid(info,1);
+ return info[3];
+}
+#else
+static int stbi__cpuid3(void)
+{
+ int res;
+ __asm {
+ mov eax,1
+ cpuid
+ mov res,edx
+ }
+ return res;
+}
+#endif
+
+#define STBI_SIMD_ALIGN(type, name) __declspec(align(16)) type name
+
+static int stbi__sse2_available()
+{
+ int info3 = stbi__cpuid3();
+ return ((info3 >> 26) & 1) != 0;
+}
+#else // assume GCC-style if not VC++
+#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16)))
+
+static int stbi__sse2_available()
+{
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 // GCC 4.8 or later
+ // GCC 4.8+ has a nice way to do this
+ return __builtin_cpu_supports("sse2");
+#else
+ // portable way to do this, preferably without using GCC inline ASM?
+ // just bail for now.
+ return 0;
+#endif
+}
+#endif
+#endif
+
+// ARM NEON
+#if defined(STBI_NO_SIMD) && defined(STBI_NEON)
+#undef STBI_NEON
+#endif
+
+#ifdef STBI_NEON
+#include <arm_neon.h>
+// assume GCC or Clang on ARM targets
+#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16)))
+#endif
+
+#ifndef STBI_SIMD_ALIGN
+#define STBI_SIMD_ALIGN(type, name) type name
+#endif
+
+///////////////////////////////////////////////
+//
+// stbi__context struct and start_xxx functions
+
+// stbi__context structure is our basic context used by all images, so it
+// contains all the IO context, plus some basic image information
+typedef struct
+{
+ stbi__uint32 img_x, img_y;
+ int img_n, img_out_n;
+
+ stbi_io_callbacks io;
+ void *io_user_data;
+
+ int read_from_callbacks;
+ int buflen;
+ stbi_uc buffer_start[128];
+
+ stbi_uc *img_buffer, *img_buffer_end;
+ stbi_uc *img_buffer_original;
+} stbi__context;
+
+
+static void stbi__refill_buffer(stbi__context *s);
+
+// initialize a memory-decode context
+static void stbi__start_mem(stbi__context *s, stbi_uc const *buffer, int len)
+{
+ s->io.read = NULL;
+ s->read_from_callbacks = 0;
+ s->img_buffer = s->img_buffer_original = (stbi_uc *) buffer;
+ s->img_buffer_end = (stbi_uc *) buffer+len;
+}
+
+// initialize a callback-based context
+static void stbi__start_callbacks(stbi__context *s, stbi_io_callbacks *c, void *user)
+{
+ s->io = *c;
+ s->io_user_data = user;
+ s->buflen = sizeof(s->buffer_start);
+ s->read_from_callbacks = 1;
+ s->img_buffer_original = s->buffer_start;
+ stbi__refill_buffer(s);
+}
+
+#ifndef STBI_NO_STDIO
+
+static int stbi__stdio_read(void *user, char *data, int size)
+{
+ return (int) fread(data,1,size,(FILE*) user);
+}
+
+static void stbi__stdio_skip(void *user, int n)
+{
+ fseek((FILE*) user, n, SEEK_CUR);
+}
+
+static int stbi__stdio_eof(void *user)
+{
+ return feof((FILE*) user);
+}
+
+static stbi_io_callbacks stbi__stdio_callbacks =
+{
+ stbi__stdio_read,
+ stbi__stdio_skip,
+ stbi__stdio_eof,
+};
+
+static void stbi__start_file(stbi__context *s, FILE *f)
+{
+ stbi__start_callbacks(s, &stbi__stdio_callbacks, (void *) f);
+}
+
+//static void stop_file(stbi__context *s) { }
+
+#endif // !STBI_NO_STDIO
+
+static void stbi__rewind(stbi__context *s)
+{
+ // conceptually rewind SHOULD rewind to the beginning of the stream,
+ // but we just rewind to the beginning of the initial buffer, because
+ // we only use it after doing 'test', which only ever looks at at most 92 bytes
+ s->img_buffer = s->img_buffer_original;
+}
+
+#ifndef STBI_NO_JPEG
+static int stbi__jpeg_test(stbi__context *s);
+static stbi_uc *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
+static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp);
+#endif
+
+#ifndef STBI_NO_PNG
+static int stbi__png_test(stbi__context *s);
+static stbi_uc *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
+static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp);
+#endif
+
+#ifndef STBI_NO_BMP
+static int stbi__bmp_test(stbi__context *s);
+static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
+static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp);
+#endif
+
+#ifndef STBI_NO_TGA
+static int stbi__tga_test(stbi__context *s);
+static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
+static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp);
+#endif
+
+#ifndef STBI_NO_PSD
+static int stbi__psd_test(stbi__context *s);
+static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
+static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp);
+#endif
+
+#ifndef STBI_NO_HDR
+static int stbi__hdr_test(stbi__context *s);
+static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
+static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp);
+#endif
+
+#ifndef STBI_NO_PIC
+static int stbi__pic_test(stbi__context *s);
+static stbi_uc *stbi__pic_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
+static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp);
+#endif
+
+#ifndef STBI_NO_GIF
+static int stbi__gif_test(stbi__context *s);
+static stbi_uc *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
+static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp);
+#endif
+
+#ifndef STBI_NO_PNM
+static int stbi__pnm_test(stbi__context *s);
+static stbi_uc *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
+static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp);
+#endif
+
+// this is not threadsafe
+static const char *stbi__g_failure_reason;
+
+STBIDEF const char *stbi_failure_reason(void)
+{
+ return stbi__g_failure_reason;
+}
+
+static int stbi__err(const char *str)
+{
+ stbi__g_failure_reason = str;
+ return 0;
+}
+
+static void *stbi__malloc(size_t size)
+{
+ return STBI_MALLOC(size);
+}
+
+// stbi__err - error
+// stbi__errpf - error returning pointer to float
+// stbi__errpuc - error returning pointer to unsigned char
+
+#ifdef STBI_NO_FAILURE_STRINGS
+ #define stbi__err(x,y) 0
+#elif defined(STBI_FAILURE_USERMSG)
+ #define stbi__err(x,y) stbi__err(y)
+#else
+ #define stbi__err(x,y) stbi__err(x)
+#endif
+
+#define stbi__errpf(x,y) ((float *) (stbi__err(x,y)?NULL:NULL))
+#define stbi__errpuc(x,y) ((unsigned char *) (stbi__err(x,y)?NULL:NULL))
+
+STBIDEF void stbi_image_free(void *retval_from_stbi_load)
+{
+ STBI_FREE(retval_from_stbi_load);
+}
+
+#ifndef STBI_NO_LINEAR
+static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp);
+#endif
+
+#ifndef STBI_NO_HDR
+static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp);
+#endif
+
+static unsigned char *stbi_load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp)
+{
+ #ifndef STBI_NO_JPEG
+ if (stbi__jpeg_test(s)) return stbi__jpeg_load(s,x,y,comp,req_comp);
+ #endif
+ #ifndef STBI_NO_PNG
+ if (stbi__png_test(s)) return stbi__png_load(s,x,y,comp,req_comp);
+ #endif
+ #ifndef STBI_NO_BMP
+ if (stbi__bmp_test(s)) return stbi__bmp_load(s,x,y,comp,req_comp);
+ #endif
+ #ifndef STBI_NO_GIF
+ if (stbi__gif_test(s)) return stbi__gif_load(s,x,y,comp,req_comp);
+ #endif
+ #ifndef STBI_NO_PSD
+ if (stbi__psd_test(s)) return stbi__psd_load(s,x,y,comp,req_comp);
+ #endif
+ #ifndef STBI_NO_PIC
+ if (stbi__pic_test(s)) return stbi__pic_load(s,x,y,comp,req_comp);
+ #endif
+ #ifndef STBI_NO_PNM
+ if (stbi__pnm_test(s)) return stbi__pnm_load(s,x,y,comp,req_comp);
+ #endif
+
+ #ifndef STBI_NO_HDR
+ if (stbi__hdr_test(s)) {
+ float *hdr = stbi__hdr_load(s, x,y,comp,req_comp);
+ return stbi__hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp);
+ }
+ #endif
+
+ #ifndef STBI_NO_TGA
+ // test tga last because it's a crappy test!
+ if (stbi__tga_test(s))
+ return stbi__tga_load(s,x,y,comp,req_comp);
+ #endif
+
+ return stbi__errpuc("unknown image type", "Image not of any known type, or corrupt");
+}
+
+#ifndef STBI_NO_STDIO
+
+static FILE *stbi__fopen(char const *filename, char const *mode)
+{
+ FILE *f;
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ if (0 != fopen_s(&f, filename, mode))
+ f=0;
+#else
+ f = fopen(filename, mode);
+#endif
+ return f;
+}
+
+
+STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp)
+{
+ FILE *f = stbi__fopen(filename, "rb");
+ unsigned char *result;
+ if (!f) return stbi__errpuc("can't fopen", "Unable to open file");
+ result = stbi_load_from_file(f,x,y,comp,req_comp);
+ fclose(f);
+ return result;
+}
+
+STBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)
+{
+ unsigned char *result;
+ stbi__context s;
+ stbi__start_file(&s,f);
+ result = stbi_load_main(&s,x,y,comp,req_comp);
+ if (result) {
+ // need to 'unget' all the characters in the IO buffer
+ fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR);
+ }
+ return result;
+}
+#endif //!STBI_NO_STDIO
+
+STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
+{
+ stbi__context s;
+ stbi__start_mem(&s,buffer,len);
+ return stbi_load_main(&s,x,y,comp,req_comp);
+}
+
+STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
+{
+ stbi__context s;
+ stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
+ return stbi_load_main(&s,x,y,comp,req_comp);
+}
+
+#ifndef STBI_NO_LINEAR
+static float *stbi_loadf_main(stbi__context *s, int *x, int *y, int *comp, int req_comp)
+{
+ unsigned char *data;
+ #ifndef STBI_NO_HDR
+ if (stbi__hdr_test(s))
+ return stbi__hdr_load(s,x,y,comp,req_comp);
+ #endif
+ data = stbi_load_main(s, x, y, comp, req_comp);
+ if (data)
+ return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp);
+ return stbi__errpf("unknown image type", "Image not of any known type, or corrupt");
+}
+
+STBIDEF float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
+{
+ stbi__context s;
+ stbi__start_mem(&s,buffer,len);
+ return stbi_loadf_main(&s,x,y,comp,req_comp);
+}
+
+STBIDEF float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
+{
+ stbi__context s;
+ stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
+ return stbi_loadf_main(&s,x,y,comp,req_comp);
+}
+
+#ifndef STBI_NO_STDIO
+STBIDEF float *stbi_loadf(char const *filename, int *x, int *y, int *comp, int req_comp)
+{
+ float *result;
+ FILE *f = stbi__fopen(filename, "rb");
+ if (!f) return stbi__errpf("can't fopen", "Unable to open file");
+ result = stbi_loadf_from_file(f,x,y,comp,req_comp);
+ fclose(f);
+ return result;
+}
+
+STBIDEF float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)
+{
+ stbi__context s;
+ stbi__start_file(&s,f);
+ return stbi_loadf_main(&s,x,y,comp,req_comp);
+}
+#endif // !STBI_NO_STDIO
+
+#endif // !STBI_NO_LINEAR
+
+// these is-hdr-or-not is defined independent of whether STBI_NO_LINEAR is
+// defined, for API simplicity; if STBI_NO_LINEAR is defined, it always
+// reports false!
+
+STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len)
+{
+ #ifndef STBI_NO_HDR
+ stbi__context s;
+ stbi__start_mem(&s,buffer,len);
+ return stbi__hdr_test(&s);
+ #else
+ STBI_NOTUSED(buffer);
+ STBI_NOTUSED(len);
+ return 0;
+ #endif
+}
+
+#ifndef STBI_NO_STDIO
+STBIDEF int stbi_is_hdr (char const *filename)
+{
+ FILE *f = stbi__fopen(filename, "rb");
+ int result=0;
+ if (f) {
+ result = stbi_is_hdr_from_file(f);
+ fclose(f);
+ }
+ return result;
+}
+
+STBIDEF int stbi_is_hdr_from_file(FILE *f)
+{
+ #ifndef STBI_NO_HDR
+ stbi__context s;
+ stbi__start_file(&s,f);
+ return stbi__hdr_test(&s);
+ #else
+ return 0;
+ #endif
+}
+#endif // !STBI_NO_STDIO
+
+STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user)
+{
+ #ifndef STBI_NO_HDR
+ stbi__context s;
+ stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
+ return stbi__hdr_test(&s);
+ #else
+ return 0;
+ #endif
+}
+
+static float stbi__h2l_gamma_i=1.0f/2.2f, stbi__h2l_scale_i=1.0f;
+static float stbi__l2h_gamma=2.2f, stbi__l2h_scale=1.0f;
+
+#ifndef STBI_NO_LINEAR
+STBIDEF void stbi_ldr_to_hdr_gamma(float gamma) { stbi__l2h_gamma = gamma; }
+STBIDEF void stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = scale; }
+#endif
+
+STBIDEF void stbi_hdr_to_ldr_gamma(float gamma) { stbi__h2l_gamma_i = 1/gamma; }
+STBIDEF void stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = 1/scale; }
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// Common code used by all image loaders
+//
+
+enum
+{
+ STBI__SCAN_load=0,
+ STBI__SCAN_type,
+ STBI__SCAN_header
+};
+
+static void stbi__refill_buffer(stbi__context *s)
+{
+ int n = (s->io.read)(s->io_user_data,(char*)s->buffer_start,s->buflen);
+ if (n == 0) {
+ // at end of file, treat same as if from memory, but need to handle case
+ // where s->img_buffer isn't pointing to safe memory, e.g. 0-byte file
+ s->read_from_callbacks = 0;
+ s->img_buffer = s->buffer_start;
+ s->img_buffer_end = s->buffer_start+1;
+ *s->img_buffer = 0;
+ } else {
+ s->img_buffer = s->buffer_start;
+ s->img_buffer_end = s->buffer_start + n;
+ }
+}
+
+stbi_inline static stbi_uc stbi__get8(stbi__context *s)
+{
+ if (s->img_buffer < s->img_buffer_end)
+ return *s->img_buffer++;
+ if (s->read_from_callbacks) {
+ stbi__refill_buffer(s);
+ return *s->img_buffer++;
+ }
+ return 0;
+}
+
+stbi_inline static int stbi__at_eof(stbi__context *s)
+{
+ if (s->io.read) {
+ if (!(s->io.eof)(s->io_user_data)) return 0;
+ // if feof() is true, check if buffer = end
+ // special case: we've only got the special 0 character at the end
+ if (s->read_from_callbacks == 0) return 1;
+ }
+
+ return s->img_buffer >= s->img_buffer_end;
+}
+
+static void stbi__skip(stbi__context *s, int n)
+{
+ if (s->io.read) {
+ int blen = (int) (s->img_buffer_end - s->img_buffer);
+ if (blen < n) {
+ s->img_buffer = s->img_buffer_end;
+ (s->io.skip)(s->io_user_data, n - blen);
+ return;
+ }
+ }
+ s->img_buffer += n;
+}
+
+static int stbi__getn(stbi__context *s, stbi_uc *buffer, int n)
+{
+ if (s->io.read) {
+ int blen = (int) (s->img_buffer_end - s->img_buffer);
+ if (blen < n) {
+ int res, count;
+
+ memcpy(buffer, s->img_buffer, blen);
+
+ count = (s->io.read)(s->io_user_data, (char*) buffer + blen, n - blen);
+ res = (count == (n-blen));
+ s->img_buffer = s->img_buffer_end;
+ return res;
+ }
+ }
+
+ if (s->img_buffer+n <= s->img_buffer_end) {
+ memcpy(buffer, s->img_buffer, n);
+ s->img_buffer += n;
+ return 1;
+ } else
+ return 0;
+}
+
+static int stbi__get16be(stbi__context *s)
+{
+ int z = stbi__get8(s);
+ return (z << 8) + stbi__get8(s);
+}
+
+static stbi__uint32 stbi__get32be(stbi__context *s)
+{
+ stbi__uint32 z = stbi__get16be(s);
+ return (z << 16) + stbi__get16be(s);
+}
+
+static int stbi__get16le(stbi__context *s)
+{
+ int z = stbi__get8(s);
+ return z + (stbi__get8(s) << 8);
+}
+
+static stbi__uint32 stbi__get32le(stbi__context *s)
+{
+ stbi__uint32 z = stbi__get16le(s);
+ return z + (stbi__get16le(s) << 16);
+}
+
+#define STBI__BYTECAST(x) ((stbi_uc) ((x) & 255)) // truncate int to byte without warnings
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// generic converter from built-in img_n to req_comp
+// individual types do this automatically as much as possible (e.g. jpeg
+// does all cases internally since it needs to colorspace convert anyway,
+// and it never has alpha, so very few cases ). png can automatically
+// interleave an alpha=255 channel, but falls back to this for other cases
+//
+// assume data buffer is malloced, so malloc a new one and free that one
+// only failure mode is malloc failing
+
+static stbi_uc stbi__compute_y(int r, int g, int b)
+{
+ return (stbi_uc) (((r*77) + (g*150) + (29*b)) >> 8);
+}
+
+static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int req_comp, unsigned int x, unsigned int y)
+{
+ int i,j;
+ unsigned char *good;
+
+ if (req_comp == img_n) return data;
+ STBI_ASSERT(req_comp >= 1 && req_comp <= 4);
+
+ good = (unsigned char *) stbi__malloc(req_comp * x * y);
+ if (good == NULL) {
+ STBI_FREE(data);
+ return stbi__errpuc("outofmem", "Out of memory");
+ }
+
+ for (j=0; j < (int) y; ++j) {
+ unsigned char *src = data + j * x * img_n ;
+ unsigned char *dest = good + j * x * req_comp;
+
+ #define COMBO(a,b) ((a)*8+(b))
+ #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
+ // convert source image with img_n components to one with req_comp components;
+ // avoid switch per pixel, so use switch per scanline and massive macros
+ switch (COMBO(img_n, req_comp)) {
+ CASE(1,2) dest[0]=src[0], dest[1]=255; break;
+ CASE(1,3) dest[0]=dest[1]=dest[2]=src[0]; break;
+ CASE(1,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; break;
+ CASE(2,1) dest[0]=src[0]; break;
+ CASE(2,3) dest[0]=dest[1]=dest[2]=src[0]; break;
+ CASE(2,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; break;
+ CASE(3,4) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; break;
+ CASE(3,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break;
+ CASE(3,2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = 255; break;
+ CASE(4,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break;
+ CASE(4,2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = src[3]; break;
+ CASE(4,3) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; break;
+ default: STBI_ASSERT(0);
+ }
+ #undef CASE
+ }
+
+ STBI_FREE(data);
+ return good;
+}
+
+#ifndef STBI_NO_LINEAR
+static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp)
+{
+ int i,k,n;
+ float *output = (float *) stbi__malloc(x * y * comp * sizeof(float));
+ if (output == NULL) { STBI_FREE(data); return stbi__errpf("outofmem", "Out of memory"); }
+ // compute number of non-alpha components
+ if (comp & 1) n = comp; else n = comp-1;
+ for (i=0; i < x*y; ++i) {
+ for (k=0; k < n; ++k) {
+ output[i*comp + k] = (float) (pow(data[i*comp+k]/255.0f, stbi__l2h_gamma) * stbi__l2h_scale);
+ }
+ if (k < comp) output[i*comp + k] = data[i*comp+k]/255.0f;
+ }
+ STBI_FREE(data);
+ return output;
+}
+#endif
+
+#ifndef STBI_NO_HDR
+#define stbi__float2int(x) ((int) (x))
+static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp)
+{
+ int i,k,n;
+ stbi_uc *output = (stbi_uc *) stbi__malloc(x * y * comp);
+ if (output == NULL) { STBI_FREE(data); return stbi__errpuc("outofmem", "Out of memory"); }
+ // compute number of non-alpha components
+ if (comp & 1) n = comp; else n = comp-1;
+ for (i=0; i < x*y; ++i) {
+ for (k=0; k < n; ++k) {
+ float z = (float) pow(data[i*comp+k]*stbi__h2l_scale_i, stbi__h2l_gamma_i) * 255 + 0.5f;
+ if (z < 0) z = 0;
+ if (z > 255) z = 255;
+ output[i*comp + k] = (stbi_uc) stbi__float2int(z);
+ }
+ if (k < comp) {
+ float z = data[i*comp+k] * 255 + 0.5f;
+ if (z < 0) z = 0;
+ if (z > 255) z = 255;
+ output[i*comp + k] = (stbi_uc) stbi__float2int(z);
+ }
+ }
+ STBI_FREE(data);
+ return output;
+}
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// "baseline" JPEG/JFIF decoder
+//
+// simple implementation
+// - doesn't support delayed output of y-dimension
+// - simple interface (only one output format: 8-bit interleaved RGB)
+// - doesn't try to recover corrupt jpegs
+// - doesn't allow partial loading, loading multiple at once
+// - still fast on x86 (copying globals into locals doesn't help x86)
+// - allocates lots of intermediate memory (full size of all components)
+// - non-interleaved case requires this anyway
+// - allows good upsampling (see next)
+// high-quality
+// - upsampled channels are bilinearly interpolated, even across blocks
+// - quality integer IDCT derived from IJG's 'slow'
+// performance
+// - fast huffman; reasonable integer IDCT
+// - some SIMD kernels for common paths on targets with SSE2/NEON
+// - uses a lot of intermediate memory, could cache poorly
+
+#ifndef STBI_NO_JPEG
+
+// huffman decoding acceleration
+#define FAST_BITS 9 // larger handles more cases; smaller stomps less cache
+
+typedef struct
+{
+ stbi_uc fast[1 << FAST_BITS];
+ // weirdly, repacking this into AoS is a 10% speed loss, instead of a win
+ stbi__uint16 code[256];
+ stbi_uc values[256];
+ stbi_uc size[257];
+ unsigned int maxcode[18];
+ int delta[17]; // old 'firstsymbol' - old 'firstcode'
+} stbi__huffman;
+
+typedef struct
+{
+ stbi__context *s;
+ stbi__huffman huff_dc[4];
+ stbi__huffman huff_ac[4];
+ stbi_uc dequant[4][64];
+ stbi__int16 fast_ac[4][1 << FAST_BITS];
+
+// sizes for components, interleaved MCUs
+ int img_h_max, img_v_max;
+ int img_mcu_x, img_mcu_y;
+ int img_mcu_w, img_mcu_h;
+
+// definition of jpeg image component
+ struct
+ {
+ int id;
+ int h,v;
+ int tq;
+ int hd,ha;
+ int dc_pred;
+
+ int x,y,w2,h2;
+ stbi_uc *data;
+ void *raw_data, *raw_coeff;
+ stbi_uc *linebuf;
+ short *coeff; // progressive only
+ int coeff_w, coeff_h; // number of 8x8 coefficient blocks
+ } img_comp[4];
+
+ stbi__uint32 code_buffer; // jpeg entropy-coded buffer
+ int code_bits; // number of valid bits
+ unsigned char marker; // marker seen while filling entropy buffer
+ int nomore; // flag if we saw a marker so must stop
+
+ int progressive;
+ int spec_start;
+ int spec_end;
+ int succ_high;
+ int succ_low;
+ int eob_run;
+
+ int scan_n, order[4];
+ int restart_interval, todo;
+
+// kernels
+ void (*idct_block_kernel)(stbi_uc *out, int out_stride, short data[64]);
+ void (*YCbCr_to_RGB_kernel)(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step);
+ stbi_uc *(*resample_row_hv_2_kernel)(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs);
+} stbi__jpeg;
+
+static int stbi__build_huffman(stbi__huffman *h, int *count)
+{
+ int i,j,k=0,code;
+ // build size list for each symbol (from JPEG spec)
+ for (i=0; i < 16; ++i)
+ for (j=0; j < count[i]; ++j)
+ h->size[k++] = (stbi_uc) (i+1);
+ h->size[k] = 0;
+
+ // compute actual symbols (from jpeg spec)
+ code = 0;
+ k = 0;
+ for(j=1; j <= 16; ++j) {
+ // compute delta to add to code to compute symbol id
+ h->delta[j] = k - code;
+ if (h->size[k] == j) {
+ while (h->size[k] == j)
+ h->code[k++] = (stbi__uint16) (code++);
+ if (code-1 >= (1 << j)) return stbi__err("bad code lengths","Corrupt JPEG");
+ }
+ // compute largest code + 1 for this size, preshifted as needed later
+ h->maxcode[j] = code << (16-j);
+ code <<= 1;
+ }
+ h->maxcode[j] = 0xffffffff;
+
+ // build non-spec acceleration table; 255 is flag for not-accelerated
+ memset(h->fast, 255, 1 << FAST_BITS);
+ for (i=0; i < k; ++i) {
+ int s = h->size[i];
+ if (s <= FAST_BITS) {
+ int c = h->code[i] << (FAST_BITS-s);
+ int m = 1 << (FAST_BITS-s);
+ for (j=0; j < m; ++j) {
+ h->fast[c+j] = (stbi_uc) i;
+ }
+ }
+ }
+ return 1;
+}
+
+// build a table that decodes both magnitude and value of small ACs in
+// one go.
+static void stbi__build_fast_ac(stbi__int16 *fast_ac, stbi__huffman *h)
+{
+ int i;
+ for (i=0; i < (1 << FAST_BITS); ++i) {
+ stbi_uc fast = h->fast[i];
+ fast_ac[i] = 0;
+ if (fast < 255) {
+ int rs = h->values[fast];
+ int run = (rs >> 4) & 15;
+ int magbits = rs & 15;
+ int len = h->size[fast];
+
+ if (magbits && len + magbits <= FAST_BITS) {
+ // magnitude code followed by receive_extend code
+ int k = ((i << len) & ((1 << FAST_BITS) - 1)) >> (FAST_BITS - magbits);
+ int m = 1 << (magbits - 1);
+ if (k < m) k += (-1 << magbits) + 1;
+ // if the result is small enough, we can fit it in fast_ac table
+ if (k >= -128 && k <= 127)
+ fast_ac[i] = (stbi__int16) ((k << 8) + (run << 4) + (len + magbits));
+ }
+ }
+ }
+}
+
+static void stbi__grow_buffer_unsafe(stbi__jpeg *j)
+{
+ do {
+ int b = j->nomore ? 0 : stbi__get8(j->s);
+ if (b == 0xff) {
+ int c = stbi__get8(j->s);
+ if (c != 0) {
+ j->marker = (unsigned char) c;
+ j->nomore = 1;
+ return;
+ }
+ }
+ j->code_buffer |= b << (24 - j->code_bits);
+ j->code_bits += 8;
+ } while (j->code_bits <= 24);
+}
+
+// (1 << n) - 1
+static stbi__uint32 stbi__bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535};
+
+// decode a jpeg huffman value from the bitstream
+stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h)
+{
+ unsigned int temp;
+ int c,k;
+
+ if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
+
+ // look at the top FAST_BITS and determine what symbol ID it is,
+ // if the code is <= FAST_BITS
+ c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
+ k = h->fast[c];
+ if (k < 255) {
+ int s = h->size[k];
+ if (s > j->code_bits)
+ return -1;
+ j->code_buffer <<= s;
+ j->code_bits -= s;
+ return h->values[k];
+ }
+
+ // naive test is to shift the code_buffer down so k bits are
+ // valid, then test against maxcode. To speed this up, we've
+ // preshifted maxcode left so that it has (16-k) 0s at the
+ // end; in other words, regardless of the number of bits, it
+ // wants to be compared against something shifted to have 16;
+ // that way we don't need to shift inside the loop.
+ temp = j->code_buffer >> 16;
+ for (k=FAST_BITS+1 ; ; ++k)
+ if (temp < h->maxcode[k])
+ break;
+ if (k == 17) {
+ // error! code not found
+ j->code_bits -= 16;
+ return -1;
+ }
+
+ if (k > j->code_bits)
+ return -1;
+
+ // convert the huffman code to the symbol id
+ c = ((j->code_buffer >> (32 - k)) & stbi__bmask[k]) + h->delta[k];
+ STBI_ASSERT((((j->code_buffer) >> (32 - h->size[c])) & stbi__bmask[h->size[c]]) == h->code[c]);
+
+ // convert the id to a symbol
+ j->code_bits -= k;
+ j->code_buffer <<= k;
+ return h->values[c];
+}
+
+// bias[n] = (-1<<n) + 1
+static int const stbi__jbias[16] = {0,-1,-3,-7,-15,-31,-63,-127,-255,-511,-1023,-2047,-4095,-8191,-16383,-32767};
+
+// combined JPEG 'receive' and JPEG 'extend', since baseline
+// always extends everything it receives.
+stbi_inline static int stbi__extend_receive(stbi__jpeg *j, int n)
+{
+ unsigned int k;
+ int sgn;
+ if (j->code_bits < n) stbi__grow_buffer_unsafe(j);
+
+ sgn = (stbi__int32)j->code_buffer >> 31; // sign bit is always in MSB
+ k = stbi_lrot(j->code_buffer, n);
+ j->code_buffer = k & ~stbi__bmask[n];
+ k &= stbi__bmask[n];
+ j->code_bits -= n;
+ return k + (stbi__jbias[n] & ~sgn);
+}
+
+// get some unsigned bits
+stbi_inline static int stbi__jpeg_get_bits(stbi__jpeg *j, int n)
+{
+ unsigned int k;
+ if (j->code_bits < n) stbi__grow_buffer_unsafe(j);
+ k = stbi_lrot(j->code_buffer, n);
+ j->code_buffer = k & ~stbi__bmask[n];
+ k &= stbi__bmask[n];
+ j->code_bits -= n;
+ return k;
+}
+
+stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j)
+{
+ unsigned int k;
+ if (j->code_bits < 1) stbi__grow_buffer_unsafe(j);
+ k = j->code_buffer;
+ j->code_buffer <<= 1;
+ --j->code_bits;
+ return k & 0x80000000;
+}
+
+// given a value that's at position X in the zigzag stream,
+// where does it appear in the 8x8 matrix coded as row-major?
+static stbi_uc stbi__jpeg_dezigzag[64+15] =
+{
+ 0, 1, 8, 16, 9, 2, 3, 10,
+ 17, 24, 32, 25, 18, 11, 4, 5,
+ 12, 19, 26, 33, 40, 48, 41, 34,
+ 27, 20, 13, 6, 7, 14, 21, 28,
+ 35, 42, 49, 56, 57, 50, 43, 36,
+ 29, 22, 15, 23, 30, 37, 44, 51,
+ 58, 59, 52, 45, 38, 31, 39, 46,
+ 53, 60, 61, 54, 47, 55, 62, 63,
+ // let corrupt input sample past end
+ 63, 63, 63, 63, 63, 63, 63, 63,
+ 63, 63, 63, 63, 63, 63, 63
+};
+
+// decode one 64-entry block--
+static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, stbi__int16 *fac, int b, stbi_uc *dequant)
+{
+ int diff,dc,k;
+ int t;
+
+ if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
+ t = stbi__jpeg_huff_decode(j, hdc);
+ if (t < 0) return stbi__err("bad huffman code","Corrupt JPEG");
+
+ // 0 all the ac values now so we can do it 32-bits at a time
+ memset(data,0,64*sizeof(data[0]));
+
+ diff = t ? stbi__extend_receive(j, t) : 0;
+ dc = j->img_comp[b].dc_pred + diff;
+ j->img_comp[b].dc_pred = dc;
+ data[0] = (short) (dc * dequant[0]);
+
+ // decode AC components, see JPEG spec
+ k = 1;
+ do {
+ unsigned int zig;
+ int c,r,s;
+ if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
+ c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
+ r = fac[c];
+ if (r) { // fast-AC path
+ k += (r >> 4) & 15; // run
+ s = r & 15; // combined length
+ j->code_buffer <<= s;
+ j->code_bits -= s;
+ // decode into unzigzag'd location
+ zig = stbi__jpeg_dezigzag[k++];
+ data[zig] = (short) ((r >> 8) * dequant[zig]);
+ } else {
+ int rs = stbi__jpeg_huff_decode(j, hac);
+ if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
+ s = rs & 15;
+ r = rs >> 4;
+ if (s == 0) {
+ if (rs != 0xf0) break; // end block
+ k += 16;
+ } else {
+ k += r;
+ // decode into unzigzag'd location
+ zig = stbi__jpeg_dezigzag[k++];
+ data[zig] = (short) (stbi__extend_receive(j,s) * dequant[zig]);
+ }
+ }
+ } while (k < 64);
+ return 1;
+}
+
+static int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64], stbi__huffman *hdc, int b)
+{
+ int diff,dc;
+ int t;
+ if (j->spec_end != 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
+
+ if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
+
+ if (j->succ_high == 0) {
+ // first scan for DC coefficient, must be first
+ memset(data,0,64*sizeof(data[0])); // 0 all the ac values now
+ t = stbi__jpeg_huff_decode(j, hdc);
+ diff = t ? stbi__extend_receive(j, t) : 0;
+
+ dc = j->img_comp[b].dc_pred + diff;
+ j->img_comp[b].dc_pred = dc;
+ data[0] = (short) (dc << j->succ_low);
+ } else {
+ // refinement scan for DC coefficient
+ if (stbi__jpeg_get_bit(j))
+ data[0] += (short) (1 << j->succ_low);
+ }
+ return 1;
+}
+
+// @OPTIMIZE: store non-zigzagged during the decode passes,
+// and only de-zigzag when dequantizing
+static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__huffman *hac, stbi__int16 *fac)
+{
+ int k;
+ if (j->spec_start == 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
+
+ if (j->succ_high == 0) {
+ int shift = j->succ_low;
+
+ if (j->eob_run) {
+ --j->eob_run;
+ return 1;
+ }
+
+ k = j->spec_start;
+ do {
+ unsigned int zig;
+ int c,r,s;
+ if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
+ c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
+ r = fac[c];
+ if (r) { // fast-AC path
+ k += (r >> 4) & 15; // run
+ s = r & 15; // combined length
+ j->code_buffer <<= s;
+ j->code_bits -= s;
+ zig = stbi__jpeg_dezigzag[k++];
+ data[zig] = (short) ((r >> 8) << shift);
+ } else {
+ int rs = stbi__jpeg_huff_decode(j, hac);
+ if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
+ s = rs & 15;
+ r = rs >> 4;
+ if (s == 0) {
+ if (r < 15) {
+ j->eob_run = (1 << r);
+ if (r)
+ j->eob_run += stbi__jpeg_get_bits(j, r);
+ --j->eob_run;
+ break;
+ }
+ k += 16;
+ } else {
+ k += r;
+ zig = stbi__jpeg_dezigzag[k++];
+ data[zig] = (short) (stbi__extend_receive(j,s) << shift);
+ }
+ }
+ } while (k <= j->spec_end);
+ } else {
+ // refinement scan for these AC coefficients
+
+ short bit = (short) (1 << j->succ_low);
+
+ if (j->eob_run) {
+ --j->eob_run;
+ for (k = j->spec_start; k <= j->spec_end; ++k) {
+ short *p = &data[stbi__jpeg_dezigzag[k]];
+ if (*p != 0)
+ if (stbi__jpeg_get_bit(j))
+ if ((*p & bit)==0) {
+ if (*p > 0)
+ *p += bit;
+ else
+ *p -= bit;
+ }
+ }
+ } else {
+ k = j->spec_start;
+ do {
+ int r,s;
+ int rs = stbi__jpeg_huff_decode(j, hac); // @OPTIMIZE see if we can use the fast path here, advance-by-r is so slow, eh
+ if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
+ s = rs & 15;
+ r = rs >> 4;
+ if (s == 0) {
+ if (r < 15) {
+ j->eob_run = (1 << r) - 1;
+ if (r)
+ j->eob_run += stbi__jpeg_get_bits(j, r);
+ r = 64; // force end of block
+ } else
+ r = 16; // r=15 is the code for 16 0s
+ } else {
+ if (s != 1) return stbi__err("bad huffman code", "Corrupt JPEG");
+ // sign bit
+ if (stbi__jpeg_get_bit(j))
+ s = bit;
+ else
+ s = -bit;
+ }
+
+ // advance by r
+ while (k <= j->spec_end) {
+ short *p = &data[stbi__jpeg_dezigzag[k]];
+ if (*p != 0) {
+ if (stbi__jpeg_get_bit(j))
+ if ((*p & bit)==0) {
+ if (*p > 0)
+ *p += bit;
+ else
+ *p -= bit;
+ }
+ ++k;
+ } else {
+ if (r == 0) {
+ if (s)
+ data[stbi__jpeg_dezigzag[k++]] = (short) s;
+ break;
+ }
+ --r;
+ ++k;
+ }
+ }
+ } while (k <= j->spec_end);
+ }
+ }
+ return 1;
+}
+
+// take a -128..127 value and stbi__clamp it and convert to 0..255
+stbi_inline static stbi_uc stbi__clamp(int x)
+{
+ // trick to use a single test to catch both cases
+ if ((unsigned int) x > 255) {
+ if (x < 0) return 0;
+ if (x > 255) return 255;
+ }
+ return (stbi_uc) x;
+}
+
+#define stbi__f2f(x) ((int) (((x) * 4096 + 0.5)))
+#define stbi__fsh(x) ((x) << 12)
+
+// derived from jidctint -- DCT_ISLOW
+#define STBI__IDCT_1D(s0,s1,s2,s3,s4,s5,s6,s7) \
+ int t0,t1,t2,t3,p1,p2,p3,p4,p5,x0,x1,x2,x3; \
+ p2 = s2; \
+ p3 = s6; \
+ p1 = (p2+p3) * stbi__f2f(0.5411961f); \
+ t2 = p1 + p3*stbi__f2f(-1.847759065f); \
+ t3 = p1 + p2*stbi__f2f( 0.765366865f); \
+ p2 = s0; \
+ p3 = s4; \
+ t0 = stbi__fsh(p2+p3); \
+ t1 = stbi__fsh(p2-p3); \
+ x0 = t0+t3; \
+ x3 = t0-t3; \
+ x1 = t1+t2; \
+ x2 = t1-t2; \
+ t0 = s7; \
+ t1 = s5; \
+ t2 = s3; \
+ t3 = s1; \
+ p3 = t0+t2; \
+ p4 = t1+t3; \
+ p1 = t0+t3; \
+ p2 = t1+t2; \
+ p5 = (p3+p4)*stbi__f2f( 1.175875602f); \
+ t0 = t0*stbi__f2f( 0.298631336f); \
+ t1 = t1*stbi__f2f( 2.053119869f); \
+ t2 = t2*stbi__f2f( 3.072711026f); \
+ t3 = t3*stbi__f2f( 1.501321110f); \
+ p1 = p5 + p1*stbi__f2f(-0.899976223f); \
+ p2 = p5 + p2*stbi__f2f(-2.562915447f); \
+ p3 = p3*stbi__f2f(-1.961570560f); \
+ p4 = p4*stbi__f2f(-0.390180644f); \
+ t3 += p1+p4; \
+ t2 += p2+p3; \
+ t1 += p2+p4; \
+ t0 += p1+p3;
+
+static void stbi__idct_block(stbi_uc *out, int out_stride, short data[64])
+{
+ int i,val[64],*v=val;
+ stbi_uc *o;
+ short *d = data;
+
+ // columns
+ for (i=0; i < 8; ++i,++d, ++v) {
+ // if all zeroes, shortcut -- this avoids dequantizing 0s and IDCTing
+ if (d[ 8]==0 && d[16]==0 && d[24]==0 && d[32]==0
+ && d[40]==0 && d[48]==0 && d[56]==0) {
+ // no shortcut 0 seconds
+ // (1|2|3|4|5|6|7)==0 0 seconds
+ // all separate -0.047 seconds
+ // 1 && 2|3 && 4|5 && 6|7: -0.047 seconds
+ int dcterm = d[0] << 2;
+ v[0] = v[8] = v[16] = v[24] = v[32] = v[40] = v[48] = v[56] = dcterm;
+ } else {
+ STBI__IDCT_1D(d[ 0],d[ 8],d[16],d[24],d[32],d[40],d[48],d[56])
+ // constants scaled things up by 1<<12; let's bring them back
+ // down, but keep 2 extra bits of precision
+ x0 += 512; x1 += 512; x2 += 512; x3 += 512;
+ v[ 0] = (x0+t3) >> 10;
+ v[56] = (x0-t3) >> 10;
+ v[ 8] = (x1+t2) >> 10;
+ v[48] = (x1-t2) >> 10;
+ v[16] = (x2+t1) >> 10;
+ v[40] = (x2-t1) >> 10;
+ v[24] = (x3+t0) >> 10;
+ v[32] = (x3-t0) >> 10;
+ }
+ }
+
+ for (i=0, v=val, o=out; i < 8; ++i,v+=8,o+=out_stride) {
+ // no fast case since the first 1D IDCT spread components out
+ STBI__IDCT_1D(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7])
+ // constants scaled things up by 1<<12, plus we had 1<<2 from first
+ // loop, plus horizontal and vertical each scale by sqrt(8) so together
+ // we've got an extra 1<<3, so 1<<17 total we need to remove.
+ // so we want to round that, which means adding 0.5 * 1<<17,
+ // aka 65536. Also, we'll end up with -128 to 127 that we want
+ // to encode as 0..255 by adding 128, so we'll add that before the shift
+ x0 += 65536 + (128<<17);
+ x1 += 65536 + (128<<17);
+ x2 += 65536 + (128<<17);
+ x3 += 65536 + (128<<17);
+ // tried computing the shifts into temps, or'ing the temps to see
+ // if any were out of range, but that was slower
+ o[0] = stbi__clamp((x0+t3) >> 17);
+ o[7] = stbi__clamp((x0-t3) >> 17);
+ o[1] = stbi__clamp((x1+t2) >> 17);
+ o[6] = stbi__clamp((x1-t2) >> 17);
+ o[2] = stbi__clamp((x2+t1) >> 17);
+ o[5] = stbi__clamp((x2-t1) >> 17);
+ o[3] = stbi__clamp((x3+t0) >> 17);
+ o[4] = stbi__clamp((x3-t0) >> 17);
+ }
+}
+
+#ifdef STBI_SSE2
+// sse2 integer IDCT. not the fastest possible implementation but it
+// produces bit-identical results to the generic C version so it's
+// fully "transparent".
+static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])
+{
+ // This is constructed to match our regular (generic) integer IDCT exactly.
+ __m128i row0, row1, row2, row3, row4, row5, row6, row7;
+ __m128i tmp;
+
+ // dot product constant: even elems=x, odd elems=y
+ #define dct_const(x,y) _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y))
+
+ // out(0) = c0[even]*x + c0[odd]*y (c0, x, y 16-bit, out 32-bit)
+ // out(1) = c1[even]*x + c1[odd]*y
+ #define dct_rot(out0,out1, x,y,c0,c1) \
+ __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \
+ __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \
+ __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \
+ __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \
+ __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \
+ __m128i out1##_h = _mm_madd_epi16(c0##hi, c1)
+
+ // out = in << 12 (in 16-bit, out 32-bit)
+ #define dct_widen(out, in) \
+ __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \
+ __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4)
+
+ // wide add
+ #define dct_wadd(out, a, b) \
+ __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
+ __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
+
+ // wide sub
+ #define dct_wsub(out, a, b) \
+ __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
+ __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
+
+ // butterfly a/b, add bias, then shift by "s" and pack
+ #define dct_bfly32o(out0, out1, a,b,bias,s) \
+ { \
+ __m128i abiased_l = _mm_add_epi32(a##_l, bias); \
+ __m128i abiased_h = _mm_add_epi32(a##_h, bias); \
+ dct_wadd(sum, abiased, b); \
+ dct_wsub(dif, abiased, b); \
+ out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \
+ out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \
+ }
+
+ // 8-bit interleave step (for transposes)
+ #define dct_interleave8(a, b) \
+ tmp = a; \
+ a = _mm_unpacklo_epi8(a, b); \
+ b = _mm_unpackhi_epi8(tmp, b)
+
+ // 16-bit interleave step (for transposes)
+ #define dct_interleave16(a, b) \
+ tmp = a; \
+ a = _mm_unpacklo_epi16(a, b); \
+ b = _mm_unpackhi_epi16(tmp, b)
+
+ #define dct_pass(bias,shift) \
+ { \
+ /* even part */ \
+ dct_rot(t2e,t3e, row2,row6, rot0_0,rot0_1); \
+ __m128i sum04 = _mm_add_epi16(row0, row4); \
+ __m128i dif04 = _mm_sub_epi16(row0, row4); \
+ dct_widen(t0e, sum04); \
+ dct_widen(t1e, dif04); \
+ dct_wadd(x0, t0e, t3e); \
+ dct_wsub(x3, t0e, t3e); \
+ dct_wadd(x1, t1e, t2e); \
+ dct_wsub(x2, t1e, t2e); \
+ /* odd part */ \
+ dct_rot(y0o,y2o, row7,row3, rot2_0,rot2_1); \
+ dct_rot(y1o,y3o, row5,row1, rot3_0,rot3_1); \
+ __m128i sum17 = _mm_add_epi16(row1, row7); \
+ __m128i sum35 = _mm_add_epi16(row3, row5); \
+ dct_rot(y4o,y5o, sum17,sum35, rot1_0,rot1_1); \
+ dct_wadd(x4, y0o, y4o); \
+ dct_wadd(x5, y1o, y5o); \
+ dct_wadd(x6, y2o, y5o); \
+ dct_wadd(x7, y3o, y4o); \
+ dct_bfly32o(row0,row7, x0,x7,bias,shift); \
+ dct_bfly32o(row1,row6, x1,x6,bias,shift); \
+ dct_bfly32o(row2,row5, x2,x5,bias,shift); \
+ dct_bfly32o(row3,row4, x3,x4,bias,shift); \
+ }
+
+ __m128i rot0_0 = dct_const(stbi__f2f(0.5411961f), stbi__f2f(0.5411961f) + stbi__f2f(-1.847759065f));
+ __m128i rot0_1 = dct_const(stbi__f2f(0.5411961f) + stbi__f2f( 0.765366865f), stbi__f2f(0.5411961f));
+ __m128i rot1_0 = dct_const(stbi__f2f(1.175875602f) + stbi__f2f(-0.899976223f), stbi__f2f(1.175875602f));
+ __m128i rot1_1 = dct_const(stbi__f2f(1.175875602f), stbi__f2f(1.175875602f) + stbi__f2f(-2.562915447f));
+ __m128i rot2_0 = dct_const(stbi__f2f(-1.961570560f) + stbi__f2f( 0.298631336f), stbi__f2f(-1.961570560f));
+ __m128i rot2_1 = dct_const(stbi__f2f(-1.961570560f), stbi__f2f(-1.961570560f) + stbi__f2f( 3.072711026f));
+ __m128i rot3_0 = dct_const(stbi__f2f(-0.390180644f) + stbi__f2f( 2.053119869f), stbi__f2f(-0.390180644f));
+ __m128i rot3_1 = dct_const(stbi__f2f(-0.390180644f), stbi__f2f(-0.390180644f) + stbi__f2f( 1.501321110f));
+
+ // rounding biases in column/row passes, see stbi__idct_block for explanation.
+ __m128i bias_0 = _mm_set1_epi32(512);
+ __m128i bias_1 = _mm_set1_epi32(65536 + (128<<17));
+
+ // load
+ row0 = _mm_load_si128((const __m128i *) (data + 0*8));
+ row1 = _mm_load_si128((const __m128i *) (data + 1*8));
+ row2 = _mm_load_si128((const __m128i *) (data + 2*8));
+ row3 = _mm_load_si128((const __m128i *) (data + 3*8));
+ row4 = _mm_load_si128((const __m128i *) (data + 4*8));
+ row5 = _mm_load_si128((const __m128i *) (data + 5*8));
+ row6 = _mm_load_si128((const __m128i *) (data + 6*8));
+ row7 = _mm_load_si128((const __m128i *) (data + 7*8));
+
+ // column pass
+ dct_pass(bias_0, 10);
+
+ {
+ // 16bit 8x8 transpose pass 1
+ dct_interleave16(row0, row4);
+ dct_interleave16(row1, row5);
+ dct_interleave16(row2, row6);
+ dct_interleave16(row3, row7);
+
+ // transpose pass 2
+ dct_interleave16(row0, row2);
+ dct_interleave16(row1, row3);
+ dct_interleave16(row4, row6);
+ dct_interleave16(row5, row7);
+
+ // transpose pass 3
+ dct_interleave16(row0, row1);
+ dct_interleave16(row2, row3);
+ dct_interleave16(row4, row5);
+ dct_interleave16(row6, row7);
+ }
+
+ // row pass
+ dct_pass(bias_1, 17);
+
+ {
+ // pack
+ __m128i p0 = _mm_packus_epi16(row0, row1); // a0a1a2a3...a7b0b1b2b3...b7
+ __m128i p1 = _mm_packus_epi16(row2, row3);
+ __m128i p2 = _mm_packus_epi16(row4, row5);
+ __m128i p3 = _mm_packus_epi16(row6, row7);
+
+ // 8bit 8x8 transpose pass 1
+ dct_interleave8(p0, p2); // a0e0a1e1...
+ dct_interleave8(p1, p3); // c0g0c1g1...
+
+ // transpose pass 2
+ dct_interleave8(p0, p1); // a0c0e0g0...
+ dct_interleave8(p2, p3); // b0d0f0h0...
+
+ // transpose pass 3
+ dct_interleave8(p0, p2); // a0b0c0d0...
+ dct_interleave8(p1, p3); // a4b4c4d4...
+
+ // store
+ _mm_storel_epi64((__m128i *) out, p0); out += out_stride;
+ _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p0, 0x4e)); out += out_stride;
+ _mm_storel_epi64((__m128i *) out, p2); out += out_stride;
+ _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p2, 0x4e)); out += out_stride;
+ _mm_storel_epi64((__m128i *) out, p1); out += out_stride;
+ _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p1, 0x4e)); out += out_stride;
+ _mm_storel_epi64((__m128i *) out, p3); out += out_stride;
+ _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p3, 0x4e));
+ }
+
+#undef dct_const
+#undef dct_rot
+#undef dct_widen
+#undef dct_wadd
+#undef dct_wsub
+#undef dct_bfly32o
+#undef dct_interleave8
+#undef dct_interleave16
+#undef dct_pass
+}
+
+#endif // STBI_SSE2
+
+#ifdef STBI_NEON
+
+// NEON integer IDCT. should produce bit-identical
+// results to the generic C version.
+static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])
+{
+ int16x8_t row0, row1, row2, row3, row4, row5, row6, row7;
+
+ int16x4_t rot0_0 = vdup_n_s16(stbi__f2f(0.5411961f));
+ int16x4_t rot0_1 = vdup_n_s16(stbi__f2f(-1.847759065f));
+ int16x4_t rot0_2 = vdup_n_s16(stbi__f2f( 0.765366865f));
+ int16x4_t rot1_0 = vdup_n_s16(stbi__f2f( 1.175875602f));
+ int16x4_t rot1_1 = vdup_n_s16(stbi__f2f(-0.899976223f));
+ int16x4_t rot1_2 = vdup_n_s16(stbi__f2f(-2.562915447f));
+ int16x4_t rot2_0 = vdup_n_s16(stbi__f2f(-1.961570560f));
+ int16x4_t rot2_1 = vdup_n_s16(stbi__f2f(-0.390180644f));
+ int16x4_t rot3_0 = vdup_n_s16(stbi__f2f( 0.298631336f));
+ int16x4_t rot3_1 = vdup_n_s16(stbi__f2f( 2.053119869f));
+ int16x4_t rot3_2 = vdup_n_s16(stbi__f2f( 3.072711026f));
+ int16x4_t rot3_3 = vdup_n_s16(stbi__f2f( 1.501321110f));
+
+#define dct_long_mul(out, inq, coeff) \
+ int32x4_t out##_l = vmull_s16(vget_low_s16(inq), coeff); \
+ int32x4_t out##_h = vmull_s16(vget_high_s16(inq), coeff)
+
+#define dct_long_mac(out, acc, inq, coeff) \
+ int32x4_t out##_l = vmlal_s16(acc##_l, vget_low_s16(inq), coeff); \
+ int32x4_t out##_h = vmlal_s16(acc##_h, vget_high_s16(inq), coeff)
+
+#define dct_widen(out, inq) \
+ int32x4_t out##_l = vshll_n_s16(vget_low_s16(inq), 12); \
+ int32x4_t out##_h = vshll_n_s16(vget_high_s16(inq), 12)
+
+// wide add
+#define dct_wadd(out, a, b) \
+ int32x4_t out##_l = vaddq_s32(a##_l, b##_l); \
+ int32x4_t out##_h = vaddq_s32(a##_h, b##_h)
+
+// wide sub
+#define dct_wsub(out, a, b) \
+ int32x4_t out##_l = vsubq_s32(a##_l, b##_l); \
+ int32x4_t out##_h = vsubq_s32(a##_h, b##_h)
+
+// butterfly a/b, then shift using "shiftop" by "s" and pack
+#define dct_bfly32o(out0,out1, a,b,shiftop,s) \
+ { \
+ dct_wadd(sum, a, b); \
+ dct_wsub(dif, a, b); \
+ out0 = vcombine_s16(shiftop(sum_l, s), shiftop(sum_h, s)); \
+ out1 = vcombine_s16(shiftop(dif_l, s), shiftop(dif_h, s)); \
+ }
+
+#define dct_pass(shiftop, shift) \
+ { \
+ /* even part */ \
+ int16x8_t sum26 = vaddq_s16(row2, row6); \
+ dct_long_mul(p1e, sum26, rot0_0); \
+ dct_long_mac(t2e, p1e, row6, rot0_1); \
+ dct_long_mac(t3e, p1e, row2, rot0_2); \
+ int16x8_t sum04 = vaddq_s16(row0, row4); \
+ int16x8_t dif04 = vsubq_s16(row0, row4); \
+ dct_widen(t0e, sum04); \
+ dct_widen(t1e, dif04); \
+ dct_wadd(x0, t0e, t3e); \
+ dct_wsub(x3, t0e, t3e); \
+ dct_wadd(x1, t1e, t2e); \
+ dct_wsub(x2, t1e, t2e); \
+ /* odd part */ \
+ int16x8_t sum15 = vaddq_s16(row1, row5); \
+ int16x8_t sum17 = vaddq_s16(row1, row7); \
+ int16x8_t sum35 = vaddq_s16(row3, row5); \
+ int16x8_t sum37 = vaddq_s16(row3, row7); \
+ int16x8_t sumodd = vaddq_s16(sum17, sum35); \
+ dct_long_mul(p5o, sumodd, rot1_0); \
+ dct_long_mac(p1o, p5o, sum17, rot1_1); \
+ dct_long_mac(p2o, p5o, sum35, rot1_2); \
+ dct_long_mul(p3o, sum37, rot2_0); \
+ dct_long_mul(p4o, sum15, rot2_1); \
+ dct_wadd(sump13o, p1o, p3o); \
+ dct_wadd(sump24o, p2o, p4o); \
+ dct_wadd(sump23o, p2o, p3o); \
+ dct_wadd(sump14o, p1o, p4o); \
+ dct_long_mac(x4, sump13o, row7, rot3_0); \
+ dct_long_mac(x5, sump24o, row5, rot3_1); \
+ dct_long_mac(x6, sump23o, row3, rot3_2); \
+ dct_long_mac(x7, sump14o, row1, rot3_3); \
+ dct_bfly32o(row0,row7, x0,x7,shiftop,shift); \
+ dct_bfly32o(row1,row6, x1,x6,shiftop,shift); \
+ dct_bfly32o(row2,row5, x2,x5,shiftop,shift); \
+ dct_bfly32o(row3,row4, x3,x4,shiftop,shift); \
+ }
+
+ // load
+ row0 = vld1q_s16(data + 0*8);
+ row1 = vld1q_s16(data + 1*8);
+ row2 = vld1q_s16(data + 2*8);
+ row3 = vld1q_s16(data + 3*8);
+ row4 = vld1q_s16(data + 4*8);
+ row5 = vld1q_s16(data + 5*8);
+ row6 = vld1q_s16(data + 6*8);
+ row7 = vld1q_s16(data + 7*8);
+
+ // add DC bias
+ row0 = vaddq_s16(row0, vsetq_lane_s16(1024, vdupq_n_s16(0), 0));
+
+ // column pass
+ dct_pass(vrshrn_n_s32, 10);
+
+ // 16bit 8x8 transpose
+ {
+// these three map to a single VTRN.16, VTRN.32, and VSWP, respectively.
+// whether compilers actually get this is another story, sadly.
+#define dct_trn16(x, y) { int16x8x2_t t = vtrnq_s16(x, y); x = t.val[0]; y = t.val[1]; }
+#define dct_trn32(x, y) { int32x4x2_t t = vtrnq_s32(vreinterpretq_s32_s16(x), vreinterpretq_s32_s16(y)); x = vreinterpretq_s16_s32(t.val[0]); y = vreinterpretq_s16_s32(t.val[1]); }
+#define dct_trn64(x, y) { int16x8_t x0 = x; int16x8_t y0 = y; x = vcombine_s16(vget_low_s16(x0), vget_low_s16(y0)); y = vcombine_s16(vget_high_s16(x0), vget_high_s16(y0)); }
+
+ // pass 1
+ dct_trn16(row0, row1); // a0b0a2b2a4b4a6b6
+ dct_trn16(row2, row3);
+ dct_trn16(row4, row5);
+ dct_trn16(row6, row7);
+
+ // pass 2
+ dct_trn32(row0, row2); // a0b0c0d0a4b4c4d4
+ dct_trn32(row1, row3);
+ dct_trn32(row4, row6);
+ dct_trn32(row5, row7);
+
+ // pass 3
+ dct_trn64(row0, row4); // a0b0c0d0e0f0g0h0
+ dct_trn64(row1, row5);
+ dct_trn64(row2, row6);
+ dct_trn64(row3, row7);
+
+#undef dct_trn16
+#undef dct_trn32
+#undef dct_trn64
+ }
+
+ // row pass
+ // vrshrn_n_s32 only supports shifts up to 16, we need
+ // 17. so do a non-rounding shift of 16 first then follow
+ // up with a rounding shift by 1.
+ dct_pass(vshrn_n_s32, 16);
+
+ {
+ // pack and round
+ uint8x8_t p0 = vqrshrun_n_s16(row0, 1);
+ uint8x8_t p1 = vqrshrun_n_s16(row1, 1);
+ uint8x8_t p2 = vqrshrun_n_s16(row2, 1);
+ uint8x8_t p3 = vqrshrun_n_s16(row3, 1);
+ uint8x8_t p4 = vqrshrun_n_s16(row4, 1);
+ uint8x8_t p5 = vqrshrun_n_s16(row5, 1);
+ uint8x8_t p6 = vqrshrun_n_s16(row6, 1);
+ uint8x8_t p7 = vqrshrun_n_s16(row7, 1);
+
+ // again, these can translate into one instruction, but often don't.
+#define dct_trn8_8(x, y) { uint8x8x2_t t = vtrn_u8(x, y); x = t.val[0]; y = t.val[1]; }
+#define dct_trn8_16(x, y) { uint16x4x2_t t = vtrn_u16(vreinterpret_u16_u8(x), vreinterpret_u16_u8(y)); x = vreinterpret_u8_u16(t.val[0]); y = vreinterpret_u8_u16(t.val[1]); }
+#define dct_trn8_32(x, y) { uint32x2x2_t t = vtrn_u32(vreinterpret_u32_u8(x), vreinterpret_u32_u8(y)); x = vreinterpret_u8_u32(t.val[0]); y = vreinterpret_u8_u32(t.val[1]); }
+
+ // sadly can't use interleaved stores here since we only write
+ // 8 bytes to each scan line!
+
+ // 8x8 8-bit transpose pass 1
+ dct_trn8_8(p0, p1);
+ dct_trn8_8(p2, p3);
+ dct_trn8_8(p4, p5);
+ dct_trn8_8(p6, p7);
+
+ // pass 2
+ dct_trn8_16(p0, p2);
+ dct_trn8_16(p1, p3);
+ dct_trn8_16(p4, p6);
+ dct_trn8_16(p5, p7);
+
+ // pass 3
+ dct_trn8_32(p0, p4);
+ dct_trn8_32(p1, p5);
+ dct_trn8_32(p2, p6);
+ dct_trn8_32(p3, p7);
+
+ // store
+ vst1_u8(out, p0); out += out_stride;
+ vst1_u8(out, p1); out += out_stride;
+ vst1_u8(out, p2); out += out_stride;
+ vst1_u8(out, p3); out += out_stride;
+ vst1_u8(out, p4); out += out_stride;
+ vst1_u8(out, p5); out += out_stride;
+ vst1_u8(out, p6); out += out_stride;
+ vst1_u8(out, p7);
+
+#undef dct_trn8_8
+#undef dct_trn8_16
+#undef dct_trn8_32
+ }
+
+#undef dct_long_mul
+#undef dct_long_mac
+#undef dct_widen
+#undef dct_wadd
+#undef dct_wsub
+#undef dct_bfly32o
+#undef dct_pass
+}
+
+#endif // STBI_NEON
+
+#define STBI__MARKER_none 0xff
+// if there's a pending marker from the entropy stream, return that
+// otherwise, fetch from the stream and get a marker. if there's no
+// marker, return 0xff, which is never a valid marker value
+static stbi_uc stbi__get_marker(stbi__jpeg *j)
+{
+ stbi_uc x;
+ if (j->marker != STBI__MARKER_none) { x = j->marker; j->marker = STBI__MARKER_none; return x; }
+ x = stbi__get8(j->s);
+ if (x != 0xff) return STBI__MARKER_none;
+ while (x == 0xff)
+ x = stbi__get8(j->s);
+ return x;
+}
+
+// in each scan, we'll have scan_n components, and the order
+// of the components is specified by order[]
+#define STBI__RESTART(x) ((x) >= 0xd0 && (x) <= 0xd7)
+
+// after a restart interval, stbi__jpeg_reset the entropy decoder and
+// the dc prediction
+static void stbi__jpeg_reset(stbi__jpeg *j)
+{
+ j->code_bits = 0;
+ j->code_buffer = 0;
+ j->nomore = 0;
+ j->img_comp[0].dc_pred = j->img_comp[1].dc_pred = j->img_comp[2].dc_pred = 0;
+ j->marker = STBI__MARKER_none;
+ j->todo = j->restart_interval ? j->restart_interval : 0x7fffffff;
+ j->eob_run = 0;
+ // no more than 1<<31 MCUs if no restart_interal? that's plenty safe,
+ // since we don't even allow 1<<30 pixels
+}
+
+static int stbi__parse_entropy_coded_data(stbi__jpeg *z)
+{
+ stbi__jpeg_reset(z);
+ if (!z->progressive) {
+ if (z->scan_n == 1) {
+ int i,j;
+ STBI_SIMD_ALIGN(short, data[64]);
+ int n = z->order[0];
+ // non-interleaved data, we just need to process one block at a time,
+ // in trivial scanline order
+ // number of blocks to do just depends on how many actual "pixels" this
+ // component has, independent of interleaved MCU blocking and such
+ int w = (z->img_comp[n].x+7) >> 3;
+ int h = (z->img_comp[n].y+7) >> 3;
+ for (j=0; j < h; ++j) {
+ for (i=0; i < w; ++i) {
+ int ha = z->img_comp[n].ha;
+ if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0;
+ z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data);
+ // every data block is an MCU, so countdown the restart interval
+ if (--z->todo <= 0) {
+ if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
+ // if it's NOT a restart, then just bail, so we get corrupt data
+ // rather than no data
+ if (!STBI__RESTART(z->marker)) return 1;
+ stbi__jpeg_reset(z);
+ }
+ }
+ }
+ return 1;
+ } else { // interleaved
+ int i,j,k,x,y;
+ STBI_SIMD_ALIGN(short, data[64]);
+ for (j=0; j < z->img_mcu_y; ++j) {
+ for (i=0; i < z->img_mcu_x; ++i) {
+ // scan an interleaved mcu... process scan_n components in order
+ for (k=0; k < z->scan_n; ++k) {
+ int n = z->order[k];
+ // scan out an mcu's worth of this component; that's just determined
+ // by the basic H and V specified for the component
+ for (y=0; y < z->img_comp[n].v; ++y) {
+ for (x=0; x < z->img_comp[n].h; ++x) {
+ int x2 = (i*z->img_comp[n].h + x)*8;
+ int y2 = (j*z->img_comp[n].v + y)*8;
+ int ha = z->img_comp[n].ha;
+ if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0;
+ z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data);
+ }
+ }
+ }
+ // after all interleaved components, that's an interleaved MCU,
+ // so now count down the restart interval
+ if (--z->todo <= 0) {
+ if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
+ if (!STBI__RESTART(z->marker)) return 1;
+ stbi__jpeg_reset(z);
+ }
+ }
+ }
+ return 1;
+ }
+ } else {
+ if (z->scan_n == 1) {
+ int i,j;
+ int n = z->order[0];
+ // non-interleaved data, we just need to process one block at a time,
+ // in trivial scanline order
+ // number of blocks to do just depends on how many actual "pixels" this
+ // component has, independent of interleaved MCU blocking and such
+ int w = (z->img_comp[n].x+7) >> 3;
+ int h = (z->img_comp[n].y+7) >> 3;
+ for (j=0; j < h; ++j) {
+ for (i=0; i < w; ++i) {
+ short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w);
+ if (z->spec_start == 0) {
+ if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n))
+ return 0;
+ } else {
+ int ha = z->img_comp[n].ha;
+ if (!stbi__jpeg_decode_block_prog_ac(z, data, &z->huff_ac[ha], z->fast_ac[ha]))
+ return 0;
+ }
+ // every data block is an MCU, so countdown the restart interval
+ if (--z->todo <= 0) {
+ if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
+ if (!STBI__RESTART(z->marker)) return 1;
+ stbi__jpeg_reset(z);
+ }
+ }
+ }
+ return 1;
+ } else { // interleaved
+ int i,j,k,x,y;
+ for (j=0; j < z->img_mcu_y; ++j) {
+ for (i=0; i < z->img_mcu_x; ++i) {
+ // scan an interleaved mcu... process scan_n components in order
+ for (k=0; k < z->scan_n; ++k) {
+ int n = z->order[k];
+ // scan out an mcu's worth of this component; that's just determined
+ // by the basic H and V specified for the component
+ for (y=0; y < z->img_comp[n].v; ++y) {
+ for (x=0; x < z->img_comp[n].h; ++x) {
+ int x2 = (i*z->img_comp[n].h + x);
+ int y2 = (j*z->img_comp[n].v + y);
+ short *data = z->img_comp[n].coeff + 64 * (x2 + y2 * z->img_comp[n].coeff_w);
+ if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n))
+ return 0;
+ }
+ }
+ }
+ // after all interleaved components, that's an interleaved MCU,
+ // so now count down the restart interval
+ if (--z->todo <= 0) {
+ if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
+ if (!STBI__RESTART(z->marker)) return 1;
+ stbi__jpeg_reset(z);
+ }
+ }
+ }
+ return 1;
+ }
+ }
+}
+
+static void stbi__jpeg_dequantize(short *data, stbi_uc *dequant)
+{
+ int i;
+ for (i=0; i < 64; ++i)
+ data[i] *= dequant[i];
+}
+
+static void stbi__jpeg_finish(stbi__jpeg *z)
+{
+ if (z->progressive) {
+ // dequantize and idct the data
+ int i,j,n;
+ for (n=0; n < z->s->img_n; ++n) {
+ int w = (z->img_comp[n].x+7) >> 3;
+ int h = (z->img_comp[n].y+7) >> 3;
+ for (j=0; j < h; ++j) {
+ for (i=0; i < w; ++i) {
+ short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w);
+ stbi__jpeg_dequantize(data, z->dequant[z->img_comp[n].tq]);
+ z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data);
+ }
+ }
+ }
+ }
+}
+
+static int stbi__process_marker(stbi__jpeg *z, int m)
+{
+ int L;
+ switch (m) {
+ case STBI__MARKER_none: // no marker found
+ return stbi__err("expected marker","Corrupt JPEG");
+
+ case 0xDD: // DRI - specify restart interval
+ if (stbi__get16be(z->s) != 4) return stbi__err("bad DRI len","Corrupt JPEG");
+ z->restart_interval = stbi__get16be(z->s);
+ return 1;
+
+ case 0xDB: // DQT - define quantization table
+ L = stbi__get16be(z->s)-2;
+ while (L > 0) {
+ int q = stbi__get8(z->s);
+ int p = q >> 4;
+ int t = q & 15,i;
+ if (p != 0) return stbi__err("bad DQT type","Corrupt JPEG");
+ if (t > 3) return stbi__err("bad DQT table","Corrupt JPEG");
+ for (i=0; i < 64; ++i)
+ z->dequant[t][stbi__jpeg_dezigzag[i]] = stbi__get8(z->s);
+ L -= 65;
+ }
+ return L==0;
+
+ case 0xC4: // DHT - define huffman table
+ L = stbi__get16be(z->s)-2;
+ while (L > 0) {
+ stbi_uc *v;
+ int sizes[16],i,n=0;
+ int q = stbi__get8(z->s);
+ int tc = q >> 4;
+ int th = q & 15;
+ if (tc > 1 || th > 3) return stbi__err("bad DHT header","Corrupt JPEG");
+ for (i=0; i < 16; ++i) {
+ sizes[i] = stbi__get8(z->s);
+ n += sizes[i];
+ }
+ L -= 17;
+ if (tc == 0) {
+ if (!stbi__build_huffman(z->huff_dc+th, sizes)) return 0;
+ v = z->huff_dc[th].values;
+ } else {
+ if (!stbi__build_huffman(z->huff_ac+th, sizes)) return 0;
+ v = z->huff_ac[th].values;
+ }
+ for (i=0; i < n; ++i)
+ v[i] = stbi__get8(z->s);
+ if (tc != 0)
+ stbi__build_fast_ac(z->fast_ac[th], z->huff_ac + th);
+ L -= n;
+ }
+ return L==0;
+ }
+ // check for comment block or APP blocks
+ if ((m >= 0xE0 && m <= 0xEF) || m == 0xFE) {
+ stbi__skip(z->s, stbi__get16be(z->s)-2);
+ return 1;
+ }
+ return 0;
+}
+
+// after we see SOS
+static int stbi__process_scan_header(stbi__jpeg *z)
+{
+ int i;
+ int Ls = stbi__get16be(z->s);
+ z->scan_n = stbi__get8(z->s);
+ if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s->img_n) return stbi__err("bad SOS component count","Corrupt JPEG");
+ if (Ls != 6+2*z->scan_n) return stbi__err("bad SOS len","Corrupt JPEG");
+ for (i=0; i < z->scan_n; ++i) {
+ int id = stbi__get8(z->s), which;
+ int q = stbi__get8(z->s);
+ for (which = 0; which < z->s->img_n; ++which)
+ if (z->img_comp[which].id == id)
+ break;
+ if (which == z->s->img_n) return 0; // no match
+ z->img_comp[which].hd = q >> 4; if (z->img_comp[which].hd > 3) return stbi__err("bad DC huff","Corrupt JPEG");
+ z->img_comp[which].ha = q & 15; if (z->img_comp[which].ha > 3) return stbi__err("bad AC huff","Corrupt JPEG");
+ z->order[i] = which;
+ }
+
+ {
+ int aa;
+ z->spec_start = stbi__get8(z->s);
+ z->spec_end = stbi__get8(z->s); // should be 63, but might be 0
+ aa = stbi__get8(z->s);
+ z->succ_high = (aa >> 4);
+ z->succ_low = (aa & 15);
+ if (z->progressive) {
+ if (z->spec_start > 63 || z->spec_end > 63 || z->spec_start > z->spec_end || z->succ_high > 13 || z->succ_low > 13)
+ return stbi__err("bad SOS", "Corrupt JPEG");
+ } else {
+ if (z->spec_start != 0) return stbi__err("bad SOS","Corrupt JPEG");
+ if (z->succ_high != 0 || z->succ_low != 0) return stbi__err("bad SOS","Corrupt JPEG");
+ z->spec_end = 63;
+ }
+ }
+
+ return 1;
+}
+
+static int stbi__process_frame_header(stbi__jpeg *z, int scan)
+{
+ stbi__context *s = z->s;
+ int Lf,p,i,q, h_max=1,v_max=1,c;
+ Lf = stbi__get16be(s); if (Lf < 11) return stbi__err("bad SOF len","Corrupt JPEG"); // JPEG
+ p = stbi__get8(s); if (p != 8) return stbi__err("only 8-bit","JPEG format not supported: 8-bit only"); // JPEG baseline
+ s->img_y = stbi__get16be(s); if (s->img_y == 0) return stbi__err("no header height", "JPEG format not supported: delayed height"); // Legal, but we don't handle it--but neither does IJG
+ s->img_x = stbi__get16be(s); if (s->img_x == 0) return stbi__err("0 width","Corrupt JPEG"); // JPEG requires
+ c = stbi__get8(s);
+ if (c != 3 && c != 1) return stbi__err("bad component count","Corrupt JPEG"); // JFIF requires
+ s->img_n = c;
+ for (i=0; i < c; ++i) {
+ z->img_comp[i].data = NULL;
+ z->img_comp[i].linebuf = NULL;
+ }
+
+ if (Lf != 8+3*s->img_n) return stbi__err("bad SOF len","Corrupt JPEG");
+
+ for (i=0; i < s->img_n; ++i) {
+ z->img_comp[i].id = stbi__get8(s);
+ if (z->img_comp[i].id != i+1) // JFIF requires
+ if (z->img_comp[i].id != i) // some version of jpegtran outputs non-JFIF-compliant files!
+ return stbi__err("bad component ID","Corrupt JPEG");
+ q = stbi__get8(s);
+ z->img_comp[i].h = (q >> 4); if (!z->img_comp[i].h || z->img_comp[i].h > 4) return stbi__err("bad H","Corrupt JPEG");
+ z->img_comp[i].v = q & 15; if (!z->img_comp[i].v || z->img_comp[i].v > 4) return stbi__err("bad V","Corrupt JPEG");
+ z->img_comp[i].tq = stbi__get8(s); if (z->img_comp[i].tq > 3) return stbi__err("bad TQ","Corrupt JPEG");
+ }
+
+ if (scan != STBI__SCAN_load) return 1;
+
+ if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode");
+
+ for (i=0; i < s->img_n; ++i) {
+ if (z->img_comp[i].h > h_max) h_max = z->img_comp[i].h;
+ if (z->img_comp[i].v > v_max) v_max = z->img_comp[i].v;
+ }
+
+ // compute interleaved mcu info
+ z->img_h_max = h_max;
+ z->img_v_max = v_max;
+ z->img_mcu_w = h_max * 8;
+ z->img_mcu_h = v_max * 8;
+ z->img_mcu_x = (s->img_x + z->img_mcu_w-1) / z->img_mcu_w;
+ z->img_mcu_y = (s->img_y + z->img_mcu_h-1) / z->img_mcu_h;
+
+ for (i=0; i < s->img_n; ++i) {
+ // number of effective pixels (e.g. for non-interleaved MCU)
+ z->img_comp[i].x = (s->img_x * z->img_comp[i].h + h_max-1) / h_max;
+ z->img_comp[i].y = (s->img_y * z->img_comp[i].v + v_max-1) / v_max;
+ // to simplify generation, we'll allocate enough memory to decode
+ // the bogus oversized data from using interleaved MCUs and their
+ // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't
+ // discard the extra data until colorspace conversion
+ z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8;
+ z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8;
+ z->img_comp[i].raw_data = stbi__malloc(z->img_comp[i].w2 * z->img_comp[i].h2+15);
+
+ if (z->img_comp[i].raw_data == NULL) {
+ for(--i; i >= 0; --i) {
+ STBI_FREE(z->img_comp[i].raw_data);
+ z->img_comp[i].data = NULL;
+ }
+ return stbi__err("outofmem", "Out of memory");
+ }
+ // align blocks for idct using mmx/sse
+ z->img_comp[i].data = (stbi_uc*) (((size_t) z->img_comp[i].raw_data + 15) & ~15);
+ z->img_comp[i].linebuf = NULL;
+ if (z->progressive) {
+ z->img_comp[i].coeff_w = (z->img_comp[i].w2 + 7) >> 3;
+ z->img_comp[i].coeff_h = (z->img_comp[i].h2 + 7) >> 3;
+ z->img_comp[i].raw_coeff = STBI_MALLOC(z->img_comp[i].coeff_w * z->img_comp[i].coeff_h * 64 * sizeof(short) + 15);
+ z->img_comp[i].coeff = (short*) (((size_t) z->img_comp[i].raw_coeff + 15) & ~15);
+ } else {
+ z->img_comp[i].coeff = 0;
+ z->img_comp[i].raw_coeff = 0;
+ }
+ }
+
+ return 1;
+}
+
+// use comparisons since in some cases we handle more than one case (e.g. SOF)
+#define stbi__DNL(x) ((x) == 0xdc)
+#define stbi__SOI(x) ((x) == 0xd8)
+#define stbi__EOI(x) ((x) == 0xd9)
+#define stbi__SOF(x) ((x) == 0xc0 || (x) == 0xc1 || (x) == 0xc2)
+#define stbi__SOS(x) ((x) == 0xda)
+
+#define stbi__SOF_progressive(x) ((x) == 0xc2)
+
+static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan)
+{
+ int m;
+ z->marker = STBI__MARKER_none; // initialize cached marker to empty
+ m = stbi__get_marker(z);
+ if (!stbi__SOI(m)) return stbi__err("no SOI","Corrupt JPEG");
+ if (scan == STBI__SCAN_type) return 1;
+ m = stbi__get_marker(z);
+ while (!stbi__SOF(m)) {
+ if (!stbi__process_marker(z,m)) return 0;
+ m = stbi__get_marker(z);
+ while (m == STBI__MARKER_none) {
+ // some files have extra padding after their blocks, so ok, we'll scan
+ if (stbi__at_eof(z->s)) return stbi__err("no SOF", "Corrupt JPEG");
+ m = stbi__get_marker(z);
+ }
+ }
+ z->progressive = stbi__SOF_progressive(m);
+ if (!stbi__process_frame_header(z, scan)) return 0;
+ return 1;
+}
+
+// decode image to YCbCr format
+static int stbi__decode_jpeg_image(stbi__jpeg *j)
+{
+ int m;
+ j->restart_interval = 0;
+ if (!stbi__decode_jpeg_header(j, STBI__SCAN_load)) return 0;
+ m = stbi__get_marker(j);
+ while (!stbi__EOI(m)) {
+ if (stbi__SOS(m)) {
+ if (!stbi__process_scan_header(j)) return 0;
+ if (!stbi__parse_entropy_coded_data(j)) return 0;
+ if (j->marker == STBI__MARKER_none ) {
+ // handle 0s at the end of image data from IP Kamera 9060
+ while (!stbi__at_eof(j->s)) {
+ int x = stbi__get8(j->s);
+ if (x == 255) {
+ j->marker = stbi__get8(j->s);
+ break;
+ } else if (x != 0) {
+ return stbi__err("junk before marker", "Corrupt JPEG");
+ }
+ }
+ // if we reach eof without hitting a marker, stbi__get_marker() below will fail and we'll eventually return 0
+ }
+ } else {
+ if (!stbi__process_marker(j, m)) return 0;
+ }
+ m = stbi__get_marker(j);
+ }
+ if (j->progressive)
+ stbi__jpeg_finish(j);
+ return 1;
+}
+
+// static jfif-centered resampling (across block boundaries)
+
+typedef stbi_uc *(*resample_row_func)(stbi_uc *out, stbi_uc *in0, stbi_uc *in1,
+ int w, int hs);
+
+#define stbi__div4(x) ((stbi_uc) ((x) >> 2))
+
+static stbi_uc *resample_row_1(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
+{
+ STBI_NOTUSED(out);
+ STBI_NOTUSED(in_far);
+ STBI_NOTUSED(w);
+ STBI_NOTUSED(hs);
+ return in_near;
+}
+
+static stbi_uc* stbi__resample_row_v_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
+{
+ // need to generate two samples vertically for every one in input
+ int i;
+ STBI_NOTUSED(hs);
+ for (i=0; i < w; ++i)
+ out[i] = stbi__div4(3*in_near[i] + in_far[i] + 2);
+ return out;
+}
+
+static stbi_uc* stbi__resample_row_h_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
+{
+ // need to generate two samples horizontally for every one in input
+ int i;
+ stbi_uc *input = in_near;
+
+ if (w == 1) {
+ // if only one sample, can't do any interpolation
+ out[0] = out[1] = input[0];
+ return out;
+ }
+
+ out[0] = input[0];
+ out[1] = stbi__div4(input[0]*3 + input[1] + 2);
+ for (i=1; i < w-1; ++i) {
+ int n = 3*input[i]+2;
+ out[i*2+0] = stbi__div4(n+input[i-1]);
+ out[i*2+1] = stbi__div4(n+input[i+1]);
+ }
+ out[i*2+0] = stbi__div4(input[w-2]*3 + input[w-1] + 2);
+ out[i*2+1] = input[w-1];
+
+ STBI_NOTUSED(in_far);
+ STBI_NOTUSED(hs);
+
+ return out;
+}
+
+#define stbi__div16(x) ((stbi_uc) ((x) >> 4))
+
+static stbi_uc *stbi__resample_row_hv_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
+{
+ // need to generate 2x2 samples for every one in input
+ int i,t0,t1;
+ if (w == 1) {
+ out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2);
+ return out;
+ }
+
+ t1 = 3*in_near[0] + in_far[0];
+ out[0] = stbi__div4(t1+2);
+ for (i=1; i < w; ++i) {
+ t0 = t1;
+ t1 = 3*in_near[i]+in_far[i];
+ out[i*2-1] = stbi__div16(3*t0 + t1 + 8);
+ out[i*2 ] = stbi__div16(3*t1 + t0 + 8);
+ }
+ out[w*2-1] = stbi__div4(t1+2);
+
+ STBI_NOTUSED(hs);
+
+ return out;
+}
+
+#if defined(STBI_SSE2) || defined(STBI_NEON)
+static stbi_uc *stbi__resample_row_hv_2_simd(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
+{
+ // need to generate 2x2 samples for every one in input
+ int i=0,t0,t1;
+
+ if (w == 1) {
+ out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2);
+ return out;
+ }
+
+ t1 = 3*in_near[0] + in_far[0];
+ // process groups of 8 pixels for as long as we can.
+ // note we can't handle the last pixel in a row in this loop
+ // because we need to handle the filter boundary conditions.
+ for (; i < ((w-1) & ~7); i += 8) {
+#if defined(STBI_SSE2)
+ // load and perform the vertical filtering pass
+ // this uses 3*x + y = 4*x + (y - x)
+ __m128i zero = _mm_setzero_si128();
+ __m128i farb = _mm_loadl_epi64((__m128i *) (in_far + i));
+ __m128i nearb = _mm_loadl_epi64((__m128i *) (in_near + i));
+ __m128i farw = _mm_unpacklo_epi8(farb, zero);
+ __m128i nearw = _mm_unpacklo_epi8(nearb, zero);
+ __m128i diff = _mm_sub_epi16(farw, nearw);
+ __m128i nears = _mm_slli_epi16(nearw, 2);
+ __m128i curr = _mm_add_epi16(nears, diff); // current row
+
+ // horizontal filter works the same based on shifted vers of current
+ // row. "prev" is current row shifted right by 1 pixel; we need to
+ // insert the previous pixel value (from t1).
+ // "next" is current row shifted left by 1 pixel, with first pixel
+ // of next block of 8 pixels added in.
+ __m128i prv0 = _mm_slli_si128(curr, 2);
+ __m128i nxt0 = _mm_srli_si128(curr, 2);
+ __m128i prev = _mm_insert_epi16(prv0, t1, 0);
+ __m128i next = _mm_insert_epi16(nxt0, 3*in_near[i+8] + in_far[i+8], 7);
+
+ // horizontal filter, polyphase implementation since it's convenient:
+ // even pixels = 3*cur + prev = cur*4 + (prev - cur)
+ // odd pixels = 3*cur + next = cur*4 + (next - cur)
+ // note the shared term.
+ __m128i bias = _mm_set1_epi16(8);
+ __m128i curs = _mm_slli_epi16(curr, 2);
+ __m128i prvd = _mm_sub_epi16(prev, curr);
+ __m128i nxtd = _mm_sub_epi16(next, curr);
+ __m128i curb = _mm_add_epi16(curs, bias);
+ __m128i even = _mm_add_epi16(prvd, curb);
+ __m128i odd = _mm_add_epi16(nxtd, curb);
+
+ // interleave even and odd pixels, then undo scaling.
+ __m128i int0 = _mm_unpacklo_epi16(even, odd);
+ __m128i int1 = _mm_unpackhi_epi16(even, odd);
+ __m128i de0 = _mm_srli_epi16(int0, 4);
+ __m128i de1 = _mm_srli_epi16(int1, 4);
+
+ // pack and write output
+ __m128i outv = _mm_packus_epi16(de0, de1);
+ _mm_storeu_si128((__m128i *) (out + i*2), outv);
+#elif defined(STBI_NEON)
+ // load and perform the vertical filtering pass
+ // this uses 3*x + y = 4*x + (y - x)
+ uint8x8_t farb = vld1_u8(in_far + i);
+ uint8x8_t nearb = vld1_u8(in_near + i);
+ int16x8_t diff = vreinterpretq_s16_u16(vsubl_u8(farb, nearb));
+ int16x8_t nears = vreinterpretq_s16_u16(vshll_n_u8(nearb, 2));
+ int16x8_t curr = vaddq_s16(nears, diff); // current row
+
+ // horizontal filter works the same based on shifted vers of current
+ // row. "prev" is current row shifted right by 1 pixel; we need to
+ // insert the previous pixel value (from t1).
+ // "next" is current row shifted left by 1 pixel, with first pixel
+ // of next block of 8 pixels added in.
+ int16x8_t prv0 = vextq_s16(curr, curr, 7);
+ int16x8_t nxt0 = vextq_s16(curr, curr, 1);
+ int16x8_t prev = vsetq_lane_s16(t1, prv0, 0);
+ int16x8_t next = vsetq_lane_s16(3*in_near[i+8] + in_far[i+8], nxt0, 7);
+
+ // horizontal filter, polyphase implementation since it's convenient:
+ // even pixels = 3*cur + prev = cur*4 + (prev - cur)
+ // odd pixels = 3*cur + next = cur*4 + (next - cur)
+ // note the shared term.
+ int16x8_t curs = vshlq_n_s16(curr, 2);
+ int16x8_t prvd = vsubq_s16(prev, curr);
+ int16x8_t nxtd = vsubq_s16(next, curr);
+ int16x8_t even = vaddq_s16(curs, prvd);
+ int16x8_t odd = vaddq_s16(curs, nxtd);
+
+ // undo scaling and round, then store with even/odd phases interleaved
+ uint8x8x2_t o;
+ o.val[0] = vqrshrun_n_s16(even, 4);
+ o.val[1] = vqrshrun_n_s16(odd, 4);
+ vst2_u8(out + i*2, o);
+#endif
+
+ // "previous" value for next iter
+ t1 = 3*in_near[i+7] + in_far[i+7];
+ }
+
+ t0 = t1;
+ t1 = 3*in_near[i] + in_far[i];
+ out[i*2] = stbi__div16(3*t1 + t0 + 8);
+
+ for (++i; i < w; ++i) {
+ t0 = t1;
+ t1 = 3*in_near[i]+in_far[i];
+ out[i*2-1] = stbi__div16(3*t0 + t1 + 8);
+ out[i*2 ] = stbi__div16(3*t1 + t0 + 8);
+ }
+ out[w*2-1] = stbi__div4(t1+2);
+
+ STBI_NOTUSED(hs);
+
+ return out;
+}
+#endif
+
+static stbi_uc *stbi__resample_row_generic(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
+{
+ // resample with nearest-neighbor
+ int i,j;
+ STBI_NOTUSED(in_far);
+ for (i=0; i < w; ++i)
+ for (j=0; j < hs; ++j)
+ out[i*hs+j] = in_near[i];
+ return out;
+}
+
+#ifdef STBI_JPEG_OLD
+// this is the same YCbCr-to-RGB calculation that stb_image has used
+// historically before the algorithm changes in 1.49
+#define float2fixed(x) ((int) ((x) * 65536 + 0.5))
+static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step)
+{
+ int i;
+ for (i=0; i < count; ++i) {
+ int y_fixed = (y[i] << 16) + 32768; // rounding
+ int r,g,b;
+ int cr = pcr[i] - 128;
+ int cb = pcb[i] - 128;
+ r = y_fixed + cr*float2fixed(1.40200f);
+ g = y_fixed - cr*float2fixed(0.71414f) - cb*float2fixed(0.34414f);
+ b = y_fixed + cb*float2fixed(1.77200f);
+ r >>= 16;
+ g >>= 16;
+ b >>= 16;
+ if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }
+ if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }
+ if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }
+ out[0] = (stbi_uc)r;
+ out[1] = (stbi_uc)g;
+ out[2] = (stbi_uc)b;
+ out[3] = 255;
+ out += step;
+ }
+}
+#else
+// this is a reduced-precision calculation of YCbCr-to-RGB introduced
+// to make sure the code produces the same results in both SIMD and scalar
+#define float2fixed(x) (((int) ((x) * 4096.0f + 0.5f)) << 8)
+static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step)
+{
+ int i;
+ for (i=0; i < count; ++i) {
+ int y_fixed = (y[i] << 20) + (1<<19); // rounding
+ int r,g,b;
+ int cr = pcr[i] - 128;
+ int cb = pcb[i] - 128;
+ r = y_fixed + cr* float2fixed(1.40200f);
+ g = y_fixed + (cr*-float2fixed(0.71414f)) + ((cb*-float2fixed(0.34414f)) & 0xffff0000);
+ b = y_fixed + cb* float2fixed(1.77200f);
+ r >>= 20;
+ g >>= 20;
+ b >>= 20;
+ if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }
+ if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }
+ if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }
+ out[0] = (stbi_uc)r;
+ out[1] = (stbi_uc)g;
+ out[2] = (stbi_uc)b;
+ out[3] = 255;
+ out += step;
+ }
+}
+#endif
+
+#if defined(STBI_SSE2) || defined(STBI_NEON)
+static void stbi__YCbCr_to_RGB_simd(stbi_uc *out, stbi_uc const *y, stbi_uc const *pcb, stbi_uc const *pcr, int count, int step)
+{
+ int i = 0;
+
+#ifdef STBI_SSE2
+ // step == 3 is pretty ugly on the final interleave, and i'm not convinced
+ // it's useful in practice (you wouldn't use it for textures, for example).
+ // so just accelerate step == 4 case.
+ if (step == 4) {
+ // this is a fairly straightforward implementation and not super-optimized.
+ __m128i signflip = _mm_set1_epi8(-0x80);
+ __m128i cr_const0 = _mm_set1_epi16( (short) ( 1.40200f*4096.0f+0.5f));
+ __m128i cr_const1 = _mm_set1_epi16( - (short) ( 0.71414f*4096.0f+0.5f));
+ __m128i cb_const0 = _mm_set1_epi16( - (short) ( 0.34414f*4096.0f+0.5f));
+ __m128i cb_const1 = _mm_set1_epi16( (short) ( 1.77200f*4096.0f+0.5f));
+ __m128i y_bias = _mm_set1_epi8((char) (unsigned char) 128);
+ __m128i xw = _mm_set1_epi16(255); // alpha channel
+
+ for (; i+7 < count; i += 8) {
+ // load
+ __m128i y_bytes = _mm_loadl_epi64((__m128i *) (y+i));
+ __m128i cr_bytes = _mm_loadl_epi64((__m128i *) (pcr+i));
+ __m128i cb_bytes = _mm_loadl_epi64((__m128i *) (pcb+i));
+ __m128i cr_biased = _mm_xor_si128(cr_bytes, signflip); // -128
+ __m128i cb_biased = _mm_xor_si128(cb_bytes, signflip); // -128
+
+ // unpack to short (and left-shift cr, cb by 8)
+ __m128i yw = _mm_unpacklo_epi8(y_bias, y_bytes);
+ __m128i crw = _mm_unpacklo_epi8(_mm_setzero_si128(), cr_biased);
+ __m128i cbw = _mm_unpacklo_epi8(_mm_setzero_si128(), cb_biased);
+
+ // color transform
+ __m128i yws = _mm_srli_epi16(yw, 4);
+ __m128i cr0 = _mm_mulhi_epi16(cr_const0, crw);
+ __m128i cb0 = _mm_mulhi_epi16(cb_const0, cbw);
+ __m128i cb1 = _mm_mulhi_epi16(cbw, cb_const1);
+ __m128i cr1 = _mm_mulhi_epi16(crw, cr_const1);
+ __m128i rws = _mm_add_epi16(cr0, yws);
+ __m128i gwt = _mm_add_epi16(cb0, yws);
+ __m128i bws = _mm_add_epi16(yws, cb1);
+ __m128i gws = _mm_add_epi16(gwt, cr1);
+
+ // descale
+ __m128i rw = _mm_srai_epi16(rws, 4);
+ __m128i bw = _mm_srai_epi16(bws, 4);
+ __m128i gw = _mm_srai_epi16(gws, 4);
+
+ // back to byte, set up for transpose
+ __m128i brb = _mm_packus_epi16(rw, bw);
+ __m128i gxb = _mm_packus_epi16(gw, xw);
+
+ // transpose to interleave channels
+ __m128i t0 = _mm_unpacklo_epi8(brb, gxb);
+ __m128i t1 = _mm_unpackhi_epi8(brb, gxb);
+ __m128i o0 = _mm_unpacklo_epi16(t0, t1);
+ __m128i o1 = _mm_unpackhi_epi16(t0, t1);
+
+ // store
+ _mm_storeu_si128((__m128i *) (out + 0), o0);
+ _mm_storeu_si128((__m128i *) (out + 16), o1);
+ out += 32;
+ }
+ }
+#endif
+
+#ifdef STBI_NEON
+ // in this version, step=3 support would be easy to add. but is there demand?
+ if (step == 4) {
+ // this is a fairly straightforward implementation and not super-optimized.
+ uint8x8_t signflip = vdup_n_u8(0x80);
+ int16x8_t cr_const0 = vdupq_n_s16( (short) ( 1.40200f*4096.0f+0.5f));
+ int16x8_t cr_const1 = vdupq_n_s16( - (short) ( 0.71414f*4096.0f+0.5f));
+ int16x8_t cb_const0 = vdupq_n_s16( - (short) ( 0.34414f*4096.0f+0.5f));
+ int16x8_t cb_const1 = vdupq_n_s16( (short) ( 1.77200f*4096.0f+0.5f));
+
+ for (; i+7 < count; i += 8) {
+ // load
+ uint8x8_t y_bytes = vld1_u8(y + i);
+ uint8x8_t cr_bytes = vld1_u8(pcr + i);
+ uint8x8_t cb_bytes = vld1_u8(pcb + i);
+ int8x8_t cr_biased = vreinterpret_s8_u8(vsub_u8(cr_bytes, signflip));
+ int8x8_t cb_biased = vreinterpret_s8_u8(vsub_u8(cb_bytes, signflip));
+
+ // expand to s16
+ int16x8_t yws = vreinterpretq_s16_u16(vshll_n_u8(y_bytes, 4));
+ int16x8_t crw = vshll_n_s8(cr_biased, 7);
+ int16x8_t cbw = vshll_n_s8(cb_biased, 7);
+
+ // color transform
+ int16x8_t cr0 = vqdmulhq_s16(crw, cr_const0);
+ int16x8_t cb0 = vqdmulhq_s16(cbw, cb_const0);
+ int16x8_t cr1 = vqdmulhq_s16(crw, cr_const1);
+ int16x8_t cb1 = vqdmulhq_s16(cbw, cb_const1);
+ int16x8_t rws = vaddq_s16(yws, cr0);
+ int16x8_t gws = vaddq_s16(vaddq_s16(yws, cb0), cr1);
+ int16x8_t bws = vaddq_s16(yws, cb1);
+
+ // undo scaling, round, convert to byte
+ uint8x8x4_t o;
+ o.val[0] = vqrshrun_n_s16(rws, 4);
+ o.val[1] = vqrshrun_n_s16(gws, 4);
+ o.val[2] = vqrshrun_n_s16(bws, 4);
+ o.val[3] = vdup_n_u8(255);
+
+ // store, interleaving r/g/b/a
+ vst4_u8(out, o);
+ out += 8*4;
+ }
+ }
+#endif
+
+ for (; i < count; ++i) {
+ int y_fixed = (y[i] << 20) + (1<<19); // rounding
+ int r,g,b;
+ int cr = pcr[i] - 128;
+ int cb = pcb[i] - 128;
+ r = y_fixed + cr* float2fixed(1.40200f);
+ g = y_fixed + cr*-float2fixed(0.71414f) + ((cb*-float2fixed(0.34414f)) & 0xffff0000);
+ b = y_fixed + cb* float2fixed(1.77200f);
+ r >>= 20;
+ g >>= 20;
+ b >>= 20;
+ if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }
+ if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }
+ if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }
+ out[0] = (stbi_uc)r;
+ out[1] = (stbi_uc)g;
+ out[2] = (stbi_uc)b;
+ out[3] = 255;
+ out += step;
+ }
+}
+#endif
+
+// set up the kernels
+static void stbi__setup_jpeg(stbi__jpeg *j)
+{
+ j->idct_block_kernel = stbi__idct_block;
+ j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_row;
+ j->resample_row_hv_2_kernel = stbi__resample_row_hv_2;
+
+#ifdef STBI_SSE2
+ if (stbi__sse2_available()) {
+ j->idct_block_kernel = stbi__idct_simd;
+ #ifndef STBI_JPEG_OLD
+ j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd;
+ #endif
+ j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd;
+ }
+#endif
+
+#ifdef STBI_NEON
+ j->idct_block_kernel = stbi__idct_simd;
+ #ifndef STBI_JPEG_OLD
+ j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd;
+ #endif
+ j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd;
+#endif
+}
+
+// clean up the temporary component buffers
+static void stbi__cleanup_jpeg(stbi__jpeg *j)
+{
+ int i;
+ for (i=0; i < j->s->img_n; ++i) {
+ if (j->img_comp[i].raw_data) {
+ STBI_FREE(j->img_comp[i].raw_data);
+ j->img_comp[i].raw_data = NULL;
+ j->img_comp[i].data = NULL;
+ }
+ if (j->img_comp[i].raw_coeff) {
+ STBI_FREE(j->img_comp[i].raw_coeff);
+ j->img_comp[i].raw_coeff = 0;
+ j->img_comp[i].coeff = 0;
+ }
+ if (j->img_comp[i].linebuf) {
+ STBI_FREE(j->img_comp[i].linebuf);
+ j->img_comp[i].linebuf = NULL;
+ }
+ }
+}
+
+typedef struct
+{
+ resample_row_func resample;
+ stbi_uc *line0,*line1;
+ int hs,vs; // expansion factor in each axis
+ int w_lores; // horizontal pixels pre-expansion
+ int ystep; // how far through vertical expansion we are
+ int ypos; // which pre-expansion row we're on
+} stbi__resample;
+
+static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp, int req_comp)
+{
+ int n, decode_n;
+ z->s->img_n = 0; // make stbi__cleanup_jpeg safe
+
+ // validate req_comp
+ if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error");
+
+ // load a jpeg image from whichever source, but leave in YCbCr format
+ if (!stbi__decode_jpeg_image(z)) { stbi__cleanup_jpeg(z); return NULL; }
+
+ // determine actual number of components to generate
+ n = req_comp ? req_comp : z->s->img_n;
+
+ if (z->s->img_n == 3 && n < 3)
+ decode_n = 1;
+ else
+ decode_n = z->s->img_n;
+
+ // resample and color-convert
+ {
+ int k;
+ unsigned int i,j;
+ stbi_uc *output;
+ stbi_uc *coutput[4];
+
+ stbi__resample res_comp[4];
+
+ for (k=0; k < decode_n; ++k) {
+ stbi__resample *r = &res_comp[k];
+
+ // allocate line buffer big enough for upsampling off the edges
+ // with upsample factor of 4
+ z->img_comp[k].linebuf = (stbi_uc *) stbi__malloc(z->s->img_x + 3);
+ if (!z->img_comp[k].linebuf) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); }
+
+ r->hs = z->img_h_max / z->img_comp[k].h;
+ r->vs = z->img_v_max / z->img_comp[k].v;
+ r->ystep = r->vs >> 1;
+ r->w_lores = (z->s->img_x + r->hs-1) / r->hs;
+ r->ypos = 0;
+ r->line0 = r->line1 = z->img_comp[k].data;
+
+ if (r->hs == 1 && r->vs == 1) r->resample = resample_row_1;
+ else if (r->hs == 1 && r->vs == 2) r->resample = stbi__resample_row_v_2;
+ else if (r->hs == 2 && r->vs == 1) r->resample = stbi__resample_row_h_2;
+ else if (r->hs == 2 && r->vs == 2) r->resample = z->resample_row_hv_2_kernel;
+ else r->resample = stbi__resample_row_generic;
+ }
+
+ // can't error after this so, this is safe
+ output = (stbi_uc *) stbi__malloc(n * z->s->img_x * z->s->img_y + 1);
+ if (!output) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); }
+
+ // now go ahead and resample
+ for (j=0; j < z->s->img_y; ++j) {
+ stbi_uc *out = output + n * z->s->img_x * j;
+ for (k=0; k < decode_n; ++k) {
+ stbi__resample *r = &res_comp[k];
+ int y_bot = r->ystep >= (r->vs >> 1);
+ coutput[k] = r->resample(z->img_comp[k].linebuf,
+ y_bot ? r->line1 : r->line0,
+ y_bot ? r->line0 : r->line1,
+ r->w_lores, r->hs);
+ if (++r->ystep >= r->vs) {
+ r->ystep = 0;
+ r->line0 = r->line1;
+ if (++r->ypos < z->img_comp[k].y)
+ r->line1 += z->img_comp[k].w2;
+ }
+ }
+ if (n >= 3) {
+ stbi_uc *y = coutput[0];
+ if (z->s->img_n == 3) {
+ z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n);
+ } else
+ for (i=0; i < z->s->img_x; ++i) {
+ out[0] = out[1] = out[2] = y[i];
+ out[3] = 255; // not used if n==3
+ out += n;
+ }
+ } else {
+ stbi_uc *y = coutput[0];
+ if (n == 1)
+ for (i=0; i < z->s->img_x; ++i) out[i] = y[i];
+ else
+ for (i=0; i < z->s->img_x; ++i) *out++ = y[i], *out++ = 255;
+ }
+ }
+ stbi__cleanup_jpeg(z);
+ *out_x = z->s->img_x;
+ *out_y = z->s->img_y;
+ if (comp) *comp = z->s->img_n; // report original components, not output
+ return output;
+ }
+}
+
+static unsigned char *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)
+{
+ stbi__jpeg j;
+ j.s = s;
+ stbi__setup_jpeg(&j);
+ return load_jpeg_image(&j, x,y,comp,req_comp);
+}
+
+static int stbi__jpeg_test(stbi__context *s)
+{
+ int r;
+ stbi__jpeg j;
+ j.s = s;
+ stbi__setup_jpeg(&j);
+ r = stbi__decode_jpeg_header(&j, STBI__SCAN_type);
+ stbi__rewind(s);
+ return r;
+}
+
+static int stbi__jpeg_info_raw(stbi__jpeg *j, int *x, int *y, int *comp)
+{
+ if (!stbi__decode_jpeg_header(j, STBI__SCAN_header)) {
+ stbi__rewind( j->s );
+ return 0;
+ }
+ if (x) *x = j->s->img_x;
+ if (y) *y = j->s->img_y;
+ if (comp) *comp = j->s->img_n;
+ return 1;
+}
+
+static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp)
+{
+ stbi__jpeg j;
+ j.s = s;
+ return stbi__jpeg_info_raw(&j, x, y, comp);
+}
+#endif
+
+// public domain zlib decode v0.2 Sean Barrett 2006-11-18
+// simple implementation
+// - all input must be provided in an upfront buffer
+// - all output is written to a single output buffer (can malloc/realloc)
+// performance
+// - fast huffman
+
+#ifndef STBI_NO_ZLIB
+
+// fast-way is faster to check than jpeg huffman, but slow way is slower
+#define STBI__ZFAST_BITS 9 // accelerate all cases in default tables
+#define STBI__ZFAST_MASK ((1 << STBI__ZFAST_BITS) - 1)
+
+// zlib-style huffman encoding
+// (jpegs packs from left, zlib from right, so can't share code)
+typedef struct
+{
+ stbi__uint16 fast[1 << STBI__ZFAST_BITS];
+ stbi__uint16 firstcode[16];
+ int maxcode[17];
+ stbi__uint16 firstsymbol[16];
+ stbi_uc size[288];
+ stbi__uint16 value[288];
+} stbi__zhuffman;
+
+stbi_inline static int stbi__bitreverse16(int n)
+{
+ n = ((n & 0xAAAA) >> 1) | ((n & 0x5555) << 1);
+ n = ((n & 0xCCCC) >> 2) | ((n & 0x3333) << 2);
+ n = ((n & 0xF0F0) >> 4) | ((n & 0x0F0F) << 4);
+ n = ((n & 0xFF00) >> 8) | ((n & 0x00FF) << 8);
+ return n;
+}
+
+stbi_inline static int stbi__bit_reverse(int v, int bits)
+{
+ STBI_ASSERT(bits <= 16);
+ // to bit reverse n bits, reverse 16 and shift
+ // e.g. 11 bits, bit reverse and shift away 5
+ return stbi__bitreverse16(v) >> (16-bits);
+}
+
+static int stbi__zbuild_huffman(stbi__zhuffman *z, stbi_uc *sizelist, int num)
+{
+ int i,k=0;
+ int code, next_code[16], sizes[17];
+
+ // DEFLATE spec for generating codes
+ memset(sizes, 0, sizeof(sizes));
+ memset(z->fast, 0, sizeof(z->fast));
+ for (i=0; i < num; ++i)
+ ++sizes[sizelist[i]];
+ sizes[0] = 0;
+ for (i=1; i < 16; ++i)
+ STBI_ASSERT(sizes[i] <= (1 << i));
+ code = 0;
+ for (i=1; i < 16; ++i) {
+ next_code[i] = code;
+ z->firstcode[i] = (stbi__uint16) code;
+ z->firstsymbol[i] = (stbi__uint16) k;
+ code = (code + sizes[i]);
+ if (sizes[i])
+ if (code-1 >= (1 << i)) return stbi__err("bad codelengths","Corrupt JPEG");
+ z->maxcode[i] = code << (16-i); // preshift for inner loop
+ code <<= 1;
+ k += sizes[i];
+ }
+ z->maxcode[16] = 0x10000; // sentinel
+ for (i=0; i < num; ++i) {
+ int s = sizelist[i];
+ if (s) {
+ int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s];
+ stbi__uint16 fastv = (stbi__uint16) ((s << 9) | i);
+ z->size [c] = (stbi_uc ) s;
+ z->value[c] = (stbi__uint16) i;
+ if (s <= STBI__ZFAST_BITS) {
+ int k = stbi__bit_reverse(next_code[s],s);
+ while (k < (1 << STBI__ZFAST_BITS)) {
+ z->fast[k] = fastv;
+ k += (1 << s);
+ }
+ }
+ ++next_code[s];
+ }
+ }
+ return 1;
+}
+
+// zlib-from-memory implementation for PNG reading
+// because PNG allows splitting the zlib stream arbitrarily,
+// and it's annoying structurally to have PNG call ZLIB call PNG,
+// we require PNG read all the IDATs and combine them into a single
+// memory buffer
+
+typedef struct
+{
+ stbi_uc *zbuffer, *zbuffer_end;
+ int num_bits;
+ stbi__uint32 code_buffer;
+
+ char *zout;
+ char *zout_start;
+ char *zout_end;
+ int z_expandable;
+
+ stbi__zhuffman z_length, z_distance;
+} stbi__zbuf;
+
+stbi_inline static stbi_uc stbi__zget8(stbi__zbuf *z)
+{
+ if (z->zbuffer >= z->zbuffer_end) return 0;
+ return *z->zbuffer++;
+}
+
+static void stbi__fill_bits(stbi__zbuf *z)
+{
+ do {
+ STBI_ASSERT(z->code_buffer < (1U << z->num_bits));
+ z->code_buffer |= stbi__zget8(z) << z->num_bits;
+ z->num_bits += 8;
+ } while (z->num_bits <= 24);
+}
+
+stbi_inline static unsigned int stbi__zreceive(stbi__zbuf *z, int n)
+{
+ unsigned int k;
+ if (z->num_bits < n) stbi__fill_bits(z);
+ k = z->code_buffer & ((1 << n) - 1);
+ z->code_buffer >>= n;
+ z->num_bits -= n;
+ return k;
+}
+
+static int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z)
+{
+ int b,s,k;
+ // not resolved by fast table, so compute it the slow way
+ // use jpeg approach, which requires MSbits at top
+ k = stbi__bit_reverse(a->code_buffer, 16);
+ for (s=STBI__ZFAST_BITS+1; ; ++s)
+ if (k < z->maxcode[s])
+ break;
+ if (s == 16) return -1; // invalid code!
+ // code size is s, so:
+ b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s];
+ STBI_ASSERT(z->size[b] == s);
+ a->code_buffer >>= s;
+ a->num_bits -= s;
+ return z->value[b];
+}
+
+stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z)
+{
+ int b,s;
+ if (a->num_bits < 16) stbi__fill_bits(a);
+ b = z->fast[a->code_buffer & STBI__ZFAST_MASK];
+ if (b) {
+ s = b >> 9;
+ a->code_buffer >>= s;
+ a->num_bits -= s;
+ return b & 511;
+ }
+ return stbi__zhuffman_decode_slowpath(a, z);
+}
+
+static int stbi__zexpand(stbi__zbuf *z, char *zout, int n) // need to make room for n bytes
+{
+ char *q;
+ int cur, limit;
+ z->zout = zout;
+ if (!z->z_expandable) return stbi__err("output buffer limit","Corrupt PNG");
+ cur = (int) (z->zout - z->zout_start);
+ limit = (int) (z->zout_end - z->zout_start);
+ while (cur + n > limit)
+ limit *= 2;
+ q = (char *) STBI_REALLOC(z->zout_start, limit);
+ if (q == NULL) return stbi__err("outofmem", "Out of memory");
+ z->zout_start = q;
+ z->zout = q + cur;
+ z->zout_end = q + limit;
+ return 1;
+}
+
+static int stbi__zlength_base[31] = {
+ 3,4,5,6,7,8,9,10,11,13,
+ 15,17,19,23,27,31,35,43,51,59,
+ 67,83,99,115,131,163,195,227,258,0,0 };
+
+static int stbi__zlength_extra[31]=
+{ 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 };
+
+static int stbi__zdist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,
+257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0};
+
+static int stbi__zdist_extra[32] =
+{ 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
+
+static int stbi__parse_huffman_block(stbi__zbuf *a)
+{
+ char *zout = a->zout;
+ for(;;) {
+ int z = stbi__zhuffman_decode(a, &a->z_length);
+ if (z < 256) {
+ if (z < 0) return stbi__err("bad huffman code","Corrupt PNG"); // error in huffman codes
+ if (zout >= a->zout_end) {
+ if (!stbi__zexpand(a, zout, 1)) return 0;
+ zout = a->zout;
+ }
+ *zout++ = (char) z;
+ } else {
+ stbi_uc *p;
+ int len,dist;
+ if (z == 256) {
+ a->zout = zout;
+ return 1;
+ }
+ z -= 257;
+ len = stbi__zlength_base[z];
+ if (stbi__zlength_extra[z]) len += stbi__zreceive(a, stbi__zlength_extra[z]);
+ z = stbi__zhuffman_decode(a, &a->z_distance);
+ if (z < 0) return stbi__err("bad huffman code","Corrupt PNG");
+ dist = stbi__zdist_base[z];
+ if (stbi__zdist_extra[z]) dist += stbi__zreceive(a, stbi__zdist_extra[z]);
+ if (zout - a->zout_start < dist) return stbi__err("bad dist","Corrupt PNG");
+ if (zout + len > a->zout_end) {
+ if (!stbi__zexpand(a, zout, len)) return 0;
+ zout = a->zout;
+ }
+ p = (stbi_uc *) (zout - dist);
+ if (dist == 1) { // run of one byte; common in images.
+ stbi_uc v = *p;
+ do *zout++ = v; while (--len);
+ } else {
+ do *zout++ = *p++; while (--len);
+ }
+ }
+ }
+}
+
+static int stbi__compute_huffman_codes(stbi__zbuf *a)
+{
+ static stbi_uc length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 };
+ stbi__zhuffman z_codelength;
+ stbi_uc lencodes[286+32+137];//padding for maximum single op
+ stbi_uc codelength_sizes[19];
+ int i,n;
+
+ int hlit = stbi__zreceive(a,5) + 257;
+ int hdist = stbi__zreceive(a,5) + 1;
+ int hclen = stbi__zreceive(a,4) + 4;
+
+ memset(codelength_sizes, 0, sizeof(codelength_sizes));
+ for (i=0; i < hclen; ++i) {
+ int s = stbi__zreceive(a,3);
+ codelength_sizes[length_dezigzag[i]] = (stbi_uc) s;
+ }
+ if (!stbi__zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0;
+
+ n = 0;
+ while (n < hlit + hdist) {
+ int c = stbi__zhuffman_decode(a, &z_codelength);
+ STBI_ASSERT(c >= 0 && c < 19);
+ if (c < 16)
+ lencodes[n++] = (stbi_uc) c;
+ else if (c == 16) {
+ c = stbi__zreceive(a,2)+3;
+ memset(lencodes+n, lencodes[n-1], c);
+ n += c;
+ } else if (c == 17) {
+ c = stbi__zreceive(a,3)+3;
+ memset(lencodes+n, 0, c);
+ n += c;
+ } else {
+ STBI_ASSERT(c == 18);
+ c = stbi__zreceive(a,7)+11;
+ memset(lencodes+n, 0, c);
+ n += c;
+ }
+ }
+ if (n != hlit+hdist) return stbi__err("bad codelengths","Corrupt PNG");
+ if (!stbi__zbuild_huffman(&a->z_length, lencodes, hlit)) return 0;
+ if (!stbi__zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0;
+ return 1;
+}
+
+static int stbi__parse_uncomperssed_block(stbi__zbuf *a)
+{
+ stbi_uc header[4];
+ int len,nlen,k;
+ if (a->num_bits & 7)
+ stbi__zreceive(a, a->num_bits & 7); // discard
+ // drain the bit-packed data into header
+ k = 0;
+ while (a->num_bits > 0) {
+ header[k++] = (stbi_uc) (a->code_buffer & 255); // suppress MSVC run-time check
+ a->code_buffer >>= 8;
+ a->num_bits -= 8;
+ }
+ STBI_ASSERT(a->num_bits == 0);
+ // now fill header the normal way
+ while (k < 4)
+ header[k++] = stbi__zget8(a);
+ len = header[1] * 256 + header[0];
+ nlen = header[3] * 256 + header[2];
+ if (nlen != (len ^ 0xffff)) return stbi__err("zlib corrupt","Corrupt PNG");
+ if (a->zbuffer + len > a->zbuffer_end) return stbi__err("read past buffer","Corrupt PNG");
+ if (a->zout + len > a->zout_end)
+ if (!stbi__zexpand(a, a->zout, len)) return 0;
+ memcpy(a->zout, a->zbuffer, len);
+ a->zbuffer += len;
+ a->zout += len;
+ return 1;
+}
+
+static int stbi__parse_zlib_header(stbi__zbuf *a)
+{
+ int cmf = stbi__zget8(a);
+ int cm = cmf & 15;
+ /* int cinfo = cmf >> 4; */
+ int flg = stbi__zget8(a);
+ if ((cmf*256+flg) % 31 != 0) return stbi__err("bad zlib header","Corrupt PNG"); // zlib spec
+ if (flg & 32) return stbi__err("no preset dict","Corrupt PNG"); // preset dictionary not allowed in png
+ if (cm != 8) return stbi__err("bad compression","Corrupt PNG"); // DEFLATE required for png
+ // window = 1 << (8 + cinfo)... but who cares, we fully buffer output
+ return 1;
+}
+
+// @TODO: should statically initialize these for optimal thread safety
+static stbi_uc stbi__zdefault_length[288], stbi__zdefault_distance[32];
+static void stbi__init_zdefaults(void)
+{
+ int i; // use <= to match clearly with spec
+ for (i=0; i <= 143; ++i) stbi__zdefault_length[i] = 8;
+ for ( ; i <= 255; ++i) stbi__zdefault_length[i] = 9;
+ for ( ; i <= 279; ++i) stbi__zdefault_length[i] = 7;
+ for ( ; i <= 287; ++i) stbi__zdefault_length[i] = 8;
+
+ for (i=0; i <= 31; ++i) stbi__zdefault_distance[i] = 5;
+}
+
+static int stbi__parse_zlib(stbi__zbuf *a, int parse_header)
+{
+ int final, type;
+ if (parse_header)
+ if (!stbi__parse_zlib_header(a)) return 0;
+ a->num_bits = 0;
+ a->code_buffer = 0;
+ do {
+ final = stbi__zreceive(a,1);
+ type = stbi__zreceive(a,2);
+ if (type == 0) {
+ if (!stbi__parse_uncomperssed_block(a)) return 0;
+ } else if (type == 3) {
+ return 0;
+ } else {
+ if (type == 1) {
+ // use fixed code lengths
+ if (!stbi__zdefault_distance[31]) stbi__init_zdefaults();
+ if (!stbi__zbuild_huffman(&a->z_length , stbi__zdefault_length , 288)) return 0;
+ if (!stbi__zbuild_huffman(&a->z_distance, stbi__zdefault_distance, 32)) return 0;
+ } else {
+ if (!stbi__compute_huffman_codes(a)) return 0;
+ }
+ if (!stbi__parse_huffman_block(a)) return 0;
+ }
+ } while (!final);
+ return 1;
+}
+
+static int stbi__do_zlib(stbi__zbuf *a, char *obuf, int olen, int exp, int parse_header)
+{
+ a->zout_start = obuf;
+ a->zout = obuf;
+ a->zout_end = obuf + olen;
+ a->z_expandable = exp;
+
+ return stbi__parse_zlib(a, parse_header);
+}
+
+STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen)
+{
+ stbi__zbuf a;
+ char *p = (char *) stbi__malloc(initial_size);
+ if (p == NULL) return NULL;
+ a.zbuffer = (stbi_uc *) buffer;
+ a.zbuffer_end = (stbi_uc *) buffer + len;
+ if (stbi__do_zlib(&a, p, initial_size, 1, 1)) {
+ if (outlen) *outlen = (int) (a.zout - a.zout_start);
+ return a.zout_start;
+ } else {
+ STBI_FREE(a.zout_start);
+ return NULL;
+ }
+}
+
+STBIDEF char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen)
+{
+ return stbi_zlib_decode_malloc_guesssize(buffer, len, 16384, outlen);
+}
+
+STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header)
+{
+ stbi__zbuf a;
+ char *p = (char *) stbi__malloc(initial_size);
+ if (p == NULL) return NULL;
+ a.zbuffer = (stbi_uc *) buffer;
+ a.zbuffer_end = (stbi_uc *) buffer + len;
+ if (stbi__do_zlib(&a, p, initial_size, 1, parse_header)) {
+ if (outlen) *outlen = (int) (a.zout - a.zout_start);
+ return a.zout_start;
+ } else {
+ STBI_FREE(a.zout_start);
+ return NULL;
+ }
+}
+
+STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, char const *ibuffer, int ilen)
+{
+ stbi__zbuf a;
+ a.zbuffer = (stbi_uc *) ibuffer;
+ a.zbuffer_end = (stbi_uc *) ibuffer + ilen;
+ if (stbi__do_zlib(&a, obuffer, olen, 0, 1))
+ return (int) (a.zout - a.zout_start);
+ else
+ return -1;
+}
+
+STBIDEF char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int *outlen)
+{
+ stbi__zbuf a;
+ char *p = (char *) stbi__malloc(16384);
+ if (p == NULL) return NULL;
+ a.zbuffer = (stbi_uc *) buffer;
+ a.zbuffer_end = (stbi_uc *) buffer+len;
+ if (stbi__do_zlib(&a, p, 16384, 1, 0)) {
+ if (outlen) *outlen = (int) (a.zout - a.zout_start);
+ return a.zout_start;
+ } else {
+ STBI_FREE(a.zout_start);
+ return NULL;
+ }
+}
+
+STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen)
+{
+ stbi__zbuf a;
+ a.zbuffer = (stbi_uc *) ibuffer;
+ a.zbuffer_end = (stbi_uc *) ibuffer + ilen;
+ if (stbi__do_zlib(&a, obuffer, olen, 0, 0))
+ return (int) (a.zout - a.zout_start);
+ else
+ return -1;
+}
+#endif
+
+// public domain "baseline" PNG decoder v0.10 Sean Barrett 2006-11-18
+// simple implementation
+// - only 8-bit samples
+// - no CRC checking
+// - allocates lots of intermediate memory
+// - avoids problem of streaming data between subsystems
+// - avoids explicit window management
+// performance
+// - uses stb_zlib, a PD zlib implementation with fast huffman decoding
+
+#ifndef STBI_NO_PNG
+typedef struct
+{
+ stbi__uint32 length;
+ stbi__uint32 type;
+} stbi__pngchunk;
+
+static stbi__pngchunk stbi__get_chunk_header(stbi__context *s)
+{
+ stbi__pngchunk c;
+ c.length = stbi__get32be(s);
+ c.type = stbi__get32be(s);
+ return c;
+}
+
+static int stbi__check_png_header(stbi__context *s)
+{
+ static stbi_uc png_sig[8] = { 137,80,78,71,13,10,26,10 };
+ int i;
+ for (i=0; i < 8; ++i)
+ if (stbi__get8(s) != png_sig[i]) return stbi__err("bad png sig","Not a PNG");
+ return 1;
+}
+
+typedef struct
+{
+ stbi__context *s;
+ stbi_uc *idata, *expanded, *out;
+} stbi__png;
+
+
+enum {
+ STBI__F_none=0,
+ STBI__F_sub=1,
+ STBI__F_up=2,
+ STBI__F_avg=3,
+ STBI__F_paeth=4,
+ // synthetic filters used for first scanline to avoid needing a dummy row of 0s
+ STBI__F_avg_first,
+ STBI__F_paeth_first
+};
+
+static stbi_uc first_row_filter[5] =
+{
+ STBI__F_none,
+ STBI__F_sub,
+ STBI__F_none,
+ STBI__F_avg_first,
+ STBI__F_paeth_first
+};
+
+static int stbi__paeth(int a, int b, int c)
+{
+ int p = a + b - c;
+ int pa = abs(p-a);
+ int pb = abs(p-b);
+ int pc = abs(p-c);
+ if (pa <= pb && pa <= pc) return a;
+ if (pb <= pc) return b;
+ return c;
+}
+
+static stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 };
+
+// create the png data from post-deflated data
+static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color)
+{
+ stbi__context *s = a->s;
+ stbi__uint32 i,j,stride = x*out_n;
+ stbi__uint32 img_len, img_width_bytes;
+ int k;
+ int img_n = s->img_n; // copy it into a local for later
+
+ STBI_ASSERT(out_n == s->img_n || out_n == s->img_n+1);
+ a->out = (stbi_uc *) stbi__malloc(x * y * out_n); // extra bytes to write off the end into
+ if (!a->out) return stbi__err("outofmem", "Out of memory");
+
+ img_width_bytes = (((img_n * x * depth) + 7) >> 3);
+ img_len = (img_width_bytes + 1) * y;
+ if (s->img_x == x && s->img_y == y) {
+ if (raw_len != img_len) return stbi__err("not enough pixels","Corrupt PNG");
+ } else { // interlaced:
+ if (raw_len < img_len) return stbi__err("not enough pixels","Corrupt PNG");
+ }
+
+ for (j=0; j < y; ++j) {
+ stbi_uc *cur = a->out + stride*j;
+ stbi_uc *prior = cur - stride;
+ int filter = *raw++;
+ int filter_bytes = img_n;
+ int width = x;
+ if (filter > 4)
+ return stbi__err("invalid filter","Corrupt PNG");
+
+ if (depth < 8) {
+ STBI_ASSERT(img_width_bytes <= x);
+ cur += x*out_n - img_width_bytes; // store output to the rightmost img_len bytes, so we can decode in place
+ filter_bytes = 1;
+ width = img_width_bytes;
+ }
+
+ // if first row, use special filter that doesn't sample previous row
+ if (j == 0) filter = first_row_filter[filter];
+
+ // handle first byte explicitly
+ for (k=0; k < filter_bytes; ++k) {
+ switch (filter) {
+ case STBI__F_none : cur[k] = raw[k]; break;
+ case STBI__F_sub : cur[k] = raw[k]; break;
+ case STBI__F_up : cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;
+ case STBI__F_avg : cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); break;
+ case STBI__F_paeth : cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(0,prior[k],0)); break;
+ case STBI__F_avg_first : cur[k] = raw[k]; break;
+ case STBI__F_paeth_first: cur[k] = raw[k]; break;
+ }
+ }
+
+ if (depth == 8) {
+ if (img_n != out_n)
+ cur[img_n] = 255; // first pixel
+ raw += img_n;
+ cur += out_n;
+ prior += out_n;
+ } else {
+ raw += 1;
+ cur += 1;
+ prior += 1;
+ }
+
+ // this is a little gross, so that we don't switch per-pixel or per-component
+ if (depth < 8 || img_n == out_n) {
+ int nk = (width - 1)*img_n;
+ #define CASE(f) \
+ case f: \
+ for (k=0; k < nk; ++k)
+ switch (filter) {
+ // "none" filter turns into a memcpy here; make that explicit.
+ case STBI__F_none: memcpy(cur, raw, nk); break;
+ CASE(STBI__F_sub) cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); break;
+ CASE(STBI__F_up) cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;
+ CASE(STBI__F_avg) cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); break;
+ CASE(STBI__F_paeth) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); break;
+ CASE(STBI__F_avg_first) cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); break;
+ CASE(STBI__F_paeth_first) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); break;
+ }
+ #undef CASE
+ raw += nk;
+ } else {
+ STBI_ASSERT(img_n+1 == out_n);
+ #define CASE(f) \
+ case f: \
+ for (i=x-1; i >= 1; --i, cur[img_n]=255,raw+=img_n,cur+=out_n,prior+=out_n) \
+ for (k=0; k < img_n; ++k)
+ switch (filter) {
+ CASE(STBI__F_none) cur[k] = raw[k]; break;
+ CASE(STBI__F_sub) cur[k] = STBI__BYTECAST(raw[k] + cur[k-out_n]); break;
+ CASE(STBI__F_up) cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;
+ CASE(STBI__F_avg) cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-out_n])>>1)); break;
+ CASE(STBI__F_paeth) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-out_n],prior[k],prior[k-out_n])); break;
+ CASE(STBI__F_avg_first) cur[k] = STBI__BYTECAST(raw[k] + (cur[k-out_n] >> 1)); break;
+ CASE(STBI__F_paeth_first) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-out_n],0,0)); break;
+ }
+ #undef CASE
+ }
+ }
+
+ // we make a separate pass to expand bits to pixels; for performance,
+ // this could run two scanlines behind the above code, so it won't
+ // intefere with filtering but will still be in the cache.
+ if (depth < 8) {
+ for (j=0; j < y; ++j) {
+ stbi_uc *cur = a->out + stride*j;
+ stbi_uc *in = a->out + stride*j + x*out_n - img_width_bytes;
+ // unpack 1/2/4-bit into a 8-bit buffer. allows us to keep the common 8-bit path optimal at minimal cost for 1/2/4-bit
+ // png guarante byte alignment, if width is not multiple of 8/4/2 we'll decode dummy trailing data that will be skipped in the later loop
+ stbi_uc scale = (color == 0) ? stbi__depth_scale_table[depth] : 1; // scale grayscale values to 0..255 range
+
+ // note that the final byte might overshoot and write more data than desired.
+ // we can allocate enough data that this never writes out of memory, but it
+ // could also overwrite the next scanline. can it overwrite non-empty data
+ // on the next scanline? yes, consider 1-pixel-wide scanlines with 1-bit-per-pixel.
+ // so we need to explicitly clamp the final ones
+
+ if (depth == 4) {
+ for (k=x*img_n; k >= 2; k-=2, ++in) {
+ *cur++ = scale * ((*in >> 4) );
+ *cur++ = scale * ((*in ) & 0x0f);
+ }
+ if (k > 0) *cur++ = scale * ((*in >> 4) );
+ } else if (depth == 2) {
+ for (k=x*img_n; k >= 4; k-=4, ++in) {
+ *cur++ = scale * ((*in >> 6) );
+ *cur++ = scale * ((*in >> 4) & 0x03);
+ *cur++ = scale * ((*in >> 2) & 0x03);
+ *cur++ = scale * ((*in ) & 0x03);
+ }
+ if (k > 0) *cur++ = scale * ((*in >> 6) );
+ if (k > 1) *cur++ = scale * ((*in >> 4) & 0x03);
+ if (k > 2) *cur++ = scale * ((*in >> 2) & 0x03);
+ } else if (depth == 1) {
+ for (k=x*img_n; k >= 8; k-=8, ++in) {
+ *cur++ = scale * ((*in >> 7) );
+ *cur++ = scale * ((*in >> 6) & 0x01);
+ *cur++ = scale * ((*in >> 5) & 0x01);
+ *cur++ = scale * ((*in >> 4) & 0x01);
+ *cur++ = scale * ((*in >> 3) & 0x01);
+ *cur++ = scale * ((*in >> 2) & 0x01);
+ *cur++ = scale * ((*in >> 1) & 0x01);
+ *cur++ = scale * ((*in ) & 0x01);
+ }
+ if (k > 0) *cur++ = scale * ((*in >> 7) );
+ if (k > 1) *cur++ = scale * ((*in >> 6) & 0x01);
+ if (k > 2) *cur++ = scale * ((*in >> 5) & 0x01);
+ if (k > 3) *cur++ = scale * ((*in >> 4) & 0x01);
+ if (k > 4) *cur++ = scale * ((*in >> 3) & 0x01);
+ if (k > 5) *cur++ = scale * ((*in >> 2) & 0x01);
+ if (k > 6) *cur++ = scale * ((*in >> 1) & 0x01);
+ }
+ if (img_n != out_n) {
+ // insert alpha = 255
+ stbi_uc *cur = a->out + stride*j;
+ int i;
+ if (img_n == 1) {
+ for (i=x-1; i >= 0; --i) {
+ cur[i*2+1] = 255;
+ cur[i*2+0] = cur[i];
+ }
+ } else {
+ STBI_ASSERT(img_n == 3);
+ for (i=x-1; i >= 0; --i) {
+ cur[i*4+3] = 255;
+ cur[i*4+2] = cur[i*3+2];
+ cur[i*4+1] = cur[i*3+1];
+ cur[i*4+0] = cur[i*3+0];
+ }
+ }
+ }
+ }
+ }
+
+ return 1;
+}
+
+static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint32 image_data_len, int out_n, int depth, int color, int interlaced)
+{
+ stbi_uc *final;
+ int p;
+ if (!interlaced)
+ return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color);
+
+ // de-interlacing
+ final = (stbi_uc *) stbi__malloc(a->s->img_x * a->s->img_y * out_n);
+ for (p=0; p < 7; ++p) {
+ int xorig[] = { 0,4,0,2,0,1,0 };
+ int yorig[] = { 0,0,4,0,2,0,1 };
+ int xspc[] = { 8,8,4,4,2,2,1 };
+ int yspc[] = { 8,8,8,4,4,2,2 };
+ int i,j,x,y;
+ // pass1_x[4] = 0, pass1_x[5] = 1, pass1_x[12] = 1
+ x = (a->s->img_x - xorig[p] + xspc[p]-1) / xspc[p];
+ y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p];
+ if (x && y) {
+ stbi__uint32 img_len = ((((a->s->img_n * x * depth) + 7) >> 3) + 1) * y;
+ if (!stbi__create_png_image_raw(a, image_data, image_data_len, out_n, x, y, depth, color)) {
+ STBI_FREE(final);
+ return 0;
+ }
+ for (j=0; j < y; ++j) {
+ for (i=0; i < x; ++i) {
+ int out_y = j*yspc[p]+yorig[p];
+ int out_x = i*xspc[p]+xorig[p];
+ memcpy(final + out_y*a->s->img_x*out_n + out_x*out_n,
+ a->out + (j*x+i)*out_n, out_n);
+ }
+ }
+ STBI_FREE(a->out);
+ image_data += img_len;
+ image_data_len -= img_len;
+ }
+ }
+ a->out = final;
+
+ return 1;
+}
+
+static int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int out_n)
+{
+ stbi__context *s = z->s;
+ stbi__uint32 i, pixel_count = s->img_x * s->img_y;
+ stbi_uc *p = z->out;
+
+ // compute color-based transparency, assuming we've
+ // already got 255 as the alpha value in the output
+ STBI_ASSERT(out_n == 2 || out_n == 4);
+
+ if (out_n == 2) {
+ for (i=0; i < pixel_count; ++i) {
+ p[1] = (p[0] == tc[0] ? 0 : 255);
+ p += 2;
+ }
+ } else {
+ for (i=0; i < pixel_count; ++i) {
+ if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2])
+ p[3] = 0;
+ p += 4;
+ }
+ }
+ return 1;
+}
+
+static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len, int pal_img_n)
+{
+ stbi__uint32 i, pixel_count = a->s->img_x * a->s->img_y;
+ stbi_uc *p, *temp_out, *orig = a->out;
+
+ p = (stbi_uc *) stbi__malloc(pixel_count * pal_img_n);
+ if (p == NULL) return stbi__err("outofmem", "Out of memory");
+
+ // between here and free(out) below, exitting would leak
+ temp_out = p;
+
+ if (pal_img_n == 3) {
+ for (i=0; i < pixel_count; ++i) {
+ int n = orig[i]*4;
+ p[0] = palette[n ];
+ p[1] = palette[n+1];
+ p[2] = palette[n+2];
+ p += 3;
+ }
+ } else {
+ for (i=0; i < pixel_count; ++i) {
+ int n = orig[i]*4;
+ p[0] = palette[n ];
+ p[1] = palette[n+1];
+ p[2] = palette[n+2];
+ p[3] = palette[n+3];
+ p += 4;
+ }
+ }
+ STBI_FREE(a->out);
+ a->out = temp_out;
+
+ STBI_NOTUSED(len);
+
+ return 1;
+}
+
+static int stbi__unpremultiply_on_load = 0;
+static int stbi__de_iphone_flag = 0;
+
+STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply)
+{
+ stbi__unpremultiply_on_load = flag_true_if_should_unpremultiply;
+}
+
+STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert)
+{
+ stbi__de_iphone_flag = flag_true_if_should_convert;
+}
+
+static void stbi__de_iphone(stbi__png *z)
+{
+ stbi__context *s = z->s;
+ stbi__uint32 i, pixel_count = s->img_x * s->img_y;
+ stbi_uc *p = z->out;
+
+ if (s->img_out_n == 3) { // convert bgr to rgb
+ for (i=0; i < pixel_count; ++i) {
+ stbi_uc t = p[0];
+ p[0] = p[2];
+ p[2] = t;
+ p += 3;
+ }
+ } else {
+ STBI_ASSERT(s->img_out_n == 4);
+ if (stbi__unpremultiply_on_load) {
+ // convert bgr to rgb and unpremultiply
+ for (i=0; i < pixel_count; ++i) {
+ stbi_uc a = p[3];
+ stbi_uc t = p[0];
+ if (a) {
+ p[0] = p[2] * 255 / a;
+ p[1] = p[1] * 255 / a;
+ p[2] = t * 255 / a;
+ } else {
+ p[0] = p[2];
+ p[2] = t;
+ }
+ p += 4;
+ }
+ } else {
+ // convert bgr to rgb
+ for (i=0; i < pixel_count; ++i) {
+ stbi_uc t = p[0];
+ p[0] = p[2];
+ p[2] = t;
+ p += 4;
+ }
+ }
+ }
+}
+
+#define STBI__PNG_TYPE(a,b,c,d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))
+
+static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
+{
+ stbi_uc palette[1024], pal_img_n=0;
+ stbi_uc has_trans=0, tc[3];
+ stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0;
+ int first=1,k,interlace=0, color=0, depth=0, is_iphone=0;
+ stbi__context *s = z->s;
+
+ z->expanded = NULL;
+ z->idata = NULL;
+ z->out = NULL;
+
+ if (!stbi__check_png_header(s)) return 0;
+
+ if (scan == STBI__SCAN_type) return 1;
+
+ for (;;) {
+ stbi__pngchunk c = stbi__get_chunk_header(s);
+ switch (c.type) {
+ case STBI__PNG_TYPE('C','g','B','I'):
+ is_iphone = 1;
+ stbi__skip(s, c.length);
+ break;
+ case STBI__PNG_TYPE('I','H','D','R'): {
+ int comp,filter;
+ if (!first) return stbi__err("multiple IHDR","Corrupt PNG");
+ first = 0;
+ if (c.length != 13) return stbi__err("bad IHDR len","Corrupt PNG");
+ s->img_x = stbi__get32be(s); if (s->img_x > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)");
+ s->img_y = stbi__get32be(s); if (s->img_y > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)");
+ depth = stbi__get8(s); if (depth != 1 && depth != 2 && depth != 4 && depth != 8) return stbi__err("1/2/4/8-bit only","PNG not supported: 1/2/4/8-bit only");
+ color = stbi__get8(s); if (color > 6) return stbi__err("bad ctype","Corrupt PNG");
+ if (color == 3) pal_img_n = 3; else if (color & 1) return stbi__err("bad ctype","Corrupt PNG");
+ comp = stbi__get8(s); if (comp) return stbi__err("bad comp method","Corrupt PNG");
+ filter= stbi__get8(s); if (filter) return stbi__err("bad filter method","Corrupt PNG");
+ interlace = stbi__get8(s); if (interlace>1) return stbi__err("bad interlace method","Corrupt PNG");
+ if (!s->img_x || !s->img_y) return stbi__err("0-pixel image","Corrupt PNG");
+ if (!pal_img_n) {
+ s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0);
+ if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode");
+ if (scan == STBI__SCAN_header) return 1;
+ } else {
+ // if paletted, then pal_n is our final components, and
+ // img_n is # components to decompress/filter.
+ s->img_n = 1;
+ if ((1 << 30) / s->img_x / 4 < s->img_y) return stbi__err("too large","Corrupt PNG");
+ // if SCAN_header, have to scan to see if we have a tRNS
+ }
+ break;
+ }
+
+ case STBI__PNG_TYPE('P','L','T','E'): {
+ if (first) return stbi__err("first not IHDR", "Corrupt PNG");
+ if (c.length > 256*3) return stbi__err("invalid PLTE","Corrupt PNG");
+ pal_len = c.length / 3;
+ if (pal_len * 3 != c.length) return stbi__err("invalid PLTE","Corrupt PNG");
+ for (i=0; i < pal_len; ++i) {
+ palette[i*4+0] = stbi__get8(s);
+ palette[i*4+1] = stbi__get8(s);
+ palette[i*4+2] = stbi__get8(s);
+ palette[i*4+3] = 255;
+ }
+ break;
+ }
+
+ case STBI__PNG_TYPE('t','R','N','S'): {
+ if (first) return stbi__err("first not IHDR", "Corrupt PNG");
+ if (z->idata) return stbi__err("tRNS after IDAT","Corrupt PNG");
+ if (pal_img_n) {
+ if (scan == STBI__SCAN_header) { s->img_n = 4; return 1; }
+ if (pal_len == 0) return stbi__err("tRNS before PLTE","Corrupt PNG");
+ if (c.length > pal_len) return stbi__err("bad tRNS len","Corrupt PNG");
+ pal_img_n = 4;
+ for (i=0; i < c.length; ++i)
+ palette[i*4+3] = stbi__get8(s);
+ } else {
+ if (!(s->img_n & 1)) return stbi__err("tRNS with alpha","Corrupt PNG");
+ if (c.length != (stbi__uint32) s->img_n*2) return stbi__err("bad tRNS len","Corrupt PNG");
+ has_trans = 1;
+ for (k=0; k < s->img_n; ++k)
+ tc[k] = (stbi_uc) (stbi__get16be(s) & 255) * stbi__depth_scale_table[depth]; // non 8-bit images will be larger
+ }
+ break;
+ }
+
+ case STBI__PNG_TYPE('I','D','A','T'): {
+ if (first) return stbi__err("first not IHDR", "Corrupt PNG");
+ if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG");
+ if (scan == STBI__SCAN_header) { s->img_n = pal_img_n; return 1; }
+ if (ioff + c.length > idata_limit) {
+ stbi_uc *p;
+ if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096;
+ while (ioff + c.length > idata_limit)
+ idata_limit *= 2;
+ p = (stbi_uc *) STBI_REALLOC(z->idata, idata_limit); if (p == NULL) return stbi__err("outofmem", "Out of memory");
+ z->idata = p;
+ }
+ if (!stbi__getn(s, z->idata+ioff,c.length)) return stbi__err("outofdata","Corrupt PNG");
+ ioff += c.length;
+ break;
+ }
+
+ case STBI__PNG_TYPE('I','E','N','D'): {
+ stbi__uint32 raw_len, bpl;
+ if (first) return stbi__err("first not IHDR", "Corrupt PNG");
+ if (scan != STBI__SCAN_load) return 1;
+ if (z->idata == NULL) return stbi__err("no IDAT","Corrupt PNG");
+ // initial guess for decoded data size to avoid unnecessary reallocs
+ bpl = (s->img_x * depth + 7) / 8; // bytes per line, per component
+ raw_len = bpl * s->img_y * s->img_n /* pixels */ + s->img_y /* filter mode per row */;
+ z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, !is_iphone);
+ if (z->expanded == NULL) return 0; // zlib should set error
+ STBI_FREE(z->idata); z->idata = NULL;
+ if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans)
+ s->img_out_n = s->img_n+1;
+ else
+ s->img_out_n = s->img_n;
+ if (!stbi__create_png_image(z, z->expanded, raw_len, s->img_out_n, depth, color, interlace)) return 0;
+ if (has_trans)
+ if (!stbi__compute_transparency(z, tc, s->img_out_n)) return 0;
+ if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2)
+ stbi__de_iphone(z);
+ if (pal_img_n) {
+ // pal_img_n == 3 or 4
+ s->img_n = pal_img_n; // record the actual colors we had
+ s->img_out_n = pal_img_n;
+ if (req_comp >= 3) s->img_out_n = req_comp;
+ if (!stbi__expand_png_palette(z, palette, pal_len, s->img_out_n))
+ return 0;
+ }
+ STBI_FREE(z->expanded); z->expanded = NULL;
+ return 1;
+ }
+
+ default:
+ // if critical, fail
+ if (first) return stbi__err("first not IHDR", "Corrupt PNG");
+ if ((c.type & (1 << 29)) == 0) {
+ #ifndef STBI_NO_FAILURE_STRINGS
+ // not threadsafe
+ static char invalid_chunk[] = "XXXX PNG chunk not known";
+ invalid_chunk[0] = STBI__BYTECAST(c.type >> 24);
+ invalid_chunk[1] = STBI__BYTECAST(c.type >> 16);
+ invalid_chunk[2] = STBI__BYTECAST(c.type >> 8);
+ invalid_chunk[3] = STBI__BYTECAST(c.type >> 0);
+ #endif
+ return stbi__err(invalid_chunk, "PNG not supported: unknown PNG chunk type");
+ }
+ stbi__skip(s, c.length);
+ break;
+ }
+ // end of PNG chunk, read and skip CRC
+ stbi__get32be(s);
+ }
+}
+
+static unsigned char *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req_comp)
+{
+ unsigned char *result=NULL;
+ if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error");
+ if (stbi__parse_png_file(p, STBI__SCAN_load, req_comp)) {
+ result = p->out;
+ p->out = NULL;
+ if (req_comp && req_comp != p->s->img_out_n) {
+ result = stbi__convert_format(result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y);
+ p->s->img_out_n = req_comp;
+ if (result == NULL) return result;
+ }
+ *x = p->s->img_x;
+ *y = p->s->img_y;
+ if (n) *n = p->s->img_out_n;
+ }
+ STBI_FREE(p->out); p->out = NULL;
+ STBI_FREE(p->expanded); p->expanded = NULL;
+ STBI_FREE(p->idata); p->idata = NULL;
+
+ return result;
+}
+
+static unsigned char *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)
+{
+ stbi__png p;
+ p.s = s;
+ return stbi__do_png(&p, x,y,comp,req_comp);
+}
+
+static int stbi__png_test(stbi__context *s)
+{
+ int r;
+ r = stbi__check_png_header(s);
+ stbi__rewind(s);
+ return r;
+}
+
+static int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp)
+{
+ if (!stbi__parse_png_file(p, STBI__SCAN_header, 0)) {
+ stbi__rewind( p->s );
+ return 0;
+ }
+ if (x) *x = p->s->img_x;
+ if (y) *y = p->s->img_y;
+ if (comp) *comp = p->s->img_n;
+ return 1;
+}
+
+static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp)
+{
+ stbi__png p;
+ p.s = s;
+ return stbi__png_info_raw(&p, x, y, comp);
+}
+#endif
+
+// Microsoft/Windows BMP image
+
+#ifndef STBI_NO_BMP
+static int stbi__bmp_test_raw(stbi__context *s)
+{
+ int r;
+ int sz;
+ if (stbi__get8(s) != 'B') return 0;
+ if (stbi__get8(s) != 'M') return 0;
+ stbi__get32le(s); // discard filesize
+ stbi__get16le(s); // discard reserved
+ stbi__get16le(s); // discard reserved
+ stbi__get32le(s); // discard data offset
+ sz = stbi__get32le(s);
+ r = (sz == 12 || sz == 40 || sz == 56 || sz == 108 || sz == 124);
+ return r;
+}
+
+static int stbi__bmp_test(stbi__context *s)
+{
+ int r = stbi__bmp_test_raw(s);
+ stbi__rewind(s);
+ return r;
+}
+
+
+// returns 0..31 for the highest set bit
+static int stbi__high_bit(unsigned int z)
+{
+ int n=0;
+ if (z == 0) return -1;
+ if (z >= 0x10000) n += 16, z >>= 16;
+ if (z >= 0x00100) n += 8, z >>= 8;
+ if (z >= 0x00010) n += 4, z >>= 4;
+ if (z >= 0x00004) n += 2, z >>= 2;
+ if (z >= 0x00002) n += 1, z >>= 1;
+ return n;
+}
+
+static int stbi__bitcount(unsigned int a)
+{
+ a = (a & 0x55555555) + ((a >> 1) & 0x55555555); // max 2
+ a = (a & 0x33333333) + ((a >> 2) & 0x33333333); // max 4
+ a = (a + (a >> 4)) & 0x0f0f0f0f; // max 8 per 4, now 8 bits
+ a = (a + (a >> 8)); // max 16 per 8 bits
+ a = (a + (a >> 16)); // max 32 per 8 bits
+ return a & 0xff;
+}
+
+static int stbi__shiftsigned(int v, int shift, int bits)
+{
+ int result;
+ int z=0;
+
+ if (shift < 0) v <<= -shift;
+ else v >>= shift;
+ result = v;
+
+ z = bits;
+ while (z < 8) {
+ result += v >> z;
+ z += bits;
+ }
+ return result;
+}
+
+static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)
+{
+ stbi_uc *out;
+ unsigned int mr=0,mg=0,mb=0,ma=0, fake_a=0;
+ stbi_uc pal[256][4];
+ int psize=0,i,j,compress=0,width;
+ int bpp, flip_vertically, pad, target, offset, hsz;
+ if (stbi__get8(s) != 'B' || stbi__get8(s) != 'M') return stbi__errpuc("not BMP", "Corrupt BMP");
+ stbi__get32le(s); // discard filesize
+ stbi__get16le(s); // discard reserved
+ stbi__get16le(s); // discard reserved
+ offset = stbi__get32le(s);
+ hsz = stbi__get32le(s);
+ if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124) return stbi__errpuc("unknown BMP", "BMP type not supported: unknown");
+ if (hsz == 12) {
+ s->img_x = stbi__get16le(s);
+ s->img_y = stbi__get16le(s);
+ } else {
+ s->img_x = stbi__get32le(s);
+ s->img_y = stbi__get32le(s);
+ }
+ if (stbi__get16le(s) != 1) return stbi__errpuc("bad BMP", "bad BMP");
+ bpp = stbi__get16le(s);
+ if (bpp == 1) return stbi__errpuc("monochrome", "BMP type not supported: 1-bit");
+ flip_vertically = ((int) s->img_y) > 0;
+ s->img_y = abs((int) s->img_y);
+ if (hsz == 12) {
+ if (bpp < 24)
+ psize = (offset - 14 - 24) / 3;
+ } else {
+ compress = stbi__get32le(s);
+ if (compress == 1 || compress == 2) return stbi__errpuc("BMP RLE", "BMP type not supported: RLE");
+ stbi__get32le(s); // discard sizeof
+ stbi__get32le(s); // discard hres
+ stbi__get32le(s); // discard vres
+ stbi__get32le(s); // discard colorsused
+ stbi__get32le(s); // discard max important
+ if (hsz == 40 || hsz == 56) {
+ if (hsz == 56) {
+ stbi__get32le(s);
+ stbi__get32le(s);
+ stbi__get32le(s);
+ stbi__get32le(s);
+ }
+ if (bpp == 16 || bpp == 32) {
+ mr = mg = mb = 0;
+ if (compress == 0) {
+ if (bpp == 32) {
+ mr = 0xffu << 16;
+ mg = 0xffu << 8;
+ mb = 0xffu << 0;
+ ma = 0xffu << 24;
+ fake_a = 1; // @TODO: check for cases like alpha value is all 0 and switch it to 255
+ STBI_NOTUSED(fake_a);
+ } else {
+ mr = 31u << 10;
+ mg = 31u << 5;
+ mb = 31u << 0;
+ }
+ } else if (compress == 3) {
+ mr = stbi__get32le(s);
+ mg = stbi__get32le(s);
+ mb = stbi__get32le(s);
+ // not documented, but generated by photoshop and handled by mspaint
+ if (mr == mg && mg == mb) {
+ // ?!?!?
+ return stbi__errpuc("bad BMP", "bad BMP");
+ }
+ } else
+ return stbi__errpuc("bad BMP", "bad BMP");
+ }
+ } else {
+ STBI_ASSERT(hsz == 108 || hsz == 124);
+ mr = stbi__get32le(s);
+ mg = stbi__get32le(s);
+ mb = stbi__get32le(s);
+ ma = stbi__get32le(s);
+ stbi__get32le(s); // discard color space
+ for (i=0; i < 12; ++i)
+ stbi__get32le(s); // discard color space parameters
+ if (hsz == 124) {
+ stbi__get32le(s); // discard rendering intent
+ stbi__get32le(s); // discard offset of profile data
+ stbi__get32le(s); // discard size of profile data
+ stbi__get32le(s); // discard reserved
+ }
+ }
+ if (bpp < 16)
+ psize = (offset - 14 - hsz) >> 2;
+ }
+ s->img_n = ma ? 4 : 3;
+ if (req_comp && req_comp >= 3) // we can directly decode 3 or 4
+ target = req_comp;
+ else
+ target = s->img_n; // if they want monochrome, we'll post-convert
+ out = (stbi_uc *) stbi__malloc(target * s->img_x * s->img_y);
+ if (!out) return stbi__errpuc("outofmem", "Out of memory");
+ if (bpp < 16) {
+ int z=0;
+ if (psize == 0 || psize > 256) { STBI_FREE(out); return stbi__errpuc("invalid", "Corrupt BMP"); }
+ for (i=0; i < psize; ++i) {
+ pal[i][2] = stbi__get8(s);
+ pal[i][1] = stbi__get8(s);
+ pal[i][0] = stbi__get8(s);
+ if (hsz != 12) stbi__get8(s);
+ pal[i][3] = 255;
+ }
+ stbi__skip(s, offset - 14 - hsz - psize * (hsz == 12 ? 3 : 4));
+ if (bpp == 4) width = (s->img_x + 1) >> 1;
+ else if (bpp == 8) width = s->img_x;
+ else { STBI_FREE(out); return stbi__errpuc("bad bpp", "Corrupt BMP"); }
+ pad = (-width)&3;
+ for (j=0; j < (int) s->img_y; ++j) {
+ for (i=0; i < (int) s->img_x; i += 2) {
+ int v=stbi__get8(s),v2=0;
+ if (bpp == 4) {
+ v2 = v & 15;
+ v >>= 4;
+ }
+ out[z++] = pal[v][0];
+ out[z++] = pal[v][1];
+ out[z++] = pal[v][2];
+ if (target == 4) out[z++] = 255;
+ if (i+1 == (int) s->img_x) break;
+ v = (bpp == 8) ? stbi__get8(s) : v2;
+ out[z++] = pal[v][0];
+ out[z++] = pal[v][1];
+ out[z++] = pal[v][2];
+ if (target == 4) out[z++] = 255;
+ }
+ stbi__skip(s, pad);
+ }
+ } else {
+ int rshift=0,gshift=0,bshift=0,ashift=0,rcount=0,gcount=0,bcount=0,acount=0;
+ int z = 0;
+ int easy=0;
+ stbi__skip(s, offset - 14 - hsz);
+ if (bpp == 24) width = 3 * s->img_x;
+ else if (bpp == 16) width = 2*s->img_x;
+ else /* bpp = 32 and pad = 0 */ width=0;
+ pad = (-width) & 3;
+ if (bpp == 24) {
+ easy = 1;
+ } else if (bpp == 32) {
+ if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 && ma == 0xff000000)
+ easy = 2;
+ }
+ if (!easy) {
+ if (!mr || !mg || !mb) { STBI_FREE(out); return stbi__errpuc("bad masks", "Corrupt BMP"); }
+ // right shift amt to put high bit in position #7
+ rshift = stbi__high_bit(mr)-7; rcount = stbi__bitcount(mr);
+ gshift = stbi__high_bit(mg)-7; gcount = stbi__bitcount(mg);
+ bshift = stbi__high_bit(mb)-7; bcount = stbi__bitcount(mb);
+ ashift = stbi__high_bit(ma)-7; acount = stbi__bitcount(ma);
+ }
+ for (j=0; j < (int) s->img_y; ++j) {
+ if (easy) {
+ for (i=0; i < (int) s->img_x; ++i) {
+ unsigned char a;
+ out[z+2] = stbi__get8(s);
+ out[z+1] = stbi__get8(s);
+ out[z+0] = stbi__get8(s);
+ z += 3;
+ a = (easy == 2 ? stbi__get8(s) : 255);
+ if (target == 4) out[z++] = a;
+ }
+ } else {
+ for (i=0; i < (int) s->img_x; ++i) {
+ stbi__uint32 v = (stbi__uint32) (bpp == 16 ? stbi__get16le(s) : stbi__get32le(s));
+ int a;
+ out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mr, rshift, rcount));
+ out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mg, gshift, gcount));
+ out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mb, bshift, bcount));
+ a = (ma ? stbi__shiftsigned(v & ma, ashift, acount) : 255);
+ if (target == 4) out[z++] = STBI__BYTECAST(a);
+ }
+ }
+ stbi__skip(s, pad);
+ }
+ }
+ if (flip_vertically) {
+ stbi_uc t;
+ for (j=0; j < (int) s->img_y>>1; ++j) {
+ stbi_uc *p1 = out + j *s->img_x*target;
+ stbi_uc *p2 = out + (s->img_y-1-j)*s->img_x*target;
+ for (i=0; i < (int) s->img_x*target; ++i) {
+ t = p1[i], p1[i] = p2[i], p2[i] = t;
+ }
+ }
+ }
+
+ if (req_comp && req_comp != target) {
+ out = stbi__convert_format(out, target, req_comp, s->img_x, s->img_y);
+ if (out == NULL) return out; // stbi__convert_format frees input on failure
+ }
+
+ *x = s->img_x;
+ *y = s->img_y;
+ if (comp) *comp = s->img_n;
+ return out;
+}
+#endif
+
+// Targa Truevision - TGA
+// by Jonathan Dummer
+#ifndef STBI_NO_TGA
+static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp)
+{
+ int tga_w, tga_h, tga_comp;
+ int sz;
+ stbi__get8(s); // discard Offset
+ sz = stbi__get8(s); // color type
+ if( sz > 1 ) {
+ stbi__rewind(s);
+ return 0; // only RGB or indexed allowed
+ }
+ sz = stbi__get8(s); // image type
+ // only RGB or grey allowed, +/- RLE
+ if ((sz != 1) && (sz != 2) && (sz != 3) && (sz != 9) && (sz != 10) && (sz != 11)) return 0;
+ stbi__skip(s,9);
+ tga_w = stbi__get16le(s);
+ if( tga_w < 1 ) {
+ stbi__rewind(s);
+ return 0; // test width
+ }
+ tga_h = stbi__get16le(s);
+ if( tga_h < 1 ) {
+ stbi__rewind(s);
+ return 0; // test height
+ }
+ sz = stbi__get8(s); // bits per pixel
+ // only RGB or RGBA or grey allowed
+ if ((sz != 8) && (sz != 16) && (sz != 24) && (sz != 32)) {
+ stbi__rewind(s);
+ return 0;
+ }
+ tga_comp = sz;
+ if (x) *x = tga_w;
+ if (y) *y = tga_h;
+ if (comp) *comp = tga_comp / 8;
+ return 1; // seems to have passed everything
+}
+
+static int stbi__tga_test(stbi__context *s)
+{
+ int res;
+ int sz;
+ stbi__get8(s); // discard Offset
+ sz = stbi__get8(s); // color type
+ if ( sz > 1 ) return 0; // only RGB or indexed allowed
+ sz = stbi__get8(s); // image type
+ if ( (sz != 1) && (sz != 2) && (sz != 3) && (sz != 9) && (sz != 10) && (sz != 11) ) return 0; // only RGB or grey allowed, +/- RLE
+ stbi__get16be(s); // discard palette start
+ stbi__get16be(s); // discard palette length
+ stbi__get8(s); // discard bits per palette color entry
+ stbi__get16be(s); // discard x origin
+ stbi__get16be(s); // discard y origin
+ if ( stbi__get16be(s) < 1 ) return 0; // test width
+ if ( stbi__get16be(s) < 1 ) return 0; // test height
+ sz = stbi__get8(s); // bits per pixel
+ if ( (sz != 8) && (sz != 16) && (sz != 24) && (sz != 32) )
+ res = 0;
+ else
+ res = 1;
+ stbi__rewind(s);
+ return res;
+}
+
+static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)
+{
+ // read in the TGA header stuff
+ int tga_offset = stbi__get8(s);
+ int tga_indexed = stbi__get8(s);
+ int tga_image_type = stbi__get8(s);
+ int tga_is_RLE = 0;
+ int tga_palette_start = stbi__get16le(s);
+ int tga_palette_len = stbi__get16le(s);
+ int tga_palette_bits = stbi__get8(s);
+ int tga_x_origin = stbi__get16le(s);
+ int tga_y_origin = stbi__get16le(s);
+ int tga_width = stbi__get16le(s);
+ int tga_height = stbi__get16le(s);
+ int tga_bits_per_pixel = stbi__get8(s);
+ int tga_comp = tga_bits_per_pixel / 8;
+ int tga_inverted = stbi__get8(s);
+ // image data
+ unsigned char *tga_data;
+ unsigned char *tga_palette = NULL;
+ int i, j;
+ unsigned char raw_data[4];
+ int RLE_count = 0;
+ int RLE_repeating = 0;
+ int read_next_pixel = 1;
+
+ // do a tiny bit of precessing
+ if ( tga_image_type >= 8 )
+ {
+ tga_image_type -= 8;
+ tga_is_RLE = 1;
+ }
+ /* int tga_alpha_bits = tga_inverted & 15; */
+ tga_inverted = 1 - ((tga_inverted >> 5) & 1);
+
+ // error check
+ if ( //(tga_indexed) ||
+ (tga_width < 1) || (tga_height < 1) ||
+ (tga_image_type < 1) || (tga_image_type > 3) ||
+ ((tga_bits_per_pixel != 8) && (tga_bits_per_pixel != 16) &&
+ (tga_bits_per_pixel != 24) && (tga_bits_per_pixel != 32))
+ )
+ {
+ return NULL; // we don't report this as a bad TGA because we don't even know if it's TGA
+ }
+
+ // If I'm paletted, then I'll use the number of bits from the palette
+ if ( tga_indexed )
+ {
+ tga_comp = tga_palette_bits / 8;
+ }
+
+ // tga info
+ *x = tga_width;
+ *y = tga_height;
+ if (comp) *comp = tga_comp;
+
+ tga_data = (unsigned char*)stbi__malloc( tga_width * tga_height * tga_comp );
+ if (!tga_data) return stbi__errpuc("outofmem", "Out of memory");
+
+ // skip to the data's starting position (offset usually = 0)
+ stbi__skip(s, tga_offset );
+
+ if ( !tga_indexed && !tga_is_RLE) {
+ for (i=0; i < tga_height; ++i) {
+ int y = tga_inverted ? tga_height -i - 1 : i;
+ stbi_uc *tga_row = tga_data + y*tga_width*tga_comp;
+ stbi__getn(s, tga_row, tga_width * tga_comp);
+ }
+ } else {
+ // do I need to load a palette?
+ if ( tga_indexed)
+ {
+ // any data to skip? (offset usually = 0)
+ stbi__skip(s, tga_palette_start );
+ // load the palette
+ tga_palette = (unsigned char*)stbi__malloc( tga_palette_len * tga_palette_bits / 8 );
+ if (!tga_palette) {
+ STBI_FREE(tga_data);
+ return stbi__errpuc("outofmem", "Out of memory");
+ }
+ if (!stbi__getn(s, tga_palette, tga_palette_len * tga_palette_bits / 8 )) {
+ STBI_FREE(tga_data);
+ STBI_FREE(tga_palette);
+ return stbi__errpuc("bad palette", "Corrupt TGA");
+ }
+ }
+ // load the data
+ for (i=0; i < tga_width * tga_height; ++i)
+ {
+ // if I'm in RLE mode, do I need to get a RLE stbi__pngchunk?
+ if ( tga_is_RLE )
+ {
+ if ( RLE_count == 0 )
+ {
+ // yep, get the next byte as a RLE command
+ int RLE_cmd = stbi__get8(s);
+ RLE_count = 1 + (RLE_cmd & 127);
+ RLE_repeating = RLE_cmd >> 7;
+ read_next_pixel = 1;
+ } else if ( !RLE_repeating )
+ {
+ read_next_pixel = 1;
+ }
+ } else
+ {
+ read_next_pixel = 1;
+ }
+ // OK, if I need to read a pixel, do it now
+ if ( read_next_pixel )
+ {
+ // load however much data we did have
+ if ( tga_indexed )
+ {
+ // read in 1 byte, then perform the lookup
+ int pal_idx = stbi__get8(s);
+ if ( pal_idx >= tga_palette_len )
+ {
+ // invalid index
+ pal_idx = 0;
+ }
+ pal_idx *= tga_bits_per_pixel / 8;
+ for (j = 0; j*8 < tga_bits_per_pixel; ++j)
+ {
+ raw_data[j] = tga_palette[pal_idx+j];
+ }
+ } else
+ {
+ // read in the data raw
+ for (j = 0; j*8 < tga_bits_per_pixel; ++j)
+ {
+ raw_data[j] = stbi__get8(s);
+ }
+ }
+ // clear the reading flag for the next pixel
+ read_next_pixel = 0;
+ } // end of reading a pixel
+
+ // copy data
+ for (j = 0; j < tga_comp; ++j)
+ tga_data[i*tga_comp+j] = raw_data[j];
+
+ // in case we're in RLE mode, keep counting down
+ --RLE_count;
+ }
+ // do I need to invert the image?
+ if ( tga_inverted )
+ {
+ for (j = 0; j*2 < tga_height; ++j)
+ {
+ int index1 = j * tga_width * tga_comp;
+ int index2 = (tga_height - 1 - j) * tga_width * tga_comp;
+ for (i = tga_width * tga_comp; i > 0; --i)
+ {
+ unsigned char temp = tga_data[index1];
+ tga_data[index1] = tga_data[index2];
+ tga_data[index2] = temp;
+ ++index1;
+ ++index2;
+ }
+ }
+ }
+ // clear my palette, if I had one
+ if ( tga_palette != NULL )
+ {
+ STBI_FREE( tga_palette );
+ }
+ }
+
+ // swap RGB
+ if (tga_comp >= 3)
+ {
+ unsigned char* tga_pixel = tga_data;
+ for (i=0; i < tga_width * tga_height; ++i)
+ {
+ unsigned char temp = tga_pixel[0];
+ tga_pixel[0] = tga_pixel[2];
+ tga_pixel[2] = temp;
+ tga_pixel += tga_comp;
+ }
+ }
+
+ // convert to target component count
+ if (req_comp && req_comp != tga_comp)
+ tga_data = stbi__convert_format(tga_data, tga_comp, req_comp, tga_width, tga_height);
+
+ // the things I do to get rid of an error message, and yet keep
+ // Microsoft's C compilers happy... [8^(
+ tga_palette_start = tga_palette_len = tga_palette_bits =
+ tga_x_origin = tga_y_origin = 0;
+ // OK, done
+ return tga_data;
+}
+#endif
+
+// *************************************************************************************************
+// Photoshop PSD loader -- PD by Thatcher Ulrich, integration by Nicolas Schulz, tweaked by STB
+
+#ifndef STBI_NO_PSD
+static int stbi__psd_test(stbi__context *s)
+{
+ int r = (stbi__get32be(s) == 0x38425053);
+ stbi__rewind(s);
+ return r;
+}
+
+static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)
+{
+ int pixelCount;
+ int channelCount, compression;
+ int channel, i, count, len;
+ int w,h;
+ stbi_uc *out;
+
+ // Check identifier
+ if (stbi__get32be(s) != 0x38425053) // "8BPS"
+ return stbi__errpuc("not PSD", "Corrupt PSD image");
+
+ // Check file type version.
+ if (stbi__get16be(s) != 1)
+ return stbi__errpuc("wrong version", "Unsupported version of PSD image");
+
+ // Skip 6 reserved bytes.
+ stbi__skip(s, 6 );
+
+ // Read the number of channels (R, G, B, A, etc).
+ channelCount = stbi__get16be(s);
+ if (channelCount < 0 || channelCount > 16)
+ return stbi__errpuc("wrong channel count", "Unsupported number of channels in PSD image");
+
+ // Read the rows and columns of the image.
+ h = stbi__get32be(s);
+ w = stbi__get32be(s);
+
+ // Make sure the depth is 8 bits.
+ if (stbi__get16be(s) != 8)
+ return stbi__errpuc("unsupported bit depth", "PSD bit depth is not 8 bit");
+
+ // Make sure the color mode is RGB.
+ // Valid options are:
+ // 0: Bitmap
+ // 1: Grayscale
+ // 2: Indexed color
+ // 3: RGB color
+ // 4: CMYK color
+ // 7: Multichannel
+ // 8: Duotone
+ // 9: Lab color
+ if (stbi__get16be(s) != 3)
+ return stbi__errpuc("wrong color format", "PSD is not in RGB color format");
+
+ // Skip the Mode Data. (It's the palette for indexed color; other info for other modes.)
+ stbi__skip(s,stbi__get32be(s) );
+
+ // Skip the image resources. (resolution, pen tool paths, etc)
+ stbi__skip(s, stbi__get32be(s) );
+
+ // Skip the reserved data.
+ stbi__skip(s, stbi__get32be(s) );
+
+ // Find out if the data is compressed.
+ // Known values:
+ // 0: no compression
+ // 1: RLE compressed
+ compression = stbi__get16be(s);
+ if (compression > 1)
+ return stbi__errpuc("bad compression", "PSD has an unknown compression format");
+
+ // Create the destination image.
+ out = (stbi_uc *) stbi__malloc(4 * w*h);
+ if (!out) return stbi__errpuc("outofmem", "Out of memory");
+ pixelCount = w*h;
+
+ // Initialize the data to zero.
+ //memset( out, 0, pixelCount * 4 );
+
+ // Finally, the image data.
+ if (compression) {
+ // RLE as used by .PSD and .TIFF
+ // Loop until you get the number of unpacked bytes you are expecting:
+ // Read the next source byte into n.
+ // If n is between 0 and 127 inclusive, copy the next n+1 bytes literally.
+ // Else if n is between -127 and -1 inclusive, copy the next byte -n+1 times.
+ // Else if n is 128, noop.
+ // Endloop
+
+ // The RLE-compressed data is preceeded by a 2-byte data count for each row in the data,
+ // which we're going to just skip.
+ stbi__skip(s, h * channelCount * 2 );
+
+ // Read the RLE data by channel.
+ for (channel = 0; channel < 4; channel++) {
+ stbi_uc *p;
+
+ p = out+channel;
+ if (channel >= channelCount) {
+ // Fill this channel with default data.
+ for (i = 0; i < pixelCount; i++) *p = (channel == 3 ? 255 : 0), p += 4;
+ } else {
+ // Read the RLE data.
+ count = 0;
+ while (count < pixelCount) {
+ len = stbi__get8(s);
+ if (len == 128) {
+ // No-op.
+ } else if (len < 128) {
+ // Copy next len+1 bytes literally.
+ len++;
+ count += len;
+ while (len) {
+ *p = stbi__get8(s);
+ p += 4;
+ len--;
+ }
+ } else if (len > 128) {
+ stbi_uc val;
+ // Next -len+1 bytes in the dest are replicated from next source byte.
+ // (Interpret len as a negative 8-bit int.)
+ len ^= 0x0FF;
+ len += 2;
+ val = stbi__get8(s);
+ count += len;
+ while (len) {
+ *p = val;
+ p += 4;
+ len--;
+ }
+ }
+ }
+ }
+ }
+
+ } else {
+ // We're at the raw image data. It's each channel in order (Red, Green, Blue, Alpha, ...)
+ // where each channel consists of an 8-bit value for each pixel in the image.
+
+ // Read the data by channel.
+ for (channel = 0; channel < 4; channel++) {
+ stbi_uc *p;
+
+ p = out + channel;
+ if (channel > channelCount) {
+ // Fill this channel with default data.
+ for (i = 0; i < pixelCount; i++) *p = channel == 3 ? 255 : 0, p += 4;
+ } else {
+ // Read the data.
+ for (i = 0; i < pixelCount; i++)
+ *p = stbi__get8(s), p += 4;
+ }
+ }
+ }
+
+ if (req_comp && req_comp != 4) {
+ out = stbi__convert_format(out, 4, req_comp, w, h);
+ if (out == NULL) return out; // stbi__convert_format frees input on failure
+ }
+
+ if (comp) *comp = channelCount;
+ *y = h;
+ *x = w;
+
+ return out;
+}
+#endif
+
+// *************************************************************************************************
+// Softimage PIC loader
+// by Tom Seddon
+//
+// See http://softimage.wiki.softimage.com/index.php/INFO:_PIC_file_format
+// See http://ozviz.wasp.uwa.edu.au/~pbourke/dataformats/softimagepic/
+
+#ifndef STBI_NO_PIC
+static int stbi__pic_is4(stbi__context *s,const char *str)
+{
+ int i;
+ for (i=0; i<4; ++i)
+ if (stbi__get8(s) != (stbi_uc)str[i])
+ return 0;
+
+ return 1;
+}
+
+static int stbi__pic_test_core(stbi__context *s)
+{
+ int i;
+
+ if (!stbi__pic_is4(s,"\x53\x80\xF6\x34"))
+ return 0;
+
+ for(i=0;i<84;++i)
+ stbi__get8(s);
+
+ if (!stbi__pic_is4(s,"PICT"))
+ return 0;
+
+ return 1;
+}
+
+typedef struct
+{
+ stbi_uc size,type,channel;
+} stbi__pic_packet;
+
+static stbi_uc *stbi__readval(stbi__context *s, int channel, stbi_uc *dest)
+{
+ int mask=0x80, i;
+
+ for (i=0; i<4; ++i, mask>>=1) {
+ if (channel & mask) {
+ if (stbi__at_eof(s)) return stbi__errpuc("bad file","PIC file too short");
+ dest[i]=stbi__get8(s);
+ }
+ }
+
+ return dest;
+}
+
+static void stbi__copyval(int channel,stbi_uc *dest,const stbi_uc *src)
+{
+ int mask=0x80,i;
+
+ for (i=0;i<4; ++i, mask>>=1)
+ if (channel&mask)
+ dest[i]=src[i];
+}
+
+static stbi_uc *stbi__pic_load_core(stbi__context *s,int width,int height,int *comp, stbi_uc *result)
+{
+ int act_comp=0,num_packets=0,y,chained;
+ stbi__pic_packet packets[10];
+
+ // this will (should...) cater for even some bizarre stuff like having data
+ // for the same channel in multiple packets.
+ do {
+ stbi__pic_packet *packet;
+
+ if (num_packets==sizeof(packets)/sizeof(packets[0]))
+ return stbi__errpuc("bad format","too many packets");
+
+ packet = &packets[num_packets++];
+
+ chained = stbi__get8(s);
+ packet->size = stbi__get8(s);
+ packet->type = stbi__get8(s);
+ packet->channel = stbi__get8(s);
+
+ act_comp |= packet->channel;
+
+ if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (reading packets)");
+ if (packet->size != 8) return stbi__errpuc("bad format","packet isn't 8bpp");
+ } while (chained);
+
+ *comp = (act_comp & 0x10 ? 4 : 3); // has alpha channel?
+
+ for(y=0; y<height; ++y) {
+ int packet_idx;
+
+ for(packet_idx=0; packet_idx < num_packets; ++packet_idx) {
+ stbi__pic_packet *packet = &packets[packet_idx];
+ stbi_uc *dest = result+y*width*4;
+
+ switch (packet->type) {
+ default:
+ return stbi__errpuc("bad format","packet has bad compression type");
+
+ case 0: {//uncompressed
+ int x;
+
+ for(x=0;x<width;++x, dest+=4)
+ if (!stbi__readval(s,packet->channel,dest))
+ return 0;
+ break;
+ }
+
+ case 1://Pure RLE
+ {
+ int left=width, i;
+
+ while (left>0) {
+ stbi_uc count,value[4];
+
+ count=stbi__get8(s);
+ if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pure read count)");
+
+ if (count > left)
+ count = (stbi_uc) left;
+
+ if (!stbi__readval(s,packet->channel,value)) return 0;
+
+ for(i=0; i<count; ++i,dest+=4)
+ stbi__copyval(packet->channel,dest,value);
+ left -= count;
+ }
+ }
+ break;
+
+ case 2: {//Mixed RLE
+ int left=width;
+ while (left>0) {
+ int count = stbi__get8(s), i;
+ if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (mixed read count)");
+
+ if (count >= 128) { // Repeated
+ stbi_uc value[4];
+ int i;
+
+ if (count==128)
+ count = stbi__get16be(s);
+ else
+ count -= 127;
+ if (count > left)
+ return stbi__errpuc("bad file","scanline overrun");
+
+ if (!stbi__readval(s,packet->channel,value))
+ return 0;
+
+ for(i=0;i<count;++i, dest += 4)
+ stbi__copyval(packet->channel,dest,value);
+ } else { // Raw
+ ++count;
+ if (count>left) return stbi__errpuc("bad file","scanline overrun");
+
+ for(i=0;i<count;++i, dest+=4)
+ if (!stbi__readval(s,packet->channel,dest))
+ return 0;
+ }
+ left-=count;
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ return result;
+}
+
+static stbi_uc *stbi__pic_load(stbi__context *s,int *px,int *py,int *comp,int req_comp)
+{
+ stbi_uc *result;
+ int i, x,y;
+
+ for (i=0; i<92; ++i)
+ stbi__get8(s);
+
+ x = stbi__get16be(s);
+ y = stbi__get16be(s);
+ if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pic header)");
+ if ((1 << 28) / x < y) return stbi__errpuc("too large", "Image too large to decode");
+
+ stbi__get32be(s); //skip `ratio'
+ stbi__get16be(s); //skip `fields'
+ stbi__get16be(s); //skip `pad'
+
+ // intermediate buffer is RGBA
+ result = (stbi_uc *) stbi__malloc(x*y*4);
+ memset(result, 0xff, x*y*4);
+
+ if (!stbi__pic_load_core(s,x,y,comp, result)) {
+ STBI_FREE(result);
+ result=0;
+ }
+ *px = x;
+ *py = y;
+ if (req_comp == 0) req_comp = *comp;
+ result=stbi__convert_format(result,4,req_comp,x,y);
+
+ return result;
+}
+
+static int stbi__pic_test(stbi__context *s)
+{
+ int r = stbi__pic_test_core(s);
+ stbi__rewind(s);
+ return r;
+}
+#endif
+
+// *************************************************************************************************
+// GIF loader -- public domain by Jean-Marc Lienher -- simplified/shrunk by stb
+
+#ifndef STBI_NO_GIF
+typedef struct
+{
+ stbi__int16 prefix;
+ stbi_uc first;
+ stbi_uc suffix;
+} stbi__gif_lzw;
+
+typedef struct
+{
+ int w,h;
+ stbi_uc *out; // output buffer (always 4 components)
+ int flags, bgindex, ratio, transparent, eflags;
+ stbi_uc pal[256][4];
+ stbi_uc lpal[256][4];
+ stbi__gif_lzw codes[4096];
+ stbi_uc *color_table;
+ int parse, step;
+ int lflags;
+ int start_x, start_y;
+ int max_x, max_y;
+ int cur_x, cur_y;
+ int line_size;
+} stbi__gif;
+
+static int stbi__gif_test_raw(stbi__context *s)
+{
+ int sz;
+ if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') return 0;
+ sz = stbi__get8(s);
+ if (sz != '9' && sz != '7') return 0;
+ if (stbi__get8(s) != 'a') return 0;
+ return 1;
+}
+
+static int stbi__gif_test(stbi__context *s)
+{
+ int r = stbi__gif_test_raw(s);
+ stbi__rewind(s);
+ return r;
+}
+
+static void stbi__gif_parse_colortable(stbi__context *s, stbi_uc pal[256][4], int num_entries, int transp)
+{
+ int i;
+ for (i=0; i < num_entries; ++i) {
+ pal[i][2] = stbi__get8(s);
+ pal[i][1] = stbi__get8(s);
+ pal[i][0] = stbi__get8(s);
+ pal[i][3] = transp == i ? 0 : 255;
+ }
+}
+
+static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_info)
+{
+ stbi_uc version;
+ if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8')
+ return stbi__err("not GIF", "Corrupt GIF");
+
+ version = stbi__get8(s);
+ if (version != '7' && version != '9') return stbi__err("not GIF", "Corrupt GIF");
+ if (stbi__get8(s) != 'a') return stbi__err("not GIF", "Corrupt GIF");
+
+ stbi__g_failure_reason = "";
+ g->w = stbi__get16le(s);
+ g->h = stbi__get16le(s);
+ g->flags = stbi__get8(s);
+ g->bgindex = stbi__get8(s);
+ g->ratio = stbi__get8(s);
+ g->transparent = -1;
+
+ if (comp != 0) *comp = 4; // can't actually tell whether it's 3 or 4 until we parse the comments
+
+ if (is_info) return 1;
+
+ if (g->flags & 0x80)
+ stbi__gif_parse_colortable(s,g->pal, 2 << (g->flags & 7), -1);
+
+ return 1;
+}
+
+static int stbi__gif_info_raw(stbi__context *s, int *x, int *y, int *comp)
+{
+ stbi__gif g;
+ if (!stbi__gif_header(s, &g, comp, 1)) {
+ stbi__rewind( s );
+ return 0;
+ }
+ if (x) *x = g.w;
+ if (y) *y = g.h;
+ return 1;
+}
+
+static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code)
+{
+ stbi_uc *p, *c;
+
+ // recurse to decode the prefixes, since the linked-list is backwards,
+ // and working backwards through an interleaved image would be nasty
+ if (g->codes[code].prefix >= 0)
+ stbi__out_gif_code(g, g->codes[code].prefix);
+
+ if (g->cur_y >= g->max_y) return;
+
+ p = &g->out[g->cur_x + g->cur_y];
+ c = &g->color_table[g->codes[code].suffix * 4];
+
+ if (c[3] >= 128) {
+ p[0] = c[2];
+ p[1] = c[1];
+ p[2] = c[0];
+ p[3] = c[3];
+ }
+ g->cur_x += 4;
+
+ if (g->cur_x >= g->max_x) {
+ g->cur_x = g->start_x;
+ g->cur_y += g->step;
+
+ while (g->cur_y >= g->max_y && g->parse > 0) {
+ g->step = (1 << g->parse) * g->line_size;
+ g->cur_y = g->start_y + (g->step >> 1);
+ --g->parse;
+ }
+ }
+}
+
+static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g)
+{
+ stbi_uc lzw_cs;
+ stbi__int32 len, code;
+ stbi__uint32 first;
+ stbi__int32 codesize, codemask, avail, oldcode, bits, valid_bits, clear;
+ stbi__gif_lzw *p;
+
+ lzw_cs = stbi__get8(s);
+ clear = 1 << lzw_cs;
+ first = 1;
+ codesize = lzw_cs + 1;
+ codemask = (1 << codesize) - 1;
+ bits = 0;
+ valid_bits = 0;
+ for (code = 0; code < clear; code++) {
+ g->codes[code].prefix = -1;
+ g->codes[code].first = (stbi_uc) code;
+ g->codes[code].suffix = (stbi_uc) code;
+ }
+
+ // support no starting clear code
+ avail = clear+2;
+ oldcode = -1;
+
+ len = 0;
+ for(;;) {
+ if (valid_bits < codesize) {
+ if (len == 0) {
+ len = stbi__get8(s); // start new block
+ if (len == 0)
+ return g->out;
+ }
+ --len;
+ bits |= (stbi__int32) stbi__get8(s) << valid_bits;
+ valid_bits += 8;
+ } else {
+ stbi__int32 code = bits & codemask;
+ bits >>= codesize;
+ valid_bits -= codesize;
+ // @OPTIMIZE: is there some way we can accelerate the non-clear path?
+ if (code == clear) { // clear code
+ codesize = lzw_cs + 1;
+ codemask = (1 << codesize) - 1;
+ avail = clear + 2;
+ oldcode = -1;
+ first = 0;
+ } else if (code == clear + 1) { // end of stream code
+ stbi__skip(s, len);
+ while ((len = stbi__get8(s)) > 0)
+ stbi__skip(s,len);
+ return g->out;
+ } else if (code <= avail) {
+ if (first) return stbi__errpuc("no clear code", "Corrupt GIF");
+
+ if (oldcode >= 0) {
+ p = &g->codes[avail++];
+ if (avail > 4096) return stbi__errpuc("too many codes", "Corrupt GIF");
+ p->prefix = (stbi__int16) oldcode;
+ p->first = g->codes[oldcode].first;
+ p->suffix = (code == avail) ? p->first : g->codes[code].first;
+ } else if (code == avail)
+ return stbi__errpuc("illegal code in raster", "Corrupt GIF");
+
+ stbi__out_gif_code(g, (stbi__uint16) code);
+
+ if ((avail & codemask) == 0 && avail <= 0x0FFF) {
+ codesize++;
+ codemask = (1 << codesize) - 1;
+ }
+
+ oldcode = code;
+ } else {
+ return stbi__errpuc("illegal code in raster", "Corrupt GIF");
+ }
+ }
+ }
+}
+
+static void stbi__fill_gif_background(stbi__gif *g)
+{
+ int i;
+ stbi_uc *c = g->pal[g->bgindex];
+ // @OPTIMIZE: write a dword at a time
+ for (i = 0; i < g->w * g->h * 4; i += 4) {
+ stbi_uc *p = &g->out[i];
+ p[0] = c[2];
+ p[1] = c[1];
+ p[2] = c[0];
+ p[3] = c[3];
+ }
+}
+
+// this function is designed to support animated gifs, although stb_image doesn't support it
+static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, int req_comp)
+{
+ int i;
+ stbi_uc *old_out = 0;
+
+ if (g->out == 0) {
+ if (!stbi__gif_header(s, g, comp,0)) return 0; // stbi__g_failure_reason set by stbi__gif_header
+ g->out = (stbi_uc *) stbi__malloc(4 * g->w * g->h);
+ if (g->out == 0) return stbi__errpuc("outofmem", "Out of memory");
+ stbi__fill_gif_background(g);
+ } else {
+ // animated-gif-only path
+ if (((g->eflags & 0x1C) >> 2) == 3) {
+ old_out = g->out;
+ g->out = (stbi_uc *) stbi__malloc(4 * g->w * g->h);
+ if (g->out == 0) return stbi__errpuc("outofmem", "Out of memory");
+ memcpy(g->out, old_out, g->w*g->h*4);
+ }
+ }
+
+ for (;;) {
+ switch (stbi__get8(s)) {
+ case 0x2C: /* Image Descriptor */
+ {
+ stbi__int32 x, y, w, h;
+ stbi_uc *o;
+
+ x = stbi__get16le(s);
+ y = stbi__get16le(s);
+ w = stbi__get16le(s);
+ h = stbi__get16le(s);
+ if (((x + w) > (g->w)) || ((y + h) > (g->h)))
+ return stbi__errpuc("bad Image Descriptor", "Corrupt GIF");
+
+ g->line_size = g->w * 4;
+ g->start_x = x * 4;
+ g->start_y = y * g->line_size;
+ g->max_x = g->start_x + w * 4;
+ g->max_y = g->start_y + h * g->line_size;
+ g->cur_x = g->start_x;
+ g->cur_y = g->start_y;
+
+ g->lflags = stbi__get8(s);
+
+ if (g->lflags & 0x40) {
+ g->step = 8 * g->line_size; // first interlaced spacing
+ g->parse = 3;
+ } else {
+ g->step = g->line_size;
+ g->parse = 0;
+ }
+
+ if (g->lflags & 0x80) {
+ stbi__gif_parse_colortable(s,g->lpal, 2 << (g->lflags & 7), g->eflags & 0x01 ? g->transparent : -1);
+ g->color_table = (stbi_uc *) g->lpal;
+ } else if (g->flags & 0x80) {
+ for (i=0; i < 256; ++i) // @OPTIMIZE: stbi__jpeg_reset only the previous transparent
+ g->pal[i][3] = 255;
+ if (g->transparent >= 0 && (g->eflags & 0x01))
+ g->pal[g->transparent][3] = 0;
+ g->color_table = (stbi_uc *) g->pal;
+ } else
+ return stbi__errpuc("missing color table", "Corrupt GIF");
+
+ o = stbi__process_gif_raster(s, g);
+ if (o == NULL) return NULL;
+
+ if (req_comp && req_comp != 4)
+ o = stbi__convert_format(o, 4, req_comp, g->w, g->h);
+ return o;
+ }
+
+ case 0x21: // Comment Extension.
+ {
+ int len;
+ if (stbi__get8(s) == 0xF9) { // Graphic Control Extension.
+ len = stbi__get8(s);
+ if (len == 4) {
+ g->eflags = stbi__get8(s);
+ stbi__get16le(s); // delay
+ g->transparent = stbi__get8(s);
+ } else {
+ stbi__skip(s, len);
+ break;
+ }
+ }
+ while ((len = stbi__get8(s)) != 0)
+ stbi__skip(s, len);
+ break;
+ }
+
+ case 0x3B: // gif stream termination code
+ return (stbi_uc *) s; // using '1' causes warning on some compilers
+
+ default:
+ return stbi__errpuc("unknown code", "Corrupt GIF");
+ }
+ }
+}
+
+static stbi_uc *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)
+{
+ stbi_uc *u = 0;
+ stbi__gif g;
+ memset(&g, 0, sizeof(g));
+
+ u = stbi__gif_load_next(s, &g, comp, req_comp);
+ if (u == (stbi_uc *) s) u = 0; // end of animated gif marker
+ if (u) {
+ *x = g.w;
+ *y = g.h;
+ }
+
+ return u;
+}
+
+static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp)
+{
+ return stbi__gif_info_raw(s,x,y,comp);
+}
+#endif
+
+// *************************************************************************************************
+// Radiance RGBE HDR loader
+// originally by Nicolas Schulz
+#ifndef STBI_NO_HDR
+static int stbi__hdr_test_core(stbi__context *s)
+{
+ const char *signature = "#?RADIANCE\n";
+ int i;
+ for (i=0; signature[i]; ++i)
+ if (stbi__get8(s) != signature[i])
+ return 0;
+ return 1;
+}
+
+static int stbi__hdr_test(stbi__context* s)
+{
+ int r = stbi__hdr_test_core(s);
+ stbi__rewind(s);
+ return r;
+}
+
+#define STBI__HDR_BUFLEN 1024
+static char *stbi__hdr_gettoken(stbi__context *z, char *buffer)
+{
+ int len=0;
+ char c = '\0';
+
+ c = (char) stbi__get8(z);
+
+ while (!stbi__at_eof(z) && c != '\n') {
+ buffer[len++] = c;
+ if (len == STBI__HDR_BUFLEN-1) {
+ // flush to end of line
+ while (!stbi__at_eof(z) && stbi__get8(z) != '\n')
+ ;
+ break;
+ }
+ c = (char) stbi__get8(z);
+ }
+
+ buffer[len] = 0;
+ return buffer;
+}
+
+static void stbi__hdr_convert(float *output, stbi_uc *input, int req_comp)
+{
+ if ( input[3] != 0 ) {
+ float f1;
+ // Exponent
+ f1 = (float) ldexp(1.0f, input[3] - (int)(128 + 8));
+ if (req_comp <= 2)
+ output[0] = (input[0] + input[1] + input[2]) * f1 / 3;
+ else {
+ output[0] = input[0] * f1;
+ output[1] = input[1] * f1;
+ output[2] = input[2] * f1;
+ }
+ if (req_comp == 2) output[1] = 1;
+ if (req_comp == 4) output[3] = 1;
+ } else {
+ switch (req_comp) {
+ case 4: output[3] = 1; /* fallthrough */
+ case 3: output[0] = output[1] = output[2] = 0;
+ break;
+ case 2: output[1] = 1; /* fallthrough */
+ case 1: output[0] = 0;
+ break;
+ }
+ }
+}
+
+static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)
+{
+ char buffer[STBI__HDR_BUFLEN];
+ char *token;
+ int valid = 0;
+ int width, height;
+ stbi_uc *scanline;
+ float *hdr_data;
+ int len;
+ unsigned char count, value;
+ int i, j, k, c1,c2, z;
+
+
+ // Check identifier
+ if (strcmp(stbi__hdr_gettoken(s,buffer), "#?RADIANCE") != 0)
+ return stbi__errpf("not HDR", "Corrupt HDR image");
+
+ // Parse header
+ for(;;) {
+ token = stbi__hdr_gettoken(s,buffer);
+ if (token[0] == 0) break;
+ if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1;
+ }
+
+ if (!valid) return stbi__errpf("unsupported format", "Unsupported HDR format");
+
+ // Parse width and height
+ // can't use sscanf() if we're not using stdio!
+ token = stbi__hdr_gettoken(s,buffer);
+ if (strncmp(token, "-Y ", 3)) return stbi__errpf("unsupported data layout", "Unsupported HDR format");
+ token += 3;
+ height = (int) strtol(token, &token, 10);
+ while (*token == ' ') ++token;
+ if (strncmp(token, "+X ", 3)) return stbi__errpf("unsupported data layout", "Unsupported HDR format");
+ token += 3;
+ width = (int) strtol(token, NULL, 10);
+
+ *x = width;
+ *y = height;
+
+ if (comp) *comp = 3;
+ if (req_comp == 0) req_comp = 3;
+
+ // Read data
+ hdr_data = (float *) stbi__malloc(height * width * req_comp * sizeof(float));
+
+ // Load image data
+ // image data is stored as some number of sca
+ if ( width < 8 || width >= 32768) {
+ // Read flat data
+ for (j=0; j < height; ++j) {
+ for (i=0; i < width; ++i) {
+ stbi_uc rgbe[4];
+ main_decode_loop:
+ stbi__getn(s, rgbe, 4);
+ stbi__hdr_convert(hdr_data + j * width * req_comp + i * req_comp, rgbe, req_comp);
+ }
+ }
+ } else {
+ // Read RLE-encoded data
+ scanline = NULL;
+
+ for (j = 0; j < height; ++j) {
+ c1 = stbi__get8(s);
+ c2 = stbi__get8(s);
+ len = stbi__get8(s);
+ if (c1 != 2 || c2 != 2 || (len & 0x80)) {
+ // not run-length encoded, so we have to actually use THIS data as a decoded
+ // pixel (note this can't be a valid pixel--one of RGB must be >= 128)
+ stbi_uc rgbe[4];
+ rgbe[0] = (stbi_uc) c1;
+ rgbe[1] = (stbi_uc) c2;
+ rgbe[2] = (stbi_uc) len;
+ rgbe[3] = (stbi_uc) stbi__get8(s);
+ stbi__hdr_convert(hdr_data, rgbe, req_comp);
+ i = 1;
+ j = 0;
+ STBI_FREE(scanline);
+ goto main_decode_loop; // yes, this makes no sense
+ }
+ len <<= 8;
+ len |= stbi__get8(s);
+ if (len != width) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("invalid decoded scanline length", "corrupt HDR"); }
+ if (scanline == NULL) scanline = (stbi_uc *) stbi__malloc(width * 4);
+
+ for (k = 0; k < 4; ++k) {
+ i = 0;
+ while (i < width) {
+ count = stbi__get8(s);
+ if (count > 128) {
+ // Run
+ value = stbi__get8(s);
+ count -= 128;
+ for (z = 0; z < count; ++z)
+ scanline[i++ * 4 + k] = value;
+ } else {
+ // Dump
+ for (z = 0; z < count; ++z)
+ scanline[i++ * 4 + k] = stbi__get8(s);
+ }
+ }
+ }
+ for (i=0; i < width; ++i)
+ stbi__hdr_convert(hdr_data+(j*width + i)*req_comp, scanline + i*4, req_comp);
+ }
+ STBI_FREE(scanline);
+ }
+
+ return hdr_data;
+}
+
+static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp)
+{
+ char buffer[STBI__HDR_BUFLEN];
+ char *token;
+ int valid = 0;
+
+ if (strcmp(stbi__hdr_gettoken(s,buffer), "#?RADIANCE") != 0) {
+ stbi__rewind( s );
+ return 0;
+ }
+
+ for(;;) {
+ token = stbi__hdr_gettoken(s,buffer);
+ if (token[0] == 0) break;
+ if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1;
+ }
+
+ if (!valid) {
+ stbi__rewind( s );
+ return 0;
+ }
+ token = stbi__hdr_gettoken(s,buffer);
+ if (strncmp(token, "-Y ", 3)) {
+ stbi__rewind( s );
+ return 0;
+ }
+ token += 3;
+ *y = (int) strtol(token, &token, 10);
+ while (*token == ' ') ++token;
+ if (strncmp(token, "+X ", 3)) {
+ stbi__rewind( s );
+ return 0;
+ }
+ token += 3;
+ *x = (int) strtol(token, NULL, 10);
+ *comp = 3;
+ return 1;
+}
+#endif // STBI_NO_HDR
+
+#ifndef STBI_NO_BMP
+static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp)
+{
+ int hsz;
+ if (stbi__get8(s) != 'B' || stbi__get8(s) != 'M') {
+ stbi__rewind( s );
+ return 0;
+ }
+ stbi__skip(s,12);
+ hsz = stbi__get32le(s);
+ if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124) {
+ stbi__rewind( s );
+ return 0;
+ }
+ if (hsz == 12) {
+ *x = stbi__get16le(s);
+ *y = stbi__get16le(s);
+ } else {
+ *x = stbi__get32le(s);
+ *y = stbi__get32le(s);
+ }
+ if (stbi__get16le(s) != 1) {
+ stbi__rewind( s );
+ return 0;
+ }
+ *comp = stbi__get16le(s) / 8;
+ return 1;
+}
+#endif
+
+#ifndef STBI_NO_PSD
+static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp)
+{
+ int channelCount;
+ if (stbi__get32be(s) != 0x38425053) {
+ stbi__rewind( s );
+ return 0;
+ }
+ if (stbi__get16be(s) != 1) {
+ stbi__rewind( s );
+ return 0;
+ }
+ stbi__skip(s, 6);
+ channelCount = stbi__get16be(s);
+ if (channelCount < 0 || channelCount > 16) {
+ stbi__rewind( s );
+ return 0;
+ }
+ *y = stbi__get32be(s);
+ *x = stbi__get32be(s);
+ if (stbi__get16be(s) != 8) {
+ stbi__rewind( s );
+ return 0;
+ }
+ if (stbi__get16be(s) != 3) {
+ stbi__rewind( s );
+ return 0;
+ }
+ *comp = 4;
+ return 1;
+}
+#endif
+
+#ifndef STBI_NO_PIC
+static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp)
+{
+ int act_comp=0,num_packets=0,chained;
+ stbi__pic_packet packets[10];
+
+ stbi__skip(s, 92);
+
+ *x = stbi__get16be(s);
+ *y = stbi__get16be(s);
+ if (stbi__at_eof(s)) return 0;
+ if ( (*x) != 0 && (1 << 28) / (*x) < (*y)) {
+ stbi__rewind( s );
+ return 0;
+ }
+
+ stbi__skip(s, 8);
+
+ do {
+ stbi__pic_packet *packet;
+
+ if (num_packets==sizeof(packets)/sizeof(packets[0]))
+ return 0;
+
+ packet = &packets[num_packets++];
+ chained = stbi__get8(s);
+ packet->size = stbi__get8(s);
+ packet->type = stbi__get8(s);
+ packet->channel = stbi__get8(s);
+ act_comp |= packet->channel;
+
+ if (stbi__at_eof(s)) {
+ stbi__rewind( s );
+ return 0;
+ }
+ if (packet->size != 8) {
+ stbi__rewind( s );
+ return 0;
+ }
+ } while (chained);
+
+ *comp = (act_comp & 0x10 ? 4 : 3);
+
+ return 1;
+}
+#endif
+
+// *************************************************************************************************
+// Portable Gray Map and Portable Pixel Map loader
+// by Ken Miller
+//
+// PGM: http://netpbm.sourceforge.net/doc/pgm.html
+// PPM: http://netpbm.sourceforge.net/doc/ppm.html
+//
+// Known limitations:
+// Does not support comments in the header section
+// Does not support ASCII image data (formats P2 and P3)
+// Does not support 16-bit-per-channel
+
+#ifndef STBI_NO_PNM
+
+static int stbi__pnm_test(stbi__context *s)
+{
+ char p, t;
+ p = (char) stbi__get8(s);
+ t = (char) stbi__get8(s);
+ if (p != 'P' || (t != '5' && t != '6')) {
+ stbi__rewind( s );
+ return 0;
+ }
+ return 1;
+}
+
+static stbi_uc *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)
+{
+ stbi_uc *out;
+ if (!stbi__pnm_info(s, (int *)&s->img_x, (int *)&s->img_y, (int *)&s->img_n))
+ return 0;
+ *x = s->img_x;
+ *y = s->img_y;
+ *comp = s->img_n;
+
+ out = (stbi_uc *) stbi__malloc(s->img_n * s->img_x * s->img_y);
+ if (!out) return stbi__errpuc("outofmem", "Out of memory");
+ stbi__getn(s, out, s->img_n * s->img_x * s->img_y);
+
+ if (req_comp && req_comp != s->img_n) {
+ out = stbi__convert_format(out, s->img_n, req_comp, s->img_x, s->img_y);
+ if (out == NULL) return out; // stbi__convert_format frees input on failure
+ }
+ return out;
+}
+
+static int stbi__pnm_isspace(char c)
+{
+ return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r';
+}
+
+static void stbi__pnm_skip_whitespace(stbi__context *s, char *c)
+{
+ while (!stbi__at_eof(s) && stbi__pnm_isspace(*c))
+ *c = (char) stbi__get8(s);
+}
+
+static int stbi__pnm_isdigit(char c)
+{
+ return c >= '0' && c <= '9';
+}
+
+static int stbi__pnm_getinteger(stbi__context *s, char *c)
+{
+ int value = 0;
+
+ while (!stbi__at_eof(s) && stbi__pnm_isdigit(*c)) {
+ value = value*10 + (*c - '0');
+ *c = (char) stbi__get8(s);
+ }
+
+ return value;
+}
+
+static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp)
+{
+ int maxv;
+ char c, p, t;
+
+ stbi__rewind( s );
+
+ // Get identifier
+ p = (char) stbi__get8(s);
+ t = (char) stbi__get8(s);
+ if (p != 'P' || (t != '5' && t != '6')) {
+ stbi__rewind( s );
+ return 0;
+ }
+
+ *comp = (t == '6') ? 3 : 1; // '5' is 1-component .pgm; '6' is 3-component .ppm
+
+ c = (char) stbi__get8(s);
+ stbi__pnm_skip_whitespace(s, &c);
+
+ *x = stbi__pnm_getinteger(s, &c); // read width
+ stbi__pnm_skip_whitespace(s, &c);
+
+ *y = stbi__pnm_getinteger(s, &c); // read height
+ stbi__pnm_skip_whitespace(s, &c);
+
+ maxv = stbi__pnm_getinteger(s, &c); // read max value
+
+ if (maxv > 255)
+ return stbi__err("max value > 255", "PPM image not 8-bit");
+ else
+ return 1;
+}
+#endif
+
+static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp)
+{
+ #ifndef STBI_NO_JPEG
+ if (stbi__jpeg_info(s, x, y, comp)) return 1;
+ #endif
+
+ #ifndef STBI_NO_PNG
+ if (stbi__png_info(s, x, y, comp)) return 1;
+ #endif
+
+ #ifndef STBI_NO_GIF
+ if (stbi__gif_info(s, x, y, comp)) return 1;
+ #endif
+
+ #ifndef STBI_NO_BMP
+ if (stbi__bmp_info(s, x, y, comp)) return 1;
+ #endif
+
+ #ifndef STBI_NO_PSD
+ if (stbi__psd_info(s, x, y, comp)) return 1;
+ #endif
+
+ #ifndef STBI_NO_PIC
+ if (stbi__pic_info(s, x, y, comp)) return 1;
+ #endif
+
+ #ifndef STBI_NO_PNM
+ if (stbi__pnm_info(s, x, y, comp)) return 1;
+ #endif
+
+ #ifndef STBI_NO_HDR
+ if (stbi__hdr_info(s, x, y, comp)) return 1;
+ #endif
+
+ // test tga last because it's a crappy test!
+ #ifndef STBI_NO_TGA
+ if (stbi__tga_info(s, x, y, comp))
+ return 1;
+ #endif
+ return stbi__err("unknown image type", "Image not of any known type, or corrupt");
+}
+
+#ifndef STBI_NO_STDIO
+STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp)
+{
+ FILE *f = stbi__fopen(filename, "rb");
+ int result;
+ if (!f) return stbi__err("can't fopen", "Unable to open file");
+ result = stbi_info_from_file(f, x, y, comp);
+ fclose(f);
+ return result;
+}
+
+STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp)
+{
+ int r;
+ stbi__context s;
+ long pos = ftell(f);
+ stbi__start_file(&s, f);
+ r = stbi__info_main(&s,x,y,comp);
+ fseek(f,pos,SEEK_SET);
+ return r;
+}
+#endif // !STBI_NO_STDIO
+
+STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp)
+{
+ stbi__context s;
+ stbi__start_mem(&s,buffer,len);
+ return stbi__info_main(&s,x,y,comp);
+}
+
+STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp)
+{
+ stbi__context s;
+ stbi__start_callbacks(&s, (stbi_io_callbacks *) c, user);
+ return stbi__info_main(&s,x,y,comp);
+}
+
+#endif // STB_IMAGE_IMPLEMENTATION
+
+/*
+ revision history:
+ 2.02 (2015-01-19) fix incorrect assert, fix warning
+ 2.01 (2015-01-17) fix various warnings; suppress SIMD on gcc 32-bit without -msse2
+ 2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG
+ 2.00 (2014-12-25) optimize JPG, including x86 SSE2 & NEON SIMD (ryg)
+ progressive JPEG (stb)
+ PGM/PPM support (Ken Miller)
+ STBI_MALLOC,STBI_REALLOC,STBI_FREE
+ GIF bugfix -- seemingly never worked
+ STBI_NO_*, STBI_ONLY_*
+ 1.48 (2014-12-14) fix incorrectly-named assert()
+ 1.47 (2014-12-14) 1/2/4-bit PNG support, both direct and paletted (Omar Cornut & stb)
+ optimize PNG (ryg)
+ fix bug in interlaced PNG with user-specified channel count (stb)
+ 1.46 (2014-08-26)
+ fix broken tRNS chunk (colorkey-style transparency) in non-paletted PNG
+ 1.45 (2014-08-16)
+ fix MSVC-ARM internal compiler error by wrapping malloc
+ 1.44 (2014-08-07)
+ various warning fixes from Ronny Chevalier
+ 1.43 (2014-07-15)
+ fix MSVC-only compiler problem in code changed in 1.42
+ 1.42 (2014-07-09)
+ don't define _CRT_SECURE_NO_WARNINGS (affects user code)
+ fixes to stbi__cleanup_jpeg path
+ added STBI_ASSERT to avoid requiring assert.h
+ 1.41 (2014-06-25)
+ fix search&replace from 1.36 that messed up comments/error messages
+ 1.40 (2014-06-22)
+ fix gcc struct-initialization warning
+ 1.39 (2014-06-15)
+ fix to TGA optimization when req_comp != number of components in TGA;
+ fix to GIF loading because BMP wasn't rewinding (whoops, no GIFs in my test suite)
+ add support for BMP version 5 (more ignored fields)
+ 1.38 (2014-06-06)
+ suppress MSVC warnings on integer casts truncating values
+ fix accidental rename of 'skip' field of I/O
+ 1.37 (2014-06-04)
+ remove duplicate typedef
+ 1.36 (2014-06-03)
+ convert to header file single-file library
+ if de-iphone isn't set, load iphone images color-swapped instead of returning NULL
+ 1.35 (2014-05-27)
+ various warnings
+ fix broken STBI_SIMD path
+ fix bug where stbi_load_from_file no longer left file pointer in correct place
+ fix broken non-easy path for 32-bit BMP (possibly never used)
+ TGA optimization by Arseny Kapoulkine
+ 1.34 (unknown)
+ use STBI_NOTUSED in stbi__resample_row_generic(), fix one more leak in tga failure case
+ 1.33 (2011-07-14)
+ make stbi_is_hdr work in STBI_NO_HDR (as specified), minor compiler-friendly improvements
+ 1.32 (2011-07-13)
+ support for "info" function for all supported filetypes (SpartanJ)
+ 1.31 (2011-06-20)
+ a few more leak fixes, bug in PNG handling (SpartanJ)
+ 1.30 (2011-06-11)
+ added ability to load files via callbacks to accomidate custom input streams (Ben Wenger)
+ removed deprecated format-specific test/load functions
+ removed support for installable file formats (stbi_loader) -- would have been broken for IO callbacks anyway
+ error cases in bmp and tga give messages and don't leak (Raymond Barbiero, grisha)
+ fix inefficiency in decoding 32-bit BMP (David Woo)
+ 1.29 (2010-08-16)
+ various warning fixes from Aurelien Pocheville
+ 1.28 (2010-08-01)
+ fix bug in GIF palette transparency (SpartanJ)
+ 1.27 (2010-08-01)
+ cast-to-stbi_uc to fix warnings
+ 1.26 (2010-07-24)
+ fix bug in file buffering for PNG reported by SpartanJ
+ 1.25 (2010-07-17)
+ refix trans_data warning (Won Chun)
+ 1.24 (2010-07-12)
+ perf improvements reading from files on platforms with lock-heavy fgetc()
+ minor perf improvements for jpeg
+ deprecated type-specific functions so we'll get feedback if they're needed
+ attempt to fix trans_data warning (Won Chun)
+ 1.23 fixed bug in iPhone support
+ 1.22 (2010-07-10)
+ removed image *writing* support
+ stbi_info support from Jetro Lauha
+ GIF support from Jean-Marc Lienher
+ iPhone PNG-extensions from James Brown
+ warning-fixes from Nicolas Schulz and Janez Zemva (i.stbi__err. Janez (U+017D)emva)
+ 1.21 fix use of 'stbi_uc' in header (reported by jon blow)
+ 1.20 added support for Softimage PIC, by Tom Seddon
+ 1.19 bug in interlaced PNG corruption check (found by ryg)
+ 1.18 2008-08-02
+ fix a threading bug (local mutable static)
+ 1.17 support interlaced PNG
+ 1.16 major bugfix - stbi__convert_format converted one too many pixels
+ 1.15 initialize some fields for thread safety
+ 1.14 fix threadsafe conversion bug
+ header-file-only version (#define STBI_HEADER_FILE_ONLY before including)
+ 1.13 threadsafe
+ 1.12 const qualifiers in the API
+ 1.11 Support installable IDCT, colorspace conversion routines
+ 1.10 Fixes for 64-bit (don't use "unsigned long")
+ optimized upsampling by Fabian "ryg" Giesen
+ 1.09 Fix format-conversion for PSD code (bad global variables!)
+ 1.08 Thatcher Ulrich's PSD code integrated by Nicolas Schulz
+ 1.07 attempt to fix C++ warning/errors again
+ 1.06 attempt to fix C++ warning/errors again
+ 1.05 fix TGA loading to return correct *comp and use good luminance calc
+ 1.04 default float alpha is 1, not 255; use 'void *' for stbi_image_free
+ 1.03 bugfixes to STBI_NO_STDIO, STBI_NO_HDR
+ 1.02 support for (subset of) HDR files, float interface for preferred access to them
+ 1.01 fix bug: possible bug in handling right-side up bmps... not sure
+ fix bug: the stbi__bmp_load() and stbi__tga_load() functions didn't work at all
+ 1.00 interface to zlib that skips zlib header
+ 0.99 correct handling of alpha in palette
+ 0.98 TGA loader by lonesock; dynamically add loaders (untested)
+ 0.97 jpeg errors on too large a file; also catch another malloc failure
+ 0.96 fix detection of invalid v value - particleman@mollyrocket forum
+ 0.95 during header scan, seek to markers in case of padding
+ 0.94 STBI_NO_STDIO to disable stdio usage; rename all #defines the same
+ 0.93 handle jpegtran output; verbose errors
+ 0.92 read 4,8,16,24,32-bit BMP files of several formats
+ 0.91 output 24-bit Windows 3.0 BMP files
+ 0.90 fix a few more warnings; bump version number to approach 1.0
+ 0.61 bugfixes due to Marc LeBlanc, Christopher Lloyd
+ 0.60 fix compiling as c++
+ 0.59 fix warnings: merge Dave Moore's -Wall fixes
+ 0.58 fix bug: zlib uncompressed mode len/nlen was wrong endian
+ 0.57 fix bug: jpg last huffman symbol before marker was >9 bits but less than 16 available
+ 0.56 fix bug: zlib uncompressed mode len vs. nlen
+ 0.55 fix bug: restart_interval not initialized to 0
+ 0.54 allow NULL for 'int *comp'
+ 0.53 fix bug in png 3->4; speedup png decoding
+ 0.52 png handles req_comp=3,4 directly; minor cleanup; jpeg comments
+ 0.51 obey req_comp requests, 1-component jpegs return as 1-component,
+ on 'test' only check type, not whether we support this variant
+ 0.50 first released version
+*/
diff --git a/src/SFML/Graphics/stb_image/stb_image_write.h b/extlibs/headers/stb_image/stb_image_write.h
index b9f7aae..5a449d9 100644
--- a/src/SFML/Graphics/stb_image/stb_image_write.h
+++ b/extlibs/headers/stb_image/stb_image_write.h
@@ -1,15 +1,17 @@
-/* stbiw-0.92 - public domain - http://nothings.org/stb/stb_image_write.h
+/* stb_image_write - v0.97 - public domain - http://nothings.org/stb/stb_image_write.h
writes out PNG/BMP/TGA images to C stdio - Sean Barrett 2010
no warranty implied; use at your own risk
-Before including,
+ Before #including,
- #define STB_IMAGE_WRITE_IMPLEMENTATION
+ #define STB_IMAGE_WRITE_IMPLEMENTATION
-in the file that you want to have the implementation.
+ in the file that you want to have the implementation.
+ Will probably not work correctly with strict-aliasing optimizations.
+
ABOUT:
This header file is a library for writing images to C stdio. It could be
@@ -22,11 +24,12 @@ ABOUT:
USAGE:
- There are three functions, one for each image file format:
+ There are four functions, one for each image file format:
int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes);
int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data);
int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data);
+ int stbi_write_hdr(char const *filename, int w, int h, int comp, const void *data);
Each function returns 0 on failure and non-0 on success.
@@ -40,7 +43,7 @@ USAGE:
a row of pixels to the first byte of the next row of pixels.
PNG creates output files with the same number of components as the input.
- The BMP and TGA formats expand Y to RGB in the file format. BMP does not
+ The BMP format expands Y to RGB in the file format and does not
output alpha.
PNG supports writing rectangles of data even when the bytes storing rows of
@@ -49,6 +52,21 @@ USAGE:
formats do not. (Thus you cannot write a native-format BMP through the BMP
writer, both because it is in BGR order and because it may have padding
at the end of the line.)
+
+ HDR expects linear float data. Since the format is always 32-bit rgb(e)
+ data, alpha (if provided) is discarded, and for monochrome data it is
+ replicated across all three channels.
+
+CREDITS:
+
+ PNG/BMP/TGA
+ Sean Barrett
+ HDR
+ Baldur Karlsson
+ TGA monochrome:
+ Jean-Sebastien Guay
+ Bugfixes:
+ Chribba@github
*/
#ifndef INCLUDE_STB_IMAGE_WRITE_H
@@ -58,9 +76,10 @@ USAGE:
extern "C" {
#endif
-extern int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes);
-extern int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data);
-extern int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data);
+extern int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes);
+extern int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data);
+extern int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data);
+extern int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data);
#ifdef __cplusplus
}
@@ -75,6 +94,7 @@ extern int stbi_write_tga(char const *filename, int w, int h, int comp, const vo
#include <stdio.h>
#include <string.h>
#include <assert.h>
+#include <math.h>
typedef unsigned int stbiw_uint32;
typedef int stb_image_write_test[sizeof(stbiw_uint32)==4 ? 1 : -1];
@@ -106,7 +126,7 @@ static void write3(FILE *f, unsigned char a, unsigned char b, unsigned char c)
fwrite(arr, 3, 1, f);
}
-static void write_pixels(FILE *f, int rgb_dir, int vdir, int x, int y, int comp, void *data, int write_alpha, int scanline_pad)
+static void write_pixels(FILE *f, int rgb_dir, int vdir, int x, int y, int comp, void *data, int write_alpha, int scanline_pad, int expand_mono)
{
unsigned char bg[3] = { 255, 0, 255}, px[3];
stbiw_uint32 zero = 0;
@@ -126,8 +146,12 @@ static void write_pixels(FILE *f, int rgb_dir, int vdir, int x, int y, int comp,
if (write_alpha < 0)
fwrite(&d[comp-1], 1, 1, f);
switch (comp) {
- case 1:
- case 2: write3(f, d[0],d[0],d[0]);
+ case 1: fwrite(d, 1, 1, f);
+ break;
+ case 2: if (expand_mono)
+ write3(f, d[0],d[0],d[0]); // monochrome bmp
+ else
+ fwrite(d, 1, 1, f); // monochrome TGA
break;
case 4:
if (!write_alpha) {
@@ -149,7 +173,7 @@ static void write_pixels(FILE *f, int rgb_dir, int vdir, int x, int y, int comp,
}
}
-static int outfile(char const *filename, int rgb_dir, int vdir, int x, int y, int comp, void *data, int alpha, int pad, const char *fmt, ...)
+static int outfile(char const *filename, int rgb_dir, int vdir, int x, int y, int comp, int expand_mono, void *data, int alpha, int pad, const char *fmt, ...)
{
FILE *f;
if (y < 0 || x < 0) return 0;
@@ -159,7 +183,7 @@ static int outfile(char const *filename, int rgb_dir, int vdir, int x, int y, in
va_start(v, fmt);
writefv(f, fmt, v);
va_end(v);
- write_pixels(f,rgb_dir,vdir,x,y,comp,data,alpha,pad);
+ write_pixels(f,rgb_dir,vdir,x,y,comp,data,alpha,pad,expand_mono);
fclose(f);
}
return f != NULL;
@@ -168,7 +192,7 @@ static int outfile(char const *filename, int rgb_dir, int vdir, int x, int y, in
int stbi_write_bmp(char const *filename, int x, int y, int comp, const void *data)
{
int pad = (-x*3) & 3;
- return outfile(filename,-1,-1,x,y,comp,(void *) data,0,pad,
+ return outfile(filename,-1,-1,x,y,comp,1,(void *) data,0,pad,
"11 4 22 4" "4 44 22 444444",
'B', 'M', 14+40+(x*3+pad)*y, 0,0, 14+40, // file header
40, x,y, 1,24, 0,0,0,0,0,0); // bitmap header
@@ -176,48 +200,200 @@ int stbi_write_bmp(char const *filename, int x, int y, int comp, const void *dat
int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data)
{
- int has_alpha = !(comp & 1);
- return outfile(filename, -1,-1, x, y, comp, (void *) data, has_alpha, 0,
- "111 221 2222 11", 0,0,2, 0,0,0, 0,0,x,y, 24+8*has_alpha, 8*has_alpha);
+ int has_alpha = (comp == 2 || comp == 4);
+ int colorbytes = has_alpha ? comp-1 : comp;
+ int format = colorbytes < 2 ? 3 : 2; // 3 color channels (RGB/RGBA) = 2, 1 color channel (Y/YA) = 3
+ return outfile(filename, -1,-1, x, y, comp, 0, (void *) data, has_alpha, 0,
+ "111 221 2222 11", 0,0,format, 0,0,0, 0,0,x,y, (colorbytes+has_alpha)*8, has_alpha*8);
+}
+
+// *************************************************************************************************
+// Radiance RGBE HDR writer
+// by Baldur Karlsson
+#define stbiw__max(a, b) ((a) > (b) ? (a) : (b))
+
+void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear)
+{
+ int exponent;
+ float maxcomp = stbiw__max(linear[0], stbiw__max(linear[1], linear[2]));
+
+ if (maxcomp < 1e-32) {
+ rgbe[0] = rgbe[1] = rgbe[2] = rgbe[3] = 0;
+ } else {
+ float normalize = (float) frexp(maxcomp, &exponent) * 256.0f/maxcomp;
+
+ rgbe[0] = (unsigned char)(linear[0] * normalize);
+ rgbe[1] = (unsigned char)(linear[1] * normalize);
+ rgbe[2] = (unsigned char)(linear[2] * normalize);
+ rgbe[3] = (unsigned char)(exponent + 128);
+ }
+}
+
+void stbiw__write_run_data(FILE *f, int length, unsigned char databyte)
+{
+ unsigned char lengthbyte = (unsigned char) (length+128);
+ assert(length+128 <= 255);
+ fwrite(&lengthbyte, 1, 1, f);
+ fwrite(&databyte, 1, 1, f);
+}
+
+void stbiw__write_dump_data(FILE *f, int length, unsigned char *data)
+{
+ unsigned char lengthbyte = (unsigned char )(length & 0xff);
+ assert(length <= 128); // inconsistent with spec but consistent with official code
+ fwrite(&lengthbyte, 1, 1, f);
+ fwrite(data, length, 1, f);
+}
+
+void stbiw__write_hdr_scanline(FILE *f, int width, int comp, unsigned char *scratch, const float *scanline)
+{
+ unsigned char scanlineheader[4] = { 2, 2, 0, 0 };
+ unsigned char rgbe[4];
+ float linear[3];
+ int x;
+
+ scanlineheader[2] = (width&0xff00)>>8;
+ scanlineheader[3] = (width&0x00ff);
+
+ /* skip RLE for images too small or large */
+ if (width < 8 || width >= 32768) {
+ for (x=0; x < width; x++) {
+ switch (comp) {
+ case 4: /* fallthrough */
+ case 3: linear[2] = scanline[x*comp + 2];
+ linear[1] = scanline[x*comp + 1];
+ linear[0] = scanline[x*comp + 0];
+ break;
+ case 2: /* fallthrough */
+ case 1: linear[0] = linear[1] = linear[2] = scanline[x*comp + 0];
+ break;
+ }
+ stbiw__linear_to_rgbe(rgbe, linear);
+ fwrite(rgbe, 4, 1, f);
+ }
+ } else {
+ int c,r;
+ /* encode into scratch buffer */
+ for (x=0; x < width; x++) {
+ switch(comp) {
+ case 4: /* fallthrough */
+ case 3: linear[2] = scanline[x*comp + 2];
+ linear[1] = scanline[x*comp + 1];
+ linear[0] = scanline[x*comp + 0];
+ break;
+ case 2: /* fallthrough */
+ case 1: linear[0] = linear[1] = linear[2] = scanline[x*comp + 0];
+ break;
+ }
+ stbiw__linear_to_rgbe(rgbe, linear);
+ scratch[x + width*0] = rgbe[0];
+ scratch[x + width*1] = rgbe[1];
+ scratch[x + width*2] = rgbe[2];
+ scratch[x + width*3] = rgbe[3];
+ }
+
+ fwrite(scanlineheader, 4, 1, f);
+
+ /* RLE each component separately */
+ for (c=0; c < 4; c++) {
+ unsigned char *comp = &scratch[width*c];
+ int runstart = 0, head = 0, rlerun = 0;
+
+ x = 0;
+ while (x < width) {
+ // find first run
+ r = x;
+ while (r+2 < width) {
+ if (comp[r] == comp[r+1] && comp[r] == comp[r+2])
+ break;
+ ++r;
+ }
+ if (r+2 >= width)
+ r = width;
+ // dump up to first run
+ while (x < r) {
+ int len = r-x;
+ if (len > 128) len = 128;
+ stbiw__write_dump_data(f, len, &comp[x]);
+ x += len;
+ }
+ // if there's a run, output it
+ if (r+2 < width) { // same test as what we break out of in search loop, so only true if we break'd
+ // find next byte after run
+ while (r < width && comp[r] == comp[x])
+ ++r;
+ // output run up to r
+ while (x < r) {
+ int len = r-x;
+ if (len > 127) len = 127;
+ stbiw__write_run_data(f, len, comp[x]);
+ x += len;
+ }
+ }
+ }
+ }
+ }
+}
+
+int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *data)
+{
+ int i;
+ FILE *f;
+ if (y <= 0 || x <= 0 || data == NULL) return 0;
+ f = fopen(filename, "wb");
+ if (f) {
+ /* Each component is stored separately. Allocate scratch space for full output scanline. */
+ unsigned char *scratch = (unsigned char *) malloc(x*4);
+ fprintf(f, "#?RADIANCE\n# Written by stb_image_write.h\nFORMAT=32-bit_rle_rgbe\n" );
+ fprintf(f, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n" , y, x);
+ for(i=0; i < y; i++)
+ stbiw__write_hdr_scanline(f, x, comp, scratch, data + comp*i*x);
+ free(scratch);
+ fclose(f);
+ }
+ return f != NULL;
}
-// stretchy buffer; stbi__sbpush() == vector<>::push_back() -- stbi__sbcount() == vector<>::size()
-#define stbi__sbraw(a) ((int *) (a) - 2)
-#define stbi__sbm(a) stbi__sbraw(a)[0]
-#define stbi__sbn(a) stbi__sbraw(a)[1]
+/////////////////////////////////////////////////////////
+// PNG
+
+// stretchy buffer; stbiw__sbpush() == vector<>::push_back() -- stbiw__sbcount() == vector<>::size()
+#define stbiw__sbraw(a) ((int *) (a) - 2)
+#define stbiw__sbm(a) stbiw__sbraw(a)[0]
+#define stbiw__sbn(a) stbiw__sbraw(a)[1]
-#define stbi__sbneedgrow(a,n) ((a)==0 || stbi__sbn(a)+n >= stbi__sbm(a))
-#define stbi__sbmaybegrow(a,n) (stbi__sbneedgrow(a,(n)) ? stbi__sbgrow(a,n) : 0)
-#define stbi__sbgrow(a,n) stbi__sbgrowf((void **) &(a), (n), sizeof(*(a)))
+#define stbiw__sbneedgrow(a,n) ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
+#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
+#define stbiw__sbgrow(a,n) stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a)))
-#define stbi__sbpush(a, v) (stbi__sbmaybegrow(a,1), (a)[stbi__sbn(a)++] = (v))
-#define stbi__sbcount(a) ((a) ? stbi__sbn(a) : 0)
-#define stbi__sbfree(a) ((a) ? free(stbi__sbraw(a)),0 : 0)
+#define stbiw__sbpush(a, v) (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
+#define stbiw__sbcount(a) ((a) ? stbiw__sbn(a) : 0)
+#define stbiw__sbfree(a) ((a) ? free(stbiw__sbraw(a)),0 : 0)
-static void *stbi__sbgrowf(void **arr, int increment, int itemsize)
+static void *stbiw__sbgrowf(void **arr, int increment, int itemsize)
{
- int m = *arr ? 2*stbi__sbm(*arr)+increment : increment+1;
- void *p = realloc(*arr ? stbi__sbraw(*arr) : 0, itemsize * m + sizeof(int)*2);
+ int m = *arr ? 2*stbiw__sbm(*arr)+increment : increment+1;
+ void *p = realloc(*arr ? stbiw__sbraw(*arr) : 0, itemsize * m + sizeof(int)*2);
assert(p);
if (p) {
if (!*arr) ((int *) p)[1] = 0;
*arr = (void *) ((int *) p + 2);
- stbi__sbm(*arr) = m;
+ stbiw__sbm(*arr) = m;
}
return *arr;
}
-static unsigned char *stbi__zlib_flushf(unsigned char *data, unsigned int *bitbuffer, int *bitcount)
+static unsigned char *stbiw__zlib_flushf(unsigned char *data, unsigned int *bitbuffer, int *bitcount)
{
while (*bitcount >= 8) {
- stbi__sbpush(data, (unsigned char) *bitbuffer);
+ stbiw__sbpush(data, (unsigned char) *bitbuffer);
*bitbuffer >>= 8;
*bitcount -= 8;
}
return data;
}
-static int stbi__zlib_bitrev(int code, int codebits)
+static int stbiw__zlib_bitrev(int code, int codebits)
{
int res=0;
while (codebits--) {
@@ -227,7 +403,7 @@ static int stbi__zlib_bitrev(int code, int codebits)
return res;
}
-static unsigned int stbi__zlib_countm(unsigned char *a, unsigned char *b, int limit)
+static unsigned int stbiw__zlib_countm(unsigned char *a, unsigned char *b, int limit)
{
int i;
for (i=0; i < limit && i < 258; ++i)
@@ -235,7 +411,7 @@ static unsigned int stbi__zlib_countm(unsigned char *a, unsigned char *b, int li
return i;
}
-static unsigned int stbi__zhash(unsigned char *data)
+static unsigned int stbiw__zhash(unsigned char *data)
{
stbiw_uint32 hash = data[0] + (data[1] << 8) + (data[2] << 16);
hash ^= hash << 3;
@@ -247,19 +423,19 @@ static unsigned int stbi__zhash(unsigned char *data)
return hash;
}
-#define stbi__zlib_flush() (out = stbi__zlib_flushf(out, &bitbuf, &bitcount))
-#define stbi__zlib_add(code,codebits) \
- (bitbuf |= (code) << bitcount, bitcount += (codebits), stbi__zlib_flush())
-#define stbi__zlib_huffa(b,c) stbi__zlib_add(stbi__zlib_bitrev(b,c),c)
+#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
+#define stbiw__zlib_add(code,codebits) \
+ (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
+#define stbiw__zlib_huffa(b,c) stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c)
// default huffman tables
-#define stbi__zlib_huff1(n) stbi__zlib_huffa(0x30 + (n), 8)
-#define stbi__zlib_huff2(n) stbi__zlib_huffa(0x190 + (n)-144, 9)
-#define stbi__zlib_huff3(n) stbi__zlib_huffa(0 + (n)-256,7)
-#define stbi__zlib_huff4(n) stbi__zlib_huffa(0xc0 + (n)-280,8)
-#define stbi__zlib_huff(n) ((n) <= 143 ? stbi__zlib_huff1(n) : (n) <= 255 ? stbi__zlib_huff2(n) : (n) <= 279 ? stbi__zlib_huff3(n) : stbi__zlib_huff4(n))
-#define stbi__zlib_huffb(n) ((n) <= 143 ? stbi__zlib_huff1(n) : stbi__zlib_huff2(n))
+#define stbiw__zlib_huff1(n) stbiw__zlib_huffa(0x30 + (n), 8)
+#define stbiw__zlib_huff2(n) stbiw__zlib_huffa(0x190 + (n)-144, 9)
+#define stbiw__zlib_huff3(n) stbiw__zlib_huffa(0 + (n)-256,7)
+#define stbiw__zlib_huff4(n) stbiw__zlib_huffa(0xc0 + (n)-280,8)
+#define stbiw__zlib_huff(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw__zlib_huff4(n))
+#define stbiw__zlib_huffb(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : stbiw__zlib_huff2(n))
-#define stbi__ZHASH 16384
+#define stbiw__ZHASH 16384
unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality)
{
@@ -270,45 +446,45 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l
unsigned int bitbuf=0;
int i,j, bitcount=0;
unsigned char *out = NULL;
- unsigned char **hash_table[stbi__ZHASH]; // 64KB on the stack!
+ unsigned char **hash_table[stbiw__ZHASH]; // 64KB on the stack!
if (quality < 5) quality = 5;
- stbi__sbpush(out, 0x78); // DEFLATE 32K window
- stbi__sbpush(out, 0x5e); // FLEVEL = 1
- stbi__zlib_add(1,1); // BFINAL = 1
- stbi__zlib_add(1,2); // BTYPE = 1 -- fixed huffman
+ stbiw__sbpush(out, 0x78); // DEFLATE 32K window
+ stbiw__sbpush(out, 0x5e); // FLEVEL = 1
+ stbiw__zlib_add(1,1); // BFINAL = 1
+ stbiw__zlib_add(1,2); // BTYPE = 1 -- fixed huffman
- for (i=0; i < stbi__ZHASH; ++i)
+ for (i=0; i < stbiw__ZHASH; ++i)
hash_table[i] = NULL;
i=0;
while (i < data_len-3) {
// hash next 3 bytes of data to be compressed
- int h = stbi__zhash(data+i)&(stbi__ZHASH-1), best=3;
+ int h = stbiw__zhash(data+i)&(stbiw__ZHASH-1), best=3;
unsigned char *bestloc = 0;
unsigned char **hlist = hash_table[h];
- int n = stbi__sbcount(hlist);
+ int n = stbiw__sbcount(hlist);
for (j=0; j < n; ++j) {
if (hlist[j]-data > i-32768) { // if entry lies within window
- int d = stbi__zlib_countm(hlist[j], data+i, data_len-i);
+ int d = stbiw__zlib_countm(hlist[j], data+i, data_len-i);
if (d >= best) best=d,bestloc=hlist[j];
}
}
// when hash table entry is too long, delete half the entries
- if (hash_table[h] && stbi__sbn(hash_table[h]) == 2*quality) {
+ if (hash_table[h] && stbiw__sbn(hash_table[h]) == 2*quality) {
memcpy(hash_table[h], hash_table[h]+quality, sizeof(hash_table[h][0])*quality);
- stbi__sbn(hash_table[h]) = quality;
+ stbiw__sbn(hash_table[h]) = quality;
}
- stbi__sbpush(hash_table[h],data+i);
+ stbiw__sbpush(hash_table[h],data+i);
if (bestloc) {
// "lazy matching" - check match at *next* byte, and if it's better, do cur byte as literal
- h = stbi__zhash(data+i+1)&(stbi__ZHASH-1);
+ h = stbiw__zhash(data+i+1)&(stbiw__ZHASH-1);
hlist = hash_table[h];
- n = stbi__sbcount(hlist);
+ n = stbiw__sbcount(hlist);
for (j=0; j < n; ++j) {
if (hlist[j]-data > i-32767) {
- int e = stbi__zlib_countm(hlist[j], data+i+1, data_len-i-1);
+ int e = stbiw__zlib_countm(hlist[j], data+i+1, data_len-i-1);
if (e > best) { // if next match is better, bail on current match
bestloc = NULL;
break;
@@ -318,30 +494,30 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l
}
if (bestloc) {
- int d = data+i - bestloc; // distance back
+ int d = (int) (data+i - bestloc); // distance back
assert(d <= 32767 && best <= 258);
for (j=0; best > lengthc[j+1]-1; ++j);
- stbi__zlib_huff(j+257);
- if (lengtheb[j]) stbi__zlib_add(best - lengthc[j], lengtheb[j]);
+ stbiw__zlib_huff(j+257);
+ if (lengtheb[j]) stbiw__zlib_add(best - lengthc[j], lengtheb[j]);
for (j=0; d > distc[j+1]-1; ++j);
- stbi__zlib_add(stbi__zlib_bitrev(j,5),5);
- if (disteb[j]) stbi__zlib_add(d - distc[j], disteb[j]);
+ stbiw__zlib_add(stbiw__zlib_bitrev(j,5),5);
+ if (disteb[j]) stbiw__zlib_add(d - distc[j], disteb[j]);
i += best;
} else {
- stbi__zlib_huffb(data[i]);
+ stbiw__zlib_huffb(data[i]);
++i;
}
}
// write out final bytes
for (;i < data_len; ++i)
- stbi__zlib_huffb(data[i]);
- stbi__zlib_huff(256); // end of block
+ stbiw__zlib_huffb(data[i]);
+ stbiw__zlib_huff(256); // end of block
// pad with 0 bits to byte boundary
while (bitcount)
- stbi__zlib_add(0,1);
+ stbiw__zlib_add(0,1);
- for (i=0; i < stbi__ZHASH; ++i)
- (void) stbi__sbfree(hash_table[i]);
+ for (i=0; i < stbiw__ZHASH; ++i)
+ (void) stbiw__sbfree(hash_table[i]);
{
// compute adler32 on input
@@ -353,18 +529,18 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l
j += blocklen;
blocklen = 5552;
}
- stbi__sbpush(out, (unsigned char) (s2 >> 8));
- stbi__sbpush(out, (unsigned char) s2);
- stbi__sbpush(out, (unsigned char) (s1 >> 8));
- stbi__sbpush(out, (unsigned char) s1);
+ stbiw__sbpush(out, (unsigned char) (s2 >> 8));
+ stbiw__sbpush(out, (unsigned char) s2);
+ stbiw__sbpush(out, (unsigned char) (s1 >> 8));
+ stbiw__sbpush(out, (unsigned char) s1);
}
- *out_len = stbi__sbn(out);
+ *out_len = stbiw__sbn(out);
// make returned pointer freeable
- memmove(stbi__sbraw(out), out, *out_len);
- return (unsigned char *) stbi__sbraw(out);
+ memmove(stbiw__sbraw(out), out, *out_len);
+ return (unsigned char *) stbiw__sbraw(out);
}
-unsigned int stbi__crc32(unsigned char *buffer, int len)
+unsigned int stbiw__crc32(unsigned char *buffer, int len)
{
static unsigned int crc_table[256];
unsigned int crc = ~0u;
@@ -378,17 +554,17 @@ unsigned int stbi__crc32(unsigned char *buffer, int len)
return ~crc;
}
-#define stbi__wpng4(o,a,b,c,d) ((o)[0]=(unsigned char)(a),(o)[1]=(unsigned char)(b),(o)[2]=(unsigned char)(c),(o)[3]=(unsigned char)(d),(o)+=4)
-#define stbi__wp32(data,v) stbi__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v));
-#define stbi__wptag(data,s) stbi__wpng4(data, s[0],s[1],s[2],s[3])
+#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=(unsigned char)(a),(o)[1]=(unsigned char)(b),(o)[2]=(unsigned char)(c),(o)[3]=(unsigned char)(d),(o)+=4)
+#define stbiw__wp32(data,v) stbiw__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v));
+#define stbiw__wptag(data,s) stbiw__wpng4(data, s[0],s[1],s[2],s[3])
-static void stbi__wpcrc(unsigned char **data, int len)
+static void stbiw__wpcrc(unsigned char **data, int len)
{
- unsigned int crc = stbi__crc32(*data - len - 4, len+4);
- stbi__wp32(*data, crc);
+ unsigned int crc = stbiw__crc32(*data - len - 4, len+4);
+ stbiw__wp32(*data, crc);
}
-static unsigned char stbi__paeth(int a, int b, int c)
+static unsigned char stbiw__paeth(int a, int b, int c)
{
int p = a + b - c, pa = abs(p-a), pb = abs(p-b), pc = abs(p-c);
if (pa <= pb && pa <= pc) return (unsigned char) a;
@@ -424,7 +600,7 @@ unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, in
case 1: line_buffer[i] = z[i]; break;
case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break;
case 3: line_buffer[i] = z[i] - (z[i-stride_bytes]>>1); break;
- case 4: line_buffer[i] = (signed char) (z[i] - stbi__paeth(0,z[i-stride_bytes],0)); break;
+ case 4: line_buffer[i] = (signed char) (z[i] - stbiw__paeth(0,z[i-stride_bytes],0)); break;
case 5: line_buffer[i] = z[i]; break;
case 6: line_buffer[i] = z[i]; break;
}
@@ -434,9 +610,9 @@ unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, in
case 1: line_buffer[i] = z[i] - z[i-n]; break;
case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break;
case 3: line_buffer[i] = z[i] - ((z[i-n] + z[i-stride_bytes])>>1); break;
- case 4: line_buffer[i] = z[i] - stbi__paeth(z[i-n], z[i-stride_bytes], z[i-stride_bytes-n]); break;
+ case 4: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], z[i-stride_bytes], z[i-stride_bytes-n]); break;
case 5: line_buffer[i] = z[i] - (z[i-n]>>1); break;
- case 6: line_buffer[i] = z[i] - stbi__paeth(z[i-n], 0,0); break;
+ case 6: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], 0,0); break;
}
}
if (p) break;
@@ -461,25 +637,25 @@ unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, in
o=out;
memcpy(o,sig,8); o+= 8;
- stbi__wp32(o, 13); // header length
- stbi__wptag(o, "IHDR");
- stbi__wp32(o, x);
- stbi__wp32(o, y);
+ stbiw__wp32(o, 13); // header length
+ stbiw__wptag(o, "IHDR");
+ stbiw__wp32(o, x);
+ stbiw__wp32(o, y);
*o++ = 8;
*o++ = (unsigned char) ctype[n];
*o++ = 0;
*o++ = 0;
*o++ = 0;
- stbi__wpcrc(&o,13);
+ stbiw__wpcrc(&o,13);
- stbi__wp32(o, zlen);
- stbi__wptag(o, "IDAT");
+ stbiw__wp32(o, zlen);
+ stbiw__wptag(o, "IDAT");
memcpy(o, zlib, zlen); o += zlen; free(zlib);
- stbi__wpcrc(&o, zlen);
+ stbiw__wpcrc(&o, zlen);
- stbi__wp32(o,0);
- stbi__wptag(o, "IEND");
- stbi__wpcrc(&o,0);
+ stbiw__wp32(o,0);
+ stbiw__wptag(o, "IEND");
+ stbiw__wpcrc(&o,0);
assert(o == out + *out_len);
@@ -503,6 +679,17 @@ int stbi_write_png(char const *filename, int x, int y, int comp, const void *dat
/* Revision history
+ 0.97 (2015-01-18)
+ fixed HDR asserts, rewrote HDR rle logic
+ 0.96 (2015-01-17)
+ add HDR output
+ fix monochrome BMP
+ 0.95 (2014-08-17)
+ add monochrome TGA output
+ 0.94 (2014-05-31)
+ rename private functions to avoid conflicts with stb_image.h
+ 0.93 (2014-05-27)
+ warning fixes
0.92 (2010-08-01)
casts to unsigned char to fix warnings
0.91 (2010-07-17)
diff --git a/include/SFML/Audio.hpp b/include/SFML/Audio.hpp
index 15a079f..41737cf 100644
--- a/include/SFML/Audio.hpp
+++ b/include/SFML/Audio.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,12 +30,18 @@
////////////////////////////////////////////////////////////
#include <SFML/System.hpp>
+#include <SFML/Audio/InputSoundFile.hpp>
#include <SFML/Audio/Listener.hpp>
#include <SFML/Audio/Music.hpp>
+#include <SFML/Audio/OutputSoundFile.hpp>
#include <SFML/Audio/Sound.hpp>
#include <SFML/Audio/SoundBuffer.hpp>
#include <SFML/Audio/SoundBufferRecorder.hpp>
+#include <SFML/Audio/SoundFileFactory.hpp>
+#include <SFML/Audio/SoundFileReader.hpp>
+#include <SFML/Audio/SoundFileWriter.hpp>
#include <SFML/Audio/SoundRecorder.hpp>
+#include <SFML/Audio/SoundSource.hpp>
#include <SFML/Audio/SoundStream.hpp>
@@ -46,5 +52,5 @@
///
/// Sounds, streaming (musics or custom sources), recording,
/// spatialization.
-///
+///
////////////////////////////////////////////////////////////
diff --git a/include/SFML/Audio/AlResource.hpp b/include/SFML/Audio/AlResource.hpp
new file mode 100644
index 0000000..ca5d2c0
--- /dev/null
+++ b/include/SFML/Audio/AlResource.hpp
@@ -0,0 +1,70 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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_ALRESOURCE_HPP
+#define SFML_ALRESOURCE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/Export.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// \brief Base class for classes that require an OpenAL context
+///
+////////////////////////////////////////////////////////////
+class SFML_AUDIO_API AlResource
+{
+protected:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ AlResource();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~AlResource();
+};
+
+} // namespace sf
+
+
+#endif // SFML_ALRESOURCE_HPP
+
+////////////////////////////////////////////////////////////
+/// \class sf::AlResource
+/// \ingroup audio
+///
+/// This class is for internal use only, it must be the base
+/// of every class that requires a valid OpenAL context in
+/// order to work.
+///
+////////////////////////////////////////////////////////////
diff --git a/include/SFML/Audio/Export.hpp b/include/SFML/Audio/Export.hpp
index 0cd99ac..1ea6f42 100644
--- a/include/SFML/Audio/Export.hpp
+++ b/include/SFML/Audio/Export.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Audio/SoundFile.hpp b/include/SFML/Audio/InputSoundFile.hpp
index a04a0ff..5e306ae 100644
--- a/src/SFML/Audio/SoundFile.hpp
+++ b/include/SFML/Audio/InputSoundFile.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -22,29 +22,28 @@
//
////////////////////////////////////////////////////////////
-#ifndef SFML_SOUNDFILE_HPP
-#define SFML_SOUNDFILE_HPP
+#ifndef SFML_INPUTSOUNDFILE_HPP
+#define SFML_INPUTSOUNDFILE_HPP
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
+#include <SFML/Audio/Export.hpp>
#include <SFML/System/NonCopyable.hpp>
#include <SFML/System/Time.hpp>
-#include <sndfile.h>
#include <string>
namespace sf
{
class InputStream;
+class SoundFileReader;
-namespace priv
-{
////////////////////////////////////////////////////////////
-/// \brief Provide read and write access to sound files
+/// \brief Provide read access to sound files
///
////////////////////////////////////////////////////////////
-class SoundFile : NonCopyable
+class SFML_AUDIO_API InputSoundFile : NonCopyable
{
public:
@@ -52,71 +51,53 @@ public:
/// \brief Default constructor
///
////////////////////////////////////////////////////////////
- SoundFile();
+ InputSoundFile();
////////////////////////////////////////////////////////////
/// \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;
+ ~InputSoundFile();
////////////////////////////////////////////////////////////
- /// \brief Get the sample rate of the sound
- ///
- /// \return Sample rate, in samples per second
+ /// \brief Open a sound file from the disk for reading
///
- ////////////////////////////////////////////////////////////
- unsigned int getSampleRate() const;
-
- ////////////////////////////////////////////////////////////
- /// \brief Open a sound file for reading
+ /// The supported audio formats are: WAV, OGG/Vorbis, FLAC.
///
/// \param filename Path of the sound file to load
///
/// \return True if the file was successfully opened
///
////////////////////////////////////////////////////////////
- bool openRead(const std::string& filename);
+ bool openFromFile(const std::string& filename);
////////////////////////////////////////////////////////////
/// \brief Open a sound file in memory for reading
///
+ /// The supported audio formats are: WAV, OGG/Vorbis, FLAC.
+ ///
/// \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);
+ bool openFromMemory(const void* data, std::size_t sizeInBytes);
////////////////////////////////////////////////////////////
/// \brief Open a sound file from a custom stream for reading
///
+ /// The supported audio formats are: WAV, OGG/Vorbis, FLAC.
+ ///
/// \param stream Source stream to read from
///
/// \return True if the file was successfully opened
///
////////////////////////////////////////////////////////////
- bool openRead(InputStream& stream);
+ bool openFromStream(InputStream& stream);
////////////////////////////////////////////////////////////
- /// \brief a the sound file for writing
+ /// \brief Open the sound file from the disk for writing
///
/// \param filename Path of the sound file to write
/// \param channelCount Number of channels in the sound
@@ -125,107 +106,145 @@ public:
/// \return True if the file was successfully opened
///
////////////////////////////////////////////////////////////
- bool openWrite(const std::string& filename, unsigned int channelCount, unsigned int sampleRate);
+ bool openForWriting(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
+ /// \brief Get the total number of audio samples in the file
///
- /// \return Number of samples actually read (may be less than \a sampleCount)
+ /// \return Number of samples
///
////////////////////////////////////////////////////////////
- std::size_t read(Int16* data, std::size_t sampleCount);
+ Uint64 getSampleCount() const;
////////////////////////////////////////////////////////////
- /// \brief Write audio samples to the file
+ /// \brief Get the number of channels used by the sound
///
- /// \param data Pointer to the sample array to write
- /// \param sampleCount Number of samples to write
+ /// \return Number of channels (1 = mono, 2 = stereo)
///
////////////////////////////////////////////////////////////
- void write(const Int16* data, std::size_t sampleCount);
+ unsigned int getChannelCount() const;
////////////////////////////////////////////////////////////
- /// \brief Change the current read position in the file
+ /// \brief Get the sample rate of the sound
///
- /// \param timeOffset New playing position, from the beginning of the file
+ /// \return Sample rate, in samples per second
///
////////////////////////////////////////////////////////////
- void seek(Time timeOffset);
+ unsigned int getSampleRate() const;
-private:
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the total duration of the sound file
+ ///
+ /// This function is provided for convenience, the duration is
+ /// deduced from the other sound file attributes.
+ ///
+ /// \return Duration of the sound file
+ ///
+ ////////////////////////////////////////////////////////////
+ Time getDuration() const;
////////////////////////////////////////////////////////////
- /// \brief Initialize the internal state of the sound file
+ /// \brief Change the current read position to the given sample offset
+ ///
+ /// This function takes a sample offset to provide maximum
+ /// precision. If you need to jump to a given time, use the
+ /// other overload.
///
- /// This function is called by all the openRead functions.
+ /// If the given offset exceeds to total number of samples,
+ /// this function jumps to the end of the sound file.
///
- /// \param fileInfo Information about the loaded sound file
+ /// \param sampleOffset Index of the sample to jump to, relative to the beginning
///
////////////////////////////////////////////////////////////
- void initialize(SF_INFO fileInfo);
+ void seek(Uint64 sampleOffset);
////////////////////////////////////////////////////////////
- /// \brief Get the internal format of an audio file according to
- /// its filename extension
+ /// \brief Change the current read position to the given time offset
///
- /// \param filename Filename to check
+ /// Using a time offset is handy but imprecise. If you need an accurate
+ /// result, consider using the overload which takes a sample offset.
///
- /// \return Internal format matching the filename (-1 if no match)
+ /// If the given time exceeds to total duration, this function jumps
+ /// to the end of the sound file.
+ ///
+ /// \param timeOffset Time to jump to, relative to the beginning
///
////////////////////////////////////////////////////////////
- static int getFormatFromFilename(const std::string& filename);
+ void seek(Time timeOffset);
////////////////////////////////////////////////////////////
- /// \brief Data and callbacks for opening from memory
+ /// \brief Read audio samples from the open file
+ ///
+ /// \param samples Pointer to the sample array to fill
+ /// \param maxCount Maximum number of samples to read
+ ///
+ /// \return Number of samples actually read (may be less than \a maxCount)
///
////////////////////////////////////////////////////////////
- struct Memory
- {
- const char* begin;
- const char* current;
- sf_count_t size;
+ Uint64 read(Int16* samples, Uint64 maxCount);
- 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);
- };
+private:
////////////////////////////////////////////////////////////
- /// \brief Data and callbacks for opening from stream
+ /// \brief Close the current file
///
////////////////////////////////////////////////////////////
- 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);
- };
+ void close();
////////////////////////////////////////////////////////////
// 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
+ SoundFileReader* m_reader; ///< Reader that handles I/O on the file's format
+ InputStream* m_stream; ///< Input stream used to access the file's data
+ bool m_streamOwned; ///< Is the stream internal or external?
+ Uint64 m_sampleCount; ///< Total number of samples in the file
+ unsigned int m_channelCount; ///< Number of channels of the sound
+ unsigned int m_sampleRate; ///< Number of samples per second
};
-} // namespace priv
-
} // namespace sf
-#endif // SFML_SOUNDFILE_HPP
+#endif // SFML_INPUTSOUNDFILE_HPP
+
+
+////////////////////////////////////////////////////////////
+/// \class sf::InputSoundFile
+/// \ingroup audio
+///
+/// This class decodes audio samples from a sound file. It is
+/// used internally by higher-level classes such as sf::SoundBuffer
+/// and sf::Music, but can also be useful if you want to process
+/// or analyze audio files without playing them, or if you want to
+/// implement your own version of sf::Music with more specific
+/// features.
+///
+/// Usage example:
+/// \code
+/// // Open a sound file
+/// sf::InputSoundFile file;
+/// if (!file.openFromFile("music.ogg"))
+/// /* error */;
+///
+/// // Print the sound attributes
+/// std::cout << "duration: " << file.getDuration().asSeconds() << std::endl;
+/// std::cout << "channels: " << file.getChannelCount() << std::endl;
+/// std::cout << "sample rate: " << file.getSampleRate() << std::endl;
+/// std::cout << "sample count: " << file.getSampleCount() << std::endl;
+///
+/// // Read and process batches of samples until the end of file is reached
+/// sf::Int16 samples[1024];
+/// sf::Uint64 count;
+/// do
+/// {
+/// count = file.read(samples, 1024);
+///
+/// // process, analyze, play, convert, or whatever
+/// // you want to do with the samples...
+/// }
+/// while (count > 0);
+/// \endcode
+///
+/// \see sf::SoundFileReader, sf::OutputSoundFile
+///
+////////////////////////////////////////////////////////////
diff --git a/include/SFML/Audio/Listener.hpp b/include/SFML/Audio/Listener.hpp
index 2ab203e..04e4af3 100644
--- a/include/SFML/Audio/Listener.hpp
+++ b/include/SFML/Audio/Listener.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -210,7 +210,7 @@ public:
/// audio environment, it defines where and how sounds and musics
/// are heard. If sf::View is the eyes of the user, then sf::Listener
/// is his ears (by the way, they are often linked together --
-/// same position, orientation, etc.).
+/// same position, orientation, etc.).
///
/// sf::Listener is a simple interface, which allows to setup the
/// listener in the 3D audio environment (position, direction and
diff --git a/include/SFML/Audio/Music.hpp b/include/SFML/Audio/Music.hpp
index 99b7dac..a502724 100644
--- a/include/SFML/Audio/Music.hpp
+++ b/include/SFML/Audio/Music.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Audio/Export.hpp>
#include <SFML/Audio/SoundStream.hpp>
+#include <SFML/Audio/InputSoundFile.hpp>
#include <SFML/System/Mutex.hpp>
#include <SFML/System/Time.hpp>
#include <string>
@@ -38,11 +39,6 @@
namespace sf
{
-namespace priv
-{
- class SoundFile;
-}
-
class InputStream;
////////////////////////////////////////////////////////////
@@ -70,9 +66,8 @@ public:
///
/// This function doesn't start playing the music (call play()
/// to do so).
- /// Here is a complete list of all the supported audio formats:
- /// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
- /// w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
+ /// See the documentation of sf::InputSoundFile for the list
+ /// of supported formats.
///
/// \param filename Path of the music file to open
///
@@ -88,9 +83,8 @@ public:
///
/// This function doesn't start playing the music (call play()
/// to do so).
- /// Here is a complete list of all the supported audio formats:
- /// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
- /// w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
+ /// See the documentation of sf::InputSoundFile for the list
+ /// of supported formats.
/// Since the music is not loaded completely but rather streamed
/// continuously, the \a data must remain available as long as the
/// music is playing (i.e. you can't deallocate it right after calling
@@ -111,9 +105,8 @@ public:
///
/// This function doesn't start playing the music (call play()
/// to do so).
- /// Here is a complete list of all the supported audio formats:
- /// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
- /// w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
+ /// See the documentation of sf::InputSoundFile for the list
+ /// of supported formats.
/// Since the music is not loaded completely but rather streamed
/// continuously, the \a stream must remain alive as long as the
/// music is playing (i.e. you can't destroy it right after calling
@@ -170,7 +163,7 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
- priv::SoundFile* m_file; ///< Sound file
+ InputSoundFile m_file; ///< The streamed music file
Time m_duration; ///< Music duration
std::vector<Int16> m_samples; ///< Temporary buffer of samples
Mutex m_mutex; ///< Mutex protecting the data
@@ -186,13 +179,13 @@ private:
/// \class sf::Music
/// \ingroup audio
///
-/// Music objects are sounds that are streamed rather than
-/// completely loaded in memory. This is especially useful for
-/// compressed music that usually takes hundreds of MB when it is
+/// Musics are sounds that are streamed rather than completely
+/// loaded in memory. This is especially useful for compressed
+/// musics that usually take hundreds of MB when they are
/// uncompressed: by streaming it instead of loading it entirely,
/// you avoid saturating the memory and have almost no loading delay.
///
-/// Apart from that, sf::Music has almost the same features as
+/// Apart from that, a sf::Music has almost the same features as
/// the sf::SoundBuffer / sf::Sound pair: you can play/pause/stop
/// it, request its parameters (channels, sample rate), change
/// the way it is played (pitch, volume, 3D position, ...), etc.
diff --git a/include/SFML/Audio/OutputSoundFile.hpp b/include/SFML/Audio/OutputSoundFile.hpp
new file mode 100644
index 0000000..8f60498
--- /dev/null
+++ b/include/SFML/Audio/OutputSoundFile.hpp
@@ -0,0 +1,133 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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_OUTPUTSOUNDFILE_HPP
+#define SFML_OUTPUTSOUNDFILE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/Export.hpp>
+#include <SFML/System/NonCopyable.hpp>
+#include <string>
+
+
+namespace sf
+{
+class SoundFileWriter;
+
+////////////////////////////////////////////////////////////
+/// \brief Provide write access to sound files
+///
+////////////////////////////////////////////////////////////
+class SFML_AUDIO_API OutputSoundFile : NonCopyable
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ OutputSoundFile();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ /// Closes the file if it was still open.
+ ///
+ ////////////////////////////////////////////////////////////
+ ~OutputSoundFile();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open the sound file from the disk for writing
+ ///
+ /// The supported audio formats are: WAV, OGG/Vorbis, FLAC.
+ ///
+ /// \param filename Path of the sound file to write
+ /// \param sampleRate Sample rate of the sound
+ /// \param channelCount Number of channels in the sound
+ ///
+ /// \return True if the file was successfully opened
+ ///
+ ////////////////////////////////////////////////////////////
+ bool openFromFile(const std::string& filename, unsigned int sampleRate, unsigned int channelCount);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Write audio samples to the file
+ ///
+ /// \param samples Pointer to the sample array to write
+ /// \param count Number of samples to write
+ ///
+ ////////////////////////////////////////////////////////////
+ void write(const Int16* samples, Uint64 count);
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Close the current file
+ ///
+ ////////////////////////////////////////////////////////////
+ void close();
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ SoundFileWriter* m_writer; ///< Writer that handles I/O on the file's format
+};
+
+} // namespace sf
+
+
+#endif // SFML_OUTPUTSOUNDFILE_HPP
+
+
+////////////////////////////////////////////////////////////
+/// \class sf::OutputSoundFile
+/// \ingroup audio
+///
+/// This class encodes audio samples to a sound file. It is
+/// used internally by higher-level classes such as sf::SoundBuffer,
+/// but can also be useful if you want to create audio files from
+/// custom data sources, like generated audio samples.
+///
+/// Usage example:
+/// \code
+/// // Create a sound file, ogg/vorbis format, 44100 Hz, stereo
+/// sf::OutputSoundFile file;
+/// if (!file.openFromFile("music.ogg", 44100, 2))
+/// /* error */;
+///
+/// while (...)
+/// {
+/// // Read or generate audio samples from your custom source
+/// std::vector<sf::Int16> samples = ...;
+///
+/// // Write them to the file
+/// file.write(samples.data(), samples.size());
+/// }
+/// \endcode
+///
+/// \see sf::SoundFileWriter, sf::InputSoundFile
+///
+////////////////////////////////////////////////////////////
diff --git a/include/SFML/Audio/Sound.hpp b/include/SFML/Audio/Sound.hpp
index dbd5869..8b0771d 100644
--- a/include/SFML/Audio/Sound.hpp
+++ b/include/SFML/Audio/Sound.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Audio/SoundBuffer.hpp b/include/SFML/Audio/SoundBuffer.hpp
index 392b461..42eda6f 100644
--- a/include/SFML/Audio/SoundBuffer.hpp
+++ b/include/SFML/Audio/SoundBuffer.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Audio/Export.hpp>
+#include <SFML/Audio/AlResource.hpp>
#include <SFML/System/Time.hpp>
#include <string>
#include <vector>
@@ -37,19 +38,15 @@
namespace sf
{
-namespace priv
-{
- class SoundFile;
-}
-
class Sound;
+class InputSoundFile;
class InputStream;
////////////////////////////////////////////////////////////
/// \brief Storage for audio samples defining a sound
///
////////////////////////////////////////////////////////////
-class SFML_AUDIO_API SoundBuffer
+class SFML_AUDIO_API SoundBuffer : AlResource
{
public:
@@ -76,9 +73,8 @@ public:
////////////////////////////////////////////////////////////
/// \brief Load the sound buffer from a file
///
- /// Here is a complete list of all the supported audio formats:
- /// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
- /// w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
+ /// See the documentation of sf::InputSoundFile for the list
+ /// of supported formats.
///
/// \param filename Path of the sound file to load
///
@@ -92,9 +88,8 @@ public:
////////////////////////////////////////////////////////////
/// \brief Load the sound buffer from a file in memory
///
- /// Here is a complete list of all the supported audio formats:
- /// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
- /// w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
+ /// See the documentation of sf::InputSoundFile for the list
+ /// of supported formats.
///
/// \param data Pointer to the file data in memory
/// \param sizeInBytes Size of the data to load, in bytes
@@ -109,9 +104,8 @@ public:
////////////////////////////////////////////////////////////
/// \brief Load the sound buffer from a custom stream
///
- /// Here is a complete list of all the supported audio formats:
- /// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
- /// w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
+ /// See the documentation of sf::InputSoundFile for the list
+ /// of supported formats.
///
/// \param stream Source stream to read from
///
@@ -138,14 +132,13 @@ public:
/// \see loadFromFile, loadFromMemory, saveToFile
///
////////////////////////////////////////////////////////////
- bool loadFromSamples(const Int16* samples, std::size_t sampleCount, unsigned int channelCount, unsigned int sampleRate);
+ bool loadFromSamples(const Int16* samples, Uint64 sampleCount, unsigned int channelCount, unsigned int sampleRate);
////////////////////////////////////////////////////////////
/// \brief Save the sound buffer to an audio file
///
- /// Here is a complete list of all the supported audio formats:
- /// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
- /// w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
+ /// See the documentation of sf::OutputSoundFile for the list
+ /// of supported formats.
///
/// \param filename Path of the sound file to write
///
@@ -181,7 +174,7 @@ public:
/// \see getSamples
///
////////////////////////////////////////////////////////////
- std::size_t getSampleCount() const;
+ Uint64 getSampleCount() const;
////////////////////////////////////////////////////////////
/// \brief Get the sample rate of the sound
@@ -239,10 +232,10 @@ private:
///
/// \param file Sound file providing access to the new loaded sound
///
- /// \return True on succesful initialization, false on failure
+ /// \return True on successful initialization, false on failure
///
////////////////////////////////////////////////////////////
- bool initialize(priv::SoundFile& file);
+ bool initialize(InputSoundFile& file);
////////////////////////////////////////////////////////////
/// \brief Update the internal buffer with the cached audio samples
@@ -298,7 +291,7 @@ private:
/// A sound buffer holds the data of a sound, which is
/// an array of audio samples. A sample is a 16 bits signed integer
/// that defines the amplitude of the sound at a given time.
-/// The sound is then restituted by playing these samples at
+/// The sound is then reconstituted by playing these samples at
/// a high rate (for example, 44100 samples per second is the
/// standard rate used for playing CDs). In short, audio samples
/// are like texture pixels, and a sf::SoundBuffer is similar to
@@ -331,20 +324,20 @@ private:
/// \code
/// // Declare a new sound buffer
/// sf::SoundBuffer buffer;
-///
+///
/// // Load it from a file
/// if (!buffer.loadFromFile("sound.wav"))
/// {
/// // error...
/// }
-///
+///
/// // Create a sound source and bind it to the buffer
/// sf::Sound sound1;
/// sound1.setBuffer(buffer);
-///
+///
/// // Play the sound
/// sound1.play();
-///
+///
/// // Create another sound source bound to the same buffer
/// sf::Sound sound2;
/// sound2.setBuffer(buffer);
diff --git a/include/SFML/Audio/SoundBufferRecorder.hpp b/include/SFML/Audio/SoundBufferRecorder.hpp
index cb174b0..7715ac5 100644
--- a/include/SFML/Audio/SoundBufferRecorder.hpp
+++ b/include/SFML/Audio/SoundBufferRecorder.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Audio/SoundFileFactory.hpp b/include/SFML/Audio/SoundFileFactory.hpp
new file mode 100644
index 0000000..bd346cc
--- /dev/null
+++ b/include/SFML/Audio/SoundFileFactory.hpp
@@ -0,0 +1,197 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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_SOUNDFILEFACTORY_HPP
+#define SFML_SOUNDFILEFACTORY_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/Export.hpp>
+#include <string>
+#include <vector>
+
+
+namespace sf
+{
+class InputStream;
+class SoundFileReader;
+class SoundFileWriter;
+
+////////////////////////////////////////////////////////////
+/// \brief Manages and instantiates sound file readers and writers
+///
+////////////////////////////////////////////////////////////
+class SFML_AUDIO_API SoundFileFactory
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Register a new reader
+ ///
+ /// \see unregisterReader
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename T>
+ static void registerReader();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Unregister a reader
+ ///
+ /// \see registerReader
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename T>
+ static void unregisterReader();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Register a new writer
+ ///
+ /// \see unregisterWriter
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename T>
+ static void registerWriter();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Unregister a writer
+ ///
+ /// \see registerWriter
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename T>
+ static void unregisterWriter();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Instantiate the right reader for the given file on disk
+ ///
+ /// It's up to the caller to release the returned reader
+ ///
+ /// \param filename Path of the sound file
+ ///
+ /// \return A new sound file reader that can read the given file, or null if no reader can handle it
+ ///
+ /// \see createReaderFromMemory, createReaderFromStream
+ ///
+ ////////////////////////////////////////////////////////////
+ static SoundFileReader* createReaderFromFilename(const std::string& filename);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Instantiate the right codec for the given file in memory
+ ///
+ /// It's up to the caller to release the returned reader
+ ///
+ /// \param data Pointer to the file data in memory
+ /// \param sizeInBytes Total size of the file data, in bytes
+ ///
+ /// \return A new sound file codec that can read the given file, or null if no codec can handle it
+ ///
+ /// \see createReaderFromFilename, createReaderFromStream
+ ///
+ ////////////////////////////////////////////////////////////
+ static SoundFileReader* createReaderFromMemory(const void* data, std::size_t sizeInBytes);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Instantiate the right codec for the given file in stream
+ ///
+ /// It's up to the caller to release the returned reader
+ ///
+ /// \param stream Source stream to read from
+ ///
+ /// \return A new sound file codec that can read the given file, or null if no codec can handle it
+ ///
+ /// \see createReaderFromFilename, createReaderFromMemory
+ ///
+ ////////////////////////////////////////////////////////////
+ static SoundFileReader* createReaderFromStream(InputStream& stream);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Instantiate the right writer for the given file on disk
+ ///
+ /// It's up to the caller to release the returned writer
+ ///
+ /// \param filename Path of the sound file
+ ///
+ /// \return A new sound file writer that can write given file, or null if no writer can handle it
+ ///
+ ////////////////////////////////////////////////////////////
+ static SoundFileWriter* createWriterFromFilename(const std::string& filename);
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ // Types
+ ////////////////////////////////////////////////////////////
+ struct ReaderFactory
+ {
+ bool (*check)(InputStream&);
+ SoundFileReader* (*create)();
+ };
+ typedef std::vector<ReaderFactory> ReaderFactoryArray;
+
+ struct WriterFactory
+ {
+ bool (*check)(const std::string&);
+ SoundFileWriter* (*create)();
+ };
+ typedef std::vector<WriterFactory> WriterFactoryArray;
+
+ ////////////////////////////////////////////////////////////
+ // Static member data
+ ////////////////////////////////////////////////////////////
+ static ReaderFactoryArray s_readers; ///< List of all registered readers
+ static WriterFactoryArray s_writers; ///< List of all registered writers
+};
+
+} // namespace sf
+
+#include <SFML/Audio/SoundFileFactory.inl>
+
+#endif // SFML_SOUNDFILEFACTORY_HPP
+
+
+////////////////////////////////////////////////////////////
+/// \class sf::SoundFileFactory
+/// \ingroup audio
+///
+/// This class is where all the sound file readers and writers are
+/// registered. You should normally only need to use its registration
+/// and unregistration functions; readers/writers creation and manipulation
+/// are wrapped into the higher-level classes sf::InputSoundFile and
+/// sf::OutputSoundFile.
+///
+/// To register a new reader (writer) use the sf::SoundFileFactory::registerReader
+/// (registerWriter) static function. You don't have to call the unregisterReader
+/// (unregisterWriter) function, unless you want to unregister a format before your
+/// application ends (typically, when a plugin is unloaded).
+///
+/// Usage example:
+/// \code
+/// sf::SoundFileFactory::registerReader<MySoundFileReader>();
+/// sf::SoundFileFactory::registerWriter<MySoundFileWriter>();
+/// \endcode
+///
+/// \see sf::InputSoundFile, sf::OutputSoundFile, sf::SoundFileReader, sf::SoundFileWriter
+///
+////////////////////////////////////////////////////////////
diff --git a/include/SFML/Audio/SoundFileFactory.inl b/include/SFML/Audio/SoundFileFactory.inl
new file mode 100644
index 0000000..19d334b
--- /dev/null
+++ b/include/SFML/Audio/SoundFileFactory.inl
@@ -0,0 +1,100 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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
+////////////////////////////////////////////////////////////
+
+
+namespace sf
+{
+namespace priv
+{
+ template <typename T> SoundFileReader* createReader() {return new T;}
+ template <typename T> SoundFileWriter* createWriter() {return new T;}
+}
+
+////////////////////////////////////////////////////////////
+template <typename T>
+void SoundFileFactory::registerReader()
+{
+ // Make sure the same class won't be registered twice
+ unregisterReader<T>();
+
+ // Create a new factory with the functions provided by the class
+ ReaderFactory factory;
+ factory.check = &T::check;
+ factory.create = &priv::createReader<T>;
+
+ // Add it
+ s_readers.push_back(factory);
+}
+
+
+////////////////////////////////////////////////////////////
+template <typename T>
+void SoundFileFactory::unregisterReader()
+{
+ // Remove the instance(s) of the reader from the array of factories
+ for (ReaderFactoryArray::iterator it = s_readers.begin(); it != s_readers.end(); )
+ {
+ if (it->create == &priv::createReader<T>)
+ it = s_readers.erase(it);
+ else
+ ++it;
+ }
+}
+
+////////////////////////////////////////////////////////////
+template <typename T>
+void SoundFileFactory::registerWriter()
+{
+ // Make sure the same class won't be registered twice
+ unregisterWriter<T>();
+
+ // Create a new factory with the functions provided by the class
+ WriterFactory factory;
+ factory.check = &T::check;
+ factory.create = &priv::createWriter<T>;
+
+ // Add it
+ s_writers.push_back(factory);
+}
+
+
+////////////////////////////////////////////////////////////
+template <typename T>
+void SoundFileFactory::unregisterWriter()
+{
+ // Remove the instance(s) of the writer from the array of factories
+ for (WriterFactoryArray::iterator it = s_writers.begin(); it != s_writers.end(); )
+ {
+ if (it->create == &priv::createWriter<T>)
+ it = s_writers.erase(it);
+ else
+ ++it;
+ }
+}
+
+} // namespace sf
diff --git a/include/SFML/Audio/SoundFileReader.hpp b/include/SFML/Audio/SoundFileReader.hpp
new file mode 100644
index 0000000..549f50b
--- /dev/null
+++ b/include/SFML/Audio/SoundFileReader.hpp
@@ -0,0 +1,161 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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_SOUNDFILEREADER_HPP
+#define SFML_SOUNDFILEREADER_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/Export.hpp>
+#include <string>
+
+
+namespace sf
+{
+class InputStream;
+
+////////////////////////////////////////////////////////////
+/// \brief Abstract base class for sound file decoding
+///
+////////////////////////////////////////////////////////////
+class SFML_AUDIO_API SoundFileReader
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Structure holding the audio properties of a sound file
+ ///
+ ////////////////////////////////////////////////////////////
+ struct Info
+ {
+ Uint64 sampleCount; ///< Total number of samples in the file
+ unsigned int channelCount; ///< Number of channels of the sound
+ unsigned int sampleRate; ///< Samples rate of the sound, in samples per second
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Virtual destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~SoundFileReader() {}
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open a sound file for reading
+ ///
+ /// The provided stream reference is valid as long as the
+ /// SoundFileReader is alive, so it is safe to use/store it
+ /// during the whole lifetime of the reader.
+ ///
+ /// \param stream Source stream to read from
+ /// \param info Structure to fill with the properties of the loaded sound
+ ///
+ /// \return True if the file was successfully opened
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool open(InputStream& stream, Info& info) = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the current read position to the given sample offset
+ ///
+ /// If the given offset exceeds to total number of samples,
+ /// this function must jump to the end of the file.
+ ///
+ /// \param sampleOffset Index of the sample to jump to, relative to the beginning
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void seek(Uint64 sampleOffset) = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Read audio samples from the open file
+ ///
+ /// \param samples Pointer to the sample array to fill
+ /// \param maxCount Maximum number of samples to read
+ ///
+ /// \return Number of samples actually read (may be less than \a maxCount)
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Uint64 read(Int16* samples, Uint64 maxCount) = 0;
+};
+
+} // namespace sf
+
+
+#endif // SFML_SOUNDFILEREADER_HPP
+
+
+////////////////////////////////////////////////////////////
+/// \class sf::SoundFileReader
+/// \ingroup audio
+///
+/// This class allows users to read audio file formats not natively
+/// supported by SFML, and thus extend the set of supported readable
+/// audio formats.
+///
+/// A valid sound file reader must override the open, seek and write functions,
+/// as well as providing a static check function; the latter is used by
+/// SFML to find a suitable writer for a given input file.
+///
+/// To register a new reader, use the sf::SoundFileFactory::registerReader
+/// template function.
+///
+/// Usage example:
+/// \code
+/// class MySoundFileReader : public sf::SoundFileReader
+/// {
+/// public:
+///
+/// static bool check(sf::InputStream& stream)
+/// {
+/// // typically, read the first few header bytes and check fields that identify the format
+/// // return true if the reader can handle the format
+/// }
+///
+/// virtual bool open(sf::InputStream& stream, Info& info)
+/// {
+/// // read the sound file header and fill the sound attributes
+/// // (channel count, sample count and sample rate)
+/// // return true on success
+/// }
+///
+/// virtual void seek(sf::Uint64 sampleOffset)
+/// {
+/// // advance to the sampleOffset-th sample from the beginning of the sound
+/// }
+///
+/// virtual sf::Uint64 read(sf::Int16* samples, sf::Uint64 maxCount)
+/// {
+/// // read up to 'maxCount' samples into the 'samples' array,
+/// // convert them (for example from normalized float) if they are not stored
+/// // as 16-bits signed integers in the file
+/// // return the actual number of samples read
+/// }
+/// };
+///
+/// sf::SoundFileFactory::registerReader<MySoundFileReader>();
+/// \endcode
+///
+/// \see sf::InputSoundFile, sf::SoundFileFactory, sf::SoundFileWriter
+///
+////////////////////////////////////////////////////////////
diff --git a/include/SFML/Audio/SoundFileWriter.hpp b/include/SFML/Audio/SoundFileWriter.hpp
new file mode 100644
index 0000000..36a2678
--- /dev/null
+++ b/include/SFML/Audio/SoundFileWriter.hpp
@@ -0,0 +1,125 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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_SOUNDFILEWRITER_HPP
+#define SFML_SOUNDFILEWRITER_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/Export.hpp>
+#include <string>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// \brief Abstract base class for sound file encoding
+///
+////////////////////////////////////////////////////////////
+class SFML_AUDIO_API SoundFileWriter
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Virtual destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~SoundFileWriter() {}
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open a sound file for writing
+ ///
+ /// \param filename Path of the file to open
+ /// \param sampleRate Sample rate of the sound
+ /// \param channelCount Number of channels of the sound
+ ///
+ /// \return True if the file was successfully opened
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount) = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Write audio samples to the open file
+ ///
+ /// \param samples Pointer to the sample array to write
+ /// \param count Number of samples to write
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void write(const Int16* samples, Uint64 count) = 0;
+};
+
+} // namespace sf
+
+
+#endif // SFML_SOUNDFILEWRITER_HPP
+
+
+////////////////////////////////////////////////////////////
+/// \class sf::SoundFileWriter
+/// \ingroup audio
+///
+/// This class allows users to write audio file formats not natively
+/// supported by SFML, and thus extend the set of supported writable
+/// audio formats.
+///
+/// A valid sound file writer must override the open and write functions,
+/// as well as providing a static check function; the latter is used by
+/// SFML to find a suitable writer for a given filename.
+///
+/// To register a new writer, use the sf::SoundFileFactory::registerWriter
+/// template function.
+///
+/// Usage example:
+/// \code
+/// class MySoundFileWriter : public sf::SoundFileWriter
+/// {
+/// public:
+///
+/// static bool check(const std::string& filename)
+/// {
+/// // typically, check the extension
+/// // return true if the writer can handle the format
+/// }
+///
+/// virtual bool open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount)
+/// {
+/// // open the file 'filename' for writing,
+/// // write the given sample rate and channel count to the file header
+/// // return true on success
+/// }
+///
+/// virtual void write(const sf::Int16* samples, sf::Uint64 count)
+/// {
+/// // write 'count' samples stored at address 'samples',
+/// // convert them (for example to normalized float) if the format requires it
+/// }
+/// };
+///
+/// sf::SoundFileFactory::registerWriter<MySoundFileWriter>();
+/// \endcode
+///
+/// \see sf::OutputSoundFile, sf::SoundFileFactory, sf::SoundFileReader
+///
+////////////////////////////////////////////////////////////
diff --git a/include/SFML/Audio/SoundRecorder.hpp b/include/SFML/Audio/SoundRecorder.hpp
index 733fd32..ab0eb24 100644
--- a/include/SFML/Audio/SoundRecorder.hpp
+++ b/include/SFML/Audio/SoundRecorder.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Audio/Export.hpp>
+#include <SFML/Audio/AlResource.hpp>
#include <SFML/System/Thread.hpp>
#include <SFML/System/Time.hpp>
#include <vector>
@@ -41,7 +42,7 @@ namespace sf
/// \brief Abstract base class for capturing sound data
///
////////////////////////////////////////////////////////////
-class SFML_AUDIO_API SoundRecorder
+class SFML_AUDIO_API SoundRecorder : AlResource
{
public:
diff --git a/include/SFML/Audio/SoundSource.hpp b/include/SFML/Audio/SoundSource.hpp
index f8ba48a..cde0a3b 100644
--- a/include/SFML/Audio/SoundSource.hpp
+++ b/include/SFML/Audio/SoundSource.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Audio/Export.hpp>
+#include <SFML/Audio/AlResource.hpp>
#include <SFML/System/Vector3.hpp>
@@ -38,7 +39,7 @@ namespace sf
/// \brief Base class defining a sound's properties
///
////////////////////////////////////////////////////////////
-class SFML_AUDIO_API SoundSource
+class SFML_AUDIO_API SoundSource : AlResource
{
public:
diff --git a/include/SFML/Audio/SoundStream.hpp b/include/SFML/Audio/SoundStream.hpp
index e79d879..22ae8cd 100644
--- a/include/SFML/Audio/SoundStream.hpp
+++ b/include/SFML/Audio/SoundStream.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Config.hpp b/include/SFML/Config.hpp
index a5ad154..58e9797 100644
--- a/include/SFML/Config.hpp
+++ b/include/SFML/Config.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,7 +30,7 @@
// Define the SFML version
////////////////////////////////////////////////////////////
#define SFML_VERSION_MAJOR 2
-#define SFML_VERSION_MINOR 2
+#define SFML_VERSION_MINOR 3
#define SFML_VERSION_PATCH 0
diff --git a/include/SFML/Graphics.hpp b/include/SFML/Graphics.hpp
index ac5231c..7a7f4da 100644
--- a/include/SFML/Graphics.hpp
+++ b/include/SFML/Graphics.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -31,22 +31,27 @@
#include <SFML/Window.hpp>
#include <SFML/Graphics/BlendMode.hpp>
+#include <SFML/Graphics/CircleShape.hpp>
#include <SFML/Graphics/Color.hpp>
+#include <SFML/Graphics/ConvexShape.hpp>
+#include <SFML/Graphics/Drawable.hpp>
#include <SFML/Graphics/Font.hpp>
#include <SFML/Graphics/Glyph.hpp>
#include <SFML/Graphics/Image.hpp>
+#include <SFML/Graphics/PrimitiveType.hpp>
+#include <SFML/Graphics/Rect.hpp>
+#include <SFML/Graphics/RectangleShape.hpp>
#include <SFML/Graphics/RenderStates.hpp>
+#include <SFML/Graphics/RenderTarget.hpp>
#include <SFML/Graphics/RenderTexture.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/Shader.hpp>
#include <SFML/Graphics/Shape.hpp>
-#include <SFML/Graphics/CircleShape.hpp>
-#include <SFML/Graphics/RectangleShape.hpp>
-#include <SFML/Graphics/ConvexShape.hpp>
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/Graphics/Text.hpp>
#include <SFML/Graphics/Texture.hpp>
#include <SFML/Graphics/Transform.hpp>
+#include <SFML/Graphics/Transformable.hpp>
#include <SFML/Graphics/Vertex.hpp>
#include <SFML/Graphics/VertexArray.hpp>
#include <SFML/Graphics/View.hpp>
diff --git a/include/SFML/Graphics/BlendMode.hpp b/include/SFML/Graphics/BlendMode.hpp
index 412286d..7f5803b 100644
--- a/include/SFML/Graphics/BlendMode.hpp
+++ b/include/SFML/Graphics/BlendMode.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -146,7 +146,7 @@ SFML_GRAPHICS_API bool operator !=(const BlendMode& left, const BlendMode& right
////////////////////////////////////////////////////////////
// Commonly used blending modes
////////////////////////////////////////////////////////////
-SFML_GRAPHICS_API extern const BlendMode BlendAlpha; ///< Blend source and dest according to dest alpha
+SFML_GRAPHICS_API extern const BlendMode BlendAlpha; ///< Blend source and dest according to dest alpha
SFML_GRAPHICS_API extern const BlendMode BlendAdd; ///< Add source to dest
SFML_GRAPHICS_API extern const BlendMode BlendMultiply; ///< Multiply source and dest
SFML_GRAPHICS_API extern const BlendMode BlendNone; ///< Overwrite dest with source
@@ -164,7 +164,7 @@ SFML_GRAPHICS_API extern const BlendMode BlendNone; ///< Overwrite dest with
/// sf::BlendMode is a class that represents a blend mode. A blend
/// mode determines how the colors of an object you draw are
/// mixed with the colors that are already in the buffer.
-///
+///
/// The class is composed of 6 components, each of which has its
/// own public member variable:
/// \li %Color Source Factor (@ref colorSrcFactor)
@@ -173,7 +173,7 @@ SFML_GRAPHICS_API extern const BlendMode BlendNone; ///< Overwrite dest with
/// \li Alpha Source Factor (@ref alphaSrcFactor)
/// \li Alpha Destination Factor (@ref alphaDstFactor)
/// \li Alpha Blend Equation (@ref alphaEquation)
-///
+///
/// The source factor specifies how the pixel you are drawing contributes
/// to the final color. The destination factor specifies how the pixel
/// already drawn in the buffer contributes to the final color.
diff --git a/include/SFML/Graphics/CircleShape.hpp b/include/SFML/Graphics/CircleShape.hpp
index 07e35ca..2d5ac00 100644
--- a/include/SFML/Graphics/CircleShape.hpp
+++ b/include/SFML/Graphics/CircleShape.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -49,7 +49,7 @@ public:
/// \param pointCount Number of points composing the circle
///
////////////////////////////////////////////////////////////
- explicit CircleShape(float radius = 0, unsigned int pointCount = 30);
+ explicit CircleShape(float radius = 0, std::size_t pointCount = 30);
////////////////////////////////////////////////////////////
/// \brief Set the radius of the circle
@@ -79,7 +79,7 @@ public:
/// \see getPointCount
///
////////////////////////////////////////////////////////////
- void setPointCount(unsigned int count);
+ void setPointCount(std::size_t count);
////////////////////////////////////////////////////////////
/// \brief Get the number of points of the circle
@@ -89,7 +89,7 @@ public:
/// \see setPointCount
///
////////////////////////////////////////////////////////////
- virtual unsigned int getPointCount() const;
+ virtual std::size_t getPointCount() const;
////////////////////////////////////////////////////////////
/// \brief Get a point of the circle
@@ -104,15 +104,15 @@ public:
/// \return index-th point of the shape
///
////////////////////////////////////////////////////////////
- virtual Vector2f getPoint(unsigned int index) const;
+ virtual Vector2f getPoint(std::size_t index) const;
private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
- float m_radius; ///< Radius of the circle
- unsigned int m_pointCount; ///< Number of points composing the circle
+ float m_radius; ///< Radius of the circle
+ std::size_t m_pointCount; ///< Number of points composing the circle
};
} // namespace sf
diff --git a/include/SFML/Graphics/Color.hpp b/include/SFML/Graphics/Color.hpp
index 8c81e3c..87a1598 100644
--- a/include/SFML/Graphics/Color.hpp
+++ b/include/SFML/Graphics/Color.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -62,6 +62,22 @@ public:
Color(Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha = 255);
////////////////////////////////////////////////////////////
+ /// \brief Construct the color from 32-bit unsigned integer
+ ///
+ /// \param color Number containing the RGBA components (in that order)
+ ///
+ ////////////////////////////////////////////////////////////
+ explicit Color(Uint32 color);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Retrieve the color as a 32-bit unsigned integer
+ ///
+ /// \return Color represented as a 32-bit unsigned integer
+ ///
+ ////////////////////////////////////////////////////////////
+ Uint32 toInteger() const;
+
+ ////////////////////////////////////////////////////////////
// Static member data
////////////////////////////////////////////////////////////
static const Color Black; ///< Black predefined color
diff --git a/include/SFML/Graphics/ConvexShape.hpp b/include/SFML/Graphics/ConvexShape.hpp
index 080ca04..82991a7 100644
--- a/include/SFML/Graphics/ConvexShape.hpp
+++ b/include/SFML/Graphics/ConvexShape.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -49,7 +49,7 @@ public:
/// \param pointCount Number of points of the polygon
///
////////////////////////////////////////////////////////////
- explicit ConvexShape(unsigned int pointCount = 0);
+ explicit ConvexShape(std::size_t pointCount = 0);
////////////////////////////////////////////////////////////
/// \brief Set the number of points of the polygon
@@ -61,7 +61,7 @@ public:
/// \see getPointCount
///
////////////////////////////////////////////////////////////
- void setPointCount(unsigned int count);
+ void setPointCount(std::size_t count);
////////////////////////////////////////////////////////////
/// \brief Get the number of points of the polygon
@@ -71,7 +71,7 @@ public:
/// \see setPointCount
///
////////////////////////////////////////////////////////////
- virtual unsigned int getPointCount() const;
+ virtual std::size_t getPointCount() const;
////////////////////////////////////////////////////////////
/// \brief Set the position of a point
@@ -88,7 +88,7 @@ public:
/// \see getPoint
///
////////////////////////////////////////////////////////////
- void setPoint(unsigned int index, const Vector2f& point);
+ void setPoint(std::size_t index, const Vector2f& point);
////////////////////////////////////////////////////////////
/// \brief Get the position of a point
@@ -105,7 +105,7 @@ public:
/// \see setPoint
///
////////////////////////////////////////////////////////////
- virtual Vector2f getPoint(unsigned int index) const;
+ virtual Vector2f getPoint(std::size_t index) const;
private:
diff --git a/include/SFML/Graphics/Drawable.hpp b/include/SFML/Graphics/Drawable.hpp
index 8e30a6d..5ddf2da 100644
--- a/include/SFML/Graphics/Drawable.hpp
+++ b/include/SFML/Graphics/Drawable.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Graphics/Export.hpp b/include/SFML/Graphics/Export.hpp
index 3109fcd..624f1eb 100644
--- a/include/SFML/Graphics/Export.hpp
+++ b/include/SFML/Graphics/Export.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Graphics/Font.hpp b/include/SFML/Graphics/Font.hpp
index 8b360c9..84eee27 100644
--- a/include/SFML/Graphics/Font.hpp
+++ b/include/SFML/Graphics/Font.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Graphics/Glyph.hpp b/include/SFML/Graphics/Glyph.hpp
index bdc3357..0068872 100644
--- a/include/SFML/Graphics/Glyph.hpp
+++ b/include/SFML/Graphics/Glyph.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Graphics/Image.hpp b/include/SFML/Graphics/Image.hpp
index 82f77ef..11dc8f7 100644
--- a/include/SFML/Graphics/Image.hpp
+++ b/include/SFML/Graphics/Image.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -193,7 +193,7 @@ public:
/// \param destX X coordinate of the destination position
/// \param destY Y coordinate of the destination position
/// \param sourceRect Sub-rectangle of the source image to copy
- /// \param applyAlpha Should the copy take in account the source transparency?
+ /// \param applyAlpha Should the copy take into account the source transparency?
///
////////////////////////////////////////////////////////////
void copy(const Image& source, unsigned int destX, unsigned int destY, const IntRect& sourceRect = IntRect(0, 0, 0, 0), bool applyAlpha = false);
diff --git a/include/SFML/Graphics/PrimitiveType.hpp b/include/SFML/Graphics/PrimitiveType.hpp
index 16e7d35..9dae947 100644
--- a/include/SFML/Graphics/PrimitiveType.hpp
+++ b/include/SFML/Graphics/PrimitiveType.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Graphics/Rect.hpp b/include/SFML/Graphics/Rect.hpp
index 06abfb8..f11a920 100644
--- a/include/SFML/Graphics/Rect.hpp
+++ b/include/SFML/Graphics/Rect.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Graphics/Rect.inl b/include/SFML/Graphics/Rect.inl
index 849fc82..9ac4870 100644
--- a/include/SFML/Graphics/Rect.inl
+++ b/include/SFML/Graphics/Rect.inl
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Graphics/RectangleShape.hpp b/include/SFML/Graphics/RectangleShape.hpp
index 8677cc6..3195dc3 100644
--- a/include/SFML/Graphics/RectangleShape.hpp
+++ b/include/SFML/Graphics/RectangleShape.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -77,7 +77,7 @@ public:
/// shapes, this number is always 4.
///
////////////////////////////////////////////////////////////
- virtual unsigned int getPointCount() const;
+ virtual std::size_t getPointCount() const;
////////////////////////////////////////////////////////////
/// \brief Get a point of the rectangle
@@ -92,7 +92,7 @@ public:
/// \return index-th point of the shape
///
////////////////////////////////////////////////////////////
- virtual Vector2f getPoint(unsigned int index) const;
+ virtual Vector2f getPoint(std::size_t index) const;
private:
diff --git a/include/SFML/Graphics/RenderStates.hpp b/include/SFML/Graphics/RenderStates.hpp
index 2a5ac9a..b23a778 100644
--- a/include/SFML/Graphics/RenderStates.hpp
+++ b/include/SFML/Graphics/RenderStates.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Graphics/RenderTarget.hpp b/include/SFML/Graphics/RenderTarget.hpp
index 01c11e9..eb02355 100644
--- a/include/SFML/Graphics/RenderTarget.hpp
+++ b/include/SFML/Graphics/RenderTarget.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -244,7 +244,7 @@ public:
/// \param states Render states to use for drawing
///
////////////////////////////////////////////////////////////
- void draw(const Vertex* vertices, unsigned int vertexCount,
+ void draw(const Vertex* vertices, std::size_t vertexCount,
PrimitiveType type, const RenderStates& states = RenderStates::Default);
////////////////////////////////////////////////////////////
diff --git a/include/SFML/Graphics/RenderTexture.hpp b/include/SFML/Graphics/RenderTexture.hpp
index ff7ae1d..5d38562 100644
--- a/include/SFML/Graphics/RenderTexture.hpp
+++ b/include/SFML/Graphics/RenderTexture.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Graphics/RenderWindow.hpp b/include/SFML/Graphics/RenderWindow.hpp
index 5ff4a68..98e5b9a 100644
--- a/include/SFML/Graphics/RenderWindow.hpp
+++ b/include/SFML/Graphics/RenderWindow.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Graphics/Shader.hpp b/include/SFML/Graphics/Shader.hpp
index c60db27..d3278f9 100644
--- a/include/SFML/Graphics/Shader.hpp
+++ b/include/SFML/Graphics/Shader.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -457,6 +457,18 @@ public:
void setParameter(const std::string& name, CurrentTextureType);
////////////////////////////////////////////////////////////
+ /// \brief Get the underlying OpenGL handle of the shader.
+ ///
+ /// You shouldn't need to use this function, unless you have
+ /// very specific stuff to implement that SFML doesn't support,
+ /// or implement a temporary workaround until a bug is fixed.
+ ///
+ /// \return OpenGL handle of the shader or 0 if not yet loaded
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int getNativeHandle() const;
+
+ ////////////////////////////////////////////////////////////
/// \brief Bind a shader for rendering
///
/// This function is not part of the graphics API, it mustn't be
diff --git a/include/SFML/Graphics/Shape.hpp b/include/SFML/Graphics/Shape.hpp
index fd5491c..5983a9d 100644
--- a/include/SFML/Graphics/Shape.hpp
+++ b/include/SFML/Graphics/Shape.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -193,7 +193,7 @@ public:
/// \see getPoint
///
////////////////////////////////////////////////////////////
- virtual unsigned int getPointCount() const = 0;
+ virtual std::size_t getPointCount() const = 0;
////////////////////////////////////////////////////////////
/// \brief Get a point of the shape
@@ -210,7 +210,7 @@ public:
/// \see getPointCount
///
////////////////////////////////////////////////////////////
- virtual Vector2f getPoint(unsigned int index) const = 0;
+ virtual Vector2f getPoint(std::size_t index) const = 0;
////////////////////////////////////////////////////////////
/// \brief Get the local bounding rectangle of the entity
@@ -227,13 +227,20 @@ public:
FloatRect getLocalBounds() const;
////////////////////////////////////////////////////////////
- /// \brief Get the global bounding rectangle of the entity
+ /// \brief Get the global (non-minimal) bounding rectangle of the entity
///
/// The returned rectangle is in global coordinates, which means
- /// that it takes in account the transformations (translation,
+ /// that it takes into account the transformations (translation,
/// rotation, scale, ...) that are applied to the entity.
/// In other words, this function returns the bounds of the
- /// sprite in the global 2D world's coordinate system.
+ /// shape in the global 2D world's coordinate system.
+ ///
+ /// This function does not necessarily return the \a minimal
+ /// bounding rectangle. It merely ensures that the returned
+ /// rectangle covers all the vertices (but possibly more).
+ /// This allows for a fast approximation of the bounds as a
+ /// first check; you may want to use more precise checks
+ /// on top of that.
///
/// \return Global bounding rectangle of the entity
///
diff --git a/include/SFML/Graphics/Sprite.hpp b/include/SFML/Graphics/Sprite.hpp
index 2b48384..c7447df 100644
--- a/include/SFML/Graphics/Sprite.hpp
+++ b/include/SFML/Graphics/Sprite.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -179,7 +179,7 @@ public:
/// \brief Get the global bounding rectangle of the entity
///
/// The returned rectangle is in global coordinates, which means
- /// that it takes in account the transformations (translation,
+ /// that it takes into account the transformations (translation,
/// rotation, scale, ...) that are applied to the entity.
/// In other words, this function returns the bounds of the
/// sprite in the global 2D world's coordinate system.
@@ -262,7 +262,7 @@ private:
/// // Declare and load a texture
/// sf::Texture texture;
/// texture.loadFromFile("texture.png");
-///
+///
/// // Create a sprite
/// sf::Sprite sprite;
/// sprite.setTexture(texture);
diff --git a/include/SFML/Graphics/Text.hpp b/include/SFML/Graphics/Text.hpp
index 919a2f7..c31ec61 100644
--- a/include/SFML/Graphics/Text.hpp
+++ b/include/SFML/Graphics/Text.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -268,10 +268,10 @@ public:
/// \brief Get the global bounding rectangle of the entity
///
/// The returned rectangle is in global coordinates, which means
- /// that it takes in account the transformations (translation,
+ /// that it takes into account the transformations (translation,
/// rotation, scale, ...) that are applied to the entity.
/// In other words, this function returns the bounds of the
- /// sprite in the global 2D world's coordinate system.
+ /// text in the global 2D world's coordinate system.
///
/// \return Global bounding rectangle of the entity
///
@@ -291,7 +291,7 @@ private:
////////////////////////////////////////////////////////////
/// \brief Make sure the text's geometry is updated
- ///
+ ///
/// All the attributes related to rendering are cached, such
/// that the geometry is only updated when necessary.
///
@@ -356,7 +356,7 @@ private:
/// // Declare and load a font
/// sf::Font font;
/// font.loadFromFile("arial.ttf");
-///
+///
/// // Create a text
/// sf::Text text("hello", font);
/// text.setCharacterSize(30);
diff --git a/include/SFML/Graphics/Texture.hpp b/include/SFML/Graphics/Texture.hpp
index a68b076..421861e 100644
--- a/include/SFML/Graphics/Texture.hpp
+++ b/include/SFML/Graphics/Texture.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -421,6 +421,18 @@ public:
Texture& operator =(const Texture& right);
////////////////////////////////////////////////////////////
+ /// \brief Get the underlying OpenGL handle of the texture.
+ ///
+ /// You shouldn't need to use this function, unless you have
+ /// very specific stuff to implement that SFML doesn't support,
+ /// or implement a temporary workaround until a bug is fixed.
+ ///
+ /// \return OpenGL handle of the texture or 0 if not yet created
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int getNativeHandle() const;
+
+ ////////////////////////////////////////////////////////////
/// \brief Bind a texture for rendering
///
/// This function is not part of the graphics API, it mustn't be
diff --git a/include/SFML/Graphics/Transform.hpp b/include/SFML/Graphics/Transform.hpp
index 41155fb..a555a33 100644
--- a/include/SFML/Graphics/Transform.hpp
+++ b/include/SFML/Graphics/Transform.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Graphics/Transformable.hpp b/include/SFML/Graphics/Transformable.hpp
index d1a92ae..e4b86cf 100644
--- a/include/SFML/Graphics/Transformable.hpp
+++ b/include/SFML/Graphics/Transformable.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -413,7 +413,7 @@ private:
/// \endcode
///
/// A note on coordinates and undistorted rendering: \n
-/// By default, SFML (or more exactly, OpenGL) may interpolate drawable objects
+/// By default, SFML (or more exactly, OpenGL) may interpolate drawable objects
/// such as sprites or texts when rendering. While this allows transitions
/// like slow movements or rotations to appear smoothly, it can lead to
/// unwanted results in some cases, for example blurred or distorted objects.
@@ -423,7 +423,7 @@ private:
/// * The object's position, origin and scale have no fractional part
/// * The object's and the view's rotation are a multiple of 90 degrees
/// * The view's center and size have no fractional part
-///
+///
/// \see sf::Transform
///
////////////////////////////////////////////////////////////
diff --git a/include/SFML/Graphics/Vertex.hpp b/include/SFML/Graphics/Vertex.hpp
index cdd606b..2509976 100644
--- a/include/SFML/Graphics/Vertex.hpp
+++ b/include/SFML/Graphics/Vertex.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Graphics/VertexArray.hpp b/include/SFML/Graphics/VertexArray.hpp
index 6faca07..f0820a5 100644
--- a/include/SFML/Graphics/VertexArray.hpp
+++ b/include/SFML/Graphics/VertexArray.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -61,7 +61,7 @@ public:
/// \param vertexCount Initial number of vertices in the array
///
////////////////////////////////////////////////////////////
- explicit VertexArray(PrimitiveType type, unsigned int vertexCount = 0);
+ explicit VertexArray(PrimitiveType type, std::size_t vertexCount = 0);
////////////////////////////////////////////////////////////
/// \brief Return the vertex count
@@ -69,7 +69,7 @@ public:
/// \return Number of vertices in the array
///
////////////////////////////////////////////////////////////
- unsigned int getVertexCount() const;
+ std::size_t getVertexCount() const;
////////////////////////////////////////////////////////////
/// \brief Get a read-write access to a vertex by its index
@@ -85,7 +85,7 @@ public:
/// \see getVertexCount
///
////////////////////////////////////////////////////////////
- Vertex& operator [](unsigned int index);
+ Vertex& operator [](std::size_t index);
////////////////////////////////////////////////////////////
/// \brief Get a read-only access to a vertex by its index
@@ -101,7 +101,7 @@ public:
/// \see getVertexCount
///
////////////////////////////////////////////////////////////
- const Vertex& operator [](unsigned int index) const;
+ const Vertex& operator [](std::size_t index) const;
////////////////////////////////////////////////////////////
/// \brief Clear the vertex array
@@ -126,7 +126,7 @@ public:
/// \param vertexCount New size of the array (number of vertices)
///
////////////////////////////////////////////////////////////
- void resize(unsigned int vertexCount);
+ void resize(std::size_t vertexCount);
////////////////////////////////////////////////////////////
/// \brief Add a vertex to the array
@@ -163,8 +163,8 @@ public:
////////////////////////////////////////////////////////////
/// \brief Compute the bounding rectangle of the vertex array
///
- /// This function returns the axis-aligned rectangle that
- /// contains all the vertices of the array.
+ /// This function returns the minimal axis-aligned rectangle
+ /// that contains all the vertices of the array.
///
/// \return Bounding rectangle of the vertex array
///
diff --git a/include/SFML/Graphics/View.hpp b/include/SFML/Graphics/View.hpp
index f4ff818..4bd62d8 100644
--- a/include/SFML/Graphics/View.hpp
+++ b/include/SFML/Graphics/View.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -313,7 +313,7 @@ private:
/// \code
/// sf::RenderWindow window;
/// sf::View view;
-///
+///
/// // Initialize the view to a rectangle located at (100, 100) and with a size of 400x200
/// view.reset(sf::FloatRect(100, 100, 400, 200));
///
diff --git a/include/SFML/Main.hpp b/include/SFML/Main.hpp
index 254ad7d..23973d0 100644
--- a/include/SFML/Main.hpp
+++ b/include/SFML/Main.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Network.hpp b/include/SFML/Network.hpp
index e5e5d06..68507af 100644
--- a/include/SFML/Network.hpp
+++ b/include/SFML/Network.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,6 +34,8 @@
#include <SFML/Network/Http.hpp>
#include <SFML/Network/IpAddress.hpp>
#include <SFML/Network/Packet.hpp>
+#include <SFML/Network/Socket.hpp>
+#include <SFML/Network/SocketHandle.hpp>
#include <SFML/Network/SocketSelector.hpp>
#include <SFML/Network/TcpListener.hpp>
#include <SFML/Network/TcpSocket.hpp>
diff --git a/include/SFML/Network/Export.hpp b/include/SFML/Network/Export.hpp
index 030b8d5..6c880f6 100644
--- a/include/SFML/Network/Export.hpp
+++ b/include/SFML/Network/Export.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Network/Ftp.hpp b/include/SFML/Network/Ftp.hpp
index 4dd242b..c62db7b 100644
--- a/include/SFML/Network/Ftp.hpp
+++ b/include/SFML/Network/Ftp.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -127,10 +127,10 @@ public:
FilenameNotAllowed = 553, ///< Requested action not taken, file name not allowed
// 10xx: SFML custom codes
- InvalidResponse = 1000, ///< Response is not a valid FTP one
- ConnectionFailed = 1001, ///< Connection with server failed
- ConnectionClosed = 1002, ///< Connection with server closed
- InvalidFile = 1003 ///< Invalid file to upload / download
+ InvalidResponse = 1000, ///< Not part of the FTP standard, generated by SFML when a received response cannot be parsed
+ ConnectionFailed = 1001, ///< Not part of the FTP standard, generated by SFML when the low-level socket connection with the server fails
+ ConnectionClosed = 1002, ///< Not part of the FTP standard, generated by SFML when the low-level socket connection is unexpectedly closed
+ InvalidFile = 1003 ///< Not part of the FTP standard, generated by SFML when a local file cannot be read or written
};
////////////////////////////////////////////////////////////
@@ -559,7 +559,10 @@ private:
/// return additional data, and use a class derived from
/// sf::Ftp::Response to provide this data. The most often used
/// commands are directly provided as member functions, but it is
-/// also possible to use specific commands with the sendCommand() method.
+/// also possible to use specific commands with the sendCommand() function.
+///
+/// Note that response statuses >= 1000 are not part of the FTP standard,
+/// they are generated by SFML when an internal error occurs.
///
/// All commands, especially upload and download, may take some
/// time to complete. This is important to know if you don't want
diff --git a/include/SFML/Network/Http.hpp b/include/SFML/Network/Http.hpp
index fec109c..057b86b 100644
--- a/include/SFML/Network/Http.hpp
+++ b/include/SFML/Network/Http.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Network/IpAddress.hpp b/include/SFML/Network/IpAddress.hpp
index 77b0cf5..8205e9f 100644
--- a/include/SFML/Network/IpAddress.hpp
+++ b/include/SFML/Network/IpAddress.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Network/Packet.hpp b/include/SFML/Network/Packet.hpp
index a400aae..0b7da9f 100644
--- a/include/SFML/Network/Packet.hpp
+++ b/include/SFML/Network/Packet.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -282,6 +282,7 @@ private:
////////////////////////////////////////////////////////////
std::vector<char> m_data; ///< Data stored in the packet
std::size_t m_readPos; ///< Current reading position in the packet
+ std::size_t m_sendPos; ///< Current send position in the packet (for handling partial sends)
bool m_isValid; ///< Reading state of the packet
};
diff --git a/include/SFML/Network/Socket.hpp b/include/SFML/Network/Socket.hpp
index 8b66453..d63f55e 100644
--- a/include/SFML/Network/Socket.hpp
+++ b/include/SFML/Network/Socket.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -54,6 +54,7 @@ public:
{
Done, ///< The socket has sent / received the data
NotReady, ///< The socket is not ready to send / receive data yet
+ Partial, ///< The socket sent a part of the data
Disconnected, ///< The TCP socket has been disconnected
Error ///< An unexpected error happened
};
diff --git a/include/SFML/Network/SocketHandle.hpp b/include/SFML/Network/SocketHandle.hpp
index 83c2422..7808ab5 100644
--- a/include/SFML/Network/SocketHandle.hpp
+++ b/include/SFML/Network/SocketHandle.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Network/SocketSelector.hpp b/include/SFML/Network/SocketSelector.hpp
index 336b301..4d334c6 100644
--- a/include/SFML/Network/SocketSelector.hpp
+++ b/include/SFML/Network/SocketSelector.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Network/TcpListener.hpp b/include/SFML/Network/TcpListener.hpp
index db93a6c..a46ef29 100644
--- a/include/SFML/Network/TcpListener.hpp
+++ b/include/SFML/Network/TcpListener.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Network/TcpSocket.hpp b/include/SFML/Network/TcpSocket.hpp
index 03a69ec..a402506 100644
--- a/include/SFML/Network/TcpSocket.hpp
+++ b/include/SFML/Network/TcpSocket.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -124,6 +124,9 @@ public:
////////////////////////////////////////////////////////////
/// \brief Send raw data to the remote peer
///
+ /// To be able to handle partial sends over non-blocking
+ /// sockets, use the send(const void*, std::size_t, std::size_t&)
+ /// overload instead.
/// This function will fail if the socket is not connected.
///
/// \param data Pointer to the sequence of bytes to send
@@ -137,6 +140,22 @@ public:
Status send(const void* data, std::size_t size);
////////////////////////////////////////////////////////////
+ /// \brief Send raw data to the remote peer
+ ///
+ /// This function will fail if the socket is not connected.
+ ///
+ /// \param data Pointer to the sequence of bytes to send
+ /// \param size Number of bytes to send
+ /// \param sent The number of bytes sent will be written here
+ ///
+ /// \return Status code
+ ///
+ /// \see receive
+ ///
+ ////////////////////////////////////////////////////////////
+ Status send(const void* data, std::size_t size, std::size_t& sent);
+
+ ////////////////////////////////////////////////////////////
/// \brief Receive raw data from the remote peer
///
/// In blocking mode, this function will wait until some
@@ -157,6 +176,10 @@ public:
////////////////////////////////////////////////////////////
/// \brief Send a formatted packet of data to the remote peer
///
+ /// In non-blocking mode, if this function returns sf::Socket::Partial,
+ /// you \em must retry sending the same unmodified packet before sending
+ /// anything else in order to guarantee the packet arrives at the remote
+ /// peer uncorrupted.
/// This function will fail if the socket is not connected.
///
/// \param packet Packet to send
diff --git a/include/SFML/Network/UdpSocket.hpp b/include/SFML/Network/UdpSocket.hpp
index 268edd0..f00c257 100644
--- a/include/SFML/Network/UdpSocket.hpp
+++ b/include/SFML/Network/UdpSocket.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -207,7 +207,7 @@ private:
/// stream of data (TCP). Therefore, one call to send will always
/// match one call to receive (if the datagram is not lost),
/// with the same data that was sent.
-///
+///
/// The UDP protocol is lightweight but unreliable. Unreliable
/// means that datagrams may be duplicated, be lost or
/// arrive reordered. However, if a datagram arrives, its
diff --git a/include/SFML/OpenGL.hpp b/include/SFML/OpenGL.hpp
index 00bdd8e..a5d964f 100644
--- a/include/SFML/OpenGL.hpp
+++ b/include/SFML/OpenGL.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,7 +33,7 @@
////////////////////////////////////////////////////////////
-/// This file just includes the OpenGL (GL and GLU) headers,
+/// This file just includes the OpenGL headers,
/// which have actually different paths on each system
////////////////////////////////////////////////////////////
#if defined(SFML_SYSTEM_WINDOWS)
@@ -44,7 +44,6 @@
#endif
#include <GL/gl.h>
- #include <GL/glu.h>
#elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD)
@@ -53,13 +52,11 @@
#include <GLES/glext.h>
#else
#include <GL/gl.h>
- #include <GL/glu.h>
#endif
#elif defined(SFML_SYSTEM_MACOS)
#include <OpenGL/gl.h>
- #include <OpenGL/glu.h>
#elif defined (SFML_SYSTEM_IOS)
diff --git a/include/SFML/System.hpp b/include/SFML/System.hpp
index eca81a3..6af0652 100644
--- a/include/SFML/System.hpp
+++ b/include/SFML/System.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,14 +32,18 @@
#include <SFML/Config.hpp>
#include <SFML/System/Clock.hpp>
#include <SFML/System/Err.hpp>
+#include <SFML/System/FileInputStream.hpp>
#include <SFML/System/InputStream.hpp>
#include <SFML/System/Lock.hpp>
+#include <SFML/System/MemoryInputStream.hpp>
#include <SFML/System/Mutex.hpp>
+#include <SFML/System/NonCopyable.hpp>
#include <SFML/System/Sleep.hpp>
#include <SFML/System/String.hpp>
#include <SFML/System/Thread.hpp>
#include <SFML/System/ThreadLocal.hpp>
#include <SFML/System/ThreadLocalPtr.hpp>
+#include <SFML/System/Time.hpp>
#include <SFML/System/Utf.hpp>
#include <SFML/System/Vector2.hpp>
#include <SFML/System/Vector3.hpp>
@@ -52,5 +56,5 @@
/// Base module of SFML, defining various utilities. It provides
/// vector classes, Unicode strings and conversion functions,
/// threads and mutexes, timing classes.
-///
+///
////////////////////////////////////////////////////////////
diff --git a/include/SFML/System/Clock.hpp b/include/SFML/System/Clock.hpp
index 1ff63cb..684c616 100644
--- a/include/SFML/System/Clock.hpp
+++ b/include/SFML/System/Clock.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/Err.hpp b/include/SFML/System/Err.hpp
index 74d56f2..1c5b468 100644
--- a/include/SFML/System/Err.hpp
+++ b/include/SFML/System/Err.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/Export.hpp b/include/SFML/System/Export.hpp
index ba52091..f4adc10 100644
--- a/include/SFML/System/Export.hpp
+++ b/include/SFML/System/Export.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/FileInputStream.hpp b/include/SFML/System/FileInputStream.hpp
new file mode 100644
index 0000000..1afa939
--- /dev/null
+++ b/include/SFML/System/FileInputStream.hpp
@@ -0,0 +1,169 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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_FILEINPUTSTREAM_HPP
+#define SFML_FILEINPUTSTREAM_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <SFML/System/Export.hpp>
+#include <SFML/System/InputStream.hpp>
+#include <SFML/System/NonCopyable.hpp>
+#include <cstdio>
+#include <string>
+
+#ifdef ANDROID
+namespace sf
+{
+namespace priv
+{
+class SFML_SYSTEM_API ResourceStream;
+}
+}
+#endif
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// \brief Implementation of input stream based on a file
+///
+////////////////////////////////////////////////////////////
+class SFML_SYSTEM_API FileInputStream : public InputStream, NonCopyable
+{
+public:
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ FileInputStream();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~FileInputStream();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open the stream from a file path
+ ///
+ /// \param filename Name of the file to open
+ ///
+ /// \return True on success, false on error
+ ///
+ ////////////////////////////////////////////////////////////
+ bool open(const std::string& filename);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Read data from the stream
+ ///
+ /// After reading, the stream's reading position must be
+ /// advanced by the amount of bytes read.
+ ///
+ /// \param data Buffer where to copy the read data
+ /// \param size Desired number of bytes to read
+ ///
+ /// \return The number of bytes actually read, or -1 on error
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Int64 read(void* data, Int64 size);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the current reading position
+ ///
+ /// \param position The position to seek to, from the beginning
+ ///
+ /// \return The position actually sought to, or -1 on error
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Int64 seek(Int64 position);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current reading position in the stream
+ ///
+ /// \return The current position, or -1 on error.
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Int64 tell();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Return the size of the stream
+ ///
+ /// \return The total number of bytes available in the stream, or -1 on error
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Int64 getSize();
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+#ifdef ANDROID
+ sf::priv::ResourceStream *m_file;
+#else
+ std::FILE* m_file; ///< stdio file stream
+#endif
+};
+
+} // namespace sf
+
+
+#endif // SFML_FILEINPUTSTREAM_HPP
+
+
+////////////////////////////////////////////////////////////
+/// \class FileInputStream
+/// \ingroup system
+///
+/// This class is a specialization of InputStream that
+/// reads from a file on disk.
+///
+/// It wraps a file in the common InputStream interface
+/// and therefore allows to use generic classes or functions
+/// that accept such a stream, with a file on disk as the data
+/// source.
+///
+/// In addition to the virtual functions inherited from
+/// InputStream, FileInputStream adds a function to
+/// specify the file to open.
+///
+/// SFML resource classes can usually be loaded directly from
+/// a filename, so this class shouldn't be useful to you unless
+/// you create your own algorithms that operate on a InputStream.
+///
+/// Usage example:
+/// \code
+/// void process(InputStream& stream);
+///
+/// FileStream stream;
+/// if (stream.open("some_file.dat"))
+/// process(stream);
+/// \endcode
+///
+/// InputStream, MemoryStream
+///
+////////////////////////////////////////////////////////////
diff --git a/include/SFML/System/InputStream.hpp b/include/SFML/System/InputStream.hpp
index ccf1d9f..e5694fa 100644
--- a/include/SFML/System/InputStream.hpp
+++ b/include/SFML/System/InputStream.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Config.hpp>
+#include <SFML/System/Export.hpp>
namespace sf
@@ -37,7 +38,7 @@ namespace sf
/// \brief Abstract class for custom file input streams
///
////////////////////////////////////////////////////////////
-class InputStream
+class SFML_SYSTEM_API InputStream
{
public:
@@ -70,7 +71,7 @@ public:
///
////////////////////////////////////////////////////////////
virtual Int64 seek(Int64 position) = 0;
-
+
////////////////////////////////////////////////////////////
/// \brief Get the current reading position in the stream
///
@@ -115,17 +116,17 @@ public:
/// class ZipStream : public sf::InputStream
/// {
/// public:
-///
+///
/// ZipStream(std::string archive);
///
/// bool open(std::string filename);
///
/// Int64 read(void* data, Int64 size);
-///
+///
/// Int64 seek(Int64 position);
-///
+///
/// Int64 tell();
-///
+///
/// Int64 getSize();
///
/// private:
diff --git a/include/SFML/System/Lock.hpp b/include/SFML/System/Lock.hpp
index 1eec342..05dac10 100644
--- a/include/SFML/System/Lock.hpp
+++ b/include/SFML/System/Lock.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -94,16 +94,16 @@ private:
/// Usage example:
/// \code
/// sf::Mutex mutex;
-///
+///
/// void function()
/// {
/// sf::Lock lock(mutex); // mutex is now locked
-///
+///
/// functionThatMayThrowAnException(); // mutex is unlocked if this function throws
-///
+///
/// if (someCondition)
/// return; // mutex is unlocked
-///
+///
/// } // mutex is unlocked
/// \endcode
///
@@ -116,15 +116,15 @@ private:
///
/// \code
/// sf::Mutex mutex;
-///
+///
/// void function()
/// {
/// {
/// sf::Lock lock(mutex);
/// codeThatRequiresProtection();
-///
+///
/// } // mutex is unlocked here
-///
+///
/// codeThatDoesntCareAboutTheMutex();
/// }
/// \endcode
diff --git a/include/SFML/System/MemoryInputStream.hpp b/include/SFML/System/MemoryInputStream.hpp
new file mode 100644
index 0000000..250466c
--- /dev/null
+++ b/include/SFML/System/MemoryInputStream.hpp
@@ -0,0 +1,148 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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_MEMORYINPUTSTREAM_HPP
+#define SFML_MEMORYINPUTSTREAM_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <SFML/System/InputStream.hpp>
+#include <SFML/System/Export.hpp>
+#include <cstdlib>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// \brief Implementation of input stream based on a memory chunk
+///
+////////////////////////////////////////////////////////////
+class SFML_SYSTEM_API MemoryInputStream : public InputStream
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ MemoryInputStream();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open the stream from its data
+ ///
+ /// \param data Pointer to the data in memory
+ /// \param sizeInBytes Size of the data, in bytes
+ ///
+ ////////////////////////////////////////////////////////////
+ void open(const void* data, std::size_t sizeInBytes);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Read data from the stream
+ ///
+ /// After reading, the stream's reading position must be
+ /// advanced by the amount of bytes read.
+ ///
+ /// \param data Buffer where to copy the read data
+ /// \param size Desired number of bytes to read
+ ///
+ /// \return The number of bytes actually read, or -1 on error
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Int64 read(void* data, Int64 size);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the current reading position
+ ///
+ /// \param position The position to seek to, from the beginning
+ ///
+ /// \return The position actually sought to, or -1 on error
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Int64 seek(Int64 position);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current reading position in the stream
+ ///
+ /// \return The current position, or -1 on error.
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Int64 tell();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Return the size of the stream
+ ///
+ /// \return The total number of bytes available in the stream, or -1 on error
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Int64 getSize();
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ const char* m_data; ///< Pointer to the data in memory
+ Int64 m_size; ///< Total size of the data
+ Int64 m_offset; ///< Current reading position
+};
+
+} // namespace sf
+
+
+#endif // SFML_MEMORYINPUTSTREAM_HPP
+
+
+////////////////////////////////////////////////////////////
+/// \class MemoryeInputStream
+/// \ingroup system
+///
+/// This class is a specialization of InputStream that
+/// reads from data in memory.
+///
+/// It wraps a memory chunk in the common InputStream interface
+/// and therefore allows to use generic classes or functions
+/// that accept such a stream, with content already loaded in memory.
+///
+/// In addition to the virtual functions inherited from
+/// InputStream, MemoryInputStream adds a function to
+/// specify the pointer and size of the data in memory.
+///
+/// SFML resource classes can usually be loaded directly from
+/// memory, so this class shouldn't be useful to you unless
+/// you create your own algorithms that operate on a InputStream.
+///
+/// Usage example:
+/// \code
+/// void process(InputStream& stream);
+///
+/// MemoryStream stream;
+/// stream.open(thePtr, theSize);
+/// process(stream);
+/// \endcode
+///
+/// InputStream, FileStream
+///
+////////////////////////////////////////////////////////////
diff --git a/include/SFML/System/Mutex.hpp b/include/SFML/System/Mutex.hpp
index 2bee74d..67a8473 100644
--- a/include/SFML/System/Mutex.hpp
+++ b/include/SFML/System/Mutex.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -119,7 +119,7 @@ private:
/// database.write(...);
/// mutex.unlock(); // if thread2 was waiting, it will now be unblocked
/// }
-///
+///
/// void thread2()
/// {
/// mutex.lock(); // this call will block the thread if the mutex is already locked by thread1
diff --git a/include/SFML/System/NonCopyable.hpp b/include/SFML/System/NonCopyable.hpp
index e11b0d5..9eb291c 100644
--- a/include/SFML/System/NonCopyable.hpp
+++ b/include/SFML/System/NonCopyable.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/Sleep.hpp b/include/SFML/System/Sleep.hpp
index fd7fb5a..3c0d04a 100644
--- a/include/SFML/System/Sleep.hpp
+++ b/include/SFML/System/Sleep.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/String.hpp b/include/SFML/System/String.hpp
index 6ef4822..5a8c576 100644
--- a/include/SFML/System/String.hpp
+++ b/include/SFML/System/String.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/String.inl b/include/SFML/System/String.inl
index 9f8f1b4..2b22efa 100644
--- a/include/SFML/System/String.inl
+++ b/include/SFML/System/String.inl
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/Thread.hpp b/include/SFML/System/Thread.hpp
index 63bb1a4..3321615 100644
--- a/include/SFML/System/Thread.hpp
+++ b/include/SFML/System/Thread.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/Thread.inl b/include/SFML/System/Thread.inl
index 9df4d2c..8e0236f 100644
--- a/include/SFML/System/Thread.inl
+++ b/include/SFML/System/Thread.inl
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/ThreadLocal.hpp b/include/SFML/System/ThreadLocal.hpp
index 00703a7..d1f9e4f 100644
--- a/include/SFML/System/ThreadLocal.hpp
+++ b/include/SFML/System/ThreadLocal.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/ThreadLocalPtr.hpp b/include/SFML/System/ThreadLocalPtr.hpp
index e703dac..3ee7abf 100644
--- a/include/SFML/System/ThreadLocalPtr.hpp
+++ b/include/SFML/System/ThreadLocalPtr.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/ThreadLocalPtr.inl b/include/SFML/System/ThreadLocalPtr.inl
index e378c62..1d735bf 100644
--- a/include/SFML/System/ThreadLocalPtr.inl
+++ b/include/SFML/System/ThreadLocalPtr.inl
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/Time.hpp b/include/SFML/System/Time.hpp
index 1268afc..95a0a35 100644
--- a/include/SFML/System/Time.hpp
+++ b/include/SFML/System/Time.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/Utf.hpp b/include/SFML/System/Utf.hpp
index 8ffae99..9e9d153 100644
--- a/include/SFML/System/Utf.hpp
+++ b/include/SFML/System/Utf.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/Utf.inl b/include/SFML/System/Utf.inl
index 8711ca0..a69ca07 100644
--- a/include/SFML/System/Utf.inl
+++ b/include/SFML/System/Utf.inl
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/Vector2.hpp b/include/SFML/System/Vector2.hpp
index 07b3e96..6284026 100644
--- a/include/SFML/System/Vector2.hpp
+++ b/include/SFML/System/Vector2.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/Vector2.inl b/include/SFML/System/Vector2.inl
index 07b96f5..5cc67ca 100644
--- a/include/SFML/System/Vector2.inl
+++ b/include/SFML/System/Vector2.inl
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/Vector3.hpp b/include/SFML/System/Vector3.hpp
index 28d0c07..51704b8 100644
--- a/include/SFML/System/Vector3.hpp
+++ b/include/SFML/System/Vector3.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/System/Vector3.inl b/include/SFML/System/Vector3.inl
index af8dae3..3c69f2c 100644
--- a/include/SFML/System/Vector3.inl
+++ b/include/SFML/System/Vector3.inl
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Window.hpp b/include/SFML/Window.hpp
index 30b317b..103f888 100644
--- a/include/SFML/Window.hpp
+++ b/include/SFML/Window.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,10 +36,11 @@
#include <SFML/Window/Joystick.hpp>
#include <SFML/Window/Keyboard.hpp>
#include <SFML/Window/Mouse.hpp>
-#include <SFML/Window/Touch.hpp>
#include <SFML/Window/Sensor.hpp>
+#include <SFML/Window/Touch.hpp>
#include <SFML/Window/VideoMode.hpp>
#include <SFML/Window/Window.hpp>
+#include <SFML/Window/WindowHandle.hpp>
#include <SFML/Window/WindowStyle.hpp>
diff --git a/include/SFML/Window/Context.hpp b/include/SFML/Window/Context.hpp
index 595d4d6..29df67c 100644
--- a/include/SFML/Window/Context.hpp
+++ b/include/SFML/Window/Context.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,6 +41,8 @@ namespace priv
class GlContext;
}
+typedef void (*GlFunctionPointer)();
+
////////////////////////////////////////////////////////////
/// \brief Class holding a valid drawing context
///
@@ -76,6 +78,15 @@ public:
bool setActive(bool active);
public:
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the address of an OpenGL function
+ ///
+ /// \param name Name of the function to get the address of
+ ///
+ /// \return Address of the OpenGL function, 0 on failure
+ ///
+ ////////////////////////////////////////////////////////////
+ static GlFunctionPointer getFunction(const char* name);
////////////////////////////////////////////////////////////
/// \brief Construct a in-memory context
diff --git a/include/SFML/Window/ContextSettings.hpp b/include/SFML/Window/ContextSettings.hpp
index da89b2f..26ea910 100644
--- a/include/SFML/Window/ContextSettings.hpp
+++ b/include/SFML/Window/ContextSettings.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,6 +36,17 @@ namespace sf
struct ContextSettings
{
////////////////////////////////////////////////////////////
+ /// \brief Enumeration of the context attribute flags
+ ///
+ ////////////////////////////////////////////////////////////
+ enum Attribute
+ {
+ Default = 0, ///< Non-debug, compatibility context (this and the core attribute are mutually exclusive)
+ Core = 1 << 0, ///< Core attribute
+ Debug = 1 << 2 ///< Debug attribute
+ };
+
+ ////////////////////////////////////////////////////////////
/// \brief Default constructor
///
/// \param depth Depth buffer bits
@@ -43,14 +54,16 @@ struct ContextSettings
/// \param antialiasing Antialiasing level
/// \param major Major number of the context version
/// \param minor Minor number of the context version
+ /// \param attributes Attribute flags of the context
///
////////////////////////////////////////////////////////////
- explicit ContextSettings(unsigned int depth = 0, unsigned int stencil = 0, unsigned int antialiasing = 0, unsigned int major = 2, unsigned int minor = 0) :
+ explicit ContextSettings(unsigned int depth = 0, unsigned int stencil = 0, unsigned int antialiasing = 0, unsigned int major = 1, unsigned int minor = 1, unsigned int attributes = Default) :
depthBits (depth),
stencilBits (stencil),
antialiasingLevel(antialiasing),
majorVersion (major),
- minorVersion (minor)
+ minorVersion (minor),
+ attributeFlags (attributes)
{
}
@@ -62,6 +75,7 @@ struct ContextSettings
unsigned int antialiasingLevel; ///< Level of antialiasing
unsigned int majorVersion; ///< Major number of the context version to create
unsigned int minorVersion; ///< Minor number of the context version to create
+ Uint32 attributeFlags; ///< The attribute flags to create the context with
};
} // namespace sf
@@ -76,10 +90,11 @@ struct ContextSettings
///
/// ContextSettings allows to define several advanced settings
/// of the OpenGL context attached to a window. All these
-/// settings have no impact on the regular SFML rendering
-/// (graphics module) -- except the anti-aliasing level, so
-/// you may need to use this structure only if you're using
-/// SFML as a windowing system for custom OpenGL rendering.
+/// settings with the exception of the compatibility flag
+/// and anti-aliasing level have no impact on the regular
+/// SFML rendering (graphics module), so you may need to use
+/// this structure only if you're using SFML as a windowing
+/// system for custom OpenGL rendering.
///
/// The depthBits and stencilBits members define the number
/// of bits per pixel requested for the (respectively) depth
@@ -94,6 +109,32 @@ struct ContextSettings
/// all handled the same way (i.e. you can use any version
/// < 3.0 if you don't want an OpenGL 3 context).
///
+/// When requesting a context with a version greater or equal
+/// to 3.2, you have the option of specifying whether the
+/// context should follow the core or compatibility profile
+/// of all newer (>= 3.2) OpenGL specifications. For versions
+/// 3.0 and 3.1 there is only the core profile. By default
+/// a compatibility context is created. You only need to specify
+/// the core flag if you want a core profile context to use with
+/// your own OpenGL rendering.
+/// <b>Warning: The graphics module will not function if you
+/// request a core profile context. Make sure the attributes are
+/// set to Default if you want to use the graphics module.</b>
+///
+/// Setting the debug attribute flag will request a context with
+/// additional debugging features enabled. Depending on the
+/// system, this might be required for advanced OpenGL debugging.
+/// OpenGL debugging is disabled by default.
+///
+/// <b>Special Note for OS X:</b>
+/// Apple only supports choosing between either a legacy context
+/// (OpenGL 2.1) or a core context (OpenGL version depends on the
+/// operating system version but is at least 3.2). Compatibility
+/// contexts are not supported. Further information is available on the
+/// <a href="https://developer.apple.com/opengl/capabilities/index.html">
+/// OpenGL Capabilities Tables</a> page. OS X also currently does
+/// not support debug contexts.
+///
/// Please note that these values are only a hint.
/// No failure will be reported if one or more of these values
/// are not supported by the system; instead, SFML will try to
diff --git a/include/SFML/Window/Event.hpp b/include/SFML/Window/Event.hpp
index 7499a05..5fc9a10 100644
--- a/include/SFML/Window/Event.hpp
+++ b/include/SFML/Window/Event.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -102,6 +102,9 @@ public:
////////////////////////////////////////////////////////////
/// \brief Mouse wheel events parameters (MouseWheelMoved)
///
+ /// \deprecated This event is deprecated and potentially inaccurate.
+ /// Use MouseWheelScrollEvent instead.
+ ///
////////////////////////////////////////////////////////////
struct MouseWheelEvent
{
@@ -111,6 +114,18 @@ public:
};
////////////////////////////////////////////////////////////
+ /// \brief Mouse wheel events parameters (MouseWheelScrolled)
+ ///
+ ////////////////////////////////////////////////////////////
+ struct MouseWheelScrollEvent
+ {
+ Mouse::Wheel wheel; ///< Which wheel (for mice with multiple ones)
+ float delta; ///< Wheel offset (positive is up/left, negative is down/right). High-precision mice may use non-integral offsets.
+ int x; ///< X position of the mouse pointer, relative to the left of the owner window
+ int y; ///< Y position of the mouse pointer, relative to the top of the owner window
+ };
+
+ ////////////////////////////////////////////////////////////
/// \brief Joystick connection events parameters
/// (JoystickConnected, JoystickDisconnected)
///
@@ -152,17 +167,17 @@ public:
int x; ///< X position of the touch, relative to the left of the owner window
int y; ///< Y position of the touch, relative to the top of the owner window
};
-
+
////////////////////////////////////////////////////////////
/// \brief Sensor event parameters (SensorChanged)
///
////////////////////////////////////////////////////////////
struct SensorEvent
{
- Sensor::Type type; ///< Type of the sensor
- float x; ///< Current value of the sensor on X axis
- float y; ///< Current value of the sensor on Y axis
- float z; ///< Current value of the sensor on Z axis
+ Sensor::Type type; ///< Type of the sensor
+ float x; ///< Current value of the sensor on X axis
+ float y; ///< Current value of the sensor on Y axis
+ float z; ///< Current value of the sensor on Z axis
};
////////////////////////////////////////////////////////////
@@ -178,7 +193,8 @@ public:
TextEntered, ///< A character was entered (data in event.text)
KeyPressed, ///< A key was pressed (data in event.key)
KeyReleased, ///< A key was released (data in event.key)
- MouseWheelMoved, ///< The mouse wheel was scrolled (data in event.mouseWheel)
+ MouseWheelMoved, ///< The mouse wheel was scrolled (data in event.mouseWheel) (deprecated)
+ MouseWheelScrolled, ///< The mouse wheel was scrolled (data in event.mouseWheelScroll)
MouseButtonPressed, ///< A mouse button was pressed (data in event.mouseButton)
MouseButtonReleased, ///< A mouse button was released (data in event.mouseButton)
MouseMoved, ///< The mouse cursor moved (data in event.mouseMove)
@@ -204,17 +220,18 @@ public:
union
{
- SizeEvent size; ///< Size event parameters (Event::Resized)
- KeyEvent key; ///< Key event parameters (Event::KeyPressed, Event::KeyReleased)
- TextEvent text; ///< Text event parameters (Event::TextEntered)
- MouseMoveEvent mouseMove; ///< Mouse move event parameters (Event::MouseMoved)
- MouseButtonEvent mouseButton; ///< Mouse button event parameters (Event::MouseButtonPressed, Event::MouseButtonReleased)
- MouseWheelEvent mouseWheel; ///< Mouse wheel event parameters (Event::MouseWheelMoved)
- JoystickMoveEvent joystickMove; ///< Joystick move event parameters (Event::JoystickMoved)
- JoystickButtonEvent joystickButton; ///< Joystick button event parameters (Event::JoystickButtonPressed, Event::JoystickButtonReleased)
- JoystickConnectEvent joystickConnect; ///< Joystick (dis)connect event parameters (Event::JoystickConnected, Event::JoystickDisconnected)
- TouchEvent touch; ///< Touch events parameters (Event::TouchBegan, Event::TouchMoved, Event::TouchEnded)
- SensorEvent sensor; ///< Sensor event parameters (Event::SensorChanged)
+ SizeEvent size; ///< Size event parameters (Event::Resized)
+ KeyEvent key; ///< Key event parameters (Event::KeyPressed, Event::KeyReleased)
+ TextEvent text; ///< Text event parameters (Event::TextEntered)
+ MouseMoveEvent mouseMove; ///< Mouse move event parameters (Event::MouseMoved)
+ MouseButtonEvent mouseButton; ///< Mouse button event parameters (Event::MouseButtonPressed, Event::MouseButtonReleased)
+ MouseWheelEvent mouseWheel; ///< Mouse wheel event parameters (Event::MouseWheelMoved) (deprecated)
+ MouseWheelScrollEvent mouseWheelScroll; ///< Mouse wheel event parameters (Event::MouseWheelScrolled)
+ JoystickMoveEvent joystickMove; ///< Joystick move event parameters (Event::JoystickMoved)
+ JoystickButtonEvent joystickButton; ///< Joystick button event parameters (Event::JoystickButtonPressed, Event::JoystickButtonReleased)
+ JoystickConnectEvent joystickConnect; ///< Joystick (dis)connect event parameters (Event::JoystickConnected, Event::JoystickDisconnected)
+ TouchEvent touch; ///< Touch events parameters (Event::TouchBegan, Event::TouchMoved, Event::TouchEnded)
+ SensorEvent sensor; ///< Sensor event parameters (Event::SensorChanged)
};
};
diff --git a/include/SFML/Window/Export.hpp b/include/SFML/Window/Export.hpp
index 8df4d51..4a708ec 100644
--- a/include/SFML/Window/Export.hpp
+++ b/include/SFML/Window/Export.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Window/GlResource.hpp b/include/SFML/Window/GlResource.hpp
index 47970fb..a341f64 100644
--- a/include/SFML/Window/GlResource.hpp
+++ b/include/SFML/Window/GlResource.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Window/Joystick.hpp b/include/SFML/Window/Joystick.hpp
index dc6261b..185fd76 100644
--- a/include/SFML/Window/Joystick.hpp
+++ b/include/SFML/Window/Joystick.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -73,7 +73,7 @@ public:
/// \brief Structure holding a joystick's identification
///
////////////////////////////////////////////////////////////
- struct Identification
+ struct SFML_WINDOW_API Identification
{
Identification();
diff --git a/include/SFML/Window/Keyboard.hpp b/include/SFML/Window/Keyboard.hpp
index 5dd0d63..b3186e9 100644
--- a/include/SFML/Window/Keyboard.hpp
+++ b/include/SFML/Window/Keyboard.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Window/Mouse.hpp b/include/SFML/Window/Mouse.hpp
index 022ecc5..0056f8c 100644
--- a/include/SFML/Window/Mouse.hpp
+++ b/include/SFML/Window/Mouse.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -60,6 +60,16 @@ public:
};
////////////////////////////////////////////////////////////
+ /// \brief Mouse wheels
+ ///
+ ////////////////////////////////////////////////////////////
+ enum Wheel
+ {
+ VerticalWheel, ///< The vertical mouse wheel
+ HorizontalWheel ///< The horizontal mouse wheel
+ };
+
+ ////////////////////////////////////////////////////////////
/// \brief Check if a mouse button is pressed
///
/// \param button Button to check
diff --git a/include/SFML/Window/Sensor.hpp b/include/SFML/Window/Sensor.hpp
index 099dca7..6078881 100644
--- a/include/SFML/Window/Sensor.hpp
+++ b/include/SFML/Window/Sensor.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -49,11 +49,11 @@ public:
////////////////////////////////////////////////////////////
enum Type
{
- Accelerometer, ///< Measures the raw acceleration (m/sē)
+ Accelerometer, ///< Measures the raw acceleration (m/s^2)
Gyroscope, ///< Measures the raw rotation rates (degrees/s)
Magnetometer, ///< Measures the ambient magnetic field (micro-teslas)
- Gravity, ///< Measures the direction and intensity of gravity, independent of device acceleration (m/sē)
- UserAcceleration, ///< Measures the direction and intensity of device acceleration, independent of the gravity (m/sē)
+ Gravity, ///< Measures the direction and intensity of gravity, independent of device acceleration (m/s^2)
+ UserAcceleration, ///< Measures the direction and intensity of device acceleration, independent of the gravity (m/s^2)
Orientation, ///< Measures the absolute 3D orientation (degrees)
Count ///< Keep last -- the total number of sensor types
@@ -72,7 +72,7 @@ public:
////////////////////////////////////////////////////////////
/// \brief Enable or disable a sensor
///
- /// All sensors are disabled by default, to avoid consuming too
+ /// All sensors are disabled by default, to avoid consuming too
/// much battery power. Once a sensor is enabled, it starts
/// sending events of the corresponding type.
///
@@ -122,7 +122,7 @@ public:
///
/// You may wonder why some sensor types look so similar, for example
/// Accelerometer and Gravity / UserAcceleration. The first one
-/// is the raw measurement of the acceleration, and takes in account
+/// is the raw measurement of the acceleration, and takes into account
/// both the earth gravity and the user movement. The others are
/// more precise: they provide these components separately, which is
/// usually more useful. In fact they are not direct sensors, they
diff --git a/include/SFML/Window/Touch.hpp b/include/SFML/Window/Touch.hpp
index 8d61f1a..bf44f43 100644
--- a/include/SFML/Window/Touch.hpp
+++ b/include/SFML/Window/Touch.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Window/VideoMode.hpp b/include/SFML/Window/VideoMode.hpp
index fcced93..5eb268c 100644
--- a/include/SFML/Window/VideoMode.hpp
+++ b/include/SFML/Window/VideoMode.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Window/Window.hpp b/include/SFML/Window/Window.hpp
index 88942dc..44f0752 100644
--- a/include/SFML/Window/Window.hpp
+++ b/include/SFML/Window/Window.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Window/WindowHandle.hpp b/include/SFML/Window/WindowHandle.hpp
index b7c67a5..9da3042 100644
--- a/include/SFML/Window/WindowHandle.hpp
+++ b/include/SFML/Window/WindowHandle.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/include/SFML/Window/WindowStyle.hpp b/include/SFML/Window/WindowStyle.hpp
index cd721b3..b9253db 100644
--- a/include/SFML/Window/WindowStyle.hpp
+++ b/include/SFML/Window/WindowStyle.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/license.txt b/license.txt
index 2406368..0d6e05f 100644
--- a/license.txt
+++ b/license.txt
@@ -1,7 +1,7 @@
SFML
----
-SFML - Copyright (C) 2007-2014 Laurent Gomila - laurent.gom@gmail.com
+SFML - Copyright (C) 2007-2015 Laurent Gomila - laurent@sfml-dev.org
This software is provided 'as-is', without any express or
implied warranty. In no event will the authors be held
@@ -29,8 +29,9 @@ External libraries used by SFML
-------------------------------
* OpenAL-Soft is under the LGPL license
-* libsndfile is under the LGPL license
* libjpeg is public domain
* stb_image and stb_image_write are public domain
* freetype is under the FreeType license or the GPL license
-* GLEW is under the modified BSD License, the Mesa 3-D License (MIT License), and the Khronos License (MIT License)
+* libogg is under the BSD license
+* libvorbis is under the BSD license
+* libflac is under the BSD license
diff --git a/readme.txt b/readme.txt
index d5b0f2a..28beb60 100644
--- a/readme.txt
+++ b/readme.txt
@@ -15,26 +15,27 @@ Stefan Schindler (tank@sfml-dev.org)
Lukas DÞrrenberger (eXpl0it3r@sfml-dev.org)
binary1248 (binary1248@hotmail.com)
Artur Moreira (artturmoreira@gmail.com)
+Mario Liebisch (mario@sfml-dev.org)
Download
--------
You can get the latest official release on SFML website (http://www.sfml-dev.org/download.php).
-You can also get the current development version from the git repository (https://github.com/LaurentGomila/SFML).
+You can also get the current development version from the git repository (https://github.com/SFML/SFML).
Install
-------
-Follow the instructions of the tutorials (http://www.sfml-dev.org/tutorials.php), there is one for each platform/compiler that SFML supports.
+Follow the instructions of the tutorials (http://www.sfml-dev.org/tutorials/), there is one for each platform/compiler that SFML supports.
Learn
-----
There are several places to learn SFML:
-* The official tutorials (http://www.sfml-dev.org/resources.php#tutorials)
-* The online API documentation (http://www.sfml-dev.org/resources.php#documentation)
-* The community wiki (https://github.com/LaurentGomila/SFML/wiki/)
-* The community forum (http://en.sfml-dev.org/forums/) (or http://fr.sfml-dev.org/forums/ for french people)
+* The official tutorials (http://www.sfml-dev.org/tutorials/)
+* The online API documentation (http://www.sfml-dev.org/documentation/)
+* The community wiki (https://github.com/SFML/SFML/wiki/)
+* The community forum (http://en.sfml-dev.org/forums/) (or http://fr.sfml-dev.org/forums/ for French people)
Contribute
----------
diff --git a/src/SFML/Android.mk b/src/SFML/Android.mk
index d3ec278..f4f586d 100644
--- a/src/SFML/Android.mk
+++ b/src/SFML/Android.mk
@@ -42,7 +42,7 @@ 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
+LOCAL_SHARED_LIBRARIES := sfml-window sfml-system openal
prebuilt_path := $(call local-prebuilt-path,$(LOCAL_SRC_FILES))
prebuilt := $(strip $(wildcard $(prebuilt_path)))
@@ -132,7 +132,7 @@ 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
+LOCAL_SHARED_LIBRARIES := sfml-window-d sfml-system-d openal
prebuilt_path := $(call local-prebuilt-path,$(LOCAL_SRC_FILES))
prebuilt := $(strip $(wildcard $(prebuilt_path)))
diff --git a/src/SFML/Audio/ALCheck.cpp b/src/SFML/Audio/ALCheck.cpp
index 1a7e4bb..e1522c5 100644
--- a/src/SFML/Audio/ALCheck.cpp
+++ b/src/SFML/Audio/ALCheck.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -91,19 +91,6 @@ void alCheckError(const std::string& file, unsigned int line)
}
}
-
-////////////////////////////////////////////////////////////
-/// 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 b31a031..f851111 100644
--- a/src/SFML/Audio/ALCheck.hpp
+++ b/src/SFML/Audio/ALCheck.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -31,8 +31,13 @@
#include <SFML/Config.hpp>
#include <iostream>
#include <string>
-#include <al.h>
-#include <alc.h>
+#ifdef SFML_SYSTEM_IOS
+ #include <OpenAl/al.h>
+ #include <OpenAl/alc.h>
+#else
+ #include <al.h>
+ #include <alc.h>
+#endif
namespace sf
@@ -64,12 +69,6 @@ namespace priv
////////////////////////////////////////////////////////////
void alCheckError(const std::string& file, unsigned int line);
-////////////////////////////////////////////////////////////
-/// Make sure that OpenAL is initialized
-///
-////////////////////////////////////////////////////////////
-void ensureALInit();
-
} // namespace priv
} // namespace sf
diff --git a/src/SFML/Audio/AlResource.cpp b/src/SFML/Audio/AlResource.cpp
new file mode 100644
index 0000000..8ea9247
--- /dev/null
+++ b/src/SFML/Audio/AlResource.cpp
@@ -0,0 +1,78 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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/AlResource.hpp>
+#include <SFML/Audio/AudioDevice.hpp>
+#include <SFML/System/Mutex.hpp>
+#include <SFML/System/Lock.hpp>
+
+
+namespace
+{
+ // OpenAL resources counter and its mutex
+ unsigned int count = 0;
+ sf::Mutex mutex;
+
+ // The audio device is instantiated on demand rather than at global startup,
+ // which solves a lot of weird crashes and errors.
+ // It is destroyed when it is no longer needed.
+ sf::priv::AudioDevice* globalDevice;
+}
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+AlResource::AlResource()
+{
+ // Protect from concurrent access
+ Lock lock(mutex);
+
+ // If this is the very first resource, trigger the global device initialization
+ if (count == 0)
+ globalDevice = new priv::AudioDevice;
+
+ // Increment the resources counter
+ count++;
+}
+
+
+////////////////////////////////////////////////////////////
+AlResource::~AlResource()
+{
+ // Protect from concurrent access
+ Lock lock(mutex);
+
+ // Decrement the resources counter
+ count--;
+
+ // If there's no more resource alive, we can destroy the device
+ if (count == 0)
+ delete globalDevice;
+}
+
+} // namespace sf
diff --git a/src/SFML/Audio/AudioDevice.cpp b/src/SFML/Audio/AudioDevice.cpp
index 2c9b833..e2005e8 100644
--- a/src/SFML/Audio/AudioDevice.cpp
+++ b/src/SFML/Audio/AudioDevice.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,12 +29,18 @@
#include <SFML/Audio/ALCheck.hpp>
#include <SFML/Audio/Listener.hpp>
#include <SFML/System/Err.hpp>
+#include <memory>
-namespace
+namespace
{
ALCdevice* audioDevice = NULL;
ALCcontext* audioContext = NULL;
+
+ 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
@@ -56,6 +62,17 @@ AudioDevice::AudioDevice()
{
// Set the context as the current one (we'll only need one)
alcMakeContextCurrent(audioContext);
+
+ // Apply the listener properties the user might have set
+ float orientation[] = {listenerDirection.x,
+ listenerDirection.y,
+ listenerDirection.z,
+ listenerUpVector.x,
+ listenerUpVector.y,
+ listenerUpVector.z};
+ alCheck(alListenerf(AL_GAIN, listenerVolume * 0.01f));
+ alCheck(alListener3f(AL_POSITION, listenerPosition.x, listenerPosition.y, listenerPosition.z));
+ alCheck(alListenerfv(AL_ORIENTATION, orientation));
}
else
{
@@ -86,7 +103,13 @@ AudioDevice::~AudioDevice()
////////////////////////////////////////////////////////////
bool AudioDevice::isExtensionSupported(const std::string& extension)
{
- ensureALInit();
+ // Create a temporary audio device in case none exists yet.
+ // This device will not be used in this function and merely
+ // makes sure there is a valid OpenAL device for extension
+ // queries if none has been created yet.
+ std::auto_ptr<AudioDevice> device;
+ if (!audioDevice)
+ device.reset(new AudioDevice);
if ((extension.length() > 2) && (extension.substr(0, 3) == "ALC"))
return alcIsExtensionPresent(audioDevice, extension.c_str()) != AL_FALSE;
@@ -98,7 +121,13 @@ bool AudioDevice::isExtensionSupported(const std::string& extension)
////////////////////////////////////////////////////////////
int AudioDevice::getFormatFromChannelCount(unsigned int channelCount)
{
- ensureALInit();
+ // Create a temporary audio device in case none exists yet.
+ // This device will not be used in this function and merely
+ // makes sure there is a valid OpenAL device for format
+ // queries if none has been created yet.
+ std::auto_ptr<AudioDevice> device;
+ if (!audioDevice)
+ device.reset(new AudioDevice);
// Find the good format according to the number of channels
int format = 0;
@@ -120,6 +149,80 @@ int AudioDevice::getFormatFromChannelCount(unsigned int channelCount)
return format;
}
+
+////////////////////////////////////////////////////////////
+void AudioDevice::setGlobalVolume(float volume)
+{
+ if (audioContext)
+ alCheck(alListenerf(AL_GAIN, volume * 0.01f));
+
+ listenerVolume = volume;
+}
+
+
+////////////////////////////////////////////////////////////
+float AudioDevice::getGlobalVolume()
+{
+ return listenerVolume;
+}
+
+
+////////////////////////////////////////////////////////////
+void AudioDevice::setPosition(const Vector3f& position)
+{
+ if (audioContext)
+ alCheck(alListener3f(AL_POSITION, position.x, position.y, position.z));
+
+ listenerPosition = position;
+}
+
+
+////////////////////////////////////////////////////////////
+Vector3f AudioDevice::getPosition()
+{
+ return listenerPosition;
+}
+
+
+////////////////////////////////////////////////////////////
+void AudioDevice::setDirection(const Vector3f& direction)
+{
+ if (audioContext)
+ {
+ float orientation[] = {direction.x, direction.y, direction.z, listenerUpVector.x, listenerUpVector.y, listenerUpVector.z};
+ alCheck(alListenerfv(AL_ORIENTATION, orientation));
+ }
+
+ listenerDirection = direction;
+}
+
+
+////////////////////////////////////////////////////////////
+Vector3f AudioDevice::getDirection()
+{
+ return listenerDirection;
+}
+
+
+////////////////////////////////////////////////////////////
+void AudioDevice::setUpVector(const Vector3f& upVector)
+{
+ if (audioContext)
+ {
+ float orientation[] = {listenerDirection.x, listenerDirection.y, listenerDirection.z, upVector.x, upVector.y, upVector.z};
+ alCheck(alListenerfv(AL_ORIENTATION, orientation));
+ }
+
+ listenerUpVector = upVector;
+}
+
+
+////////////////////////////////////////////////////////////
+Vector3f AudioDevice::getUpVector()
+{
+ return listenerUpVector;
+}
+
} // namespace priv
} // namespace sf
diff --git a/src/SFML/Audio/AudioDevice.hpp b/src/SFML/Audio/AudioDevice.hpp
index 85c121b..74edb18 100644
--- a/src/SFML/Audio/AudioDevice.hpp
+++ b/src/SFML/Audio/AudioDevice.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,6 +28,7 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
+#include <SFML/System/Vector3.hpp>
#include <set>
#include <string>
@@ -81,6 +82,106 @@ public:
///
////////////////////////////////////////////////////////////
static int getFormatFromChannelCount(unsigned int channelCount);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the global volume of all the sounds and musics
+ ///
+ /// The volume is a number between 0 and 100; it is combined with
+ /// the individual volume of each sound / music.
+ /// The default value for the volume is 100 (maximum).
+ ///
+ /// \param volume New global volume, in the range [0, 100]
+ ///
+ /// \see getGlobalVolume
+ ///
+ ////////////////////////////////////////////////////////////
+ static void setGlobalVolume(float volume);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current value of the global volume
+ ///
+ /// \return Current global volume, in the range [0, 100]
+ ///
+ /// \see setGlobalVolume
+ ///
+ ////////////////////////////////////////////////////////////
+ static float getGlobalVolume();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Set the position of the listener in the scene
+ ///
+ /// The default listener's position is (0, 0, 0).
+ ///
+ /// \param position New listener's position
+ ///
+ /// \see getPosition, setDirection
+ ///
+ ////////////////////////////////////////////////////////////
+ static void setPosition(const Vector3f& position);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current position of the listener in the scene
+ ///
+ /// \return Listener's position
+ ///
+ /// \see setPosition
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector3f getPosition();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Set the forward vector of the listener in the scene
+ ///
+ /// The direction (also called "at vector") is the vector
+ /// pointing forward from the listener's perspective. Together
+ /// with the up vector, it defines the 3D orientation of the
+ /// listener in the scene. The direction vector doesn't
+ /// have to be normalized.
+ /// The default listener's direction is (0, 0, -1).
+ ///
+ /// \param direction New listener's direction
+ ///
+ /// \see getDirection, setUpVector, setPosition
+ ///
+ ////////////////////////////////////////////////////////////
+ static void setDirection(const Vector3f& direction);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current forward vector of the listener in the scene
+ ///
+ /// \return Listener's forward vector (not normalized)
+ ///
+ /// \see setDirection
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector3f getDirection();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Set the upward vector of the listener in the scene
+ ///
+ /// The up vector is the vector that points upward from the
+ /// listener's perspective. Together with the direction, it
+ /// defines the 3D orientation of the listener in the scene.
+ /// The up vector doesn't have to be normalized.
+ /// The default listener's up vector is (0, 1, 0). It is usually
+ /// not necessary to change it, especially in 2D scenarios.
+ ///
+ /// \param upVector New listener's up vector
+ ///
+ /// \see getUpVector, setDirection, setPosition
+ ///
+ ////////////////////////////////////////////////////////////
+ static void setUpVector(const Vector3f& upVector);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the current upward vector of the listener in the scene
+ ///
+ /// \return Listener's upward vector (not normalized)
+ ///
+ /// \see setUpVector
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector3f getUpVector();
};
} // namespace priv
diff --git a/src/SFML/Audio/CMakeLists.txt b/src/SFML/Audio/CMakeLists.txt
index ee7b7cb..e375057 100644
--- a/src/SFML/Audio/CMakeLists.txt
+++ b/src/SFML/Audio/CMakeLists.txt
@@ -6,6 +6,8 @@ set(SRCROOT ${PROJECT_SOURCE_DIR}/src/SFML/Audio)
set(SRC
${SRCROOT}/ALCheck.cpp
${SRCROOT}/ALCheck.hpp
+ ${SRCROOT}/AlResource.cpp
+ ${INCROOT}/AlResource.hpp
${SRCROOT}/AudioDevice.cpp
${SRCROOT}/AudioDevice.hpp
${INCROOT}/Export.hpp
@@ -19,8 +21,10 @@ set(SRC
${INCROOT}/SoundBuffer.hpp
${SRCROOT}/SoundBufferRecorder.cpp
${INCROOT}/SoundBufferRecorder.hpp
- ${SRCROOT}/SoundFile.cpp
- ${SRCROOT}/SoundFile.hpp
+ ${SRCROOT}/InputSoundFile.cpp
+ ${INCROOT}/InputSoundFile.hpp
+ ${SRCROOT}/OutputSoundFile.cpp
+ ${INCROOT}/OutputSoundFile.hpp
${SRCROOT}/SoundRecorder.cpp
${INCROOT}/SoundRecorder.hpp
${SRCROOT}/SoundSource.cpp
@@ -30,36 +34,71 @@ set(SRC
)
source_group("" FILES ${SRC})
+set(CODECS_SRC
+ ${SRCROOT}/SoundFileFactory.cpp
+ ${INCROOT}/SoundFileFactory.hpp
+ ${INCROOT}/SoundFileFactory.inl
+ ${INCROOT}/SoundFileReader.hpp
+ ${SRCROOT}/SoundFileReaderFlac.hpp
+ ${SRCROOT}/SoundFileReaderFlac.cpp
+ ${SRCROOT}/SoundFileReaderOgg.hpp
+ ${SRCROOT}/SoundFileReaderOgg.cpp
+ ${SRCROOT}/SoundFileReaderWav.hpp
+ ${SRCROOT}/SoundFileReaderWav.cpp
+ ${INCROOT}/SoundFileWriter.hpp
+ ${SRCROOT}/SoundFileWriterFlac.hpp
+ ${SRCROOT}/SoundFileWriterFlac.cpp
+ ${SRCROOT}/SoundFileWriterOgg.hpp
+ ${SRCROOT}/SoundFileWriterOgg.cpp
+ ${SRCROOT}/SoundFileWriterWav.hpp
+ ${SRCROOT}/SoundFileWriterWav.cpp
+)
+source_group("codecs" FILES ${CODECS_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")
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/android")
endif()
# find external libraries
if(NOT SFML_OS_ANDROID)
- find_package(OpenAL REQUIRED)
- find_package(Sndfile REQUIRED)
+ if(NOT SFML_OS_IOS)
+ find_package(OpenAL REQUIRED)
+ endif()
+ find_package(Vorbis REQUIRED)
+ find_package(FLAC REQUIRED)
else()
find_host_package(OpenAL REQUIRED)
- find_host_package(Sndfile REQUIRED)
+ find_host_package(Vorbis REQUIRED)
+ find_host_package(FLAC REQUIRED)
+endif()
+
+if(NOT SFML_OS_IOS)
+ include_directories(${OPENAL_INCLUDE_DIR})
endif()
-include_directories(${OPENAL_INCLUDE_DIR} ${SNDFILE_INCLUDE_DIR})
+include_directories(${VORBIS_INCLUDE_DIRS})
+include_directories(${FLAC_INCLUDE_DIR})
+add_definitions(-DOV_EXCLUDE_STATIC_CALLBACKS) # avoids warnings in vorbisfile.h
+add_definitions(-DFLAC__NO_DLL)
# build the list of external libraries to link
+if(SFML_OS_IOS)
+ list(APPEND AUDIO_EXT_LIBS "-framework OpenAL")
+else()
+ list(APPEND AUDIO_EXT_LIBS ${OPENAL_LIBRARY})
+endif()
if(SFML_OS_ANDROID)
- list(APPEND AUDIO_EXT_LIBS -landroid -lOpenSLES)
+ list(APPEND AUDIO_EXT_LIBS android OpenSLES)
endif()
-list(APPEND AUDIO_EXT_LIBS ${OPENAL_LIBRARY} ${SNDFILE_LIBRARY})
+list(APPEND AUDIO_EXT_LIBS ${VORBIS_LIBRARIES} ${FLAC_LIBRARY})
# define the sfml-audio target
sfml_add_library(sfml-audio
- SOURCES ${SRC}
+ SOURCES ${SRC} ${CODECS_SRC}
DEPENDS sfml-system
EXTERNAL_LIBS ${AUDIO_EXT_LIBS})
diff --git a/src/SFML/Audio/InputSoundFile.cpp b/src/SFML/Audio/InputSoundFile.cpp
new file mode 100644
index 0000000..2f281f5
--- /dev/null
+++ b/src/SFML/Audio/InputSoundFile.cpp
@@ -0,0 +1,257 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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/InputSoundFile.hpp>
+#include <SFML/Audio/SoundFileReader.hpp>
+#include <SFML/Audio/SoundFileFactory.hpp>
+#include <SFML/System/InputStream.hpp>
+#include <SFML/System/FileInputStream.hpp>
+#include <SFML/System/MemoryInputStream.hpp>
+#include <SFML/System/Err.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+InputSoundFile::InputSoundFile() :
+m_reader (NULL),
+m_stream (NULL),
+m_streamOwned (false),
+m_sampleCount (0),
+m_channelCount(0),
+m_sampleRate (0)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+InputSoundFile::~InputSoundFile()
+{
+ // Close the file in case it was open
+ close();
+}
+
+
+////////////////////////////////////////////////////////////
+bool InputSoundFile::openFromFile(const std::string& filename)
+{
+ // If the file is already open, first close it
+ close();
+
+ // Find a suitable reader for the file type
+ m_reader = SoundFileFactory::createReaderFromFilename(filename);
+ if (!m_reader)
+ {
+ err() << "Failed to open sound file \"" << filename << "\" (format not supported)" << std::endl;
+ return false;
+ }
+
+ // Wrap the file into a stream
+ FileInputStream* file = new FileInputStream;
+ m_stream = file;
+ m_streamOwned = true;
+
+ // Open it
+ if (!file->open(filename))
+ {
+ close();
+ return false;
+ }
+
+ // Pass the stream to the reader
+ SoundFileReader::Info info;
+ if (!m_reader->open(*file, info))
+ {
+ close();
+ return false;
+ }
+
+ // Retrieve the attributes of the open sound file
+ m_sampleCount = info.sampleCount;
+ m_channelCount = info.channelCount;
+ m_sampleRate = info.sampleRate;
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+bool InputSoundFile::openFromMemory(const void* data, std::size_t sizeInBytes)
+{
+ // If the file is already open, first close it
+ close();
+
+ // Find a suitable reader for the file type
+ m_reader = SoundFileFactory::createReaderFromMemory(data, sizeInBytes);
+ if (!m_reader)
+ {
+ err() << "Failed to open sound file from memory (format not supported)" << std::endl;
+ return false;
+ }
+
+ // Wrap the memory file into a stream
+ MemoryInputStream* memory = new MemoryInputStream;
+ m_stream = memory;
+ m_streamOwned = true;
+
+ // Open it
+ memory->open(data, sizeInBytes);
+
+ // Pass the stream to the reader
+ SoundFileReader::Info info;
+ if (!m_reader->open(*memory, info))
+ {
+ close();
+ return false;
+ }
+
+ // Retrieve the attributes of the open sound file
+ m_sampleCount = info.sampleCount;
+ m_channelCount = info.channelCount;
+ m_sampleRate = info.sampleRate;
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+bool InputSoundFile::openFromStream(InputStream& stream)
+{
+ // If the file is already open, first close it
+ close();
+
+ // Find a suitable reader for the file type
+ m_reader = SoundFileFactory::createReaderFromStream(stream);
+ if (!m_reader)
+ {
+ err() << "Failed to open sound file from stream (format not supported)" << std::endl;
+ return false;
+ }
+
+ // store the stream
+ m_stream = &stream;
+ m_streamOwned = false;
+
+ // Don't forget to reset the stream to its beginning before re-opening it
+ if (stream.seek(0) != 0)
+ {
+ err() << "Failed to open sound file from stream (cannot restart stream)" << std::endl;
+ return false;
+ }
+
+ // Pass the stream to the reader
+ SoundFileReader::Info info;
+ if (!m_reader->open(stream, info))
+ {
+ close();
+ return false;
+ }
+
+ // Retrieve the attributes of the open sound file
+ m_sampleCount = info.sampleCount;
+ m_channelCount = info.channelCount;
+ m_sampleRate = info.sampleRate;
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+Uint64 InputSoundFile::getSampleCount() const
+{
+ return m_sampleCount;
+}
+
+
+////////////////////////////////////////////////////////////
+unsigned int InputSoundFile::getChannelCount() const
+{
+ return m_channelCount;
+}
+
+
+////////////////////////////////////////////////////////////
+unsigned int InputSoundFile::getSampleRate() const
+{
+ return m_sampleRate;
+}
+
+
+////////////////////////////////////////////////////////////
+Time InputSoundFile::getDuration() const
+{
+ return seconds(static_cast<float>(m_sampleCount) / m_channelCount / m_sampleRate);
+}
+
+
+////////////////////////////////////////////////////////////
+void InputSoundFile::seek(Uint64 sampleOffset)
+{
+ if (m_reader)
+ m_reader->seek(sampleOffset);
+}
+
+
+////////////////////////////////////////////////////////////
+void InputSoundFile::seek(Time timeOffset)
+{
+ seek(static_cast<Uint64>(timeOffset.asSeconds() * m_sampleRate * m_channelCount));
+}
+
+
+////////////////////////////////////////////////////////////
+Uint64 InputSoundFile::read(Int16* samples, Uint64 maxCount)
+{
+ if (m_reader && samples && maxCount)
+ return m_reader->read(samples, maxCount);
+ else
+ return 0;
+}
+
+
+////////////////////////////////////////////////////////////
+void InputSoundFile::close()
+{
+ // Destroy the reader
+ delete m_reader;
+ m_reader = NULL;
+
+ // Destroy the stream if we own it
+ if (m_streamOwned)
+ {
+ delete m_stream;
+ m_streamOwned = false;
+ }
+ m_stream = NULL;
+
+ // Reset the sound file attributes
+ m_sampleCount = 0;
+ m_channelCount = 0;
+ m_sampleRate = 0;
+}
+
+} // namespace sf
diff --git a/src/SFML/Audio/Listener.cpp b/src/SFML/Audio/Listener.cpp
index ec0a32f..b173d5e 100644
--- a/src/SFML/Audio/Listener.cpp
+++ b/src/SFML/Audio/Listener.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,16 +26,7 @@
// 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);
-}
+#include <SFML/Audio/AudioDevice.hpp>
namespace sf
@@ -43,20 +34,14 @@ namespace sf
////////////////////////////////////////////////////////////
void Listener::setGlobalVolume(float volume)
{
- if (volume != listenerVolume)
- {
- priv::ensureALInit();
-
- alCheck(alListenerf(AL_GAIN, volume * 0.01f));
- listenerVolume = volume;
- }
+ priv::AudioDevice::setGlobalVolume(volume);
}
////////////////////////////////////////////////////////////
float Listener::getGlobalVolume()
{
- return listenerVolume;
+ return priv::AudioDevice::getGlobalVolume();
}
@@ -70,20 +55,14 @@ void Listener::setPosition(float x, float y, float z)
////////////////////////////////////////////////////////////
void Listener::setPosition(const Vector3f& position)
{
- if (position != listenerPosition)
- {
- priv::ensureALInit();
-
- alCheck(alListener3f(AL_POSITION, position.x, position.y, position.z));
- listenerPosition = position;
- }
+ priv::AudioDevice::setPosition(position);
}
////////////////////////////////////////////////////////////
Vector3f Listener::getPosition()
{
- return listenerPosition;
+ return priv::AudioDevice::getPosition();
}
@@ -97,21 +76,14 @@ void Listener::setDirection(float x, float y, float 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;
- }
+ priv::AudioDevice::setDirection(direction);
}
////////////////////////////////////////////////////////////
Vector3f Listener::getDirection()
{
- return listenerDirection;
+ return priv::AudioDevice::getDirection();
}
@@ -125,21 +97,14 @@ void Listener::setUpVector(float x, float y, float 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;
- }
+ priv::AudioDevice::setUpVector(upVector);
}
////////////////////////////////////////////////////////////
Vector3f Listener::getUpVector()
{
- return listenerUpVector;
+ return priv::AudioDevice::getUpVector();
}
} // namespace sf
diff --git a/src/SFML/Audio/Music.cpp b/src/SFML/Audio/Music.cpp
index 6f3b6db..7bf91d9 100644
--- a/src/SFML/Audio/Music.cpp
+++ b/src/SFML/Audio/Music.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -27,7 +27,6 @@
////////////////////////////////////////////////////////////
#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>
@@ -37,7 +36,7 @@ namespace sf
{
////////////////////////////////////////////////////////////
Music::Music() :
-m_file (new priv::SoundFile),
+m_file (),
m_duration()
{
@@ -49,8 +48,6 @@ Music::~Music()
{
// We must stop before destroying the file
stop();
-
- delete m_file;
}
@@ -61,7 +58,7 @@ bool Music::openFromFile(const std::string& filename)
stop();
// Open the underlying sound file
- if (!m_file->openRead(filename))
+ if (!m_file.openFromFile(filename))
return false;
// Perform common initializations
@@ -78,7 +75,7 @@ bool Music::openFromMemory(const void* data, std::size_t sizeInBytes)
stop();
// Open the underlying sound file
- if (!m_file->openRead(data, sizeInBytes))
+ if (!m_file.openFromMemory(data, sizeInBytes))
return false;
// Perform common initializations
@@ -95,7 +92,7 @@ bool Music::openFromStream(InputStream& stream)
stop();
// Open the underlying sound file
- if (!m_file->openRead(stream))
+ if (!m_file.openFromStream(stream))
return false;
// Perform common initializations
@@ -119,7 +116,7 @@ bool Music::onGetData(SoundStream::Chunk& data)
// Fill the chunk parameters
data.samples = &m_samples[0];
- data.sampleCount = m_file->read(&m_samples[0], m_samples.size());
+ data.sampleCount = static_cast<std::size_t>(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();
@@ -131,7 +128,7 @@ void Music::onSeek(Time timeOffset)
{
Lock lock(m_mutex);
- m_file->seek(timeOffset);
+ m_file.seek(timeOffset);
}
@@ -139,13 +136,13 @@ void Music::onSeek(Time timeOffset)
void Music::initialize()
{
// Compute the music duration
- m_duration = seconds(static_cast<float>(m_file->getSampleCount()) / m_file->getSampleRate() / m_file->getChannelCount());
+ m_duration = m_file.getDuration();
// Resize the internal buffer so that it can contain 1 second of audio samples
- m_samples.resize(m_file->getSampleRate() * m_file->getChannelCount());
+ m_samples.resize(m_file.getSampleRate() * m_file.getChannelCount());
// Initialize the stream
- SoundStream::initialize(m_file->getChannelCount(), m_file->getSampleRate());
+ SoundStream::initialize(m_file.getChannelCount(), m_file.getSampleRate());
}
} // namespace sf
diff --git a/src/SFML/Audio/OutputSoundFile.cpp b/src/SFML/Audio/OutputSoundFile.cpp
new file mode 100644
index 0000000..5bb0e24
--- /dev/null
+++ b/src/SFML/Audio/OutputSoundFile.cpp
@@ -0,0 +1,92 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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/OutputSoundFile.hpp>
+#include <SFML/Audio/SoundFileWriter.hpp>
+#include <SFML/Audio/SoundFileFactory.hpp>
+#include <SFML/System/Err.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+OutputSoundFile::OutputSoundFile() :
+m_writer(NULL)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+OutputSoundFile::~OutputSoundFile()
+{
+ // Close the file in case it was open
+ close();
+}
+
+
+////////////////////////////////////////////////////////////
+bool OutputSoundFile::openFromFile(const std::string& filename, unsigned int sampleRate, unsigned int channelCount)
+{
+ // If the file is already open, first close it
+ close();
+
+ // Find a suitable writer for the file type
+ m_writer = SoundFileFactory::createWriterFromFilename(filename);
+ if (!m_writer)
+ {
+ err() << "Failed to open sound file \"" << filename << "\" (format not supported)" << std::endl;
+ return false;
+ }
+
+ // Pass the stream to the reader
+ if (!m_writer->open(filename, sampleRate, channelCount))
+ {
+ close();
+ return false;
+ }
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+void OutputSoundFile::write(const Int16* samples, Uint64 count)
+{
+ if (m_writer && samples && count)
+ m_writer->write(samples, count);
+}
+
+
+////////////////////////////////////////////////////////////
+void OutputSoundFile::close()
+{
+ // Destroy the reader
+ delete m_writer;
+ m_writer = NULL;
+}
+
+} // namespace sf
diff --git a/src/SFML/Audio/Sound.cpp b/src/SFML/Audio/Sound.cpp
index d138893..82c1cca 100644
--- a/src/SFML/Audio/Sound.cpp
+++ b/src/SFML/Audio/Sound.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Audio/SoundBuffer.cpp b/src/SFML/Audio/SoundBuffer.cpp
index 0d8818c..a6ff7ea 100644
--- a/src/SFML/Audio/SoundBuffer.cpp
+++ b/src/SFML/Audio/SoundBuffer.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,8 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Audio/SoundBuffer.hpp>
-#include <SFML/Audio/SoundFile.hpp>
+#include <SFML/Audio/InputSoundFile.hpp>
+#include <SFML/Audio/OutputSoundFile.hpp>
#include <SFML/Audio/Sound.hpp>
#include <SFML/Audio/AudioDevice.hpp>
#include <SFML/Audio/ALCheck.hpp>
@@ -41,8 +42,6 @@ SoundBuffer::SoundBuffer() :
m_buffer (0),
m_duration()
{
- priv::ensureALInit();
-
// Create the buffer
alCheck(alGenBuffers(1, &m_buffer));
}
@@ -66,8 +65,14 @@ m_sounds () // don't copy the attached sounds
////////////////////////////////////////////////////////////
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)
+ // To prevent the iterator from becoming invalid, move the entire buffer to another
+ // container. Otherwise calling resetBuffer would result in detachSound being
+ // called which removes the sound from the internal list.
+ SoundList sounds;
+ sounds.swap(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();
// Destroy the buffer
@@ -79,8 +84,8 @@ SoundBuffer::~SoundBuffer()
////////////////////////////////////////////////////////////
bool SoundBuffer::loadFromFile(const std::string& filename)
{
- priv::SoundFile file;
- if (file.openRead(filename))
+ InputSoundFile file;
+ if (file.openFromFile(filename))
return initialize(file);
else
return false;
@@ -90,8 +95,8 @@ bool SoundBuffer::loadFromFile(const std::string& filename)
////////////////////////////////////////////////////////////
bool SoundBuffer::loadFromMemory(const void* data, std::size_t sizeInBytes)
{
- priv::SoundFile file;
- if (file.openRead(data, sizeInBytes))
+ InputSoundFile file;
+ if (file.openFromMemory(data, sizeInBytes))
return initialize(file);
else
return false;
@@ -101,8 +106,8 @@ bool SoundBuffer::loadFromMemory(const void* data, std::size_t sizeInBytes)
////////////////////////////////////////////////////////////
bool SoundBuffer::loadFromStream(InputStream& stream)
{
- priv::SoundFile file;
- if (file.openRead(stream))
+ InputSoundFile file;
+ if (file.openFromStream(stream))
return initialize(file);
else
return false;
@@ -110,7 +115,7 @@ bool SoundBuffer::loadFromStream(InputStream& stream)
////////////////////////////////////////////////////////////
-bool SoundBuffer::loadFromSamples(const Int16* samples, std::size_t sampleCount, unsigned int channelCount, unsigned int sampleRate)
+bool SoundBuffer::loadFromSamples(const Int16* samples, Uint64 sampleCount, unsigned int channelCount, unsigned int sampleRate)
{
if (samples && sampleCount && channelCount && sampleRate)
{
@@ -139,8 +144,8 @@ bool SoundBuffer::loadFromSamples(const Int16* samples, std::size_t sampleCount,
bool SoundBuffer::saveToFile(const std::string& filename) const
{
// Create the sound file in write mode
- priv::SoundFile file;
- if (file.openWrite(filename, getChannelCount(), getSampleRate()))
+ OutputSoundFile file;
+ if (file.openFromFile(filename, getSampleRate(), getChannelCount()))
{
// Write the samples to the opened file
file.write(&m_samples[0], m_samples.size());
@@ -162,7 +167,7 @@ const Int16* SoundBuffer::getSamples() const
////////////////////////////////////////////////////////////
-std::size_t SoundBuffer::getSampleCount() const
+Uint64 SoundBuffer::getSampleCount() const
{
return m_samples.size();
}
@@ -210,15 +215,15 @@ SoundBuffer& SoundBuffer::operator =(const SoundBuffer& right)
////////////////////////////////////////////////////////////
-bool SoundBuffer::initialize(priv::SoundFile& file)
+bool SoundBuffer::initialize(InputSoundFile& file)
{
// Retrieve the sound parameters
- std::size_t sampleCount = file.getSampleCount();
+ Uint64 sampleCount = file.getSampleCount();
unsigned int channelCount = file.getChannelCount();
unsigned int sampleRate = file.getSampleRate();
// Read the samples from the provided file
- m_samples.resize(sampleCount);
+ m_samples.resize(static_cast<std::size_t>(sampleCount));
if (file.read(&m_samples[0], sampleCount) == sampleCount)
{
// Update the internal buffer with the new samples
diff --git a/src/SFML/Audio/SoundBufferRecorder.cpp b/src/SFML/Audio/SoundBufferRecorder.cpp
index 11724b1..23f5deb 100644
--- a/src/SFML/Audio/SoundBufferRecorder.cpp
+++ b/src/SFML/Audio/SoundBufferRecorder.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Audio/SoundFile.cpp b/src/SFML/Audio/SoundFile.cpp
deleted file mode 100644
index 7ca5f82..0000000
--- a/src/SFML/Audio/SoundFile.cpp
+++ /dev/null
@@ -1,451 +0,0 @@
-////////////////////////////////////////////////////////////
-//
-// 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/SoundFileFactory.cpp b/src/SFML/Audio/SoundFileFactory.cpp
new file mode 100644
index 0000000..02d4c99
--- /dev/null
+++ b/src/SFML/Audio/SoundFileFactory.cpp
@@ -0,0 +1,147 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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/SoundFileFactory.hpp>
+#include <SFML/Audio/SoundFileReaderFlac.hpp>
+#include <SFML/Audio/SoundFileWriterFlac.hpp>
+#include <SFML/Audio/SoundFileReaderOgg.hpp>
+#include <SFML/Audio/SoundFileWriterOgg.hpp>
+#include <SFML/Audio/SoundFileReaderWav.hpp>
+#include <SFML/Audio/SoundFileWriterWav.hpp>
+#include <SFML/System/FileInputStream.hpp>
+#include <SFML/System/MemoryInputStream.hpp>
+
+
+namespace
+{
+ // Register all the built-in readers and writers if not already done
+ void ensureDefaultReadersWritersRegistered()
+ {
+ static bool registered = false;
+ if (!registered)
+ {
+ sf::SoundFileFactory::registerReader<sf::priv::SoundFileReaderFlac>();
+ sf::SoundFileFactory::registerWriter<sf::priv::SoundFileWriterFlac>();
+ sf::SoundFileFactory::registerReader<sf::priv::SoundFileReaderOgg>();
+ sf::SoundFileFactory::registerWriter<sf::priv::SoundFileWriterOgg>();
+ sf::SoundFileFactory::registerReader<sf::priv::SoundFileReaderWav>();
+ sf::SoundFileFactory::registerWriter<sf::priv::SoundFileWriterWav>();
+ registered = true;
+ }
+ }
+}
+
+namespace sf
+{
+SoundFileFactory::ReaderFactoryArray SoundFileFactory::s_readers;
+SoundFileFactory::WriterFactoryArray SoundFileFactory::s_writers;
+
+
+////////////////////////////////////////////////////////////
+SoundFileReader* SoundFileFactory::createReaderFromFilename(const std::string& filename)
+{
+ // Register the built-in readers/writers on first call
+ ensureDefaultReadersWritersRegistered();
+
+ // Wrap the input file into a file stream
+ FileInputStream stream;
+ if (!stream.open(filename))
+ return NULL;
+
+ // Test the filename in all the registered factories
+ for (ReaderFactoryArray::const_iterator it = s_readers.begin(); it != s_readers.end(); ++it)
+ {
+ stream.seek(0);
+ if (it->check(stream))
+ return it->create();
+ }
+
+ // No suitable reader found
+ return NULL;
+}
+
+
+////////////////////////////////////////////////////////////
+SoundFileReader* SoundFileFactory::createReaderFromMemory(const void* data, std::size_t sizeInBytes)
+{
+ // Register the built-in readers/writers on first call
+ ensureDefaultReadersWritersRegistered();
+
+ // Wrap the memory file into a file stream
+ MemoryInputStream stream;
+ stream.open(data, sizeInBytes);
+
+ // Test the stream for all the registered factories
+ for (ReaderFactoryArray::const_iterator it = s_readers.begin(); it != s_readers.end(); ++it)
+ {
+ stream.seek(0);
+ if (it->check(stream))
+ return it->create();
+ }
+
+ // No suitable reader found
+ return NULL;
+}
+
+
+////////////////////////////////////////////////////////////
+SoundFileReader* SoundFileFactory::createReaderFromStream(InputStream& stream)
+{
+ // Register the built-in readers/writers on first call
+ ensureDefaultReadersWritersRegistered();
+
+ // Test the stream for all the registered factories
+ for (ReaderFactoryArray::const_iterator it = s_readers.begin(); it != s_readers.end(); ++it)
+ {
+ stream.seek(0);
+ if (it->check(stream))
+ return it->create();
+ }
+
+ // No suitable reader found
+ return NULL;
+}
+
+
+////////////////////////////////////////////////////////////
+SoundFileWriter* SoundFileFactory::createWriterFromFilename(const std::string& filename)
+{
+ // Register the built-in readers/writers on first call
+ ensureDefaultReadersWritersRegistered();
+
+ // Test the filename in all the registered factories
+ for (WriterFactoryArray::const_iterator it = s_writers.begin(); it != s_writers.end(); ++it)
+ {
+ if (it->check(filename))
+ return it->create();
+ }
+
+ // No suitable writer found
+ return NULL;
+}
+
+} // namespace sf
diff --git a/src/SFML/Audio/SoundFileReaderFlac.cpp b/src/SFML/Audio/SoundFileReaderFlac.cpp
new file mode 100644
index 0000000..646b031
--- /dev/null
+++ b/src/SFML/Audio/SoundFileReaderFlac.cpp
@@ -0,0 +1,327 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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/SoundFileReaderFlac.hpp>
+#include <SFML/System/InputStream.hpp>
+#include <SFML/System/Err.hpp>
+#include <cassert>
+
+
+namespace
+{
+ FLAC__StreamDecoderReadStatus streamRead(const FLAC__StreamDecoder*, FLAC__byte buffer[], std::size_t* bytes, void* clientData)
+ {
+ sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData);
+
+ sf::Int64 count = data->stream->read(buffer, *bytes);
+ if (count > 0)
+ {
+ *bytes = static_cast<std::size_t>(count);
+ return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
+ }
+ else if (count == 0)
+ {
+ return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
+ }
+ else
+ {
+ return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
+ }
+ }
+
+ FLAC__StreamDecoderSeekStatus streamSeek(const FLAC__StreamDecoder*, FLAC__uint64 absoluteByteOffset, void* clientData)
+ {
+ sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData);
+
+ sf::Int64 position = data->stream->seek(absoluteByteOffset);
+ if (position >= 0)
+ return FLAC__STREAM_DECODER_SEEK_STATUS_OK;
+ else
+ return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
+ }
+
+ FLAC__StreamDecoderTellStatus streamTell(const FLAC__StreamDecoder*, FLAC__uint64* absoluteByteOffset, void* clientData)
+ {
+ sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData);
+
+ sf::Int64 position = data->stream->tell();
+ if (position >= 0)
+ {
+ *absoluteByteOffset = position;
+ return FLAC__STREAM_DECODER_TELL_STATUS_OK;
+ }
+ else
+ {
+ return FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
+ }
+ }
+
+ FLAC__StreamDecoderLengthStatus streamLength(const FLAC__StreamDecoder*, FLAC__uint64* streamLength, void* clientData)
+ {
+ sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData);
+
+ sf::Int64 count = data->stream->getSize();
+ if (count >= 0)
+ {
+ *streamLength = count;
+ return FLAC__STREAM_DECODER_LENGTH_STATUS_OK;
+ }
+ else
+ {
+ return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR;
+ }
+ }
+
+ FLAC__bool streamEof(const FLAC__StreamDecoder*, void* clientData)
+ {
+ sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData);
+
+ return data->stream->tell() == data->stream->getSize();
+ }
+
+ FLAC__StreamDecoderWriteStatus streamWrite(const FLAC__StreamDecoder*, const FLAC__Frame* frame, const FLAC__int32* const buffer[], void* clientData)
+ {
+ sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData);
+
+ // If there's no output buffer, it means that we are seeking
+ if (!data->buffer)
+ return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
+
+ // Reserve memory if we're going to use the leftovers buffer
+ unsigned int frameSamples = frame->header.blocksize * frame->header.channels;
+ if (data->remaining < frameSamples)
+ data->leftovers.reserve(static_cast<std::size_t>(frameSamples - data->remaining));
+
+ // Decode the samples
+ for (unsigned i = 0; i < frame->header.blocksize; ++i)
+ {
+ for (unsigned int j = 0; j < frame->header.channels; ++j)
+ {
+ // Decode the current sample
+ sf::Int16 sample = 0;
+ switch (frame->header.bits_per_sample)
+ {
+ case 8:
+ sample = buffer[j][i] << 8;
+ break;
+ case 16:
+ sample = buffer[j][i];
+ break;
+ case 24:
+ sample = buffer[j][i] >> 8;
+ break;
+ case 32:
+ sample = buffer[j][i] >> 16;
+ break;
+ default:
+ assert(false);
+ break;
+ }
+
+ if (data->remaining > 0)
+ {
+ // There's room in the output buffer, copy the sample there
+ *data->buffer++ = sample;
+ data->remaining--;
+ }
+ else
+ {
+ // We have decoded all the requested samples, put the sample in a temporary buffer until next call
+ data->leftovers.push_back(sample);
+ }
+ }
+ }
+
+ return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
+ }
+
+ void streamMetadata(const FLAC__StreamDecoder*, const FLAC__StreamMetadata* meta, void* clientData)
+ {
+ sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData);
+
+ if (meta->type == FLAC__METADATA_TYPE_STREAMINFO)
+ {
+ data->info.sampleCount = meta->data.stream_info.total_samples * meta->data.stream_info.channels;
+ data->info.sampleRate = meta->data.stream_info.sample_rate;
+ data->info.channelCount = meta->data.stream_info.channels;
+ }
+ }
+
+ void streamError(const FLAC__StreamDecoder*, FLAC__StreamDecoderErrorStatus, void* clientData)
+ {
+ sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData);
+ data->error = true;
+ }
+}
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+bool SoundFileReaderFlac::check(InputStream& stream)
+{
+ // Create a decoder
+ FLAC__StreamDecoder* decoder = FLAC__stream_decoder_new();
+ if (!decoder)
+ return false;
+
+ // Initialize the decoder with our callbacks
+ ClientData data;
+ data.stream = &stream;
+ data.error = false;
+ FLAC__stream_decoder_init_stream(decoder, &streamRead, &streamSeek, &streamTell, &streamLength, &streamEof, &streamWrite, NULL, &streamError, &data);
+
+ // Read the header
+ bool valid = FLAC__stream_decoder_process_until_end_of_metadata(decoder) != 0;
+
+ // Destroy the decoder
+ FLAC__stream_decoder_finish(decoder);
+ FLAC__stream_decoder_delete(decoder);
+
+ return valid && !data.error;
+}
+
+
+////////////////////////////////////////////////////////////
+SoundFileReaderFlac::SoundFileReaderFlac() :
+m_decoder(NULL)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+SoundFileReaderFlac::~SoundFileReaderFlac()
+{
+ close();
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundFileReaderFlac::open(InputStream& stream, Info& info)
+{
+ // Create the decoder
+ m_decoder = FLAC__stream_decoder_new();
+ if (!m_decoder)
+ {
+ err() << "Failed to open FLAC file (failed to allocate the decoder)" << std::endl;
+ return false;
+ }
+
+ // Initialize the decoder with our callbacks
+ m_clientData.stream = &stream;
+ FLAC__stream_decoder_init_stream(m_decoder, &streamRead, &streamSeek, &streamTell, &streamLength, &streamEof, &streamWrite, &streamMetadata, &streamError, &m_clientData);
+
+ // Read the header
+ if (!FLAC__stream_decoder_process_until_end_of_metadata(m_decoder))
+ {
+ close();
+ err() << "Failed to open FLAC file (failed to read metadata)" << std::endl;
+ return false;
+ }
+
+ // Retrieve the sound properties
+ info = m_clientData.info; // was filled in the "metadata" callback
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundFileReaderFlac::seek(Uint64 sampleOffset)
+{
+ assert(m_decoder);
+
+ // Reset the callback data (the "write" callback will be called)
+ m_clientData.buffer = NULL;
+ m_clientData.remaining = 0;
+ m_clientData.leftovers.clear();
+
+ FLAC__stream_decoder_seek_absolute(m_decoder, sampleOffset);
+}
+
+
+////////////////////////////////////////////////////////////
+Uint64 SoundFileReaderFlac::read(Int16* samples, Uint64 maxCount)
+{
+ assert(m_decoder);
+
+ // If there are leftovers from previous call, use it first
+ Uint64 left = m_clientData.leftovers.size();
+ if (left > 0)
+ {
+ if (left > maxCount)
+ {
+ // There are more leftovers than needed
+ std::copy(m_clientData.leftovers.begin(), m_clientData.leftovers.end(), samples);
+ std::vector<Int16> leftovers(m_clientData.leftovers.begin() + maxCount, m_clientData.leftovers.end());
+ m_clientData.leftovers.swap(leftovers);
+ return maxCount;
+ }
+ else
+ {
+ // We can use all the leftovers and decode new frames
+ std::copy(m_clientData.leftovers.begin(), m_clientData.leftovers.end(), samples);
+ }
+ }
+
+ // Reset the data that will be used in the callback
+ m_clientData.buffer = samples + left;
+ m_clientData.remaining = maxCount - left;
+ m_clientData.leftovers.clear();
+
+ // Decode frames one by one until we reach the requested sample count, the end of file or an error
+ while (m_clientData.remaining > 0)
+ {
+ // Everything happens in the "write" callback
+ // This will break on any fatal error (does not include EOF)
+ if (!FLAC__stream_decoder_process_single(m_decoder))
+ break;
+
+ // Break on EOF
+ if (FLAC__stream_decoder_get_state(m_decoder) == FLAC__STREAM_DECODER_END_OF_STREAM)
+ break;
+ }
+
+ return maxCount - m_clientData.remaining;
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundFileReaderFlac::close()
+{
+ if (m_decoder)
+ {
+ FLAC__stream_decoder_finish(m_decoder);
+ FLAC__stream_decoder_delete(m_decoder);
+ m_decoder = NULL;
+ }
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Audio/SoundFileReaderFlac.hpp b/src/SFML/Audio/SoundFileReaderFlac.hpp
new file mode 100644
index 0000000..ee9079a
--- /dev/null
+++ b/src/SFML/Audio/SoundFileReaderFlac.hpp
@@ -0,0 +1,140 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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_SOUNDFILEREADERFLAC_HPP
+#define SFML_SOUNDFILEREADERFLAC_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/SoundFileReader.hpp>
+#include <FLAC/stream_decoder.h>
+#include <string>
+#include <vector>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Implementation of sound file reader that handles FLAC files
+///
+////////////////////////////////////////////////////////////
+class SoundFileReaderFlac : public SoundFileReader
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if this reader can handle a file given by an input stream
+ ///
+ /// \param stream Source stream to check
+ ///
+ /// \return True if the file is supported by this reader
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool check(InputStream& stream);
+
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ SoundFileReaderFlac();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~SoundFileReaderFlac();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open a sound file for reading
+ ///
+ /// \param stream Stream to open
+ /// \param info Structure to fill with the attributes of the loaded sound
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool open(sf::InputStream& stream, Info& info);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the current read position to the given sample offset
+ ///
+ /// If the given offset exceeds to total number of samples,
+ /// this function must jump to the end of the file.
+ ///
+ /// \param sampleOffset Index of the sample to jump to, relative to the beginning
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void seek(Uint64 sampleOffset);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Read audio samples from the open file
+ ///
+ /// \param samples Pointer to the sample array to fill
+ /// \param maxCount Maximum number of samples to read
+ ///
+ /// \return Number of samples actually read (may be less than \a maxCount)
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Uint64 read(Int16* samples, Uint64 maxCount);
+
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Hold the state that is passed to the decoder callbacks
+ ///
+ ////////////////////////////////////////////////////////////
+ struct ClientData
+ {
+ InputStream* stream;
+ SoundFileReader::Info info;
+ Int16* buffer;
+ Uint64 remaining;
+ std::vector<Int16> leftovers;
+ bool error;
+ };
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Close the open FLAC file
+ ///
+ ////////////////////////////////////////////////////////////
+ void close();
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ FLAC__StreamDecoder* m_decoder; ///< FLAC decoder
+ ClientData m_clientData; ///< Structure passed to the decoder callbacks
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_SOUNDFILEREADERFLAC_HPP
diff --git a/src/SFML/Audio/SoundFileReaderOgg.cpp b/src/SFML/Audio/SoundFileReaderOgg.cpp
new file mode 100644
index 0000000..d9f8628
--- /dev/null
+++ b/src/SFML/Audio/SoundFileReaderOgg.cpp
@@ -0,0 +1,179 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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/SoundFileReaderOgg.hpp>
+#include <SFML/System/MemoryInputStream.hpp>
+#include <SFML/System/Err.hpp>
+#include <algorithm>
+#include <cctype>
+#include <cassert>
+
+
+namespace
+{
+ size_t read(void* ptr, size_t size, size_t nmemb, void* data)
+ {
+ sf::InputStream* stream = static_cast<sf::InputStream*>(data);
+ return static_cast<std::size_t>(stream->read(ptr, size * nmemb));
+ }
+
+ int seek(void* data, ogg_int64_t offset, int whence)
+ {
+ sf::InputStream* stream = static_cast<sf::InputStream*>(data);
+ switch (whence)
+ {
+ case SEEK_SET:
+ break;
+ case SEEK_CUR:
+ offset += stream->tell();
+ break;
+ case SEEK_END:
+ offset = stream->getSize() - offset;
+ }
+ return static_cast<int>(stream->seek(offset));
+ }
+
+ long tell(void* data)
+ {
+ sf::InputStream* stream = static_cast<sf::InputStream*>(data);
+ return static_cast<long>(stream->tell());
+ }
+
+ static ov_callbacks callbacks = {&read, &seek, NULL, &tell};
+}
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+bool SoundFileReaderOgg::check(InputStream& stream)
+{
+ OggVorbis_File file;
+ if (ov_test_callbacks(&stream, &file, NULL, 0, callbacks) == 0)
+ {
+ ov_clear(&file);
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+SoundFileReaderOgg::SoundFileReaderOgg() :
+m_vorbis (),
+m_channelCount(0)
+{
+ m_vorbis.datasource = NULL;
+}
+
+
+////////////////////////////////////////////////////////////
+SoundFileReaderOgg::~SoundFileReaderOgg()
+{
+ close();
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundFileReaderOgg::open(InputStream& stream, Info& info)
+{
+ // Open the Vorbis stream
+ int status = ov_open_callbacks(&stream, &m_vorbis, NULL, 0, callbacks);
+ if (status < 0)
+ {
+ err() << "Failed to open Vorbis file for reading" << std::endl;
+ return false;
+ }
+
+ // Retrieve the music attributes
+ vorbis_info* vorbisInfo = ov_info(&m_vorbis, -1);
+ info.channelCount = vorbisInfo->channels;
+ info.sampleRate = vorbisInfo->rate;
+ info.sampleCount = static_cast<std::size_t>(ov_pcm_total(&m_vorbis, -1) * vorbisInfo->channels);
+
+ // We must keep the channel count for the seek function
+ m_channelCount = info.channelCount;
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundFileReaderOgg::seek(Uint64 sampleOffset)
+{
+ assert(m_vorbis.datasource);
+
+ ov_pcm_seek(&m_vorbis, sampleOffset / m_channelCount);
+}
+
+
+////////////////////////////////////////////////////////////
+Uint64 SoundFileReaderOgg::read(Int16* samples, Uint64 maxCount)
+{
+ assert(m_vorbis.datasource);
+
+ // Try to read the requested number of samples, stop only on error or end of file
+ Uint64 count = 0;
+ while (count < maxCount)
+ {
+ int bytesToRead = static_cast<int>(maxCount - count) * sizeof(Int16);
+ long bytesRead = ov_read(&m_vorbis, reinterpret_cast<char*>(samples), bytesToRead, 0, 2, 1, NULL);
+ if (bytesRead > 0)
+ {
+ long samplesRead = bytesRead / sizeof(Int16);
+ count += samplesRead;
+ samples += samplesRead;
+ }
+ else
+ {
+ // error or end of file
+ break;
+ }
+ }
+
+ return count;
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundFileReaderOgg::close()
+{
+ if (m_vorbis.datasource)
+ {
+ ov_clear(&m_vorbis);
+ m_vorbis.datasource = NULL;
+ m_channelCount = 0;
+ }
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Audio/SoundFileReaderOgg.hpp b/src/SFML/Audio/SoundFileReaderOgg.hpp
new file mode 100644
index 0000000..2b9917b
--- /dev/null
+++ b/src/SFML/Audio/SoundFileReaderOgg.hpp
@@ -0,0 +1,124 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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_SOUNDFILEREADEROGG_HPP
+#define SFML_SOUNDFILEREADEROGG_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/SoundFileReader.hpp>
+#include <vorbis/vorbisfile.h>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Implementation of sound file reader that handles OGG/Vorbis files
+///
+////////////////////////////////////////////////////////////
+class SoundFileReaderOgg : public SoundFileReader
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if this reader can handle a file given by an input stream
+ ///
+ /// \param stream Source stream to check
+ ///
+ /// \return True if the file is supported by this reader
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool check(InputStream& stream);
+
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ SoundFileReaderOgg();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~SoundFileReaderOgg();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open a sound file for reading
+ ///
+ /// \param stream Source stream to read from
+ /// \param info Structure to fill with the properties of the loaded sound
+ ///
+ /// \return True if the file was successfully opened
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool open(InputStream& stream, Info& info);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the current read position to the given sample offset
+ ///
+ /// If the given offset exceeds to total number of samples,
+ /// this function must jump to the end of the file.
+ ///
+ /// \param sampleOffset Index of the sample to jump to, relative to the beginning
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void seek(Uint64 sampleOffset);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Read audio samples from the open file
+ ///
+ /// \param samples Pointer to the sample array to fill
+ /// \param maxCount Maximum number of samples to read
+ ///
+ /// \return Number of samples actually read (may be less than \a maxCount)
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Uint64 read(Int16* samples, Uint64 maxCount);
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Close the open Vorbis file
+ ///
+ ////////////////////////////////////////////////////////////
+ void close();
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ OggVorbis_File m_vorbis; // ogg/vorbis file handle
+ unsigned int m_channelCount; // number of channels of the open sound file
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_SOUNDFILEREADEROGG_HPP
diff --git a/src/SFML/Audio/SoundFileReaderWav.cpp b/src/SFML/Audio/SoundFileReaderWav.cpp
new file mode 100644
index 0000000..730f841
--- /dev/null
+++ b/src/SFML/Audio/SoundFileReaderWav.cpp
@@ -0,0 +1,285 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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/SoundFileReaderWav.hpp>
+#include <SFML/System/InputStream.hpp>
+#include <SFML/System/Err.hpp>
+#include <algorithm>
+#include <cctype>
+#include <cassert>
+
+
+namespace
+{
+ // The following functions read integers as little endian and
+ // return them in the host byte order
+
+ bool decode(sf::InputStream& stream, sf::Uint8& value)
+ {
+ return stream.read(&value, sizeof(value)) == sizeof(value);
+ }
+
+ bool decode(sf::InputStream& stream, sf::Int16& value)
+ {
+ unsigned char bytes[sizeof(value)];
+ if (stream.read(bytes, sizeof(bytes)) != sizeof(bytes))
+ return false;
+
+ value = bytes[0] | (bytes[1] << 8);
+
+ return true;
+ }
+
+ bool decode(sf::InputStream& stream, sf::Uint16& value)
+ {
+ unsigned char bytes[sizeof(value)];
+ if (stream.read(bytes, sizeof(bytes)) != sizeof(bytes))
+ return false;
+
+ value = bytes[0] | (bytes[1] << 8);
+
+ return true;
+ }
+
+ bool decode(sf::InputStream& stream, sf::Int32& value)
+ {
+ unsigned char bytes[sizeof(value)];
+ if (stream.read(bytes, sizeof(bytes)) != sizeof(bytes))
+ return false;
+
+ value = bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24);
+
+ return true;
+ }
+
+ bool decode(sf::InputStream& stream, sf::Uint32& value)
+ {
+ unsigned char bytes[sizeof(value)];
+ if (stream.read(bytes, sizeof(bytes)) != sizeof(bytes))
+ return false;
+
+ value = bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24);
+
+ return true;
+ }
+
+ const sf::Uint64 mainChunkSize = 12;
+}
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+bool SoundFileReaderWav::check(InputStream& stream)
+{
+ char header[mainChunkSize];
+ if (stream.read(header, sizeof(header)) < static_cast<Int64>(sizeof(header)))
+ return false;
+
+ return (header[0] == 'R') && (header[1] == 'I') && (header[2] == 'F') && (header[3] == 'F')
+ && (header[8] == 'W') && (header[9] == 'A') && (header[10] == 'V') && (header[11] == 'E');
+}
+
+
+////////////////////////////////////////////////////////////
+SoundFileReaderWav::SoundFileReaderWav() :
+m_stream (NULL),
+m_bytesPerSample(0),
+m_dataStart (0)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundFileReaderWav::open(InputStream& stream, Info& info)
+{
+ m_stream = &stream;
+
+ if (!parseHeader(info))
+ {
+ err() << "Failed to open WAV sound file (invalid or unsupported file)" << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundFileReaderWav::seek(Uint64 sampleOffset)
+{
+ assert(m_stream);
+
+ m_stream->seek(m_dataStart + sampleOffset * m_bytesPerSample);
+}
+
+
+////////////////////////////////////////////////////////////
+Uint64 SoundFileReaderWav::read(Int16* samples, Uint64 maxCount)
+{
+ assert(m_stream);
+
+ Uint64 count = 0;
+ while (count < maxCount)
+ {
+ switch (m_bytesPerSample)
+ {
+ case 1:
+ {
+ Uint8 sample = 0;
+ if (decode(*m_stream, sample))
+ *samples++ = (static_cast<Int16>(sample) - 128) << 8;
+ else
+ return count;
+ break;
+ }
+
+ case 2:
+ {
+ Int16 sample = 0;
+ if (decode(*m_stream, sample))
+ *samples++ = sample;
+ else
+ return count;
+ break;
+ }
+
+ case 4:
+ {
+ Int32 sample = 0;
+ if (decode(*m_stream, sample))
+ *samples++ = sample >> 16;
+ else
+ return count;
+ break;
+ }
+ }
+
+ ++count;
+ }
+
+ return count;
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundFileReaderWav::parseHeader(Info& info)
+{
+ assert(m_stream);
+
+ // If we are here, it means that the first part of the header
+ // (the format) has already been checked
+ char mainChunk[mainChunkSize];
+ if (m_stream->read(mainChunk, sizeof(mainChunk)) != sizeof(mainChunk))
+ return false;
+
+ // Parse all the sub-chunks
+ bool dataChunkFound = false;
+ while (!dataChunkFound)
+ {
+ // Parse the sub-chunk id and size
+ char subChunkId[4];
+ if (m_stream->read(subChunkId, sizeof(subChunkId)) != sizeof(subChunkId))
+ return false;
+ Uint32 subChunkSize = 0;
+ if (!decode(*m_stream, subChunkSize))
+ return false;
+
+ // Check which chunk it is
+ if ((subChunkId[0] == 'f') && (subChunkId[1] == 'm') && (subChunkId[2] == 't') && (subChunkId[3] == ' '))
+ {
+ // "fmt" chunk
+
+ // Audio format
+ Uint16 format = 0;
+ if (!decode(*m_stream, format))
+ return false;
+ if (format != 1) // PCM
+ return false;
+
+ // Channel count
+ Uint16 channelCount = 0;
+ if (!decode(*m_stream, channelCount))
+ return false;
+ info.channelCount = channelCount;
+
+ // Sample rate
+ Uint32 sampleRate = 0;
+ if (!decode(*m_stream, sampleRate))
+ return false;
+ info.sampleRate = sampleRate;
+
+ // Byte rate
+ Uint32 byteRate = 0;
+ if (!decode(*m_stream, byteRate))
+ return false;
+
+ // Block align
+ Uint16 blockAlign = 0;
+ if (!decode(*m_stream, blockAlign))
+ return false;
+
+ // Bits per sample
+ Uint16 bitsPerSample = 0;
+ if (!decode(*m_stream, bitsPerSample))
+ return false;
+ m_bytesPerSample = bitsPerSample / 8;
+
+ // Skip potential extra information (should not exist for PCM)
+ if (subChunkSize > 16)
+ {
+ if (m_stream->seek(m_stream->tell() + subChunkSize - 16) == -1)
+ return false;
+ }
+ }
+ else if ((subChunkId[0] == 'd') && (subChunkId[1] == 'a') && (subChunkId[2] == 't') && (subChunkId[3] == 'a'))
+ {
+ // "data" chunk
+
+ // Compute the total number of samples
+ info.sampleCount = subChunkSize / m_bytesPerSample;
+
+ // Store the starting position of samples in the file
+ m_dataStart = m_stream->tell();
+
+ dataChunkFound = true;
+ }
+ else
+ {
+ // unknown chunk, skip it
+ if (m_stream->seek(m_stream->tell() + subChunkSize) == -1)
+ return false;
+ }
+ }
+
+ return true;
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Audio/SoundFileReaderWav.hpp b/src/SFML/Audio/SoundFileReaderWav.hpp
new file mode 100644
index 0000000..a52bc1f
--- /dev/null
+++ b/src/SFML/Audio/SoundFileReaderWav.hpp
@@ -0,0 +1,121 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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_SOUNDFILEREADERWAV_HPP
+#define SFML_SOUNDFILEREADERWAV_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/SoundFileReader.hpp>
+#include <string>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Implementation of sound file reader that handles wav files
+///
+////////////////////////////////////////////////////////////
+class SoundFileReaderWav : public SoundFileReader
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if this reader can handle a file given by an input stream
+ ///
+ /// \param stream Source stream to check
+ ///
+ /// \return True if the file is supported by this reader
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool check(InputStream& stream);
+
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ SoundFileReaderWav();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open a sound file for reading
+ ///
+ /// \param stream Stream to open
+ /// \param info Structure to fill with the attributes of the loaded sound
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool open(sf::InputStream& stream, Info& info);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change the current read position to the given sample offset
+ ///
+ /// If the given offset exceeds to total number of samples,
+ /// this function must jump to the end of the file.
+ ///
+ /// \param sampleOffset Index of the sample to jump to, relative to the beginning
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void seek(Uint64 sampleOffset);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Read audio samples from the open file
+ ///
+ /// \param samples Pointer to the sample array to fill
+ /// \param maxCount Maximum number of samples to read
+ ///
+ /// \return Number of samples actually read (may be less than \a maxCount)
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual Uint64 read(Int16* samples, Uint64 maxCount);
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Read the header of the open file
+ ///
+ /// \param info Attributes of the sound file
+ ///
+ /// \return True on success, false on error
+ ///
+ ////////////////////////////////////////////////////////////
+ bool parseHeader(Info& info);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ InputStream* m_stream; ///< Source stream to read from
+ unsigned int m_bytesPerSample; ///< Size of a sample, in bytes
+ Uint64 m_dataStart; ///< Starting position of the audio data in the open file
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_SOUNDFILEREADERWAV_HPP
diff --git a/src/SFML/Audio/SoundFileWriterFlac.cpp b/src/SFML/Audio/SoundFileWriterFlac.cpp
new file mode 100644
index 0000000..5236896
--- /dev/null
+++ b/src/SFML/Audio/SoundFileWriterFlac.cpp
@@ -0,0 +1,133 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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/SoundFileWriterFlac.hpp>
+#include <SFML/System/Err.hpp>
+#include <algorithm>
+#include <cctype>
+#include <cassert>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+bool SoundFileWriterFlac::check(const std::string& filename)
+{
+ std::string extension = filename.substr(filename.find_last_of(".") + 1);
+ std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower);
+
+ return extension == "flac";
+}
+
+
+////////////////////////////////////////////////////////////
+SoundFileWriterFlac::SoundFileWriterFlac() :
+m_encoder (NULL),
+m_channelCount(0),
+m_samples32 ()
+{
+}
+
+
+////////////////////////////////////////////////////////////
+SoundFileWriterFlac::~SoundFileWriterFlac()
+{
+ close();
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundFileWriterFlac::open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount)
+{
+ // Create the encoder
+ m_encoder = FLAC__stream_encoder_new();
+ if (!m_encoder)
+ {
+ err() << "Failed to write flac file \"" << filename << "\" (failed to allocate encoder)" << std::endl;
+ return false;
+ }
+
+ // Setup the encoder
+ FLAC__stream_encoder_set_channels(m_encoder, channelCount);
+ FLAC__stream_encoder_set_bits_per_sample(m_encoder, 16);
+ FLAC__stream_encoder_set_sample_rate(m_encoder, sampleRate);
+
+ // Initialize the output stream
+ if (FLAC__stream_encoder_init_file(m_encoder, filename.c_str(), NULL, NULL) != FLAC__STREAM_ENCODER_INIT_STATUS_OK)
+ {
+ err() << "Failed to write flac file \"" << filename << "\" (failed to open the file)" << std::endl;
+ close();
+ return false;
+ }
+
+ // Store the channel count
+ m_channelCount = channelCount;
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundFileWriterFlac::write(const Int16* samples, Uint64 count)
+{
+ while (count > 0)
+ {
+ // Make sure that we don't process too many samples at once
+ unsigned int frames = std::min(static_cast<unsigned int>(count / m_channelCount), 10000u);
+
+ // Convert the samples to 32-bits
+ m_samples32.assign(samples, samples + frames * m_channelCount);
+
+ // Write them to the FLAC stream
+ FLAC__stream_encoder_process_interleaved(m_encoder, &m_samples32[0], frames);
+
+ // Next chunk
+ count -= m_samples32.size();
+ samples += m_samples32.size();
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundFileWriterFlac::close()
+{
+ if (m_encoder)
+ {
+ // Close the output stream
+ FLAC__stream_encoder_finish(m_encoder);
+
+ // Destroy the encoder
+ FLAC__stream_encoder_delete(m_encoder);
+ m_encoder = NULL;
+ }
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Audio/SoundFileWriterFlac.hpp b/src/SFML/Audio/SoundFileWriterFlac.hpp
new file mode 100644
index 0000000..4946564
--- /dev/null
+++ b/src/SFML/Audio/SoundFileWriterFlac.hpp
@@ -0,0 +1,114 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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_SOUNDFILEWRITERFLAC_HPP
+#define SFML_SOUNDFILEWRITERFLAC_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/SoundFileWriter.hpp>
+#include <FLAC/stream_encoder.h>
+#include <vector>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Implementation of sound file writer that handles FLAC files
+///
+////////////////////////////////////////////////////////////
+class SoundFileWriterFlac : public SoundFileWriter
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if this writer can handle a file on disk
+ ///
+ /// \param filename Path of the sound file to check
+ ///
+ /// \return True if the file can be written by this writer
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool check(const std::string& filename);
+
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ SoundFileWriterFlac();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~SoundFileWriterFlac();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open a sound file for writing
+ ///
+ /// \param filename Path of the file to open
+ /// \param sampleRate Sample rate of the sound
+ /// \param channelCount Number of channels of the sound
+ ///
+ /// \return True if the file was successfully opened
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Write audio samples to the open file
+ ///
+ /// \param samples Pointer to the sample array to write
+ /// \param count Number of samples to write
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void write(const Int16* samples, Uint64 count);
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Close the file
+ ///
+ ////////////////////////////////////////////////////////////
+ void close();
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ FLAC__StreamEncoder* m_encoder; ///< FLAC stream encoder
+ unsigned int m_channelCount; ///< Number of channels
+ std::vector<Int32> m_samples32; ///< Conversion buffer
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_SOUNDFILEWRITERFLAC_HPP
diff --git a/src/SFML/Audio/SoundFileWriterOgg.cpp b/src/SFML/Audio/SoundFileWriterOgg.cpp
new file mode 100644
index 0000000..0091f84
--- /dev/null
+++ b/src/SFML/Audio/SoundFileWriterOgg.cpp
@@ -0,0 +1,206 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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/SoundFileWriterOgg.hpp>
+#include <SFML/System/Err.hpp>
+#include <algorithm>
+#include <cctype>
+#include <cstdlib>
+#include <cassert>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+bool SoundFileWriterOgg::check(const std::string& filename)
+{
+ std::string extension = filename.substr(filename.find_last_of(".") + 1);
+ std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower);
+
+ return extension == "ogg";
+}
+
+
+////////////////////////////////////////////////////////////
+SoundFileWriterOgg::SoundFileWriterOgg() :
+m_channelCount(0),
+m_file (),
+m_ogg (),
+m_vorbis (),
+m_state ()
+{
+}
+
+
+////////////////////////////////////////////////////////////
+SoundFileWriterOgg::~SoundFileWriterOgg()
+{
+ close();
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundFileWriterOgg::open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount)
+{
+ // Save the channel count
+ m_channelCount = channelCount;
+
+ // Initialize the ogg/vorbis stream
+ ogg_stream_init(&m_ogg, std::rand());
+ vorbis_info_init(&m_vorbis);
+
+ // Setup the encoder: VBR, automatic bitrate management
+ // Quality is in range [-1 .. 1], 0.4 gives ~128 kbps for a 44 KHz stereo sound
+ int status = vorbis_encode_init_vbr(&m_vorbis, channelCount, sampleRate, 0.4f);
+ if (status < 0)
+ {
+ err() << "Failed to write ogg/vorbis file \"" << filename << "\" (unsupported bitrate)" << std::endl;
+ close();
+ return false;
+ }
+ vorbis_analysis_init(&m_state, &m_vorbis);
+
+ // Open the file after the vorbis setup is ok
+ m_file.open(filename.c_str(), std::ios::binary);
+ if (!m_file)
+ {
+ err() << "Failed to write ogg/vorbis file \"" << filename << "\" (cannot open file)" << std::endl;
+ close();
+ return false;
+ }
+
+ // Generate header metadata (leave it empty)
+ vorbis_comment comment;
+ vorbis_comment_init(&comment);
+
+ // Generate the header packets
+ ogg_packet header, headerComm, headerCode;
+ status = vorbis_analysis_headerout(&m_state, &comment, &header, &headerComm, &headerCode);
+ vorbis_comment_clear(&comment);
+ if (status < 0)
+ {
+ err() << "Failed to write ogg/vorbis file \"" << filename << "\" (cannot generate the headers)" << std::endl;
+ close();
+ return false;
+ }
+
+ // Write the header packets to the ogg stream
+ ogg_stream_packetin(&m_ogg, &header);
+ ogg_stream_packetin(&m_ogg, &headerComm);
+ ogg_stream_packetin(&m_ogg, &headerCode);
+
+ // This ensures the actual audio data will start on a new page, as per spec
+ ogg_page page;
+ while (ogg_stream_flush(&m_ogg, &page) > 0)
+ {
+ m_file.write(reinterpret_cast<const char*>(page.header), page.header_len);
+ m_file.write(reinterpret_cast<const char*>(page.body), page.body_len);
+ }
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundFileWriterOgg::write(const Int16* samples, Uint64 count)
+{
+ // Prepare a buffer to hold our samples
+ int frameCount = static_cast<int>(count / m_channelCount);
+ float** buffer = vorbis_analysis_buffer(&m_state, frameCount);
+ assert(buffer);
+
+ // Write the samples to the buffer, converted to float
+ for (int i = 0; i < frameCount; ++i)
+ for (unsigned int j = 0; j < m_channelCount; ++j)
+ buffer[j][i] = *samples++ / 32767.0f;
+
+ // Tell the library how many samples we've written
+ vorbis_analysis_wrote(&m_state, frameCount);
+
+ // Flush any produced block
+ flushBlocks();
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundFileWriterOgg::flushBlocks()
+{
+ // Let the library divide uncompressed data into blocks, and process them
+ vorbis_block block;
+ vorbis_block_init(&m_state, &block);
+ while (vorbis_analysis_blockout(&m_state, &block) == 1)
+ {
+ // Let the automatic bitrate management do its job
+ vorbis_analysis(&block, NULL);
+ vorbis_bitrate_addblock(&block);
+
+ // Get new packets from the bitrate management engine
+ ogg_packet packet;
+ while (vorbis_bitrate_flushpacket(&m_state, &packet))
+ {
+ // Write the packet to the ogg stream
+ ogg_stream_packetin(&m_ogg, &packet);
+
+ // If the stream produced new pages, write them to the output file
+ ogg_page page;
+ while (ogg_stream_flush(&m_ogg, &page) > 0)
+ {
+ m_file.write(reinterpret_cast<const char*>(page.header), page.header_len);
+ m_file.write(reinterpret_cast<const char*>(page.body), page.body_len);
+ }
+ }
+ }
+
+ // Clear the allocated block
+ vorbis_block_clear(&block);
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundFileWriterOgg::close()
+{
+ if (m_file.is_open())
+ {
+ // Submit an empty packet to mark the end of stream
+ vorbis_analysis_wrote(&m_state, 0);
+ flushBlocks();
+
+ // Close the file
+ m_file.close();
+ }
+
+ // Clear all the ogg/vorbis structures
+ ogg_stream_clear(&m_ogg);
+ vorbis_dsp_clear(&m_state);
+ vorbis_info_clear(&m_vorbis);
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Audio/SoundFileWriterOgg.hpp b/src/SFML/Audio/SoundFileWriterOgg.hpp
new file mode 100644
index 0000000..bac570d
--- /dev/null
+++ b/src/SFML/Audio/SoundFileWriterOgg.hpp
@@ -0,0 +1,122 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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_SOUNDFILEWRITEROGG_HPP
+#define SFML_SOUNDFILEWRITEROGG_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/SoundFileWriter.hpp>
+#include <vorbis/vorbisenc.h>
+#include <fstream>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Implementation of sound file writer that handles OGG/Vorbis files
+///
+////////////////////////////////////////////////////////////
+class SoundFileWriterOgg : public SoundFileWriter
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if this writer can handle a file on disk
+ ///
+ /// \param filename Path of the sound file to check
+ ///
+ /// \return True if the file can be written by this writer
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool check(const std::string& filename);
+
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ SoundFileWriterOgg();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~SoundFileWriterOgg();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open a sound file for writing
+ ///
+ /// \param filename Path of the file to open
+ /// \param sampleRate Sample rate of the sound
+ /// \param channelCount Number of channels of the sound
+ ///
+ /// \return True if the file was successfully opened
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Write audio samples to the open file
+ ///
+ /// \param samples Pointer to the sample array to write
+ /// \param count Number of samples to write
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void write(const Int16* samples, Uint64 count);
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Flush blocks produced by the ogg stream, if any
+ ///
+ ////////////////////////////////////////////////////////////
+ void flushBlocks();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Close the file
+ ///
+ ////////////////////////////////////////////////////////////
+ void close();
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ unsigned int m_channelCount; // channel count of the sound being written
+ std::ofstream m_file; // output file
+ ogg_stream_state m_ogg; // ogg stream
+ vorbis_info m_vorbis; // vorbis handle
+ vorbis_dsp_state m_state; // current encoding state
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_SOUNDFILEWRITEROGG_HPP
diff --git a/src/SFML/Audio/SoundFileWriterWav.cpp b/src/SFML/Audio/SoundFileWriterWav.cpp
new file mode 100644
index 0000000..e7f977d
--- /dev/null
+++ b/src/SFML/Audio/SoundFileWriterWav.cpp
@@ -0,0 +1,207 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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/SoundFileWriterWav.hpp>
+#include <SFML/System/Err.hpp>
+#include <algorithm>
+#include <cctype>
+#include <cassert>
+
+
+namespace
+{
+ // The following functions takes integers in host byte order
+ // and writes them to a stream as little endian
+
+ void encode(std::ostream& stream, sf::Int16 value)
+ {
+ unsigned char bytes[] =
+ {
+ static_cast<unsigned char>(value & 0xFF),
+ static_cast<unsigned char>(value >> 8)
+ };
+ stream.write(reinterpret_cast<const char*>(bytes), sizeof(bytes));
+ }
+
+ void encode(std::ostream& stream, sf::Uint16 value)
+ {
+ unsigned char bytes[] =
+ {
+ static_cast<unsigned char>(value & 0xFF),
+ static_cast<unsigned char>(value >> 8)
+ };
+ stream.write(reinterpret_cast<const char*>(bytes), sizeof(bytes));
+ }
+
+ void encode(std::ostream& stream, sf::Uint32 value)
+ {
+ unsigned char bytes[] =
+ {
+ static_cast<unsigned char>(value & 0x000000FF),
+ static_cast<unsigned char>((value & 0x0000FF00) >> 8),
+ static_cast<unsigned char>((value & 0x00FF0000) >> 16),
+ static_cast<unsigned char>((value & 0xFF000000) >> 24),
+ };
+ stream.write(reinterpret_cast<const char*>(bytes), sizeof(bytes));
+ }
+}
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+bool SoundFileWriterWav::check(const std::string& filename)
+{
+ std::string extension = filename.substr(filename.find_last_of(".") + 1);
+ std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower);
+
+ return extension == "wav";
+}
+
+
+////////////////////////////////////////////////////////////
+SoundFileWriterWav::SoundFileWriterWav() :
+m_file (),
+m_sampleCount (0),
+m_channelCount(0)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+SoundFileWriterWav::~SoundFileWriterWav()
+{
+ close();
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundFileWriterWav::open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount)
+{
+ // Open the file
+ m_file.open(filename.c_str(), std::ios::binary);
+ if (!m_file)
+ {
+ err() << "Failed to open WAV sound file \"" << filename << "\" for writing" << std::endl;
+ return false;
+ }
+
+ // Write the header
+ if (!writeHeader(sampleRate, channelCount))
+ {
+ err() << "Failed to write header of WAV sound file \"" << filename << "\"" << std::endl;
+ return false;
+ }
+
+ // Save the channel count
+ m_channelCount = channelCount;
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundFileWriterWav::write(const Int16* samples, Uint64 count)
+{
+ assert(m_file.good());
+
+ m_sampleCount += count;
+
+ while (count--)
+ encode(m_file, *samples++);
+}
+
+
+////////////////////////////////////////////////////////////
+bool SoundFileWriterWav::writeHeader(unsigned int sampleRate, unsigned int channelCount)
+{
+ assert(m_file.good());
+
+ // Write the main chunk ID
+ char mainChunkId[4] = {'R', 'I', 'F', 'F'};
+ m_file.write(mainChunkId, sizeof(mainChunkId));
+
+ // Write the main chunk header
+ Uint32 mainChunkSize = 0; // placeholder, will be written later
+ encode(m_file, mainChunkSize);
+ char mainChunkFormat[4] = {'W', 'A', 'V', 'E'};
+ m_file.write(mainChunkFormat, sizeof(mainChunkFormat));
+
+ // Write the sub-chunk 1 ("format") id and size
+ char fmtChunkId[4] = {'f', 'm', 't', ' '};
+ m_file.write(fmtChunkId, sizeof(fmtChunkId));
+ Uint32 fmtChunkSize = 16;
+ encode(m_file, fmtChunkSize);
+
+ // Write the format (PCM)
+ Uint16 format = 1;
+ encode(m_file, format);
+
+ // Write the sound attributes
+ encode(m_file, static_cast<Uint16>(channelCount));
+ encode(m_file, static_cast<Uint32>(sampleRate));
+ Uint32 byteRate = sampleRate * channelCount * 2;
+ encode(m_file, byteRate);
+ Uint16 blockAlign = channelCount * 2;
+ encode(m_file, blockAlign);
+ Uint16 bitsPerSample = 16;
+ encode(m_file, bitsPerSample);
+
+ // Write the sub-chunk 2 ("data") id and size
+ char dataChunkId[4] = {'d', 'a', 't', 'a'};
+ m_file.write(dataChunkId, sizeof(dataChunkId));
+ Uint32 dataChunkSize = 0; // placeholder, will be written later
+ encode(m_file, dataChunkSize);
+
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+void SoundFileWriterWav::close()
+{
+ // If the file is open, finalize the header and close it
+ if (m_file.is_open())
+ {
+ m_file.flush();
+
+ // Update the main chunk size and data sub-chunk size
+ Uint32 dataChunkSize = static_cast<Uint32>(m_sampleCount * m_channelCount * 2);
+ Uint32 mainChunkSize = dataChunkSize + 36;
+ m_file.seekp(4);
+ encode(m_file, mainChunkSize);
+ m_file.seekp(40);
+ encode(m_file, dataChunkSize);
+
+ m_file.close();
+ }
+}
+
+} // namespace priv
+
+} // namespace sf
diff --git a/src/SFML/Audio/SoundFileWriterWav.hpp b/src/SFML/Audio/SoundFileWriterWav.hpp
new file mode 100644
index 0000000..d96b4d3
--- /dev/null
+++ b/src/SFML/Audio/SoundFileWriterWav.hpp
@@ -0,0 +1,125 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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_SOUNDFILEWRITERWAV_HPP
+#define SFML_SOUNDFILEWRITERWAV_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/SoundFileWriter.hpp>
+#include <fstream>
+#include <string>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Implementation of sound file writer that handles wav files
+///
+////////////////////////////////////////////////////////////
+class SoundFileWriterWav : public SoundFileWriter
+{
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if this writer can handle a file on disk
+ ///
+ /// \param filename Path of the sound file to check
+ ///
+ /// \return True if the file can be written by this writer
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool check(const std::string& filename);
+
+public:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ SoundFileWriterWav();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~SoundFileWriterWav();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Open a sound file for writing
+ ///
+ /// \param filename Path of the file to open
+ /// \param sampleRate Sample rate of the sound
+ /// \param channelCount Number of channels of the sound
+ ///
+ /// \return True if the file was successfully opened
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Write audio samples to the open file
+ ///
+ /// \param samples Pointer to the sample array to write
+ /// \param count Number of samples to write
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void write(const Int16* samples, Uint64 count);
+
+private:
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Write the header of the open file
+ ///
+ /// \param sampleRate Sample rate of the sound
+ /// \param channelCount Number of channels of the sound
+ ///
+ /// \return True on success, false on error
+ ///
+ ////////////////////////////////////////////////////////////
+ bool writeHeader(unsigned int sampleRate, unsigned int channelCount);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Close the file
+ ///
+ ////////////////////////////////////////////////////////////
+ void close();
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ std::ofstream m_file; ///< File stream to write to
+ Uint64 m_sampleCount; ///< Total number of samples written to the file
+ unsigned int m_channelCount; ///< Number of channels of the sound
+};
+
+} // namespace priv
+
+} // namespace sf
+
+
+#endif // SFML_SOUNDFILEWRITERWAV_HPP
diff --git a/src/SFML/Audio/SoundRecorder.cpp b/src/SFML/Audio/SoundRecorder.cpp
index 51e7ef9..84a4854 100644
--- a/src/SFML/Audio/SoundRecorder.cpp
+++ b/src/SFML/Audio/SoundRecorder.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -51,8 +51,6 @@ m_sampleRate (0),
m_processingInterval(milliseconds(100)),
m_isCapturing (false)
{
- priv::ensureALInit();
-
// Set the device name to the default device
m_deviceName = getDefaultDevice();
}
diff --git a/src/SFML/Audio/SoundSource.cpp b/src/SFML/Audio/SoundSource.cpp
index 3129b2e..977769e 100644
--- a/src/SFML/Audio/SoundSource.cpp
+++ b/src/SFML/Audio/SoundSource.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,8 +34,6 @@ namespace sf
////////////////////////////////////////////////////////////
SoundSource::SoundSource()
{
- priv::ensureALInit();
-
alCheck(alGenSources(1, &m_source));
alCheck(alSourcei(m_source, AL_BUFFER, 0));
}
@@ -44,8 +42,6 @@ SoundSource::SoundSource()
////////////////////////////////////////////////////////////
SoundSource::SoundSource(const SoundSource& copy)
{
- priv::ensureALInit();
-
alCheck(alGenSources(1, &m_source));
alCheck(alSourcei(m_source, AL_BUFFER, 0));
diff --git a/src/SFML/Audio/SoundStream.cpp b/src/SFML/Audio/SoundStream.cpp
index 8321889..81977fd 100644
--- a/src/SFML/Audio/SoundStream.cpp
+++ b/src/SFML/Audio/SoundStream.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -274,17 +274,21 @@ void SoundStream::streamData()
m_isStreaming = false;
return;
}
+ }
- // Create the buffers
- alCheck(alGenBuffers(BufferCount, m_buffers));
- for (int i = 0; i < BufferCount; ++i)
- m_endBuffers[i] = false;
+ // Create the buffers
+ alCheck(alGenBuffers(BufferCount, m_buffers));
+ for (int i = 0; i < BufferCount; ++i)
+ m_endBuffers[i] = false;
- // Fill the queue
- requestStop = fillQueue();
+ // Fill the queue
+ requestStop = fillQueue();
- // Play the sound
- alCheck(alSourcePlay(m_source));
+ // Play the sound
+ alCheck(alSourcePlay(m_source));
+
+ {
+ Lock lock(m_threadMutex);
// Check if the thread was launched Paused
if (m_threadStartState == Paused)
diff --git a/src/SFML/CMakeLists.txt b/src/SFML/CMakeLists.txt
index 1bbfc7f..392ed82 100644
--- a/src/SFML/CMakeLists.txt
+++ b/src/SFML/CMakeLists.txt
@@ -48,6 +48,4 @@ endif()
add_subdirectory(Window)
add_subdirectory(Network)
add_subdirectory(Graphics)
-if(NOT SFML_OS_IOS)
- add_subdirectory(Audio)
-endif()
+add_subdirectory(Audio)
diff --git a/src/SFML/Graphics/BlendMode.cpp b/src/SFML/Graphics/BlendMode.cpp
index 3d392f4..a9fb085 100644
--- a/src/SFML/Graphics/BlendMode.cpp
+++ b/src/SFML/Graphics/BlendMode.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/CMakeLists.txt b/src/SFML/Graphics/CMakeLists.txt
index 81a730e..6f02fb6 100644
--- a/src/SFML/Graphics/CMakeLists.txt
+++ b/src/SFML/Graphics/CMakeLists.txt
@@ -46,6 +46,10 @@ set(SRC
${SRCROOT}/Vertex.cpp
${INCROOT}/Vertex.hpp
)
+if(NOT SFML_OPENGL_ES)
+ list(APPEND SRC ${SRCROOT}/GLLoader.cpp)
+ list(APPEND SRC ${SRCROOT}/GLLoader.hpp)
+endif()
source_group("" FILES ${SRC})
# drawables sources
@@ -80,43 +84,31 @@ set(RENDER_TEXTURE_SRC
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()
+include_directories("${PROJECT_SOURCE_DIR}/extlibs/headers/stb_image")
# 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")
+ 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/freetype2")
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_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/jpeg")
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/freetype2")
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-osx/Frameworks")
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")
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/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")
+ set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers/freetype2")
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})
+ include_directories(${FREETYPE_INCLUDE_DIRS} ${JPEG_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
endif()
if(SFML_OPENGL_ES AND SFML_OS_LINUX)
find_package(EGL REQUIRED)
@@ -134,7 +126,7 @@ 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})
+ list(APPEND GRAPHICS_EXT_LIBS ${OPENGL_gl_LIBRARY})
if(SFML_OS_LINUX)
list(APPEND GRAPHICS_EXT_LIBS ${X11_LIBRARIES})
endif()
@@ -145,14 +137,11 @@ endif()
if(SFML_OS_IOS)
list(APPEND GRAPHICS_EXT_LIBS "-framework OpenGLES")
elseif(SFML_OS_ANDROID)
- list(APPEND GRAPHICS_EXT_LIBS -lz)
+ list(APPEND GRAPHICS_EXT_LIBS z)
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
diff --git a/src/SFML/Graphics/CircleShape.cpp b/src/SFML/Graphics/CircleShape.cpp
index 355a007..24bd9d3 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,7 @@
namespace sf
{
////////////////////////////////////////////////////////////
-CircleShape::CircleShape(float radius, unsigned int pointCount) :
+CircleShape::CircleShape(float radius, std::size_t pointCount) :
m_radius (radius),
m_pointCount(pointCount)
{
@@ -56,21 +56,21 @@ float CircleShape::getRadius() const
////////////////////////////////////////////////////////////
-void CircleShape::setPointCount(unsigned int count)
+void CircleShape::setPointCount(std::size_t count)
{
m_pointCount = count;
update();
}
////////////////////////////////////////////////////////////
-unsigned int CircleShape::getPointCount() const
+std::size_t CircleShape::getPointCount() const
{
return m_pointCount;
}
////////////////////////////////////////////////////////////
-Vector2f CircleShape::getPoint(unsigned int index) const
+Vector2f CircleShape::getPoint(std::size_t index) const
{
static const float pi = 3.141592654f;
diff --git a/src/SFML/Graphics/Color.cpp b/src/SFML/Graphics/Color.cpp
index 00d215a..0bcd502 100644
--- a/src/SFML/Graphics/Color.cpp
+++ b/src/SFML/Graphics/Color.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -68,6 +68,24 @@ a(alpha)
////////////////////////////////////////////////////////////
+Color::Color(Uint32 color) :
+r((color & 0xff000000) >> 24),
+g((color & 0x00ff0000) >> 16),
+b((color & 0x0000ff00) >> 8 ),
+a((color & 0x000000ff) >> 0 )
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+Uint32 Color::toInteger() const
+{
+ return (r << 24) | (g << 16) | (b << 8) | a;
+}
+
+
+////////////////////////////////////////////////////////////
bool operator ==(const Color& left, const Color& right)
{
return (left.r == right.r) &&
diff --git a/src/SFML/Graphics/ConvexShape.cpp b/src/SFML/Graphics/ConvexShape.cpp
index 73bf234..f605647 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -31,14 +31,14 @@
namespace sf
{
////////////////////////////////////////////////////////////
-ConvexShape::ConvexShape(unsigned int pointCount)
+ConvexShape::ConvexShape(std::size_t pointCount)
{
setPointCount(pointCount);
}
////////////////////////////////////////////////////////////
-void ConvexShape::setPointCount(unsigned int count)
+void ConvexShape::setPointCount(std::size_t count)
{
m_points.resize(count);
update();
@@ -46,14 +46,14 @@ void ConvexShape::setPointCount(unsigned int count)
////////////////////////////////////////////////////////////
-unsigned int ConvexShape::getPointCount() const
+std::size_t ConvexShape::getPointCount() const
{
- return static_cast<unsigned int>(m_points.size());
+ return m_points.size();
}
////////////////////////////////////////////////////////////
-void ConvexShape::setPoint(unsigned int index, const Vector2f& point)
+void ConvexShape::setPoint(std::size_t index, const Vector2f& point)
{
m_points[index] = point;
update();
@@ -61,7 +61,7 @@ void ConvexShape::setPoint(unsigned int index, const Vector2f& point)
////////////////////////////////////////////////////////////
-Vector2f ConvexShape::getPoint(unsigned int index) const
+Vector2f ConvexShape::getPoint(std::size_t index) const
{
return m_points[index];
}
diff --git a/src/SFML/Graphics/Font.cpp b/src/SFML/Graphics/Font.cpp
index e54be40..9940ce1 100644
--- a/src/SFML/Graphics/Font.cpp
+++ b/src/SFML/Graphics/Font.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/GLCheck.cpp b/src/SFML/Graphics/GLCheck.cpp
index 0e8f6de..ce777b2 100644
--- a/src/SFML/Graphics/GLCheck.cpp
+++ b/src/SFML/Graphics/GLCheck.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/GLCheck.hpp b/src/SFML/Graphics/GLCheck.hpp
index 23ee4d0..743afcb 100644
--- a/src/SFML/Graphics/GLCheck.hpp
+++ b/src/SFML/Graphics/GLCheck.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/GLExtensions.cpp b/src/SFML/Graphics/GLExtensions.cpp
index d3caf6c..0c257e8 100644
--- a/src/SFML/Graphics/GLExtensions.cpp
+++ b/src/SFML/Graphics/GLExtensions.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -40,15 +40,15 @@ void ensureExtensionsInit()
static bool initialized = false;
if (!initialized)
{
- GLenum status = glewInit();
- if (status == GLEW_OK)
- {
- initialized = true;
- }
- else
+ sfogl_LoadFunctions();
+
+ if (!sfogl_IsVersionGEQ(1, 1))
{
- err() << "Failed to initialize GLEW, " << glewGetErrorString(status) << std::endl;
+ err() << "sfml-graphics requires support for OpenGL 1.1 or greater" << std::endl;
+ err() << "Ensure that hardware acceleration is enabled if available" << std::endl;
}
+
+ initialized = true;
}
#endif
}
diff --git a/src/SFML/Graphics/GLExtensions.hpp b/src/SFML/Graphics/GLExtensions.hpp
index ae97741..7cff594 100644
--- a/src/SFML/Graphics/GLExtensions.hpp
+++ b/src/SFML/Graphics/GLExtensions.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,80 +34,184 @@
#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
+ // SFML requires at a bare minimum OpenGL ES 1.0 capability
+ // Some extensions only incorporated by 2.0 are also required
+ // OpenGL ES 1.0 is defined relative to OpenGL 1.3
+ // OpenGL ES 1.1 is defined relative to OpenGL 1.5
+ // OpenGL ES 2.0 is defined relative to OpenGL 2.0
+ // All functionality beyond that is optional
+ // and has to be checked for prior to use
+
+ // Core since 1.0
+ #define GLEXT_multitexture true
+ #define GLEXT_texture_edge_clamp true
+ #define GLEXT_blend_minmax true
+ #define GLEXT_glClientActiveTexture glClientActiveTexture
+ #define GLEXT_glActiveTexture glActiveTexture
+ #define GLEXT_GL_TEXTURE0 GL_TEXTURE0
+ #define GLEXT_GL_CLAMP GL_CLAMP_TO_EDGE
+ #define GLEXT_GL_CLAMP_TO_EDGE GL_CLAMP_TO_EDGE
+
+ // The following extensions are listed chronologically
+ // Extension macro first, followed by tokens then
+ // functions according to the corresponding specification
+
+ // The following extensions are required.
+
+ // Core since 2.0 - OES_blend_subtract
+ #define GLEXT_blend_subtract GL_OES_blend_subtract
+ #define GLEXT_glBlendEquation glBlendEquationOES
+ #define GLEXT_GL_FUNC_ADD GL_FUNC_ADD_OES
+ #define GLEXT_GL_FUNC_SUBTRACT GL_FUNC_SUBTRACT_OES
+
+ // The following extensions are optional.
+
+ // Core since 2.0 - OES_blend_func_separate
+ #ifdef SFML_SYSTEM_ANDROID
+ // Hack to make transparency working on some Android devices
+ #define GLEXT_blend_func_separate false
+ #else
+ #define GLEXT_blend_func_separate GL_OES_blend_func_separate
+ #endif
+ #define GLEXT_glBlendFuncSeparate glBlendFuncSeparateOES
+
+ // Core since 2.0 - OES_blend_equation_separate
+ #ifdef SFML_SYSTEM_ANDROID
+ // Hack to make transparency working on some Android devices
+ #define GLEXT_blend_equation_separate false
+ #else
+ #define GLEXT_blend_equation_separate GL_OES_blend_equation_separate
+ #endif
+ #define GLEXT_glBlendEquationSeparate glBlendEquationSeparateOES
+
+ // Core since 2.0 - OES_texture_npot
+ #define GLEXT_texture_non_power_of_two false
+
+ // Core since 2.0 - OES_framebuffer_object
+ #define GLEXT_framebuffer_object GL_OES_framebuffer_object
+ #define GLEXT_glBindRenderbuffer glBindRenderbufferOES
+ #define GLEXT_glDeleteRenderbuffers glDeleteRenderbuffersOES
+ #define GLEXT_glGenRenderbuffers glGenRenderbuffersOES
+ #define GLEXT_glRenderbufferStorage glRenderbufferStorageOES
+ #define GLEXT_glBindFramebuffer glBindFramebufferOES
+ #define GLEXT_glDeleteFramebuffers glDeleteFramebuffersOES
+ #define GLEXT_glGenFramebuffers glGenFramebuffersOES
+ #define GLEXT_glCheckFramebufferStatus glCheckFramebufferStatusOES
+ #define GLEXT_glFramebufferTexture2D glFramebufferTexture2DOES
+ #define GLEXT_glFramebufferRenderbuffer glFramebufferRenderbufferOES
+ #define GLEXT_GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
+ #define GLEXT_GL_RENDERBUFFER GL_RENDERBUFFER_OES
+ #define GLEXT_GL_DEPTH_COMPONENT GL_DEPTH_COMPONENT16_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_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING_OES
+ #define GLEXT_GL_INVALID_FRAMEBUFFER_OPERATION GL_INVALID_FRAMEBUFFER_OPERATION_OES
#else
- #include <GL/glew.h>
- #include <SFML/OpenGL.hpp>
+ #include <SFML/Graphics/GLLoader.hpp>
+
+ // SFML requires at a bare minimum OpenGL 1.1 capability
+ // All functionality beyond that is optional
+ // and has to be checked for prior to use
+
+ // Core since 1.1
+ #define GLEXT_GL_DEPTH_COMPONENT GL_DEPTH_COMPONENT
+ #define GLEXT_GL_CLAMP GL_CLAMP
+
+ // The following extensions are listed chronologically
+ // Extension macro first, followed by tokens then
+ // functions according to the corresponding specification
+
+ // The following extensions are optional.
+
+ // Core since 1.2 - SGIS_texture_edge_clamp
+ #define GLEXT_texture_edge_clamp sfogl_ext_SGIS_texture_edge_clamp
+ #define GLEXT_GL_CLAMP_TO_EDGE GL_CLAMP_TO_EDGE_SGIS
+
+ // Core since 1.2 - EXT_blend_minmax
+ #define GLEXT_blend_minmax sfogl_ext_EXT_blend_minmax
+ #define GLEXT_glBlendEquation glBlendEquationEXT
+ #define GLEXT_GL_FUNC_ADD GL_FUNC_ADD_EXT
+
+ // Core since 1.2 - EXT_blend_subtract
+ #define GLEXT_blend_subtract sfogl_ext_EXT_blend_subtract
+ #define GLEXT_GL_FUNC_SUBTRACT GL_FUNC_SUBTRACT_EXT
+
+ // Core since 1.3 - ARB_multitexture
+ #define GLEXT_multitexture sfogl_ext_ARB_multitexture
+ #define GLEXT_glClientActiveTexture glClientActiveTextureARB
+ #define GLEXT_glActiveTexture glActiveTextureARB
+ #define GLEXT_GL_TEXTURE0 GL_TEXTURE0_ARB
+
+ // Core since 1.4 - EXT_blend_func_separate
+ #define GLEXT_blend_func_separate sfogl_ext_EXT_blend_func_separate
+ #define GLEXT_glBlendFuncSeparate glBlendFuncSeparateEXT
+
+ // Core since 2.0 - ARB_shading_language_100
+ #define GLEXT_shading_language_100 sfogl_ext_ARB_shading_language_100
+
+ // Core since 2.0 - ARB_shader_objects
+ #define GLEXT_shader_objects sfogl_ext_ARB_shader_objects
+ #define GLEXT_glDeleteObject glDeleteObjectARB
+ #define GLEXT_glGetHandle glGetHandleARB
+ #define GLEXT_glCreateShaderObject glCreateShaderObjectARB
+ #define GLEXT_glShaderSource glShaderSourceARB
+ #define GLEXT_glCompileShader glCompileShaderARB
+ #define GLEXT_glCreateProgramObject glCreateProgramObjectARB
+ #define GLEXT_glAttachObject glAttachObjectARB
+ #define GLEXT_glLinkProgram glLinkProgramARB
+ #define GLEXT_glUseProgramObject glUseProgramObjectARB
+ #define GLEXT_glUniform1f glUniform1fARB
+ #define GLEXT_glUniform2f glUniform2fARB
+ #define GLEXT_glUniform3f glUniform3fARB
+ #define GLEXT_glUniform4f glUniform4fARB
+ #define GLEXT_glUniform1i glUniform1iARB
+ #define GLEXT_glUniformMatrix4fv glUniformMatrix4fvARB
+ #define GLEXT_glGetObjectParameteriv glGetObjectParameterivARB
+ #define GLEXT_glGetInfoLog glGetInfoLogARB
+ #define GLEXT_glGetUniformLocation glGetUniformLocationARB
+ #define GLEXT_GL_PROGRAM_OBJECT GL_PROGRAM_OBJECT_ARB
+ #define GLEXT_GL_OBJECT_COMPILE_STATUS GL_OBJECT_COMPILE_STATUS_ARB
+ #define GLEXT_GL_OBJECT_LINK_STATUS GL_OBJECT_LINK_STATUS_ARB
+ #define GLEXT_GLhandle GLhandleARB
+
+ // Core since 2.0 - ARB_vertex_shader
+ #define GLEXT_vertex_shader sfogl_ext_ARB_vertex_shader
+ #define GLEXT_GL_VERTEX_SHADER GL_VERTEX_SHADER_ARB
+ #define GLEXT_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB
+
+ // Core since 2.0 - ARB_fragment_shader
+ #define GLEXT_fragment_shader sfogl_ext_ARB_fragment_shader
+ #define GLEXT_GL_FRAGMENT_SHADER GL_FRAGMENT_SHADER_ARB
+
+ // Core since 2.0 - ARB_texture_non_power_of_two
+ #define GLEXT_texture_non_power_of_two sfogl_ext_ARB_texture_non_power_of_two
+
+ // Core since 2.0 - EXT_blend_equation_separate
+ #define GLEXT_blend_equation_separate sfogl_ext_EXT_blend_equation_separate
+ #define GLEXT_glBlendEquationSeparate glBlendEquationSeparateEXT
- #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
+ // Core since 3.0 - EXT_framebuffer_object
+ #define GLEXT_framebuffer_object sfogl_ext_EXT_framebuffer_object
+ #define GLEXT_glBindRenderbuffer glBindRenderbufferEXT
+ #define GLEXT_glDeleteRenderbuffers glDeleteRenderbuffersEXT
+ #define GLEXT_glGenRenderbuffers glGenRenderbuffersEXT
+ #define GLEXT_glRenderbufferStorage glRenderbufferStorageEXT
+ #define GLEXT_glBindFramebuffer glBindFramebufferEXT
+ #define GLEXT_glDeleteFramebuffers glDeleteFramebuffersEXT
+ #define GLEXT_glGenFramebuffers glGenFramebuffersEXT
+ #define GLEXT_glCheckFramebufferStatus glCheckFramebufferStatusEXT
+ #define GLEXT_glFramebufferTexture2D glFramebufferTexture2DEXT
+ #define GLEXT_glFramebufferRenderbuffer glFramebufferRenderbufferEXT
+ #define GLEXT_GL_FRAMEBUFFER GL_FRAMEBUFFER_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_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING_EXT
+ #define GLEXT_GL_INVALID_FRAMEBUFFER_OPERATION GL_INVALID_FRAMEBUFFER_OPERATION_EXT
#endif
diff --git a/src/SFML/Graphics/GLExtensions.txt b/src/SFML/Graphics/GLExtensions.txt
new file mode 100644
index 0000000..5f2b5b3
--- /dev/null
+++ b/src/SFML/Graphics/GLExtensions.txt
@@ -0,0 +1,17 @@
+// Created with:
+// https://bitbucket.org/KhronosGroup/glloadgen
+// Commit d143d66ac90d538ed06f806188714861b8e8e2f9
+// lua LoadGen.lua -style=pointer_c -spec=gl -version=1.1 -indent=space -prefix=sf -extfile=GLExtensions.txt GLLoader
+
+SGIS_texture_edge_clamp
+EXT_blend_minmax
+EXT_blend_subtract
+ARB_multitexture
+EXT_blend_func_separate
+ARB_shading_language_100
+ARB_shader_objects
+ARB_vertex_shader
+ARB_fragment_shader
+ARB_texture_non_power_of_two
+EXT_blend_equation_separate
+EXT_framebuffer_object
diff --git a/src/SFML/Graphics/GLLoader.cpp b/src/SFML/Graphics/GLLoader.cpp
new file mode 100644
index 0000000..cceab2f
--- /dev/null
+++ b/src/SFML/Graphics/GLLoader.cpp
@@ -0,0 +1,551 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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/GLLoader.hpp>
+#include <SFML/Graphics/GLCheck.hpp>
+#include <SFML/Window/Context.hpp>
+#include <cstdlib>
+#include <cstring>
+#include <cstddef>
+
+#if !defined(GL_MAJOR_VERSION)
+ #define GL_MAJOR_VERSION 0x821B
+#endif
+
+#if !defined(GL_MINOR_VERSION)
+ #define GL_MINOR_VERSION 0x821C
+#endif
+
+#if !defined(GL_NUM_EXTENSIONS)
+ #define GL_NUM_EXTENSIONS 0x821D
+#endif
+
+static sf::GlFunctionPointer IntGetProcAddress(const char* name)
+{
+ return sf::Context::getFunction(name);
+}
+
+int sfogl_ext_SGIS_texture_edge_clamp = sfogl_LOAD_FAILED;
+int sfogl_ext_EXT_blend_minmax = sfogl_LOAD_FAILED;
+int sfogl_ext_EXT_blend_subtract = sfogl_LOAD_FAILED;
+int sfogl_ext_ARB_multitexture = sfogl_LOAD_FAILED;
+int sfogl_ext_EXT_blend_func_separate = sfogl_LOAD_FAILED;
+int sfogl_ext_ARB_shading_language_100 = sfogl_LOAD_FAILED;
+int sfogl_ext_ARB_shader_objects = sfogl_LOAD_FAILED;
+int sfogl_ext_ARB_vertex_shader = sfogl_LOAD_FAILED;
+int sfogl_ext_ARB_fragment_shader = sfogl_LOAD_FAILED;
+int sfogl_ext_ARB_texture_non_power_of_two = sfogl_LOAD_FAILED;
+int sfogl_ext_EXT_blend_equation_separate = sfogl_LOAD_FAILED;
+int sfogl_ext_EXT_framebuffer_object = sfogl_LOAD_FAILED;
+
+void (CODEGEN_FUNCPTR *sf_ptrc_glBlendEquationEXT)(GLenum) = NULL;
+
+static int Load_EXT_blend_minmax()
+{
+ int numFailed = 0;
+ sf_ptrc_glBlendEquationEXT = (void (CODEGEN_FUNCPTR *)(GLenum))IntGetProcAddress("glBlendEquationEXT");
+ if(!sf_ptrc_glBlendEquationEXT) numFailed++;
+ return numFailed;
+}
+
+void (CODEGEN_FUNCPTR *sf_ptrc_glActiveTextureARB)(GLenum) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glClientActiveTextureARB)(GLenum) = NULL;
+
+static int Load_ARB_multitexture()
+{
+ int numFailed = 0;
+ sf_ptrc_glActiveTextureARB = (void (CODEGEN_FUNCPTR *)(GLenum))IntGetProcAddress("glActiveTextureARB");
+ if(!sf_ptrc_glActiveTextureARB) numFailed++;
+ sf_ptrc_glClientActiveTextureARB = (void (CODEGEN_FUNCPTR *)(GLenum))IntGetProcAddress("glClientActiveTextureARB");
+ if(!sf_ptrc_glClientActiveTextureARB) numFailed++;
+ return numFailed;
+}
+
+void (CODEGEN_FUNCPTR *sf_ptrc_glBlendFuncSeparateEXT)(GLenum, GLenum, GLenum, GLenum) = NULL;
+
+static int Load_EXT_blend_func_separate()
+{
+ int numFailed = 0;
+ sf_ptrc_glBlendFuncSeparateEXT = (void (CODEGEN_FUNCPTR *)(GLenum, GLenum, GLenum, GLenum))IntGetProcAddress("glBlendFuncSeparateEXT");
+ if(!sf_ptrc_glBlendFuncSeparateEXT) numFailed++;
+ return numFailed;
+}
+
+void (CODEGEN_FUNCPTR *sf_ptrc_glAttachObjectARB)(GLhandleARB, GLhandleARB) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glCompileShaderARB)(GLhandleARB) = NULL;
+GLhandleARB (CODEGEN_FUNCPTR *sf_ptrc_glCreateProgramObjectARB)() = NULL;
+GLhandleARB (CODEGEN_FUNCPTR *sf_ptrc_glCreateShaderObjectARB)(GLenum) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glDeleteObjectARB)(GLhandleARB) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glDetachObjectARB)(GLhandleARB, GLhandleARB) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glGetActiveUniformARB)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glGetAttachedObjectsARB)(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *) = NULL;
+GLhandleARB (CODEGEN_FUNCPTR *sf_ptrc_glGetHandleARB)(GLenum) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glGetInfoLogARB)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glGetObjectParameterfvARB)(GLhandleARB, GLenum, GLfloat *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glGetObjectParameterivARB)(GLhandleARB, GLenum, GLint *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glGetShaderSourceARB)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *) = NULL;
+GLint (CODEGEN_FUNCPTR *sf_ptrc_glGetUniformLocationARB)(GLhandleARB, const GLcharARB *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glGetUniformfvARB)(GLhandleARB, GLint, GLfloat *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glGetUniformivARB)(GLhandleARB, GLint, GLint *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glLinkProgramARB)(GLhandleARB) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glShaderSourceARB)(GLhandleARB, GLsizei, const GLcharARB **, const GLint *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniform1fARB)(GLint, GLfloat) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniform1fvARB)(GLint, GLsizei, const GLfloat *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniform1iARB)(GLint, GLint) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniform1ivARB)(GLint, GLsizei, const GLint *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniform2fARB)(GLint, GLfloat, GLfloat) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniform2fvARB)(GLint, GLsizei, const GLfloat *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniform2iARB)(GLint, GLint, GLint) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniform2ivARB)(GLint, GLsizei, const GLint *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniform3fARB)(GLint, GLfloat, GLfloat, GLfloat) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniform3fvARB)(GLint, GLsizei, const GLfloat *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniform3iARB)(GLint, GLint, GLint, GLint) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniform3ivARB)(GLint, GLsizei, const GLint *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniform4fARB)(GLint, GLfloat, GLfloat, GLfloat, GLfloat) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniform4fvARB)(GLint, GLsizei, const GLfloat *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniform4iARB)(GLint, GLint, GLint, GLint, GLint) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniform4ivARB)(GLint, GLsizei, const GLint *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniformMatrix2fvARB)(GLint, GLsizei, GLboolean, const GLfloat *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniformMatrix3fvARB)(GLint, GLsizei, GLboolean, const GLfloat *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUniformMatrix4fvARB)(GLint, GLsizei, GLboolean, const GLfloat *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glUseProgramObjectARB)(GLhandleARB) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glValidateProgramARB)(GLhandleARB) = NULL;
+
+static int Load_ARB_shader_objects()
+{
+ int numFailed = 0;
+ sf_ptrc_glAttachObjectARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB, GLhandleARB))IntGetProcAddress("glAttachObjectARB");
+ if(!sf_ptrc_glAttachObjectARB) numFailed++;
+ sf_ptrc_glCompileShaderARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB))IntGetProcAddress("glCompileShaderARB");
+ if(!sf_ptrc_glCompileShaderARB) numFailed++;
+ sf_ptrc_glCreateProgramObjectARB = (GLhandleARB (CODEGEN_FUNCPTR *)())IntGetProcAddress("glCreateProgramObjectARB");
+ if(!sf_ptrc_glCreateProgramObjectARB) numFailed++;
+ sf_ptrc_glCreateShaderObjectARB = (GLhandleARB (CODEGEN_FUNCPTR *)(GLenum))IntGetProcAddress("glCreateShaderObjectARB");
+ if(!sf_ptrc_glCreateShaderObjectARB) numFailed++;
+ sf_ptrc_glDeleteObjectARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB))IntGetProcAddress("glDeleteObjectARB");
+ if(!sf_ptrc_glDeleteObjectARB) numFailed++;
+ sf_ptrc_glDetachObjectARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB, GLhandleARB))IntGetProcAddress("glDetachObjectARB");
+ if(!sf_ptrc_glDetachObjectARB) numFailed++;
+ sf_ptrc_glGetActiveUniformARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *))IntGetProcAddress("glGetActiveUniformARB");
+ if(!sf_ptrc_glGetActiveUniformARB) numFailed++;
+ sf_ptrc_glGetAttachedObjectsARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *))IntGetProcAddress("glGetAttachedObjectsARB");
+ if(!sf_ptrc_glGetAttachedObjectsARB) numFailed++;
+ sf_ptrc_glGetHandleARB = (GLhandleARB (CODEGEN_FUNCPTR *)(GLenum))IntGetProcAddress("glGetHandleARB");
+ if(!sf_ptrc_glGetHandleARB) numFailed++;
+ sf_ptrc_glGetInfoLogARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *))IntGetProcAddress("glGetInfoLogARB");
+ if(!sf_ptrc_glGetInfoLogARB) numFailed++;
+ sf_ptrc_glGetObjectParameterfvARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB, GLenum, GLfloat *))IntGetProcAddress("glGetObjectParameterfvARB");
+ if(!sf_ptrc_glGetObjectParameterfvARB) numFailed++;
+ sf_ptrc_glGetObjectParameterivARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB, GLenum, GLint *))IntGetProcAddress("glGetObjectParameterivARB");
+ if(!sf_ptrc_glGetObjectParameterivARB) numFailed++;
+ sf_ptrc_glGetShaderSourceARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *))IntGetProcAddress("glGetShaderSourceARB");
+ if(!sf_ptrc_glGetShaderSourceARB) numFailed++;
+ sf_ptrc_glGetUniformLocationARB = (GLint (CODEGEN_FUNCPTR *)(GLhandleARB, const GLcharARB *))IntGetProcAddress("glGetUniformLocationARB");
+ if(!sf_ptrc_glGetUniformLocationARB) numFailed++;
+ sf_ptrc_glGetUniformfvARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB, GLint, GLfloat *))IntGetProcAddress("glGetUniformfvARB");
+ if(!sf_ptrc_glGetUniformfvARB) numFailed++;
+ sf_ptrc_glGetUniformivARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB, GLint, GLint *))IntGetProcAddress("glGetUniformivARB");
+ if(!sf_ptrc_glGetUniformivARB) numFailed++;
+ sf_ptrc_glLinkProgramARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB))IntGetProcAddress("glLinkProgramARB");
+ if(!sf_ptrc_glLinkProgramARB) numFailed++;
+ sf_ptrc_glShaderSourceARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB, GLsizei, const GLcharARB **, const GLint *))IntGetProcAddress("glShaderSourceARB");
+ if(!sf_ptrc_glShaderSourceARB) numFailed++;
+ sf_ptrc_glUniform1fARB = (void (CODEGEN_FUNCPTR *)(GLint, GLfloat))IntGetProcAddress("glUniform1fARB");
+ if(!sf_ptrc_glUniform1fARB) numFailed++;
+ sf_ptrc_glUniform1fvARB = (void (CODEGEN_FUNCPTR *)(GLint, GLsizei, const GLfloat *))IntGetProcAddress("glUniform1fvARB");
+ if(!sf_ptrc_glUniform1fvARB) numFailed++;
+ sf_ptrc_glUniform1iARB = (void (CODEGEN_FUNCPTR *)(GLint, GLint))IntGetProcAddress("glUniform1iARB");
+ if(!sf_ptrc_glUniform1iARB) numFailed++;
+ sf_ptrc_glUniform1ivARB = (void (CODEGEN_FUNCPTR *)(GLint, GLsizei, const GLint *))IntGetProcAddress("glUniform1ivARB");
+ if(!sf_ptrc_glUniform1ivARB) numFailed++;
+ sf_ptrc_glUniform2fARB = (void (CODEGEN_FUNCPTR *)(GLint, GLfloat, GLfloat))IntGetProcAddress("glUniform2fARB");
+ if(!sf_ptrc_glUniform2fARB) numFailed++;
+ sf_ptrc_glUniform2fvARB = (void (CODEGEN_FUNCPTR *)(GLint, GLsizei, const GLfloat *))IntGetProcAddress("glUniform2fvARB");
+ if(!sf_ptrc_glUniform2fvARB) numFailed++;
+ sf_ptrc_glUniform2iARB = (void (CODEGEN_FUNCPTR *)(GLint, GLint, GLint))IntGetProcAddress("glUniform2iARB");
+ if(!sf_ptrc_glUniform2iARB) numFailed++;
+ sf_ptrc_glUniform2ivARB = (void (CODEGEN_FUNCPTR *)(GLint, GLsizei, const GLint *))IntGetProcAddress("glUniform2ivARB");
+ if(!sf_ptrc_glUniform2ivARB) numFailed++;
+ sf_ptrc_glUniform3fARB = (void (CODEGEN_FUNCPTR *)(GLint, GLfloat, GLfloat, GLfloat))IntGetProcAddress("glUniform3fARB");
+ if(!sf_ptrc_glUniform3fARB) numFailed++;
+ sf_ptrc_glUniform3fvARB = (void (CODEGEN_FUNCPTR *)(GLint, GLsizei, const GLfloat *))IntGetProcAddress("glUniform3fvARB");
+ if(!sf_ptrc_glUniform3fvARB) numFailed++;
+ sf_ptrc_glUniform3iARB = (void (CODEGEN_FUNCPTR *)(GLint, GLint, GLint, GLint))IntGetProcAddress("glUniform3iARB");
+ if(!sf_ptrc_glUniform3iARB) numFailed++;
+ sf_ptrc_glUniform3ivARB = (void (CODEGEN_FUNCPTR *)(GLint, GLsizei, const GLint *))IntGetProcAddress("glUniform3ivARB");
+ if(!sf_ptrc_glUniform3ivARB) numFailed++;
+ sf_ptrc_glUniform4fARB = (void (CODEGEN_FUNCPTR *)(GLint, GLfloat, GLfloat, GLfloat, GLfloat))IntGetProcAddress("glUniform4fARB");
+ if(!sf_ptrc_glUniform4fARB) numFailed++;
+ sf_ptrc_glUniform4fvARB = (void (CODEGEN_FUNCPTR *)(GLint, GLsizei, const GLfloat *))IntGetProcAddress("glUniform4fvARB");
+ if(!sf_ptrc_glUniform4fvARB) numFailed++;
+ sf_ptrc_glUniform4iARB = (void (CODEGEN_FUNCPTR *)(GLint, GLint, GLint, GLint, GLint))IntGetProcAddress("glUniform4iARB");
+ if(!sf_ptrc_glUniform4iARB) numFailed++;
+ sf_ptrc_glUniform4ivARB = (void (CODEGEN_FUNCPTR *)(GLint, GLsizei, const GLint *))IntGetProcAddress("glUniform4ivARB");
+ if(!sf_ptrc_glUniform4ivARB) numFailed++;
+ sf_ptrc_glUniformMatrix2fvARB = (void (CODEGEN_FUNCPTR *)(GLint, GLsizei, GLboolean, const GLfloat *))IntGetProcAddress("glUniformMatrix2fvARB");
+ if(!sf_ptrc_glUniformMatrix2fvARB) numFailed++;
+ sf_ptrc_glUniformMatrix3fvARB = (void (CODEGEN_FUNCPTR *)(GLint, GLsizei, GLboolean, const GLfloat *))IntGetProcAddress("glUniformMatrix3fvARB");
+ if(!sf_ptrc_glUniformMatrix3fvARB) numFailed++;
+ sf_ptrc_glUniformMatrix4fvARB = (void (CODEGEN_FUNCPTR *)(GLint, GLsizei, GLboolean, const GLfloat *))IntGetProcAddress("glUniformMatrix4fvARB");
+ if(!sf_ptrc_glUniformMatrix4fvARB) numFailed++;
+ sf_ptrc_glUseProgramObjectARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB))IntGetProcAddress("glUseProgramObjectARB");
+ if(!sf_ptrc_glUseProgramObjectARB) numFailed++;
+ sf_ptrc_glValidateProgramARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB))IntGetProcAddress("glValidateProgramARB");
+ if(!sf_ptrc_glValidateProgramARB) numFailed++;
+ return numFailed;
+}
+
+void (CODEGEN_FUNCPTR *sf_ptrc_glBindAttribLocationARB)(GLhandleARB, GLuint, const GLcharARB *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glGetActiveAttribARB)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *) = NULL;
+GLint (CODEGEN_FUNCPTR *sf_ptrc_glGetAttribLocationARB)(GLhandleARB, const GLcharARB *) = NULL;
+
+static int Load_ARB_vertex_shader()
+{
+ int numFailed = 0;
+ sf_ptrc_glBindAttribLocationARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB, GLuint, const GLcharARB *))IntGetProcAddress("glBindAttribLocationARB");
+ if(!sf_ptrc_glBindAttribLocationARB) numFailed++;
+ sf_ptrc_glGetActiveAttribARB = (void (CODEGEN_FUNCPTR *)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *))IntGetProcAddress("glGetActiveAttribARB");
+ if(!sf_ptrc_glGetActiveAttribARB) numFailed++;
+ sf_ptrc_glGetAttribLocationARB = (GLint (CODEGEN_FUNCPTR *)(GLhandleARB, const GLcharARB *))IntGetProcAddress("glGetAttribLocationARB");
+ if(!sf_ptrc_glGetAttribLocationARB) numFailed++;
+ return numFailed;
+}
+
+void (CODEGEN_FUNCPTR *sf_ptrc_glBlendEquationSeparateEXT)(GLenum, GLenum) = NULL;
+
+static int Load_EXT_blend_equation_separate()
+{
+ int numFailed = 0;
+ sf_ptrc_glBlendEquationSeparateEXT = (void (CODEGEN_FUNCPTR *)(GLenum, GLenum))IntGetProcAddress("glBlendEquationSeparateEXT");
+ if(!sf_ptrc_glBlendEquationSeparateEXT) numFailed++;
+ return numFailed;
+}
+
+void (CODEGEN_FUNCPTR *sf_ptrc_glBindFramebufferEXT)(GLenum, GLuint) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glBindRenderbufferEXT)(GLenum, GLuint) = NULL;
+GLenum (CODEGEN_FUNCPTR *sf_ptrc_glCheckFramebufferStatusEXT)(GLenum) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glDeleteFramebuffersEXT)(GLsizei, const GLuint *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glDeleteRenderbuffersEXT)(GLsizei, const GLuint *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glFramebufferRenderbufferEXT)(GLenum, GLenum, GLenum, GLuint) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glFramebufferTexture1DEXT)(GLenum, GLenum, GLenum, GLuint, GLint) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glFramebufferTexture2DEXT)(GLenum, GLenum, GLenum, GLuint, GLint) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glFramebufferTexture3DEXT)(GLenum, GLenum, GLenum, GLuint, GLint, GLint) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glGenFramebuffersEXT)(GLsizei, GLuint *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glGenRenderbuffersEXT)(GLsizei, GLuint *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glGenerateMipmapEXT)(GLenum) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glGetFramebufferAttachmentParameterivEXT)(GLenum, GLenum, GLenum, GLint *) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glGetRenderbufferParameterivEXT)(GLenum, GLenum, GLint *) = NULL;
+GLboolean (CODEGEN_FUNCPTR *sf_ptrc_glIsFramebufferEXT)(GLuint) = NULL;
+GLboolean (CODEGEN_FUNCPTR *sf_ptrc_glIsRenderbufferEXT)(GLuint) = NULL;
+void (CODEGEN_FUNCPTR *sf_ptrc_glRenderbufferStorageEXT)(GLenum, GLenum, GLsizei, GLsizei) = NULL;
+
+static int Load_EXT_framebuffer_object()
+{
+ int numFailed = 0;
+ sf_ptrc_glBindFramebufferEXT = (void (CODEGEN_FUNCPTR *)(GLenum, GLuint))IntGetProcAddress("glBindFramebufferEXT");
+ if(!sf_ptrc_glBindFramebufferEXT) numFailed++;
+ sf_ptrc_glBindRenderbufferEXT = (void (CODEGEN_FUNCPTR *)(GLenum, GLuint))IntGetProcAddress("glBindRenderbufferEXT");
+ if(!sf_ptrc_glBindRenderbufferEXT) numFailed++;
+ sf_ptrc_glCheckFramebufferStatusEXT = (GLenum (CODEGEN_FUNCPTR *)(GLenum))IntGetProcAddress("glCheckFramebufferStatusEXT");
+ if(!sf_ptrc_glCheckFramebufferStatusEXT) numFailed++;
+ sf_ptrc_glDeleteFramebuffersEXT = (void (CODEGEN_FUNCPTR *)(GLsizei, const GLuint *))IntGetProcAddress("glDeleteFramebuffersEXT");
+ if(!sf_ptrc_glDeleteFramebuffersEXT) numFailed++;
+ sf_ptrc_glDeleteRenderbuffersEXT = (void (CODEGEN_FUNCPTR *)(GLsizei, const GLuint *))IntGetProcAddress("glDeleteRenderbuffersEXT");
+ if(!sf_ptrc_glDeleteRenderbuffersEXT) numFailed++;
+ sf_ptrc_glFramebufferRenderbufferEXT = (void (CODEGEN_FUNCPTR *)(GLenum, GLenum, GLenum, GLuint))IntGetProcAddress("glFramebufferRenderbufferEXT");
+ if(!sf_ptrc_glFramebufferRenderbufferEXT) numFailed++;
+ sf_ptrc_glFramebufferTexture1DEXT = (void (CODEGEN_FUNCPTR *)(GLenum, GLenum, GLenum, GLuint, GLint))IntGetProcAddress("glFramebufferTexture1DEXT");
+ if(!sf_ptrc_glFramebufferTexture1DEXT) numFailed++;
+ sf_ptrc_glFramebufferTexture2DEXT = (void (CODEGEN_FUNCPTR *)(GLenum, GLenum, GLenum, GLuint, GLint))IntGetProcAddress("glFramebufferTexture2DEXT");
+ if(!sf_ptrc_glFramebufferTexture2DEXT) numFailed++;
+ sf_ptrc_glFramebufferTexture3DEXT = (void (CODEGEN_FUNCPTR *)(GLenum, GLenum, GLenum, GLuint, GLint, GLint))IntGetProcAddress("glFramebufferTexture3DEXT");
+ if(!sf_ptrc_glFramebufferTexture3DEXT) numFailed++;
+ sf_ptrc_glGenFramebuffersEXT = (void (CODEGEN_FUNCPTR *)(GLsizei, GLuint *))IntGetProcAddress("glGenFramebuffersEXT");
+ if(!sf_ptrc_glGenFramebuffersEXT) numFailed++;
+ sf_ptrc_glGenRenderbuffersEXT = (void (CODEGEN_FUNCPTR *)(GLsizei, GLuint *))IntGetProcAddress("glGenRenderbuffersEXT");
+ if(!sf_ptrc_glGenRenderbuffersEXT) numFailed++;
+ sf_ptrc_glGenerateMipmapEXT = (void (CODEGEN_FUNCPTR *)(GLenum))IntGetProcAddress("glGenerateMipmapEXT");
+ if(!sf_ptrc_glGenerateMipmapEXT) numFailed++;
+ sf_ptrc_glGetFramebufferAttachmentParameterivEXT = (void (CODEGEN_FUNCPTR *)(GLenum, GLenum, GLenum, GLint *))IntGetProcAddress("glGetFramebufferAttachmentParameterivEXT");
+ if(!sf_ptrc_glGetFramebufferAttachmentParameterivEXT) numFailed++;
+ sf_ptrc_glGetRenderbufferParameterivEXT = (void (CODEGEN_FUNCPTR *)(GLenum, GLenum, GLint *))IntGetProcAddress("glGetRenderbufferParameterivEXT");
+ if(!sf_ptrc_glGetRenderbufferParameterivEXT) numFailed++;
+ sf_ptrc_glIsFramebufferEXT = (GLboolean (CODEGEN_FUNCPTR *)(GLuint))IntGetProcAddress("glIsFramebufferEXT");
+ if(!sf_ptrc_glIsFramebufferEXT) numFailed++;
+ sf_ptrc_glIsRenderbufferEXT = (GLboolean (CODEGEN_FUNCPTR *)(GLuint))IntGetProcAddress("glIsRenderbufferEXT");
+ if(!sf_ptrc_glIsRenderbufferEXT) numFailed++;
+ sf_ptrc_glRenderbufferStorageEXT = (void (CODEGEN_FUNCPTR *)(GLenum, GLenum, GLsizei, GLsizei))IntGetProcAddress("glRenderbufferStorageEXT");
+ if(!sf_ptrc_glRenderbufferStorageEXT) numFailed++;
+ return numFailed;
+}
+
+static int Load_Version_1_1()
+{
+ int numFailed = 0;
+ return numFailed;
+}
+
+typedef int (*PFN_LOADFUNCPOINTERS)();
+typedef struct sfogl_StrToExtMap_s
+{
+ const char *extensionName;
+ int *extensionVariable;
+ PFN_LOADFUNCPOINTERS LoadExtension;
+} sfogl_StrToExtMap;
+
+static sfogl_StrToExtMap ExtensionMap[12] = {
+ {"GL_SGIS_texture_edge_clamp", &sfogl_ext_SGIS_texture_edge_clamp, NULL},
+ {"GL_EXT_blend_minmax", &sfogl_ext_EXT_blend_minmax, Load_EXT_blend_minmax},
+ {"GL_EXT_blend_subtract", &sfogl_ext_EXT_blend_subtract, NULL},
+ {"GL_ARB_multitexture", &sfogl_ext_ARB_multitexture, Load_ARB_multitexture},
+ {"GL_EXT_blend_func_separate", &sfogl_ext_EXT_blend_func_separate, Load_EXT_blend_func_separate},
+ {"GL_ARB_shading_language_100", &sfogl_ext_ARB_shading_language_100, NULL},
+ {"GL_ARB_shader_objects", &sfogl_ext_ARB_shader_objects, Load_ARB_shader_objects},
+ {"GL_ARB_vertex_shader", &sfogl_ext_ARB_vertex_shader, Load_ARB_vertex_shader},
+ {"GL_ARB_fragment_shader", &sfogl_ext_ARB_fragment_shader, NULL},
+ {"GL_ARB_texture_non_power_of_two", &sfogl_ext_ARB_texture_non_power_of_two, NULL},
+ {"GL_EXT_blend_equation_separate", &sfogl_ext_EXT_blend_equation_separate, Load_EXT_blend_equation_separate},
+ {"GL_EXT_framebuffer_object", &sfogl_ext_EXT_framebuffer_object, Load_EXT_framebuffer_object}
+};
+
+static int g_extensionMapSize = 12;
+
+static sfogl_StrToExtMap *FindExtEntry(const char *extensionName)
+{
+ int loop;
+ sfogl_StrToExtMap *currLoc = ExtensionMap;
+ for(loop = 0; loop < g_extensionMapSize; ++loop, ++currLoc)
+ {
+ if(strcmp(extensionName, currLoc->extensionName) == 0)
+ return currLoc;
+ }
+
+ return NULL;
+}
+
+static void ClearExtensionVars()
+{
+ sfogl_ext_SGIS_texture_edge_clamp = sfogl_LOAD_FAILED;
+ sfogl_ext_EXT_blend_minmax = sfogl_LOAD_FAILED;
+ sfogl_ext_EXT_blend_subtract = sfogl_LOAD_FAILED;
+ sfogl_ext_ARB_multitexture = sfogl_LOAD_FAILED;
+ sfogl_ext_EXT_blend_func_separate = sfogl_LOAD_FAILED;
+ sfogl_ext_ARB_shading_language_100 = sfogl_LOAD_FAILED;
+ sfogl_ext_ARB_shader_objects = sfogl_LOAD_FAILED;
+ sfogl_ext_ARB_vertex_shader = sfogl_LOAD_FAILED;
+ sfogl_ext_ARB_fragment_shader = sfogl_LOAD_FAILED;
+ sfogl_ext_ARB_texture_non_power_of_two = sfogl_LOAD_FAILED;
+ sfogl_ext_EXT_blend_equation_separate = sfogl_LOAD_FAILED;
+ sfogl_ext_EXT_framebuffer_object = sfogl_LOAD_FAILED;
+}
+
+
+static void LoadExtByName(const char *extensionName)
+{
+ sfogl_StrToExtMap *entry = NULL;
+ entry = FindExtEntry(extensionName);
+ if(entry)
+ {
+ if(entry->LoadExtension)
+ {
+ int numFailed = entry->LoadExtension();
+ if(numFailed == 0)
+ {
+ *(entry->extensionVariable) = sfogl_LOAD_SUCCEEDED;
+ }
+ else
+ {
+ *(entry->extensionVariable) = sfogl_LOAD_SUCCEEDED + numFailed;
+ }
+ }
+ else
+ {
+ *(entry->extensionVariable) = sfogl_LOAD_SUCCEEDED;
+ }
+ }
+}
+
+
+static void ProcExtsFromExtString(const char *strExtList)
+{
+ if (!strExtList)
+ strExtList = "";
+
+ size_t iExtListLen = strlen(strExtList);
+ const char *strExtListEnd = strExtList + iExtListLen;
+ const char *strCurrPos = strExtList;
+ char strWorkBuff[256];
+
+ while(*strCurrPos)
+ {
+ /*Get the extension at our position.*/
+ int iStrLen = 0;
+ const char *strEndStr = strchr(strCurrPos, ' ');
+ int iStop = 0;
+ if(strEndStr == NULL)
+ {
+ strEndStr = strExtListEnd;
+ iStop = 1;
+ }
+
+ iStrLen = (int)((ptrdiff_t)strEndStr - (ptrdiff_t)strCurrPos);
+
+ if(iStrLen > 255)
+ return;
+
+ strncpy(strWorkBuff, strCurrPos, iStrLen);
+ strWorkBuff[iStrLen] = '\0';
+
+ LoadExtByName(strWorkBuff);
+
+ strCurrPos = strEndStr + 1;
+ if(iStop) break;
+ }
+}
+
+int sfogl_LoadFunctions()
+{
+ int numFailed = 0;
+ ClearExtensionVars();
+
+ const char* extensionString = NULL;
+
+ if(sfogl_GetMajorVersion() < 3)
+ {
+ // Try to load the < 3.0 way
+ glCheck(extensionString = (const char *)glGetString(GL_EXTENSIONS));
+
+ ProcExtsFromExtString(extensionString);
+ }
+ else
+ {
+ // Try to load the >= 3.0 way
+ const GLubyte* (CODEGEN_FUNCPTR *glGetStringiFunc)(GLenum, GLuint) = NULL;
+ glGetStringiFunc = (const GLubyte* (CODEGEN_FUNCPTR *)(GLenum, GLuint))IntGetProcAddress("glGetStringi");
+
+ if (glGetStringiFunc)
+ {
+ int numExtensions = 0;
+ glCheck(glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions));
+
+ if (numExtensions)
+ {
+ for (unsigned int i = 0; i < static_cast<unsigned int>(numExtensions); ++i)
+ {
+ glCheck(extensionString = (const char *)glGetStringiFunc(GL_EXTENSIONS, i));
+
+ ProcExtsFromExtString(extensionString);
+ }
+ }
+ }
+ }
+
+ numFailed = Load_Version_1_1();
+
+ if(numFailed == 0)
+ return sfogl_LOAD_SUCCEEDED;
+ else
+ return sfogl_LOAD_SUCCEEDED + numFailed;
+}
+
+static int g_major_version = 0;
+static int g_minor_version = 0;
+
+static void ParseVersionFromString(int *pOutMajor, int *pOutMinor, const char *strVersion)
+{
+ const char *strDotPos = NULL;
+ int iLength = 0;
+ char strWorkBuff[10];
+ *pOutMinor = 0;
+ *pOutMajor = 0;
+
+ strDotPos = strchr(strVersion, '.');
+ if(!strDotPos)
+ return;
+
+ iLength = (int)((ptrdiff_t)strDotPos - (ptrdiff_t)strVersion);
+ strncpy(strWorkBuff, strVersion, iLength);
+ strWorkBuff[iLength] = '\0';
+
+ *pOutMajor = atoi(strWorkBuff);
+ strDotPos = strchr(strVersion + iLength + 1, ' ');
+ if(!strDotPos)
+ {
+ /*No extra data. Take the whole rest of the string.*/
+ strcpy(strWorkBuff, strVersion + iLength + 1);
+ }
+ else
+ {
+ /*Copy only up until the space.*/
+ int iLengthMinor = (int)((ptrdiff_t)strDotPos - (ptrdiff_t)strVersion);
+ iLengthMinor = iLengthMinor - (iLength + 1);
+ strncpy(strWorkBuff, strVersion + iLength + 1, iLengthMinor);
+ strWorkBuff[iLengthMinor] = '\0';
+ }
+
+ *pOutMinor = atoi(strWorkBuff);
+}
+
+static void GetGLVersion()
+{
+ glGetIntegerv(GL_MAJOR_VERSION, &g_major_version);
+ glGetIntegerv(GL_MINOR_VERSION, &g_minor_version);
+
+ // Check if we have to retrieve the context version using the legacy method
+ if (glGetError() == GL_INVALID_ENUM)
+ {
+ const char* versionString = NULL;
+ glCheck(versionString = (const char*)glGetString(GL_VERSION));
+ ParseVersionFromString(&g_major_version, &g_minor_version, versionString);
+ }
+}
+
+int sfogl_GetMajorVersion()
+{
+ if(g_major_version == 0)
+ GetGLVersion();
+ return g_major_version;
+}
+
+int sfogl_GetMinorVersion()
+{
+ if(g_major_version == 0) //Yes, check the major version to get the minor one.
+ GetGLVersion();
+ return g_minor_version;
+}
+
+int sfogl_IsVersionGEQ(int majorVersion, int minorVersion)
+{
+ if(g_major_version == 0)
+ GetGLVersion();
+
+ if(majorVersion > g_major_version) return 0;
+ if(majorVersion < g_major_version) return 1;
+ if(g_minor_version >= minorVersion) return 1;
+ return 0;
+}
+
diff --git a/src/SFML/Graphics/GLLoader.hpp b/src/SFML/Graphics/GLLoader.hpp
new file mode 100644
index 0000000..42e1e09
--- /dev/null
+++ b/src/SFML/Graphics/GLLoader.hpp
@@ -0,0 +1,1050 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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 SF_POINTER_C_GENERATED_HEADER_OPENGL_HPP
+#define SF_POINTER_C_GENERATED_HEADER_OPENGL_HPP
+
+#if defined(__glew_h__) || defined(__GLEW_H__)
+#error Attempt to include auto-generated header after including glew.h
+#endif
+#if defined(__gl_h_) || defined(__GL_H__)
+#error Attempt to include auto-generated header after including gl.h
+#endif
+#if defined(__glext_h_) || defined(__GLEXT_H_)
+#error Attempt to include auto-generated header after including glext.h
+#endif
+#if defined(__gltypes_h_)
+#error Attempt to include auto-generated header after gltypes.h
+#endif
+#if defined(__gl_ATI_h_)
+#error Attempt to include auto-generated header after including glATI.h
+#endif
+
+#define __glew_h__
+#define __GLEW_H__
+#define __gl_h_
+#define __GL_H__
+#define __glext_h_
+#define __GLEXT_H_
+#define __gltypes_h_
+#define __gl_ATI_h_
+
+#ifndef APIENTRY
+ #if defined(__MINGW32__) || defined(__CYGWIN__)
+ #define APIENTRY __stdcall
+ #elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__)
+ #define APIENTRY __stdcall
+ #else
+ #define APIENTRY
+ #endif
+#endif /*APIENTRY*/
+
+#ifndef CODEGEN_FUNCPTR
+ #define CODEGEN_REMOVE_FUNCPTR
+ #if defined(_WIN32)
+ #define CODEGEN_FUNCPTR APIENTRY
+ #else
+ #define CODEGEN_FUNCPTR
+ #endif
+#endif /*CODEGEN_FUNCPTR*/
+
+#ifndef GLAPI
+ #if defined(_WIN32)
+ #if defined(__MINGW32__) || defined(__CYGWIN__)
+ #define GLAPI extern
+ #else
+ #define GLAPI __declspec(dllimport)
+ #endif
+ #else
+ #define GLAPI extern
+ #endif
+#endif
+
+
+#ifndef GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS
+#define GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS
+
+
+#endif /*GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS*/
+
+
+#include <stddef.h>
+#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
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef void GLvoid;
+typedef signed char GLbyte;
+typedef short GLshort;
+typedef int GLint;
+typedef unsigned char GLubyte;
+typedef unsigned short GLushort;
+typedef unsigned int GLuint;
+typedef int GLsizei;
+typedef float GLfloat;
+typedef float GLclampf;
+typedef double GLdouble;
+typedef double GLclampd;
+typedef char GLchar;
+typedef char GLcharARB;
+#ifdef __APPLE__
+typedef void *GLhandleARB;
+#else
+typedef unsigned int GLhandleARB;
+#endif
+typedef unsigned short GLhalfARB;
+typedef unsigned short GLhalf;
+typedef GLint GLfixed;
+typedef ptrdiff_t GLintptr;
+typedef ptrdiff_t GLsizeiptr;
+typedef int64_t GLint64;
+typedef uint64_t GLuint64;
+typedef ptrdiff_t GLintptrARB;
+typedef ptrdiff_t GLsizeiptrARB;
+typedef int64_t GLint64EXT;
+typedef uint64_t GLuint64EXT;
+typedef struct __GLsync *GLsync;
+struct _cl_context;
+struct _cl_event;
+typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
+typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
+typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam);
+typedef unsigned short GLhalfNV;
+typedef GLintptr GLvdpauSurfaceNV;
+
+#ifdef __cplusplus
+extern "C" {
+#endif /*__cplusplus*/
+
+extern int sfogl_ext_SGIS_texture_edge_clamp;
+extern int sfogl_ext_EXT_blend_minmax;
+extern int sfogl_ext_EXT_blend_subtract;
+extern int sfogl_ext_ARB_multitexture;
+extern int sfogl_ext_EXT_blend_func_separate;
+extern int sfogl_ext_ARB_shading_language_100;
+extern int sfogl_ext_ARB_shader_objects;
+extern int sfogl_ext_ARB_vertex_shader;
+extern int sfogl_ext_ARB_fragment_shader;
+extern int sfogl_ext_ARB_texture_non_power_of_two;
+extern int sfogl_ext_EXT_blend_equation_separate;
+extern int sfogl_ext_EXT_framebuffer_object;
+
+#define GL_CLAMP_TO_EDGE_SGIS 0x812F
+
+#define GL_BLEND_EQUATION_EXT 0x8009
+#define GL_FUNC_ADD_EXT 0x8006
+#define GL_MAX_EXT 0x8008
+#define GL_MIN_EXT 0x8007
+
+#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B
+#define GL_FUNC_SUBTRACT_EXT 0x800A
+
+#define GL_ACTIVE_TEXTURE_ARB 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
+#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
+#define GL_TEXTURE0_ARB 0x84C0
+#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_TEXTURE1_ARB 0x84C1
+#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_TEXTURE2_ARB 0x84C2
+#define GL_TEXTURE30_ARB 0x84DE
+#define GL_TEXTURE31_ARB 0x84DF
+#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_BLEND_DST_ALPHA_EXT 0x80CA
+#define GL_BLEND_DST_RGB_EXT 0x80C8
+#define GL_BLEND_SRC_ALPHA_EXT 0x80CB
+#define GL_BLEND_SRC_RGB_EXT 0x80C9
+
+#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C
+
+#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_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_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86
+#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
+#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85
+#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81
+#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80
+#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84
+#define GL_OBJECT_LINK_STATUS_ARB 0x8B82
+#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
+#define GL_OBJECT_SUBTYPE_ARB 0x8B4F
+#define GL_OBJECT_TYPE_ARB 0x8B4E
+#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83
+#define GL_PROGRAM_OBJECT_ARB 0x8B40
+#define GL_SAMPLER_1D_ARB 0x8B5D
+#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61
+#define GL_SAMPLER_2D_ARB 0x8B5E
+#define GL_SAMPLER_2D_RECT_ARB 0x8B63
+#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
+#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62
+#define GL_SAMPLER_3D_ARB 0x8B5F
+#define GL_SAMPLER_CUBE_ARB 0x8B60
+#define GL_SHADER_OBJECT_ARB 0x8B48
+
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
+#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
+#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89
+#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
+#define GL_VERTEX_SHADER_ARB 0x8B31
+
+#define GL_FRAGMENT_SHADER_ARB 0x8B30
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
+
+#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D
+#define GL_BLEND_EQUATION_RGB_EXT 0x8009
+
+#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
+#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
+#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
+#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
+#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
+#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
+#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
+#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
+#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
+#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
+#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
+#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
+#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
+#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
+#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
+#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
+#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
+#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
+#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
+#define GL_FRAMEBUFFER_EXT 0x8D40
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
+#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
+#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
+#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
+#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
+#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
+#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
+#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
+#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
+#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
+#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
+#define GL_RENDERBUFFER_EXT 0x8D41
+#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
+#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
+#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
+#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
+#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
+#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
+#define GL_STENCIL_INDEX16_EXT 0x8D49
+#define GL_STENCIL_INDEX1_EXT 0x8D46
+#define GL_STENCIL_INDEX4_EXT 0x8D47
+#define GL_STENCIL_INDEX8_EXT 0x8D48
+
+#define GL_2D 0x0600
+#define GL_2_BYTES 0x1407
+#define GL_3D 0x0601
+#define GL_3D_COLOR 0x0602
+#define GL_3D_COLOR_TEXTURE 0x0603
+#define GL_3_BYTES 0x1408
+#define GL_4D_COLOR_TEXTURE 0x0604
+#define GL_4_BYTES 0x1409
+#define GL_ACCUM 0x0100
+#define GL_ACCUM_ALPHA_BITS 0x0D5B
+#define GL_ACCUM_BLUE_BITS 0x0D5A
+#define GL_ACCUM_BUFFER_BIT 0x00000200
+#define GL_ACCUM_CLEAR_VALUE 0x0B80
+#define GL_ACCUM_GREEN_BITS 0x0D59
+#define GL_ACCUM_RED_BITS 0x0D58
+#define GL_ADD 0x0104
+#define GL_ALL_ATTRIB_BITS 0xFFFFFFFF
+#define GL_ALPHA 0x1906
+#define GL_ALPHA12 0x803D
+#define GL_ALPHA16 0x803E
+#define GL_ALPHA4 0x803B
+#define GL_ALPHA8 0x803C
+#define GL_ALPHA_BIAS 0x0D1D
+#define GL_ALPHA_BITS 0x0D55
+#define GL_ALPHA_SCALE 0x0D1C
+#define GL_ALPHA_TEST 0x0BC0
+#define GL_ALPHA_TEST_FUNC 0x0BC1
+#define GL_ALPHA_TEST_REF 0x0BC2
+#define GL_ALWAYS 0x0207
+#define GL_AMBIENT 0x1200
+#define GL_AMBIENT_AND_DIFFUSE 0x1602
+#define GL_AND 0x1501
+#define GL_AND_INVERTED 0x1504
+#define GL_AND_REVERSE 0x1502
+#define GL_ATTRIB_STACK_DEPTH 0x0BB0
+#define GL_AUTO_NORMAL 0x0D80
+#define GL_BACK 0x0405
+#define GL_BITMAP 0x1A00
+#define GL_BITMAP_TOKEN 0x0704
+#define GL_BLEND 0x0BE2
+#define GL_BLEND_DST 0x0BE0
+#define GL_BLEND_SRC 0x0BE1
+#define GL_BLUE 0x1905
+#define GL_BLUE_BIAS 0x0D1B
+#define GL_BLUE_BITS 0x0D54
+#define GL_BLUE_SCALE 0x0D1A
+#define GL_BYTE 0x1400
+#define GL_C3F_V3F 0x2A24
+#define GL_C4F_N3F_V3F 0x2A26
+#define GL_C4UB_V2F 0x2A22
+#define GL_C4UB_V3F 0x2A23
+#define GL_CCW 0x0901
+#define GL_CLAMP 0x2900
+#define GL_CLEAR 0x1500
+#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
+#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
+#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
+#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
+#define GL_CLIP_PLANE0 0x3000
+#define GL_CLIP_PLANE1 0x3001
+#define GL_CLIP_PLANE2 0x3002
+#define GL_CLIP_PLANE3 0x3003
+#define GL_CLIP_PLANE4 0x3004
+#define GL_CLIP_PLANE5 0x3005
+#define GL_COEFF 0x0A00
+#define GL_COLOR 0x1800
+#define GL_COLOR_ARRAY 0x8076
+#define GL_COLOR_ARRAY_POINTER 0x8090
+#define GL_COLOR_ARRAY_SIZE 0x8081
+#define GL_COLOR_ARRAY_STRIDE 0x8083
+#define GL_COLOR_ARRAY_TYPE 0x8082
+#define GL_COLOR_BUFFER_BIT 0x00004000
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_INDEX 0x1900
+#define GL_COLOR_INDEXES 0x1603
+#define GL_COLOR_LOGIC_OP 0x0BF2
+#define GL_COLOR_MATERIAL 0x0B57
+#define GL_COLOR_MATERIAL_FACE 0x0B55
+#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_COMPILE 0x1300
+#define GL_COMPILE_AND_EXECUTE 0x1301
+#define GL_CONSTANT_ATTENUATION 0x1207
+#define GL_COPY 0x1503
+#define GL_COPY_INVERTED 0x150C
+#define GL_COPY_PIXEL_TOKEN 0x0706
+#define GL_CULL_FACE 0x0B44
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_CURRENT_BIT 0x00000001
+#define GL_CURRENT_COLOR 0x0B00
+#define GL_CURRENT_INDEX 0x0B01
+#define GL_CURRENT_NORMAL 0x0B02
+#define GL_CURRENT_RASTER_COLOR 0x0B04
+#define GL_CURRENT_RASTER_DISTANCE 0x0B09
+#define GL_CURRENT_RASTER_INDEX 0x0B05
+#define GL_CURRENT_RASTER_POSITION 0x0B07
+#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
+#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
+#define GL_CURRENT_TEXTURE_COORDS 0x0B03
+#define GL_CW 0x0900
+#define GL_DECAL 0x2101
+#define GL_DECR 0x1E03
+#define GL_DEPTH 0x1801
+#define GL_DEPTH_BIAS 0x0D1F
+#define GL_DEPTH_BITS 0x0D56
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_COMPONENT 0x1902
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_SCALE 0x0D1E
+#define GL_DEPTH_TEST 0x0B71
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DITHER 0x0BD0
+#define GL_DOMAIN 0x0A02
+#define GL_DONT_CARE 0x1100
+#define GL_DOUBLE 0x140A
+#define GL_DOUBLEBUFFER 0x0C32
+#define GL_DRAW_BUFFER 0x0C01
+#define GL_DRAW_PIXEL_TOKEN 0x0705
+#define GL_DST_ALPHA 0x0304
+#define GL_DST_COLOR 0x0306
+#define GL_EDGE_FLAG 0x0B43
+#define GL_EDGE_FLAG_ARRAY 0x8079
+#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
+#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
+#define GL_EMISSION 0x1600
+#define GL_ENABLE_BIT 0x00002000
+#define GL_EQUAL 0x0202
+#define GL_EQUIV 0x1509
+#define GL_EVAL_BIT 0x00010000
+#define GL_EXP 0x0800
+#define GL_EXP2 0x0801
+#define GL_EXTENSIONS 0x1F03
+#define GL_EYE_LINEAR 0x2400
+#define GL_EYE_PLANE 0x2502
+#define GL_FALSE 0
+#define GL_FASTEST 0x1101
+#define GL_FEEDBACK 0x1C01
+#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
+#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
+#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
+#define GL_FILL 0x1B02
+#define GL_FLAT 0x1D00
+#define GL_FLOAT 0x1406
+#define GL_FRONT 0x0404
+#define GL_FRONT_AND_BACK 0x0408
+#define GL_FRONT_FACE 0x0B46
+#define GL_GEQUAL 0x0206
+#define GL_GREATER 0x0204
+#define GL_GREEN 0x1904
+#define GL_GREEN_BIAS 0x0D19
+#define GL_GREEN_BITS 0x0D53
+#define GL_GREEN_SCALE 0x0D18
+#define GL_HINT_BIT 0x00008000
+#define GL_INCR 0x1E02
+#define GL_INDEX_ARRAY 0x8077
+#define GL_INDEX_ARRAY_POINTER 0x8091
+#define GL_INDEX_ARRAY_STRIDE 0x8086
+#define GL_INDEX_ARRAY_TYPE 0x8085
+#define GL_INDEX_BITS 0x0D51
+#define GL_INDEX_CLEAR_VALUE 0x0C20
+#define GL_INDEX_LOGIC_OP 0x0BF1
+#define GL_INDEX_MODE 0x0C30
+#define GL_INDEX_OFFSET 0x0D13
+#define GL_INDEX_SHIFT 0x0D12
+#define GL_INDEX_WRITEMASK 0x0C21
+#define GL_INT 0x1404
+#define GL_INTENSITY 0x8049
+#define GL_INTENSITY12 0x804C
+#define GL_INTENSITY16 0x804D
+#define GL_INTENSITY4 0x804A
+#define GL_INTENSITY8 0x804B
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_OPERATION 0x0502
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVERT 0x150A
+#define GL_KEEP 0x1E00
+#define GL_LEQUAL 0x0203
+#define GL_LESS 0x0201
+#define GL_LIGHTING 0x0B50
+#define GL_LINE 0x1B01
+#define GL_LINEAR 0x2601
+#define GL_LINEAR_ATTENUATION 0x1208
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+#define GL_LINEAR_MIPMAP_NEAREST 0x2701
+#define GL_LINES 0x0001
+#define GL_LINE_BIT 0x00000004
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_RESET_TOKEN 0x0707
+#define GL_LINE_SMOOTH 0x0B20
+#define GL_LINE_SMOOTH_HINT 0x0C52
+#define GL_LINE_STIPPLE 0x0B24
+#define GL_LINE_STIPPLE_PATTERN 0x0B25
+#define GL_LINE_STIPPLE_REPEAT 0x0B26
+#define GL_LINE_STRIP 0x0003
+#define GL_LINE_TOKEN 0x0702
+#define GL_LINE_WIDTH 0x0B21
+#define GL_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_LINE_WIDTH_RANGE 0x0B22
+#define GL_LOAD 0x0101
+#define GL_LOGIC_OP 0x0BF1
+#define GL_LOGIC_OP_MODE 0x0BF0
+#define GL_LUMINANCE 0x1909
+#define GL_LUMINANCE12 0x8041
+#define GL_LUMINANCE12_ALPHA12 0x8047
+#define GL_LUMINANCE12_ALPHA4 0x8046
+#define GL_LUMINANCE16 0x8042
+#define GL_LUMINANCE16_ALPHA16 0x8048
+#define GL_LUMINANCE4 0x803F
+#define GL_LUMINANCE4_ALPHA4 0x8043
+#define GL_LUMINANCE6_ALPHA2 0x8044
+#define GL_LUMINANCE8 0x8040
+#define GL_LUMINANCE8_ALPHA8 0x8045
+#define GL_LUMINANCE_ALPHA 0x190A
+#define GL_MAP_COLOR 0x0D10
+#define GL_MAP_STENCIL 0x0D11
+#define GL_MATRIX_MODE 0x0BA0
+#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
+#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
+#define GL_MAX_CLIP_PLANES 0x0D32
+#define GL_MAX_EVAL_ORDER 0x0D30
+#define GL_MAX_LIGHTS 0x0D31
+#define GL_MAX_LIST_NESTING 0x0B31
+#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
+#define GL_MAX_NAME_STACK_DEPTH 0x0D37
+#define GL_MAX_PIXEL_MAP_TABLE 0x0D34
+#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_MODELVIEW 0x1700
+#define GL_MODELVIEW_MATRIX 0x0BA6
+#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
+#define GL_MODULATE 0x2100
+#define GL_MULT 0x0103
+#define GL_N3F_V3F 0x2A25
+#define GL_NAND 0x150E
+#define GL_NEAREST 0x2600
+#define GL_NEAREST_MIPMAP_LINEAR 0x2702
+#define GL_NEAREST_MIPMAP_NEAREST 0x2700
+#define GL_NEVER 0x0200
+#define GL_NICEST 0x1102
+#define GL_NONE 0
+#define GL_NOOP 0x1505
+#define GL_NOR 0x1508
+#define GL_NORMALIZE 0x0BA1
+#define GL_NORMAL_ARRAY 0x8075
+#define GL_NORMAL_ARRAY_POINTER 0x808F
+#define GL_NORMAL_ARRAY_STRIDE 0x807F
+#define GL_NORMAL_ARRAY_TYPE 0x807E
+#define GL_NOTEQUAL 0x0205
+#define GL_NO_ERROR 0
+#define GL_OBJECT_LINEAR 0x2401
+#define GL_OBJECT_PLANE 0x2501
+#define GL_ONE 1
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_OR 0x1507
+#define GL_ORDER 0x0A01
+#define GL_OR_INVERTED 0x150D
+#define GL_OR_REVERSE 0x150B
+#define GL_OUT_OF_MEMORY 0x0505
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_PACK_LSB_FIRST 0x0D01
+#define GL_PACK_ROW_LENGTH 0x0D02
+#define GL_PACK_SKIP_PIXELS 0x0D04
+#define GL_PACK_SKIP_ROWS 0x0D03
+#define GL_PACK_SWAP_BYTES 0x0D00
+#define GL_PASS_THROUGH_TOKEN 0x0700
+#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
+#define GL_PIXEL_MODE_BIT 0x00000020
+#define GL_POINT 0x1B00
+#define GL_POINTS 0x0000
+#define GL_POINT_BIT 0x00000002
+#define GL_POINT_SIZE 0x0B11
+#define GL_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_POINT_SIZE_RANGE 0x0B12
+#define GL_POINT_SMOOTH 0x0B10
+#define GL_POINT_SMOOTH_HINT 0x0C51
+#define GL_POINT_TOKEN 0x0701
+#define GL_POLYGON 0x0009
+#define GL_POLYGON_BIT 0x00000008
+#define GL_POLYGON_MODE 0x0B40
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_POLYGON_OFFSET_LINE 0x2A02
+#define GL_POLYGON_OFFSET_POINT 0x2A01
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_SMOOTH 0x0B41
+#define GL_POLYGON_SMOOTH_HINT 0x0C53
+#define GL_POLYGON_STIPPLE 0x0B42
+#define GL_POLYGON_STIPPLE_BIT 0x00000010
+#define GL_POLYGON_TOKEN 0x0703
+#define GL_POSITION 0x1203
+#define GL_PROJECTION 0x1701
+#define GL_PROJECTION_MATRIX 0x0BA7
+#define GL_PROJECTION_STACK_DEPTH 0x0BA4
+#define GL_PROXY_TEXTURE_1D 0x8063
+#define GL_PROXY_TEXTURE_2D 0x8064
+#define GL_Q 0x2003
+#define GL_QUADRATIC_ATTENUATION 0x1209
+#define GL_QUADS 0x0007
+#define GL_QUAD_STRIP 0x0008
+#define GL_R 0x2002
+#define GL_R3_G3_B2 0x2A10
+#define GL_READ_BUFFER 0x0C02
+#define GL_RED 0x1903
+#define GL_RED_BIAS 0x0D15
+#define GL_RED_BITS 0x0D52
+#define GL_RED_SCALE 0x0D14
+#define GL_RENDER 0x1C00
+#define GL_RENDERER 0x1F01
+#define GL_RENDER_MODE 0x0C40
+#define GL_REPEAT 0x2901
+#define GL_REPLACE 0x1E01
+#define GL_RETURN 0x0102
+#define GL_RGB 0x1907
+#define GL_RGB10 0x8052
+#define GL_RGB10_A2 0x8059
+#define GL_RGB12 0x8053
+#define GL_RGB16 0x8054
+#define GL_RGB4 0x804F
+#define GL_RGB5 0x8050
+#define GL_RGB5_A1 0x8057
+#define GL_RGB8 0x8051
+#define GL_RGBA 0x1908
+#define GL_RGBA12 0x805A
+#define GL_RGBA16 0x805B
+#define GL_RGBA2 0x8055
+#define GL_RGBA4 0x8056
+#define GL_RGBA8 0x8058
+#define GL_RGBA_MODE 0x0C31
+#define GL_S 0x2000
+#define GL_SCISSOR_BIT 0x00080000
+#define GL_SCISSOR_BOX 0x0C10
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_SET 0x150F
+#define GL_SHADE_MODEL 0x0B54
+#define GL_SHININESS 0x1601
+#define GL_SHORT 0x1402
+#define GL_SMOOTH 0x1D01
+#define GL_SPECULAR 0x1202
+#define GL_SPHERE_MAP 0x2402
+#define GL_SRC_ALPHA 0x0302
+#define GL_SRC_ALPHA_SATURATE 0x0308
+#define GL_SRC_COLOR 0x0300
+#define GL_STACK_OVERFLOW 0x0503
+#define GL_STACK_UNDERFLOW 0x0504
+#define GL_STENCIL 0x1802
+#define GL_STENCIL_BITS 0x0D57
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_INDEX 0x1901
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_TEST 0x0B90
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_STEREO 0x0C33
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_T 0x2001
+#define GL_T2F_C3F_V3F 0x2A2A
+#define GL_T2F_C4F_N3F_V3F 0x2A2C
+#define GL_T2F_C4UB_V3F 0x2A29
+#define GL_T2F_N3F_V3F 0x2A2B
+#define GL_T2F_V3F 0x2A27
+#define GL_T4F_C4F_N3F_V4F 0x2A2D
+#define GL_T4F_V4F 0x2A28
+#define GL_TEXTURE 0x1702
+#define GL_TEXTURE_1D 0x0DE0
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_TEXTURE_ALPHA_SIZE 0x805F
+#define GL_TEXTURE_BINDING_1D 0x8068
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_TEXTURE_BIT 0x00040000
+#define GL_TEXTURE_BLUE_SIZE 0x805E
+#define GL_TEXTURE_BORDER 0x1005
+#define GL_TEXTURE_BORDER_COLOR 0x1004
+#define GL_TEXTURE_COMPONENTS 0x1003
+#define GL_TEXTURE_COORD_ARRAY 0x8078
+#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
+#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
+#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
+#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
+#define GL_TEXTURE_ENV 0x2300
+#define GL_TEXTURE_ENV_COLOR 0x2201
+#define GL_TEXTURE_ENV_MODE 0x2200
+#define GL_TEXTURE_GEN_MODE 0x2500
+#define GL_TEXTURE_GEN_Q 0x0C63
+#define GL_TEXTURE_GEN_R 0x0C62
+#define GL_TEXTURE_GEN_S 0x0C60
+#define GL_TEXTURE_GEN_T 0x0C61
+#define GL_TEXTURE_GREEN_SIZE 0x805D
+#define GL_TEXTURE_HEIGHT 0x1001
+#define GL_TEXTURE_INTENSITY_SIZE 0x8061
+#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
+#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
+#define GL_TEXTURE_MAG_FILTER 0x2800
+#define GL_TEXTURE_MATRIX 0x0BA8
+#define GL_TEXTURE_MIN_FILTER 0x2801
+#define GL_TEXTURE_PRIORITY 0x8066
+#define GL_TEXTURE_RED_SIZE 0x805C
+#define GL_TEXTURE_RESIDENT 0x8067
+#define GL_TEXTURE_STACK_DEPTH 0x0BA5
+#define GL_TEXTURE_WIDTH 0x1000
+#define GL_TEXTURE_WRAP_S 0x2802
+#define GL_TEXTURE_WRAP_T 0x2803
+#define GL_TRANSFORM_BIT 0x00001000
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLE_FAN 0x0006
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRUE 1
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_UNPACK_LSB_FIRST 0x0CF1
+#define GL_UNPACK_ROW_LENGTH 0x0CF2
+#define GL_UNPACK_SKIP_PIXELS 0x0CF4
+#define GL_UNPACK_SKIP_ROWS 0x0CF3
+#define GL_UNPACK_SWAP_BYTES 0x0CF0
+#define GL_UNSIGNED_BYTE 0x1401
+#define GL_UNSIGNED_INT 0x1405
+#define GL_UNSIGNED_SHORT 0x1403
+#define GL_V2F 0x2A20
+#define GL_V3F 0x2A21
+#define GL_VENDOR 0x1F00
+#define GL_VERSION 0x1F02
+#define GL_VERTEX_ARRAY 0x8074
+#define GL_VERTEX_ARRAY_POINTER 0x808E
+#define GL_VERTEX_ARRAY_SIZE 0x807A
+#define GL_VERTEX_ARRAY_STRIDE 0x807C
+#define GL_VERTEX_ARRAY_TYPE 0x807B
+#define GL_VIEWPORT 0x0BA2
+#define GL_VIEWPORT_BIT 0x00000800
+#define GL_XOR 0x1506
+#define GL_ZERO 0
+#define GL_ZOOM_X 0x0D16
+#define GL_ZOOM_Y 0x0D17
+
+#ifndef GL_EXT_blend_minmax
+#define GL_EXT_blend_minmax 1
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glBlendEquationEXT)(GLenum);
+#define glBlendEquationEXT sf_ptrc_glBlendEquationEXT
+#endif /*GL_EXT_blend_minmax*/
+
+
+#ifndef GL_ARB_multitexture
+#define GL_ARB_multitexture 1
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glActiveTextureARB)(GLenum);
+#define glActiveTextureARB sf_ptrc_glActiveTextureARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glClientActiveTextureARB)(GLenum);
+#define glClientActiveTextureARB sf_ptrc_glClientActiveTextureARB
+#endif /*GL_ARB_multitexture*/
+
+#ifndef GL_EXT_blend_func_separate
+#define GL_EXT_blend_func_separate 1
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glBlendFuncSeparateEXT)(GLenum, GLenum, GLenum, GLenum);
+#define glBlendFuncSeparateEXT sf_ptrc_glBlendFuncSeparateEXT
+#endif /*GL_EXT_blend_func_separate*/
+
+#ifndef GL_ARB_shader_objects
+#define GL_ARB_shader_objects 1
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glAttachObjectARB)(GLhandleARB, GLhandleARB);
+#define glAttachObjectARB sf_ptrc_glAttachObjectARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glCompileShaderARB)(GLhandleARB);
+#define glCompileShaderARB sf_ptrc_glCompileShaderARB
+extern GLhandleARB (CODEGEN_FUNCPTR *sf_ptrc_glCreateProgramObjectARB)();
+#define glCreateProgramObjectARB sf_ptrc_glCreateProgramObjectARB
+extern GLhandleARB (CODEGEN_FUNCPTR *sf_ptrc_glCreateShaderObjectARB)(GLenum);
+#define glCreateShaderObjectARB sf_ptrc_glCreateShaderObjectARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glDeleteObjectARB)(GLhandleARB);
+#define glDeleteObjectARB sf_ptrc_glDeleteObjectARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glDetachObjectARB)(GLhandleARB, GLhandleARB);
+#define glDetachObjectARB sf_ptrc_glDetachObjectARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glGetActiveUniformARB)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
+#define glGetActiveUniformARB sf_ptrc_glGetActiveUniformARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glGetAttachedObjectsARB)(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
+#define glGetAttachedObjectsARB sf_ptrc_glGetAttachedObjectsARB
+extern GLhandleARB (CODEGEN_FUNCPTR *sf_ptrc_glGetHandleARB)(GLenum);
+#define glGetHandleARB sf_ptrc_glGetHandleARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glGetInfoLogARB)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
+#define glGetInfoLogARB sf_ptrc_glGetInfoLogARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glGetObjectParameterfvARB)(GLhandleARB, GLenum, GLfloat *);
+#define glGetObjectParameterfvARB sf_ptrc_glGetObjectParameterfvARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glGetObjectParameterivARB)(GLhandleARB, GLenum, GLint *);
+#define glGetObjectParameterivARB sf_ptrc_glGetObjectParameterivARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glGetShaderSourceARB)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
+#define glGetShaderSourceARB sf_ptrc_glGetShaderSourceARB
+extern GLint (CODEGEN_FUNCPTR *sf_ptrc_glGetUniformLocationARB)(GLhandleARB, const GLcharARB *);
+#define glGetUniformLocationARB sf_ptrc_glGetUniformLocationARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glGetUniformfvARB)(GLhandleARB, GLint, GLfloat *);
+#define glGetUniformfvARB sf_ptrc_glGetUniformfvARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glGetUniformivARB)(GLhandleARB, GLint, GLint *);
+#define glGetUniformivARB sf_ptrc_glGetUniformivARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glLinkProgramARB)(GLhandleARB);
+#define glLinkProgramARB sf_ptrc_glLinkProgramARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glShaderSourceARB)(GLhandleARB, GLsizei, const GLcharARB **, const GLint *);
+#define glShaderSourceARB sf_ptrc_glShaderSourceARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniform1fARB)(GLint, GLfloat);
+#define glUniform1fARB sf_ptrc_glUniform1fARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniform1fvARB)(GLint, GLsizei, const GLfloat *);
+#define glUniform1fvARB sf_ptrc_glUniform1fvARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniform1iARB)(GLint, GLint);
+#define glUniform1iARB sf_ptrc_glUniform1iARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniform1ivARB)(GLint, GLsizei, const GLint *);
+#define glUniform1ivARB sf_ptrc_glUniform1ivARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniform2fARB)(GLint, GLfloat, GLfloat);
+#define glUniform2fARB sf_ptrc_glUniform2fARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniform2fvARB)(GLint, GLsizei, const GLfloat *);
+#define glUniform2fvARB sf_ptrc_glUniform2fvARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniform2iARB)(GLint, GLint, GLint);
+#define glUniform2iARB sf_ptrc_glUniform2iARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniform2ivARB)(GLint, GLsizei, const GLint *);
+#define glUniform2ivARB sf_ptrc_glUniform2ivARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniform3fARB)(GLint, GLfloat, GLfloat, GLfloat);
+#define glUniform3fARB sf_ptrc_glUniform3fARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniform3fvARB)(GLint, GLsizei, const GLfloat *);
+#define glUniform3fvARB sf_ptrc_glUniform3fvARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniform3iARB)(GLint, GLint, GLint, GLint);
+#define glUniform3iARB sf_ptrc_glUniform3iARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniform3ivARB)(GLint, GLsizei, const GLint *);
+#define glUniform3ivARB sf_ptrc_glUniform3ivARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniform4fARB)(GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+#define glUniform4fARB sf_ptrc_glUniform4fARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniform4fvARB)(GLint, GLsizei, const GLfloat *);
+#define glUniform4fvARB sf_ptrc_glUniform4fvARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniform4iARB)(GLint, GLint, GLint, GLint, GLint);
+#define glUniform4iARB sf_ptrc_glUniform4iARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniform4ivARB)(GLint, GLsizei, const GLint *);
+#define glUniform4ivARB sf_ptrc_glUniform4ivARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniformMatrix2fvARB)(GLint, GLsizei, GLboolean, const GLfloat *);
+#define glUniformMatrix2fvARB sf_ptrc_glUniformMatrix2fvARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniformMatrix3fvARB)(GLint, GLsizei, GLboolean, const GLfloat *);
+#define glUniformMatrix3fvARB sf_ptrc_glUniformMatrix3fvARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUniformMatrix4fvARB)(GLint, GLsizei, GLboolean, const GLfloat *);
+#define glUniformMatrix4fvARB sf_ptrc_glUniformMatrix4fvARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glUseProgramObjectARB)(GLhandleARB);
+#define glUseProgramObjectARB sf_ptrc_glUseProgramObjectARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glValidateProgramARB)(GLhandleARB);
+#define glValidateProgramARB sf_ptrc_glValidateProgramARB
+#endif /*GL_ARB_shader_objects*/
+
+#ifndef GL_ARB_vertex_shader
+#define GL_ARB_vertex_shader 1
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glBindAttribLocationARB)(GLhandleARB, GLuint, const GLcharARB *);
+#define glBindAttribLocationARB sf_ptrc_glBindAttribLocationARB
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glGetActiveAttribARB)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
+#define glGetActiveAttribARB sf_ptrc_glGetActiveAttribARB
+extern GLint (CODEGEN_FUNCPTR *sf_ptrc_glGetAttribLocationARB)(GLhandleARB, const GLcharARB *);
+#define glGetAttribLocationARB sf_ptrc_glGetAttribLocationARB
+#endif /*GL_ARB_vertex_shader*/
+
+
+
+#ifndef GL_EXT_blend_equation_separate
+#define GL_EXT_blend_equation_separate 1
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glBlendEquationSeparateEXT)(GLenum, GLenum);
+#define glBlendEquationSeparateEXT sf_ptrc_glBlendEquationSeparateEXT
+#endif /*GL_EXT_blend_equation_separate*/
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_EXT_framebuffer_object 1
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glBindFramebufferEXT)(GLenum, GLuint);
+#define glBindFramebufferEXT sf_ptrc_glBindFramebufferEXT
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glBindRenderbufferEXT)(GLenum, GLuint);
+#define glBindRenderbufferEXT sf_ptrc_glBindRenderbufferEXT
+extern GLenum (CODEGEN_FUNCPTR *sf_ptrc_glCheckFramebufferStatusEXT)(GLenum);
+#define glCheckFramebufferStatusEXT sf_ptrc_glCheckFramebufferStatusEXT
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glDeleteFramebuffersEXT)(GLsizei, const GLuint *);
+#define glDeleteFramebuffersEXT sf_ptrc_glDeleteFramebuffersEXT
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glDeleteRenderbuffersEXT)(GLsizei, const GLuint *);
+#define glDeleteRenderbuffersEXT sf_ptrc_glDeleteRenderbuffersEXT
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glFramebufferRenderbufferEXT)(GLenum, GLenum, GLenum, GLuint);
+#define glFramebufferRenderbufferEXT sf_ptrc_glFramebufferRenderbufferEXT
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glFramebufferTexture1DEXT)(GLenum, GLenum, GLenum, GLuint, GLint);
+#define glFramebufferTexture1DEXT sf_ptrc_glFramebufferTexture1DEXT
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glFramebufferTexture2DEXT)(GLenum, GLenum, GLenum, GLuint, GLint);
+#define glFramebufferTexture2DEXT sf_ptrc_glFramebufferTexture2DEXT
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glFramebufferTexture3DEXT)(GLenum, GLenum, GLenum, GLuint, GLint, GLint);
+#define glFramebufferTexture3DEXT sf_ptrc_glFramebufferTexture3DEXT
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glGenFramebuffersEXT)(GLsizei, GLuint *);
+#define glGenFramebuffersEXT sf_ptrc_glGenFramebuffersEXT
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glGenRenderbuffersEXT)(GLsizei, GLuint *);
+#define glGenRenderbuffersEXT sf_ptrc_glGenRenderbuffersEXT
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glGenerateMipmapEXT)(GLenum);
+#define glGenerateMipmapEXT sf_ptrc_glGenerateMipmapEXT
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glGetFramebufferAttachmentParameterivEXT)(GLenum, GLenum, GLenum, GLint *);
+#define glGetFramebufferAttachmentParameterivEXT sf_ptrc_glGetFramebufferAttachmentParameterivEXT
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glGetRenderbufferParameterivEXT)(GLenum, GLenum, GLint *);
+#define glGetRenderbufferParameterivEXT sf_ptrc_glGetRenderbufferParameterivEXT
+extern GLboolean (CODEGEN_FUNCPTR *sf_ptrc_glIsFramebufferEXT)(GLuint);
+#define glIsFramebufferEXT sf_ptrc_glIsFramebufferEXT
+extern GLboolean (CODEGEN_FUNCPTR *sf_ptrc_glIsRenderbufferEXT)(GLuint);
+#define glIsRenderbufferEXT sf_ptrc_glIsRenderbufferEXT
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glRenderbufferStorageEXT)(GLenum, GLenum, GLsizei, GLsizei);
+#define glRenderbufferStorageEXT sf_ptrc_glRenderbufferStorageEXT
+#endif /*GL_EXT_framebuffer_object*/
+
+GLAPI void APIENTRY glBlendFunc(GLenum, GLenum);
+GLAPI void APIENTRY glClear(GLbitfield);
+GLAPI void APIENTRY glClearColor(GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glClearDepth(GLdouble);
+GLAPI void APIENTRY glClearStencil(GLint);
+GLAPI void APIENTRY glClipPlane(GLenum, const GLdouble *);
+GLAPI void APIENTRY glColorMask(GLboolean, GLboolean, GLboolean, GLboolean);
+GLAPI void APIENTRY glCopyPixels(GLint, GLint, GLsizei, GLsizei, GLenum);
+GLAPI void APIENTRY glCullFace(GLenum);
+GLAPI void APIENTRY glDepthFunc(GLenum);
+GLAPI void APIENTRY glDepthMask(GLboolean);
+GLAPI void APIENTRY glDepthRange(GLdouble, GLdouble);
+GLAPI void APIENTRY glDisable(GLenum);
+GLAPI void APIENTRY glDrawBuffer(GLenum);
+GLAPI void APIENTRY glEnable(GLenum);
+GLAPI void APIENTRY glFinish();
+GLAPI void APIENTRY glFlush();
+GLAPI void APIENTRY glFrontFace(GLenum);
+GLAPI void APIENTRY glFrustum(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glGetBooleanv(GLenum, GLboolean *);
+GLAPI void APIENTRY glGetDoublev(GLenum, GLdouble *);
+GLAPI GLenum APIENTRY glGetError();
+GLAPI void APIENTRY glGetFloatv(GLenum, GLfloat *);
+GLAPI void APIENTRY glGetIntegerv(GLenum, GLint *);
+GLAPI const GLubyte * APIENTRY glGetString(GLenum);
+GLAPI void APIENTRY glGetTexEnvfv(GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetTexEnviv(GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetTexGendv(GLenum, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetTexGenfv(GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetTexGeniv(GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetTexImage(GLenum, GLint, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetTexLevelParameterfv(GLenum, GLint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetTexLevelParameteriv(GLenum, GLint, GLenum, GLint *);
+GLAPI void APIENTRY glGetTexParameterfv(GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetTexParameteriv(GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glHint(GLenum, GLenum);
+GLAPI void APIENTRY glIndexMask(GLuint);
+GLAPI GLboolean APIENTRY glIsEnabled(GLenum);
+GLAPI void APIENTRY glLineWidth(GLfloat);
+GLAPI void APIENTRY glLoadIdentity();
+GLAPI void APIENTRY glLoadMatrixd(const GLdouble *);
+GLAPI void APIENTRY glLoadMatrixf(const GLfloat *);
+GLAPI void APIENTRY glMatrixMode(GLenum);
+GLAPI void APIENTRY glMultMatrixd(const GLdouble *);
+GLAPI void APIENTRY glMultMatrixf(const GLfloat *);
+GLAPI void APIENTRY glOrtho(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glPointSize(GLfloat);
+GLAPI void APIENTRY glPopAttrib();
+GLAPI void APIENTRY glPopMatrix();
+GLAPI void APIENTRY glPushAttrib(GLbitfield);
+GLAPI void APIENTRY glPushMatrix();
+GLAPI void APIENTRY glReadBuffer(GLenum);
+GLAPI void APIENTRY glReadPixels(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glScissor(GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glShadeModel(GLenum);
+GLAPI void APIENTRY glStencilFunc(GLenum, GLint, GLuint);
+GLAPI void APIENTRY glStencilMask(GLuint);
+GLAPI void APIENTRY glStencilOp(GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glTexImage1D(GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexImage2D(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexParameterf(GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glTexParameterfv(GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glTexParameteri(GLenum, GLenum, GLint);
+GLAPI void APIENTRY glTexParameteriv(GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glViewport(GLint, GLint, GLsizei, GLsizei);
+
+GLAPI void APIENTRY glBindTexture(GLenum, GLuint);
+GLAPI void APIENTRY glColorPointer(GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCopyTexImage1D(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
+GLAPI void APIENTRY glCopyTexImage2D(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
+GLAPI void APIENTRY glCopyTexSubImage1D(GLenum, GLint, GLint, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyTexSubImage2D(GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glDeleteTextures(GLsizei, const GLuint *);
+GLAPI void APIENTRY glDisableClientState(GLenum);
+GLAPI void APIENTRY glDrawArrays(GLenum, GLint, GLsizei);
+GLAPI void APIENTRY glDrawElements(GLenum, GLsizei, GLenum, const GLvoid *);
+GLAPI void APIENTRY glEnableClientState(GLenum);
+GLAPI void APIENTRY glGenTextures(GLsizei, GLuint *);
+GLAPI void APIENTRY glGetPointerv(GLenum, GLvoid **);
+GLAPI void APIENTRY glNormalPointer(GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glPolygonOffset(GLfloat, GLfloat);
+GLAPI void APIENTRY glPopClientAttrib();
+GLAPI void APIENTRY glPushClientAttrib(GLbitfield);
+GLAPI void APIENTRY glTexCoordPointer(GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage1D(GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage2D(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glVertexPointer(GLint, GLenum, GLsizei, const GLvoid *);
+
+enum sfogl_LoadStatus
+{
+ sfogl_LOAD_FAILED = 0,
+ sfogl_LOAD_SUCCEEDED = 1
+};
+
+int sfogl_LoadFunctions();
+
+int sfogl_GetMinorVersion();
+int sfogl_GetMajorVersion();
+int sfogl_IsVersionGEQ(int majorVersion, int minorVersion);
+
+#ifdef __cplusplus
+}
+#endif /*__cplusplus*/
+
+#endif //SF_POINTER_C_GENERATED_HEADER_OPENGL_HPP
diff --git a/src/SFML/Graphics/Image.cpp b/src/SFML/Graphics/Image.cpp
index 7cc45e0..08fc495 100644
--- a/src/SFML/Graphics/Image.cpp
+++ b/src/SFML/Graphics/Image.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/ImageLoader.cpp b/src/SFML/Graphics/ImageLoader.cpp
index be6aecf..08ca147 100644
--- a/src/SFML/Graphics/ImageLoader.cpp
+++ b/src/SFML/Graphics/ImageLoader.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,9 +28,10 @@
#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_IMPLEMENTATION
+#include <stb_image.h>
#define STB_IMAGE_WRITE_IMPLEMENTATION
-#include <SFML/Graphics/stb_image/stb_image_write.h>
+#include <stb_image_write.h>
extern "C"
{
#include <jpeglib.h>
@@ -55,7 +56,7 @@ namespace
sf::InputStream* stream = static_cast<sf::InputStream*>(user);
return static_cast<int>(stream->read(data, size));
}
- void skip(void* user, unsigned int size)
+ void skip(void* user, int size)
{
sf::InputStream* stream = static_cast<sf::InputStream*>(user);
stream->seek(stream->tell() + size);
diff --git a/src/SFML/Graphics/ImageLoader.hpp b/src/SFML/Graphics/ImageLoader.hpp
index 8d1b71d..12e0699 100644
--- a/src/SFML/Graphics/ImageLoader.hpp
+++ b/src/SFML/Graphics/ImageLoader.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/RectangleShape.cpp b/src/SFML/Graphics/RectangleShape.cpp
index be04abd..6fa4119 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -54,14 +54,14 @@ const Vector2f& RectangleShape::getSize() const
////////////////////////////////////////////////////////////
-unsigned int RectangleShape::getPointCount() const
+std::size_t RectangleShape::getPointCount() const
{
return 4;
}
////////////////////////////////////////////////////////////
-Vector2f RectangleShape::getPoint(unsigned int index) const
+Vector2f RectangleShape::getPoint(std::size_t index) const
{
switch (index)
{
diff --git a/src/SFML/Graphics/RenderStates.cpp b/src/SFML/Graphics/RenderStates.cpp
index 093d902..3da5fb1 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/RenderTarget.cpp b/src/SFML/Graphics/RenderTarget.cpp
index cfc7ba6..19e1d50 100644
--- a/src/SFML/Graphics/RenderTarget.cpp
+++ b/src/SFML/Graphics/RenderTarget.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,6 @@ namespace
{
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;
@@ -62,7 +61,6 @@ namespace
{
switch (blendEquation)
{
- default:
case sf::BlendMode::Add: return GLEXT_GL_FUNC_ADD;
case sf::BlendMode::Subtract: return GLEXT_GL_FUNC_SUBTRACT;
}
@@ -190,7 +188,7 @@ void RenderTarget::draw(const Drawable& drawable, const RenderStates& states)
////////////////////////////////////////////////////////////
-void RenderTarget::draw(const Vertex* vertices, unsigned int vertexCount,
+void RenderTarget::draw(const Vertex* vertices, std::size_t vertexCount,
PrimitiveType type, const RenderStates& states)
{
// Nothing to draw?
@@ -218,7 +216,7 @@ void RenderTarget::draw(const Vertex* vertices, unsigned int vertexCount,
if (useVertexCache)
{
// Pre-transform the vertices and store them into the vertex cache
- for (unsigned int i = 0; i < vertexCount; ++i)
+ for (std::size_t i = 0; i < vertexCount; ++i)
{
Vertex& vertex = m_cache.vertexCache[i];
vertex.position = states.transform * vertices[i].position;
@@ -434,15 +432,31 @@ void RenderTarget::applyBlendMode(const BlendMode& mode)
factorToGlConstant(mode.colorDstFactor)));
}
- if (GLEXT_blend_equation_separate)
+ if (GLEXT_blend_minmax && GLEXT_blend_subtract)
{
- glCheck(GLEXT_glBlendEquationSeparate(
- equationToGlConstant(mode.colorEquation),
- equationToGlConstant(mode.alphaEquation)));
+ if (GLEXT_blend_equation_separate)
+ {
+ glCheck(GLEXT_glBlendEquationSeparate(
+ equationToGlConstant(mode.colorEquation),
+ equationToGlConstant(mode.alphaEquation)));
+ }
+ else
+ {
+ glCheck(GLEXT_glBlendEquation(equationToGlConstant(mode.colorEquation)));
+ }
}
- else
+ else if ((mode.colorEquation != BlendMode::Add) || (mode.alphaEquation != BlendMode::Add))
{
- glCheck(GLEXT_glBlendEquation(equationToGlConstant(mode.colorEquation)));
+ static bool warned = false;
+
+ if (!warned)
+ {
+ err() << "OpenGL extension EXT_blend_minmax and/or EXT_blend_subtract unavailable" << std::endl;
+ err() << "Selecting a blend equation not possible" << std::endl;
+ err() << "Ensure that hardware acceleration is enabled if available" << std::endl;
+
+ warned = true;
+ }
}
m_cache.lastBlendMode = mode;
diff --git a/src/SFML/Graphics/RenderTexture.cpp b/src/SFML/Graphics/RenderTexture.cpp
index e3669e3..e80aa4c 100644
--- a/src/SFML/Graphics/RenderTexture.cpp
+++ b/src/SFML/Graphics/RenderTexture.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/RenderTextureImpl.cpp b/src/SFML/Graphics/RenderTextureImpl.cpp
index d57c03b..f69305b 100644
--- a/src/SFML/Graphics/RenderTextureImpl.cpp
+++ b/src/SFML/Graphics/RenderTextureImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/RenderTextureImpl.hpp b/src/SFML/Graphics/RenderTextureImpl.hpp
index dec8152..87562e7 100644
--- a/src/SFML/Graphics/RenderTextureImpl.hpp
+++ b/src/SFML/Graphics/RenderTextureImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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.cpp b/src/SFML/Graphics/RenderTextureImplDefault.cpp
index 80a15cc..3d1a9dd 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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 c801fe1..5c05a88 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/RenderTextureImplFBO.cpp b/src/SFML/Graphics/RenderTextureImplFBO.cpp
index dca0240..9526872 100644
--- a/src/SFML/Graphics/RenderTextureImplFBO.cpp
+++ b/src/SFML/Graphics/RenderTextureImplFBO.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/RenderTextureImplFBO.hpp b/src/SFML/Graphics/RenderTextureImplFBO.hpp
index 831876c..cfbb53a 100644
--- a/src/SFML/Graphics/RenderTextureImplFBO.hpp
+++ b/src/SFML/Graphics/RenderTextureImplFBO.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/RenderWindow.cpp b/src/SFML/Graphics/RenderWindow.cpp
index ac7ce7d..d9e884d 100644
--- a/src/SFML/Graphics/RenderWindow.cpp
+++ b/src/SFML/Graphics/RenderWindow.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Shader.cpp b/src/SFML/Graphics/Shader.cpp
index 1cf7648..80ca28e 100644
--- a/src/SFML/Graphics/Shader.cpp
+++ b/src/SFML/Graphics/Shader.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -40,6 +40,18 @@
#ifndef SFML_OPENGL_ES
+#if defined(SFML_SYSTEM_MACOS) || defined(SFML_SYSTEM_IOS)
+
+ #define castToGlHandle(x) reinterpret_cast<GLEXT_GLhandle>(static_cast<ptrdiff_t>(x))
+ #define castFromGlHandle(x) static_cast<unsigned int>(reinterpret_cast<ptrdiff_t>(x))
+
+#else
+
+ #define castToGlHandle(x) (x)
+ #define castFromGlHandle(x) (x)
+
+#endif
+
namespace
{
sf::Mutex mutex;
@@ -47,8 +59,7 @@ namespace
GLint checkMaxTextureUnits()
{
GLint maxUnits = 0;
-
- glCheck(glGetIntegerv(GL_MAX_TEXTURE_COORDS_ARB, &maxUnits));
+ glCheck(glGetIntegerv(GLEXT_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxUnits));
return maxUnits;
}
@@ -113,10 +124,11 @@ namespace
// 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;
+ bool available = GLEXT_multitexture &&
+ GLEXT_shading_language_100 &&
+ GLEXT_shader_objects &&
+ GLEXT_vertex_shader &&
+ GLEXT_fragment_shader;
return available;
}
@@ -146,7 +158,7 @@ Shader::~Shader()
// Destroy effect program
if (m_shaderProgram)
- glCheck(glDeleteObjectARB(m_shaderProgram));
+ glCheck(GLEXT_glDeleteObject(castToGlHandle(m_shaderProgram)));
}
@@ -263,18 +275,18 @@ void Shader::setParameter(const std::string& name, float x)
ensureGlContext();
// Enable program
- GLhandleARB program = glCheck(glGetHandleARB(GL_PROGRAM_OBJECT_ARB));
- glCheck(glUseProgramObjectARB(m_shaderProgram));
+ GLEXT_GLhandle program = glCheck(GLEXT_glGetHandle(GLEXT_GL_PROGRAM_OBJECT));
+ glCheck(GLEXT_glUseProgramObject(castToGlHandle(m_shaderProgram)));
// Get parameter location and assign it new values
GLint location = getParamLocation(name);
if (location != -1)
{
- glCheck(glUniform1fARB(location, x));
+ glCheck(GLEXT_glUniform1f(location, x));
}
// Disable program
- glCheck(glUseProgramObjectARB(program));
+ glCheck(GLEXT_glUseProgramObject(program));
}
}
@@ -287,18 +299,18 @@ void Shader::setParameter(const std::string& name, float x, float y)
ensureGlContext();
// Enable program
- GLhandleARB program = glCheck(glGetHandleARB(GL_PROGRAM_OBJECT_ARB));
- glCheck(glUseProgramObjectARB(m_shaderProgram));
+ GLEXT_GLhandle program = glCheck(GLEXT_glGetHandle(GLEXT_GL_PROGRAM_OBJECT));
+ glCheck(GLEXT_glUseProgramObject(castToGlHandle(m_shaderProgram)));
// Get parameter location and assign it new values
GLint location = getParamLocation(name);
if (location != -1)
{
- glCheck(glUniform2fARB(location, x, y));
+ glCheck(GLEXT_glUniform2f(location, x, y));
}
// Disable program
- glCheck(glUseProgramObjectARB(program));
+ glCheck(GLEXT_glUseProgramObject(program));
}
}
@@ -311,18 +323,18 @@ void Shader::setParameter(const std::string& name, float x, float y, float z)
ensureGlContext();
// Enable program
- GLhandleARB program = glCheck(glGetHandleARB(GL_PROGRAM_OBJECT_ARB));
- glCheck(glUseProgramObjectARB(m_shaderProgram));
+ GLEXT_GLhandle program = glCheck(GLEXT_glGetHandle(GLEXT_GL_PROGRAM_OBJECT));
+ glCheck(GLEXT_glUseProgramObject(castToGlHandle(m_shaderProgram)));
// Get parameter location and assign it new values
GLint location = getParamLocation(name);
if (location != -1)
{
- glCheck(glUniform3fARB(location, x, y, z));
+ glCheck(GLEXT_glUniform3f(location, x, y, z));
}
// Disable program
- glCheck(glUseProgramObjectARB(program));
+ glCheck(GLEXT_glUseProgramObject(program));
}
}
@@ -335,18 +347,18 @@ void Shader::setParameter(const std::string& name, float x, float y, float z, fl
ensureGlContext();
// Enable program
- GLhandleARB program = glCheck(glGetHandleARB(GL_PROGRAM_OBJECT_ARB));
- glCheck(glUseProgramObjectARB(m_shaderProgram));
+ GLEXT_GLhandle program = glCheck(GLEXT_glGetHandle(GLEXT_GL_PROGRAM_OBJECT));
+ glCheck(GLEXT_glUseProgramObject(castToGlHandle(m_shaderProgram)));
// Get parameter location and assign it new values
GLint location = getParamLocation(name);
if (location != -1)
{
- glCheck(glUniform4fARB(location, x, y, z, w));
+ glCheck(GLEXT_glUniform4f(location, x, y, z, w));
}
// Disable program
- glCheck(glUseProgramObjectARB(program));
+ glCheck(GLEXT_glUseProgramObject(program));
}
}
@@ -380,18 +392,18 @@ void Shader::setParameter(const std::string& name, const sf::Transform& transfor
ensureGlContext();
// Enable program
- GLhandleARB program = glCheck(glGetHandleARB(GL_PROGRAM_OBJECT_ARB));
- glCheck(glUseProgramObjectARB(m_shaderProgram));
+ GLEXT_GLhandle program = glCheck(GLEXT_glGetHandle(GLEXT_GL_PROGRAM_OBJECT));
+ glCheck(GLEXT_glUseProgramObject(castToGlHandle(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()));
+ glCheck(GLEXT_glUniformMatrix4fv(location, 1, GL_FALSE, transform.getMatrix()));
}
// Disable program
- glCheck(glUseProgramObjectARB(program));
+ glCheck(GLEXT_glUseProgramObject(program));
}
}
@@ -445,26 +457,41 @@ void Shader::setParameter(const std::string& name, CurrentTextureType)
////////////////////////////////////////////////////////////
+unsigned int Shader::getNativeHandle() const
+{
+ return m_shaderProgram;
+}
+
+
+////////////////////////////////////////////////////////////
void Shader::bind(const Shader* shader)
{
ensureGlContext();
+ // Make sure that we can use shaders
+ if (!isAvailable())
+ {
+ err() << "Failed to bind or unbind shader: your system doesn't support shaders "
+ << "(you should test Shader::isAvailable() before trying to use the Shader class)" << std::endl;
+ return;
+ }
+
if (shader && shader->m_shaderProgram)
{
// Enable the program
- glCheck(glUseProgramObjectARB(shader->m_shaderProgram));
+ glCheck(GLEXT_glUseProgramObject(castToGlHandle(shader->m_shaderProgram)));
// Bind the textures
shader->bindTextures();
// Bind the current texture
if (shader->m_currentTexture != -1)
- glCheck(glUniform1iARB(shader->m_currentTexture, 0));
+ glCheck(GLEXT_glUniform1i(shader->m_currentTexture, 0));
}
else
{
// Bind no shader
- glCheck(glUseProgramObjectARB(0));
+ glCheck(GLEXT_glUseProgramObject(0));
}
}
@@ -496,7 +523,10 @@ bool Shader::compile(const char* vertexShaderCode, const char* fragmentShaderCod
// Destroy the shader if it was already created
if (m_shaderProgram)
- glCheck(glDeleteObjectARB(m_shaderProgram));
+ {
+ glCheck(GLEXT_glDeleteObject(castToGlHandle(m_shaderProgram)));
+ m_shaderProgram = 0;
+ }
// Reset the internal state
m_currentTexture = -1;
@@ -504,81 +534,80 @@ bool Shader::compile(const char* vertexShaderCode, const char* fragmentShaderCod
m_params.clear();
// Create the program
- m_shaderProgram = glCheck(glCreateProgramObjectARB());
+ GLEXT_GLhandle shaderProgram = glCheck(GLEXT_glCreateProgramObject());
// 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));
+ GLEXT_GLhandle vertexShader = glCheck(GLEXT_glCreateShaderObject(GLEXT_GL_VERTEX_SHADER));
+ glCheck(GLEXT_glShaderSource(vertexShader, 1, &vertexShaderCode, NULL));
+ glCheck(GLEXT_glCompileShader(vertexShader));
// Check the compile log
GLint success;
- glCheck(glGetObjectParameterivARB(vertexShader, GL_OBJECT_COMPILE_STATUS_ARB, &success));
+ glCheck(GLEXT_glGetObjectParameteriv(vertexShader, GLEXT_GL_OBJECT_COMPILE_STATUS, &success));
if (success == GL_FALSE)
{
char log[1024];
- glCheck(glGetInfoLogARB(vertexShader, sizeof(log), 0, log));
+ glCheck(GLEXT_glGetInfoLog(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;
+ glCheck(GLEXT_glDeleteObject(vertexShader));
+ glCheck(GLEXT_glDeleteObject(shaderProgram));
return false;
}
// Attach the shader to the program, and delete it (not needed anymore)
- glCheck(glAttachObjectARB(m_shaderProgram, vertexShader));
- glCheck(glDeleteObjectARB(vertexShader));
+ glCheck(GLEXT_glAttachObject(shaderProgram, vertexShader));
+ glCheck(GLEXT_glDeleteObject(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));
+ GLEXT_GLhandle fragmentShader = glCheck(GLEXT_glCreateShaderObject(GLEXT_GL_FRAGMENT_SHADER));
+ glCheck(GLEXT_glShaderSource(fragmentShader, 1, &fragmentShaderCode, NULL));
+ glCheck(GLEXT_glCompileShader(fragmentShader));
// Check the compile log
GLint success;
- glCheck(glGetObjectParameterivARB(fragmentShader, GL_OBJECT_COMPILE_STATUS_ARB, &success));
+ glCheck(GLEXT_glGetObjectParameteriv(fragmentShader, GLEXT_GL_OBJECT_COMPILE_STATUS, &success));
if (success == GL_FALSE)
{
char log[1024];
- glCheck(glGetInfoLogARB(fragmentShader, sizeof(log), 0, log));
+ glCheck(GLEXT_glGetInfoLog(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;
+ glCheck(GLEXT_glDeleteObject(fragmentShader));
+ glCheck(GLEXT_glDeleteObject(shaderProgram));
return false;
}
// Attach the shader to the program, and delete it (not needed anymore)
- glCheck(glAttachObjectARB(m_shaderProgram, fragmentShader));
- glCheck(glDeleteObjectARB(fragmentShader));
+ glCheck(GLEXT_glAttachObject(shaderProgram, fragmentShader));
+ glCheck(GLEXT_glDeleteObject(fragmentShader));
}
// Link the program
- glCheck(glLinkProgramARB(m_shaderProgram));
+ glCheck(GLEXT_glLinkProgram(shaderProgram));
// Check the link log
GLint success;
- glCheck(glGetObjectParameterivARB(m_shaderProgram, GL_OBJECT_LINK_STATUS_ARB, &success));
+ glCheck(GLEXT_glGetObjectParameteriv(shaderProgram, GLEXT_GL_OBJECT_LINK_STATUS, &success));
if (success == GL_FALSE)
{
char log[1024];
- glCheck(glGetInfoLogARB(m_shaderProgram, sizeof(log), 0, log));
+ glCheck(GLEXT_glGetInfoLog(shaderProgram, sizeof(log), 0, log));
err() << "Failed to link shader:" << std::endl
<< log << std::endl;
- glCheck(glDeleteObjectARB(m_shaderProgram));
- m_shaderProgram = 0;
+ glCheck(GLEXT_glDeleteObject(shaderProgram));
return false;
}
+ m_shaderProgram = castFromGlHandle(shaderProgram);
+
// Force an OpenGL flush, so that the shader will appear updated
// in all contexts immediately (solves problems in multi-threaded apps)
glCheck(glFlush());
@@ -594,14 +623,14 @@ void Shader::bindTextures() const
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));
+ glCheck(GLEXT_glUniform1i(it->first, index));
+ glCheck(GLEXT_glActiveTexture(GLEXT_GL_TEXTURE0 + 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));
+ glCheck(GLEXT_glActiveTexture(GLEXT_GL_TEXTURE0));
}
@@ -618,7 +647,7 @@ int Shader::getParamLocation(const std::string& name)
else
{
// Not in cache, request the location from OpenGL
- int location = glGetUniformLocationARB(m_shaderProgram, name.c_str());
+ int location = GLEXT_glGetUniformLocation(castToGlHandle(m_shaderProgram), name.c_str());
m_params.insert(std::make_pair(name, location));
if (location == -1)
@@ -757,6 +786,13 @@ void Shader::setParameter(const std::string& name, CurrentTextureType)
////////////////////////////////////////////////////////////
+unsigned int Shader::getNativeHandle() const
+{
+ return 0;
+}
+
+
+////////////////////////////////////////////////////////////
void Shader::bind(const Shader* shader)
{
}
diff --git a/src/SFML/Graphics/Shape.cpp b/src/SFML/Graphics/Shape.cpp
index fa73a5f..3487777 100644
--- a/src/SFML/Graphics/Shape.cpp
+++ b/src/SFML/Graphics/Shape.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -175,7 +175,7 @@ m_bounds ()
void Shape::update()
{
// Get the total number of points of the shape
- unsigned int count = getPointCount();
+ std::size_t count = getPointCount();
if (count < 3)
{
m_vertices.resize(0);
@@ -186,7 +186,7 @@ void Shape::update()
m_vertices.resize(count + 2); // + 2 for center and repeated first point
// Position
- for (unsigned int i = 0; i < count; ++i)
+ for (std::size_t i = 0; i < count; ++i)
m_vertices[i + 1].position = getPoint(i);
m_vertices[count + 1].position = m_vertices[1].position;
@@ -230,7 +230,7 @@ void Shape::draw(RenderTarget& target, RenderStates states) const
////////////////////////////////////////////////////////////
void Shape::updateFillColors()
{
- for (unsigned int i = 0; i < m_vertices.getVertexCount(); ++i)
+ for (std::size_t i = 0; i < m_vertices.getVertexCount(); ++i)
m_vertices[i].color = m_fillColor;
}
@@ -238,7 +238,7 @@ void Shape::updateFillColors()
////////////////////////////////////////////////////////////
void Shape::updateTexCoords()
{
- for (unsigned int i = 0; i < m_vertices.getVertexCount(); ++i)
+ for (std::size_t 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;
@@ -251,12 +251,12 @@ void Shape::updateTexCoords()
////////////////////////////////////////////////////////////
void Shape::updateOutline()
{
- unsigned int count = m_vertices.getVertexCount() - 2;
+ std::size_t count = m_vertices.getVertexCount() - 2;
m_outlineVertices.resize((count + 1) * 2);
- for (unsigned int i = 0; i < count; ++i)
+ for (std::size_t i = 0; i < count; ++i)
{
- unsigned int index = i + 1;
+ std::size_t 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;
@@ -298,7 +298,7 @@ void Shape::updateOutline()
////////////////////////////////////////////////////////////
void Shape::updateOutlineColors()
{
- for (unsigned int i = 0; i < m_outlineVertices.getVertexCount(); ++i)
+ for (std::size_t i = 0; i < m_outlineVertices.getVertexCount(); ++i)
m_outlineVertices[i].color = m_outlineColor;
}
diff --git a/src/SFML/Graphics/Sprite.cpp b/src/SFML/Graphics/Sprite.cpp
index eeb82e8..e24c8f2 100644
--- a/src/SFML/Graphics/Sprite.cpp
+++ b/src/SFML/Graphics/Sprite.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Text.cpp b/src/SFML/Graphics/Text.cpp
index 5a83e3b..0635a0e 100644
--- a/src/SFML/Graphics/Text.cpp
+++ b/src/SFML/Graphics/Text.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -118,7 +118,7 @@ void Text::setColor(const Color& color)
// (if geometry is updated anyway, we can skip this step)
if (!m_geometryNeedUpdate)
{
- for (unsigned int i = 0; i < m_vertices.getVertexCount(); ++i)
+ for (std::size_t i = 0; i < m_vertices.getVertexCount(); ++i)
m_vertices[i].color = m_color;
}
}
diff --git a/src/SFML/Graphics/Texture.cpp b/src/SFML/Graphics/Texture.cpp
index 81387c7..a747a2d 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -80,7 +80,6 @@ m_isRepeated (false),
m_pixelsFlipped(false),
m_cacheId (getUniqueId())
{
-
}
@@ -153,14 +152,31 @@ bool Texture::create(unsigned int width, unsigned int height)
m_texture = static_cast<unsigned int>(texture);
}
+ // Make sure that extensions are initialized
+ priv::ensureExtensionsInit();
+
// Make sure that the current texture binding will be preserved
priv::TextureSaver save;
+ if (!m_isRepeated && !GLEXT_texture_edge_clamp)
+ {
+ static bool warned = false;
+
+ if (!warned)
+ {
+ err() << "OpenGL extension SGIS_texture_edge_clamp unavailable" << std::endl;
+ err() << "Artifacts may occur along texture edges" << std::endl;
+ err() << "Ensure that hardware acceleration is enabled if available" << std::endl;
+
+ warned = true;
+ }
+ }
+
// Initialize the texture
glCheck(glBindTexture(GL_TEXTURE_2D, m_texture));
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_WRAP_S, m_isRepeated ? GL_REPEAT : (GLEXT_texture_edge_clamp ? GLEXT_GL_CLAMP_TO_EDGE : GLEXT_GL_CLAMP)));
+ glCheck(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, m_isRepeated ? GL_REPEAT : (GLEXT_texture_edge_clamp ? GLEXT_GL_CLAMP_TO_EDGE : GLEXT_GL_CLAMP)));
glCheck(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, m_isSmooth ? GL_LINEAR : GL_NEAREST));
glCheck(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, m_isSmooth ? GL_LINEAR : GL_NEAREST));
m_cacheId = getUniqueId();
@@ -464,9 +480,23 @@ void Texture::setRepeated(bool repeated)
// Make sure that the current texture binding will be preserved
priv::TextureSaver save;
+ if (!m_isRepeated && !GLEXT_texture_edge_clamp)
+ {
+ static bool warned = false;
+
+ if (!warned)
+ {
+ err() << "OpenGL extension SGIS_texture_edge_clamp unavailable" << std::endl;
+ err() << "Artifacts may occur along texture edges" << std::endl;
+ err() << "Ensure that hardware acceleration is enabled if available" << std::endl;
+
+ warned = true;
+ }
+ }
+
glCheck(glBindTexture(GL_TEXTURE_2D, m_texture));
- 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_WRAP_S, m_isRepeated ? GL_REPEAT : (GLEXT_texture_edge_clamp ? GLEXT_GL_CLAMP_TO_EDGE : GLEXT_GL_CLAMP)));
+ glCheck(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, m_isRepeated ? GL_REPEAT : (GLEXT_texture_edge_clamp ? GLEXT_GL_CLAMP_TO_EDGE : GLEXT_GL_CLAMP)));
}
}
}
@@ -565,6 +595,13 @@ Texture& Texture::operator =(const Texture& right)
////////////////////////////////////////////////////////////
+unsigned int Texture::getNativeHandle() const
+{
+ return m_texture;
+}
+
+
+////////////////////////////////////////////////////////////
unsigned int Texture::getValidSize(unsigned int size)
{
ensureGlContext();
diff --git a/src/SFML/Graphics/TextureSaver.cpp b/src/SFML/Graphics/TextureSaver.cpp
index c0e0197..47ad6e9 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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 2880e19..4c87e4e 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Transform.cpp b/src/SFML/Graphics/Transform.cpp
index 487072a..e027031 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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 726bc36..c45452d 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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 8733a0f..b95eb71 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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 743cc3e..e2d0218 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -40,7 +40,7 @@ m_primitiveType(Points)
////////////////////////////////////////////////////////////
-VertexArray::VertexArray(PrimitiveType type, unsigned int vertexCount) :
+VertexArray::VertexArray(PrimitiveType type, std::size_t vertexCount) :
m_vertices (vertexCount),
m_primitiveType(type)
{
@@ -48,21 +48,21 @@ m_primitiveType(type)
////////////////////////////////////////////////////////////
-unsigned int VertexArray::getVertexCount() const
+std::size_t VertexArray::getVertexCount() const
{
- return static_cast<unsigned int>(m_vertices.size());
+ return m_vertices.size();
}
////////////////////////////////////////////////////////////
-Vertex& VertexArray::operator [](unsigned int index)
+Vertex& VertexArray::operator [](std::size_t index)
{
return m_vertices[index];
}
////////////////////////////////////////////////////////////
-const Vertex& VertexArray::operator [](unsigned int index) const
+const Vertex& VertexArray::operator [](std::size_t index) const
{
return m_vertices[index];
}
@@ -76,7 +76,7 @@ void VertexArray::clear()
////////////////////////////////////////////////////////////
-void VertexArray::resize(unsigned int vertexCount)
+void VertexArray::resize(std::size_t vertexCount)
{
m_vertices.resize(vertexCount);
}
@@ -144,7 +144,7 @@ FloatRect VertexArray::getBounds() const
void VertexArray::draw(RenderTarget& target, RenderStates states) const
{
if (!m_vertices.empty())
- target.draw(&m_vertices[0], static_cast<unsigned int>(m_vertices.size()), m_primitiveType, states);
+ target.draw(&m_vertices[0], m_vertices.size(), m_primitiveType, states);
}
} // namespace sf
diff --git a/src/SFML/Graphics/View.cpp b/src/SFML/Graphics/View.cpp
index ba9f673..4fc6178 100644
--- a/src/SFML/Graphics/View.cpp
+++ b/src/SFML/Graphics/View.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/stb_image/stb_image.h b/src/SFML/Graphics/stb_image/stb_image.h
deleted file mode 100644
index e6ed311..0000000
--- a/src/SFML/Graphics/stb_image/stb_image.h
+++ /dev/null
@@ -1,4673 +0,0 @@
-/* stbi-1.33 - public domain JPEG/PNG reader - http://nothings.org/stb_image.c
- when you control the images you're loading
- no warranty implied; use at your own risk
-
- QUICK NOTES:
- Primarily of interest to game developers and other people who can
- avoid problematic images and only need the trivial interface
-
- JPEG baseline (no JPEG progressive)
- PNG 8-bit only
-
- TGA (not sure what subset, if a subset)
- BMP non-1bpp, non-RLE
- PSD (composited view only, no extra channels)
-
- GIF (*comp always reports as 4-channel)
- HDR (radiance rgbE format)
- PIC (Softimage PIC)
-
- - decode from memory or through FILE (define STBI_NO_STDIO to remove code)
- - decode from arbitrary I/O callbacks
- - overridable dequantizing-IDCT, YCbCr-to-RGB conversion (define STBI_SIMD)
-
- Latest revisions:
- 1.33 (2011-07-14) minor fixes suggested by Dave Moore
- 1.32 (2011-07-13) info support for all filetypes (SpartanJ)
- 1.31 (2011-06-19) a few more leak fixes, bug in PNG handling (SpartanJ)
- 1.30 (2011-06-11) added ability to load files via io callbacks (Ben Wenger)
- 1.29 (2010-08-16) various warning fixes from Aurelien Pocheville
- 1.28 (2010-08-01) fix bug in GIF palette transparency (SpartanJ)
- 1.27 (2010-08-01) cast-to-uint8 to fix warnings (Laurent Gomila)
- allow trailing 0s at end of image data (Laurent Gomila)
- 1.26 (2010-07-24) fix bug in file buffering for PNG reported by SpartanJ
-
- See end of file for full revision history.
-
- TODO:
- stbi_info support for BMP,PSD,HDR,PIC
-
-
- ============================ Contributors =========================
-
- Image formats Optimizations & bugfixes
- Sean Barrett (jpeg, png, bmp) Fabian "ryg" Giesen
- Nicolas Schulz (hdr, psd)
- Jonathan Dummer (tga) Bug fixes & warning fixes
- Jean-Marc Lienher (gif) Marc LeBlanc
- Tom Seddon (pic) Christpher Lloyd
- Thatcher Ulrich (psd) Dave Moore
- Won Chun
- the Horde3D community
- Extensions, features Janez Zemva
- Jetro Lauha (stbi_info) Jonathan Blow
- James "moose2000" Brown (iPhone PNG) Laurent Gomila
- Ben "Disch" Wenger (io callbacks) Aruelien Pocheville
- Martin "SpartanJ" Golini Ryamond Barbiero
- David Woo
-
-
- If your name should be here but isn't, let Sean know.
-
-*/
-
-#ifndef STBI_INCLUDE_STB_IMAGE_H
-#define STBI_INCLUDE_STB_IMAGE_H
-
-// To get a header file for this, either cut and paste the header,
-// or create stb_image.h, #define STBI_HEADER_FILE_ONLY, and
-// then include stb_image.c from it.
-
-//// begin header file ////////////////////////////////////////////////////
-//
-// Limitations:
-// - no jpeg progressive support
-// - non-HDR formats support 8-bit samples only (jpeg, png)
-// - no delayed line count (jpeg) -- IJG doesn't support either
-// - no 1-bit BMP
-// - GIF always returns *comp=4
-//
-// Basic usage (see HDR discussion below):
-// int x,y,n;
-// unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
-// // ... process data if not NULL ...
-// // ... x = width, y = height, n = # 8-bit components per pixel ...
-// // ... replace '0' with '1'..'4' to force that many components per pixel
-// // ... but 'n' will always be the number that it would have been if you said 0
-// stbi_image_free(data)
-//
-// Standard parameters:
-// int *x -- outputs image width in pixels
-// int *y -- outputs image height in pixels
-// int *comp -- outputs # of image components in image file
-// int req_comp -- if non-zero, # of image components requested in result
-//
-// The return value from an image loader is an 'unsigned char *' which points
-// to the pixel data. The pixel data consists of *y scanlines of *x pixels,
-// with each pixel consisting of N interleaved 8-bit components; the first
-// pixel pointed to is top-left-most in the image. There is no padding between
-// image scanlines or between pixels, regardless of format. The number of
-// components N is 'req_comp' if req_comp is non-zero, or *comp otherwise.
-// If req_comp is non-zero, *comp has the number of components that _would_
-// have been output otherwise. E.g. if you set req_comp to 4, you will always
-// get RGBA output, but you can check *comp to easily see if it's opaque.
-//
-// An output image with N components has the following components interleaved
-// in this order in each pixel:
-//
-// N=#comp components
-// 1 grey
-// 2 grey, alpha
-// 3 red, green, blue
-// 4 red, green, blue, alpha
-//
-// If image loading fails for any reason, the return value will be NULL,
-// and *x, *y, *comp will be unchanged. The function stbi_failure_reason()
-// can be queried for an extremely brief, end-user unfriendly explanation
-// of why the load failed. Define STBI_NO_FAILURE_STRINGS to avoid
-// compiling these strings at all, and STBI_FAILURE_USERMSG to get slightly
-// more user-friendly ones.
-//
-// Paletted PNG, BMP, GIF, and PIC images are automatically depalettized.
-//
-// ===========================================================================
-//
-// iPhone PNG support:
-//
-// By default we convert iphone-formatted PNGs back to RGB; nominally they
-// would silently load as BGR, except the existing code should have just
-// failed on such iPhone PNGs. But you can disable this conversion by
-// by calling stbi_convert_iphone_png_to_rgb(0), in which case
-// you will always just get the native iphone "format" through.
-//
-// Call stbi_set_unpremultiply_on_load(1) as well to force a divide per
-// pixel to remove any premultiplied alpha *only* if the image file explicitly
-// says there's premultiplied data (currently only happens in iPhone images,
-// and only if iPhone convert-to-rgb processing is on).
-//
-// ===========================================================================
-//
-// HDR image support (disable by defining STBI_NO_HDR)
-//
-// stb_image now supports loading HDR images in general, and currently
-// the Radiance .HDR file format, although the support is provided
-// generically. You can still load any file through the existing interface;
-// if you attempt to load an HDR file, it will be automatically remapped to
-// LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1;
-// both of these constants can be reconfigured through this interface:
-//
-// stbi_hdr_to_ldr_gamma(2.2f);
-// stbi_hdr_to_ldr_scale(1.0f);
-//
-// (note, do not use _inverse_ constants; stbi_image will invert them
-// appropriately).
-//
-// Additionally, there is a new, parallel interface for loading files as
-// (linear) floats to preserve the full dynamic range:
-//
-// float *data = stbi_loadf(filename, &x, &y, &n, 0);
-//
-// If you load LDR images through this interface, those images will
-// be promoted to floating point values, run through the inverse of
-// constants corresponding to the above:
-//
-// stbi_ldr_to_hdr_scale(1.0f);
-// stbi_ldr_to_hdr_gamma(2.2f);
-//
-// Finally, given a filename (or an open file or memory block--see header
-// file for details) containing image data, you can query for the "most
-// appropriate" interface to use (that is, whether the image is HDR or
-// not), using:
-//
-// stbi_is_hdr(char *filename);
-//
-// ===========================================================================
-//
-// I/O callbacks
-//
-// I/O callbacks allow you to read from arbitrary sources, like packaged
-// files or some other source. Data read from callbacks are processed
-// through a small internal buffer (currently 128 bytes) to try to reduce
-// overhead.
-//
-// The three functions you must define are "read" (reads some bytes of data),
-// "skip" (skips some bytes of data), "eof" (reports if the stream is at the end).
-
-
-#ifndef STBI_NO_STDIO
-
-#if defined(_MSC_VER) && _MSC_VER >= 0x1400
-#define _CRT_SECURE_NO_WARNINGS // suppress bogus warnings about fopen()
-#endif
-
-#include <stdio.h>
-#endif
-
-#define STBI_VERSION 1
-
-enum
-{
- STBI_default = 0, // only used for req_comp
-
- STBI_grey = 1,
- STBI_grey_alpha = 2,
- STBI_rgb = 3,
- STBI_rgb_alpha = 4
-};
-
-typedef unsigned char stbi_uc;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// PRIMARY API - works on images of any type
-//
-
-//
-// load image by filename, open file, or memory buffer
-//
-
-extern stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp);
-
-#ifndef STBI_NO_STDIO
-extern stbi_uc *stbi_load (char const *filename, int *x, int *y, int *comp, int req_comp);
-extern stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp);
-// for stbi_load_from_file, file pointer is left pointing immediately after image
-#endif
-
-typedef struct
-{
- int (*read) (void *user,char *data,int size); // fill 'data' with 'size' bytes. return number of bytes actually read
- void (*skip) (void *user,unsigned n); // skip the next 'n' bytes
- int (*eof) (void *user); // returns nonzero if we are at end of file/data
-} stbi_io_callbacks;
-
-extern stbi_uc *stbi_load_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp);
-
-#ifndef STBI_NO_HDR
- extern float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp);
-
- #ifndef STBI_NO_STDIO
- extern float *stbi_loadf (char const *filename, int *x, int *y, int *comp, int req_comp);
- extern float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *comp, int req_comp);
- #endif
-
- extern float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp);
-
- extern void stbi_hdr_to_ldr_gamma(float gamma);
- extern void stbi_hdr_to_ldr_scale(float scale);
-
- extern void stbi_ldr_to_hdr_gamma(float gamma);
- extern void stbi_ldr_to_hdr_scale(float scale);
-#endif // STBI_NO_HDR
-
-// stbi_is_hdr is always defined
-extern int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user);
-extern int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len);
-#ifndef STBI_NO_STDIO
-extern int stbi_is_hdr (char const *filename);
-extern int stbi_is_hdr_from_file(FILE *f);
-#endif // STBI_NO_STDIO
-
-
-// get a VERY brief reason for failure
-// NOT THREADSAFE
-extern const char *stbi_failure_reason (void);
-
-// free the loaded image -- this is just free()
-extern void stbi_image_free (void *retval_from_stbi_load);
-
-// get image dimensions & components without fully decoding
-extern int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp);
-extern int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp);
-
-#ifndef STBI_NO_STDIO
-extern int stbi_info (char const *filename, int *x, int *y, int *comp);
-extern int stbi_info_from_file (FILE *f, int *x, int *y, int *comp);
-
-#endif
-
-
-
-// for image formats that explicitly notate that they have premultiplied alpha,
-// we just return the colors as stored in the file. set this flag to force
-// unpremultiplication. results are undefined if the unpremultiply overflow.
-extern void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply);
-
-// indicate whether we should process iphone images back to canonical format,
-// or just pass them through "as-is"
-extern void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert);
-
-
-// ZLIB client - used by PNG, available for other purposes
-
-extern char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen);
-extern char *stbi_zlib_decode_malloc(const char *buffer, int len, int *outlen);
-extern int stbi_zlib_decode_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);
-
-extern char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len, int *outlen);
-extern int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);
-
-
-// define faster low-level operations (typically SIMD support)
-#ifdef STBI_SIMD
-typedef void (*stbi_idct_8x8)(stbi_uc *out, int out_stride, short data[64], unsigned short *dequantize);
-// compute an integer IDCT on "input"
-// input[x] = data[x] * dequantize[x]
-// write results to 'out': 64 samples, each run of 8 spaced by 'out_stride'
-// CLAMP results to 0..255
-typedef void (*stbi_YCbCr_to_RGB_run)(stbi_uc *output, stbi_uc const *y, stbi_uc const *cb, stbi_uc const *cr, int count, int step);
-// compute a conversion from YCbCr to RGB
-// 'count' pixels
-// write pixels to 'output'; each pixel is 'step' bytes (either 3 or 4; if 4, write '255' as 4th), order R,G,B
-// y: Y input channel
-// cb: Cb input channel; scale/biased to be 0..255
-// cr: Cr input channel; scale/biased to be 0..255
-
-extern void stbi_install_idct(stbi_idct_8x8 func);
-extern void stbi_install_YCbCr_to_RGB(stbi_YCbCr_to_RGB_run func);
-#endif // STBI_SIMD
-
-
-#ifdef __cplusplus
-}
-#endif
-
-//
-//
-//// end header file /////////////////////////////////////////////////////
-#endif // STBI_INCLUDE_STB_IMAGE_H
-
-#ifndef STBI_HEADER_FILE_ONLY
-
-#ifndef STBI_NO_HDR
-#include <math.h> // ldexp
-#include <string.h> // strcmp, strtok
-#endif
-
-#ifndef STBI_NO_STDIO
-#include <stdio.h>
-#endif
-#include <stdlib.h>
-#include <memory.h>
-#include <assert.h>
-#include <stdarg.h>
-
-#ifndef _MSC_VER
- #ifdef __cplusplus
- #define stbi_inline inline
- #else
- #define stbi_inline
- #endif
-#else
- #define stbi_inline __forceinline
-#endif
-
-
-// implementation:
-typedef unsigned char uint8;
-typedef unsigned short uint16;
-typedef signed short int16;
-typedef unsigned int uint32;
-typedef signed int int32;
-typedef unsigned int uint;
-
-// should produce compiler error if size is wrong
-typedef unsigned char validate_uint32[sizeof(uint32)==4 ? 1 : -1];
-
-#if defined(STBI_NO_STDIO) && !defined(STBI_NO_WRITE)
-#define STBI_NO_WRITE
-#endif
-
-#define STBI_NOTUSED(v) (void)sizeof(v)
-
-#ifdef _MSC_VER
-#define STBI_HAS_LROTL
-#endif
-
-#ifdef STBI_HAS_LROTL
- #define stbi_lrot(x,y) _lrotl(x,y)
-#else
- #define stbi_lrot(x,y) (((x) << (y)) | ((x) >> (32 - (y))))
-#endif
-
-///////////////////////////////////////////////
-//
-// stbi struct and start_xxx functions
-
-// stbi structure is our basic context used by all images, so it
-// contains all the IO context, plus some basic image information
-typedef struct
-{
- uint32 img_x, img_y;
- int img_n, img_out_n;
-
- stbi_io_callbacks io;
- void *io_user_data;
-
- int read_from_callbacks;
- int buflen;
- uint8 buffer_start[128];
-
- uint8 *img_buffer, *img_buffer_end;
- uint8 *img_buffer_original;
-} stbi;
-
-
-static void refill_buffer(stbi *s);
-
-// initialize a memory-decode context
-static void start_mem(stbi *s, uint8 const *buffer, int len)
-{
- s->io.read = NULL;
- s->read_from_callbacks = 0;
- s->img_buffer = s->img_buffer_original = (uint8 *) buffer;
- s->img_buffer_end = (uint8 *) buffer+len;
-}
-
-// initialize a callback-based context
-static void start_callbacks(stbi *s, stbi_io_callbacks *c, void *user)
-{
- s->io = *c;
- s->io_user_data = user;
- s->buflen = sizeof(s->buffer_start);
- s->read_from_callbacks = 1;
- s->img_buffer_original = s->buffer_start;
- refill_buffer(s);
-}
-
-#ifndef STBI_NO_STDIO
-
-static int stdio_read(void *user, char *data, int size)
-{
- return (int) fread(data,1,size,(FILE*) user);
-}
-
-static void stdio_skip(void *user, unsigned n)
-{
- fseek((FILE*) user, n, SEEK_CUR);
-}
-
-static int stdio_eof(void *user)
-{
- return feof((FILE*) user);
-}
-
-static stbi_io_callbacks stbi_stdio_callbacks =
-{
- stdio_read,
- stdio_skip,
- stdio_eof,
-};
-
-static void start_file(stbi *s, FILE *f)
-{
- start_callbacks(s, &stbi_stdio_callbacks, (void *) f);
-}
-
-//static void stop_file(stbi *s) { }
-
-#endif // !STBI_NO_STDIO
-
-static void stbi_rewind(stbi *s)
-{
- // conceptually rewind SHOULD rewind to the beginning of the stream,
- // but we just rewind to the beginning of the initial buffer, because
- // we only use it after doing 'test', which only ever looks at at most 92 bytes
- s->img_buffer = s->img_buffer_original;
-}
-
-static int stbi_jpeg_test(stbi *s);
-static stbi_uc *stbi_jpeg_load(stbi *s, int *x, int *y, int *comp, int req_comp);
-static int stbi_jpeg_info(stbi *s, int *x, int *y, int *comp);
-static int stbi_png_test(stbi *s);
-static stbi_uc *stbi_png_load(stbi *s, int *x, int *y, int *comp, int req_comp);
-static int stbi_png_info(stbi *s, int *x, int *y, int *comp);
-static int stbi_bmp_test(stbi *s);
-static stbi_uc *stbi_bmp_load(stbi *s, int *x, int *y, int *comp, int req_comp);
-static int stbi_tga_test(stbi *s);
-static stbi_uc *stbi_tga_load(stbi *s, int *x, int *y, int *comp, int req_comp);
-static int stbi_tga_info(stbi *s, int *x, int *y, int *comp);
-static int stbi_psd_test(stbi *s);
-static stbi_uc *stbi_psd_load(stbi *s, int *x, int *y, int *comp, int req_comp);
-static int stbi_hdr_test(stbi *s);
-static float *stbi_hdr_load(stbi *s, int *x, int *y, int *comp, int req_comp);
-static int stbi_pic_test(stbi *s);
-static stbi_uc *stbi_pic_load(stbi *s, int *x, int *y, int *comp, int req_comp);
-static int stbi_gif_test(stbi *s);
-static stbi_uc *stbi_gif_load(stbi *s, int *x, int *y, int *comp, int req_comp);
-static int stbi_gif_info(stbi *s, int *x, int *y, int *comp);
-
-
-// this is not threadsafe
-static const char *failure_reason;
-
-const char *stbi_failure_reason(void)
-{
- return failure_reason;
-}
-
-static int e(const char *str)
-{
- failure_reason = str;
- return 0;
-}
-
-// e - error
-// epf - error returning pointer to float
-// epuc - error returning pointer to unsigned char
-
-#ifdef STBI_NO_FAILURE_STRINGS
- #define e(x,y) 0
-#elif defined(STBI_FAILURE_USERMSG)
- #define e(x,y) e(y)
-#else
- #define e(x,y) e(x)
-#endif
-
-#define epf(x,y) ((float *) (e(x,y)?NULL:NULL))
-#define epuc(x,y) ((unsigned char *) (e(x,y)?NULL:NULL))
-
-void stbi_image_free(void *retval_from_stbi_load)
-{
- free(retval_from_stbi_load);
-}
-
-#ifndef STBI_NO_HDR
-static float *ldr_to_hdr(stbi_uc *data, int x, int y, int comp);
-static stbi_uc *hdr_to_ldr(float *data, int x, int y, int comp);
-#endif
-
-static unsigned char *stbi_load_main(stbi *s, int *x, int *y, int *comp, int req_comp)
-{
- if (stbi_jpeg_test(s)) return stbi_jpeg_load(s,x,y,comp,req_comp);
- if (stbi_png_test(s)) return stbi_png_load(s,x,y,comp,req_comp);
- if (stbi_bmp_test(s)) return stbi_bmp_load(s,x,y,comp,req_comp);
- if (stbi_gif_test(s)) return stbi_gif_load(s,x,y,comp,req_comp);
- if (stbi_psd_test(s)) return stbi_psd_load(s,x,y,comp,req_comp);
- if (stbi_pic_test(s)) return stbi_pic_load(s,x,y,comp,req_comp);
-
- #ifndef STBI_NO_HDR
- if (stbi_hdr_test(s)) {
- float *hdr = stbi_hdr_load(s, x,y,comp,req_comp);
- return hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp);
- }
- #endif
-
- // test tga last because it's a crappy test!
- if (stbi_tga_test(s))
- return stbi_tga_load(s,x,y,comp,req_comp);
- return epuc("unknown image type", "Image not of any known type, or corrupt");
-}
-
-#ifndef STBI_NO_STDIO
-unsigned char *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp)
-{
- FILE *f = fopen(filename, "rb");
- unsigned char *result;
- if (!f) return epuc("can't fopen", "Unable to open file");
- result = stbi_load_from_file(f,x,y,comp,req_comp);
- fclose(f);
- return result;
-}
-
-unsigned char *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)
-{
- stbi s;
- start_file(&s,f);
- return stbi_load_main(&s,x,y,comp,req_comp);
-}
-#endif //!STBI_NO_STDIO
-
-unsigned char *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
-{
- stbi s;
- start_mem(&s,buffer,len);
- return stbi_load_main(&s,x,y,comp,req_comp);
-}
-
-unsigned char *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
-{
- stbi s;
- start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
- return stbi_load_main(&s,x,y,comp,req_comp);
-}
-
-#ifndef STBI_NO_HDR
-
-float *stbi_loadf_main(stbi *s, int *x, int *y, int *comp, int req_comp)
-{
- unsigned char *data;
- #ifndef STBI_NO_HDR
- if (stbi_hdr_test(s))
- return stbi_hdr_load(s,x,y,comp,req_comp);
- #endif
- data = stbi_load_main(s, x, y, comp, req_comp);
- if (data)
- return ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp);
- return epf("unknown image type", "Image not of any known type, or corrupt");
-}
-
-float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
-{
- stbi s;
- start_mem(&s,buffer,len);
- return stbi_loadf_main(&s,x,y,comp,req_comp);
-}
-
-float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
-{
- stbi s;
- start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
- return stbi_loadf_main(&s,x,y,comp,req_comp);
-}
-
-#ifndef STBI_NO_STDIO
-float *stbi_loadf(char const *filename, int *x, int *y, int *comp, int req_comp)
-{
- FILE *f = fopen(filename, "rb");
- float *result;
- if (!f) return epf("can't fopen", "Unable to open file");
- result = stbi_loadf_from_file(f,x,y,comp,req_comp);
- fclose(f);
- return result;
-}
-
-float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)
-{
- stbi s;
- start_file(&s,f);
- return stbi_loadf_main(&s,x,y,comp,req_comp);
-}
-#endif // !STBI_NO_STDIO
-
-#endif // !STBI_NO_HDR
-
-// these is-hdr-or-not is defined independent of whether STBI_NO_HDR is
-// defined, for API simplicity; if STBI_NO_HDR is defined, it always
-// reports false!
-
-int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len)
-{
- #ifndef STBI_NO_HDR
- stbi s;
- start_mem(&s,buffer,len);
- return stbi_hdr_test(&s);
- #else
- STBI_NOTUSED(buffer);
- STBI_NOTUSED(len);
- return 0;
- #endif
-}
-
-#ifndef STBI_NO_STDIO
-extern int stbi_is_hdr (char const *filename)
-{
- FILE *f = fopen(filename, "rb");
- int result=0;
- if (f) {
- result = stbi_is_hdr_from_file(f);
- fclose(f);
- }
- return result;
-}
-
-extern int stbi_is_hdr_from_file(FILE *f)
-{
- #ifndef STBI_NO_HDR
- stbi s;
- start_file(&s,f);
- return stbi_hdr_test(&s);
- #else
- return 0;
- #endif
-}
-#endif // !STBI_NO_STDIO
-
-extern int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user)
-{
- #ifndef STBI_NO_HDR
- stbi s;
- start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
- return stbi_hdr_test(&s);
- #else
- return 0;
- #endif
-}
-
-#ifndef STBI_NO_HDR
-static float h2l_gamma_i=1.0f/2.2f, h2l_scale_i=1.0f;
-static float l2h_gamma=2.2f, l2h_scale=1.0f;
-
-void stbi_hdr_to_ldr_gamma(float gamma) { h2l_gamma_i = 1/gamma; }
-void stbi_hdr_to_ldr_scale(float scale) { h2l_scale_i = 1/scale; }
-
-void stbi_ldr_to_hdr_gamma(float gamma) { l2h_gamma = gamma; }
-void stbi_ldr_to_hdr_scale(float scale) { l2h_scale = scale; }
-#endif
-
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// Common code used by all image loaders
-//
-
-enum
-{
- SCAN_load=0,
- SCAN_type,
- SCAN_header
-};
-
-static void refill_buffer(stbi *s)
-{
- int n = (s->io.read)(s->io_user_data,(char*)s->buffer_start,s->buflen);
- if (n == 0) {
- // at end of file, treat same as if from memory
- s->read_from_callbacks = 0;
- s->img_buffer = s->img_buffer_end-1;
- *s->img_buffer = 0;
- } else {
- s->img_buffer = s->buffer_start;
- s->img_buffer_end = s->buffer_start + n;
- }
-}
-
-stbi_inline static int get8(stbi *s)
-{
- if (s->img_buffer < s->img_buffer_end)
- return *s->img_buffer++;
- if (s->read_from_callbacks) {
- refill_buffer(s);
- return *s->img_buffer++;
- }
- return 0;
-}
-
-stbi_inline static int at_eof(stbi *s)
-{
- if (s->io.read) {
- if (!(s->io.eof)(s->io_user_data)) return 0;
- // if feof() is true, check if buffer = end
- // special case: we've only got the special 0 character at the end
- if (s->read_from_callbacks == 0) return 1;
- }
-
- return s->img_buffer >= s->img_buffer_end;
-}
-
-stbi_inline static uint8 get8u(stbi *s)
-{
- return (uint8) get8(s);
-}
-
-static void skip(stbi *s, int n)
-{
- if (s->io.read) {
- int blen = s->img_buffer_end - s->img_buffer;
- if (blen < n) {
- s->img_buffer = s->img_buffer_end;
- (s->io.skip)(s->io_user_data, n - blen);
- return;
- }
- }
- s->img_buffer += n;
-}
-
-static int getn(stbi *s, stbi_uc *buffer, int n)
-{
- if (s->io.read) {
- int blen = s->img_buffer_end - s->img_buffer;
- if (blen < n) {
- int res, count;
-
- memcpy(buffer, s->img_buffer, blen);
-
- count = (s->io.read)(s->io_user_data, (char*) buffer + blen, n - blen);
- res = (count == (n-blen));
- s->img_buffer = s->img_buffer_end;
- return res;
- }
- }
-
- if (s->img_buffer+n <= s->img_buffer_end) {
- memcpy(buffer, s->img_buffer, n);
- s->img_buffer += n;
- return 1;
- } else
- return 0;
-}
-
-static int get16(stbi *s)
-{
- int z = get8(s);
- return (z << 8) + get8(s);
-}
-
-static uint32 get32(stbi *s)
-{
- uint32 z = get16(s);
- return (z << 16) + get16(s);
-}
-
-static int get16le(stbi *s)
-{
- int z = get8(s);
- return z + (get8(s) << 8);
-}
-
-static uint32 get32le(stbi *s)
-{
- uint32 z = get16le(s);
- return z + (get16le(s) << 16);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// generic converter from built-in img_n to req_comp
-// individual types do this automatically as much as possible (e.g. jpeg
-// does all cases internally since it needs to colorspace convert anyway,
-// and it never has alpha, so very few cases ). png can automatically
-// interleave an alpha=255 channel, but falls back to this for other cases
-//
-// assume data buffer is malloced, so malloc a new one and free that one
-// only failure mode is malloc failing
-
-static uint8 compute_y(int r, int g, int b)
-{
- return (uint8) (((r*77) + (g*150) + (29*b)) >> 8);
-}
-
-static unsigned char *convert_format(unsigned char *data, int img_n, int req_comp, uint x, uint y)
-{
- int i,j;
- unsigned char *good;
-
- if (req_comp == img_n) return data;
- assert(req_comp >= 1 && req_comp <= 4);
-
- good = (unsigned char *) malloc(req_comp * x * y);
- if (good == NULL) {
- free(data);
- return epuc("outofmem", "Out of memory");
- }
-
- for (j=0; j < (int) y; ++j) {
- unsigned char *src = data + j * x * img_n ;
- unsigned char *dest = good + j * x * req_comp;
-
- #define COMBO(a,b) ((a)*8+(b))
- #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
- // convert source image with img_n components to one with req_comp components;
- // avoid switch per pixel, so use switch per scanline and massive macros
- switch (COMBO(img_n, req_comp)) {
- CASE(1,2) dest[0]=src[0], dest[1]=255; break;
- CASE(1,3) dest[0]=dest[1]=dest[2]=src[0]; break;
- CASE(1,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; break;
- CASE(2,1) dest[0]=src[0]; break;
- CASE(2,3) dest[0]=dest[1]=dest[2]=src[0]; break;
- CASE(2,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; break;
- CASE(3,4) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; break;
- CASE(3,1) dest[0]=compute_y(src[0],src[1],src[2]); break;
- CASE(3,2) dest[0]=compute_y(src[0],src[1],src[2]), dest[1] = 255; break;
- CASE(4,1) dest[0]=compute_y(src[0],src[1],src[2]); break;
- CASE(4,2) dest[0]=compute_y(src[0],src[1],src[2]), dest[1] = src[3]; break;
- CASE(4,3) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; break;
- default: assert(0);
- }
- #undef CASE
- }
-
- free(data);
- return good;
-}
-
-#ifndef STBI_NO_HDR
-static float *ldr_to_hdr(stbi_uc *data, int x, int y, int comp)
-{
- int i,k,n;
- float *output = (float *) malloc(x * y * comp * sizeof(float));
- if (output == NULL) { free(data); return epf("outofmem", "Out of memory"); }
- // compute number of non-alpha components
- if (comp & 1) n = comp; else n = comp-1;
- for (i=0; i < x*y; ++i) {
- for (k=0; k < n; ++k) {
- output[i*comp + k] = (float) pow(data[i*comp+k]/255.0f, l2h_gamma) * l2h_scale;
- }
- if (k < comp) output[i*comp + k] = data[i*comp+k]/255.0f;
- }
- free(data);
- return output;
-}
-
-#define float2int(x) ((int) (x))
-static stbi_uc *hdr_to_ldr(float *data, int x, int y, int comp)
-{
- int i,k,n;
- stbi_uc *output = (stbi_uc *) malloc(x * y * comp);
- if (output == NULL) { free(data); return epuc("outofmem", "Out of memory"); }
- // compute number of non-alpha components
- if (comp & 1) n = comp; else n = comp-1;
- for (i=0; i < x*y; ++i) {
- for (k=0; k < n; ++k) {
- float z = (float) pow(data[i*comp+k]*h2l_scale_i, h2l_gamma_i) * 255 + 0.5f;
- if (z < 0) z = 0;
- if (z > 255) z = 255;
- output[i*comp + k] = (uint8) float2int(z);
- }
- if (k < comp) {
- float z = data[i*comp+k] * 255 + 0.5f;
- if (z < 0) z = 0;
- if (z > 255) z = 255;
- output[i*comp + k] = (uint8) float2int(z);
- }
- }
- free(data);
- return output;
-}
-#endif
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// "baseline" JPEG/JFIF decoder (not actually fully baseline implementation)
-//
-// simple implementation
-// - channel subsampling of at most 2 in each dimension
-// - doesn't support delayed output of y-dimension
-// - simple interface (only one output format: 8-bit interleaved RGB)
-// - doesn't try to recover corrupt jpegs
-// - doesn't allow partial loading, loading multiple at once
-// - still fast on x86 (copying globals into locals doesn't help x86)
-// - allocates lots of intermediate memory (full size of all components)
-// - non-interleaved case requires this anyway
-// - allows good upsampling (see next)
-// high-quality
-// - upsampled channels are bilinearly interpolated, even across blocks
-// - quality integer IDCT derived from IJG's 'slow'
-// performance
-// - fast huffman; reasonable integer IDCT
-// - uses a lot of intermediate memory, could cache poorly
-// - load http://nothings.org/remote/anemones.jpg 3 times on 2.8Ghz P4
-// stb_jpeg: 1.34 seconds (MSVC6, default release build)
-// stb_jpeg: 1.06 seconds (MSVC6, processor = Pentium Pro)
-// IJL11.dll: 1.08 seconds (compiled by intel)
-// IJG 1998: 0.98 seconds (MSVC6, makefile provided by IJG)
-// IJG 1998: 0.95 seconds (MSVC6, makefile + proc=PPro)
-
-// huffman decoding acceleration
-#define FAST_BITS 9 // larger handles more cases; smaller stomps less cache
-
-typedef struct
-{
- uint8 fast[1 << FAST_BITS];
- // weirdly, repacking this into AoS is a 10% speed loss, instead of a win
- uint16 code[256];
- uint8 values[256];
- uint8 size[257];
- unsigned int maxcode[18];
- int delta[17]; // old 'firstsymbol' - old 'firstcode'
-} huffman;
-
-typedef struct
-{
- #ifdef STBI_SIMD
- unsigned short dequant2[4][64];
- #endif
- stbi *s;
- huffman huff_dc[4];
- huffman huff_ac[4];
- uint8 dequant[4][64];
-
-// sizes for components, interleaved MCUs
- int img_h_max, img_v_max;
- int img_mcu_x, img_mcu_y;
- int img_mcu_w, img_mcu_h;
-
-// definition of jpeg image component
- struct
- {
- int id;
- int h,v;
- int tq;
- int hd,ha;
- int dc_pred;
-
- int x,y,w2,h2;
- uint8 *data;
- void *raw_data;
- uint8 *linebuf;
- } img_comp[4];
-
- uint32 code_buffer; // jpeg entropy-coded buffer
- int code_bits; // number of valid bits
- unsigned char marker; // marker seen while filling entropy buffer
- int nomore; // flag if we saw a marker so must stop
-
- int scan_n, order[4];
- int restart_interval, todo;
-} jpeg;
-
-static int build_huffman(huffman *h, int *count)
-{
- int i,j,k=0,code;
- // build size list for each symbol (from JPEG spec)
- for (i=0; i < 16; ++i)
- for (j=0; j < count[i]; ++j)
- h->size[k++] = (uint8) (i+1);
- h->size[k] = 0;
-
- // compute actual symbols (from jpeg spec)
- code = 0;
- k = 0;
- for(j=1; j <= 16; ++j) {
- // compute delta to add to code to compute symbol id
- h->delta[j] = k - code;
- if (h->size[k] == j) {
- while (h->size[k] == j)
- h->code[k++] = (uint16) (code++);
- if (code-1 >= (1 << j)) return e("bad code lengths","Corrupt JPEG");
- }
- // compute largest code + 1 for this size, preshifted as needed later
- h->maxcode[j] = code << (16-j);
- code <<= 1;
- }
- h->maxcode[j] = 0xffffffff;
-
- // build non-spec acceleration table; 255 is flag for not-accelerated
- memset(h->fast, 255, 1 << FAST_BITS);
- for (i=0; i < k; ++i) {
- int s = h->size[i];
- if (s <= FAST_BITS) {
- int c = h->code[i] << (FAST_BITS-s);
- int m = 1 << (FAST_BITS-s);
- for (j=0; j < m; ++j) {
- h->fast[c+j] = (uint8) i;
- }
- }
- }
- return 1;
-}
-
-static void grow_buffer_unsafe(jpeg *j)
-{
- do {
- int b = j->nomore ? 0 : get8(j->s);
- if (b == 0xff) {
- int c = get8(j->s);
- if (c != 0) {
- j->marker = (unsigned char) c;
- j->nomore = 1;
- return;
- }
- }
- j->code_buffer |= b << (24 - j->code_bits);
- j->code_bits += 8;
- } while (j->code_bits <= 24);
-}
-
-// (1 << n) - 1
-static uint32 bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535};
-
-// decode a jpeg huffman value from the bitstream
-stbi_inline static int decode(jpeg *j, huffman *h)
-{
- unsigned int temp;
- int c,k;
-
- if (j->code_bits < 16) grow_buffer_unsafe(j);
-
- // look at the top FAST_BITS and determine what symbol ID it is,
- // if the code is <= FAST_BITS
- c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
- k = h->fast[c];
- if (k < 255) {
- int s = h->size[k];
- if (s > j->code_bits)
- return -1;
- j->code_buffer <<= s;
- j->code_bits -= s;
- return h->values[k];
- }
-
- // naive test is to shift the code_buffer down so k bits are
- // valid, then test against maxcode. To speed this up, we've
- // preshifted maxcode left so that it has (16-k) 0s at the
- // end; in other words, regardless of the number of bits, it
- // wants to be compared against something shifted to have 16;
- // that way we don't need to shift inside the loop.
- temp = j->code_buffer >> 16;
- for (k=FAST_BITS+1 ; ; ++k)
- if (temp < h->maxcode[k])
- break;
- if (k == 17) {
- // error! code not found
- j->code_bits -= 16;
- return -1;
- }
-
- if (k > j->code_bits)
- return -1;
-
- // convert the huffman code to the symbol id
- c = ((j->code_buffer >> (32 - k)) & bmask[k]) + h->delta[k];
- assert((((j->code_buffer) >> (32 - h->size[c])) & bmask[h->size[c]]) == h->code[c]);
-
- // convert the id to a symbol
- j->code_bits -= k;
- j->code_buffer <<= k;
- return h->values[c];
-}
-
-// combined JPEG 'receive' and JPEG 'extend', since baseline
-// always extends everything it receives.
-stbi_inline static int extend_receive(jpeg *j, int n)
-{
- unsigned int m = 1 << (n-1);
- unsigned int k;
- if (j->code_bits < n) grow_buffer_unsafe(j);
-
- #if 1
- k = stbi_lrot(j->code_buffer, n);
- j->code_buffer = k & ~bmask[n];
- k &= bmask[n];
- j->code_bits -= n;
- #else
- k = (j->code_buffer >> (32 - n)) & bmask[n];
- j->code_bits -= n;
- j->code_buffer <<= n;
- #endif
- // the following test is probably a random branch that won't
- // predict well. I tried to table accelerate it but failed.
- // maybe it's compiling as a conditional move?
- if (k < m)
- return (-1 << n) + k + 1;
- else
- return k;
-}
-
-// given a value that's at position X in the zigzag stream,
-// where does it appear in the 8x8 matrix coded as row-major?
-static uint8 dezigzag[64+15] =
-{
- 0, 1, 8, 16, 9, 2, 3, 10,
- 17, 24, 32, 25, 18, 11, 4, 5,
- 12, 19, 26, 33, 40, 48, 41, 34,
- 27, 20, 13, 6, 7, 14, 21, 28,
- 35, 42, 49, 56, 57, 50, 43, 36,
- 29, 22, 15, 23, 30, 37, 44, 51,
- 58, 59, 52, 45, 38, 31, 39, 46,
- 53, 60, 61, 54, 47, 55, 62, 63,
- // let corrupt input sample past end
- 63, 63, 63, 63, 63, 63, 63, 63,
- 63, 63, 63, 63, 63, 63, 63
-};
-
-// decode one 64-entry block--
-static int decode_block(jpeg *j, short data[64], huffman *hdc, huffman *hac, int b)
-{
- int diff,dc,k;
- int t = decode(j, hdc);
- if (t < 0) return e("bad huffman code","Corrupt JPEG");
-
- // 0 all the ac values now so we can do it 32-bits at a time
- memset(data,0,64*sizeof(data[0]));
-
- diff = t ? extend_receive(j, t) : 0;
- dc = j->img_comp[b].dc_pred + diff;
- j->img_comp[b].dc_pred = dc;
- data[0] = (short) dc;
-
- // decode AC components, see JPEG spec
- k = 1;
- do {
- int r,s;
- int rs = decode(j, hac);
- if (rs < 0) return e("bad huffman code","Corrupt JPEG");
- s = rs & 15;
- r = rs >> 4;
- if (s == 0) {
- if (rs != 0xf0) break; // end block
- k += 16;
- } else {
- k += r;
- // decode into unzigzag'd location
- data[dezigzag[k++]] = (short) extend_receive(j,s);
- }
- } while (k < 64);
- return 1;
-}
-
-// take a -128..127 value and clamp it and convert to 0..255
-stbi_inline static uint8 clamp(int x)
-{
- // trick to use a single test to catch both cases
- if ((unsigned int) x > 255) {
- if (x < 0) return 0;
- if (x > 255) return 255;
- }
- return (uint8) x;
-}
-
-#define f2f(x) (int) (((x) * 4096 + 0.5))
-#define fsh(x) ((x) << 12)
-
-// derived from jidctint -- DCT_ISLOW
-#define IDCT_1D(s0,s1,s2,s3,s4,s5,s6,s7) \
- int t0,t1,t2,t3,p1,p2,p3,p4,p5,x0,x1,x2,x3; \
- p2 = s2; \
- p3 = s6; \
- p1 = (p2+p3) * f2f(0.5411961f); \
- t2 = p1 + p3*f2f(-1.847759065f); \
- t3 = p1 + p2*f2f( 0.765366865f); \
- p2 = s0; \
- p3 = s4; \
- t0 = fsh(p2+p3); \
- t1 = fsh(p2-p3); \
- x0 = t0+t3; \
- x3 = t0-t3; \
- x1 = t1+t2; \
- x2 = t1-t2; \
- t0 = s7; \
- t1 = s5; \
- t2 = s3; \
- t3 = s1; \
- p3 = t0+t2; \
- p4 = t1+t3; \
- p1 = t0+t3; \
- p2 = t1+t2; \
- p5 = (p3+p4)*f2f( 1.175875602f); \
- t0 = t0*f2f( 0.298631336f); \
- t1 = t1*f2f( 2.053119869f); \
- t2 = t2*f2f( 3.072711026f); \
- t3 = t3*f2f( 1.501321110f); \
- p1 = p5 + p1*f2f(-0.899976223f); \
- p2 = p5 + p2*f2f(-2.562915447f); \
- p3 = p3*f2f(-1.961570560f); \
- p4 = p4*f2f(-0.390180644f); \
- t3 += p1+p4; \
- t2 += p2+p3; \
- t1 += p2+p4; \
- t0 += p1+p3;
-
-#ifdef STBI_SIMD
-typedef unsigned short stbi_dequantize_t;
-#else
-typedef uint8 stbi_dequantize_t;
-#endif
-
-// .344 seconds on 3*anemones.jpg
-static void idct_block(uint8 *out, int out_stride, short data[64], stbi_dequantize_t *dequantize)
-{
- int i,val[64],*v=val;
- stbi_dequantize_t *dq = dequantize;
- uint8 *o;
- short *d = data;
-
- // columns
- for (i=0; i < 8; ++i,++d,++dq, ++v) {
- // if all zeroes, shortcut -- this avoids dequantizing 0s and IDCTing
- if (d[ 8]==0 && d[16]==0 && d[24]==0 && d[32]==0
- && d[40]==0 && d[48]==0 && d[56]==0) {
- // no shortcut 0 seconds
- // (1|2|3|4|5|6|7)==0 0 seconds
- // all separate -0.047 seconds
- // 1 && 2|3 && 4|5 && 6|7: -0.047 seconds
- int dcterm = d[0] * dq[0] << 2;
- v[0] = v[8] = v[16] = v[24] = v[32] = v[40] = v[48] = v[56] = dcterm;
- } else {
- IDCT_1D(d[ 0]*dq[ 0],d[ 8]*dq[ 8],d[16]*dq[16],d[24]*dq[24],
- d[32]*dq[32],d[40]*dq[40],d[48]*dq[48],d[56]*dq[56])
- // constants scaled things up by 1<<12; let's bring them back
- // down, but keep 2 extra bits of precision
- x0 += 512; x1 += 512; x2 += 512; x3 += 512;
- v[ 0] = (x0+t3) >> 10;
- v[56] = (x0-t3) >> 10;
- v[ 8] = (x1+t2) >> 10;
- v[48] = (x1-t2) >> 10;
- v[16] = (x2+t1) >> 10;
- v[40] = (x2-t1) >> 10;
- v[24] = (x3+t0) >> 10;
- v[32] = (x3-t0) >> 10;
- }
- }
-
- for (i=0, v=val, o=out; i < 8; ++i,v+=8,o+=out_stride) {
- // no fast case since the first 1D IDCT spread components out
- IDCT_1D(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7])
- // constants scaled things up by 1<<12, plus we had 1<<2 from first
- // loop, plus horizontal and vertical each scale by sqrt(8) so together
- // we've got an extra 1<<3, so 1<<17 total we need to remove.
- // so we want to round that, which means adding 0.5 * 1<<17,
- // aka 65536. Also, we'll end up with -128 to 127 that we want
- // to encode as 0..255 by adding 128, so we'll add that before the shift
- x0 += 65536 + (128<<17);
- x1 += 65536 + (128<<17);
- x2 += 65536 + (128<<17);
- x3 += 65536 + (128<<17);
- // tried computing the shifts into temps, or'ing the temps to see
- // if any were out of range, but that was slower
- o[0] = clamp((x0+t3) >> 17);
- o[7] = clamp((x0-t3) >> 17);
- o[1] = clamp((x1+t2) >> 17);
- o[6] = clamp((x1-t2) >> 17);
- o[2] = clamp((x2+t1) >> 17);
- o[5] = clamp((x2-t1) >> 17);
- o[3] = clamp((x3+t0) >> 17);
- o[4] = clamp((x3-t0) >> 17);
- }
-}
-
-#ifdef STBI_SIMD
-static stbi_idct_8x8 stbi_idct_installed = idct_block;
-
-void stbi_install_idct(stbi_idct_8x8 func)
-{
- stbi_idct_installed = func;
-}
-#endif
-
-#define MARKER_none 0xff
-// if there's a pending marker from the entropy stream, return that
-// otherwise, fetch from the stream and get a marker. if there's no
-// marker, return 0xff, which is never a valid marker value
-static uint8 get_marker(jpeg *j)
-{
- uint8 x;
- if (j->marker != MARKER_none) { x = j->marker; j->marker = MARKER_none; return x; }
- x = get8u(j->s);
- if (x != 0xff) return MARKER_none;
- while (x == 0xff)
- x = get8u(j->s);
- return x;
-}
-
-// in each scan, we'll have scan_n components, and the order
-// of the components is specified by order[]
-#define RESTART(x) ((x) >= 0xd0 && (x) <= 0xd7)
-
-// after a restart interval, reset the entropy decoder and
-// the dc prediction
-static void reset(jpeg *j)
-{
- j->code_bits = 0;
- j->code_buffer = 0;
- j->nomore = 0;
- j->img_comp[0].dc_pred = j->img_comp[1].dc_pred = j->img_comp[2].dc_pred = 0;
- j->marker = MARKER_none;
- j->todo = j->restart_interval ? j->restart_interval : 0x7fffffff;
- // no more than 1<<31 MCUs if no restart_interal? that's plenty safe,
- // since we don't even allow 1<<30 pixels
-}
-
-static int parse_entropy_coded_data(jpeg *z)
-{
- reset(z);
- if (z->scan_n == 1) {
- int i,j;
- #ifdef STBI_SIMD
- __declspec(align(16))
- #endif
- short data[64];
- int n = z->order[0];
- // non-interleaved data, we just need to process one block at a time,
- // in trivial scanline order
- // number of blocks to do just depends on how many actual "pixels" this
- // component has, independent of interleaved MCU blocking and such
- int w = (z->img_comp[n].x+7) >> 3;
- int h = (z->img_comp[n].y+7) >> 3;
- for (j=0; j < h; ++j) {
- for (i=0; i < w; ++i) {
- if (!decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+z->img_comp[n].ha, n)) return 0;
- #ifdef STBI_SIMD
- stbi_idct_installed(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data, z->dequant2[z->img_comp[n].tq]);
- #else
- idct_block(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data, z->dequant[z->img_comp[n].tq]);
- #endif
- // every data block is an MCU, so countdown the restart interval
- if (--z->todo <= 0) {
- if (z->code_bits < 24) grow_buffer_unsafe(z);
- // if it's NOT a restart, then just bail, so we get corrupt data
- // rather than no data
- if (!RESTART(z->marker)) return 1;
- reset(z);
- }
- }
- }
- } else { // interleaved!
- int i,j,k,x,y;
- short data[64];
- for (j=0; j < z->img_mcu_y; ++j) {
- for (i=0; i < z->img_mcu_x; ++i) {
- // scan an interleaved mcu... process scan_n components in order
- for (k=0; k < z->scan_n; ++k) {
- int n = z->order[k];
- // scan out an mcu's worth of this component; that's just determined
- // by the basic H and V specified for the component
- for (y=0; y < z->img_comp[n].v; ++y) {
- for (x=0; x < z->img_comp[n].h; ++x) {
- int x2 = (i*z->img_comp[n].h + x)*8;
- int y2 = (j*z->img_comp[n].v + y)*8;
- if (!decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+z->img_comp[n].ha, n)) return 0;
- #ifdef STBI_SIMD
- stbi_idct_installed(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data, z->dequant2[z->img_comp[n].tq]);
- #else
- idct_block(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data, z->dequant[z->img_comp[n].tq]);
- #endif
- }
- }
- }
- // after all interleaved components, that's an interleaved MCU,
- // so now count down the restart interval
- if (--z->todo <= 0) {
- if (z->code_bits < 24) grow_buffer_unsafe(z);
- // if it's NOT a restart, then just bail, so we get corrupt data
- // rather than no data
- if (!RESTART(z->marker)) return 1;
- reset(z);
- }
- }
- }
- }
- return 1;
-}
-
-static int process_marker(jpeg *z, int m)
-{
- int L;
- switch (m) {
- case MARKER_none: // no marker found
- return e("expected marker","Corrupt JPEG");
-
- case 0xC2: // SOF - progressive
- return e("progressive jpeg","JPEG format not supported (progressive)");
-
- case 0xDD: // DRI - specify restart interval
- if (get16(z->s) != 4) return e("bad DRI len","Corrupt JPEG");
- z->restart_interval = get16(z->s);
- return 1;
-
- case 0xDB: // DQT - define quantization table
- L = get16(z->s)-2;
- while (L > 0) {
- int q = get8(z->s);
- int p = q >> 4;
- int t = q & 15,i;
- if (p != 0) return e("bad DQT type","Corrupt JPEG");
- if (t > 3) return e("bad DQT table","Corrupt JPEG");
- for (i=0; i < 64; ++i)
- z->dequant[t][dezigzag[i]] = get8u(z->s);
- #ifdef STBI_SIMD
- for (i=0; i < 64; ++i)
- z->dequant2[t][i] = z->dequant[t][i];
- #endif
- L -= 65;
- }
- return L==0;
-
- case 0xC4: // DHT - define huffman table
- L = get16(z->s)-2;
- while (L > 0) {
- uint8 *v;
- int sizes[16],i,m=0;
- int q = get8(z->s);
- int tc = q >> 4;
- int th = q & 15;
- if (tc > 1 || th > 3) return e("bad DHT header","Corrupt JPEG");
- for (i=0; i < 16; ++i) {
- sizes[i] = get8(z->s);
- m += sizes[i];
- }
- L -= 17;
- if (tc == 0) {
- if (!build_huffman(z->huff_dc+th, sizes)) return 0;
- v = z->huff_dc[th].values;
- } else {
- if (!build_huffman(z->huff_ac+th, sizes)) return 0;
- v = z->huff_ac[th].values;
- }
- for (i=0; i < m; ++i)
- v[i] = get8u(z->s);
- L -= m;
- }
- return L==0;
- }
- // check for comment block or APP blocks
- if ((m >= 0xE0 && m <= 0xEF) || m == 0xFE) {
- skip(z->s, get16(z->s)-2);
- return 1;
- }
- return 0;
-}
-
-// after we see SOS
-static int process_scan_header(jpeg *z)
-{
- int i;
- int Ls = get16(z->s);
- z->scan_n = get8(z->s);
- if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s->img_n) return e("bad SOS component count","Corrupt JPEG");
- if (Ls != 6+2*z->scan_n) return e("bad SOS len","Corrupt JPEG");
- for (i=0; i < z->scan_n; ++i) {
- int id = get8(z->s), which;
- int q = get8(z->s);
- for (which = 0; which < z->s->img_n; ++which)
- if (z->img_comp[which].id == id)
- break;
- if (which == z->s->img_n) return 0;
- z->img_comp[which].hd = q >> 4; if (z->img_comp[which].hd > 3) return e("bad DC huff","Corrupt JPEG");
- z->img_comp[which].ha = q & 15; if (z->img_comp[which].ha > 3) return e("bad AC huff","Corrupt JPEG");
- z->order[i] = which;
- }
- if (get8(z->s) != 0) return e("bad SOS","Corrupt JPEG");
- get8(z->s); // should be 63, but might be 0
- if (get8(z->s) != 0) return e("bad SOS","Corrupt JPEG");
-
- return 1;
-}
-
-static int process_frame_header(jpeg *z, int scan)
-{
- stbi *s = z->s;
- int Lf,p,i,q, h_max=1,v_max=1,c;
- Lf = get16(s); if (Lf < 11) return e("bad SOF len","Corrupt JPEG"); // JPEG
- p = get8(s); if (p != 8) return e("only 8-bit","JPEG format not supported: 8-bit only"); // JPEG baseline
- s->img_y = get16(s); if (s->img_y == 0) return e("no header height", "JPEG format not supported: delayed height"); // Legal, but we don't handle it--but neither does IJG
- s->img_x = get16(s); if (s->img_x == 0) return e("0 width","Corrupt JPEG"); // JPEG requires
- c = get8(s);
- if (c != 3 && c != 1) return e("bad component count","Corrupt JPEG"); // JFIF requires
- s->img_n = c;
- for (i=0; i < c; ++i) {
- z->img_comp[i].data = NULL;
- z->img_comp[i].linebuf = NULL;
- }
-
- if (Lf != 8+3*s->img_n) return e("bad SOF len","Corrupt JPEG");
-
- for (i=0; i < s->img_n; ++i) {
- z->img_comp[i].id = get8(s);
- if (z->img_comp[i].id != i+1) // JFIF requires
- if (z->img_comp[i].id != i) // some version of jpegtran outputs non-JFIF-compliant files!
- return e("bad component ID","Corrupt JPEG");
- q = get8(s);
- z->img_comp[i].h = (q >> 4); if (!z->img_comp[i].h || z->img_comp[i].h > 4) return e("bad H","Corrupt JPEG");
- z->img_comp[i].v = q & 15; if (!z->img_comp[i].v || z->img_comp[i].v > 4) return e("bad V","Corrupt JPEG");
- z->img_comp[i].tq = get8(s); if (z->img_comp[i].tq > 3) return e("bad TQ","Corrupt JPEG");
- }
-
- if (scan != SCAN_load) return 1;
-
- if ((1 << 30) / s->img_x / s->img_n < s->img_y) return e("too large", "Image too large to decode");
-
- for (i=0; i < s->img_n; ++i) {
- if (z->img_comp[i].h > h_max) h_max = z->img_comp[i].h;
- if (z->img_comp[i].v > v_max) v_max = z->img_comp[i].v;
- }
-
- // compute interleaved mcu info
- z->img_h_max = h_max;
- z->img_v_max = v_max;
- z->img_mcu_w = h_max * 8;
- z->img_mcu_h = v_max * 8;
- z->img_mcu_x = (s->img_x + z->img_mcu_w-1) / z->img_mcu_w;
- z->img_mcu_y = (s->img_y + z->img_mcu_h-1) / z->img_mcu_h;
-
- for (i=0; i < s->img_n; ++i) {
- // number of effective pixels (e.g. for non-interleaved MCU)
- z->img_comp[i].x = (s->img_x * z->img_comp[i].h + h_max-1) / h_max;
- z->img_comp[i].y = (s->img_y * z->img_comp[i].v + v_max-1) / v_max;
- // to simplify generation, we'll allocate enough memory to decode
- // the bogus oversized data from using interleaved MCUs and their
- // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't
- // discard the extra data until colorspace conversion
- z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8;
- z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8;
- z->img_comp[i].raw_data = malloc(z->img_comp[i].w2 * z->img_comp[i].h2+15);
- if (z->img_comp[i].raw_data == NULL) {
- for(--i; i >= 0; --i) {
- free(z->img_comp[i].raw_data);
- z->img_comp[i].data = NULL;
- }
- return e("outofmem", "Out of memory");
- }
- // align blocks for installable-idct using mmx/sse
- z->img_comp[i].data = (uint8*) (((size_t) z->img_comp[i].raw_data + 15) & ~15);
- z->img_comp[i].linebuf = NULL;
- }
-
- return 1;
-}
-
-// use comparisons since in some cases we handle more than one case (e.g. SOF)
-#define DNL(x) ((x) == 0xdc)
-#define SOI(x) ((x) == 0xd8)
-#define EOI(x) ((x) == 0xd9)
-#define SOF(x) ((x) == 0xc0 || (x) == 0xc1)
-#define SOS(x) ((x) == 0xda)
-
-static int decode_jpeg_header(jpeg *z, int scan)
-{
- int m;
- z->marker = MARKER_none; // initialize cached marker to empty
- m = get_marker(z);
- if (!SOI(m)) return e("no SOI","Corrupt JPEG");
- if (scan == SCAN_type) return 1;
- m = get_marker(z);
- while (!SOF(m)) {
- if (!process_marker(z,m)) return 0;
- m = get_marker(z);
- while (m == MARKER_none) {
- // some files have extra padding after their blocks, so ok, we'll scan
- if (at_eof(z->s)) return e("no SOF", "Corrupt JPEG");
- m = get_marker(z);
- }
- }
- if (!process_frame_header(z, scan)) return 0;
- return 1;
-}
-
-static int decode_jpeg_image(jpeg *j)
-{
- int m;
- j->restart_interval = 0;
- if (!decode_jpeg_header(j, SCAN_load)) return 0;
- m = get_marker(j);
- while (!EOI(m)) {
- if (SOS(m)) {
- if (!process_scan_header(j)) return 0;
- if (!parse_entropy_coded_data(j)) return 0;
- if (j->marker == MARKER_none ) {
- // handle 0s at the end of image data from IP Kamera 9060
- while (!at_eof(j->s)) {
- int x = get8(j->s);
- if (x == 255) {
- j->marker = get8u(j->s);
- break;
- } else if (x != 0) {
- return 0;
- }
- }
- // if we reach eof without hitting a marker, get_marker() below will fail and we'll eventually return 0
- }
- } else {
- if (!process_marker(j, m)) return 0;
- }
- m = get_marker(j);
- }
- return 1;
-}
-
-// static jfif-centered resampling (across block boundaries)
-
-typedef uint8 *(*resample_row_func)(uint8 *out, uint8 *in0, uint8 *in1,
- int w, int hs);
-
-#define div4(x) ((uint8) ((x) >> 2))
-
-static uint8 *resample_row_1(uint8 *out, uint8 *in_near, uint8 *in_far, int w, int hs)
-{
- STBI_NOTUSED(out);
- STBI_NOTUSED(in_far);
- STBI_NOTUSED(w);
- STBI_NOTUSED(hs);
- return in_near;
-}
-
-static uint8* resample_row_v_2(uint8 *out, uint8 *in_near, uint8 *in_far, int w, int hs)
-{
- // need to generate two samples vertically for every one in input
- int i;
- STBI_NOTUSED(hs);
- for (i=0; i < w; ++i)
- out[i] = div4(3*in_near[i] + in_far[i] + 2);
- return out;
-}
-
-static uint8* resample_row_h_2(uint8 *out, uint8 *in_near, uint8 *in_far, int w, int hs)
-{
- // need to generate two samples horizontally for every one in input
- int i;
- uint8 *input = in_near;
-
- if (w == 1) {
- // if only one sample, can't do any interpolation
- out[0] = out[1] = input[0];
- return out;
- }
-
- out[0] = input[0];
- out[1] = div4(input[0]*3 + input[1] + 2);
- for (i=1; i < w-1; ++i) {
- int n = 3*input[i]+2;
- out[i*2+0] = div4(n+input[i-1]);
- out[i*2+1] = div4(n+input[i+1]);
- }
- out[i*2+0] = div4(input[w-2]*3 + input[w-1] + 2);
- out[i*2+1] = input[w-1];
-
- STBI_NOTUSED(in_far);
- STBI_NOTUSED(hs);
-
- return out;
-}
-
-#define div16(x) ((uint8) ((x) >> 4))
-
-static uint8 *resample_row_hv_2(uint8 *out, uint8 *in_near, uint8 *in_far, int w, int hs)
-{
- // need to generate 2x2 samples for every one in input
- int i,t0,t1;
- if (w == 1) {
- out[0] = out[1] = div4(3*in_near[0] + in_far[0] + 2);
- return out;
- }
-
- t1 = 3*in_near[0] + in_far[0];
- out[0] = div4(t1+2);
- for (i=1; i < w; ++i) {
- t0 = t1;
- t1 = 3*in_near[i]+in_far[i];
- out[i*2-1] = div16(3*t0 + t1 + 8);
- out[i*2 ] = div16(3*t1 + t0 + 8);
- }
- out[w*2-1] = div4(t1+2);
-
- STBI_NOTUSED(hs);
-
- return out;
-}
-
-static uint8 *resample_row_generic(uint8 *out, uint8 *in_near, uint8 *in_far, int w, int hs)
-{
- // resample with nearest-neighbor
- int i,j;
- in_far = in_far;
- for (i=0; i < w; ++i)
- for (j=0; j < hs; ++j)
- out[i*hs+j] = in_near[i];
- return out;
-}
-
-#define float2fixed(x) ((int) ((x) * 65536 + 0.5))
-
-// 0.38 seconds on 3*anemones.jpg (0.25 with processor = Pro)
-// VC6 without processor=Pro is generating multiple LEAs per multiply!
-static void YCbCr_to_RGB_row(uint8 *out, const uint8 *y, const uint8 *pcb, const uint8 *pcr, int count, int step)
-{
- int i;
- for (i=0; i < count; ++i) {
- int y_fixed = (y[i] << 16) + 32768; // rounding
- int r,g,b;
- int cr = pcr[i] - 128;
- int cb = pcb[i] - 128;
- r = y_fixed + cr*float2fixed(1.40200f);
- g = y_fixed - cr*float2fixed(0.71414f) - cb*float2fixed(0.34414f);
- b = y_fixed + cb*float2fixed(1.77200f);
- r >>= 16;
- g >>= 16;
- b >>= 16;
- if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }
- if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }
- if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }
- out[0] = (uint8)r;
- out[1] = (uint8)g;
- out[2] = (uint8)b;
- out[3] = 255;
- out += step;
- }
-}
-
-#ifdef STBI_SIMD
-static stbi_YCbCr_to_RGB_run stbi_YCbCr_installed = YCbCr_to_RGB_row;
-
-void stbi_install_YCbCr_to_RGB(stbi_YCbCr_to_RGB_run func)
-{
- stbi_YCbCr_installed = func;
-}
-#endif
-
-
-// clean up the temporary component buffers
-static void cleanup_jpeg(jpeg *j)
-{
- int i;
- for (i=0; i < j->s->img_n; ++i) {
- if (j->img_comp[i].data) {
- free(j->img_comp[i].raw_data);
- j->img_comp[i].data = NULL;
- }
- if (j->img_comp[i].linebuf) {
- free(j->img_comp[i].linebuf);
- j->img_comp[i].linebuf = NULL;
- }
- }
-}
-
-typedef struct
-{
- resample_row_func resample;
- uint8 *line0,*line1;
- int hs,vs; // expansion factor in each axis
- int w_lores; // horizontal pixels pre-expansion
- int ystep; // how far through vertical expansion we are
- int ypos; // which pre-expansion row we're on
-} stbi_resample;
-
-static uint8 *load_jpeg_image(jpeg *z, int *out_x, int *out_y, int *comp, int req_comp)
-{
- int n, decode_n;
- // validate req_comp
- if (req_comp < 0 || req_comp > 4) return epuc("bad req_comp", "Internal error");
- z->s->img_n = 0;
-
- // load a jpeg image from whichever source
- if (!decode_jpeg_image(z)) { cleanup_jpeg(z); return NULL; }
-
- // determine actual number of components to generate
- n = req_comp ? req_comp : z->s->img_n;
-
- if (z->s->img_n == 3 && n < 3)
- decode_n = 1;
- else
- decode_n = z->s->img_n;
-
- // resample and color-convert
- {
- int k;
- uint i,j;
- uint8 *output;
- uint8 *coutput[4];
-
- stbi_resample res_comp[4];
-
- for (k=0; k < decode_n; ++k) {
- stbi_resample *r = &res_comp[k];
-
- // allocate line buffer big enough for upsampling off the edges
- // with upsample factor of 4
- z->img_comp[k].linebuf = (uint8 *) malloc(z->s->img_x + 3);
- if (!z->img_comp[k].linebuf) { cleanup_jpeg(z); return epuc("outofmem", "Out of memory"); }
-
- r->hs = z->img_h_max / z->img_comp[k].h;
- r->vs = z->img_v_max / z->img_comp[k].v;
- r->ystep = r->vs >> 1;
- r->w_lores = (z->s->img_x + r->hs-1) / r->hs;
- r->ypos = 0;
- r->line0 = r->line1 = z->img_comp[k].data;
-
- if (r->hs == 1 && r->vs == 1) r->resample = resample_row_1;
- else if (r->hs == 1 && r->vs == 2) r->resample = resample_row_v_2;
- else if (r->hs == 2 && r->vs == 1) r->resample = resample_row_h_2;
- else if (r->hs == 2 && r->vs == 2) r->resample = resample_row_hv_2;
- else r->resample = resample_row_generic;
- }
-
- // can't error after this so, this is safe
- output = (uint8 *) malloc(n * z->s->img_x * z->s->img_y + 1);
- if (!output) { cleanup_jpeg(z); return epuc("outofmem", "Out of memory"); }
-
- // now go ahead and resample
- for (j=0; j < z->s->img_y; ++j) {
- uint8 *out = output + n * z->s->img_x * j;
- for (k=0; k < decode_n; ++k) {
- stbi_resample *r = &res_comp[k];
- int y_bot = r->ystep >= (r->vs >> 1);
- coutput[k] = r->resample(z->img_comp[k].linebuf,
- y_bot ? r->line1 : r->line0,
- y_bot ? r->line0 : r->line1,
- r->w_lores, r->hs);
- if (++r->ystep >= r->vs) {
- r->ystep = 0;
- r->line0 = r->line1;
- if (++r->ypos < z->img_comp[k].y)
- r->line1 += z->img_comp[k].w2;
- }
- }
- if (n >= 3) {
- uint8 *y = coutput[0];
- if (z->s->img_n == 3) {
- #ifdef STBI_SIMD
- stbi_YCbCr_installed(out, y, coutput[1], coutput[2], z->s.img_x, n);
- #else
- YCbCr_to_RGB_row(out, y, coutput[1], coutput[2], z->s->img_x, n);
- #endif
- } else
- for (i=0; i < z->s->img_x; ++i) {
- out[0] = out[1] = out[2] = y[i];
- out[3] = 255; // not used if n==3
- out += n;
- }
- } else {
- uint8 *y = coutput[0];
- if (n == 1)
- for (i=0; i < z->s->img_x; ++i) out[i] = y[i];
- else
- for (i=0; i < z->s->img_x; ++i) *out++ = y[i], *out++ = 255;
- }
- }
- cleanup_jpeg(z);
- *out_x = z->s->img_x;
- *out_y = z->s->img_y;
- if (comp) *comp = z->s->img_n; // report original components, not output
- return output;
- }
-}
-
-static unsigned char *stbi_jpeg_load(stbi *s, int *x, int *y, int *comp, int req_comp)
-{
- jpeg j;
- j.s = s;
- return load_jpeg_image(&j, x,y,comp,req_comp);
-}
-
-static int stbi_jpeg_test(stbi *s)
-{
- int r;
- jpeg j;
- j.s = s;
- r = decode_jpeg_header(&j, SCAN_type);
- stbi_rewind(s);
- return r;
-}
-
-static int stbi_jpeg_info_raw(jpeg *j, int *x, int *y, int *comp)
-{
- if (!decode_jpeg_header(j, SCAN_header)) {
- stbi_rewind( j->s );
- return 0;
- }
- if (x) *x = j->s->img_x;
- if (y) *y = j->s->img_y;
- if (comp) *comp = j->s->img_n;
- return 1;
-}
-
-static int stbi_jpeg_info(stbi *s, int *x, int *y, int *comp)
-{
- jpeg j;
- j.s = s;
- return stbi_jpeg_info_raw(&j, x, y, comp);
-}
-
-// public domain zlib decode v0.2 Sean Barrett 2006-11-18
-// simple implementation
-// - all input must be provided in an upfront buffer
-// - all output is written to a single output buffer (can malloc/realloc)
-// performance
-// - fast huffman
-
-// fast-way is faster to check than jpeg huffman, but slow way is slower
-#define ZFAST_BITS 9 // accelerate all cases in default tables
-#define ZFAST_MASK ((1 << ZFAST_BITS) - 1)
-
-// zlib-style huffman encoding
-// (jpegs packs from left, zlib from right, so can't share code)
-typedef struct
-{
- uint16 fast[1 << ZFAST_BITS];
- uint16 firstcode[16];
- int maxcode[17];
- uint16 firstsymbol[16];
- uint8 size[288];
- uint16 value[288];
-} zhuffman;
-
-stbi_inline static int bitreverse16(int n)
-{
- n = ((n & 0xAAAA) >> 1) | ((n & 0x5555) << 1);
- n = ((n & 0xCCCC) >> 2) | ((n & 0x3333) << 2);
- n = ((n & 0xF0F0) >> 4) | ((n & 0x0F0F) << 4);
- n = ((n & 0xFF00) >> 8) | ((n & 0x00FF) << 8);
- return n;
-}
-
-stbi_inline static int bit_reverse(int v, int bits)
-{
- assert(bits <= 16);
- // to bit reverse n bits, reverse 16 and shift
- // e.g. 11 bits, bit reverse and shift away 5
- return bitreverse16(v) >> (16-bits);
-}
-
-static int zbuild_huffman(zhuffman *z, uint8 *sizelist, int num)
-{
- int i,k=0;
- int code, next_code[16], sizes[17];
-
- // DEFLATE spec for generating codes
- memset(sizes, 0, sizeof(sizes));
- memset(z->fast, 255, sizeof(z->fast));
- for (i=0; i < num; ++i)
- ++sizes[sizelist[i]];
- sizes[0] = 0;
- for (i=1; i < 16; ++i)
- assert(sizes[i] <= (1 << i));
- code = 0;
- for (i=1; i < 16; ++i) {
- next_code[i] = code;
- z->firstcode[i] = (uint16) code;
- z->firstsymbol[i] = (uint16) k;
- code = (code + sizes[i]);
- if (sizes[i])
- if (code-1 >= (1 << i)) return e("bad codelengths","Corrupt JPEG");
- z->maxcode[i] = code << (16-i); // preshift for inner loop
- code <<= 1;
- k += sizes[i];
- }
- z->maxcode[16] = 0x10000; // sentinel
- for (i=0; i < num; ++i) {
- int s = sizelist[i];
- if (s) {
- int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s];
- z->size[c] = (uint8)s;
- z->value[c] = (uint16)i;
- if (s <= ZFAST_BITS) {
- int k = bit_reverse(next_code[s],s);
- while (k < (1 << ZFAST_BITS)) {
- z->fast[k] = (uint16) c;
- k += (1 << s);
- }
- }
- ++next_code[s];
- }
- }
- return 1;
-}
-
-// zlib-from-memory implementation for PNG reading
-// because PNG allows splitting the zlib stream arbitrarily,
-// and it's annoying structurally to have PNG call ZLIB call PNG,
-// we require PNG read all the IDATs and combine them into a single
-// memory buffer
-
-typedef struct
-{
- uint8 *zbuffer, *zbuffer_end;
- int num_bits;
- uint32 code_buffer;
-
- char *zout;
- char *zout_start;
- char *zout_end;
- int z_expandable;
-
- zhuffman z_length, z_distance;
-} zbuf;
-
-stbi_inline static int zget8(zbuf *z)
-{
- if (z->zbuffer >= z->zbuffer_end) return 0;
- return *z->zbuffer++;
-}
-
-static void fill_bits(zbuf *z)
-{
- do {
- assert(z->code_buffer < (1U << z->num_bits));
- z->code_buffer |= zget8(z) << z->num_bits;
- z->num_bits += 8;
- } while (z->num_bits <= 24);
-}
-
-stbi_inline static unsigned int zreceive(zbuf *z, int n)
-{
- unsigned int k;
- if (z->num_bits < n) fill_bits(z);
- k = z->code_buffer & ((1 << n) - 1);
- z->code_buffer >>= n;
- z->num_bits -= n;
- return k;
-}
-
-stbi_inline static int zhuffman_decode(zbuf *a, zhuffman *z)
-{
- int b,s,k;
- if (a->num_bits < 16) fill_bits(a);
- b = z->fast[a->code_buffer & ZFAST_MASK];
- if (b < 0xffff) {
- s = z->size[b];
- a->code_buffer >>= s;
- a->num_bits -= s;
- return z->value[b];
- }
-
- // not resolved by fast table, so compute it the slow way
- // use jpeg approach, which requires MSbits at top
- k = bit_reverse(a->code_buffer, 16);
- for (s=ZFAST_BITS+1; ; ++s)
- if (k < z->maxcode[s])
- break;
- if (s == 16) return -1; // invalid code!
- // code size is s, so:
- b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s];
- assert(z->size[b] == s);
- a->code_buffer >>= s;
- a->num_bits -= s;
- return z->value[b];
-}
-
-static int expand(zbuf *z, int n) // need to make room for n bytes
-{
- char *q;
- int cur, limit;
- if (!z->z_expandable) return e("output buffer limit","Corrupt PNG");
- cur = (int) (z->zout - z->zout_start);
- limit = (int) (z->zout_end - z->zout_start);
- while (cur + n > limit)
- limit *= 2;
- q = (char *) realloc(z->zout_start, limit);
- if (q == NULL) return e("outofmem", "Out of memory");
- z->zout_start = q;
- z->zout = q + cur;
- z->zout_end = q + limit;
- return 1;
-}
-
-static int length_base[31] = {
- 3,4,5,6,7,8,9,10,11,13,
- 15,17,19,23,27,31,35,43,51,59,
- 67,83,99,115,131,163,195,227,258,0,0 };
-
-static int length_extra[31]=
-{ 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 };
-
-static int dist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,
-257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0};
-
-static int dist_extra[32] =
-{ 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
-
-static int parse_huffman_block(zbuf *a)
-{
- for(;;) {
- int z = zhuffman_decode(a, &a->z_length);
- if (z < 256) {
- if (z < 0) return e("bad huffman code","Corrupt PNG"); // error in huffman codes
- if (a->zout >= a->zout_end) if (!expand(a, 1)) return 0;
- *a->zout++ = (char) z;
- } else {
- uint8 *p;
- int len,dist;
- if (z == 256) return 1;
- z -= 257;
- len = length_base[z];
- if (length_extra[z]) len += zreceive(a, length_extra[z]);
- z = zhuffman_decode(a, &a->z_distance);
- if (z < 0) return e("bad huffman code","Corrupt PNG");
- dist = dist_base[z];
- if (dist_extra[z]) dist += zreceive(a, dist_extra[z]);
- if (a->zout - a->zout_start < dist) return e("bad dist","Corrupt PNG");
- if (a->zout + len > a->zout_end) if (!expand(a, len)) return 0;
- p = (uint8 *) (a->zout - dist);
- while (len--)
- *a->zout++ = *p++;
- }
- }
-}
-
-static int compute_huffman_codes(zbuf *a)
-{
- static uint8 length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 };
- zhuffman z_codelength;
- uint8 lencodes[286+32+137];//padding for maximum single op
- uint8 codelength_sizes[19];
- int i,n;
-
- int hlit = zreceive(a,5) + 257;
- int hdist = zreceive(a,5) + 1;
- int hclen = zreceive(a,4) + 4;
-
- memset(codelength_sizes, 0, sizeof(codelength_sizes));
- for (i=0; i < hclen; ++i) {
- int s = zreceive(a,3);
- codelength_sizes[length_dezigzag[i]] = (uint8) s;
- }
- if (!zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0;
-
- n = 0;
- while (n < hlit + hdist) {
- int c = zhuffman_decode(a, &z_codelength);
- assert(c >= 0 && c < 19);
- if (c < 16)
- lencodes[n++] = (uint8) c;
- else if (c == 16) {
- c = zreceive(a,2)+3;
- memset(lencodes+n, lencodes[n-1], c);
- n += c;
- } else if (c == 17) {
- c = zreceive(a,3)+3;
- memset(lencodes+n, 0, c);
- n += c;
- } else {
- assert(c == 18);
- c = zreceive(a,7)+11;
- memset(lencodes+n, 0, c);
- n += c;
- }
- }
- if (n != hlit+hdist) return e("bad codelengths","Corrupt PNG");
- if (!zbuild_huffman(&a->z_length, lencodes, hlit)) return 0;
- if (!zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0;
- return 1;
-}
-
-static int parse_uncompressed_block(zbuf *a)
-{
- uint8 header[4];
- int len,nlen,k;
- if (a->num_bits & 7)
- zreceive(a, a->num_bits & 7); // discard
- // drain the bit-packed data into header
- k = 0;
- while (a->num_bits > 0) {
- header[k++] = (uint8) (a->code_buffer & 255); // wtf this warns?
- a->code_buffer >>= 8;
- a->num_bits -= 8;
- }
- assert(a->num_bits == 0);
- // now fill header the normal way
- while (k < 4)
- header[k++] = (uint8) zget8(a);
- len = header[1] * 256 + header[0];
- nlen = header[3] * 256 + header[2];
- if (nlen != (len ^ 0xffff)) return e("zlib corrupt","Corrupt PNG");
- if (a->zbuffer + len > a->zbuffer_end) return e("read past buffer","Corrupt PNG");
- if (a->zout + len > a->zout_end)
- if (!expand(a, len)) return 0;
- memcpy(a->zout, a->zbuffer, len);
- a->zbuffer += len;
- a->zout += len;
- return 1;
-}
-
-static int parse_zlib_header(zbuf *a)
-{
- int cmf = zget8(a);
- int cm = cmf & 15;
- /* int cinfo = cmf >> 4; */
- int flg = zget8(a);
- if ((cmf*256+flg) % 31 != 0) return e("bad zlib header","Corrupt PNG"); // zlib spec
- if (flg & 32) return e("no preset dict","Corrupt PNG"); // preset dictionary not allowed in png
- if (cm != 8) return e("bad compression","Corrupt PNG"); // DEFLATE required for png
- // window = 1 << (8 + cinfo)... but who cares, we fully buffer output
- return 1;
-}
-
-// @TODO: should statically initialize these for optimal thread safety
-static uint8 default_length[288], default_distance[32];
-static void init_defaults(void)
-{
- int i; // use <= to match clearly with spec
- for (i=0; i <= 143; ++i) default_length[i] = 8;
- for ( ; i <= 255; ++i) default_length[i] = 9;
- for ( ; i <= 279; ++i) default_length[i] = 7;
- for ( ; i <= 287; ++i) default_length[i] = 8;
-
- for (i=0; i <= 31; ++i) default_distance[i] = 5;
-}
-
-int stbi_png_partial; // a quick hack to only allow decoding some of a PNG... I should implement real streaming support instead
-static int parse_zlib(zbuf *a, int parse_header)
-{
- int final, type;
- if (parse_header)
- if (!parse_zlib_header(a)) return 0;
- a->num_bits = 0;
- a->code_buffer = 0;
- do {
- final = zreceive(a,1);
- type = zreceive(a,2);
- if (type == 0) {
- if (!parse_uncompressed_block(a)) return 0;
- } else if (type == 3) {
- return 0;
- } else {
- if (type == 1) {
- // use fixed code lengths
- if (!default_distance[31]) init_defaults();
- if (!zbuild_huffman(&a->z_length , default_length , 288)) return 0;
- if (!zbuild_huffman(&a->z_distance, default_distance, 32)) return 0;
- } else {
- if (!compute_huffman_codes(a)) return 0;
- }
- if (!parse_huffman_block(a)) return 0;
- }
- if (stbi_png_partial && a->zout - a->zout_start > 65536)
- break;
- } while (!final);
- return 1;
-}
-
-static int do_zlib(zbuf *a, char *obuf, int olen, int exp, int parse_header)
-{
- a->zout_start = obuf;
- a->zout = obuf;
- a->zout_end = obuf + olen;
- a->z_expandable = exp;
-
- return parse_zlib(a, parse_header);
-}
-
-char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen)
-{
- zbuf a;
- char *p = (char *) malloc(initial_size);
- if (p == NULL) return NULL;
- a.zbuffer = (uint8 *) buffer;
- a.zbuffer_end = (uint8 *) buffer + len;
- if (do_zlib(&a, p, initial_size, 1, 1)) {
- if (outlen) *outlen = (int) (a.zout - a.zout_start);
- return a.zout_start;
- } else {
- free(a.zout_start);
- return NULL;
- }
-}
-
-char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen)
-{
- return stbi_zlib_decode_malloc_guesssize(buffer, len, 16384, outlen);
-}
-
-char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header)
-{
- zbuf a;
- char *p = (char *) malloc(initial_size);
- if (p == NULL) return NULL;
- a.zbuffer = (uint8 *) buffer;
- a.zbuffer_end = (uint8 *) buffer + len;
- if (do_zlib(&a, p, initial_size, 1, parse_header)) {
- if (outlen) *outlen = (int) (a.zout - a.zout_start);
- return a.zout_start;
- } else {
- free(a.zout_start);
- return NULL;
- }
-}
-
-int stbi_zlib_decode_buffer(char *obuffer, int olen, char const *ibuffer, int ilen)
-{
- zbuf a;
- a.zbuffer = (uint8 *) ibuffer;
- a.zbuffer_end = (uint8 *) ibuffer + ilen;
- if (do_zlib(&a, obuffer, olen, 0, 1))
- return (int) (a.zout - a.zout_start);
- else
- return -1;
-}
-
-char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int *outlen)
-{
- zbuf a;
- char *p = (char *) malloc(16384);
- if (p == NULL) return NULL;
- a.zbuffer = (uint8 *) buffer;
- a.zbuffer_end = (uint8 *) buffer+len;
- if (do_zlib(&a, p, 16384, 1, 0)) {
- if (outlen) *outlen = (int) (a.zout - a.zout_start);
- return a.zout_start;
- } else {
- free(a.zout_start);
- return NULL;
- }
-}
-
-int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen)
-{
- zbuf a;
- a.zbuffer = (uint8 *) ibuffer;
- a.zbuffer_end = (uint8 *) ibuffer + ilen;
- if (do_zlib(&a, obuffer, olen, 0, 0))
- return (int) (a.zout - a.zout_start);
- else
- return -1;
-}
-
-// public domain "baseline" PNG decoder v0.10 Sean Barrett 2006-11-18
-// simple implementation
-// - only 8-bit samples
-// - no CRC checking
-// - allocates lots of intermediate memory
-// - avoids problem of streaming data between subsystems
-// - avoids explicit window management
-// performance
-// - uses stb_zlib, a PD zlib implementation with fast huffman decoding
-
-
-typedef struct
-{
- uint32 length;
- uint32 type;
-} chunk;
-
-#define PNG_TYPE(a,b,c,d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))
-
-static chunk get_chunk_header(stbi *s)
-{
- chunk c;
- c.length = get32(s);
- c.type = get32(s);
- return c;
-}
-
-static int check_png_header(stbi *s)
-{
- static uint8 png_sig[8] = { 137,80,78,71,13,10,26,10 };
- int i;
- for (i=0; i < 8; ++i)
- if (get8u(s) != png_sig[i]) return e("bad png sig","Not a PNG");
- return 1;
-}
-
-typedef struct
-{
- stbi *s;
- uint8 *idata, *expanded, *out;
-} png;
-
-
-enum {
- F_none=0, F_sub=1, F_up=2, F_avg=3, F_paeth=4,
- F_avg_first, F_paeth_first
-};
-
-static uint8 first_row_filter[5] =
-{
- F_none, F_sub, F_none, F_avg_first, F_paeth_first
-};
-
-static int paeth(int a, int b, int c)
-{
- int p = a + b - c;
- int pa = abs(p-a);
- int pb = abs(p-b);
- int pc = abs(p-c);
- if (pa <= pb && pa <= pc) return a;
- if (pb <= pc) return b;
- return c;
-}
-
-// create the png data from post-deflated data
-static int create_png_image_raw(png *a, uint8 *raw, uint32 raw_len, int out_n, uint32 x, uint32 y)
-{
- stbi *s = a->s;
- uint32 i,j,stride = x*out_n;
- int k;
- int img_n = s->img_n; // copy it into a local for later
- assert(out_n == s->img_n || out_n == s->img_n+1);
- if (stbi_png_partial) y = 1;
- a->out = (uint8 *) malloc(x * y * out_n);
- if (!a->out) return e("outofmem", "Out of memory");
- if (!stbi_png_partial) {
- if (s->img_x == x && s->img_y == y) {
- if (raw_len != (img_n * x + 1) * y) return e("not enough pixels","Corrupt PNG");
- } else { // interlaced:
- if (raw_len < (img_n * x + 1) * y) return e("not enough pixels","Corrupt PNG");
- }
- }
- for (j=0; j < y; ++j) {
- uint8 *cur = a->out + stride*j;
- uint8 *prior = cur - stride;
- int filter = *raw++;
- if (filter > 4) return e("invalid filter","Corrupt PNG");
- // if first row, use special filter that doesn't sample previous row
- if (j == 0) filter = first_row_filter[filter];
- // handle first pixel explicitly
- for (k=0; k < img_n; ++k) {
- switch (filter) {
- case F_none : cur[k] = raw[k]; break;
- case F_sub : cur[k] = raw[k]; break;
- case F_up : cur[k] = raw[k] + prior[k]; break;
- case F_avg : cur[k] = raw[k] + (prior[k]>>1); break;
- case F_paeth : cur[k] = (uint8) (raw[k] + paeth(0,prior[k],0)); break;
- case F_avg_first : cur[k] = raw[k]; break;
- case F_paeth_first: cur[k] = raw[k]; break;
- }
- }
- if (img_n != out_n) cur[img_n] = 255;
- raw += img_n;
- cur += out_n;
- prior += out_n;
- // this is a little gross, so that we don't switch per-pixel or per-component
- if (img_n == out_n) {
- #define CASE(f) \
- case f: \
- for (i=x-1; i >= 1; --i, raw+=img_n,cur+=img_n,prior+=img_n) \
- for (k=0; k < img_n; ++k)
- switch (filter) {
- CASE(F_none) cur[k] = raw[k]; break;
- CASE(F_sub) cur[k] = raw[k] + cur[k-img_n]; break;
- CASE(F_up) cur[k] = raw[k] + prior[k]; break;
- CASE(F_avg) cur[k] = raw[k] + ((prior[k] + cur[k-img_n])>>1); break;
- CASE(F_paeth) cur[k] = (uint8) (raw[k] + paeth(cur[k-img_n],prior[k],prior[k-img_n])); break;
- CASE(F_avg_first) cur[k] = raw[k] + (cur[k-img_n] >> 1); break;
- CASE(F_paeth_first) cur[k] = (uint8) (raw[k] + paeth(cur[k-img_n],0,0)); break;
- }
- #undef CASE
- } else {
- assert(img_n+1 == out_n);
- #define CASE(f) \
- case f: \
- for (i=x-1; i >= 1; --i, cur[img_n]=255,raw+=img_n,cur+=out_n,prior+=out_n) \
- for (k=0; k < img_n; ++k)
- switch (filter) {
- CASE(F_none) cur[k] = raw[k]; break;
- CASE(F_sub) cur[k] = raw[k] + cur[k-out_n]; break;
- CASE(F_up) cur[k] = raw[k] + prior[k]; break;
- CASE(F_avg) cur[k] = raw[k] + ((prior[k] + cur[k-out_n])>>1); break;
- CASE(F_paeth) cur[k] = (uint8) (raw[k] + paeth(cur[k-out_n],prior[k],prior[k-out_n])); break;
- CASE(F_avg_first) cur[k] = raw[k] + (cur[k-out_n] >> 1); break;
- CASE(F_paeth_first) cur[k] = (uint8) (raw[k] + paeth(cur[k-out_n],0,0)); break;
- }
- #undef CASE
- }
- }
- return 1;
-}
-
-static int create_png_image(png *a, uint8 *raw, uint32 raw_len, int out_n, int interlaced)
-{
- uint8 *final;
- int p;
- int save;
- if (!interlaced)
- return create_png_image_raw(a, raw, raw_len, out_n, a->s->img_x, a->s->img_y);
- save = stbi_png_partial;
- stbi_png_partial = 0;
-
- // de-interlacing
- final = (uint8 *) malloc(a->s->img_x * a->s->img_y * out_n);
- for (p=0; p < 7; ++p) {
- int xorig[] = { 0,4,0,2,0,1,0 };
- int yorig[] = { 0,0,4,0,2,0,1 };
- int xspc[] = { 8,8,4,4,2,2,1 };
- int yspc[] = { 8,8,8,4,4,2,2 };
- int i,j,x,y;
- // pass1_x[4] = 0, pass1_x[5] = 1, pass1_x[12] = 1
- x = (a->s->img_x - xorig[p] + xspc[p]-1) / xspc[p];
- y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p];
- if (x && y) {
- if (!create_png_image_raw(a, raw, raw_len, out_n, x, y)) {
- free(final);
- return 0;
- }
- for (j=0; j < y; ++j)
- for (i=0; i < x; ++i)
- memcpy(final + (j*yspc[p]+yorig[p])*a->s->img_x*out_n + (i*xspc[p]+xorig[p])*out_n,
- a->out + (j*x+i)*out_n, out_n);
- free(a->out);
- raw += (x*out_n+1)*y;
- raw_len -= (x*out_n+1)*y;
- }
- }
- a->out = final;
-
- stbi_png_partial = save;
- return 1;
-}
-
-static int compute_transparency(png *z, uint8 tc[3], int out_n)
-{
- stbi *s = z->s;
- uint32 i, pixel_count = s->img_x * s->img_y;
- uint8 *p = z->out;
-
- // compute color-based transparency, assuming we've
- // already got 255 as the alpha value in the output
- assert(out_n == 2 || out_n == 4);
-
- if (out_n == 2) {
- for (i=0; i < pixel_count; ++i) {
- p[1] = (p[0] == tc[0] ? 0 : 255);
- p += 2;
- }
- } else {
- for (i=0; i < pixel_count; ++i) {
- if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2])
- p[3] = 0;
- p += 4;
- }
- }
- return 1;
-}
-
-static int expand_palette(png *a, uint8 *palette, int len, int pal_img_n)
-{
- uint32 i, pixel_count = a->s->img_x * a->s->img_y;
- uint8 *p, *temp_out, *orig = a->out;
-
- p = (uint8 *) malloc(pixel_count * pal_img_n);
- if (p == NULL) return e("outofmem", "Out of memory");
-
- // between here and free(out) below, exitting would leak
- temp_out = p;
-
- if (pal_img_n == 3) {
- for (i=0; i < pixel_count; ++i) {
- int n = orig[i]*4;
- p[0] = palette[n ];
- p[1] = palette[n+1];
- p[2] = palette[n+2];
- p += 3;
- }
- } else {
- for (i=0; i < pixel_count; ++i) {
- int n = orig[i]*4;
- p[0] = palette[n ];
- p[1] = palette[n+1];
- p[2] = palette[n+2];
- p[3] = palette[n+3];
- p += 4;
- }
- }
- free(a->out);
- a->out = temp_out;
-
- STBI_NOTUSED(len);
-
- return 1;
-}
-
-static int stbi_unpremultiply_on_load = 0;
-static int stbi_de_iphone_flag = 0;
-
-void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply)
-{
- stbi_unpremultiply_on_load = flag_true_if_should_unpremultiply;
-}
-void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert)
-{
- stbi_de_iphone_flag = flag_true_if_should_convert;
-}
-
-static void stbi_de_iphone(png *z)
-{
- stbi *s = z->s;
- uint32 i, pixel_count = s->img_x * s->img_y;
- uint8 *p = z->out;
-
- if (s->img_out_n == 3) { // convert bgr to rgb
- for (i=0; i < pixel_count; ++i) {
- uint8 t = p[0];
- p[0] = p[2];
- p[2] = t;
- p += 3;
- }
- } else {
- assert(s->img_out_n == 4);
- if (stbi_unpremultiply_on_load) {
- // convert bgr to rgb and unpremultiply
- for (i=0; i < pixel_count; ++i) {
- uint8 a = p[3];
- uint8 t = p[0];
- if (a) {
- p[0] = p[2] * 255 / a;
- p[1] = p[1] * 255 / a;
- p[2] = t * 255 / a;
- } else {
- p[0] = p[2];
- p[2] = t;
- }
- p += 4;
- }
- } else {
- // convert bgr to rgb
- for (i=0; i < pixel_count; ++i) {
- uint8 t = p[0];
- p[0] = p[2];
- p[2] = t;
- p += 4;
- }
- }
- }
-}
-
-static int parse_png_file(png *z, int scan, int req_comp)
-{
- uint8 palette[1024], pal_img_n=0;
- uint8 has_trans=0, tc[3];
- uint32 ioff=0, idata_limit=0, i, pal_len=0;
- int first=1,k,interlace=0, iphone=0;
- stbi *s = z->s;
-
- z->expanded = NULL;
- z->idata = NULL;
- z->out = NULL;
-
- if (!check_png_header(s)) return 0;
-
- if (scan == SCAN_type) return 1;
-
- for (;;) {
- chunk c = get_chunk_header(s);
- switch (c.type) {
- case PNG_TYPE('C','g','B','I'):
- iphone = stbi_de_iphone_flag;
- skip(s, c.length);
- break;
- case PNG_TYPE('I','H','D','R'): {
- int depth,color,comp,filter;
- if (!first) return e("multiple IHDR","Corrupt PNG");
- first = 0;
- if (c.length != 13) return e("bad IHDR len","Corrupt PNG");
- s->img_x = get32(s); if (s->img_x > (1 << 24)) return e("too large","Very large image (corrupt?)");
- s->img_y = get32(s); if (s->img_y > (1 << 24)) return e("too large","Very large image (corrupt?)");
- depth = get8(s); if (depth != 8) return e("8bit only","PNG not supported: 8-bit only");
- color = get8(s); if (color > 6) return e("bad ctype","Corrupt PNG");
- if (color == 3) pal_img_n = 3; else if (color & 1) return e("bad ctype","Corrupt PNG");
- comp = get8(s); if (comp) return e("bad comp method","Corrupt PNG");
- filter= get8(s); if (filter) return e("bad filter method","Corrupt PNG");
- interlace = get8(s); if (interlace>1) return e("bad interlace method","Corrupt PNG");
- if (!s->img_x || !s->img_y) return e("0-pixel image","Corrupt PNG");
- if (!pal_img_n) {
- s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0);
- if ((1 << 30) / s->img_x / s->img_n < s->img_y) return e("too large", "Image too large to decode");
- if (scan == SCAN_header) return 1;
- } else {
- // if paletted, then pal_n is our final components, and
- // img_n is # components to decompress/filter.
- s->img_n = 1;
- if ((1 << 30) / s->img_x / 4 < s->img_y) return e("too large","Corrupt PNG");
- // if SCAN_header, have to scan to see if we have a tRNS
- }
- break;
- }
-
- case PNG_TYPE('P','L','T','E'): {
- if (first) return e("first not IHDR", "Corrupt PNG");
- if (c.length > 256*3) return e("invalid PLTE","Corrupt PNG");
- pal_len = c.length / 3;
- if (pal_len * 3 != c.length) return e("invalid PLTE","Corrupt PNG");
- for (i=0; i < pal_len; ++i) {
- palette[i*4+0] = get8u(s);
- palette[i*4+1] = get8u(s);
- palette[i*4+2] = get8u(s);
- palette[i*4+3] = 255;
- }
- break;
- }
-
- case PNG_TYPE('t','R','N','S'): {
- if (first) return e("first not IHDR", "Corrupt PNG");
- if (z->idata) return e("tRNS after IDAT","Corrupt PNG");
- if (pal_img_n) {
- if (scan == SCAN_header) { s->img_n = 4; return 1; }
- if (pal_len == 0) return e("tRNS before PLTE","Corrupt PNG");
- if (c.length > pal_len) return e("bad tRNS len","Corrupt PNG");
- pal_img_n = 4;
- for (i=0; i < c.length; ++i)
- palette[i*4+3] = get8u(s);
- } else {
- if (!(s->img_n & 1)) return e("tRNS with alpha","Corrupt PNG");
- if (c.length != (uint32) s->img_n*2) return e("bad tRNS len","Corrupt PNG");
- has_trans = 1;
- for (k=0; k < s->img_n; ++k)
- tc[k] = (uint8) get16(s); // non 8-bit images will be larger
- }
- break;
- }
-
- case PNG_TYPE('I','D','A','T'): {
- if (first) return e("first not IHDR", "Corrupt PNG");
- if (pal_img_n && !pal_len) return e("no PLTE","Corrupt PNG");
- if (scan == SCAN_header) { s->img_n = pal_img_n; return 1; }
- if (ioff + c.length > idata_limit) {
- uint8 *p;
- if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096;
- while (ioff + c.length > idata_limit)
- idata_limit *= 2;
- p = (uint8 *) realloc(z->idata, idata_limit); if (p == NULL) return e("outofmem", "Out of memory");
- z->idata = p;
- }
- if (!getn(s, z->idata+ioff,c.length)) return e("outofdata","Corrupt PNG");
- ioff += c.length;
- break;
- }
-
- case PNG_TYPE('I','E','N','D'): {
- uint32 raw_len;
- if (first) return e("first not IHDR", "Corrupt PNG");
- if (scan != SCAN_load) return 1;
- if (z->idata == NULL) return e("no IDAT","Corrupt PNG");
- z->expanded = (uint8 *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, 16384, (int *) &raw_len, !iphone);
- if (z->expanded == NULL) return 0; // zlib should set error
- free(z->idata); z->idata = NULL;
- if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans)
- s->img_out_n = s->img_n+1;
- else
- s->img_out_n = s->img_n;
- if (!create_png_image(z, z->expanded, raw_len, s->img_out_n, interlace)) return 0;
- if (has_trans)
- if (!compute_transparency(z, tc, s->img_out_n)) return 0;
- if (iphone && s->img_out_n > 2)
- stbi_de_iphone(z);
- if (pal_img_n) {
- // pal_img_n == 3 or 4
- s->img_n = pal_img_n; // record the actual colors we had
- s->img_out_n = pal_img_n;
- if (req_comp >= 3) s->img_out_n = req_comp;
- if (!expand_palette(z, palette, pal_len, s->img_out_n))
- return 0;
- }
- free(z->expanded); z->expanded = NULL;
- return 1;
- }
-
- default:
- // if critical, fail
- if (first) return e("first not IHDR", "Corrupt PNG");
- if ((c.type & (1 << 29)) == 0) {
- #ifndef STBI_NO_FAILURE_STRINGS
- // not threadsafe
- static char invalid_chunk[] = "XXXX chunk not known";
- invalid_chunk[0] = (uint8) (c.type >> 24);
- invalid_chunk[1] = (uint8) (c.type >> 16);
- invalid_chunk[2] = (uint8) (c.type >> 8);
- invalid_chunk[3] = (uint8) (c.type >> 0);
- #endif
- return e(invalid_chunk, "PNG not supported: unknown chunk type");
- }
- skip(s, c.length);
- break;
- }
- // end of chunk, read and skip CRC
- get32(s);
- }
-}
-
-static unsigned char *do_png(png *p, int *x, int *y, int *n, int req_comp)
-{
- unsigned char *result=NULL;
- if (req_comp < 0 || req_comp > 4) return epuc("bad req_comp", "Internal error");
- if (parse_png_file(p, SCAN_load, req_comp)) {
- result = p->out;
- p->out = NULL;
- if (req_comp && req_comp != p->s->img_out_n) {
- result = convert_format(result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y);
- p->s->img_out_n = req_comp;
- if (result == NULL) return result;
- }
- *x = p->s->img_x;
- *y = p->s->img_y;
- if (n) *n = p->s->img_n;
- }
- free(p->out); p->out = NULL;
- free(p->expanded); p->expanded = NULL;
- free(p->idata); p->idata = NULL;
-
- return result;
-}
-
-static unsigned char *stbi_png_load(stbi *s, int *x, int *y, int *comp, int req_comp)
-{
- png p;
- p.s = s;
- return do_png(&p, x,y,comp,req_comp);
-}
-
-static int stbi_png_test(stbi *s)
-{
- int r;
- r = check_png_header(s);
- stbi_rewind(s);
- return r;
-}
-
-static int stbi_png_info_raw(png *p, int *x, int *y, int *comp)
-{
- if (!parse_png_file(p, SCAN_header, 0)) {
- stbi_rewind( p->s );
- return 0;
- }
- if (x) *x = p->s->img_x;
- if (y) *y = p->s->img_y;
- if (comp) *comp = p->s->img_n;
- return 1;
-}
-
-static int stbi_png_info(stbi *s, int *x, int *y, int *comp)
-{
- png p;
- p.s = s;
- return stbi_png_info_raw(&p, x, y, comp);
-}
-
-// Microsoft/Windows BMP image
-
-static int bmp_test(stbi *s)
-{
- int sz;
- if (get8(s) != 'B') return 0;
- if (get8(s) != 'M') return 0;
- get32le(s); // discard filesize
- get16le(s); // discard reserved
- get16le(s); // discard reserved
- get32le(s); // discard data offset
- sz = get32le(s);
- if (sz == 12 || sz == 40 || sz == 56 || sz == 108) return 1;
- return 0;
-}
-
-static int stbi_bmp_test(stbi *s)
-{
- int r = bmp_test(s);
- stbi_rewind(s);
- return r;
-}
-
-
-// returns 0..31 for the highest set bit
-static int high_bit(unsigned int z)
-{
- int n=0;
- if (z == 0) return -1;
- if (z >= 0x10000) n += 16, z >>= 16;
- if (z >= 0x00100) n += 8, z >>= 8;
- if (z >= 0x00010) n += 4, z >>= 4;
- if (z >= 0x00004) n += 2, z >>= 2;
- if (z >= 0x00002) n += 1, z >>= 1;
- return n;
-}
-
-static int bitcount(unsigned int a)
-{
- a = (a & 0x55555555) + ((a >> 1) & 0x55555555); // max 2
- a = (a & 0x33333333) + ((a >> 2) & 0x33333333); // max 4
- a = (a + (a >> 4)) & 0x0f0f0f0f; // max 8 per 4, now 8 bits
- a = (a + (a >> 8)); // max 16 per 8 bits
- a = (a + (a >> 16)); // max 32 per 8 bits
- return a & 0xff;
-}
-
-static int shiftsigned(int v, int shift, int bits)
-{
- int result;
- int z=0;
-
- if (shift < 0) v <<= -shift;
- else v >>= shift;
- result = v;
-
- z = bits;
- while (z < 8) {
- result += v >> z;
- z += bits;
- }
- return result;
-}
-
-static stbi_uc *bmp_load(stbi *s, int *x, int *y, int *comp, int req_comp)
-{
- uint8 *out;
- unsigned int mr=0,mg=0,mb=0,ma=0, fake_a=0;
- stbi_uc pal[256][4];
- int psize=0,i,j,compress=0,width;
- int bpp, flip_vertically, pad, target, offset, hsz;
- if (get8(s) != 'B' || get8(s) != 'M') return epuc("not BMP", "Corrupt BMP");
- get32le(s); // discard filesize
- get16le(s); // discard reserved
- get16le(s); // discard reserved
- offset = get32le(s);
- hsz = get32le(s);
- if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108) return epuc("unknown BMP", "BMP type not supported: unknown");
- if (hsz == 12) {
- s->img_x = get16le(s);
- s->img_y = get16le(s);
- } else {
- s->img_x = get32le(s);
- s->img_y = get32le(s);
- }
- if (get16le(s) != 1) return epuc("bad BMP", "bad BMP");
- bpp = get16le(s);
- if (bpp == 1) return epuc("monochrome", "BMP type not supported: 1-bit");
- flip_vertically = ((int) s->img_y) > 0;
- s->img_y = abs((int) s->img_y);
- if (hsz == 12) {
- if (bpp < 24)
- psize = (offset - 14 - 24) / 3;
- } else {
- compress = get32le(s);
- if (compress == 1 || compress == 2) return epuc("BMP RLE", "BMP type not supported: RLE");
- get32le(s); // discard sizeof
- get32le(s); // discard hres
- get32le(s); // discard vres
- get32le(s); // discard colorsused
- get32le(s); // discard max important
- if (hsz == 40 || hsz == 56) {
- if (hsz == 56) {
- get32le(s);
- get32le(s);
- get32le(s);
- get32le(s);
- }
- if (bpp == 16 || bpp == 32) {
- mr = mg = mb = 0;
- if (compress == 0) {
- if (bpp == 32) {
- mr = 0xffu << 16;
- mg = 0xffu << 8;
- mb = 0xffu << 0;
- ma = 0xffu << 24;
- fake_a = 1; // @TODO: check for cases like alpha value is all 0 and switch it to 255
- } else {
- mr = 31u << 10;
- mg = 31u << 5;
- mb = 31u << 0;
- }
- } else if (compress == 3) {
- mr = get32le(s);
- mg = get32le(s);
- mb = get32le(s);
- // not documented, but generated by photoshop and handled by mspaint
- if (mr == mg && mg == mb) {
- // ?!?!?
- return epuc("bad BMP", "bad BMP");
- }
- } else
- return epuc("bad BMP", "bad BMP");
- }
- } else {
- assert(hsz == 108);
- mr = get32le(s);
- mg = get32le(s);
- mb = get32le(s);
- ma = get32le(s);
- get32le(s); // discard color space
- for (i=0; i < 12; ++i)
- get32le(s); // discard color space parameters
- }
- if (bpp < 16)
- psize = (offset - 14 - hsz) >> 2;
- }
- s->img_n = ma ? 4 : 3;
- if (req_comp && req_comp >= 3) // we can directly decode 3 or 4
- target = req_comp;
- else
- target = s->img_n; // if they want monochrome, we'll post-convert
- out = (stbi_uc *) malloc(target * s->img_x * s->img_y);
- if (!out) return epuc("outofmem", "Out of memory");
- if (bpp < 16) {
- int z=0;
- if (psize == 0 || psize > 256) { free(out); return epuc("invalid", "Corrupt BMP"); }
- for (i=0; i < psize; ++i) {
- pal[i][2] = get8u(s);
- pal[i][1] = get8u(s);
- pal[i][0] = get8u(s);
- if (hsz != 12) get8(s);
- pal[i][3] = 255;
- }
- skip(s, offset - 14 - hsz - psize * (hsz == 12 ? 3 : 4));
- if (bpp == 4) width = (s->img_x + 1) >> 1;
- else if (bpp == 8) width = s->img_x;
- else { free(out); return epuc("bad bpp", "Corrupt BMP"); }
- pad = (-width)&3;
- for (j=0; j < (int) s->img_y; ++j) {
- for (i=0; i < (int) s->img_x; i += 2) {
- int v=get8(s),v2=0;
- if (bpp == 4) {
- v2 = v & 15;
- v >>= 4;
- }
- out[z++] = pal[v][0];
- out[z++] = pal[v][1];
- out[z++] = pal[v][2];
- if (target == 4) out[z++] = 255;
- if (i+1 == (int) s->img_x) break;
- v = (bpp == 8) ? get8(s) : v2;
- out[z++] = pal[v][0];
- out[z++] = pal[v][1];
- out[z++] = pal[v][2];
- if (target == 4) out[z++] = 255;
- }
- skip(s, pad);
- }
- } else {
- int rshift=0,gshift=0,bshift=0,ashift=0,rcount=0,gcount=0,bcount=0,acount=0;
- int z = 0;
- int easy=0;
- skip(s, offset - 14 - hsz);
- if (bpp == 24) width = 3 * s->img_x;
- else if (bpp == 16) width = 2*s->img_x;
- else /* bpp = 32 and pad = 0 */ width=0;
- pad = (-width) & 3;
- if (bpp == 24) {
- easy = 1;
- } else if (bpp == 32) {
- if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 && ma == 0xff000000)
- easy = 2;
- }
- if (!easy) {
- if (!mr || !mg || !mb) { free(out); return epuc("bad masks", "Corrupt BMP"); }
- // right shift amt to put high bit in position #7
- rshift = high_bit(mr)-7; rcount = bitcount(mr);
- gshift = high_bit(mg)-7; gcount = bitcount(mr);
- bshift = high_bit(mb)-7; bcount = bitcount(mr);
- ashift = high_bit(ma)-7; acount = bitcount(mr);
- }
- for (j=0; j < (int) s->img_y; ++j) {
- if (easy) {
- for (i=0; i < (int) s->img_x; ++i) {
- int a;
- out[z+2] = get8u(s);
- out[z+1] = get8u(s);
- out[z+0] = get8u(s);
- z += 3;
- a = (easy == 2 ? get8(s) : 255);
- if (target == 4) out[z++] = (uint8) a;
- }
- } else {
- for (i=0; i < (int) s->img_x; ++i) {
- uint32 v = (bpp == 16 ? get16le(s) : get32le(s));
- int a;
- out[z++] = (uint8) shiftsigned(v & mr, rshift, rcount);
- out[z++] = (uint8) shiftsigned(v & mg, gshift, gcount);
- out[z++] = (uint8) shiftsigned(v & mb, bshift, bcount);
- a = (ma ? shiftsigned(v & ma, ashift, acount) : 255);
- if (target == 4) out[z++] = (uint8) a;
- }
- }
- skip(s, pad);
- }
- }
- if (flip_vertically) {
- stbi_uc t;
- for (j=0; j < (int) s->img_y>>1; ++j) {
- stbi_uc *p1 = out + j *s->img_x*target;
- stbi_uc *p2 = out + (s->img_y-1-j)*s->img_x*target;
- for (i=0; i < (int) s->img_x*target; ++i) {
- t = p1[i], p1[i] = p2[i], p2[i] = t;
- }
- }
- }
-
- if (req_comp && req_comp != target) {
- out = convert_format(out, target, req_comp, s->img_x, s->img_y);
- if (out == NULL) return out; // convert_format frees input on failure
- }
-
- *x = s->img_x;
- *y = s->img_y;
- if (comp) *comp = s->img_n;
- return out;
-}
-
-static stbi_uc *stbi_bmp_load(stbi *s,int *x, int *y, int *comp, int req_comp)
-{
- return bmp_load(s, x,y,comp,req_comp);
-}
-
-
-// Targa Truevision - TGA
-// by Jonathan Dummer
-
-static int tga_info(stbi *s, int *x, int *y, int *comp)
-{
- int tga_w, tga_h, tga_comp;
- int sz;
- get8u(s); // discard Offset
- sz = get8u(s); // color type
- if( sz > 1 ) {
- stbi_rewind(s);
- return 0; // only RGB or indexed allowed
- }
- sz = get8u(s); // image type
- // only RGB or grey allowed, +/- RLE
- if ((sz != 1) && (sz != 2) && (sz != 3) && (sz != 9) && (sz != 10) && (sz != 11)) return 0;
- skip(s,9);
- tga_w = get16le(s);
- if( tga_w < 1 ) {
- stbi_rewind(s);
- return 0; // test width
- }
- tga_h = get16le(s);
- if( tga_h < 1 ) {
- stbi_rewind(s);
- return 0; // test height
- }
- sz = get8(s); // bits per pixel
- // only RGB or RGBA or grey allowed
- if ((sz != 8) && (sz != 16) && (sz != 24) && (sz != 32)) {
- stbi_rewind(s);
- return 0;
- }
- tga_comp = sz;
- if (x) *x = tga_w;
- if (y) *y = tga_h;
- if (comp) *comp = tga_comp / 8;
- return 1; // seems to have passed everything
-}
-
-int stbi_tga_info(stbi *s, int *x, int *y, int *comp)
-{
- return tga_info(s, x, y, comp);
-}
-
-static int tga_test(stbi *s)
-{
- int sz;
- get8u(s); // discard Offset
- sz = get8u(s); // color type
- if ( sz > 1 ) return 0; // only RGB or indexed allowed
- sz = get8u(s); // image type
- if ( (sz != 1) && (sz != 2) && (sz != 3) && (sz != 9) && (sz != 10) && (sz != 11) ) return 0; // only RGB or grey allowed, +/- RLE
- get16(s); // discard palette start
- get16(s); // discard palette length
- get8(s); // discard bits per palette color entry
- get16(s); // discard x origin
- get16(s); // discard y origin
- if ( get16(s) < 1 ) return 0; // test width
- if ( get16(s) < 1 ) return 0; // test height
- sz = get8(s); // bits per pixel
- if ( (sz != 8) && (sz != 16) && (sz != 24) && (sz != 32) ) return 0; // only RGB or RGBA or grey allowed
- return 1; // seems to have passed everything
-}
-
-static int stbi_tga_test(stbi *s)
-{
- int res = tga_test(s);
- stbi_rewind(s);
- return res;
-}
-
-static stbi_uc *tga_load(stbi *s, int *x, int *y, int *comp, int req_comp)
-{
- // read in the TGA header stuff
- int tga_offset = get8u(s);
- int tga_indexed = get8u(s);
- int tga_image_type = get8u(s);
- int tga_is_RLE = 0;
- int tga_palette_start = get16le(s);
- int tga_palette_len = get16le(s);
- int tga_palette_bits = get8u(s);
- int tga_x_origin = get16le(s);
- int tga_y_origin = get16le(s);
- int tga_width = get16le(s);
- int tga_height = get16le(s);
- int tga_bits_per_pixel = get8u(s);
- int tga_inverted = get8u(s);
- // image data
- unsigned char *tga_data;
- unsigned char *tga_palette = NULL;
- int i, j;
- unsigned char raw_data[4];
- unsigned char trans_data[4];
- int RLE_count = 0;
- int RLE_repeating = 0;
- int read_next_pixel = 1;
-
- // do a tiny bit of precessing
- if ( tga_image_type >= 8 )
- {
- tga_image_type -= 8;
- tga_is_RLE = 1;
- }
- /* int tga_alpha_bits = tga_inverted & 15; */
- tga_inverted = 1 - ((tga_inverted >> 5) & 1);
-
- // error check
- if ( //(tga_indexed) ||
- (tga_width < 1) || (tga_height < 1) ||
- (tga_image_type < 1) || (tga_image_type > 3) ||
- ((tga_bits_per_pixel != 8) && (tga_bits_per_pixel != 16) &&
- (tga_bits_per_pixel != 24) && (tga_bits_per_pixel != 32))
- )
- {
- return NULL; // we don't report this as a bad TGA because we don't even know if it's TGA
- }
-
- // If I'm paletted, then I'll use the number of bits from the palette
- if ( tga_indexed )
- {
- tga_bits_per_pixel = tga_palette_bits;
- }
-
- // tga info
- *x = tga_width;
- *y = tga_height;
- if ( (req_comp < 1) || (req_comp > 4) )
- {
- // just use whatever the file was
- req_comp = tga_bits_per_pixel / 8;
- *comp = req_comp;
- } else
- {
- // force a new number of components
- *comp = tga_bits_per_pixel/8;
- }
- tga_data = (unsigned char*)malloc( tga_width * tga_height * req_comp );
- if (!tga_data) return epuc("outofmem", "Out of memory");
-
- // skip to the data's starting position (offset usually = 0)
- skip(s, tga_offset );
- // do I need to load a palette?
- if ( tga_indexed )
- {
- // any data to skip? (offset usually = 0)
- skip(s, tga_palette_start );
- // load the palette
- tga_palette = (unsigned char*)malloc( tga_palette_len * tga_palette_bits / 8 );
- if (!tga_palette) return epuc("outofmem", "Out of memory");
- if (!getn(s, tga_palette, tga_palette_len * tga_palette_bits / 8 )) {
- free(tga_data);
- free(tga_palette);
- return epuc("bad palette", "Corrupt TGA");
- }
- }
- // load the data
- trans_data[0] = trans_data[1] = trans_data[2] = trans_data[3] = 0;
- for (i=0; i < tga_width * tga_height; ++i)
- {
- // if I'm in RLE mode, do I need to get a RLE chunk?
- if ( tga_is_RLE )
- {
- if ( RLE_count == 0 )
- {
- // yep, get the next byte as a RLE command
- int RLE_cmd = get8u(s);
- RLE_count = 1 + (RLE_cmd & 127);
- RLE_repeating = RLE_cmd >> 7;
- read_next_pixel = 1;
- } else if ( !RLE_repeating )
- {
- read_next_pixel = 1;
- }
- } else
- {
- read_next_pixel = 1;
- }
- // OK, if I need to read a pixel, do it now
- if ( read_next_pixel )
- {
- // load however much data we did have
- if ( tga_indexed )
- {
- // read in 1 byte, then perform the lookup
- int pal_idx = get8u(s);
- if ( pal_idx >= tga_palette_len )
- {
- // invalid index
- pal_idx = 0;
- }
- pal_idx *= tga_bits_per_pixel / 8;
- for (j = 0; j*8 < tga_bits_per_pixel; ++j)
- {
- raw_data[j] = tga_palette[pal_idx+j];
- }
- } else
- {
- // read in the data raw
- for (j = 0; j*8 < tga_bits_per_pixel; ++j)
- {
- raw_data[j] = get8u(s);
- }
- }
- // convert raw to the intermediate format
- switch (tga_bits_per_pixel)
- {
- case 8:
- // Luminous => RGBA
- trans_data[0] = raw_data[0];
- trans_data[1] = raw_data[0];
- trans_data[2] = raw_data[0];
- trans_data[3] = 255;
- break;
- case 16:
- // Luminous,Alpha => RGBA
- trans_data[0] = raw_data[0];
- trans_data[1] = raw_data[0];
- trans_data[2] = raw_data[0];
- trans_data[3] = raw_data[1];
- break;
- case 24:
- // BGR => RGBA
- trans_data[0] = raw_data[2];
- trans_data[1] = raw_data[1];
- trans_data[2] = raw_data[0];
- trans_data[3] = 255;
- break;
- case 32:
- // BGRA => RGBA
- trans_data[0] = raw_data[2];
- trans_data[1] = raw_data[1];
- trans_data[2] = raw_data[0];
- trans_data[3] = raw_data[3];
- break;
- }
- // clear the reading flag for the next pixel
- read_next_pixel = 0;
- } // end of reading a pixel
- // convert to final format
- switch (req_comp)
- {
- case 1:
- // RGBA => Luminance
- tga_data[i*req_comp+0] = compute_y(trans_data[0],trans_data[1],trans_data[2]);
- break;
- case 2:
- // RGBA => Luminance,Alpha
- tga_data[i*req_comp+0] = compute_y(trans_data[0],trans_data[1],trans_data[2]);
- tga_data[i*req_comp+1] = trans_data[3];
- break;
- case 3:
- // RGBA => RGB
- tga_data[i*req_comp+0] = trans_data[0];
- tga_data[i*req_comp+1] = trans_data[1];
- tga_data[i*req_comp+2] = trans_data[2];
- break;
- case 4:
- // RGBA => RGBA
- tga_data[i*req_comp+0] = trans_data[0];
- tga_data[i*req_comp+1] = trans_data[1];
- tga_data[i*req_comp+2] = trans_data[2];
- tga_data[i*req_comp+3] = trans_data[3];
- break;
- }
- // in case we're in RLE mode, keep counting down
- --RLE_count;
- }
- // do I need to invert the image?
- if ( tga_inverted )
- {
- for (j = 0; j*2 < tga_height; ++j)
- {
- int index1 = j * tga_width * req_comp;
- int index2 = (tga_height - 1 - j) * tga_width * req_comp;
- for (i = tga_width * req_comp; i > 0; --i)
- {
- unsigned char temp = tga_data[index1];
- tga_data[index1] = tga_data[index2];
- tga_data[index2] = temp;
- ++index1;
- ++index2;
- }
- }
- }
- // clear my palette, if I had one
- if ( tga_palette != NULL )
- {
- free( tga_palette );
- }
- // the things I do to get rid of an error message, and yet keep
- // Microsoft's C compilers happy... [8^(
- tga_palette_start = tga_palette_len = tga_palette_bits =
- tga_x_origin = tga_y_origin = 0;
- // OK, done
- return tga_data;
-}
-
-static stbi_uc *stbi_tga_load(stbi *s, int *x, int *y, int *comp, int req_comp)
-{
- return tga_load(s,x,y,comp,req_comp);
-}
-
-
-// *************************************************************************************************
-// Photoshop PSD loader -- PD by Thatcher Ulrich, integration by Nicolas Schulz, tweaked by STB
-
-static int psd_test(stbi *s)
-{
- if (get32(s) != 0x38425053) return 0; // "8BPS"
- else return 1;
-}
-
-static int stbi_psd_test(stbi *s)
-{
- int r = psd_test(s);
- stbi_rewind(s);
- return r;
-}
-
-static stbi_uc *psd_load(stbi *s, int *x, int *y, int *comp, int req_comp)
-{
- int pixelCount;
- int channelCount, compression;
- int channel, i, count, len;
- int w,h;
- uint8 *out;
-
- // Check identifier
- if (get32(s) != 0x38425053) // "8BPS"
- return epuc("not PSD", "Corrupt PSD image");
-
- // Check file type version.
- if (get16(s) != 1)
- return epuc("wrong version", "Unsupported version of PSD image");
-
- // Skip 6 reserved bytes.
- skip(s, 6 );
-
- // Read the number of channels (R, G, B, A, etc).
- channelCount = get16(s);
- if (channelCount < 0 || channelCount > 16)
- return epuc("wrong channel count", "Unsupported number of channels in PSD image");
-
- // Read the rows and columns of the image.
- h = get32(s);
- w = get32(s);
-
- // Make sure the depth is 8 bits.
- if (get16(s) != 8)
- return epuc("unsupported bit depth", "PSD bit depth is not 8 bit");
-
- // Make sure the color mode is RGB.
- // Valid options are:
- // 0: Bitmap
- // 1: Grayscale
- // 2: Indexed color
- // 3: RGB color
- // 4: CMYK color
- // 7: Multichannel
- // 8: Duotone
- // 9: Lab color
- if (get16(s) != 3)
- return epuc("wrong color format", "PSD is not in RGB color format");
-
- // Skip the Mode Data. (It's the palette for indexed color; other info for other modes.)
- skip(s,get32(s) );
-
- // Skip the image resources. (resolution, pen tool paths, etc)
- skip(s, get32(s) );
-
- // Skip the reserved data.
- skip(s, get32(s) );
-
- // Find out if the data is compressed.
- // Known values:
- // 0: no compression
- // 1: RLE compressed
- compression = get16(s);
- if (compression > 1)
- return epuc("bad compression", "PSD has an unknown compression format");
-
- // Create the destination image.
- out = (stbi_uc *) malloc(4 * w*h);
- if (!out) return epuc("outofmem", "Out of memory");
- pixelCount = w*h;
-
- // Initialize the data to zero.
- //memset( out, 0, pixelCount * 4 );
-
- // Finally, the image data.
- if (compression) {
- // RLE as used by .PSD and .TIFF
- // Loop until you get the number of unpacked bytes you are expecting:
- // Read the next source byte into n.
- // If n is between 0 and 127 inclusive, copy the next n+1 bytes literally.
- // Else if n is between -127 and -1 inclusive, copy the next byte -n+1 times.
- // Else if n is 128, noop.
- // Endloop
-
- // The RLE-compressed data is preceeded by a 2-byte data count for each row in the data,
- // which we're going to just skip.
- skip(s, h * channelCount * 2 );
-
- // Read the RLE data by channel.
- for (channel = 0; channel < 4; channel++) {
- uint8 *p;
-
- p = out+channel;
- if (channel >= channelCount) {
- // Fill this channel with default data.
- for (i = 0; i < pixelCount; i++) *p = (channel == 3 ? 255 : 0), p += 4;
- } else {
- // Read the RLE data.
- count = 0;
- while (count < pixelCount) {
- len = get8(s);
- if (len == 128) {
- // No-op.
- } else if (len < 128) {
- // Copy next len+1 bytes literally.
- len++;
- count += len;
- while (len) {
- *p = get8u(s);
- p += 4;
- len--;
- }
- } else if (len > 128) {
- uint8 val;
- // Next -len+1 bytes in the dest are replicated from next source byte.
- // (Interpret len as a negative 8-bit int.)
- len ^= 0x0FF;
- len += 2;
- val = get8u(s);
- count += len;
- while (len) {
- *p = val;
- p += 4;
- len--;
- }
- }
- }
- }
- }
-
- } else {
- // We're at the raw image data. It's each channel in order (Red, Green, Blue, Alpha, ...)
- // where each channel consists of an 8-bit value for each pixel in the image.
-
- // Read the data by channel.
- for (channel = 0; channel < 4; channel++) {
- uint8 *p;
-
- p = out + channel;
- if (channel > channelCount) {
- // Fill this channel with default data.
- for (i = 0; i < pixelCount; i++) *p = channel == 3 ? 255 : 0, p += 4;
- } else {
- // Read the data.
- for (i = 0; i < pixelCount; i++)
- *p = get8u(s), p += 4;
- }
- }
- }
-
- if (req_comp && req_comp != 4) {
- out = convert_format(out, 4, req_comp, w, h);
- if (out == NULL) return out; // convert_format frees input on failure
- }
-
- if (comp) *comp = channelCount;
- *y = h;
- *x = w;
-
- return out;
-}
-
-static stbi_uc *stbi_psd_load(stbi *s, int *x, int *y, int *comp, int req_comp)
-{
- return psd_load(s,x,y,comp,req_comp);
-}
-
-// *************************************************************************************************
-// Softimage PIC loader
-// by Tom Seddon
-//
-// See http://softimage.wiki.softimage.com/index.php/INFO:_PIC_file_format
-// See http://ozviz.wasp.uwa.edu.au/~pbourke/dataformats/softimagepic/
-
-static int pic_is4(stbi *s,const char *str)
-{
- int i;
- for (i=0; i<4; ++i)
- if (get8(s) != (stbi_uc)str[i])
- return 0;
-
- return 1;
-}
-
-static int pic_test(stbi *s)
-{
- int i;
-
- if (!pic_is4(s,"\x53\x80\xF6\x34"))
- return 0;
-
- for(i=0;i<84;++i)
- get8(s);
-
- if (!pic_is4(s,"PICT"))
- return 0;
-
- return 1;
-}
-
-typedef struct
-{
- stbi_uc size,type,channel;
-} pic_packet_t;
-
-static stbi_uc *pic_readval(stbi *s, int channel, stbi_uc *dest)
-{
- int mask=0x80, i;
-
- for (i=0; i<4; ++i, mask>>=1) {
- if (channel & mask) {
- if (at_eof(s)) return epuc("bad file","PIC file too short");
- dest[i]=get8u(s);
- }
- }
-
- return dest;
-}
-
-static void pic_copyval(int channel,stbi_uc *dest,const stbi_uc *src)
-{
- int mask=0x80,i;
-
- for (i=0;i<4; ++i, mask>>=1)
- if (channel&mask)
- dest[i]=src[i];
-}
-
-static stbi_uc *pic_load2(stbi *s,int width,int height,int *comp, stbi_uc *result)
-{
- int act_comp=0,num_packets=0,y,chained;
- pic_packet_t packets[10];
-
- // this will (should...) cater for even some bizarre stuff like having data
- // for the same channel in multiple packets.
- do {
- pic_packet_t *packet;
-
- if (num_packets==sizeof(packets)/sizeof(packets[0]))
- return epuc("bad format","too many packets");
-
- packet = &packets[num_packets++];
-
- chained = get8(s);
- packet->size = get8u(s);
- packet->type = get8u(s);
- packet->channel = get8u(s);
-
- act_comp |= packet->channel;
-
- if (at_eof(s)) return epuc("bad file","file too short (reading packets)");
- if (packet->size != 8) return epuc("bad format","packet isn't 8bpp");
- } while (chained);
-
- *comp = (act_comp & 0x10 ? 4 : 3); // has alpha channel?
-
- for(y=0; y<height; ++y) {
- int packet_idx;
-
- for(packet_idx=0; packet_idx < num_packets; ++packet_idx) {
- pic_packet_t *packet = &packets[packet_idx];
- stbi_uc *dest = result+y*width*4;
-
- switch (packet->type) {
- default:
- return epuc("bad format","packet has bad compression type");
-
- case 0: {//uncompressed
- int x;
-
- for(x=0;x<width;++x, dest+=4)
- if (!pic_readval(s,packet->channel,dest))
- return 0;
- break;
- }
-
- case 1://Pure RLE
- {
- int left=width, i;
-
- while (left>0) {
- stbi_uc count,value[4];
-
- count=get8u(s);
- if (at_eof(s)) return epuc("bad file","file too short (pure read count)");
-
- if (count > left)
- count = (uint8) left;
-
- if (!pic_readval(s,packet->channel,value)) return 0;
-
- for(i=0; i<count; ++i,dest+=4)
- pic_copyval(packet->channel,dest,value);
- left -= count;
- }
- }
- break;
-
- case 2: {//Mixed RLE
- int left=width;
- while (left>0) {
- int count = get8(s), i;
- if (at_eof(s)) return epuc("bad file","file too short (mixed read count)");
-
- if (count >= 128) { // Repeated
- stbi_uc value[4];
- int i;
-
- if (count==128)
- count = get16(s);
- else
- count -= 127;
- if (count > left)
- return epuc("bad file","scanline overrun");
-
- if (!pic_readval(s,packet->channel,value))
- return 0;
-
- for(i=0;i<count;++i, dest += 4)
- pic_copyval(packet->channel,dest,value);
- } else { // Raw
- ++count;
- if (count>left) return epuc("bad file","scanline overrun");
-
- for(i=0;i<count;++i, dest+=4)
- if (!pic_readval(s,packet->channel,dest))
- return 0;
- }
- left-=count;
- }
- break;
- }
- }
- }
- }
-
- return result;
-}
-
-static stbi_uc *pic_load(stbi *s,int *px,int *py,int *comp,int req_comp)
-{
- stbi_uc *result;
- int i, x,y;
-
- for (i=0; i<92; ++i)
- get8(s);
-
- x = get16(s);
- y = get16(s);
- if (at_eof(s)) return epuc("bad file","file too short (pic header)");
- if ((1 << 28) / x < y) return epuc("too large", "Image too large to decode");
-
- get32(s); //skip `ratio'
- get16(s); //skip `fields'
- get16(s); //skip `pad'
-
- // intermediate buffer is RGBA
- result = (stbi_uc *) malloc(x*y*4);
- memset(result, 0xff, x*y*4);
-
- if (!pic_load2(s,x,y,comp, result)) {
- free(result);
- result=0;
- }
- *px = x;
- *py = y;
- if (req_comp == 0) req_comp = *comp;
- result=convert_format(result,4,req_comp,x,y);
-
- return result;
-}
-
-static int stbi_pic_test(stbi *s)
-{
- int r = pic_test(s);
- stbi_rewind(s);
- return r;
-}
-
-static stbi_uc *stbi_pic_load(stbi *s, int *x, int *y, int *comp, int req_comp)
-{
- return pic_load(s,x,y,comp,req_comp);
-}
-
-// *************************************************************************************************
-// GIF loader -- public domain by Jean-Marc Lienher -- simplified/shrunk by stb
-typedef struct stbi_gif_lzw_struct {
- int16 prefix;
- uint8 first;
- uint8 suffix;
-} stbi_gif_lzw;
-
-typedef struct stbi_gif_struct
-{
- int w,h;
- stbi_uc *out; // output buffer (always 4 components)
- int flags, bgindex, ratio, transparent, eflags;
- uint8 pal[256][4];
- uint8 lpal[256][4];
- stbi_gif_lzw codes[4096];
- uint8 *color_table;
- int parse, step;
- int lflags;
- int start_x, start_y;
- int max_x, max_y;
- int cur_x, cur_y;
- int line_size;
-} stbi_gif;
-
-static int gif_test(stbi *s)
-{
- int sz;
- if (get8(s) != 'G' || get8(s) != 'I' || get8(s) != 'F' || get8(s) != '8') return 0;
- sz = get8(s);
- if (sz != '9' && sz != '7') return 0;
- if (get8(s) != 'a') return 0;
- return 1;
-}
-
-static int stbi_gif_test(stbi *s)
-{
- int r = gif_test(s);
- stbi_rewind(s);
- return r;
-}
-
-static void stbi_gif_parse_colortable(stbi *s, uint8 pal[256][4], int num_entries, int transp)
-{
- int i;
- for (i=0; i < num_entries; ++i) {
- pal[i][2] = get8u(s);
- pal[i][1] = get8u(s);
- pal[i][0] = get8u(s);
- pal[i][3] = transp ? 0 : 255;
- }
-}
-
-static int stbi_gif_header(stbi *s, stbi_gif *g, int *comp, int is_info)
-{
- uint8 version;
- if (get8(s) != 'G' || get8(s) != 'I' || get8(s) != 'F' || get8(s) != '8')
- return e("not GIF", "Corrupt GIF");
-
- version = get8u(s);
- if (version != '7' && version != '9') return e("not GIF", "Corrupt GIF");
- if (get8(s) != 'a') return e("not GIF", "Corrupt GIF");
-
- failure_reason = "";
- g->w = get16le(s);
- g->h = get16le(s);
- g->flags = get8(s);
- g->bgindex = get8(s);
- g->ratio = get8(s);
- g->transparent = -1;
-
- if (comp != 0) *comp = 4; // can't actually tell whether it's 3 or 4 until we parse the comments
-
- if (is_info) return 1;
-
- if (g->flags & 0x80)
- stbi_gif_parse_colortable(s,g->pal, 2 << (g->flags & 7), -1);
-
- return 1;
-}
-
-static int stbi_gif_info_raw(stbi *s, int *x, int *y, int *comp)
-{
- stbi_gif g;
- if (!stbi_gif_header(s, &g, comp, 1)) {
- stbi_rewind( s );
- return 0;
- }
- if (x) *x = g.w;
- if (y) *y = g.h;
- return 1;
-}
-
-static void stbi_out_gif_code(stbi_gif *g, uint16 code)
-{
- uint8 *p, *c;
-
- // recurse to decode the prefixes, since the linked-list is backwards,
- // and working backwards through an interleaved image would be nasty
- if (g->codes[code].prefix >= 0)
- stbi_out_gif_code(g, g->codes[code].prefix);
-
- if (g->cur_y >= g->max_y) return;
-
- p = &g->out[g->cur_x + g->cur_y];
- c = &g->color_table[g->codes[code].suffix * 4];
-
- if (c[3] >= 128) {
- p[0] = c[2];
- p[1] = c[1];
- p[2] = c[0];
- p[3] = c[3];
- }
- g->cur_x += 4;
-
- if (g->cur_x >= g->max_x) {
- g->cur_x = g->start_x;
- g->cur_y += g->step;
-
- while (g->cur_y >= g->max_y && g->parse > 0) {
- g->step = (1 << g->parse) * g->line_size;
- g->cur_y = g->start_y + (g->step >> 1);
- --g->parse;
- }
- }
-}
-
-static uint8 *stbi_process_gif_raster(stbi *s, stbi_gif *g)
-{
- uint8 lzw_cs;
- int32 len, code;
- uint32 first;
- int32 codesize, codemask, avail, oldcode, bits, valid_bits, clear;
- stbi_gif_lzw *p;
-
- lzw_cs = get8u(s);
- clear = 1 << lzw_cs;
- first = 1;
- codesize = lzw_cs + 1;
- codemask = (1 << codesize) - 1;
- bits = 0;
- valid_bits = 0;
- for (code = 0; code < clear; code++) {
- g->codes[code].prefix = -1;
- g->codes[code].first = (uint8) code;
- g->codes[code].suffix = (uint8) code;
- }
-
- // support no starting clear code
- avail = clear+2;
- oldcode = -1;
-
- len = 0;
- for(;;) {
- if (valid_bits < codesize) {
- if (len == 0) {
- len = get8(s); // start new block
- if (len == 0)
- return g->out;
- }
- --len;
- bits |= (int32) get8(s) << valid_bits;
- valid_bits += 8;
- } else {
- int32 code = bits & codemask;
- bits >>= codesize;
- valid_bits -= codesize;
- // @OPTIMIZE: is there some way we can accelerate the non-clear path?
- if (code == clear) { // clear code
- codesize = lzw_cs + 1;
- codemask = (1 << codesize) - 1;
- avail = clear + 2;
- oldcode = -1;
- first = 0;
- } else if (code == clear + 1) { // end of stream code
- skip(s, len);
- while ((len = get8(s)) > 0)
- skip(s,len);
- return g->out;
- } else if (code <= avail) {
- if (first) return epuc("no clear code", "Corrupt GIF");
-
- if (oldcode >= 0) {
- p = &g->codes[avail++];
- if (avail > 4096) return epuc("too many codes", "Corrupt GIF");
- p->prefix = (int16) oldcode;
- p->first = g->codes[oldcode].first;
- p->suffix = (code == avail) ? p->first : g->codes[code].first;
- } else if (code == avail)
- return epuc("illegal code in raster", "Corrupt GIF");
-
- stbi_out_gif_code(g, (uint16) code);
-
- if ((avail & codemask) == 0 && avail <= 0x0FFF) {
- codesize++;
- codemask = (1 << codesize) - 1;
- }
-
- oldcode = code;
- } else {
- return epuc("illegal code in raster", "Corrupt GIF");
- }
- }
- }
-}
-
-static void stbi_fill_gif_background(stbi_gif *g)
-{
- int i;
- uint8 *c = g->pal[g->bgindex];
- // @OPTIMIZE: write a dword at a time
- for (i = 0; i < g->w * g->h * 4; i += 4) {
- uint8 *p = &g->out[i];
- p[0] = c[2];
- p[1] = c[1];
- p[2] = c[0];
- p[3] = c[3];
- }
-}
-
-// this function is designed to support animated gifs, although stb_image doesn't support it
-static uint8 *stbi_gif_load_next(stbi *s, stbi_gif *g, int *comp, int req_comp)
-{
- int i;
- uint8 *old_out = 0;
-
- if (g->out == 0) {
- if (!stbi_gif_header(s, g, comp,0)) return 0; // failure_reason set by stbi_gif_header
- g->out = (uint8 *) malloc(4 * g->w * g->h);
- if (g->out == 0) return epuc("outofmem", "Out of memory");
- stbi_fill_gif_background(g);
- } else {
- // animated-gif-only path
- if (((g->eflags & 0x1C) >> 2) == 3) {
- old_out = g->out;
- g->out = (uint8 *) malloc(4 * g->w * g->h);
- if (g->out == 0) return epuc("outofmem", "Out of memory");
- memcpy(g->out, old_out, g->w*g->h*4);
- }
- }
-
- for (;;) {
- switch (get8(s)) {
- case 0x2C: /* Image Descriptor */
- {
- int32 x, y, w, h;
- uint8 *o;
-
- x = get16le(s);
- y = get16le(s);
- w = get16le(s);
- h = get16le(s);
- if (((x + w) > (g->w)) || ((y + h) > (g->h)))
- return epuc("bad Image Descriptor", "Corrupt GIF");
-
- g->line_size = g->w * 4;
- g->start_x = x * 4;
- g->start_y = y * g->line_size;
- g->max_x = g->start_x + w * 4;
- g->max_y = g->start_y + h * g->line_size;
- g->cur_x = g->start_x;
- g->cur_y = g->start_y;
-
- g->lflags = get8(s);
-
- if (g->lflags & 0x40) {
- g->step = 8 * g->line_size; // first interlaced spacing
- g->parse = 3;
- } else {
- g->step = g->line_size;
- g->parse = 0;
- }
-
- if (g->lflags & 0x80) {
- stbi_gif_parse_colortable(s,g->lpal, 2 << (g->lflags & 7), g->eflags & 0x01 ? g->transparent : -1);
- g->color_table = (uint8 *) g->lpal;
- } else if (g->flags & 0x80) {
- for (i=0; i < 256; ++i) // @OPTIMIZE: reset only the previous transparent
- g->pal[i][3] = 255;
- if (g->transparent >= 0 && (g->eflags & 0x01))
- g->pal[g->transparent][3] = 0;
- g->color_table = (uint8 *) g->pal;
- } else
- return epuc("missing color table", "Corrupt GIF");
-
- o = stbi_process_gif_raster(s, g);
- if (o == NULL) return NULL;
-
- if (req_comp && req_comp != 4)
- o = convert_format(o, 4, req_comp, g->w, g->h);
- return o;
- }
-
- case 0x21: // Comment Extension.
- {
- int len;
- if (get8(s) == 0xF9) { // Graphic Control Extension.
- len = get8(s);
- if (len == 4) {
- g->eflags = get8(s);
- get16le(s); // delay
- g->transparent = get8(s);
- } else {
- skip(s, len);
- break;
- }
- }
- while ((len = get8(s)) != 0)
- skip(s, len);
- break;
- }
-
- case 0x3B: // gif stream termination code
- return (uint8 *) 1;
-
- default:
- return epuc("unknown code", "Corrupt GIF");
- }
- }
-}
-
-static stbi_uc *stbi_gif_load(stbi *s, int *x, int *y, int *comp, int req_comp)
-{
- uint8 *u = 0;
- stbi_gif g={0};
-
- u = stbi_gif_load_next(s, &g, comp, req_comp);
- if (u == (void *) 1) u = 0; // end of animated gif marker
- if (u) {
- *x = g.w;
- *y = g.h;
- }
-
- return u;
-}
-
-static int stbi_gif_info(stbi *s, int *x, int *y, int *comp)
-{
- return stbi_gif_info_raw(s,x,y,comp);
-}
-
-
-// *************************************************************************************************
-// Radiance RGBE HDR loader
-// originally by Nicolas Schulz
-#ifndef STBI_NO_HDR
-static int hdr_test(stbi *s)
-{
- const char *signature = "#?RADIANCE\n";
- int i;
- for (i=0; signature[i]; ++i)
- if (get8(s) != signature[i])
- return 0;
- return 1;
-}
-
-static int stbi_hdr_test(stbi* s)
-{
- int r = hdr_test(s);
- stbi_rewind(s);
- return r;
-}
-
-#define HDR_BUFLEN 1024
-static char *hdr_gettoken(stbi *z, char *buffer)
-{
- int len=0;
- char c = '\0';
-
- c = (char) get8(z);
-
- while (!at_eof(z) && c != '\n') {
- buffer[len++] = c;
- if (len == HDR_BUFLEN-1) {
- // flush to end of line
- while (!at_eof(z) && get8(z) != '\n')
- ;
- break;
- }
- c = (char) get8(z);
- }
-
- buffer[len] = 0;
- return buffer;
-}
-
-static void hdr_convert(float *output, stbi_uc *input, int req_comp)
-{
- if ( input[3] != 0 ) {
- float f1;
- // Exponent
- f1 = (float) ldexp(1.0f, input[3] - (int)(128 + 8));
- if (req_comp <= 2)
- output[0] = (input[0] + input[1] + input[2]) * f1 / 3;
- else {
- output[0] = input[0] * f1;
- output[1] = input[1] * f1;
- output[2] = input[2] * f1;
- }
- if (req_comp == 2) output[1] = 1;
- if (req_comp == 4) output[3] = 1;
- } else {
- switch (req_comp) {
- case 4: output[3] = 1; /* fallthrough */
- case 3: output[0] = output[1] = output[2] = 0;
- break;
- case 2: output[1] = 1; /* fallthrough */
- case 1: output[0] = 0;
- break;
- }
- }
-}
-
-static float *hdr_load(stbi *s, int *x, int *y, int *comp, int req_comp)
-{
- char buffer[HDR_BUFLEN];
- char *token;
- int valid = 0;
- int width, height;
- stbi_uc *scanline;
- float *hdr_data;
- int len;
- unsigned char count, value;
- int i, j, k, c1,c2, z;
-
-
- // Check identifier
- if (strcmp(hdr_gettoken(s,buffer), "#?RADIANCE") != 0)
- return epf("not HDR", "Corrupt HDR image");
-
- // Parse header
- for(;;) {
- token = hdr_gettoken(s,buffer);
- if (token[0] == 0) break;
- if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1;
- }
-
- if (!valid) return epf("unsupported format", "Unsupported HDR format");
-
- // Parse width and height
- // can't use sscanf() if we're not using stdio!
- token = hdr_gettoken(s,buffer);
- if (strncmp(token, "-Y ", 3)) return epf("unsupported data layout", "Unsupported HDR format");
- token += 3;
- height = strtol(token, &token, 10);
- while (*token == ' ') ++token;
- if (strncmp(token, "+X ", 3)) return epf("unsupported data layout", "Unsupported HDR format");
- token += 3;
- width = strtol(token, NULL, 10);
-
- *x = width;
- *y = height;
-
- *comp = 3;
- if (req_comp == 0) req_comp = 3;
-
- // Read data
- hdr_data = (float *) malloc(height * width * req_comp * sizeof(float));
-
- // Load image data
- // image data is stored as some number of sca
- if ( width < 8 || width >= 32768) {
- // Read flat data
- for (j=0; j < height; ++j) {
- for (i=0; i < width; ++i) {
- stbi_uc rgbe[4];
- main_decode_loop:
- getn(s, rgbe, 4);
- hdr_convert(hdr_data + j * width * req_comp + i * req_comp, rgbe, req_comp);
- }
- }
- } else {
- // Read RLE-encoded data
- scanline = NULL;
-
- for (j = 0; j < height; ++j) {
- c1 = get8(s);
- c2 = get8(s);
- len = get8(s);
- if (c1 != 2 || c2 != 2 || (len & 0x80)) {
- // not run-length encoded, so we have to actually use THIS data as a decoded
- // pixel (note this can't be a valid pixel--one of RGB must be >= 128)
- uint8 rgbe[4];
- rgbe[0] = (uint8) c1;
- rgbe[1] = (uint8) c2;
- rgbe[2] = (uint8) len;
- rgbe[3] = (uint8) get8u(s);
- hdr_convert(hdr_data, rgbe, req_comp);
- i = 1;
- j = 0;
- free(scanline);
- goto main_decode_loop; // yes, this makes no sense
- }
- len <<= 8;
- len |= get8(s);
- if (len != width) { free(hdr_data); free(scanline); return epf("invalid decoded scanline length", "corrupt HDR"); }
- if (scanline == NULL) scanline = (stbi_uc *) malloc(width * 4);
-
- for (k = 0; k < 4; ++k) {
- i = 0;
- while (i < width) {
- count = get8u(s);
- if (count > 128) {
- // Run
- value = get8u(s);
- count -= 128;
- for (z = 0; z < count; ++z)
- scanline[i++ * 4 + k] = value;
- } else {
- // Dump
- for (z = 0; z < count; ++z)
- scanline[i++ * 4 + k] = get8u(s);
- }
- }
- }
- for (i=0; i < width; ++i)
- hdr_convert(hdr_data+(j*width + i)*req_comp, scanline + i*4, req_comp);
- }
- free(scanline);
- }
-
- return hdr_data;
-}
-
-static float *stbi_hdr_load(stbi *s, int *x, int *y, int *comp, int req_comp)
-{
- return hdr_load(s,x,y,comp,req_comp);
-}
-
-static int stbi_hdr_info(stbi *s, int *x, int *y, int *comp)
-{
- char buffer[HDR_BUFLEN];
- char *token;
- int valid = 0;
-
- if (strcmp(hdr_gettoken(s,buffer), "#?RADIANCE") != 0) {
- stbi_rewind( s );
- return 0;
- }
-
- for(;;) {
- token = hdr_gettoken(s,buffer);
- if (token[0] == 0) break;
- if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1;
- }
-
- if (!valid) {
- stbi_rewind( s );
- return 0;
- }
- token = hdr_gettoken(s,buffer);
- if (strncmp(token, "-Y ", 3)) {
- stbi_rewind( s );
- return 0;
- }
- token += 3;
- *y = strtol(token, &token, 10);
- while (*token == ' ') ++token;
- if (strncmp(token, "+X ", 3)) {
- stbi_rewind( s );
- return 0;
- }
- token += 3;
- *x = strtol(token, NULL, 10);
- *comp = 3;
- return 1;
-}
-#endif // STBI_NO_HDR
-
-static int stbi_bmp_info(stbi *s, int *x, int *y, int *comp)
-{
- int hsz;
- if (get8(s) != 'B' || get8(s) != 'M') {
- stbi_rewind( s );
- return 0;
- }
- skip(s,12);
- hsz = get32le(s);
- if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108) {
- stbi_rewind( s );
- return 0;
- }
- if (hsz == 12) {
- *x = get16le(s);
- *y = get16le(s);
- } else {
- *x = get32le(s);
- *y = get32le(s);
- }
- if (get16le(s) != 1) {
- stbi_rewind( s );
- return 0;
- }
- *comp = get16le(s) / 8;
- return 1;
-}
-
-static int stbi_psd_info(stbi *s, int *x, int *y, int *comp)
-{
- int channelCount;
- if (get32(s) != 0x38425053) {
- stbi_rewind( s );
- return 0;
- }
- if (get16(s) != 1) {
- stbi_rewind( s );
- return 0;
- }
- skip(s, 6);
- channelCount = get16(s);
- if (channelCount < 0 || channelCount > 16) {
- stbi_rewind( s );
- return 0;
- }
- *y = get32(s);
- *x = get32(s);
- if (get16(s) != 8) {
- stbi_rewind( s );
- return 0;
- }
- if (get16(s) != 3) {
- stbi_rewind( s );
- return 0;
- }
- *comp = 4;
- return 1;
-}
-
-static int stbi_pic_info(stbi *s, int *x, int *y, int *comp)
-{
- int act_comp=0,num_packets=0,chained;
- pic_packet_t packets[10];
-
- skip(s, 92);
-
- *x = get16(s);
- *y = get16(s);
- if (at_eof(s)) return 0;
- if ( (*x) != 0 && (1 << 28) / (*x) < (*y)) {
- stbi_rewind( s );
- return 0;
- }
-
- skip(s, 8);
-
- do {
- pic_packet_t *packet;
-
- if (num_packets==sizeof(packets)/sizeof(packets[0]))
- return 0;
-
- packet = &packets[num_packets++];
- chained = get8(s);
- packet->size = get8u(s);
- packet->type = get8u(s);
- packet->channel = get8u(s);
- act_comp |= packet->channel;
-
- if (at_eof(s)) {
- stbi_rewind( s );
- return 0;
- }
- if (packet->size != 8) {
- stbi_rewind( s );
- return 0;
- }
- } while (chained);
-
- *comp = (act_comp & 0x10 ? 4 : 3);
-
- return 1;
-}
-
-static int stbi_info_main(stbi *s, int *x, int *y, int *comp)
-{
- if (stbi_jpeg_info(s, x, y, comp))
- return 1;
- if (stbi_png_info(s, x, y, comp))
- return 1;
- if (stbi_gif_info(s, x, y, comp))
- return 1;
- if (stbi_bmp_info(s, x, y, comp))
- return 1;
- if (stbi_psd_info(s, x, y, comp))
- return 1;
- if (stbi_pic_info(s, x, y, comp))
- return 1;
- #ifndef STBI_NO_HDR
- if (stbi_hdr_info(s, x, y, comp))
- return 1;
- #endif
- // test tga last because it's a crappy test!
- if (stbi_tga_info(s, x, y, comp))
- return 1;
- return e("unknown image type", "Image not of any known type, or corrupt");
-}
-
-#ifndef STBI_NO_STDIO
-int stbi_info(char const *filename, int *x, int *y, int *comp)
-{
- FILE *f = fopen(filename, "rb");
- int result;
- if (!f) return e("can't fopen", "Unable to open file");
- result = stbi_info_from_file(f, x, y, comp);
- fclose(f);
- return result;
-}
-
-int stbi_info_from_file(FILE *f, int *x, int *y, int *comp)
-{
- int r;
- stbi s;
- long pos = ftell(f);
- start_file(&s, f);
- r = stbi_info_main(&s,x,y,comp);
- fseek(f,pos,SEEK_SET);
- return r;
-}
-#endif // !STBI_NO_STDIO
-
-int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp)
-{
- stbi s;
- start_mem(&s,buffer,len);
- return stbi_info_main(&s,x,y,comp);
-}
-
-int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp)
-{
- stbi s;
- start_callbacks(&s, (stbi_io_callbacks *) c, user);
- return stbi_info_main(&s,x,y,comp);
-}
-
-#endif // STBI_HEADER_FILE_ONLY
-
-/*
- revision history:
- 1.33 (2011-07-14)
- make stbi_is_hdr work in STBI_NO_HDR (as specified), minor compiler-friendly improvements
- 1.32 (2011-07-13)
- support for "info" function for all supported filetypes (SpartanJ)
- 1.31 (2011-06-20)
- a few more leak fixes, bug in PNG handling (SpartanJ)
- 1.30 (2011-06-11)
- added ability to load files via callbacks to accomidate custom input streams (Ben Wenger)
- removed deprecated format-specific test/load functions
- removed support for installable file formats (stbi_loader) -- would have been broken for IO callbacks anyway
- error cases in bmp and tga give messages and don't leak (Raymond Barbiero, grisha)
- fix inefficiency in decoding 32-bit BMP (David Woo)
- 1.29 (2010-08-16)
- various warning fixes from Aurelien Pocheville
- 1.28 (2010-08-01)
- fix bug in GIF palette transparency (SpartanJ)
- 1.27 (2010-08-01)
- cast-to-uint8 to fix warnings
- 1.26 (2010-07-24)
- fix bug in file buffering for PNG reported by SpartanJ
- 1.25 (2010-07-17)
- refix trans_data warning (Won Chun)
- 1.24 (2010-07-12)
- perf improvements reading from files on platforms with lock-heavy fgetc()
- minor perf improvements for jpeg
- deprecated type-specific functions so we'll get feedback if they're needed
- attempt to fix trans_data warning (Won Chun)
- 1.23 fixed bug in iPhone support
- 1.22 (2010-07-10)
- removed image *writing* support
- stbi_info support from Jetro Lauha
- GIF support from Jean-Marc Lienher
- iPhone PNG-extensions from James Brown
- warning-fixes from Nicolas Schulz and Janez Zemva (i.e. Janez (U+017D)emva)
- 1.21 fix use of 'uint8' in header (reported by jon blow)
- 1.20 added support for Softimage PIC, by Tom Seddon
- 1.19 bug in interlaced PNG corruption check (found by ryg)
- 1.18 2008-08-02
- fix a threading bug (local mutable static)
- 1.17 support interlaced PNG
- 1.16 major bugfix - convert_format converted one too many pixels
- 1.15 initialize some fields for thread safety
- 1.14 fix threadsafe conversion bug
- header-file-only version (#define STBI_HEADER_FILE_ONLY before including)
- 1.13 threadsafe
- 1.12 const qualifiers in the API
- 1.11 Support installable IDCT, colorspace conversion routines
- 1.10 Fixes for 64-bit (don't use "unsigned long")
- optimized upsampling by Fabian "ryg" Giesen
- 1.09 Fix format-conversion for PSD code (bad global variables!)
- 1.08 Thatcher Ulrich's PSD code integrated by Nicolas Schulz
- 1.07 attempt to fix C++ warning/errors again
- 1.06 attempt to fix C++ warning/errors again
- 1.05 fix TGA loading to return correct *comp and use good luminance calc
- 1.04 default float alpha is 1, not 255; use 'void *' for stbi_image_free
- 1.03 bugfixes to STBI_NO_STDIO, STBI_NO_HDR
- 1.02 support for (subset of) HDR files, float interface for preferred access to them
- 1.01 fix bug: possible bug in handling right-side up bmps... not sure
- fix bug: the stbi_bmp_load() and stbi_tga_load() functions didn't work at all
- 1.00 interface to zlib that skips zlib header
- 0.99 correct handling of alpha in palette
- 0.98 TGA loader by lonesock; dynamically add loaders (untested)
- 0.97 jpeg errors on too large a file; also catch another malloc failure
- 0.96 fix detection of invalid v value - particleman@mollyrocket forum
- 0.95 during header scan, seek to markers in case of padding
- 0.94 STBI_NO_STDIO to disable stdio usage; rename all #defines the same
- 0.93 handle jpegtran output; verbose errors
- 0.92 read 4,8,16,24,32-bit BMP files of several formats
- 0.91 output 24-bit Windows 3.0 BMP files
- 0.90 fix a few more warnings; bump version number to approach 1.0
- 0.61 bugfixes due to Marc LeBlanc, Christopher Lloyd
- 0.60 fix compiling as c++
- 0.59 fix warnings: merge Dave Moore's -Wall fixes
- 0.58 fix bug: zlib uncompressed mode len/nlen was wrong endian
- 0.57 fix bug: jpg last huffman symbol before marker was >9 bits but less than 16 available
- 0.56 fix bug: zlib uncompressed mode len vs. nlen
- 0.55 fix bug: restart_interval not initialized to 0
- 0.54 allow NULL for 'int *comp'
- 0.53 fix bug in png 3->4; speedup png decoding
- 0.52 png handles req_comp=3,4 directly; minor cleanup; jpeg comments
- 0.51 obey req_comp requests, 1-component jpegs return as 1-component,
- on 'test' only check type, not whether we support this variant
- 0.50 first released version
-*/
diff --git a/src/SFML/Main/CMakeLists.txt b/src/SFML/Main/CMakeLists.txt
index ac006c3..d18ee40 100644
--- a/src/SFML/Main/CMakeLists.txt
+++ b/src/SFML/Main/CMakeLists.txt
@@ -33,5 +33,5 @@ install(TARGETS sfml-main ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT devel)
# 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)
+ 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
index 5dfb6f5..2069402 100644
--- a/src/SFML/Main/MainAndroid.cpp
+++ b/src/SFML/Main/MainAndroid.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Main/MainWin32.cpp b/src/SFML/Main/MainWin32.cpp
index 25a6247..c9f2873 100644
--- a/src/SFML/Main/MainWin32.cpp
+++ b/src/SFML/Main/MainWin32.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
diff --git a/src/SFML/Main/MainiOS.mm b/src/SFML/Main/MainiOS.mm
index ec07810..48040e6 100644
--- a/src/SFML/Main/MainiOS.mm
+++ b/src/SFML/Main/MainiOS.mm
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.prg)
// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
diff --git a/src/SFML/Main/SFMLActivity.cpp b/src/SFML/Main/SFMLActivity.cpp
index 549303d..07602fb 100644
--- a/src/SFML/Main/SFMLActivity.cpp
+++ b/src/SFML/Main/SFMLActivity.cpp
@@ -23,7 +23,6 @@
////////////////////////////////////////////////////////////
#include <SFML/Config.hpp>
-#include <string>
#include <android/native_activity.h>
#include <android/log.h>
#include <dlfcn.h>
@@ -37,13 +36,14 @@ namespace {
typedef void (*activityOnCreatePointer)(ANativeActivity*, void*, size_t);
}
-std::string getLibraryName(JNIEnv* lJNIEnv, jobject& objectActivityInfo)
+const char *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");
+ static char name[256];
// Get metaData instance from the ActivityInfo object
jclass classActivityInfo = lJNIEnv->FindClass("android/content/pm/ActivityInfo");
@@ -58,7 +58,7 @@ std::string getLibraryName(JNIEnv* lJNIEnv, jobject& objectActivityInfo)
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
+ // No meta-data "sfml.app.lib_name" was found so we abort and inform the user
if (valueString == NULL)
{
LOGE("No meta-data 'sfml.app.lib_name' found in AndroidManifest.xml file");
@@ -68,10 +68,18 @@ std::string getLibraryName(JNIEnv* lJNIEnv, jobject& objectActivityInfo)
// 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);
+
+ if (applicationNameLength >= 256)
+ {
+ LOGE("The value of 'sfml.app.lib_name' must not be longer than 255 characters.");
+ exit(1);
+ }
+
+ strncpy(name, applicationName, applicationNameLength);
+ name[applicationNameLength] = '\0';
lJNIEnv->ReleaseStringUTFChars(valueString, applicationName);
- return ret;
+ return name;
}
void* loadLibrary(const char* libraryName, JNIEnv* lJNIEnv, jobject& ObjectActivityInfo)
@@ -159,8 +167,13 @@ void ANativeActivity_onCreate(ANativeActivity* activity, void* savedState, size_
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);
+#if defined(STL_LIBRARY)
+#define _SFML_QS(s) _SFML_S(s)
+#define _SFML_S(s) #s
+ loadLibrary(_SFML_QS(STL_LIBRARY), lJNIEnv, ObjectActivityInfo);
+#undef _SFML_S
+#undef _SFML_QS
+#endif
loadLibrary("openal", lJNIEnv, ObjectActivityInfo);
#if !defined(SFML_DEBUG)
@@ -177,8 +190,7 @@ void ANativeActivity_onCreate(ANativeActivity* activity, void* savedState, size_
loadLibrary("sfml-network-d", lJNIEnv, ObjectActivityInfo);
#endif
- std::string libName = getLibraryName(lJNIEnv, ObjectActivityInfo);
- void* handle = loadLibrary(libName.c_str(), lJNIEnv, ObjectActivityInfo);
+ void* handle = loadLibrary(getLibraryName(lJNIEnv, ObjectActivityInfo), lJNIEnv, ObjectActivityInfo);
// Call the original ANativeActivity_onCreate function
activityOnCreatePointer ANativeActivity_onCreate = (activityOnCreatePointer)dlsym(handle, "ANativeActivity_onCreate");
diff --git a/src/SFML/Network/Ftp.cpp b/src/SFML/Network/Ftp.cpp
index 0f4049e..44a03b8 100644
--- a/src/SFML/Network/Ftp.cpp
+++ b/src/SFML/Network/Ftp.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Network/Http.cpp b/src/SFML/Network/Http.cpp
index df3ebb4..68737f4 100644
--- a/src/SFML/Network/Http.cpp
+++ b/src/SFML/Network/Http.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -107,7 +107,6 @@ std::string Http::Request::prepare() const
std::string method;
switch (m_method)
{
- default:
case Get: method = "GET"; break;
case Post: method = "POST"; break;
case Head: method = "HEAD"; break;
diff --git a/src/SFML/Network/IpAddress.cpp b/src/SFML/Network/IpAddress.cpp
index 0459091..19f0840 100644
--- a/src/SFML/Network/IpAddress.cpp
+++ b/src/SFML/Network/IpAddress.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Network/Packet.cpp b/src/SFML/Network/Packet.cpp
index 31fe259..2c5d0e0 100644
--- a/src/SFML/Network/Packet.cpp
+++ b/src/SFML/Network/Packet.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,6 +37,7 @@ namespace sf
////////////////////////////////////////////////////////////
Packet::Packet() :
m_readPos(0),
+m_sendPos(0),
m_isValid(true)
{
diff --git a/src/SFML/Network/Socket.cpp b/src/SFML/Network/Socket.cpp
index a74aa10..58ff16a 100644
--- a/src/SFML/Network/Socket.cpp
+++ b/src/SFML/Network/Socket.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Network/SocketImpl.hpp b/src/SFML/Network/SocketImpl.hpp
index fbe45bc..423787e 100644
--- a/src/SFML/Network/SocketImpl.hpp
+++ b/src/SFML/Network/SocketImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Network/SocketSelector.cpp b/src/SFML/Network/SocketSelector.cpp
index 8b521bb..31e82d8 100644
--- a/src/SFML/Network/SocketSelector.cpp
+++ b/src/SFML/Network/SocketSelector.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Network/TcpListener.cpp b/src/SFML/Network/TcpListener.cpp
index 78f7f43..7a68707 100644
--- a/src/SFML/Network/TcpListener.cpp
+++ b/src/SFML/Network/TcpListener.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Network/TcpSocket.cpp b/src/SFML/Network/TcpSocket.cpp
index ac6d6b9..5a032ef 100644
--- a/src/SFML/Network/TcpSocket.cpp
+++ b/src/SFML/Network/TcpSocket.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -219,6 +219,18 @@ void TcpSocket::disconnect()
////////////////////////////////////////////////////////////
Socket::Status TcpSocket::send(const void* data, std::size_t size)
{
+ if (!isBlocking())
+ err() << "Warning: Partial sends might not be handled properly." << std::endl;
+
+ std::size_t sent;
+
+ return send(data, size, sent);
+}
+
+
+////////////////////////////////////////////////////////////
+Socket::Status TcpSocket::send(const void* data, std::size_t size, std::size_t& sent)
+{
// Check the parameters
if (!data || (size == 0))
{
@@ -227,16 +239,22 @@ Socket::Status TcpSocket::send(const void* data, std::size_t size)
}
// Loop until every byte has been sent
- int sent = 0;
- int sizeToSend = static_cast<int>(size);
- for (int length = 0; length < sizeToSend; length += sent)
+ int result = 0;
+ for (sent = 0; sent < size; sent += result)
{
// Send a chunk of data
- sent = ::send(getHandle(), static_cast<const char*>(data) + length, sizeToSend - length, flags);
+ result = ::send(getHandle(), static_cast<const char*>(data) + sent, size - sent, flags);
// Check for errors
- if (sent < 0)
- return priv::SocketImpl::getErrorStatus();
+ if (result < 0)
+ {
+ Status status = priv::SocketImpl::getErrorStatus();
+
+ if ((status == NotReady) && sent)
+ return Partial;
+
+ return status;
+ }
}
return Done;
@@ -294,17 +312,30 @@ Socket::Status TcpSocket::send(Packet& packet)
// 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());
+ std::size_t sent;
+ Status status = send(&blockToSend[0] + packet.m_sendPos, blockToSend.size() - packet.m_sendPos, sent);
+
+ // In the case of a partial send, record the location to resume from
+ if (status == Partial)
+ {
+ packet.m_sendPos += sent;
+ }
+ else if (status == Done)
+ {
+ packet.m_sendPos = 0;
+ }
+
+ return status;
}
diff --git a/src/SFML/Network/UdpSocket.cpp b/src/SFML/Network/UdpSocket.cpp
index af56f5d..ffa1494 100644
--- a/src/SFML/Network/UdpSocket.cpp
+++ b/src/SFML/Network/UdpSocket.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Network/Unix/SocketImpl.cpp b/src/SFML/Network/Unix/SocketImpl.cpp
index a36e617..9a33d90 100644
--- a/src/SFML/Network/Unix/SocketImpl.cpp
+++ b/src/SFML/Network/Unix/SocketImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Network/Unix/SocketImpl.hpp b/src/SFML/Network/Unix/SocketImpl.hpp
index 8a3f29f..c54c55f 100644
--- a/src/SFML/Network/Unix/SocketImpl.hpp
+++ b/src/SFML/Network/Unix/SocketImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Network/Win32/SocketImpl.cpp b/src/SFML/Network/Win32/SocketImpl.cpp
index 3fc6bb2..0f19842 100644
--- a/src/SFML/Network/Win32/SocketImpl.cpp
+++ b/src/SFML/Network/Win32/SocketImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Network/Win32/SocketImpl.hpp b/src/SFML/Network/Win32/SocketImpl.hpp
index 8178c7c..f6cabaf 100644
--- a/src/SFML/Network/Win32/SocketImpl.hpp
+++ b/src/SFML/Network/Win32/SocketImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Android/Activity.cpp b/src/SFML/System/Android/Activity.cpp
index b5ba35d..fe3d015 100644
--- a/src/SFML/System/Android/Activity.cpp
+++ b/src/SFML/System/Android/Activity.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2013 Jonathan De Wachter (dewachter.jonathan@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
diff --git a/src/SFML/System/CMakeLists.txt b/src/SFML/System/CMakeLists.txt
index 74c95de..48629f4 100644
--- a/src/SFML/System/CMakeLists.txt
+++ b/src/SFML/System/CMakeLists.txt
@@ -35,6 +35,10 @@ set(SRC
${INCROOT}/Vector2.inl
${INCROOT}/Vector3.hpp
${INCROOT}/Vector3.inl
+ ${SRCROOT}/FileInputStream.cpp
+ ${INCROOT}/FileInputStream.hpp
+ ${SRCROOT}/MemoryInputStream.cpp
+ ${INCROOT}/MemoryInputStream.hpp
)
source_group("" FILES ${SRC})
diff --git a/src/SFML/System/Clock.cpp b/src/SFML/System/Clock.cpp
index d6ccf24..ba0bddb 100644
--- a/src/SFML/System/Clock.cpp
+++ b/src/SFML/System/Clock.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Err.cpp b/src/SFML/System/Err.cpp
index 1a38986..a7a408e 100644
--- a/src/SFML/System/Err.cpp
+++ b/src/SFML/System/Err.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,7 +38,7 @@ class DefaultErrStreamBuf : public std::streambuf
{
public:
- DefaultErrStreamBuf()
+ DefaultErrStreamBuf()
{
// Allocate the write buffer
static const int size = 64;
@@ -46,7 +46,7 @@ public:
setp(buffer, buffer + size);
}
- ~DefaultErrStreamBuf()
+ ~DefaultErrStreamBuf()
{
// Synchronize
sync();
diff --git a/src/SFML/System/FileInputStream.cpp b/src/SFML/System/FileInputStream.cpp
new file mode 100644
index 0000000..dee021f
--- /dev/null
+++ b/src/SFML/System/FileInputStream.cpp
@@ -0,0 +1,143 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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/FileInputStream.hpp>
+#ifdef ANDROID
+#include <SFML/System/Android/ResourceStream.hpp>
+#endif
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+FileInputStream::FileInputStream()
+: m_file(NULL)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+FileInputStream::~FileInputStream()
+{
+#ifdef ANDROID
+ if (m_file)
+ delete m_file;
+#else
+ if (m_file)
+ std::fclose(m_file);
+#endif
+}
+
+
+////////////////////////////////////////////////////////////
+bool FileInputStream::open(const std::string& filename)
+{
+#ifdef ANDROID
+ if (m_file)
+ delete m_file;
+ m_file = new sf::priv::ResourceStream(filename);
+#else
+ if (m_file)
+ std::fclose(m_file);
+
+ m_file = std::fopen(filename.c_str(), "rb");
+
+ return m_file != NULL;
+#endif
+}
+
+
+////////////////////////////////////////////////////////////
+Int64 FileInputStream::read(void* data, Int64 size)
+{
+#ifdef ANDROID
+ return m_file->read(data, size);
+#else
+ if (m_file)
+ return std::fread(data, 1, static_cast<std::size_t>(size), m_file);
+ else
+ return -1;
+#endif
+}
+
+
+////////////////////////////////////////////////////////////
+Int64 FileInputStream::seek(Int64 position)
+{
+#ifdef ANDROID
+ return m_file->seek(position);
+#else
+ if (m_file)
+ {
+ std::fseek(m_file, static_cast<std::size_t>(position), SEEK_SET);
+ return tell();
+ }
+ else
+ {
+ return -1;
+ }
+#endif
+}
+
+
+////////////////////////////////////////////////////////////
+Int64 FileInputStream::tell()
+{
+#ifdef ANDROID
+ return m_file->tell();
+#else
+ if (m_file)
+ return std::ftell(m_file);
+ else
+ return -1;
+#endif
+}
+
+
+////////////////////////////////////////////////////////////
+Int64 FileInputStream::getSize()
+{
+#ifdef ANDROID
+ return m_file->getSize();
+#else
+ if (m_file)
+ {
+ sf::Int64 position = tell();
+ std::fseek(m_file, 0, SEEK_END);
+ sf::Int64 size = tell();
+ seek(position);
+ return size;
+ }
+ else
+ {
+ return -1;
+ }
+#endif
+}
+
+} // namespace sf
diff --git a/src/SFML/System/Lock.cpp b/src/SFML/System/Lock.cpp
index 68a85de..90da155 100644
--- a/src/SFML/System/Lock.cpp
+++ b/src/SFML/System/Lock.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/MemoryInputStream.cpp b/src/SFML/System/MemoryInputStream.cpp
new file mode 100644
index 0000000..6c2d547
--- /dev/null
+++ b/src/SFML/System/MemoryInputStream.cpp
@@ -0,0 +1,101 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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/MemoryInputStream.hpp>
+#include <cstring>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+MemoryInputStream::MemoryInputStream() :
+m_data (NULL),
+m_size (0),
+m_offset(0)
+{
+}
+
+
+////////////////////////////////////////////////////////////
+void MemoryInputStream::open(const void* data, std::size_t sizeInBytes)
+{
+ m_data = static_cast<const char*>(data);
+ m_size = sizeInBytes;
+ m_offset = 0;
+}
+
+
+////////////////////////////////////////////////////////////
+Int64 MemoryInputStream::read(void* data, Int64 size)
+{
+ if (!m_data)
+ return -1;
+
+ Int64 endPosition = m_offset + size;
+ Int64 count = endPosition <= m_size ? size : m_size - m_offset;
+
+ if (count > 0)
+ {
+ std::memcpy(data, m_data + m_offset, static_cast<std::size_t>(count));
+ m_offset += count;
+ }
+
+ return count;
+}
+
+
+////////////////////////////////////////////////////////////
+Int64 MemoryInputStream::seek(Int64 position)
+{
+ if (!m_data)
+ return -1;
+
+ m_offset = position < m_size ? position : m_size;
+ return m_offset;
+}
+
+
+////////////////////////////////////////////////////////////
+Int64 MemoryInputStream::tell()
+{
+ if (!m_data)
+ return -1;
+
+ return m_offset;
+}
+
+
+////////////////////////////////////////////////////////////
+Int64 MemoryInputStream::getSize()
+{
+ if (!m_data)
+ return -1;
+
+ return m_size;
+}
+
+} // namespace sf
diff --git a/src/SFML/System/Mutex.cpp b/src/SFML/System/Mutex.cpp
index c339004..4d515fc 100644
--- a/src/SFML/System/Mutex.cpp
+++ b/src/SFML/System/Mutex.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Sleep.cpp b/src/SFML/System/Sleep.cpp
index 0bd375f..4765050 100644
--- a/src/SFML/System/Sleep.cpp
+++ b/src/SFML/System/Sleep.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/String.cpp b/src/SFML/System/String.cpp
index f0753dc..df5c169 100644
--- a/src/SFML/System/String.cpp
+++ b/src/SFML/System/String.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Thread.cpp b/src/SFML/System/Thread.cpp
index 4345802..5c4b08c 100644
--- a/src/SFML/System/Thread.cpp
+++ b/src/SFML/System/Thread.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/ThreadLocal.cpp b/src/SFML/System/ThreadLocal.cpp
index bac8229..8e9cda1 100644
--- a/src/SFML/System/ThreadLocal.cpp
+++ b/src/SFML/System/ThreadLocal.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Time.cpp b/src/SFML/System/Time.cpp
index 6eeaa30..2be34c9 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/ClockImpl.cpp b/src/SFML/System/Unix/ClockImpl.cpp
index 4ee8ddf..7233009 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/ClockImpl.hpp b/src/SFML/System/Unix/ClockImpl.hpp
index 1420b3e..24db7d9 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/MutexImpl.cpp b/src/SFML/System/Unix/MutexImpl.cpp
index 235393f..56d2854 100644
--- a/src/SFML/System/Unix/MutexImpl.cpp
+++ b/src/SFML/System/Unix/MutexImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/MutexImpl.hpp b/src/SFML/System/Unix/MutexImpl.hpp
index 03cb32e..d89365d 100644
--- a/src/SFML/System/Unix/MutexImpl.hpp
+++ b/src/SFML/System/Unix/MutexImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SleepImpl.cpp b/src/SFML/System/Unix/SleepImpl.cpp
index 08d00f8..611a554 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SleepImpl.hpp b/src/SFML/System/Unix/SleepImpl.hpp
index d0d38bc..4912581 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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 0d94dfa..39cdeab 100644
--- a/src/SFML/System/Unix/ThreadImpl.cpp
+++ b/src/SFML/System/Unix/ThreadImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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.hpp b/src/SFML/System/Unix/ThreadImpl.hpp
index d9e7bc9..37daae4 100644
--- a/src/SFML/System/Unix/ThreadImpl.hpp
+++ b/src/SFML/System/Unix/ThreadImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/ThreadLocalImpl.cpp b/src/SFML/System/Unix/ThreadLocalImpl.cpp
index 5ebb5a0..8af3974 100644
--- a/src/SFML/System/Unix/ThreadLocalImpl.cpp
+++ b/src/SFML/System/Unix/ThreadLocalImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/ThreadLocalImpl.hpp b/src/SFML/System/Unix/ThreadLocalImpl.hpp
index 07abdff..b591cb2 100644
--- a/src/SFML/System/Unix/ThreadLocalImpl.hpp
+++ b/src/SFML/System/Unix/ThreadLocalImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/ClockImpl.cpp b/src/SFML/System/Win32/ClockImpl.cpp
index 5b197a4..7ba7b9a 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/ClockImpl.hpp b/src/SFML/System/Win32/ClockImpl.hpp
index f01708a..3790491 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/MutexImpl.cpp b/src/SFML/System/Win32/MutexImpl.cpp
index f000e8d..047ea52 100644
--- a/src/SFML/System/Win32/MutexImpl.cpp
+++ b/src/SFML/System/Win32/MutexImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/MutexImpl.hpp b/src/SFML/System/Win32/MutexImpl.hpp
index 9604a5b..75a5fb6 100644
--- a/src/SFML/System/Win32/MutexImpl.hpp
+++ b/src/SFML/System/Win32/MutexImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SleepImpl.cpp b/src/SFML/System/Win32/SleepImpl.cpp
index 6f7106f..090c219 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SleepImpl.hpp b/src/SFML/System/Win32/SleepImpl.hpp
index c0fbe54..682ec7f 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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 1697702..dfe3c64 100644
--- a/src/SFML/System/Win32/ThreadImpl.cpp
+++ b/src/SFML/System/Win32/ThreadImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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.hpp b/src/SFML/System/Win32/ThreadImpl.hpp
index 00df619..94b45f8 100644
--- a/src/SFML/System/Win32/ThreadImpl.hpp
+++ b/src/SFML/System/Win32/ThreadImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/ThreadLocalImpl.cpp b/src/SFML/System/Win32/ThreadLocalImpl.cpp
index f617e84..0f0fb4a 100644
--- a/src/SFML/System/Win32/ThreadLocalImpl.cpp
+++ b/src/SFML/System/Win32/ThreadLocalImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/ThreadLocalImpl.hpp b/src/SFML/System/Win32/ThreadLocalImpl.hpp
index 83060b1..38bef43 100644
--- a/src/SFML/System/Win32/ThreadLocalImpl.hpp
+++ b/src/SFML/System/Win32/ThreadLocalImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Android/SensorImpl.cpp b/src/SFML/Window/Android/SensorImpl.cpp
index 4e36584..2b691a1 100644
--- a/src/SFML/Window/Android/SensorImpl.cpp
+++ b/src/SFML/Window/Android/SensorImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Android/SensorImpl.hpp b/src/SFML/Window/Android/SensorImpl.hpp
index d945c11..0b34997 100644
--- a/src/SFML/Window/Android/SensorImpl.hpp
+++ b/src/SFML/Window/Android/SensorImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/CMakeLists.txt b/src/SFML/Window/CMakeLists.txt
index 3046fec..386c077 100644
--- a/src/SFML/Window/CMakeLists.txt
+++ b/src/SFML/Window/CMakeLists.txt
@@ -53,6 +53,8 @@ if(SFML_OS_WINDOWS)
set(PLATFORM_SRC
${SRCROOT}/Win32/WglContext.cpp
${SRCROOT}/Win32/WglContext.hpp
+ ${SRCROOT}/Win32/WglExtensions.cpp
+ ${SRCROOT}/Win32/WglExtensions.hpp
${SRCROOT}/Win32/InputImpl.cpp
${SRCROOT}/Win32/InputImpl.hpp
${SRCROOT}/Win32/JoystickImpl.cpp
@@ -73,6 +75,8 @@ elseif(SFML_OS_LINUX OR SFML_OS_FREEBSD)
${SRCROOT}/Unix/Display.hpp
${SRCROOT}/Unix/InputImpl.cpp
${SRCROOT}/Unix/InputImpl.hpp
+ ${SRCROOT}/Unix/ScopedXcbPtr.hpp
+ ${SRCROOT}/Unix/ScopedXcbPtr.inl
${SRCROOT}/Unix/SensorImpl.cpp
${SRCROOT}/Unix/SensorImpl.hpp
${SRCROOT}/Unix/VideoModeImpl.cpp
@@ -84,6 +88,8 @@ elseif(SFML_OS_LINUX OR SFML_OS_FREEBSD)
${PLATFORM_SRC}
${SRCROOT}/Unix/GlxContext.cpp
${SRCROOT}/Unix/GlxContext.hpp
+ ${SRCROOT}/Unix/GlxExtensions.cpp
+ ${SRCROOT}/Unix/GlxExtensions.hpp
)
endif()
if(SFML_OS_LINUX)
@@ -184,8 +190,8 @@ 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")
+ if(NOT X11_FOUND)
+ message(FATAL_ERROR "X11 library not found")
endif()
include_directories(${X11_INCLUDE_DIR})
endif()
@@ -193,11 +199,11 @@ 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")
+ find_package(XCB COMPONENTS xlib_xcb image randr REQUIRED)
+ if(NOT LIBXCB_FOUND)
+ message(FATAL_ERROR "Xcb library not found")
endif()
- include_directories(${X11_INCLUDE_DIR})
+ include_directories(${LIBXCB_INCLUDE_DIRS})
endif()
endif()
if(SFML_OPENGL_ES AND SFML_OS_LINUX)
@@ -218,15 +224,15 @@ endif()
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})
+ list(APPEND WINDOW_EXT_LIBS ${X11_X11_LIB} ${LIBXCB_LIBRARIES} ${UDEV_LIBRARIES})
elseif(SFML_OS_FREEBSD)
- list(APPEND WINDOW_EXT_LIBS ${X11_X11_LIB} ${X11_Xrandr_LIB} usbhid)
+ list(APPEND WINDOW_EXT_LIBS ${X11_X11_LIB} ${LIBXCB_LIBRARIES} 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")
+ list(APPEND WINDOW_EXT_LIBS android)
endif()
if(SFML_OPENGL_ES)
if(SFML_OS_LINUX)
@@ -234,7 +240,7 @@ if(SFML_OPENGL_ES)
elseif(SFML_OS_IOS)
list(APPEND WINDOW_EXT_LIBS "-framework OpenGLES")
elseif(SFML_OS_ANDROID)
- list(APPEND WINDOW_EXT_LIBS "-lEGL -lGLESv1_CM")
+ list(APPEND WINDOW_EXT_LIBS EGL GLESv1_CM)
endif()
else()
list(APPEND WINDOW_EXT_LIBS ${OPENGL_gl_LIBRARY})
diff --git a/src/SFML/Window/Context.cpp b/src/SFML/Window/Context.cpp
index fc6cb55..0ec500a 100644
--- a/src/SFML/Window/Context.cpp
+++ b/src/SFML/Window/Context.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -54,6 +54,13 @@ bool Context::setActive(bool active)
////////////////////////////////////////////////////////////
+GlFunctionPointer Context::getFunction(const char* name)
+{
+ return priv::GlContext::getFunction(name);
+}
+
+
+////////////////////////////////////////////////////////////
Context::Context(const ContextSettings& settings, unsigned int width, unsigned int height)
{
m_context = priv::GlContext::create(settings, width, height);
diff --git a/src/SFML/Window/EglContext.cpp b/src/SFML/Window/EglContext.cpp
index b4182dd..ed7d294 100644
--- a/src/SFML/Window/EglContext.cpp
+++ b/src/SFML/Window/EglContext.cpp
@@ -47,15 +47,15 @@ namespace
#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
@@ -63,7 +63,7 @@ namespace
sf::Lock lock(states->mutex);
return states->display;
-
+
#endif
}
}
@@ -85,10 +85,10 @@ m_config (NULL)
// 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[] = {
+ EGLint attrib_list[] = {
EGL_WIDTH, 1,
EGL_HEIGHT,1,
EGL_NONE
@@ -120,15 +120,15 @@ m_config (NULL)
// 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
+ // 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
@@ -199,7 +199,7 @@ void EglContext::createContext(EglContext* shared)
EGL_CONTEXT_CLIENT_VERSION, 1,
EGL_NONE
};
-
+
EGLContext toShared;
if (shared)
@@ -243,13 +243,13 @@ EGLConfig EglContext::getBestConfig(EGLDisplay display, unsigned int bitsPerPixe
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];
}
@@ -260,44 +260,44 @@ XVisualInfo EglContext::selectBestVisual(::Display* XDisplay, unsigned int bitsP
{
// 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
diff --git a/src/SFML/Window/EglContext.hpp b/src/SFML/Window/EglContext.hpp
index 50b366e..ef30cb4 100644
--- a/src/SFML/Window/EglContext.hpp
+++ b/src/SFML/Window/EglContext.hpp
@@ -148,7 +148,7 @@ public:
///
////////////////////////////////////////////////////////////
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
diff --git a/src/SFML/Window/FreeBSD/JoystickImpl.cpp b/src/SFML/Window/FreeBSD/JoystickImpl.cpp
index c7392a8..ff21293 100644
--- a/src/SFML/Window/FreeBSD/JoystickImpl.cpp
+++ b/src/SFML/Window/FreeBSD/JoystickImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
// 2013-2013 David Demelier (demelier.david@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
diff --git a/src/SFML/Window/FreeBSD/JoystickImpl.hpp b/src/SFML/Window/FreeBSD/JoystickImpl.hpp
index 106da8c..b52307c 100644
--- a/src/SFML/Window/FreeBSD/JoystickImpl.hpp
+++ b/src/SFML/Window/FreeBSD/JoystickImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/GlContext.cpp b/src/SFML/Window/GlContext.cpp
index 53e6280..1a66774 100644
--- a/src/SFML/Window/GlContext.cpp
+++ b/src/SFML/Window/GlContext.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,14 +29,11 @@
#include <SFML/System/ThreadLocalPtr.hpp>
#include <SFML/System/Mutex.hpp>
#include <SFML/System/Lock.hpp>
+#include <SFML/System/Err.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
+#include <cstring>
#if !defined(SFML_OPENGL_ES)
@@ -73,9 +70,60 @@
#endif
+#if defined(SFML_SYSTEM_WINDOWS)
+
+ typedef const GLubyte* (APIENTRY *glGetStringiFuncType)(GLenum, GLuint);
+
+#else
+
+ typedef const GLubyte* (*glGetStringiFuncType)(GLenum, GLuint);
+
+#endif
+
+#if !defined(GL_MULTISAMPLE)
+ #define GL_MULTISAMPLE 0x809D
+#endif
+
+#if !defined(GL_MAJOR_VERSION)
+ #define GL_MAJOR_VERSION 0x821B
+#endif
+
+#if !defined(GL_MINOR_VERSION)
+ #define GL_MINOR_VERSION 0x821C
+#endif
+
+#if !defined(GL_NUM_EXTENSIONS)
+ #define GL_NUM_EXTENSIONS 0x821D
+#endif
+
+#if !defined(GL_CONTEXT_FLAGS)
+ #define GL_CONTEXT_FLAGS 0x821E
+#endif
+
+#if !defined(GL_CONTEXT_FLAG_DEBUG_BIT)
+ #define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
+#endif
+
+#if !defined(GL_CONTEXT_PROFILE_MASK)
+ #define GL_CONTEXT_PROFILE_MASK 0x9126
+#endif
+
+#if !defined(GL_CONTEXT_CORE_PROFILE_BIT)
+ #define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
+#endif
+
+#if !defined(GL_CONTEXT_COMPATIBILITY_PROFILE_BIT)
+ #define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
+#endif
+
namespace
{
+ // AMD drivers have issues with internal synchronization
+ // We need to make sure that no operating system context
+ // or pixel format operations are performed simultaneously
+ sf::Mutex mutex;
+
// This per-thread variable holds the current context for each thread
sf::ThreadLocalPtr<sf::priv::GlContext> currentContext(NULL);
@@ -121,6 +169,8 @@ namespace priv
////////////////////////////////////////////////////////////
void GlContext::globalInit()
{
+ Lock lock(mutex);
+
// Create the shared context
sharedContext = new ContextType(NULL);
sharedContext->initialize();
@@ -135,12 +185,14 @@ void GlContext::globalInit()
////////////////////////////////////////////////////////////
void GlContext::globalCleanup()
{
+ Lock lock(mutex);
+
// Destroy the shared context
delete sharedContext;
sharedContext = NULL;
// Destroy the internal contexts
- sf::Lock lock(internalContextsMutex);
+ Lock internalContextsLock(internalContextsMutex);
for (std::set<GlContext*>::iterator it = internalContexts.begin(); it != internalContexts.end(); ++it)
delete *it;
internalContexts.clear();
@@ -159,6 +211,9 @@ void GlContext::ensureContext()
////////////////////////////////////////////////////////////
GlContext* GlContext::create()
{
+ Lock lock(mutex);
+
+ // Create the context
GlContext* context = new ContextType(sharedContext);
context->initialize();
@@ -172,9 +227,12 @@ GlContext* GlContext::create(const ContextSettings& settings, const WindowImpl*
// Make sure that there's an active context (context creation may need extensions, and thus a valid context)
ensureContext();
+ Lock lock(mutex);
+
// Create the context
GlContext* context = new ContextType(sharedContext, settings, owner, bitsPerPixel);
context->initialize();
+ context->checkSettings(settings);
return context;
}
@@ -186,15 +244,35 @@ GlContext* GlContext::create(const ContextSettings& settings, unsigned int width
// Make sure that there's an active context (context creation may need extensions, and thus a valid context)
ensureContext();
+ Lock lock(mutex);
+
// Create the context
GlContext* context = new ContextType(sharedContext, settings, width, height);
context->initialize();
+ context->checkSettings(settings);
return context;
}
////////////////////////////////////////////////////////////
+GlFunctionPointer GlContext::getFunction(const char* name)
+{
+#if !defined(SFML_OPENGL_ES)
+
+ Lock lock(mutex);
+
+ return ContextType::getFunction(name);
+
+#else
+
+ return 0;
+
+#endif
+}
+
+
+////////////////////////////////////////////////////////////
GlContext::~GlContext()
{
// Deactivate the context before killing it, unless we're inside Cleanup()
@@ -217,6 +295,8 @@ bool GlContext::setActive(bool active)
{
if (this != currentContext)
{
+ Lock lock(mutex);
+
// Activate the context
if (makeCurrent())
{
@@ -260,12 +340,27 @@ GlContext::GlContext()
////////////////////////////////////////////////////////////
-int GlContext::evaluateFormat(unsigned int bitsPerPixel, const ContextSettings& settings, int colorBits, int depthBits, int stencilBits, int antialiasing)
+int GlContext::evaluateFormat(unsigned int bitsPerPixel, const ContextSettings& settings, int colorBits, int depthBits, int stencilBits, int antialiasing, bool accelerated)
{
- 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));
+ int colorDiff = static_cast<int>(bitsPerPixel) - colorBits;
+ int depthDiff = static_cast<int>(settings.depthBits) - depthBits;
+ int stencilDiff = static_cast<int>(settings.stencilBits) - stencilBits;
+ int antialiasingDiff = static_cast<int>(settings.antialiasingLevel) - antialiasing;
+
+ // Weight sub-scores so that better settings don't score equally as bad as worse settings
+ colorDiff *= ((colorDiff > 0) ? 100000 : 1);
+ depthDiff *= ((depthDiff > 0) ? 100000 : 1);
+ stencilDiff *= ((stencilDiff > 0) ? 100000 : 1);
+ antialiasingDiff *= ((antialiasingDiff > 0) ? 100000 : 1);
+
+ // Aggregate the scores
+ int score = std::abs(colorDiff) + std::abs(depthDiff) + std::abs(stencilDiff) + std::abs(antialiasingDiff);
+
+ // Make sure we prefer hardware acceleration over features
+ if (!accelerated)
+ score += 100000000;
+
+ return score;
}
@@ -276,18 +371,95 @@ void GlContext::initialize()
setActive(true);
// Retrieve the context version number
- const GLubyte* version = glGetString(GL_VERSION);
- if (version)
+ int majorVersion = 0;
+ int minorVersion = 0;
+
+ // Try the new way first
+ glGetIntegerv(GL_MAJOR_VERSION, &majorVersion);
+ glGetIntegerv(GL_MINOR_VERSION, &minorVersion);
+
+ if (glGetError() != GL_INVALID_ENUM)
{
- // The beginning of the returned string is "major.minor" (this is standard)
- m_settings.majorVersion = version[0] - '0';
- m_settings.minorVersion = version[2] - '0';
+ m_settings.majorVersion = static_cast<unsigned int>(majorVersion);
+ m_settings.minorVersion = static_cast<unsigned int>(minorVersion);
}
else
{
- // Can't get the version number, assume 2.0
- m_settings.majorVersion = 2;
- m_settings.minorVersion = 0;
+ // Try the old way
+ 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 1.1
+ m_settings.majorVersion = 1;
+ m_settings.minorVersion = 1;
+ }
+ }
+
+ // 3.0 contexts only deprecate features, but do not remove them yet
+ // 3.1 contexts remove features if ARB_compatibility is not present
+ // 3.2+ contexts remove features only if a core profile is requested
+
+ // If the context was created with wglCreateContext, it is guaranteed to be compatibility.
+ // If a 3.0 context was created with wglCreateContextAttribsARB, it is guaranteed to be compatibility.
+ // If a 3.1 context was created with wglCreateContextAttribsARB, the compatibility flag
+ // is set only if ARB_compatibility is present
+ // If a 3.2+ context was created with wglCreateContextAttribsARB, the compatibility flag
+ // would have been set correctly already depending on whether ARB_create_context_profile is supported.
+
+ // If the user requests a 3.0 context, it will be a compatibility context regardless of the requested profile.
+ // If the user requests a 3.1 context and its creation was successful, the specification
+ // states that it will not be a compatibility profile context regardless of the requested
+ // profile unless ARB_compatibility is present.
+
+ m_settings.attributeFlags = ContextSettings::Default;
+
+ if (m_settings.majorVersion >= 3)
+ {
+ // Retrieve the context flags
+ int flags = 0;
+ glGetIntegerv(GL_CONTEXT_FLAGS, &flags);
+
+ if (flags & GL_CONTEXT_FLAG_DEBUG_BIT)
+ m_settings.attributeFlags |= ContextSettings::Debug;
+
+ if ((m_settings.majorVersion == 3) && (m_settings.minorVersion == 1))
+ {
+ m_settings.attributeFlags |= ContextSettings::Core;
+
+ glGetStringiFuncType glGetStringiFunc = reinterpret_cast<glGetStringiFuncType>(getFunction("glGetStringi"));
+
+ if (glGetStringiFunc)
+ {
+ int numExtensions = 0;
+ glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);
+
+ for (unsigned int i = 0; i < static_cast<unsigned int>(numExtensions); ++i)
+ {
+ const char* extensionString = reinterpret_cast<const char*>(glGetStringiFunc(GL_EXTENSIONS, i));
+
+ if (std::strstr(extensionString, "GL_ARB_compatibility"))
+ {
+ m_settings.attributeFlags &= ~static_cast<Uint32>(ContextSettings::Core);
+ break;
+ }
+ }
+ }
+ }
+ else if ((m_settings.majorVersion > 3) || (m_settings.minorVersion >= 2))
+ {
+ // Retrieve the context profile
+ int profile = 0;
+ glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &profile);
+
+ if (profile & GL_CONTEXT_CORE_PROFILE_BIT)
+ m_settings.attributeFlags |= ContextSettings::Core;
+ }
}
// Enable antialiasing if needed
@@ -295,6 +467,54 @@ void GlContext::initialize()
glEnable(GL_MULTISAMPLE);
}
+
+////////////////////////////////////////////////////////////
+void GlContext::checkSettings(const ContextSettings& requestedSettings)
+{
+ // Perform checks to inform the user if they are getting a context they might not have expected
+
+ // Detect any known non-accelerated implementations and warn
+ const char* vendorName = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
+ const char* rendererName = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
+
+ if (vendorName && rendererName)
+ {
+ if ((std::strcmp(vendorName, "Microsoft Corporation") == 0) && (std::strcmp(rendererName, "GDI Generic") == 0))
+ {
+ err() << "Warning: Detected \"Microsoft Corporation GDI Generic\" OpenGL implementation" << std::endl
+ << "The current OpenGL implementation is not hardware-accelerated" << std::endl;
+ }
+ }
+
+ int version = m_settings.majorVersion * 10 + m_settings.minorVersion;
+ int requestedVersion = requestedSettings.majorVersion * 10 + requestedSettings.minorVersion;
+
+ if ((m_settings.attributeFlags != requestedSettings.attributeFlags) ||
+ (version < requestedVersion) ||
+ (m_settings.stencilBits < requestedSettings.stencilBits) ||
+ (m_settings.antialiasingLevel < requestedSettings.antialiasingLevel) ||
+ (m_settings.depthBits < requestedSettings.depthBits))
+ {
+ err() << "Warning: The created OpenGL context does not fully meet the settings that were requested" << std::endl;
+ err() << "Requested: version = " << requestedSettings.majorVersion << "." << requestedSettings.minorVersion
+ << " ; depth bits = " << requestedSettings.depthBits
+ << " ; stencil bits = " << requestedSettings.stencilBits
+ << " ; AA level = " << requestedSettings.antialiasingLevel
+ << std::boolalpha
+ << " ; core = " << ((requestedSettings.attributeFlags & ContextSettings::Core) != 0)
+ << " ; debug = " << ((requestedSettings.attributeFlags & ContextSettings::Debug) != 0)
+ << std::noboolalpha << std::endl;
+ err() << "Created: version = " << m_settings.majorVersion << "." << m_settings.minorVersion
+ << " ; depth bits = " << m_settings.depthBits
+ << " ; stencil bits = " << m_settings.stencilBits
+ << " ; AA level = " << m_settings.antialiasingLevel
+ << std::boolalpha
+ << " ; core = " << ((m_settings.attributeFlags & ContextSettings::Core) != 0)
+ << " ; debug = " << ((m_settings.attributeFlags & ContextSettings::Debug) != 0)
+ << std::noboolalpha << std::endl;
+ }
+}
+
} // namespace priv
} // namespace sf
diff --git a/src/SFML/Window/GlContext.hpp b/src/SFML/Window/GlContext.hpp
index 9cd588b..f9225cd 100644
--- a/src/SFML/Window/GlContext.hpp
+++ b/src/SFML/Window/GlContext.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Config.hpp>
+#include <SFML/Window/Context.hpp>
#include <SFML/Window/ContextSettings.hpp>
#include <SFML/System/NonCopyable.hpp>
@@ -119,6 +120,15 @@ public:
static GlContext* create(const ContextSettings& settings, unsigned int width, unsigned int height);
public:
+ ////////////////////////////////////////////////////////////
+ /// \brief Get the address of an OpenGL function
+ ///
+ /// \param name Name of the function to get the address of
+ ///
+ /// \return Address of the OpenGL function, 0 on failure
+ ///
+ ////////////////////////////////////////////////////////////
+ static GlFunctionPointer getFunction(const char* name);
////////////////////////////////////////////////////////////
/// \brief Destructor
@@ -206,11 +216,12 @@ protected:
/// \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
+ /// \param accelerated Whether the pixel format is hardware accelerated
///
/// \return Score of the configuration
///
////////////////////////////////////////////////////////////
- static int evaluateFormat(unsigned int bitsPerPixel, const ContextSettings& settings, int colorBits, int depthBits, int stencilBits, int antialiasing);
+ static int evaluateFormat(unsigned int bitsPerPixel, const ContextSettings& settings, int colorBits, int depthBits, int stencilBits, int antialiasing, bool accelerated);
////////////////////////////////////////////////////////////
// Member data
@@ -224,6 +235,13 @@ private:
///
////////////////////////////////////////////////////////////
void initialize();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check whether the context is compatible with the requested settings
+ /// \param requestedSettings Requested settings during context creation
+ ///
+ ////////////////////////////////////////////////////////////
+ void checkSettings(const ContextSettings& requestedSettings);
};
} // namespace priv
diff --git a/src/SFML/Window/GlResource.cpp b/src/SFML/Window/GlResource.cpp
index 84725f8..921874d 100644
--- a/src/SFML/Window/GlResource.cpp
+++ b/src/SFML/Window/GlResource.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/InputImpl.hpp b/src/SFML/Window/InputImpl.hpp
index cf11572..df52a78 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Joystick.cpp b/src/SFML/Window/Joystick.cpp
index 879dd29..11cf289 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/JoystickImpl.hpp b/src/SFML/Window/JoystickImpl.hpp
index 3877d63..6648b59 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/JoystickManager.cpp b/src/SFML/Window/JoystickManager.cpp
index 1f3b9ec..99c100d 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/JoystickManager.hpp b/src/SFML/Window/JoystickManager.hpp
index e0e2492..229160b 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Keyboard.cpp b/src/SFML/Window/Keyboard.cpp
index e8afc67..6076122 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,5 +43,5 @@ void Keyboard::setVirtualKeyboardVisible(bool visible)
{
priv::InputImpl::setVirtualKeyboardVisible(visible);
}
-
+
} // namespace sf
diff --git a/src/SFML/Window/Mouse.cpp b/src/SFML/Window/Mouse.cpp
index d1e88a7..0f966bc 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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 90bc974..6921533 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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.mm b/src/SFML/Window/OSX/AutoreleasePoolWrapper.mm
index 89b6ce7..2afd8ab 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/HIDInputManager.hpp b/src/SFML/Window/OSX/HIDInputManager.hpp
index 202f23d..01c5ccd 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/HIDInputManager.mm b/src/SFML/Window/OSX/HIDInputManager.mm
index e4dc9e1..37ef79e 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -777,7 +777,7 @@ Keyboard::Key HIDInputManager::nonLocalizedKeys(UniChar virtualKeycode)
case 0x33: return sf::Keyboard::BackSpace;
case 0x30: return sf::Keyboard::Tab;
- // Duplicates (see next §).
+ // Duplicates (see next section).
case 0x74: return sf::Keyboard::PageUp;
case 0x79: return sf::Keyboard::PageDown;
case 0x77: return sf::Keyboard::End;
@@ -798,7 +798,7 @@ Keyboard::Key HIDInputManager::nonLocalizedKeys(UniChar virtualKeycode)
case 0x43: return sf::Keyboard::Multiply;
case 0x4b: return sf::Keyboard::Divide;
- // Duplicates (see next §).
+ // Duplicates (see next section).
case 0x7b: return sf::Keyboard::Left;
case 0x7c: return sf::Keyboard::Right;
case 0x7e: return sf::Keyboard::Up;
@@ -820,7 +820,7 @@ Keyboard::Key HIDInputManager::nonLocalizedKeys(UniChar virtualKeycode)
case 0x5b: return sf::Keyboard::Numpad8;
case 0x5c: return sf::Keyboard::Numpad9;
- // Duplicates (see next §).
+ // Duplicates (see next section).
case 0x7a: return sf::Keyboard::F1;
case 0x78: return sf::Keyboard::F2;
case 0x63: return sf::Keyboard::F3;
diff --git a/src/SFML/Window/OSX/HIDJoystickManager.cpp b/src/SFML/Window/OSX/HIDJoystickManager.cpp
index 4b11152..1724fe6 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/HIDJoystickManager.hpp b/src/SFML/Window/OSX/HIDJoystickManager.hpp
index 8c49a2b..a128df5 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/InputImpl.hpp b/src/SFML/Window/OSX/InputImpl.hpp
index 20bc14f..ef897b1 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/InputImpl.mm b/src/SFML/Window/OSX/InputImpl.mm
index b357c4f..f0e8ee4 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -70,9 +70,26 @@ SFOpenGLView* getSFOpenGLViewFromSFMLWindow(const Window& window)
// Subview doesn't match ?
if (![view isKindOfClass:[SFOpenGLView class]])
{
- sf::err() << "The content view is not a valid SFOpenGLView"
- << std::endl;
- view = nil;
+ if([view isKindOfClass:[NSView class]])
+ {
+ NSArray* subviews = [view subviews];
+ for (NSView* subview in subviews)
+ {
+ if ([subview isKindOfClass:[SFOpenGLView class]])
+ {
+ view = (SFOpenGLView*)subview;
+ break;
+ }
+ }
+
+ }
+ else
+ {
+ sf::err() << "The content view is not a valid SFOpenGLView"
+ << std::endl;
+
+ view = nil;
+ }
}
}
diff --git a/src/SFML/Window/OSX/JoystickImpl.cpp b/src/SFML/Window/OSX/JoystickImpl.cpp
index 03e81ee..09d7614 100644
--- a/src/SFML/Window/OSX/JoystickImpl.cpp
+++ b/src/SFML/Window/OSX/JoystickImpl.cpp
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -53,7 +53,7 @@ namespace
std::string getDeviceString(IOHIDDeviceRef ref, CFStringRef prop, unsigned int index)
{
CFTypeRef typeRef = IOHIDDeviceGetProperty(ref, prop);
- if (ref && (CFGetTypeID(typeRef) == CFStringGetTypeID()))
+ if (typeRef && (CFGetTypeID(typeRef) == CFStringGetTypeID()))
{
CFStringRef str = static_cast<CFStringRef>(typeRef);
return stringFromCFString(str);
@@ -68,7 +68,7 @@ namespace
unsigned int getDeviceUint(IOHIDDeviceRef ref, CFStringRef prop, unsigned int index)
{
CFTypeRef typeRef = IOHIDDeviceGetProperty(ref, prop);
- if (ref && (CFGetTypeID(typeRef) == CFNumberGetTypeID()))
+ if (typeRef && (CFGetTypeID(typeRef) == CFNumberGetTypeID()))
{
SInt32 value;
CFNumberGetValue((CFNumberRef)typeRef, kCFNumberSInt32Type, &value);
@@ -255,6 +255,7 @@ bool JoystickImpl::open(unsigned int index)
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;
+ default: break;
// kHIDUsage_GD_Vx, kHIDUsage_GD_Vy, kHIDUsage_GD_Vz are ignored.
}
break;
diff --git a/src/SFML/Window/OSX/JoystickImpl.hpp b/src/SFML/Window/OSX/JoystickImpl.hpp
index 88afbdb..5b08ba6 100644
--- a/src/SFML/Window/OSX/JoystickImpl.hpp
+++ b/src/SFML/Window/OSX/JoystickImpl.hpp
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SFApplication.h b/src/SFML/Window/OSX/SFApplication.h
index 3ef4ef1..b388d80 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SFApplication.m b/src/SFML/Window/OSX/SFApplication.m
index 289c8e8..6ba1f90 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -92,11 +92,11 @@
// Services >
// / default empty menu /
// --------------------
- // Hide AppName ⌘H
- // Hide Others âŒĨ⌘H
+ // Hide AppName Command+H
+ // Hide Others Option+Command+H
// Show All
// --------------------
- // Quit AppName ⌘Q
+ // Quit AppName Command+Q
NSString* appName = [SFApplication applicationName];
@@ -112,7 +112,7 @@
[appleMenu addItem:[NSMenuItem separatorItem]];
// PREFERENCES
- [appleMenu addItemWithTitle:@"Preferencesâ€Ķ"
+ [appleMenu addItemWithTitle:@"Preferences..."
action:nil
keyEquivalent:@""];
@@ -164,7 +164,7 @@
// The File menu is as follow:
//
// File >
- // Close ⌘W
+ // Close Command+W
// FILE MENU
NSMenu* fileMenu = [[NSMenu alloc] initWithTitle:@"File"];
@@ -186,7 +186,7 @@
// The Window menu is as follow:
//
// Window >
- // Minimize ⌘M
+ // Minimize Command+M
// Zoom
// --------------------
// Bring All to Front
diff --git a/src/SFML/Window/OSX/SFApplicationDelegate.h b/src/SFML/Window/OSX/SFApplicationDelegate.h
index ed0fd17..4a99550 100644
--- a/src/SFML/Window/OSX/SFApplicationDelegate.h
+++ b/src/SFML/Window/OSX/SFApplicationDelegate.h
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SFApplicationDelegate.m b/src/SFML/Window/OSX/SFApplicationDelegate.m
index c22b720..c15037c 100644
--- a/src/SFML/Window/OSX/SFApplicationDelegate.m
+++ b/src/SFML/Window/OSX/SFApplicationDelegate.m
@@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SFContext.hpp b/src/SFML/Window/OSX/SFContext.hpp
index 67bae16..761c12e 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -104,6 +104,16 @@ public:
~SFContext();
////////////////////////////////////////////////////////////
+ /// \brief Get the address of an OpenGL function
+ ///
+ /// \param name Name of the function to get the address of
+ ///
+ /// \return Address of the OpenGL function, 0 on failure
+ ///
+ ////////////////////////////////////////////////////////////
+ static GlFunctionPointer getFunction(const char* name);
+
+ ////////////////////////////////////////////////////////////
/// \brief Display what has been rendered to the context so far
///
////////////////////////////////////////////////////////////
diff --git a/src/SFML/Window/OSX/SFContext.mm b/src/SFML/Window/OSX/SFContext.mm
index 9b1cbd1..810bcb4 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,8 @@
#include <SFML/Window/OSX/SFContext.hpp>
#include <SFML/Window/OSX/WindowImplCocoa.hpp>
#include <SFML/System/Err.hpp>
+#include <dlfcn.h>
+#include <stdint.h>
#import <SFML/Window/OSX/AutoreleasePoolWrapper.h>
@@ -112,6 +114,18 @@ SFContext::~SFContext()
////////////////////////////////////////////////////////////
+GlFunctionPointer SFContext::getFunction(const char* name)
+{
+ static void* image = NULL;
+
+ if (!image)
+ image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY);
+
+ return (image ? reinterpret_cast<GlFunctionPointer>(reinterpret_cast<intptr_t>(dlsym(image, name))) : 0);
+}
+
+
+////////////////////////////////////////////////////////////
bool SFContext::makeCurrent()
{
[m_context makeCurrentContext];
@@ -140,6 +154,9 @@ void SFContext::createContext(SFContext* shared,
unsigned int bitsPerPixel,
const ContextSettings& settings)
{
+ // Save the settings. (OpenGL version is updated elsewhere.)
+ m_settings = settings;
+
// Choose the attributes of OGL context.
std::vector<NSOpenGLPixelFormatAttribute> attrs;
attrs.reserve(20); // max attributes (estimation).
@@ -156,12 +173,12 @@ void SFContext::createContext(SFContext* shared,
}
attrs.push_back(NSOpenGLPFADepthSize);
- attrs.push_back((NSOpenGLPixelFormatAttribute)settings.depthBits);
+ attrs.push_back((NSOpenGLPixelFormatAttribute)m_settings.depthBits);
attrs.push_back(NSOpenGLPFAStencilSize);
- attrs.push_back((NSOpenGLPixelFormatAttribute)settings.stencilBits);
+ attrs.push_back((NSOpenGLPixelFormatAttribute)m_settings.stencilBits);
- if (settings.antialiasingLevel > 0)
+ if (m_settings.antialiasingLevel > 0)
{
/*
* Antialiasing techniques are described in the
@@ -183,32 +200,48 @@ void SFContext::createContext(SFContext* shared,
// Antialiasing level
attrs.push_back(NSOpenGLPFASamples);
- attrs.push_back((NSOpenGLPixelFormatAttribute)settings.antialiasingLevel);
+ attrs.push_back((NSOpenGLPixelFormatAttribute)m_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.
+ // SFML 2 Graphics module uses some OpenGL features that are deprecated in
+ // OpenGL 3.0 and that are no longer available in 3.1 and 3.2+ with a 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.
+ // 1.x/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;
+ bool legacy = m_settings.majorVersion < 3;
if (legacy)
{
+ m_settings.attributeFlags &= ~ContextSettings::Core;
+ m_settings.majorVersion = 2;
+ m_settings.minorVersion = 1;
attrs.push_back(NSOpenGLPFAOpenGLProfile);
attrs.push_back(NSOpenGLProfileVersionLegacy);
}
else
{
+ if (!(m_settings.attributeFlags & ContextSettings::Core))
+ {
+ sf::err() << "Warning. Compatibility profile not supported on this platform." << std::endl;
+ m_settings.attributeFlags |= ContextSettings::Core;
+ }
+ m_settings.majorVersion = 3;
+ m_settings.minorVersion = 2;
attrs.push_back(NSOpenGLPFAOpenGLProfile);
attrs.push_back(NSOpenGLProfileVersion3_2Core);
}
+ if (m_settings.attributeFlags & ContextSettings::Debug)
+ {
+ sf::err() << "Warning. OpenGL debugging not supported on this platform." << std::endl;
+ m_settings.attributeFlags &= ~ContextSettings::Debug;
+ }
+
attrs.push_back((NSOpenGLPixelFormatAttribute)0); // end of array
// Create the pixel format.
@@ -242,8 +275,6 @@ void SFContext::createContext(SFContext* shared,
// Free up.
[pixFmt release];
- // Save the settings. (OpenGL version is updated elsewhere.)
- m_settings = settings;
}
} // namespace priv
diff --git a/src/SFML/Window/OSX/SFKeyboardModifiersHelper.h b/src/SFML/Window/OSX/SFKeyboardModifiersHelper.h
index 8f4ce83..60bdb3f 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SFKeyboardModifiersHelper.mm b/src/SFML/Window/OSX/SFKeyboardModifiersHelper.mm
index d788a9e..89c23b5 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SFOpenGLView.h b/src/SFML/Window/OSX/SFOpenGLView.h
index d48d6f7..6a0d0b0 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SFOpenGLView.mm b/src/SFML/Window/OSX/SFOpenGLView.mm
index 58298f7..137b7b0 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -266,7 +266,14 @@ BOOL isValidTextUnicode(NSEvent* event);
{
NSWindow* window = [self window];
NSScreen* screen = window ? [window screen] : [NSScreen mainScreen];
+ CGFloat oldScaleFactor = m_scaleFactor;
m_scaleFactor = [screen backingScaleFactor];
+
+ // Send a resize event if the scaling factor changed
+ if ((m_scaleFactor != oldScaleFactor) && (m_requester != 0)) {
+ NSSize newSize = [self frame].size;
+ m_requester->windowResized(newSize.width, newSize.height);
+ }
}
@@ -467,7 +474,7 @@ BOOL isValidTextUnicode(NSEvent* event);
if (m_requester != 0)
{
NSPoint loc = [self cursorPositionFromEvent:theEvent];
- m_requester->mouseWheelScrolledAt([theEvent deltaY], loc.x, loc.y);
+ m_requester->mouseWheelScrolledAt([theEvent deltaX], [theEvent deltaY], loc.x, loc.y);
}
// Transmit to non-SFML responder
diff --git a/src/SFML/Window/OSX/SFSilentResponder.h b/src/SFML/Window/OSX/SFSilentResponder.h
index 64de2d7..0f00dd3 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SFSilentResponder.m b/src/SFML/Window/OSX/SFSilentResponder.m
index 5789e44..f256a2f 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SFViewController.h b/src/SFML/Window/OSX/SFViewController.h
index cb2c35e..b6d0a0a 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SFViewController.mm b/src/SFML/Window/OSX/SFViewController.mm
index ba2e8a0..8e35f79 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SFWindow.h b/src/SFML/Window/OSX/SFWindow.h
index 3eecc25..36ebc92 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -70,7 +70,7 @@
///
/// Override NSWindow implementation, see implementation for details
///
-/// \param sender The message’s sender
+/// \param sender The message's sender
///
////////////////////////////////////////////////////////////
-(void)performClose:(id)sender;
diff --git a/src/SFML/Window/OSX/SFWindow.m b/src/SFML/Window/OSX/SFWindow.m
index 70e7ee8..7a4ee75 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -64,14 +64,14 @@
{
// From Apple documentation:
//
- // > If the window’s delegate or the window itself implements windowShouldClose:,
+ // > 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
+ // > 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
+ // > 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
diff --git a/src/SFML/Window/OSX/SFWindowController.h b/src/SFML/Window/OSX/SFWindowController.h
index 2ff489b..4435ad0 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SFWindowController.mm b/src/SFML/Window/OSX/SFWindowController.mm
index 6f34d68..1d2a915 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SensorImpl.cpp b/src/SFML/Window/OSX/SensorImpl.cpp
index be5e439..144c6d7 100644
--- a/src/SFML/Window/OSX/SensorImpl.cpp
+++ b/src/SFML/Window/OSX/SensorImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SensorImpl.hpp b/src/SFML/Window/OSX/SensorImpl.hpp
index ea29dd3..68b810e 100644
--- a/src/SFML/Window/OSX/SensorImpl.hpp
+++ b/src/SFML/Window/OSX/SensorImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/VideoModeImpl.cpp b/src/SFML/Window/OSX/VideoModeImpl.cpp
index 18d550a..d83d17d 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/WindowImplCocoa.hpp b/src/SFML/Window/OSX/WindowImplCocoa.hpp
index 4a66d74..486bf78 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -90,7 +90,7 @@ public:
~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.
///
@@ -98,7 +98,7 @@ public:
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.
///
@@ -109,7 +109,7 @@ public:
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.
///
@@ -117,7 +117,7 @@ public:
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.
///
@@ -125,7 +125,7 @@ public:
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.
///
@@ -137,7 +137,7 @@ public:
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.
///
@@ -149,7 +149,7 @@ public:
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.
///
@@ -160,19 +160,20 @@ public:
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 scrolling delta
+ /// \param deltaX horizontal scrolling delta
+ /// \param deltaY vertical scrolling delta
/// \param x mouse x position
/// \param y mouse y position
///
////////////////////////////////////////////////////////////
- void mouseWheelScrolledAt(float delta, int x, int y);
+ void mouseWheelScrolledAt(float deltaX, float deltaY, 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.
///
@@ -180,7 +181,7 @@ public:
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.
///
@@ -188,7 +189,7 @@ public:
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.
///
@@ -198,7 +199,7 @@ public:
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.
///
@@ -208,7 +209,7 @@ public:
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.
///
diff --git a/src/SFML/Window/OSX/WindowImplCocoa.mm b/src/SFML/Window/OSX/WindowImplCocoa.mm
index 0ddfa78..927d5b4 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -370,15 +370,31 @@ void WindowImplCocoa::mouseMovedAt(int x, int y)
}
////////////////////////////////////////////////////////////
-void WindowImplCocoa::mouseWheelScrolledAt(float delta, int x, int y)
+void WindowImplCocoa::mouseWheelScrolledAt(float deltaX, float deltaY, int x, int y)
{
Event event;
+
event.type = Event::MouseWheelMoved;
- event.mouseWheel.delta = delta;
+ event.mouseWheel.delta = deltaY;
event.mouseWheel.x = x;
event.mouseWheel.y = y;
scaleOutXY(event.mouseWheel, m_delegate);
+ pushEvent(event);
+
+ event.type = Event::MouseWheelScrolled;
+ event.mouseWheelScroll.wheel = Mouse::VerticalWheel;
+ event.mouseWheelScroll.delta = deltaY;
+ event.mouseWheelScroll.x = x;
+ event.mouseWheelScroll.y = y;
+ scaleOutXY(event.mouseWheelScroll, m_delegate);
+ pushEvent(event);
+ event.type = Event::MouseWheelScrolled;
+ event.mouseWheelScroll.wheel = Mouse::HorizontalWheel;
+ event.mouseWheelScroll.delta = deltaX;
+ event.mouseWheelScroll.x = x;
+ event.mouseWheelScroll.y = y;
+ scaleOutXY(event.mouseWheelScroll, m_delegate);
pushEvent(event);
}
diff --git a/src/SFML/Window/OSX/WindowImplDelegateProtocol.h b/src/SFML/Window/OSX/WindowImplDelegateProtocol.h
index 0132f40..0c4595c 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/cg_sf_conversion.cpp b/src/SFML/Window/OSX/cg_sf_conversion.cpp
index b5adf4c..60318cd 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/cg_sf_conversion.hpp b/src/SFML/Window/OSX/cg_sf_conversion.hpp
index a60cce4..c0083f8 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/cpp_objc_conversion.h b/src/SFML/Window/OSX/cpp_objc_conversion.h
index 32b010c..42f1557 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/cpp_objc_conversion.mm b/src/SFML/Window/OSX/cpp_objc_conversion.mm
index 6ce8a9b..ea7c84b 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-2014 Marco Antognini (antognini.marco@gmail.com),
-// Laurent Gomila (laurent.gom@gmail.com),
+// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com),
+// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Sensor.cpp b/src/SFML/Window/Sensor.cpp
index d90fcec..64b9fff 100644
--- a/src/SFML/Window/Sensor.cpp
+++ b/src/SFML/Window/Sensor.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -31,7 +31,7 @@
namespace sf
{
-
+
////////////////////////////////////////////////////////////
bool Sensor::isAvailable(Type sensor)
{
diff --git a/src/SFML/Window/SensorImpl.hpp b/src/SFML/Window/SensorImpl.hpp
index 40f266f..39ca794 100644
--- a/src/SFML/Window/SensorImpl.hpp
+++ b/src/SFML/Window/SensorImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SensorManager.cpp b/src/SFML/Window/SensorManager.cpp
index c802554..dd3e7a0 100644
--- a/src/SFML/Window/SensorManager.cpp
+++ b/src/SFML/Window/SensorManager.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/SensorManager.hpp b/src/SFML/Window/SensorManager.hpp
index aa2ec95..2d9f9c1 100644
--- a/src/SFML/Window/SensorManager.hpp
+++ b/src/SFML/Window/SensorManager.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -71,7 +71,7 @@ public:
///
////////////////////////////////////////////////////////////
void setEnabled(Sensor::Type sensor, bool enabled);
-
+
////////////////////////////////////////////////////////////
/// \brief Check if a sensor is enabled
///
@@ -97,7 +97,7 @@ public:
///
////////////////////////////////////////////////////////////
void update();
-
+
private:
////////////////////////////////////////////////////////////
diff --git a/src/SFML/Window/Touch.cpp b/src/SFML/Window/Touch.cpp
index 2bdc52f..4ff400e 100644
--- a/src/SFML/Window/Touch.cpp
+++ b/src/SFML/Window/Touch.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Unix/Display.cpp b/src/SFML/Window/Unix/Display.cpp
index aad1b26..e537224 100644
--- a/src/SFML/Window/Unix/Display.cpp
+++ b/src/SFML/Window/Unix/Display.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -27,8 +27,12 @@
////////////////////////////////////////////////////////////
#include <SFML/System/Err.hpp>
#include <SFML/Window/Unix/Display.hpp>
+#include <SFML/Window/Unix/ScopedXcbPtr.hpp>
+#include <X11/keysym.h>
#include <cassert>
#include <cstdlib>
+#include <algorithm>
+#include <map>
namespace
@@ -36,6 +40,182 @@ namespace
// The shared display and its reference counter
Display* sharedDisplay = NULL;
unsigned int referenceCount = 0;
+
+ typedef std::map<std::string, xcb_atom_t> AtomMap;
+ AtomMap atoms;
+
+ bool mapBuilt = false;
+ xcb_keycode_t firstKeycode = 255;
+ xcb_keycode_t lastKeycode = 0;
+
+ // We use a simple array instead of a map => constant time lookup
+ // xcb_keycode_t can only contain 256 distinct values
+ xcb_keysym_t keysymMap[256];
+
+ xcb_keysym_t keysymToLower(xcb_keysym_t keysym)
+ {
+ switch(keysym >> 8)
+ {
+ // Latin 1
+ case 0:
+ {
+ if ((keysym >= XK_A) && (keysym <= XK_Z))
+ return keysym + (XK_a - XK_A);
+ else if ((keysym >= XK_Agrave) && (keysym <= XK_Odiaeresis))
+ return keysym + (XK_agrave - XK_Agrave);
+ else if ((keysym >= XK_Ooblique) && (keysym <= XK_Thorn))
+ return keysym + (XK_oslash - XK_Ooblique);
+ break;
+ }
+
+ // Latin 2
+ case 1:
+ {
+ if (keysym == XK_Aogonek)
+ return XK_aogonek;
+ else if (keysym >= XK_Lstroke && keysym <= XK_Sacute)
+ return keysym + (XK_lstroke - XK_Lstroke);
+ else if (keysym >= XK_Scaron && keysym <= XK_Zacute)
+ return keysym + (XK_scaron - XK_Scaron);
+ else if (keysym >= XK_Zcaron && keysym <= XK_Zabovedot)
+ return keysym + (XK_zcaron - XK_Zcaron);
+ else if (keysym >= XK_Racute && keysym <= XK_Tcedilla)
+ return keysym + (XK_racute - XK_Racute);
+ break;
+ }
+
+ // Latin 3
+ case 2:
+ {
+ if (keysym >= XK_Hstroke && keysym <= XK_Hcircumflex)
+ return keysym + (XK_hstroke - XK_Hstroke);
+ else if (keysym >= XK_Gbreve && keysym <= XK_Jcircumflex)
+ return keysym + (XK_gbreve - XK_Gbreve);
+ else if (keysym >= XK_Cabovedot && keysym <= XK_Scircumflex)
+ return keysym + (XK_cabovedot - XK_Cabovedot);
+ break;
+ }
+
+ // Latin 4
+ case 3:
+ {
+ if (keysym >= XK_Rcedilla && keysym <= XK_Tslash)
+ return keysym + (XK_rcedilla - XK_Rcedilla);
+ else if (keysym == XK_ENG)
+ return XK_eng;
+ else if (keysym >= XK_Amacron && keysym <= XK_Umacron)
+ return keysym + (XK_amacron - XK_Amacron);
+ break;
+ }
+
+ // Cyrillic
+ case 6:
+ {
+ if (keysym >= XK_Serbian_DJE && keysym <= XK_Serbian_DZE)
+ return keysym - (XK_Serbian_DJE - XK_Serbian_dje);
+ else if (keysym >= XK_Cyrillic_YU && keysym <= XK_Cyrillic_HARDSIGN)
+ return keysym - (XK_Cyrillic_YU - XK_Cyrillic_yu);
+ break;
+ }
+
+ // Greek
+ case 7:
+ {
+ if (keysym >= XK_Greek_ALPHAaccent && keysym <= XK_Greek_OMEGAaccent)
+ return keysym + (XK_Greek_alphaaccent - XK_Greek_ALPHAaccent);
+ else if (keysym >= XK_Greek_ALPHA && keysym <= XK_Greek_OMEGA)
+ return keysym + (XK_Greek_alpha - XK_Greek_ALPHA);
+ break;
+ }
+
+ // Armenian
+ case 0x14:
+ {
+ if (keysym >= XK_Armenian_AYB && keysym <= XK_Armenian_fe) {
+ return (keysym | 1);
+ }
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+
+ return keysym;
+ }
+
+ void buildMap()
+ {
+ // Open a connection with the X server
+ xcb_connection_t* connection = sf::priv::OpenConnection();
+
+ firstKeycode = xcb_get_setup(connection)->min_keycode;
+ lastKeycode = xcb_get_setup(connection)->max_keycode;
+
+ sf::priv::ScopedXcbPtr<xcb_generic_error_t> error(NULL);
+
+ sf::priv::ScopedXcbPtr<xcb_get_keyboard_mapping_reply_t> keyboardMapping(xcb_get_keyboard_mapping_reply(
+ connection,
+ xcb_get_keyboard_mapping(
+ connection,
+ firstKeycode,
+ lastKeycode - firstKeycode + 1
+ ),
+ &error
+ ));
+
+ sf::priv::CloseConnection(connection);
+
+ if (error || !keyboardMapping)
+ {
+ sf::err() << "Failed to get keyboard mapping" << std::endl;
+ return;
+ }
+
+ uint8_t keysymsPerKeycode = keyboardMapping->keysyms_per_keycode;
+
+ if (!keysymsPerKeycode)
+ {
+ sf::err() << "Error: No keysyms per keycode" << std::endl;
+ return;
+ }
+
+ const xcb_keysym_t* keysyms = xcb_get_keyboard_mapping_keysyms(keyboardMapping.get());
+
+ if (!keysyms)
+ {
+ sf::err() << "Failed to get keyboard mapping keysyms" << std::endl;
+ return;
+ }
+
+ xcb_keycode_t range = lastKeycode - firstKeycode + 1;
+
+ std::fill(keysymMap, keysymMap + 256, XK_VoidSymbol);
+
+ for (xcb_keycode_t i = firstKeycode; ; ++i)
+ {
+ const xcb_keysym_t* keysym = &keysyms[(i - firstKeycode) * keysymsPerKeycode];
+
+ if ((keysymsPerKeycode == 1) || (keysym[1] == XCB_NO_SYMBOL))
+ {
+ keysymMap[i] = keysymToLower(keysym[0]);
+
+ if (i == lastKeycode)
+ break;
+
+ continue;
+ }
+
+ keysymMap[i] = keysym[0];
+
+ if (i == lastKeycode)
+ break;
+ }
+
+ mapBuilt = true;
+ }
}
namespace sf
@@ -64,6 +244,13 @@ Display* OpenDisplay()
////////////////////////////////////////////////////////////
+xcb_connection_t* OpenConnection()
+{
+ return XGetXCBConnection(OpenDisplay());
+}
+
+
+////////////////////////////////////////////////////////////
void CloseDisplay(Display* display)
{
assert(display == sharedDisplay);
@@ -73,6 +260,95 @@ void CloseDisplay(Display* display)
XCloseDisplay(display);
}
+
+////////////////////////////////////////////////////////////
+void CloseConnection(xcb_connection_t* connection)
+{
+ assert(connection == XGetXCBConnection(sharedDisplay));
+ return CloseDisplay(sharedDisplay);
+}
+
+
+////////////////////////////////////////////////////////////
+xcb_screen_t* XCBScreenOfDisplay(xcb_connection_t* connection, int screen_nbr)
+{
+ xcb_screen_iterator_t iter = xcb_setup_roots_iterator(xcb_get_setup(connection));
+
+ for (; iter.rem; --screen_nbr, xcb_screen_next (&iter))
+ {
+ if (screen_nbr == 0)
+ return iter.data;
+ }
+
+ return NULL;
+}
+
+
+////////////////////////////////////////////////////////////
+xcb_screen_t* XCBDefaultScreen(xcb_connection_t* connection)
+{
+ assert(connection == XGetXCBConnection(sharedDisplay));
+ return XCBScreenOfDisplay(connection, XDefaultScreen(sharedDisplay));
+}
+
+
+////////////////////////////////////////////////////////////
+xcb_window_t XCBDefaultRootWindow(xcb_connection_t* connection)
+{
+ assert(connection == XGetXCBConnection(sharedDisplay));
+ xcb_screen_t* screen = XCBScreenOfDisplay(connection, XDefaultScreen(sharedDisplay));
+ if (screen)
+ return screen->root;
+ return 0;
+}
+
+
+////////////////////////////////////////////////////////////
+xcb_atom_t getAtom(const std::string& name, bool onlyIfExists)
+{
+ AtomMap::const_iterator iter = atoms.find(name);
+
+ if (iter != atoms.end())
+ return iter->second;
+
+ ScopedXcbPtr<xcb_generic_error_t> error(NULL);
+
+ xcb_connection_t* connection = OpenConnection();
+
+ ScopedXcbPtr<xcb_intern_atom_reply_t> reply(xcb_intern_atom_reply(
+ connection,
+ xcb_intern_atom(
+ connection,
+ onlyIfExists,
+ name.size(),
+ name.c_str()
+ ),
+ &error
+ ));
+
+ CloseConnection(connection);
+
+ if (error || !reply)
+ {
+ err() << "Failed to get " << name << " atom." << std::endl;
+ return XCB_ATOM_NONE;
+ }
+
+ atoms[name] = reply->atom;
+
+ return reply->atom;
+}
+
+
+////////////////////////////////////////////////////////////
+const xcb_keysym_t* getKeysymMap()
+{
+ if (!mapBuilt)
+ buildMap();
+
+ return keysymMap;
+}
+
} // namespace priv
} // namespace sf
diff --git a/src/SFML/Window/Unix/Display.hpp b/src/SFML/Window/Unix/Display.hpp
index df018b3..1cda4a7 100644
--- a/src/SFML/Window/Unix/Display.hpp
+++ b/src/SFML/Window/Unix/Display.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,7 +28,8 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include <X11/Xlib.h>
+#include <X11/Xlib-xcb.h>
+#include <string>
namespace sf
@@ -47,13 +48,85 @@ namespace priv
Display* OpenDisplay();
////////////////////////////////////////////////////////////
-/// \brief Release a reference to the shared
+/// \brief Get the xcb connection of the shared Display
+///
+/// This function increments the reference count of the display,
+/// it must be matched with a call to CloseDisplay.
+///
+/// \return Pointer to the shared connection
+///
+////////////////////////////////////////////////////////////
+xcb_connection_t* OpenConnection();
+
+////////////////////////////////////////////////////////////
+/// \brief Release a reference to the shared display
///
/// \param display Display to release
///
////////////////////////////////////////////////////////////
void CloseDisplay(Display* display);
+////////////////////////////////////////////////////////////
+/// \brief Release a reference to the shared display
+///
+/// \param connection Connection of display to release
+///
+////////////////////////////////////////////////////////////
+void CloseConnection(xcb_connection_t* connection);
+
+////////////////////////////////////////////////////////////
+/// \brief Get screen of a display by index (equivalent to XScreenOfDisplay)
+///
+/// \param connection Connection of display
+/// \param screen_nbr The index of the screen
+///
+/// \return Pointer to the screen
+///
+////////////////////////////////////////////////////////////
+xcb_screen_t* XCBScreenOfDisplay(xcb_connection_t* connection, int screen_nbr);
+
+////////////////////////////////////////////////////////////
+/// \brief Get default screen of a display (equivalent to XDefaultScreen)
+///
+/// \param connection Connection of display
+///
+/// \return Pointer to the default screen of the display
+///
+////////////////////////////////////////////////////////////
+xcb_screen_t* XCBDefaultScreen(xcb_connection_t* connection);
+
+////////////////////////////////////////////////////////////
+/// \brief Get default root window of a display (equivalent to XDefaultRootWindow)
+///
+/// \param connection Connection of display
+///
+/// \return Root window of the display
+///
+////////////////////////////////////////////////////////////
+xcb_window_t XCBDefaultRootWindow(xcb_connection_t* connection);
+
+////////////////////////////////////////////////////////////
+/// \brief Get the atom with the specified name
+///
+/// \param name Name of the atom
+/// \param onlyIfExists Don't try to create the atom if it doesn't already exist
+///
+/// \return Atom if it exists or XCB_ATOM_NONE (0) if it doesn't
+///
+////////////////////////////////////////////////////////////
+xcb_atom_t getAtom(const std::string& name, bool onlyIfExists = false);
+
+////////////////////////////////////////////////////////////
+/// \brief Get the keycode to keysym map
+///
+/// Contains 255 values. Use the keycode as the index
+/// into the array to retrieve its keysym.
+///
+/// \return Keycode to keysym map
+///
+////////////////////////////////////////////////////////////
+const xcb_keysym_t* getKeysymMap();
+
} // namespace priv
} // namespace sf
diff --git a/src/SFML/Window/Unix/GlxContext.cpp b/src/SFML/Window/Unix/GlxContext.cpp
index eac6099..c89c9d3 100644
--- a/src/SFML/Window/Unix/GlxContext.cpp
+++ b/src/SFML/Window/Unix/GlxContext.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,15 +28,72 @@
#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/Mutex.hpp>
+#include <SFML/System/Lock.hpp>
#include <SFML/System/Err.hpp>
+#if !defined(GLX_DEBUGGING) && defined(SFML_DEBUG)
+ // Enable this to print messages to err() everytime GLX produces errors
+ //#define GLX_DEBUGGING
+#endif
+
+namespace
+{
+ sf::Mutex glxErrorMutex;
+ bool glxErrorOccurred = false;
+
+ int HandleXError(::Display*, XErrorEvent*)
+ {
+ glxErrorOccurred = true;
+ return 0;
+ }
+
+ class GlxErrorHandler
+ {
+ public:
+
+ GlxErrorHandler(::Display* display) :
+ m_display(display),
+ m_lock (glxErrorMutex)
+ {
+ glxErrorOccurred = false;
+ m_previousHandler = XSetErrorHandler(HandleXError);
+ }
+
+ ~GlxErrorHandler()
+ {
+ XSync(m_display, False);
+ XSetErrorHandler(m_previousHandler);
+ }
+
+ private:
+ sf::Lock m_lock;
+ ::Display* m_display;
+ int (*m_previousHandler)(::Display*, XErrorEvent*);
+ };
+}
+
namespace sf
{
namespace priv
{
////////////////////////////////////////////////////////////
+void ensureExtensionsInit(::Display* display, int screen)
+{
+ static bool initialized = false;
+ if (!initialized)
+ {
+ initialized = true;
+
+ // We don't check the return value since the extension
+ // flags are cleared even if loading fails
+ sfglx_LoadFunctions(display, screen);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
GlxContext::GlxContext(GlxContext* shared) :
m_window (0),
m_context (NULL),
@@ -44,18 +101,32 @@ m_ownsWindow(true)
{
// Open a connection with the X server
m_display = OpenDisplay();
+ m_connection = XGetXCBConnection(m_display);
+ xcb_screen_t* screen = XCBScreenOfDisplay(m_connection, DefaultScreen(m_display));
+
+ // Choose the visual according to the context settings
+ XVisualInfo visualInfo = selectBestVisual(m_display, VideoMode::getDesktopMode().bitsPerPixel, ContextSettings());
+
+ // Define the window attributes
+ xcb_colormap_t colormap = xcb_generate_id(m_connection);
+ xcb_create_colormap(m_connection, XCB_COLORMAP_ALLOC_NONE, colormap, screen->root, visualInfo.visualid);
+ const uint32_t value_list[] = {colormap};
// 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);
+ m_window = xcb_generate_id(m_connection);
+ xcb_create_window(
+ m_connection,
+ static_cast<uint8_t>(visualInfo.depth),
+ m_window,
+ screen->root,
+ 0, 0,
+ 1, 1,
+ 0,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT,
+ visualInfo.visualid,
+ XCB_CW_COLORMAP,
+ value_list
+ );
// Create the context
createContext(shared, VideoMode::getDesktopMode().bitsPerPixel, ContextSettings());
@@ -71,6 +142,7 @@ m_ownsWindow(false)
// Open a connection with the X server
// (important: must be the same display as the owner window)
m_display = OpenDisplay();
+ m_connection = XGetXCBConnection(m_display);
// Get the owner window and its device context
m_window = static_cast< ::Window>(owner->getSystemHandle());
@@ -89,18 +161,32 @@ m_ownsWindow(true)
{
// Open a connection with the X server
m_display = OpenDisplay();
+ m_connection = XGetXCBConnection(m_display);
+ xcb_screen_t* screen = XCBScreenOfDisplay(m_connection, DefaultScreen(m_display));
+
+ // Choose the visual according to the context settings
+ XVisualInfo visualInfo = selectBestVisual(m_display, VideoMode::getDesktopMode().bitsPerPixel, settings);
+
+ // Define the window attributes
+ xcb_colormap_t colormap = xcb_generate_id(m_connection);
+ xcb_create_colormap(m_connection, XCB_COLORMAP_ALLOC_NONE, colormap, screen->root, visualInfo.visualid);
+ const uint32_t value_list[] = {colormap};
// 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);
+ m_window = xcb_generate_id(m_connection);
+ xcb_create_window(
+ m_connection,
+ static_cast<uint8_t>(visualInfo.depth),
+ m_window,
+ screen->root,
+ 0, 0,
+ width, height,
+ 0,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT,
+ visualInfo.visualid,
+ XCB_CW_COLORMAP,
+ value_list
+ );
// Create the context
createContext(shared, VideoMode::getDesktopMode().bitsPerPixel, settings);
@@ -113,16 +199,25 @@ GlxContext::~GlxContext()
// Destroy the context
if (m_context)
{
+#if defined(GLX_DEBUGGING)
+ GlxErrorHandler handler(m_display);
+#endif
+
if (glXGetCurrentContext() == m_context)
glXMakeCurrent(m_display, None, NULL);
glXDestroyContext(m_display, m_context);
+
+#if defined(GLX_DEBUGGING)
+ if (glxErrorOccurred)
+ err() << "GLX error in GlxContext::~GlxContext()" << std::endl;
+#endif
}
// Destroy the window if we own it
if (m_window && m_ownsWindow)
{
- XDestroyWindow(m_display, m_window);
- XFlush(m_display);
+ xcb_destroy_window(m_connection, m_window);
+ xcb_flush(m_connection);
}
// Close the connection with the X server
@@ -131,27 +226,88 @@ GlxContext::~GlxContext()
////////////////////////////////////////////////////////////
+GlFunctionPointer GlxContext::getFunction(const char* name)
+{
+ return reinterpret_cast<GlFunctionPointer>(glXGetProcAddressARB(reinterpret_cast<const GLubyte*>(name)));
+}
+
+
+////////////////////////////////////////////////////////////
bool GlxContext::makeCurrent()
{
- return m_context && glXMakeCurrent(m_display, m_window, m_context);
+ if (!m_context)
+ return false;
+
+#if defined(GLX_DEBUGGING)
+ GlxErrorHandler handler(m_display);
+#endif
+
+ bool result = glXMakeCurrent(m_display, m_window, m_context);
+
+#if defined(GLX_DEBUGGING)
+ if (glxErrorOccurred)
+ err() << "GLX error in GlxContext::makeCurrent()" << std::endl;
+#endif
+
+ return result;
}
////////////////////////////////////////////////////////////
void GlxContext::display()
{
+#if defined(GLX_DEBUGGING)
+ GlxErrorHandler handler(m_display);
+#endif
+
if (m_window)
glXSwapBuffers(m_display, m_window);
+
+#if defined(GLX_DEBUGGING)
+ if (glxErrorOccurred)
+ err() << "GLX error in GlxContext::display()" << std::endl;
+#endif
}
////////////////////////////////////////////////////////////
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);
+ // Make sure that extensions are initialized
+ ensureExtensionsInit(m_display, DefaultScreen(m_display));
+
+ int result = 0;
+
+ // Prioritize the EXT variant and fall back to MESA or SGI if needed
+ // We use the direct pointer to the MESA entry point instead of the alias
+ // because glx.h declares the entry point as an external function
+ // which would require us to link in an additional library
+ if (sfglx_ext_EXT_swap_control == sfglx_LOAD_SUCCEEDED)
+ {
+ glXSwapIntervalEXT(m_display, glXGetCurrentDrawable(), enabled ? 1 : 0);
+ }
+ else if (sfglx_ext_MESA_swap_control == sfglx_LOAD_SUCCEEDED)
+ {
+ result = sf_ptrc_glXSwapIntervalMESA(enabled ? 1 : 0);
+ }
+ else if (sfglx_ext_SGI_swap_control == sfglx_LOAD_SUCCEEDED)
+ {
+ result = glXSwapIntervalSGI(enabled ? 1 : 0);
+ }
+ else
+ {
+ static bool warned = false;
+
+ if (!warned)
+ {
+ err() << "Setting vertical sync not supported" << std::endl;
+
+ warned = true;
+ }
+ }
+
+ if (result != 0)
+ err() << "Setting vertical sync failed" << std::endl;
}
@@ -164,7 +320,7 @@ XVisualInfo GlxContext::selectBestVisual(::Display* display, unsigned int bitsPe
if (visuals)
{
// Evaluate all the returned visuals, and pick the best one
- int bestScore = 0xFFFF;
+ int bestScore = 0x7FFFFFFF;
XVisualInfo bestVisual;
for (int i = 0; i < count; ++i)
{
@@ -176,18 +332,30 @@ XVisualInfo GlxContext::selectBestVisual(::Display* display, unsigned int bitsPe
// 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);
+ 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);
+
+ if (sfglx_ext_ARB_multisample == sfglx_LOAD_SUCCEEDED)
+ {
+ glXGetConfig(display, &visuals[i], GLX_SAMPLE_BUFFERS_ARB, &multiSampling);
+ glXGetConfig(display, &visuals[i], GLX_SAMPLES_ARB, &samples);
+ }
+ else
+ {
+ multiSampling = 0;
+ samples = 0;
+ }
+
+ // TODO: Replace this with proper acceleration detection
+ bool accelerated = true;
// Evaluate the visual
int color = red + green + blue + alpha;
- int score = evaluateFormat(bitsPerPixel, settings, color, depth, stencil, multiSampling ? samples : 0);
+ int score = evaluateFormat(bitsPerPixel, settings, color, depth, stencil, multiSampling ? samples : 0, accelerated);
// If it's better than the current best, make it the new best
if (score < bestScore)
@@ -211,126 +379,207 @@ XVisualInfo GlxContext::selectBestVisual(::Display* display, unsigned int bitsPe
}
}
-
////////////////////////////////////////////////////////////
void GlxContext::createContext(GlxContext* shared, unsigned int bitsPerPixel, const ContextSettings& settings)
{
- XVisualInfo* visualInfo = NULL;
-
// Save the creation settings
m_settings = settings;
+ // 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 visuals
+ XVisualInfo tpl;
+ tpl.screen = DefaultScreen(m_display);
+ tpl.visualid = XVisualIDFromVisual(windowAttributes.visual);
+ int nbVisuals = 0;
+ XVisualInfo* visualInfo = XGetVisualInfo(m_display, VisualIDMask | VisualScreenMask, &tpl, &nbVisuals);
+
// 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)
+ // There are no GLX versions prior to 1.0
+ int major = 0;
+ int minor = 0;
+
+ if (!glXQueryVersion(m_display, &major, &minor))
+ err() << "Failed to query GLX version, limited to legacy context creation" << std::endl;
+
+ // Make sure that extensions are initialized if this is not the shared context
+ // The shared context is the context used to initialize the extensions
+ if (shared)
+ ensureExtensionsInit(m_display, DefaultScreen(m_display));
+
+ // Check if glXCreateContextAttribsARB is available (requires GLX 1.3 or greater)
+ bool hasCreateContextArb = (sfglx_ext_ARB_create_context == sfglx_LOAD_SUCCEEDED) && ((major > 1) || (minor >= 3));
+
+ // Check if we need to use glXCreateContextAttribsARB
+ bool needCreateContextArb = false;
+
+ if (m_settings.attributeFlags)
+ needCreateContextArb = true;
+ else if (m_settings.majorVersion >= 3)
+ needCreateContextArb = true;
+
+ // Create the OpenGL context -- first try using glXCreateContextAttribsARB if we need to
+ if (hasCreateContextArb && needCreateContextArb)
{
- const GLubyte* name = reinterpret_cast<const GLubyte*>("glXCreateContextAttribsARB");
- PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = reinterpret_cast<PFNGLXCREATECONTEXTATTRIBSARBPROC>(glXGetProcAddress(name));
- if (glXCreateContextAttribsARB)
+ // Get a GLXFBConfig that matches the the window's visual, for glXCreateContextAttribsARB
+ GLXFBConfig* config = NULL;
+
+ // We don't supply attributes to match against, since
+ // the visual we are matching against was already
+ // deemed suitable in selectBestVisual()
+ int nbConfigs = 0;
+ GLXFBConfig* configs = glXChooseFBConfig(m_display, DefaultScreen(m_display), NULL, &nbConfigs);
+
+ for (int i = 0; configs && (i < nbConfigs); ++i)
{
- // Select a GLXFB config that matches the requested context settings
- int nbConfigs = 0;
- int fbAttributes[] =
+ XVisualInfo* visual = glXGetVisualFromFBConfig(m_display, configs[i]);
+
+ if (!visual)
+ continue;
+
+ if (visual->visualid == visualInfo->visualid)
+ {
+ config = &configs[i];
+ break;
+ }
+ }
+
+ if (!config)
+ err() << "Failed to get GLXFBConfig which corresponds to the window's visual" << std::endl;
+
+ while (config && !m_context && m_settings.majorVersion)
+ {
+ // Check if setting the profile is supported
+ if (sfglx_ext_ARB_create_context_profile == sfglx_LOAD_SUCCEEDED)
+ {
+ int profile = (m_settings.attributeFlags & ContextSettings::Core) ? GLX_CONTEXT_CORE_PROFILE_BIT_ARB : GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
+ int debug = (m_settings.attributeFlags & ContextSettings::Debug) ? GLX_CONTEXT_DEBUG_BIT_ARB : 0;
+
+ // 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, profile,
+ GLX_CONTEXT_FLAGS_ARB, debug,
+ 0, 0
+ };
+
+ // RAII GLX error handler (we simply ignore errors here)
+ // On an error, glXCreateContextAttribsARB will return 0 anyway
+ GlxErrorHandler handler(m_display);
+
+ m_context = glXCreateContextAttribsARB(m_display, *config, toShare, true, attributes);
+ }
+ else
{
- 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)
+ if ((m_settings.attributeFlags & ContextSettings::Core) || (m_settings.attributeFlags & ContextSettings::Debug))
+ err() << "Selecting a profile during context creation is not supported,"
+ << "disabling comptibility and debug" << std::endl;
+
+ m_settings.attributeFlags = ContextSettings::Default;
+
+ // 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),
+ 0, 0
+ };
+
+ // RAII GLX error handler (we simply ignore errors here)
+ // On an error, glXCreateContextAttribsARB will return 0 anyway
+ GlxErrorHandler handler(m_display);
+
+ m_context = glXCreateContextAttribsARB(m_display, *config, toShare, true, attributes);
+ }
+
+ if (!m_context)
{
- while (!m_context && (m_settings.majorVersion >= 3))
+ // If we couldn't create the context, first try disabling flags,
+ // then lower the version number and try again -- stop at 0.0
+ // Invalid version numbers will be generated by this algorithm (like 3.9), but we really don't care
+ if (m_settings.attributeFlags != ContextSettings::Default)
{
- // 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;
- }
- }
+ m_settings.attributeFlags = ContextSettings::Default;
+ }
+ else if (m_settings.minorVersion > 0)
+ {
+ // If the minor version is not 0, we decrease it and try again
+ m_settings.minorVersion--;
+
+ m_settings.attributeFlags = settings.attributeFlags;
+ }
+ else
+ {
+ // If the minor version is 0, we decrease the major version
+ m_settings.majorVersion--;
+ m_settings.minorVersion = 9;
+
+ m_settings.attributeFlags = settings.attributeFlags;
}
- XFree(configs);
}
}
+
+ if (configs)
+ 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 glXCreateContextAttribsARB failed, use glXCreateContext
if (!m_context)
{
- // set the context version to 2.0 (arbitrary)
+ // set the context version to 2.1 (arbitrary) and disable flags
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;
- }
+ m_settings.minorVersion = 1;
+ m_settings.attributeFlags = ContextSettings::Default;
- // 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);
+#if defined(GLX_DEBUGGING)
+ GlxErrorHandler handler(m_display);
+#endif
// Create the context, using the target window's visual
m_context = glXCreateContext(m_display, visualInfo, toShare, true);
- if (!m_context)
+
+#if defined(GLX_DEBUGGING)
+ if (glxErrorOccurred)
+ err() << "GLX error in GlxContext::createContext()" << std::endl;
+#endif
+ }
+
+ if (!m_context)
+ {
+ err() << "Failed to create an OpenGL context for this window" << std::endl;
+ }
+ else
+ {
+ // 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);
+
+ if (sfglx_ext_ARB_multisample == sfglx_LOAD_SUCCEEDED)
{
- err() << "Failed to create an OpenGL context for this window" << std::endl;
- return;
+ glXGetConfig(m_display, visualInfo, GLX_SAMPLE_BUFFERS_ARB, &multiSampling);
+ glXGetConfig(m_display, visualInfo, GLX_SAMPLES_ARB, &samples);
+ }
+ else
+ {
+ multiSampling = 0;
+ samples = 0;
}
- }
- // 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;
+ 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);
diff --git a/src/SFML/Window/Unix/GlxContext.hpp b/src/SFML/Window/Unix/GlxContext.hpp
index 0b5982f..e1ad899 100644
--- a/src/SFML/Window/Unix/GlxContext.hpp
+++ b/src/SFML/Window/Unix/GlxContext.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,8 +29,8 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window/GlContext.hpp>
-#include <X11/Xlib.h>
-#include <GL/glx.h>
+#include <SFML/Window/Unix/GlxExtensions.hpp>
+#include <X11/Xlib-xcb.h>
namespace sf
@@ -82,6 +82,16 @@ public:
~GlxContext();
////////////////////////////////////////////////////////////
+ /// \brief Get the address of an OpenGL function
+ ///
+ /// \param name Name of the function to get the address of
+ ///
+ /// \return Address of the OpenGL function, 0 on failure
+ ///
+ ////////////////////////////////////////////////////////////
+ static GlFunctionPointer getFunction(const char* name);
+
+ ////////////////////////////////////////////////////////////
/// \brief Activate the context as the current target for rendering
///
/// \return True on success, false if any error happened
@@ -135,10 +145,11 @@ private:
////////////////////////////////////////////////////////////
// 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?
+ ::Display* m_display; ///< Connection to the X server
+ ::Window m_window; ///< Window to which the context is attached
+ xcb_connection_t* m_connection; ///< Pointer to the xcb connection
+ GLXContext m_context; ///< OpenGL context
+ bool m_ownsWindow; ///< Do we own the window associated to the context?
};
} // namespace priv
diff --git a/src/SFML/Window/Unix/GlxExtensions.cpp b/src/SFML/Window/Unix/GlxExtensions.cpp
new file mode 100644
index 0000000..029095c
--- /dev/null
+++ b/src/SFML/Window/Unix/GlxExtensions.cpp
@@ -0,0 +1,197 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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/GlxExtensions.hpp>
+#include <SFML/Window/Context.hpp>
+#include <cstdlib>
+#include <cstring>
+#include <cstddef>
+
+static sf::GlFunctionPointer IntGetProcAddress(const char* name)
+{
+ return sf::Context::getFunction(name);
+}
+
+int sfglx_ext_EXT_swap_control = sfglx_LOAD_FAILED;
+int sfglx_ext_MESA_swap_control = sfglx_LOAD_FAILED;
+int sfglx_ext_SGI_swap_control = sfglx_LOAD_FAILED;
+int sfglx_ext_ARB_multisample = sfglx_LOAD_FAILED;
+int sfglx_ext_ARB_create_context = sfglx_LOAD_FAILED;
+int sfglx_ext_ARB_create_context_profile = sfglx_LOAD_FAILED;
+
+void (CODEGEN_FUNCPTR *sf_ptrc_glXSwapIntervalEXT)(Display *, GLXDrawable, int) = NULL;
+
+static int Load_EXT_swap_control(void)
+{
+ int numFailed = 0;
+ sf_ptrc_glXSwapIntervalEXT = (void (CODEGEN_FUNCPTR *)(Display *, GLXDrawable, int))IntGetProcAddress("glXSwapIntervalEXT");
+ if(!sf_ptrc_glXSwapIntervalEXT) numFailed++;
+ return numFailed;
+}
+
+int (CODEGEN_FUNCPTR *sf_ptrc_glXSwapIntervalMESA)(int) = NULL;
+
+static int Load_MESA_swap_control(void)
+{
+ int numFailed = 0;
+ sf_ptrc_glXSwapIntervalMESA = (int (CODEGEN_FUNCPTR *)(int))IntGetProcAddress("glXSwapIntervalMESA");
+ if(!sf_ptrc_glXSwapIntervalMESA) numFailed++;
+ return numFailed;
+}
+
+int (CODEGEN_FUNCPTR *sf_ptrc_glXSwapIntervalSGI)(int) = NULL;
+
+static int Load_SGI_swap_control(void)
+{
+ int numFailed = 0;
+ sf_ptrc_glXSwapIntervalSGI = (int (CODEGEN_FUNCPTR *)(int))IntGetProcAddress("glXSwapIntervalSGI");
+ if(!sf_ptrc_glXSwapIntervalSGI) numFailed++;
+ return numFailed;
+}
+
+GLXContext (CODEGEN_FUNCPTR *sf_ptrc_glXCreateContextAttribsARB)(Display *, GLXFBConfig, GLXContext, Bool, const int *) = NULL;
+
+static int Load_ARB_create_context(void)
+{
+ int numFailed = 0;
+ sf_ptrc_glXCreateContextAttribsARB = (GLXContext (CODEGEN_FUNCPTR *)(Display *, GLXFBConfig, GLXContext, Bool, const int *))IntGetProcAddress("glXCreateContextAttribsARB");
+ if(!sf_ptrc_glXCreateContextAttribsARB) numFailed++;
+ return numFailed;
+}
+
+typedef int (*PFN_LOADFUNCPOINTERS)(void);
+typedef struct sfglx_StrToExtMap_s
+{
+ const char *extensionName;
+ int *extensionVariable;
+ PFN_LOADFUNCPOINTERS LoadExtension;
+} sfglx_StrToExtMap;
+
+static sfglx_StrToExtMap ExtensionMap[6] = {
+ {"GLX_EXT_swap_control", &sfglx_ext_EXT_swap_control, Load_EXT_swap_control},
+ {"GLX_MESA_swap_control", &sfglx_ext_MESA_swap_control, Load_MESA_swap_control},
+ {"GLX_SGI_swap_control", &sfglx_ext_SGI_swap_control, Load_SGI_swap_control},
+ {"GLX_ARB_multisample", &sfglx_ext_ARB_multisample, NULL},
+ {"GLX_ARB_create_context", &sfglx_ext_ARB_create_context, Load_ARB_create_context},
+ {"GLX_ARB_create_context_profile", &sfglx_ext_ARB_create_context_profile, NULL},
+};
+
+static int g_extensionMapSize = 6;
+
+static sfglx_StrToExtMap *FindExtEntry(const char *extensionName)
+{
+ int loop;
+ sfglx_StrToExtMap *currLoc = ExtensionMap;
+ for(loop = 0; loop < g_extensionMapSize; ++loop, ++currLoc)
+ {
+ if(strcmp(extensionName, currLoc->extensionName) == 0)
+ return currLoc;
+ }
+
+ return NULL;
+}
+
+static void ClearExtensionVars(void)
+{
+ sfglx_ext_EXT_swap_control = sfglx_LOAD_FAILED;
+ sfglx_ext_MESA_swap_control = sfglx_LOAD_FAILED;
+ sfglx_ext_SGI_swap_control = sfglx_LOAD_FAILED;
+ sfglx_ext_ARB_multisample = sfglx_LOAD_FAILED;
+ sfglx_ext_ARB_create_context = sfglx_LOAD_FAILED;
+ sfglx_ext_ARB_create_context_profile = sfglx_LOAD_FAILED;
+}
+
+
+static void LoadExtByName(const char *extensionName)
+{
+ sfglx_StrToExtMap *entry = NULL;
+ entry = FindExtEntry(extensionName);
+ if(entry)
+ {
+ if(entry->LoadExtension)
+ {
+ int numFailed = entry->LoadExtension();
+ if(numFailed == 0)
+ {
+ *(entry->extensionVariable) = sfglx_LOAD_SUCCEEDED;
+ }
+ else
+ {
+ *(entry->extensionVariable) = sfglx_LOAD_SUCCEEDED + numFailed;
+ }
+ }
+ else
+ {
+ *(entry->extensionVariable) = sfglx_LOAD_SUCCEEDED;
+ }
+ }
+}
+
+
+static void ProcExtsFromExtString(const char *strExtList)
+{
+ size_t iExtListLen = strlen(strExtList);
+ const char *strExtListEnd = strExtList + iExtListLen;
+ const char *strCurrPos = strExtList;
+ char strWorkBuff[256];
+
+ while(*strCurrPos)
+ {
+ /*Get the extension at our position.*/
+ int iStrLen = 0;
+ const char *strEndStr = strchr(strCurrPos, ' ');
+ int iStop = 0;
+ if(strEndStr == NULL)
+ {
+ strEndStr = strExtListEnd;
+ iStop = 1;
+ }
+
+ iStrLen = (int)((ptrdiff_t)strEndStr - (ptrdiff_t)strCurrPos);
+
+ if(iStrLen > 255)
+ return;
+
+ strncpy(strWorkBuff, strCurrPos, iStrLen);
+ strWorkBuff[iStrLen] = '\0';
+
+ LoadExtByName(strWorkBuff);
+
+ strCurrPos = strEndStr + 1;
+ if(iStop) break;
+ }
+}
+
+int sfglx_LoadFunctions(Display *display, int screen)
+{
+ ClearExtensionVars();
+
+
+ ProcExtsFromExtString((const char *)glXQueryExtensionsString(display, screen));
+ return sfglx_LOAD_SUCCEEDED;
+}
+
diff --git a/src/SFML/Window/Unix/GlxExtensions.hpp b/src/SFML/Window/Unix/GlxExtensions.hpp
new file mode 100644
index 0000000..9e9a749
--- /dev/null
+++ b/src/SFML/Window/Unix/GlxExtensions.hpp
@@ -0,0 +1,203 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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 SF_POINTER_C_GENERATED_HEADER_GLXWIN_HPP
+#define SF_POINTER_C_GENERATED_HEADER_GLXWIN_HPP
+
+#ifdef __glxext_h_
+#error Attempt to include glx_exts after including glxext.h
+#endif
+
+#define __glxext_h_
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <GL/glx.h>
+#ifdef CODEGEN_FUNCPTR
+#undef CODEGEN_FUNCPTR
+#endif /*CODEGEN_FUNCPTR*/
+#define CODEGEN_FUNCPTR
+
+#ifndef GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS
+#define GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS
+
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef signed char GLbyte;
+typedef short GLshort;
+typedef int GLint;
+typedef int GLsizei;
+typedef unsigned char GLubyte;
+typedef unsigned short GLushort;
+typedef unsigned int GLuint;
+typedef float GLfloat;
+typedef float GLclampf;
+typedef double GLdouble;
+typedef double GLclampd;
+#define GLvoid void
+
+#endif /*GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS*/
+
+
+#ifndef GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS
+#define GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS
+
+
+#endif /*GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS*/
+
+
+#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
+/* Fallback if nothing above works */
+#include <inttypes.h>
+#endif
+#endif
+ typedef struct __GLXFBConfigRec *GLXFBConfig;
+ typedef XID GLXContextID;
+ typedef struct __GLXcontextRec *GLXContext;
+ typedef XID GLXPixmap;
+ typedef XID GLXDrawable;
+ typedef XID GLXPbuffer;
+ typedef void (APIENTRY *__GLXextFuncPtr)(void);
+ typedef XID GLXVideoCaptureDeviceNV;
+ typedef unsigned int GLXVideoDeviceNV;
+ typedef XID GLXVideoSourceSGIX;
+ typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
+ typedef XID GLXPbufferSGIX;
+ typedef struct {
+ char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
+ int networkId;
+} GLXHyperpipeNetworkSGIX;
+ typedef struct {
+ char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
+ int channel;
+ unsigned int participationType;
+ int timeSlice;
+} GLXHyperpipeConfigSGIX;
+ typedef struct {
+ char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
+ int srcXOrigin, srcYOrigin, srcWidth, srcHeight;
+ int destXOrigin, destYOrigin, destWidth, destHeight;
+} GLXPipeRect;
+ typedef struct {
+ char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
+ int XOrigin, YOrigin, maxHeight, maxWidth;
+} GLXPipeRectLimits;
+
+#ifdef __cplusplus
+extern "C" {
+#endif /*__cplusplus*/
+
+extern int sfglx_ext_EXT_swap_control;
+extern int sfglx_ext_MESA_swap_control;
+extern int sfglx_ext_SGI_swap_control;
+extern int sfglx_ext_ARB_multisample;
+extern int sfglx_ext_ARB_create_context;
+extern int sfglx_ext_ARB_create_context_profile;
+
+#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2
+#define GLX_SWAP_INTERVAL_EXT 0x20F1
+
+#define GLX_SAMPLES_ARB 100001
+#define GLX_SAMPLE_BUFFERS_ARB 100000
+
+#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001
+#define GLX_CONTEXT_FLAGS_ARB 0x2094
+#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_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
+#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
+#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126
+
+#ifndef GLX_EXT_swap_control
+#define GLX_EXT_swap_control 1
+extern void (CODEGEN_FUNCPTR *sf_ptrc_glXSwapIntervalEXT)(Display *, GLXDrawable, int);
+#define glXSwapIntervalEXT sf_ptrc_glXSwapIntervalEXT
+#endif /*GLX_EXT_swap_control*/
+
+// Declare entry point even if GLX header already provides glXSwapIntervalMESA
+// We won't make use of an alias here
+extern int (CODEGEN_FUNCPTR *sf_ptrc_glXSwapIntervalMESA)(int);
+
+#ifndef GLX_SGI_swap_control
+#define GLX_SGI_swap_control 1
+extern int (CODEGEN_FUNCPTR *sf_ptrc_glXSwapIntervalSGI)(int);
+#define glXSwapIntervalSGI sf_ptrc_glXSwapIntervalSGI
+#endif /*GLX_SGI_swap_control*/
+
+#ifndef GLX_ARB_create_context
+#define GLX_ARB_create_context 1
+extern GLXContext (CODEGEN_FUNCPTR *sf_ptrc_glXCreateContextAttribsARB)(Display *, GLXFBConfig, GLXContext, Bool, const int *);
+#define glXCreateContextAttribsARB sf_ptrc_glXCreateContextAttribsARB
+#endif /*GLX_ARB_create_context*/
+
+
+enum sfglx_LoadStatus
+{
+ sfglx_LOAD_FAILED = 0,
+ sfglx_LOAD_SUCCEEDED = 1
+};
+
+int sfglx_LoadFunctions(Display *display, int screen);
+
+
+#ifdef __cplusplus
+}
+#endif /*__cplusplus*/
+
+#endif /* SF_POINTER_C_GENERATED_HEADER_GLXWIN_HPP */
diff --git a/src/SFML/Window/Unix/GlxExtensions.txt b/src/SFML/Window/Unix/GlxExtensions.txt
new file mode 100644
index 0000000..b6b06fa
--- /dev/null
+++ b/src/SFML/Window/Unix/GlxExtensions.txt
@@ -0,0 +1,11 @@
+// Created with:
+// https://bitbucket.org/Anteru/glloadgen-reloaded
+// Commit 20f19482b7a844d20b9785c3e3fd1f16419f6e0a
+// lua LoadGen.lua -style=pointer_c -spec=glX -indent=space -prefix=sf -extfile=GlxExtensions.txt GlxExtensions
+
+EXT_swap_control
+// MESA_swap_control
+SGI_swap_control
+GLX_ARB_multisample
+GLX_ARB_create_context
+GLX_ARB_create_context_profile \ No newline at end of file
diff --git a/src/SFML/Window/Unix/InputImpl.cpp b/src/SFML/Window/Unix/InputImpl.cpp
index 8ff7697..4d815f8 100644
--- a/src/SFML/Window/Unix/InputImpl.cpp
+++ b/src/SFML/Window/Unix/InputImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,11 +25,148 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
+#include <SFML/Window/Window.hpp> // important to be included first (conflict with None)
#include <SFML/Window/Unix/InputImpl.hpp>
-#include <SFML/Window/Window.hpp>
#include <SFML/Window/Unix/Display.hpp>
-#include <X11/Xlib.h>
+#include <SFML/Window/Unix/ScopedXcbPtr.hpp>
+#include <SFML/System/Err.hpp>
+#include <xcb/xcb.h>
#include <X11/keysym.h>
+#include <cstdlib>
+
+////////////////////////////////////////////////////////////
+// Private data
+////////////////////////////////////////////////////////////
+namespace
+{
+ bool mapBuilt = false;
+
+ // We use a simple array instead of a map => constant time lookup
+ xcb_keycode_t keycodeMap[sf::Keyboard::KeyCount];
+
+ xcb_keycode_t getKeycode(xcb_keysym_t keysym)
+ {
+ const xcb_keysym_t* keysymMap = sf::priv::getKeysymMap();
+
+ for (xcb_keycode_t i = 0; ; ++i)
+ {
+ if (keysymMap[i] == keysym)
+ return i;
+
+ if (i == 255)
+ break;
+ }
+
+ return 255;
+ }
+
+ void buildMap()
+ {
+ keycodeMap[sf::Keyboard::A] = getKeycode(XK_a);
+ keycodeMap[sf::Keyboard::B] = getKeycode(XK_b);
+ keycodeMap[sf::Keyboard::C] = getKeycode(XK_c);
+ keycodeMap[sf::Keyboard::D] = getKeycode(XK_d);
+ keycodeMap[sf::Keyboard::E] = getKeycode(XK_e);
+ keycodeMap[sf::Keyboard::F] = getKeycode(XK_f);
+ keycodeMap[sf::Keyboard::G] = getKeycode(XK_g);
+ keycodeMap[sf::Keyboard::H] = getKeycode(XK_h);
+ keycodeMap[sf::Keyboard::I] = getKeycode(XK_i);
+ keycodeMap[sf::Keyboard::J] = getKeycode(XK_j);
+ keycodeMap[sf::Keyboard::K] = getKeycode(XK_k);
+ keycodeMap[sf::Keyboard::L] = getKeycode(XK_l);
+ keycodeMap[sf::Keyboard::M] = getKeycode(XK_m);
+ keycodeMap[sf::Keyboard::N] = getKeycode(XK_n);
+ keycodeMap[sf::Keyboard::O] = getKeycode(XK_o);
+ keycodeMap[sf::Keyboard::P] = getKeycode(XK_p);
+ keycodeMap[sf::Keyboard::Q] = getKeycode(XK_q);
+ keycodeMap[sf::Keyboard::R] = getKeycode(XK_r);
+ keycodeMap[sf::Keyboard::S] = getKeycode(XK_s);
+ keycodeMap[sf::Keyboard::T] = getKeycode(XK_t);
+ keycodeMap[sf::Keyboard::U] = getKeycode(XK_u);
+ keycodeMap[sf::Keyboard::V] = getKeycode(XK_v);
+ keycodeMap[sf::Keyboard::W] = getKeycode(XK_w);
+ keycodeMap[sf::Keyboard::X] = getKeycode(XK_x);
+ keycodeMap[sf::Keyboard::Y] = getKeycode(XK_y);
+ keycodeMap[sf::Keyboard::Z] = getKeycode(XK_z);
+ keycodeMap[sf::Keyboard::Num0] = getKeycode(XK_0);
+ keycodeMap[sf::Keyboard::Num1] = getKeycode(XK_1);
+ keycodeMap[sf::Keyboard::Num2] = getKeycode(XK_2);
+ keycodeMap[sf::Keyboard::Num3] = getKeycode(XK_3);
+ keycodeMap[sf::Keyboard::Num4] = getKeycode(XK_4);
+ keycodeMap[sf::Keyboard::Num5] = getKeycode(XK_5);
+ keycodeMap[sf::Keyboard::Num6] = getKeycode(XK_6);
+ keycodeMap[sf::Keyboard::Num7] = getKeycode(XK_7);
+ keycodeMap[sf::Keyboard::Num8] = getKeycode(XK_8);
+ keycodeMap[sf::Keyboard::Num9] = getKeycode(XK_9);
+ keycodeMap[sf::Keyboard::Escape] = getKeycode(XK_Escape);
+ keycodeMap[sf::Keyboard::LControl] = getKeycode(XK_Control_L);
+ keycodeMap[sf::Keyboard::LShift] = getKeycode(XK_Shift_L);
+ keycodeMap[sf::Keyboard::LAlt] = getKeycode(XK_Alt_L);
+ keycodeMap[sf::Keyboard::LSystem] = getKeycode(XK_Super_L);
+ keycodeMap[sf::Keyboard::RControl] = getKeycode(XK_Control_R);
+ keycodeMap[sf::Keyboard::RShift] = getKeycode(XK_Shift_R);
+ keycodeMap[sf::Keyboard::RAlt] = getKeycode(XK_Alt_R);
+ keycodeMap[sf::Keyboard::RSystem] = getKeycode(XK_Super_R);
+ keycodeMap[sf::Keyboard::Menu] = getKeycode(XK_Menu);
+ keycodeMap[sf::Keyboard::LBracket] = getKeycode(XK_bracketleft);
+ keycodeMap[sf::Keyboard::RBracket] = getKeycode(XK_bracketright);
+ keycodeMap[sf::Keyboard::SemiColon] = getKeycode(XK_semicolon);
+ keycodeMap[sf::Keyboard::Comma] = getKeycode(XK_comma);
+ keycodeMap[sf::Keyboard::Period] = getKeycode(XK_period);
+ keycodeMap[sf::Keyboard::Quote] = getKeycode(XK_apostrophe);
+ keycodeMap[sf::Keyboard::Slash] = getKeycode(XK_slash);
+ keycodeMap[sf::Keyboard::BackSlash] = getKeycode(XK_backslash);
+ keycodeMap[sf::Keyboard::Tilde] = getKeycode(XK_grave);
+ keycodeMap[sf::Keyboard::Equal] = getKeycode(XK_equal);
+ keycodeMap[sf::Keyboard::Dash] = getKeycode(XK_minus);
+ keycodeMap[sf::Keyboard::Space] = getKeycode(XK_space);
+ keycodeMap[sf::Keyboard::Return] = getKeycode(XK_Return);
+ keycodeMap[sf::Keyboard::BackSpace] = getKeycode(XK_BackSpace);
+ keycodeMap[sf::Keyboard::Tab] = getKeycode(XK_Tab);
+ keycodeMap[sf::Keyboard::PageUp] = getKeycode(XK_Prior);
+ keycodeMap[sf::Keyboard::PageDown] = getKeycode(XK_Next);
+ keycodeMap[sf::Keyboard::End] = getKeycode(XK_End);
+ keycodeMap[sf::Keyboard::Home] = getKeycode(XK_Home);
+ keycodeMap[sf::Keyboard::Insert] = getKeycode(XK_Insert);
+ keycodeMap[sf::Keyboard::Delete] = getKeycode(XK_Delete);
+ keycodeMap[sf::Keyboard::Add] = getKeycode(XK_KP_Add);
+ keycodeMap[sf::Keyboard::Subtract] = getKeycode(XK_KP_Subtract);
+ keycodeMap[sf::Keyboard::Multiply] = getKeycode(XK_KP_Multiply);
+ keycodeMap[sf::Keyboard::Divide] = getKeycode(XK_KP_Divide);
+ keycodeMap[sf::Keyboard::Left] = getKeycode(XK_Left);
+ keycodeMap[sf::Keyboard::Right] = getKeycode(XK_Right);
+ keycodeMap[sf::Keyboard::Up] = getKeycode(XK_Up);
+ keycodeMap[sf::Keyboard::Down] = getKeycode(XK_Down);
+ keycodeMap[sf::Keyboard::Numpad0] = getKeycode(XK_KP_0);
+ keycodeMap[sf::Keyboard::Numpad1] = getKeycode(XK_KP_1);
+ keycodeMap[sf::Keyboard::Numpad2] = getKeycode(XK_KP_2);
+ keycodeMap[sf::Keyboard::Numpad3] = getKeycode(XK_KP_3);
+ keycodeMap[sf::Keyboard::Numpad4] = getKeycode(XK_KP_4);
+ keycodeMap[sf::Keyboard::Numpad5] = getKeycode(XK_KP_5);
+ keycodeMap[sf::Keyboard::Numpad6] = getKeycode(XK_KP_6);
+ keycodeMap[sf::Keyboard::Numpad7] = getKeycode(XK_KP_7);
+ keycodeMap[sf::Keyboard::Numpad8] = getKeycode(XK_KP_8);
+ keycodeMap[sf::Keyboard::Numpad9] = getKeycode(XK_KP_9);
+ keycodeMap[sf::Keyboard::F1] = getKeycode(XK_F1);
+ keycodeMap[sf::Keyboard::F2] = getKeycode(XK_F2);
+ keycodeMap[sf::Keyboard::F3] = getKeycode(XK_F3);
+ keycodeMap[sf::Keyboard::F4] = getKeycode(XK_F4);
+ keycodeMap[sf::Keyboard::F5] = getKeycode(XK_F5);
+ keycodeMap[sf::Keyboard::F6] = getKeycode(XK_F6);
+ keycodeMap[sf::Keyboard::F7] = getKeycode(XK_F7);
+ keycodeMap[sf::Keyboard::F8] = getKeycode(XK_F8);
+ keycodeMap[sf::Keyboard::F9] = getKeycode(XK_F9);
+ keycodeMap[sf::Keyboard::F10] = getKeycode(XK_F10);
+ keycodeMap[sf::Keyboard::F11] = getKeycode(XK_F11);
+ keycodeMap[sf::Keyboard::F12] = getKeycode(XK_F12);
+ keycodeMap[sf::Keyboard::F13] = getKeycode(XK_F13);
+ keycodeMap[sf::Keyboard::F14] = getKeycode(XK_F14);
+ keycodeMap[sf::Keyboard::F15] = getKeycode(XK_F15);
+ keycodeMap[sf::Keyboard::Pause] = getKeycode(XK_Pause);
+
+ mapBuilt = true;
+ }
+}
namespace sf
@@ -39,143 +176,47 @@ namespace priv
////////////////////////////////////////////////////////////
bool InputImpl::isKeyPressed(Keyboard::Key key)
{
- // Get the corresponding X11 keysym
- KeySym keysym = 0;
- switch (key)
- {
- case Keyboard::A: keysym = XK_A; break;
- case Keyboard::B: keysym = XK_B; break;
- case Keyboard::C: keysym = XK_C; break;
- case Keyboard::D: keysym = XK_D; break;
- case Keyboard::E: keysym = XK_E; break;
- case Keyboard::F: keysym = XK_F; break;
- case Keyboard::G: keysym = XK_G; break;
- case Keyboard::H: keysym = XK_H; break;
- case Keyboard::I: keysym = XK_I; break;
- case Keyboard::J: keysym = XK_J; break;
- case Keyboard::K: keysym = XK_K; break;
- case Keyboard::L: keysym = XK_L; break;
- case Keyboard::M: keysym = XK_M; break;
- case Keyboard::N: keysym = XK_N; break;
- case Keyboard::O: keysym = XK_O; break;
- case Keyboard::P: keysym = XK_P; break;
- case Keyboard::Q: keysym = XK_Q; break;
- case Keyboard::R: keysym = XK_R; break;
- case Keyboard::S: keysym = XK_S; break;
- case Keyboard::T: keysym = XK_T; break;
- case Keyboard::U: keysym = XK_U; break;
- case Keyboard::V: keysym = XK_V; break;
- case Keyboard::W: keysym = XK_W; break;
- case Keyboard::X: keysym = XK_X; break;
- case Keyboard::Y: keysym = XK_Y; break;
- case Keyboard::Z: keysym = XK_Z; break;
- case Keyboard::Num0: keysym = XK_0; break;
- case Keyboard::Num1: keysym = XK_1; break;
- case Keyboard::Num2: keysym = XK_2; break;
- case Keyboard::Num3: keysym = XK_3; break;
- case Keyboard::Num4: keysym = XK_4; break;
- case Keyboard::Num5: keysym = XK_5; break;
- case Keyboard::Num6: keysym = XK_6; break;
- case Keyboard::Num7: keysym = XK_7; break;
- case Keyboard::Num8: keysym = XK_8; break;
- case Keyboard::Num9: keysym = XK_9; break;
- case Keyboard::Escape: keysym = XK_Escape; break;
- case Keyboard::LControl: keysym = XK_Control_L; break;
- case Keyboard::LShift: keysym = XK_Shift_L; break;
- case Keyboard::LAlt: keysym = XK_Alt_L; break;
- case Keyboard::LSystem: keysym = XK_Super_L; break;
- case Keyboard::RControl: keysym = XK_Control_R; break;
- case Keyboard::RShift: keysym = XK_Shift_R; break;
- case Keyboard::RAlt: keysym = XK_Alt_R; break;
- case Keyboard::RSystem: keysym = XK_Super_R; break;
- case Keyboard::Menu: keysym = XK_Menu; break;
- case Keyboard::LBracket: keysym = XK_bracketleft; break;
- case Keyboard::RBracket: keysym = XK_bracketright; break;
- case Keyboard::SemiColon: keysym = XK_semicolon; break;
- case Keyboard::Comma: keysym = XK_comma; break;
- case Keyboard::Period: keysym = XK_period; break;
- case Keyboard::Quote: keysym = XK_dead_acute; break;
- case Keyboard::Slash: keysym = XK_slash; break;
- case Keyboard::BackSlash: keysym = XK_backslash; break;
- case Keyboard::Tilde: keysym = XK_dead_grave; break;
- case Keyboard::Equal: keysym = XK_equal; break;
- case Keyboard::Dash: keysym = XK_minus; break;
- case Keyboard::Space: keysym = XK_space; break;
- case Keyboard::Return: keysym = XK_Return; break;
- case Keyboard::BackSpace: keysym = XK_BackSpace; break;
- case Keyboard::Tab: keysym = XK_Tab; break;
- case Keyboard::PageUp: keysym = XK_Prior; break;
- case Keyboard::PageDown: keysym = XK_Next; break;
- case Keyboard::End: keysym = XK_End; break;
- case Keyboard::Home: keysym = XK_Home; break;
- case Keyboard::Insert: keysym = XK_Insert; break;
- case Keyboard::Delete: keysym = XK_Delete; break;
- case Keyboard::Add: keysym = XK_KP_Add; break;
- case Keyboard::Subtract: keysym = XK_KP_Subtract; break;
- case Keyboard::Multiply: keysym = XK_KP_Multiply; break;
- case Keyboard::Divide: keysym = XK_KP_Divide; break;
- case Keyboard::Left: keysym = XK_Left; break;
- case Keyboard::Right: keysym = XK_Right; break;
- case Keyboard::Up: keysym = XK_Up; break;
- case Keyboard::Down: keysym = XK_Down; break;
- case Keyboard::Numpad0: keysym = XK_KP_0; break;
- case Keyboard::Numpad1: keysym = XK_KP_1; break;
- case Keyboard::Numpad2: keysym = XK_KP_2; break;
- case Keyboard::Numpad3: keysym = XK_KP_3; break;
- case Keyboard::Numpad4: keysym = XK_KP_4; break;
- case Keyboard::Numpad5: keysym = XK_KP_5; break;
- case Keyboard::Numpad6: keysym = XK_KP_6; break;
- case Keyboard::Numpad7: keysym = XK_KP_7; break;
- case Keyboard::Numpad8: keysym = XK_KP_8; break;
- case Keyboard::Numpad9: keysym = XK_KP_9; break;
- case Keyboard::F1: keysym = XK_F1; break;
- case Keyboard::F2: keysym = XK_F2; break;
- case Keyboard::F3: keysym = XK_F3; break;
- case Keyboard::F4: keysym = XK_F4; break;
- case Keyboard::F5: keysym = XK_F5; break;
- case Keyboard::F6: keysym = XK_F6; break;
- case Keyboard::F7: keysym = XK_F7; break;
- case Keyboard::F8: keysym = XK_F8; break;
- case Keyboard::F9: keysym = XK_F9; break;
- case Keyboard::F10: keysym = XK_F10; break;
- case Keyboard::F11: keysym = XK_F11; break;
- case Keyboard::F12: keysym = XK_F12; break;
- case Keyboard::F13: keysym = XK_F13; break;
- case Keyboard::F14: keysym = XK_F14; break;
- case Keyboard::F15: keysym = XK_F15; break;
- case Keyboard::Pause: keysym = XK_Pause; break;
- default: keysym = 0; break;
- }
+ if (!mapBuilt)
+ buildMap();
- // Open a connection with the X server
- Display* display = OpenDisplay();
+ // Sanity checks
+ if (key < 0 || key >= sf::Keyboard::KeyCount)
+ return false;
// Convert to keycode
- KeyCode keycode = XKeysymToKeycode(display, keysym);
- if (keycode != 0)
- {
- // Get the whole keyboard state
- char keys[32];
- XQueryKeymap(display, keys);
+ xcb_keycode_t keycode = keycodeMap[key];
- // Close the connection with the X server
- CloseDisplay(display);
+ ScopedXcbPtr<xcb_generic_error_t> error(NULL);
- // Check our keycode
- return (keys[keycode / 8] & (1 << (keycode % 8))) != 0;
- }
- else
+ // Open a connection with the X server
+ xcb_connection_t* connection = OpenConnection();
+
+ // Get the whole keyboard state
+ ScopedXcbPtr<xcb_query_keymap_reply_t> keymap(
+ xcb_query_keymap_reply(
+ connection,
+ xcb_query_keymap(connection),
+ &error
+ )
+ );
+
+ // Close the connection with the X server
+ CloseConnection(connection);
+
+ if (error)
{
- // Close the connection with the X server
- CloseDisplay(display);
+ err() << "Failed to query keymap" << std::endl;
return false;
}
+
+ // Check our keycode
+ return (keymap->keys[keycode / 8] & (1 << (keycode % 8))) != 0;
}
////////////////////////////////////////////////////////////
-void InputImpl::setVirtualKeyboardVisible(bool visible)
+void InputImpl::setVirtualKeyboardVisible(bool /*visible*/)
{
// Not applicable
}
@@ -185,30 +226,43 @@ void InputImpl::setVirtualKeyboardVisible(bool visible)
bool InputImpl::isMouseButtonPressed(Mouse::Button button)
{
// Open a connection with the X server
- Display* display = OpenDisplay();
+ xcb_connection_t* connection = OpenConnection();
+
+ ScopedXcbPtr<xcb_generic_error_t> error(NULL);
+
+ // Get pointer mask
+ ScopedXcbPtr<xcb_query_pointer_reply_t> pointer(
+ xcb_query_pointer_reply(
+ connection,
+ xcb_query_pointer(
+ connection,
+ XCBDefaultRootWindow(connection)
+ ),
+ &error
+ )
+ );
- // we don't care about these but they are required
- ::Window root, child;
- int wx, wy;
- int gx, gy;
+ // Close the connection with the X server
+ CloseConnection(connection);
- unsigned int buttons = 0;
- XQueryPointer(display, DefaultRootWindow(display), &root, &child, &gx, &gy, &wx, &wy, &buttons);
+ if (error)
+ {
+ err() << "Failed to query pointer" << std::endl;
- // Close the connection with the X server
- CloseDisplay(display);
+ return false;
+ }
+
+ uint16_t buttons = pointer->mask;
switch (button)
{
- case Mouse::Left: return buttons & Button1Mask;
- case Mouse::Right: return buttons & Button3Mask;
- case Mouse::Middle: return buttons & Button2Mask;
+ case Mouse::Left: return buttons & XCB_BUTTON_MASK_1;
+ case Mouse::Right: return buttons & XCB_BUTTON_MASK_3;
+ case Mouse::Middle: return buttons & XCB_BUTTON_MASK_2;
case Mouse::XButton1: return false; // not supported by X
case Mouse::XButton2: return false; // not supported by X
default: return false;
}
-
- return false;
}
@@ -216,21 +270,32 @@ bool InputImpl::isMouseButtonPressed(Mouse::Button button)
Vector2i InputImpl::getMousePosition()
{
// Open a connection with the X server
- Display* display = OpenDisplay();
+ xcb_connection_t* connection = OpenConnection();
- // we don't care about these but they are required
- ::Window root, child;
- int x, y;
- unsigned int buttons;
+ ScopedXcbPtr<xcb_generic_error_t> error(NULL);
- int gx = 0;
- int gy = 0;
- XQueryPointer(display, DefaultRootWindow(display), &root, &child, &gx, &gy, &x, &y, &buttons);
+ ScopedXcbPtr<xcb_query_pointer_reply_t> pointer(
+ xcb_query_pointer_reply(
+ connection,
+ xcb_query_pointer(
+ connection,
+ XCBDefaultRootWindow(connection)
+ ),
+ &error
+ )
+ );
// Close the connection with the X server
- CloseDisplay(display);
+ CloseConnection(connection);
- return Vector2i(gx, gy);
+ if (error)
+ {
+ err() << "Failed to query pointer" << std::endl;
+
+ return Vector2i(0, 0);
+ }
+
+ return Vector2i(pointer->root_x, pointer->root_y);
}
@@ -241,21 +306,32 @@ Vector2i InputImpl::getMousePosition(const Window& relativeTo)
if (handle)
{
// Open a connection with the X server
- Display* display = OpenDisplay();
+ xcb_connection_t* connection = OpenConnection();
- // we don't care about these but they are required
- ::Window root, child;
- int gx, gy;
- unsigned int buttons;
+ ScopedXcbPtr<xcb_generic_error_t> error(NULL);
- int x = 0;
- int y = 0;
- XQueryPointer(display, handle, &root, &child, &gx, &gy, &x, &y, &buttons);
+ ScopedXcbPtr<xcb_query_pointer_reply_t> pointer(
+ xcb_query_pointer_reply(
+ connection,
+ xcb_query_pointer(
+ connection,
+ handle
+ ),
+ &error
+ )
+ );
// Close the connection with the X server
- CloseDisplay(display);
+ CloseConnection(connection);
+
+ if (error)
+ {
+ err() << "Failed to query pointer" << std::endl;
+
+ return Vector2i(0, 0);
+ }
- return Vector2i(x, y);
+ return Vector2i(pointer->win_x, pointer->win_y);
}
else
{
@@ -268,13 +344,27 @@ Vector2i InputImpl::getMousePosition(const Window& relativeTo)
void InputImpl::setMousePosition(const Vector2i& position)
{
// Open a connection with the X server
- Display* display = OpenDisplay();
+ xcb_connection_t* connection = OpenConnection();
+
+ ScopedXcbPtr<xcb_generic_error_t> error(xcb_request_check(
+ connection,
+ xcb_warp_pointer(
+ connection,
+ None, // Source window
+ XCBDefaultRootWindow(connection), // Destination window
+ 0, 0, // Source position
+ 0, 0, // Source size
+ position.x, position.y // Destination position
+ )
+ ));
+
+ if (error)
+ err() << "Failed to set mouse position" << std::endl;
- XWarpPointer(display, None, DefaultRootWindow(display), 0, 0, 0, 0, position.x, position.y);
- XFlush(display);
+ xcb_flush(connection);
// Close the connection with the X server
- CloseDisplay(display);
+ CloseConnection(connection);
}
@@ -282,17 +372,31 @@ void InputImpl::setMousePosition(const Vector2i& position)
void InputImpl::setMousePosition(const Vector2i& position, const Window& relativeTo)
{
// Open a connection with the X server
- Display* display = OpenDisplay();
+ xcb_connection_t* connection = OpenConnection();
WindowHandle handle = relativeTo.getSystemHandle();
if (handle)
{
- XWarpPointer(display, None, handle, 0, 0, 0, 0, position.x, position.y);
- XFlush(display);
+ ScopedXcbPtr<xcb_generic_error_t> error(xcb_request_check(
+ connection,
+ xcb_warp_pointer(
+ connection,
+ None, // Source window
+ handle, // Destination window
+ 0, 0, // Source position
+ 0, 0, // Source size
+ position.x, position.y // Destination position
+ )
+ ));
+
+ if (error)
+ err() << "Failed to set mouse position" << std::endl;
+
+ xcb_flush(connection);
}
// Close the connection with the X server
- CloseDisplay(display);
+ CloseConnection(connection);
}
diff --git a/src/SFML/Window/Unix/InputImpl.hpp b/src/SFML/Window/Unix/InputImpl.hpp
index 32c8f21..9425c3d 100644
--- a/src/SFML/Window/Unix/InputImpl.hpp
+++ b/src/SFML/Window/Unix/InputImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Unix/JoystickImpl.cpp b/src/SFML/Window/Unix/JoystickImpl.cpp
index 0b8d479..d60075d 100644
--- a/src/SFML/Window/Unix/JoystickImpl.cpp
+++ b/src/SFML/Window/Unix/JoystickImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -27,159 +27,410 @@
////////////////////////////////////////////////////////////
#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 <linux/joystick.h>
#include <libudev.h>
#include <unistd.h>
-#include <cstdio>
-#include <cstdlib>
-#include <sstream>
+#include <fcntl.h>
+#include <errno.h>
+#include <vector>
+#include <string>
+#include <cstring>
namespace
{
- int notifyFd = -1;
- int inputFd = -1;
- bool plugged[sf::Joystick::Count];
+ udev* udevContext = 0;
+ udev_monitor* udevMonitor = 0;
+
+ struct JoystickRecord
+ {
+ std::string deviceNode;
+ std::string systemPath;
+ bool plugged;
+ };
+
+ typedef std::vector<JoystickRecord> JoystickList;
+ JoystickList joystickList;
- void updatePluggedList()
+ bool isJoystick(udev_device* udevDevice)
{
- udev* udevContext = udev_new();
+ // If anything goes wrong, we go safe and return true
+
+ // No device to check, assume not a joystick
+ if (!udevDevice)
+ return false;
+
+ const char* devnode = udev_device_get_devnode(udevDevice);
+
+ // We only consider devices with a device node
+ if (!devnode)
+ return false;
+
+ // SFML doesn't support evdev yet, so make sure we only handle /js nodes
+ if (!std::strstr(devnode, "/js"))
+ return false;
- for (unsigned int i = 0; i < sf::Joystick::Count; ++i)
+ // Check if this device is a joystick
+ if (udev_device_get_property_value(udevDevice, "ID_INPUT_JOYSTICK"))
+ return true;
+
+ // Check if this device is something that isn't a joystick
+ // We do this because the absence of any ID_INPUT_ property doesn't
+ // necessarily mean that the device isn't a joystick, whereas the
+ // presence of any ID_INPUT_ property that isn't ID_INPUT_JOYSTICK does
+ if (udev_device_get_property_value(udevDevice, "ID_INPUT_ACCELEROMETER") ||
+ udev_device_get_property_value(udevDevice, "ID_INPUT_KEY") ||
+ udev_device_get_property_value(udevDevice, "ID_INPUT_KEYBOARD") ||
+ udev_device_get_property_value(udevDevice, "ID_INPUT_MOUSE") ||
+ udev_device_get_property_value(udevDevice, "ID_INPUT_TABLET") ||
+ udev_device_get_property_value(udevDevice, "ID_INPUT_TOUCHPAD") ||
+ udev_device_get_property_value(udevDevice, "ID_INPUT_TOUCHSCREEN"))
+ return false;
+
+ // On some platforms (older udev), ID_INPUT_ properties are not present, instead
+ // the system makes use of the ID_CLASS property to identify the device class
+ const char* idClass = udev_device_get_property_value(udevDevice, "ID_CLASS");
+
+ if (idClass)
{
- std::ostringstream name;
- name << "js" << i;
- std::string nameString = name.str();
+ // Check if the device class matches joystick
+ if (std::strstr(idClass, "joystick"))
+ return true;
+
+ // Check if the device class matches something that isn't a joystick
+ // Rationale same as above
+ if (std::strstr(idClass, "accelerometer") ||
+ std::strstr(idClass, "key") ||
+ std::strstr(idClass, "keyboard") ||
+ std::strstr(idClass, "mouse") ||
+ std::strstr(idClass, "tablet") ||
+ std::strstr(idClass, "touchpad") ||
+ std::strstr(idClass, "touchscreen"))
+ return false;
+ }
+
+ // At this point, assume it is a joystick
+ return true;
+ }
- int file = ::open(("/dev/input/" + nameString).c_str(), O_RDONLY);
+ void updatePluggedList(udev_device* udevDevice = NULL)
+ {
+ if (udevDevice)
+ {
+ const char* action = udev_device_get_action(udevDevice);
- if (file < 0)
+ if (action)
{
- plugged[i] = false;
- continue;
+ if (isJoystick(udevDevice))
+ {
+ // Since isJoystick returned true, this has to succeed
+ const char* devnode = udev_device_get_devnode(udevDevice);
+
+ JoystickList::iterator record;
+
+ for (record = joystickList.begin(); record != joystickList.end(); ++record)
+ {
+ if (record->deviceNode == devnode)
+ {
+ if (std::strstr(action, "add"))
+ {
+ // The system path might have changed so update it
+ const char* syspath = udev_device_get_syspath(udevDevice);
+
+ record->plugged = true;
+ record->systemPath = syspath ? syspath : "";
+ break;
+ }
+ else if (std::strstr(action, "remove"))
+ {
+ record->plugged = false;
+ break;
+ }
+ }
+ }
+
+ if (record == joystickList.end())
+ {
+ if (std::strstr(action, "add"))
+ {
+ // If not mapped before and it got added, map it now
+ const char* syspath = udev_device_get_syspath(udevDevice);
+
+ JoystickRecord record;
+ record.deviceNode = devnode;
+ record.systemPath = syspath ? syspath : "";
+ record.plugged = true;
+
+ joystickList.push_back(record);
+ }
+ else if (std::strstr(action, "remove"))
+ {
+ // Not mapped during the initial scan, and removed (shouldn't happen)
+ sf::err() << "Trying to disconnect joystick that wasn't connected" << std::endl;
+ }
+ }
+ }
+
+ return;
}
- ::close(file);
+ // Do a full rescan if there was no action just to be sure
+ }
- // 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;
- }
+ // Reset the plugged status of each mapping since we are doing a full rescan
+ for (JoystickList::iterator record = joystickList.begin(); record != joystickList.end(); ++record)
+ record->plugged = false;
- udev_device* udevDevice = udev_device_new_from_subsystem_sysname(udevContext, "input", nameString.c_str());
+ udev_enumerate* udevEnumerator = udev_enumerate_new(udevContext);
- if (!udevDevice)
- {
- // Go safe and assume it is if we can't get the device
- plugged[i] = true;
- continue;
- }
+ if (!udevEnumerator)
+ {
+ sf::err() << "Error while creating udev enumerator" << std::endl;
+ return;
+ }
- if (udev_device_get_property_value(udevDevice, "ID_INPUT_ACCELEROMETER"))
- {
- // This device is an accelerometer
- plugged[i] = false;
- }
- else
+ int result = 0;
+
+ result = udev_enumerate_add_match_subsystem(udevEnumerator, "input");
+
+ if (result < 0)
+ {
+ sf::err() << "Error while adding udev enumerator match" << std::endl;
+ return;
+ }
+
+ result = udev_enumerate_scan_devices(udevEnumerator);
+
+ if (result < 0)
+ {
+ sf::err() << "Error while enumerating udev devices" << std::endl;
+ return;
+ }
+
+ udev_list_entry* devices = udev_enumerate_get_list_entry(udevEnumerator);
+ udev_list_entry* device;
+
+ udev_list_entry_foreach(device, devices) {
+ const char* syspath = udev_list_entry_get_name(device);
+ udev_device* udevDevice = udev_device_new_from_syspath(udevContext, syspath);
+
+ if (udevDevice && isJoystick(udevDevice))
{
- // This device is not an accelerometer
- // Assume it's a joystick
- plugged[i] = true;
+ // Since isJoystick returned true, this has to succeed
+ const char* devnode = udev_device_get_devnode(udevDevice);
+
+ JoystickList::iterator record;
+
+ // Check if the device node has been mapped before
+ for (record = joystickList.begin(); record != joystickList.end(); ++record)
+ {
+ if (record->deviceNode == devnode)
+ {
+ record->plugged = true;
+ break;
+ }
+ }
+
+ // If not mapped before, map it now
+ if (record == joystickList.end())
+ {
+ JoystickRecord record;
+ record.deviceNode = devnode;
+ record.systemPath = syspath;
+ record.plugged = true;
+
+ joystickList.push_back(record);
+ }
}
udev_device_unref(udevDevice);
}
- if (udevContext)
- udev_unref(udevContext);
+ udev_enumerate_unref(udevEnumerator);
}
- bool hasInotifyEvent()
+ bool hasMonitorEvent()
{
+ // This will not fail since we make sure udevMonitor is valid
+ int monitorFd = udev_monitor_get_fd(udevMonitor);
+
fd_set descriptorSet;
FD_ZERO(&descriptorSet);
- FD_SET(notifyFd, &descriptorSet);
+ FD_SET(monitorFd, &descriptorSet);
timeval timeout = {0, 0};
- return (select(notifyFd + 1, &descriptorSet, NULL, NULL, &timeout) > 0) &&
- FD_ISSET(notifyFd, &descriptorSet);
+ return (select(monitorFd + 1, &descriptorSet, NULL, NULL, &timeout) > 0) &&
+ FD_ISSET(monitorFd, &descriptorSet);
}
- // Get the joystick name
- std::string getJoystickName(int file, unsigned int index)
+ // Get a property value from a udev device
+ const char* getUdevAttribute(udev_device* udevDevice, const std::string& attributeName)
{
- // Get the name
- char name[128];
+ return udev_device_get_property_value(udevDevice, attributeName.c_str());
+ }
- if (ioctl(file, JSIOCGNAME(sizeof(name)), name) >= 0)
- return std::string(name);
+ // Get a system attribute from a USB device
+ const char* getUsbAttribute(udev_device* udevDevice, const std::string& attributeName)
+ {
+ udev_device* udevDeviceParent = udev_device_get_parent_with_subsystem_devtype(udevDevice, "usb", "usb_device");
- sf::err() << "Unable to get name for joystick at index " << index << std::endl;
+ if (!udevDeviceParent)
+ return NULL;
- return std::string("Unknown Joystick");
+ return udev_device_get_sysattr_value(udevDeviceParent, attributeName.c_str());
}
- // 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)
+ // Get a USB attribute for a joystick as an unsigned int
+ unsigned int getUsbAttributeUint(udev_device* udevDevice, const std::string& attributeName)
{
- udev_device* udevDeviceParent = udev_device_get_parent_with_subsystem_devtype(device, "usb", "usb_device");
+ if (!udevDevice)
+ return 0;
- if (!udevDeviceParent)
+ const char* attribute = getUsbAttribute(udevDevice, attributeName);
+ unsigned int value = 0;
+
+ if (attribute)
+ value = static_cast<unsigned int>(std::strtoul(attribute, NULL, 16));
+
+ return value;
+ }
+
+ // Get a udev property value for a joystick as an unsigned int
+ unsigned int getUdevAttributeUint(udev_device* udevDevice, const std::string& attributeName)
+ {
+ if (!udevDevice)
+ return 0;
+
+ const char* attribute = getUdevAttribute(udevDevice, attributeName);
+ unsigned int value = 0;
+
+ if (attribute)
+ value = static_cast<unsigned int>(std::strtoul(attribute, NULL, 16));
+
+ return value;
+ }
+
+ // Get the joystick vendor id
+ unsigned int getJoystickVendorId(unsigned int index)
+ {
+ if (!udevContext)
{
- sf::err() << "Unable to get joystick attribute. "
- << "Could not find parent USB device for joystick at index " << index << "." << std::endl;
+ sf::err() << "Failed to get vendor ID of joystick " << joystickList[index].deviceNode << std::endl;
return 0;
}
- const char* attributeString = udev_device_get_sysattr_value(udevDeviceParent, attributeName.c_str());
+ udev_device* udevDevice = udev_device_new_from_syspath(udevContext, joystickList[index].systemPath.c_str());
- if (!attributeString)
+ if (!udevDevice)
{
- sf::err() << "Unable to get joystick attribute '" << attributeName << "'. "
- << "Attribute does not exist for joystick at index " << index << "." << std::endl;
+ sf::err() << "Failed to get vendor ID of joystick " << joystickList[index].deviceNode << std::endl;
return 0;
}
- return static_cast<unsigned int>(std::strtoul(attributeString, NULL, 16));
+ unsigned int id = 0;
+
+ // First try using udev
+ id = getUdevAttributeUint(udevDevice, "ID_VENDOR_ID");
+
+ if (id)
+ {
+ udev_device_unref(udevDevice);
+ return id;
+ }
+
+ // Fall back to using USB attribute
+ id = getUsbAttributeUint(udevDevice, "idVendor");
+
+ udev_device_unref(udevDevice);
+
+ if (id)
+ return id;
+
+ sf::err() << "Failed to get vendor ID of joystick " << joystickList[index].deviceNode << std::endl;
+
+ return 0;
}
- // Get a system attribute for a joystick at index as an unsigned int
- unsigned int getAttributeUint(unsigned int index, const std::string& attributeName)
+ // Get the joystick product id
+ unsigned int getJoystickProductId(unsigned int index)
{
- udev* udevContext = udev_new();
-
if (!udevContext)
{
- sf::err() << "Unable to get joystick attribute. "
- << "Could not create udev context." << std::endl;
+ sf::err() << "Failed to get product ID of joystick " << joystickList[index].deviceNode << 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());
+ udev_device* udevDevice = udev_device_new_from_syspath(udevContext, joystickList[index].systemPath.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);
+ sf::err() << "Failed to get product ID of joystick " << joystickList[index].deviceNode << std::endl;
return 0;
}
- unsigned int attribute = getUdevAttributeUint(udevDevice, index, attributeName);
+ unsigned int id = 0;
+
+ // First try using udev
+ id = getUdevAttributeUint(udevDevice, "ID_MODEL_ID");
+
+ if (id)
+ {
+ udev_device_unref(udevDevice);
+ return id;
+ }
+
+ // Fall back to using USB attribute
+ id = getUsbAttributeUint(udevDevice, "idProduct");
udev_device_unref(udevDevice);
- udev_unref(udevContext);
- return attribute;
+
+ if (id)
+ return id;
+
+ sf::err() << "Failed to get product ID of joystick " << joystickList[index].deviceNode << std::endl;
+
+ return 0;
+ }
+
+ // Get the joystick name
+ std::string getJoystickName(unsigned int index)
+ {
+ std::string devnode = joystickList[index].deviceNode;
+
+ // First try using ioctl with JSIOCGNAME
+ int fd = ::open(devnode.c_str(), O_RDONLY | O_NONBLOCK);
+
+ if (fd >= 0)
+ {
+ // Get the name
+ char name[128];
+ std::memset(name, 0, sizeof(name));
+
+ int result = ioctl(fd, JSIOCGNAME(sizeof(name)), name);
+
+ ::close(fd);
+
+ if (result >= 0)
+ return std::string(name);
+ }
+
+ // Fall back to manual USB chain walk via udev
+ if (udevContext)
+ {
+ udev_device* udevDevice = udev_device_new_from_syspath(udevContext, joystickList[index].systemPath.c_str());
+
+ if (udevDevice)
+ {
+ const char* product = getUsbAttribute(udevDevice, "product");
+ udev_device_unref(udevDevice);
+
+ if (product)
+ return std::string(product);
+ }
+ }
+
+ sf::err() << "Unable to get name for joystick " << devnode << std::endl;
+
+ return std::string("Unknown Joystick");
}
}
@@ -191,95 +442,133 @@ namespace priv
////////////////////////////////////////////////////////////
void JoystickImpl::initialize()
{
- // Reset the array of plugged joysticks
- std::fill(plugged, plugged + Joystick::Count, false);
+ udevContext = udev_new();
- // Do an initial scan
- updatePluggedList();
-
- // Create the inotify instance
- notifyFd = inotify_init();
- if (notifyFd < 0)
+ if (!udevContext)
{
- err() << "Failed to initialize inotify, joystick connections and disconnections won't be notified" << std::endl;
+ sf::err() << "Failed to create udev context, joystick support not available" << 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)
+ udevMonitor = udev_monitor_new_from_netlink(udevContext, "udev");
+
+ if (!udevMonitor)
{
- err() << "Failed to initialize inotify, joystick connections and disconnections won't be notified" << std::endl;
+ err() << "Failed to create udev monitor, joystick connections and disconnections won't be notified" << std::endl;
+ }
+ else
+ {
+ int error = udev_monitor_filter_add_match_subsystem_devtype(udevMonitor, "input", NULL);
+
+ if (error < 0)
+ {
+ err() << "Failed to add udev monitor filter, joystick connections and disconnections won't be notified: " << error << std::endl;
+
+ udev_monitor_unref(udevMonitor);
+ udevMonitor = 0;
+ }
+ else
+ {
+ error = udev_monitor_enable_receiving(udevMonitor);
- // No need to hang on to the inotify handle in this case
- ::close(notifyFd);
- notifyFd = -1;
+ if (error < 0)
+ {
+ err() << "Failed to enable udev monitor, joystick connections and disconnections won't be notified: " << error << std::endl;
+
+ udev_monitor_unref(udevMonitor);
+ udevMonitor = 0;
+ }
+ }
}
+
+ // Do an initial scan
+ updatePluggedList();
}
////////////////////////////////////////////////////////////
void JoystickImpl::cleanup()
{
- // Stop watching the /dev/input directory
- if (inputFd >= 0)
- inotify_rm_watch(notifyFd, inputFd);
+ // Unreference the udev monitor to destroy it
+ if (udevMonitor)
+ {
+ udev_monitor_unref(udevMonitor);
+ udevMonitor = 0;
+ }
- // Close the inotify file descriptor
- if (notifyFd >= 0)
- ::close(notifyFd);
+ // Unreference the udev context to destroy it
+ if (udevContext)
+ {
+ udev_unref(udevContext);
+ udevContext = 0;
+ }
}
////////////////////////////////////////////////////////////
bool JoystickImpl::isConnected(unsigned int index)
{
- // See if we can skip scanning if inotify is available
- if (notifyFd < 0)
+ // See if we can skip scanning if udev monitor is available
+ if (!udevMonitor)
{
- // inotify is not available, perform a scan every query
+ // udev monitor is not available, perform a scan every query
updatePluggedList();
}
- else if (hasInotifyEvent())
+ else if (hasMonitorEvent())
{
// Check if new joysticks were added/removed since last update
- // Don't bother decomposing and interpreting the filename, just do a full scan
- updatePluggedList();
+ udev_device* udevDevice = udev_monitor_receive_device(udevMonitor);
- // Flush all the pending events
- if (lseek(notifyFd, 0, SEEK_END) < 0)
- err() << "Failed to flush inotify of all pending joystick events." << std::endl;
+ // If we can get the specific device, we check that,
+ // otherwise just do a full scan if udevDevice == NULL
+ updatePluggedList(udevDevice);
+
+ if (udevDevice)
+ udev_device_unref(udevDevice);
}
+ if (index >= joystickList.size())
+ return false;
+
// Then check if the joystick is connected
- return plugged[index];
+ return joystickList[index].plugged;
}
////////////////////////////////////////////////////////////
bool JoystickImpl::open(unsigned int index)
{
- if (plugged[index])
+ if (index >= joystickList.size())
+ return false;
+
+ if (joystickList[index].plugged)
{
- std::ostringstream name;
- name << "/dev/input/js" << index;
+ std::string devnode = joystickList[index].deviceNode;
// Open the joystick's file descriptor (read-only and non-blocking)
- m_file = ::open(name.str().c_str(), O_RDONLY | O_NONBLOCK);
+ m_file = ::open(devnode.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");
+ m_identification.name = getJoystickName(index);
+
+ if (udevContext)
+ {
+ m_identification.vendorId = getJoystickVendorId(index);
+ m_identification.productId = getJoystickProductId(index);
+ }
// Reset the joystick state
m_state = JoystickState();
return true;
}
+ else
+ {
+ err() << "Failed to open joystick " << devnode << ": " << errno << std::endl;
+ }
}
return false;
@@ -290,6 +579,7 @@ bool JoystickImpl::open(unsigned int index)
void JoystickImpl::close()
{
::close(m_file);
+ m_file = -1;
}
@@ -298,6 +588,9 @@ JoystickCaps JoystickImpl::getCapabilities() const
{
JoystickCaps caps;
+ if (m_file < 0)
+ return caps;
+
// Get the number of buttons
char buttonCount;
ioctl(m_file, JSIOCGBUTTONS, &buttonCount);
@@ -340,9 +633,16 @@ Joystick::Identification JoystickImpl::getIdentification() const
////////////////////////////////////////////////////////////
JoystickState JoystickImpl::JoystickImpl::update()
{
+ if (m_file < 0)
+ {
+ m_state = JoystickState();
+ return m_state;
+ }
+
// pop events from the joystick file
js_event joyState;
- while (read(m_file, &joyState, sizeof(joyState)) > 0)
+ int result = read(m_file, &joyState, sizeof(joyState));
+ while (result > 0)
{
switch (joyState.type & ~JS_EVENT_INIT)
{
@@ -375,10 +675,18 @@ JoystickState JoystickImpl::JoystickImpl::update()
break;
}
}
+
+ result = read(m_file, &joyState, sizeof(joyState));
}
- // Check the connection state of the joystick (read() fails with an error != EGAIN if it's no longer connected)
- m_state.connected = (errno == EAGAIN);
+ // Check the connection state of the joystick
+ // read() returns -1 and errno != EGAIN if it's no longer connected
+ // We need to check the result of read() as well, since errno could
+ // have been previously set by some other function call that failed
+ // result can be either negative or 0 at this point
+ // If result is 0, assume the joystick is still connected
+ // If result is negative, check errno and disconnect if it is not EAGAIN
+ m_state.connected = (!result || (errno == EAGAIN));
return m_state;
}
diff --git a/src/SFML/Window/Unix/JoystickImpl.hpp b/src/SFML/Window/Unix/JoystickImpl.hpp
index 50777ef..34fce2e 100644
--- a/src/SFML/Window/Unix/JoystickImpl.hpp
+++ b/src/SFML/Window/Unix/JoystickImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,9 +28,8 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include <linux/joystick.h>
-#include <fcntl.h>
-#include <string>
+#include <SFML/Window/JoystickImpl.hpp>
+#include <linux/input.h>
namespace sf
diff --git a/src/SFML/Window/Unix/ScopedXcbPtr.hpp b/src/SFML/Window/Unix/ScopedXcbPtr.hpp
new file mode 100644
index 0000000..6c98065
--- /dev/null
+++ b/src/SFML/Window/Unix/ScopedXcbPtr.hpp
@@ -0,0 +1,102 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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_SCOPEDXCBPTR_HPP
+#define SFML_SCOPEDXCBPTR_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <cstdlib>
+
+
+namespace sf
+{
+namespace priv
+{
+////////////////////////////////////////////////////////////
+/// \brief Scoped pointer that frees memory returned in XCB replies
+///
+////////////////////////////////////////////////////////////
+template<typename T>
+class ScopedXcbPtr
+{
+public:
+ ////////////////////////////////////////////////////////////
+ /// \brief Constructor
+ ///
+ /// \param pointer Pointer value to store
+ ///
+ ////////////////////////////////////////////////////////////
+ ScopedXcbPtr(T* pointer);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Destructor, calls std::free() on the stored pointer
+ ///
+ ////////////////////////////////////////////////////////////
+ ~ScopedXcbPtr();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Structure dereference operator
+ ///
+ /// \return Stored pointer
+ ///
+ ////////////////////////////////////////////////////////////
+ T* operator ->() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Address operator.
+ ///
+ /// \return Address of the stored pointer
+ ///
+ ////////////////////////////////////////////////////////////
+ T** operator &();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Check if stored pointer is valid
+ ///
+ /// \return true if stored pointer is valid
+ ///
+ ////////////////////////////////////////////////////////////
+ operator bool() const;
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Retrieve the stored pointer.
+ ///
+ /// \return The stored pointer
+ ///
+ ////////////////////////////////////////////////////////////
+ T* get() const;
+
+private:
+ T* m_pointer; ///< Stored pointer
+};
+
+#include <SFML/Window/Unix/ScopedXcbPtr.inl>
+
+} // namespace priv
+
+} // namespace sf
+
+#endif // SFML_SCOPEDXCBPTR_HPP
diff --git a/src/SFML/Window/Unix/ScopedXcbPtr.inl b/src/SFML/Window/Unix/ScopedXcbPtr.inl
new file mode 100644
index 0000000..6683a1e
--- /dev/null
+++ b/src/SFML/Window/Unix/ScopedXcbPtr.inl
@@ -0,0 +1,72 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+template <typename T>
+inline ScopedXcbPtr<T>::ScopedXcbPtr(T* pointer) :
+m_pointer(pointer)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+template <typename T>
+inline ScopedXcbPtr<T>::~ScopedXcbPtr()
+{
+ std::free(m_pointer);
+}
+
+
+////////////////////////////////////////////////////////////
+template <typename T>
+inline T* ScopedXcbPtr<T>::operator ->() const
+{
+ return m_pointer;
+}
+
+
+////////////////////////////////////////////////////////////
+template <typename T>
+inline T** ScopedXcbPtr<T>::operator &()
+{
+ return &m_pointer;
+}
+
+
+////////////////////////////////////////////////////////////
+template <typename T>
+inline ScopedXcbPtr<T>::operator bool() const
+{
+ return m_pointer != NULL;
+}
+
+
+////////////////////////////////////////////////////////////
+template <typename T>
+inline T* ScopedXcbPtr<T>::get() const
+{
+ return m_pointer;
+}
diff --git a/src/SFML/Window/Unix/SensorImpl.cpp b/src/SFML/Window/Unix/SensorImpl.cpp
index be5e439..144c6d7 100644
--- a/src/SFML/Window/Unix/SensorImpl.cpp
+++ b/src/SFML/Window/Unix/SensorImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Unix/SensorImpl.hpp b/src/SFML/Window/Unix/SensorImpl.hpp
index bbd705b..49ced87 100644
--- a/src/SFML/Window/Unix/SensorImpl.hpp
+++ b/src/SFML/Window/Unix/SensorImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Unix/VideoModeImpl.cpp b/src/SFML/Window/Unix/VideoModeImpl.cpp
index c7e6204..9ee812f 100644
--- a/src/SFML/Window/Unix/VideoModeImpl.cpp
+++ b/src/SFML/Window/Unix/VideoModeImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -27,9 +27,9 @@
////////////////////////////////////////////////////////////
#include <SFML/Window/VideoModeImpl.hpp>
#include <SFML/Window/Unix/Display.hpp>
+#include <SFML/Window/Unix/ScopedXcbPtr.hpp>
#include <SFML/System/Err.hpp>
-#include <X11/Xlib.h>
-#include <X11/extensions/Xrandr.h>
+#include <xcb/randr.h>
#include <algorithm>
@@ -43,73 +43,96 @@ std::vector<VideoMode> VideoModeImpl::getFullscreenModes()
std::vector<VideoMode> modes;
// Open a connection with the X server
- Display* display = OpenDisplay();
- if (display)
+ xcb_connection_t* connection = OpenConnection();
+
+ // Retrieve the default screen
+ xcb_screen_t* screen = XCBDefaultScreen(connection);
+
+ ScopedXcbPtr<xcb_generic_error_t> error(NULL);
+
+ const xcb_query_extension_reply_t* randrExt = xcb_get_extension_data(connection, &xcb_randr_id);
+
+ if (!randrExt || !randrExt->present)
{
- // Retrieve the default screen number
- int screen = DefaultScreen(display);
+ // Randr extension is not supported: we cannot get the video modes
+ err() << "Failed to use the RandR extension while trying to get the supported video modes" << std::endl;
- // Check if the XRandR extension is present
- int version;
- if (XQueryExtension(display, "RANDR", &version, &version, &version))
- {
- // Get the current configuration
- XRRScreenConfiguration* config = XRRGetScreenInfo(display, RootWindow(display, screen));
- if (config)
- {
- // Get the available screen sizes
- int nbSizes;
- XRRScreenSize* sizes = XRRConfigSizes(config, &nbSizes);
- if (sizes && (nbSizes > 0))
- {
- // Get the list of supported depths
- int nbDepths = 0;
- int* depths = XListDepths(display, screen, &nbDepths);
- if (depths && (nbDepths > 0))
- {
- // Combine depths and sizes to fill the array of supported modes
- for (int i = 0; i < nbDepths; ++i)
- {
- for (int j = 0; j < nbSizes; ++j)
- {
- // 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);
- }
- }
-
- // Free the array of depths
- XFree(depths);
- }
- }
-
- // Free the configuration instance
- XRRFreeScreenConfigInfo(config);
- }
- else
- {
- // Failed to get the screen configuration
- err() << "Failed to retrieve the screen configuration while trying to get the supported video modes" << std::endl;
- }
- }
- else
- {
- // 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;
- }
+ // Close the connection with the X server
+ CloseConnection(connection);
+
+ return modes;
+ }
+
+ // Load RandR and check its version
+ ScopedXcbPtr<xcb_randr_query_version_reply_t> randrVersion(xcb_randr_query_version_reply(
+ connection,
+ xcb_randr_query_version(
+ connection,
+ 1,
+ 1
+ ),
+ &error
+ ));
+
+ if (error)
+ {
+ err() << "Failed to load the RandR extension while trying to get the supported video modes" << std::endl;
// Close the connection with the X server
- CloseDisplay(display);
+ CloseConnection(connection);
+
+ return modes;
}
- else
+
+ // Get the current configuration
+ ScopedXcbPtr<xcb_randr_get_screen_info_reply_t> config(xcb_randr_get_screen_info_reply(
+ connection,
+ xcb_randr_get_screen_info(
+ connection,
+ screen->root
+ ),
+ &error
+ ));
+
+ if (error)
+ {
+ // Failed to get the screen configuration
+ err() << "Failed to retrieve the screen configuration while trying to get the supported video modes" << std::endl;
+
+ // Close the connection with the X server
+ CloseConnection(connection);
+
+ return modes;
+ }
+
+ // Get the available screen sizes
+ xcb_randr_screen_size_t* sizes = xcb_randr_get_screen_info_sizes(config.get());
+ if (sizes && (config->nSizes > 0))
{
- // We couldn't connect to the X server
- err() << "Failed to connect to the X server while trying to get the supported video modes" << std::endl;
+ // Get the list of supported depths
+ xcb_depth_iterator_t iter = xcb_screen_allowed_depths_iterator(screen);
+ // Combine depths and sizes to fill the array of supported modes
+ for (; iter.rem; xcb_depth_next(&iter))
+ {
+ for (int j = 0; j < config->nSizes; ++j)
+ {
+ // Convert to VideoMode
+ VideoMode mode(sizes[j].width, sizes[j].height, iter.data->depth);
+
+ if (config->rotation == XCB_RANDR_ROTATION_ROTATE_90 ||
+ config->rotation == XCB_RANDR_ROTATION_ROTATE_270)
+ std::swap(mode.width, mode.height);
+
+ // 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);
+ }
+ }
}
+ // Close the connection with the X server
+ CloseConnection(connection);
+
return modes;
}
@@ -120,54 +143,91 @@ VideoMode VideoModeImpl::getDesktopMode()
VideoMode desktopMode;
// Open a connection with the X server
- Display* display = OpenDisplay();
- if (display)
+ xcb_connection_t* connection = OpenConnection();
+
+ // Retrieve the default screen
+ xcb_screen_t* screen = XCBDefaultScreen(connection);
+
+ ScopedXcbPtr<xcb_generic_error_t> error(NULL);
+
+ // Check if the RandR extension is present
+ const xcb_query_extension_reply_t* randrExt = xcb_get_extension_data(connection, &xcb_randr_id);
+
+ if (!randrExt || !randrExt->present)
{
- // Retrieve the default screen number
- int screen = DefaultScreen(display);
+ // Randr extension is not supported: we cannot get the video modes
+ err() << "Failed to use the RandR extension while trying to get the desktop video mode" << std::endl;
- // Check if the XRandR extension is present
- int version;
- if (XQueryExtension(display, "RANDR", &version, &version, &version))
- {
- // Get the current configuration
- XRRScreenConfiguration* config = XRRGetScreenInfo(display, RootWindow(display, screen));
- if (config)
- {
- // Get the current video mode
- Rotation currentRotation;
- int currentMode = XRRConfigCurrentConfiguration(config, &currentRotation);
-
- // Get the available screen sizes
- int nbSizes;
- XRRScreenSize* sizes = XRRConfigSizes(config, &nbSizes);
- if (sizes && (nbSizes > 0))
- desktopMode = VideoMode(sizes[currentMode].width, sizes[currentMode].height, DefaultDepth(display, screen));
-
- // Free the configuration instance
- XRRFreeScreenConfigInfo(config);
- }
- else
- {
- // Failed to get the screen configuration
- err() << "Failed to retrieve the screen configuration while trying to get the desktop video modes" << std::endl;
- }
- }
- else
- {
- // 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;
- }
+ // Close the connection with the X server
+ CloseConnection(connection);
+
+ return desktopMode;
+ }
+
+ // Load RandR and check its version
+ ScopedXcbPtr<xcb_randr_query_version_reply_t> randrVersion(xcb_randr_query_version_reply(
+ connection,
+ xcb_randr_query_version(
+ connection,
+ 1,
+ 1
+ ),
+ &error
+ ));
+
+ if (error)
+ {
+ err() << "Failed to load the RandR extension while trying to get the desktop video mode" << std::endl;
// Close the connection with the X server
- CloseDisplay(display);
+ CloseConnection(connection);
+
+ return desktopMode;
+ }
+
+ // Get the current configuration
+ ScopedXcbPtr<xcb_randr_get_screen_info_reply_t> config(xcb_randr_get_screen_info_reply(
+ connection,
+ xcb_randr_get_screen_info(
+ connection,
+ screen->root
+ ),
+ &error
+ ));
+
+ if (error)
+ {
+ // Failed to get the screen configuration
+ err() << "Failed to retrieve the screen configuration while trying to get the desktop video mode" << std::endl;
+
+ // Close the connection with the X server
+ CloseConnection(connection);
+
+ return desktopMode;
+ }
+
+ // Get the current video mode
+ xcb_randr_mode_t currentMode = config->sizeID;
+
+ // Get the available screen sizes
+ int nbSizes = xcb_randr_get_screen_info_sizes_length(config.get());
+ xcb_randr_screen_size_t* sizes = xcb_randr_get_screen_info_sizes(config.get());
+ if (sizes && (nbSizes > 0))
+ {
+ desktopMode = VideoMode(sizes[currentMode].width, sizes[currentMode].height, screen->root_depth);
+
+ if (config->rotation == XCB_RANDR_ROTATION_ROTATE_90 ||
+ config->rotation == XCB_RANDR_ROTATION_ROTATE_270)
+ std::swap(desktopMode.width, desktopMode.height);
}
else
{
- // We couldn't connect to the X server
- err() << "Failed to connect to the X server while trying to get the desktop video modes" << std::endl;
+ err() << "Failed to retrieve any screen sizes while trying to get the desktop video mode" << std::endl;
}
+ // Close the connection with the X server
+ CloseConnection(connection);
+
return desktopMode;
}
diff --git a/src/SFML/Window/Unix/WindowImplX11.cpp b/src/SFML/Window/Unix/WindowImplX11.cpp
index 9e29757..d8c26e0 100644
--- a/src/SFML/Window/Unix/WindowImplX11.cpp
+++ b/src/SFML/Window/Unix/WindowImplX11.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,19 +28,27 @@
#include <SFML/Window/WindowStyle.hpp> // important to be included first (conflict with None)
#include <SFML/Window/Unix/WindowImplX11.hpp>
#include <SFML/Window/Unix/Display.hpp>
+#include <SFML/Window/Unix/ScopedXcbPtr.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 <SFML/System/Mutex.hpp>
+#include <SFML/System/Lock.hpp>
+#include <xcb/xcb_image.h>
+#include <xcb/randr.h>
+#include <X11/Xlibint.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <unistd.h>
-#include <cstring>
-#include <sstream>
+#include <libgen.h>
+#include <fcntl.h>
+#include <algorithm>
#include <vector>
#include <string>
-#include <iterator>
-#include <algorithm>
+#include <cstring>
+
+// So we don't have to require xcb dri2 to be present
+#define XCB_DRI2_BUFFER_SWAP_COMPLETE 0
+#define XCB_DRI2_INVALIDATE_BUFFERS 1
#ifdef SFML_OPENGL_ES
#include <SFML/Window/EglContext.hpp>
@@ -57,30 +65,430 @@ namespace
{
sf::priv::WindowImplX11* fullscreenWindow = NULL;
std::vector<sf::priv::WindowImplX11*> allWindows;
- unsigned long eventMask = FocusChangeMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask |
- PointerMotionMask | KeyPressMask | KeyReleaseMask | StructureNotifyMask |
- EnterWindowMask | LeaveWindowMask;
+ sf::Mutex allWindowsMutex;
+ sf::String windowManagerName;
- // Filter the events received by windows (only allow those matching a specific window)
- Bool checkEvent(::Display*, XEvent* event, XPointer userData)
- {
- // Just check if the event matches the window
- return event->xany.window == reinterpret_cast< ::Window >(userData);
- }
+ bool mapBuilt = false;
+
+ // We use a simple array instead of a map => constant time lookup
+ // xcb_keycode_t can only contain 256 distinct values
+ sf::Keyboard::Key sfKeyMap[256];
+
+ static const unsigned long eventMask = XCB_EVENT_MASK_FOCUS_CHANGE | XCB_EVENT_MASK_BUTTON_PRESS |
+ XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_BUTTON_MOTION |
+ XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_KEY_PRESS |
+ XCB_EVENT_MASK_KEY_RELEASE | XCB_EVENT_MASK_STRUCTURE_NOTIFY |
+ XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW;
// Find the name of the current executable
- void findExecutableName(char* buffer, std::size_t bufferSize)
+ std::string findExecutableName()
{
- //Default fallback name
- const char* executableName = "sfml";
- std::size_t length = readlink("/proc/self/exe", buffer, bufferSize);
- if ((length > 0) && (length < bufferSize))
+ // We use /proc/self/cmdline to get the command line
+ // the user used to invoke this instance of the application
+ int file = ::open("/proc/self/cmdline", O_RDONLY | O_NONBLOCK);
+
+ if (file < 0)
+ return "sfml";
+
+ std::vector<char> buffer(256, 0);
+ std::size_t offset = 0;
+ ssize_t result = 0;
+
+ while ((result = read(file, &buffer[offset], 256)) > 0)
+ {
+ buffer.resize(buffer.size() + result, 0);
+ offset += result;
+ }
+
+ ::close(file);
+
+ if (offset)
{
+ buffer[offset] = 0;
+
// Remove the path to keep the executable name only
- buffer[length] = '\0';
- executableName = basename(buffer);
+ return basename(&buffer[0]);
+ }
+
+ // Default fallback name
+ return "sfml";
+ }
+
+ // Check if Extended Window Manager Hints are supported
+ bool ewmhSupported()
+ {
+ static bool checked = false;
+ static bool ewmhSupported = false;
+
+ if (checked)
+ return ewmhSupported;
+
+ checked = true;
+
+ xcb_connection_t* connection = sf::priv::OpenConnection();
+
+ xcb_atom_t netSupportingWmCheck = sf::priv::getAtom("_NET_SUPPORTING_WM_CHECK", true);
+ xcb_atom_t netSupported = sf::priv::getAtom("_NET_SUPPORTED", true);
+
+ if (!netSupportingWmCheck || !netSupported)
+ return false;
+
+ sf::priv::ScopedXcbPtr<xcb_generic_error_t> error(NULL);
+
+ sf::priv::ScopedXcbPtr<xcb_get_property_reply_t> rootSupportingWindow(xcb_get_property_reply(
+ connection,
+ xcb_get_property(
+ connection,
+ 0,
+ sf::priv::XCBDefaultRootWindow(connection),
+ netSupportingWmCheck,
+ XCB_ATOM_WINDOW,
+ 0,
+ 1
+ ),
+ &error
+ ));
+
+ if (!rootSupportingWindow || rootSupportingWindow->length != 1)
+ {
+ sf::priv::CloseConnection(connection);
+ return false;
+ }
+
+ xcb_window_t* rootWindow = reinterpret_cast<xcb_window_t*>(xcb_get_property_value(rootSupportingWindow.get()));
+
+ if (!rootWindow)
+ {
+ sf::priv::CloseConnection(connection);
+ return false;
+ }
+
+ sf::priv::ScopedXcbPtr<xcb_get_property_reply_t> childSupportingWindow(xcb_get_property_reply(
+ connection,
+ xcb_get_property(
+ connection,
+ 0,
+ *rootWindow,
+ netSupportingWmCheck,
+ XCB_ATOM_WINDOW,
+ 0,
+ 1
+ ),
+ &error
+ ));
+
+ if (!childSupportingWindow || childSupportingWindow->length != 1)
+ {
+ sf::priv::CloseConnection(connection);
+ return false;
+ }
+
+ xcb_window_t* childWindow = reinterpret_cast<xcb_window_t*>(xcb_get_property_value(childSupportingWindow.get()));
+
+ if (!childWindow)
+ {
+ sf::priv::CloseConnection(connection);
+ return false;
+ }
+
+ // Conforming window managers should return the same window for both queries
+ if (*rootWindow != *childWindow)
+ {
+ sf::priv::CloseConnection(connection);
+ return false;
+ }
+
+ ewmhSupported = true;
+
+ // We try to get the name of the window manager
+ // for window manager specific workarounds
+ xcb_atom_t netWmName = sf::priv::getAtom("_NET_WM_NAME", true);
+ xcb_atom_t utf8StringType = sf::priv::getAtom("UTF8_STRING");
+
+ if (!utf8StringType)
+ utf8StringType = XCB_ATOM_STRING;
+
+ if (!netWmName)
+ {
+ sf::priv::CloseConnection(connection);
+ return true;
+ }
+
+ sf::priv::ScopedXcbPtr<xcb_get_property_reply_t> wmName(xcb_get_property_reply(
+ connection,
+ xcb_get_property(
+ connection,
+ 0,
+ *childWindow,
+ netWmName,
+ utf8StringType,
+ 0,
+ 0x7fffffff
+ ),
+ &error
+ ));
+
+ sf::priv::CloseConnection(connection);
+
+ const char* name = reinterpret_cast<const char*>(xcb_get_property_value(wmName.get()));
+
+ windowManagerName = name;
+
+ return true;
+ }
+
+ xcb_query_extension_reply_t getDriExtension()
+ {
+ xcb_connection_t* connection = sf::priv::OpenConnection();
+
+ sf::priv::ScopedXcbPtr<xcb_generic_error_t> error(NULL);
+
+ // Check if the DRI2 extension is present
+ // We don't use xcb_get_extension_data here to avoid having to link to xcb_dri2
+ static const std::string DRI2 = "DRI2";
+ sf::priv::ScopedXcbPtr<xcb_query_extension_reply_t> driExt(xcb_query_extension_reply(
+ connection,
+ xcb_query_extension(
+ connection,
+ DRI2.size(),
+ DRI2.c_str()
+ ),
+ &error
+ ));
+
+ // Close the connection with the X server
+ sf::priv::CloseConnection(connection);
+
+ if (error || !driExt || !driExt->present)
+ {
+ xcb_query_extension_reply_t reply;
+ std::memset(&reply, 0, sizeof(reply));
+ return reply;
+ }
+
+ return *driExt.get();
+ }
+
+ void dumpXcbExtensions()
+ {
+ xcb_connection_t* connection = sf::priv::OpenConnection();
+
+ sf::priv::ScopedXcbPtr<xcb_generic_error_t> error(NULL);
+
+ // Check if the RandR extension is present
+ sf::priv::ScopedXcbPtr<xcb_list_extensions_reply_t> extensions(xcb_list_extensions_reply(
+ connection,
+ xcb_list_extensions(
+ connection
+ ),
+ &error
+ ));
+
+ if (error || !extensions)
+ {
+ // Close the connection with the X server
+ sf::priv::CloseConnection(connection);
+
+ sf::err() << "Couldn't get list of X extensions" << std::endl;
+ return;
+ }
+
+ xcb_str_iterator_t iter = xcb_list_extensions_names_iterator(extensions.get());
+
+ sf::err() << "X Extensions:" << std::endl;
+
+ while (iter.rem)
+ {
+ std::string name(xcb_str_name(iter.data), xcb_str_name_length(iter.data));
+
+ sf::priv::ScopedXcbPtr<xcb_generic_error_t> error(NULL);
+
+ // Check if the RandR extension is present
+ sf::priv::ScopedXcbPtr<xcb_query_extension_reply_t> extension(xcb_query_extension_reply(
+ connection,
+ xcb_query_extension(
+ connection,
+ name.size(),
+ name.c_str()
+ ),
+ &error
+ ));
+
+ if (error || !extension || !extension->present)
+ {
+ sf::err() << "\t" << name << " - Failed to query" << std::endl;
+ continue;
+ }
+
+ int firstEvent = extension->first_event;
+
+ sf::err() << "\t" << name << " - First event: " << firstEvent << std::endl;
+ iter.data += xcb_str_name_length(iter.data) + 1;
+ --iter.rem;
+ }
+
+ // Close the connection with the X server
+ sf::priv::CloseConnection(connection);
+ }
+
+ void dumpUnhandledEvent(uint8_t type)
+ {
+ static std::vector<uint8_t> types;
+
+ // Check if we already reported this type
+ if (std::find(types.begin(), types.end(), type) != types.end())
+ return;
+
+ // Insert it if new
+ types.push_back(type);
+
+ static bool dumpedExtensions = false;
+
+ if (!dumpedExtensions)
+ {
+ dumpXcbExtensions();
+ dumpedExtensions = true;
+ }
+
+ sf::err() << "Unhandled event type: " << (static_cast<int>(type) & ~0x80) << std::endl
+ << "Report this to the SFML maintainers if possible" << std::endl;
+ }
+
+ xcb_keysym_t getKeysymFromKeycode(xcb_keycode_t keycode)
+ {
+ return sf::priv::getKeysymMap()[keycode];
+ }
+
+ sf::Keyboard::Key keysymToSF(xcb_keysym_t symbol)
+ {
+ switch (symbol)
+ {
+ case XK_Shift_L: return sf::Keyboard::LShift;
+ case XK_Shift_R: return sf::Keyboard::RShift;
+ case XK_Control_L: return sf::Keyboard::LControl;
+ case XK_Control_R: return sf::Keyboard::RControl;
+ case XK_Alt_L: return sf::Keyboard::LAlt;
+ case XK_Alt_R: return sf::Keyboard::RAlt;
+ case XK_Super_L: return sf::Keyboard::LSystem;
+ case XK_Super_R: return sf::Keyboard::RSystem;
+ case XK_Menu: return sf::Keyboard::Menu;
+ case XK_Escape: return sf::Keyboard::Escape;
+ case XK_semicolon: return sf::Keyboard::SemiColon;
+ case XK_slash: return sf::Keyboard::Slash;
+ case XK_equal: return sf::Keyboard::Equal;
+ case XK_minus: return sf::Keyboard::Dash;
+ case XK_bracketleft: return sf::Keyboard::LBracket;
+ case XK_bracketright: return sf::Keyboard::RBracket;
+ case XK_comma: return sf::Keyboard::Comma;
+ case XK_period: return sf::Keyboard::Period;
+ case XK_apostrophe: return sf::Keyboard::Quote;
+ case XK_backslash: return sf::Keyboard::BackSlash;
+ case XK_grave: return sf::Keyboard::Tilde;
+ case XK_space: return sf::Keyboard::Space;
+ case XK_Return: return sf::Keyboard::Return;
+ case XK_KP_Enter: return sf::Keyboard::Return;
+ case XK_BackSpace: return sf::Keyboard::BackSpace;
+ case XK_Tab: return sf::Keyboard::Tab;
+ case XK_Prior: return sf::Keyboard::PageUp;
+ case XK_Next: return sf::Keyboard::PageDown;
+ case XK_End: return sf::Keyboard::End;
+ case XK_Home: return sf::Keyboard::Home;
+ case XK_Insert: return sf::Keyboard::Insert;
+ case XK_Delete: return sf::Keyboard::Delete;
+ case XK_KP_Add: return sf::Keyboard::Add;
+ case XK_KP_Subtract: return sf::Keyboard::Subtract;
+ case XK_KP_Multiply: return sf::Keyboard::Multiply;
+ case XK_KP_Divide: return sf::Keyboard::Divide;
+ case XK_Pause: return sf::Keyboard::Pause;
+ case XK_F1: return sf::Keyboard::F1;
+ case XK_F2: return sf::Keyboard::F2;
+ case XK_F3: return sf::Keyboard::F3;
+ case XK_F4: return sf::Keyboard::F4;
+ case XK_F5: return sf::Keyboard::F5;
+ case XK_F6: return sf::Keyboard::F6;
+ case XK_F7: return sf::Keyboard::F7;
+ case XK_F8: return sf::Keyboard::F8;
+ case XK_F9: return sf::Keyboard::F9;
+ case XK_F10: return sf::Keyboard::F10;
+ case XK_F11: return sf::Keyboard::F11;
+ case XK_F12: return sf::Keyboard::F12;
+ case XK_F13: return sf::Keyboard::F13;
+ case XK_F14: return sf::Keyboard::F14;
+ case XK_F15: return sf::Keyboard::F15;
+ case XK_Left: return sf::Keyboard::Left;
+ case XK_Right: return sf::Keyboard::Right;
+ case XK_Up: return sf::Keyboard::Up;
+ case XK_Down: return sf::Keyboard::Down;
+ case XK_KP_0: return sf::Keyboard::Numpad0;
+ case XK_KP_1: return sf::Keyboard::Numpad1;
+ case XK_KP_2: return sf::Keyboard::Numpad2;
+ case XK_KP_3: return sf::Keyboard::Numpad3;
+ case XK_KP_4: return sf::Keyboard::Numpad4;
+ case XK_KP_5: return sf::Keyboard::Numpad5;
+ case XK_KP_6: return sf::Keyboard::Numpad6;
+ case XK_KP_7: return sf::Keyboard::Numpad7;
+ case XK_KP_8: return sf::Keyboard::Numpad8;
+ case XK_KP_9: return sf::Keyboard::Numpad9;
+ case XK_a: return sf::Keyboard::A;
+ case XK_b: return sf::Keyboard::B;
+ case XK_c: return sf::Keyboard::C;
+ case XK_d: return sf::Keyboard::D;
+ case XK_e: return sf::Keyboard::E;
+ case XK_f: return sf::Keyboard::F;
+ case XK_g: return sf::Keyboard::G;
+ case XK_h: return sf::Keyboard::H;
+ case XK_i: return sf::Keyboard::I;
+ case XK_j: return sf::Keyboard::J;
+ case XK_k: return sf::Keyboard::K;
+ case XK_l: return sf::Keyboard::L;
+ case XK_m: return sf::Keyboard::M;
+ case XK_n: return sf::Keyboard::N;
+ case XK_o: return sf::Keyboard::O;
+ case XK_p: return sf::Keyboard::P;
+ case XK_q: return sf::Keyboard::Q;
+ case XK_r: return sf::Keyboard::R;
+ case XK_s: return sf::Keyboard::S;
+ case XK_t: return sf::Keyboard::T;
+ case XK_u: return sf::Keyboard::U;
+ case XK_v: return sf::Keyboard::V;
+ case XK_w: return sf::Keyboard::W;
+ case XK_x: return sf::Keyboard::X;
+ case XK_y: return sf::Keyboard::Y;
+ case XK_z: return sf::Keyboard::Z;
+ case XK_0: return sf::Keyboard::Num0;
+ case XK_1: return sf::Keyboard::Num1;
+ case XK_2: return sf::Keyboard::Num2;
+ case XK_3: return sf::Keyboard::Num3;
+ case XK_4: return sf::Keyboard::Num4;
+ case XK_5: return sf::Keyboard::Num5;
+ case XK_6: return sf::Keyboard::Num6;
+ case XK_7: return sf::Keyboard::Num7;
+ case XK_8: return sf::Keyboard::Num8;
+ case XK_9: return sf::Keyboard::Num9;
+ }
+
+ return sf::Keyboard::Unknown;
+ }
+
+ void buildMap()
+ {
+ for (xcb_keycode_t i = 0; ; ++i)
+ {
+ sfKeyMap[i] = keysymToSF(getKeysymFromKeycode(i));
+
+ if (i == 255)
+ break;
}
- std::memmove(buffer, executableName, std::strlen(executableName) + 1);
+
+ mapBuilt = true;
+ }
+
+ sf::Keyboard::Key keycodeToSF(xcb_keycode_t keycode)
+ {
+ if (!mapBuilt)
+ buildMap();
+
+ return sfKeyMap[keycode];
}
}
@@ -91,20 +499,33 @@ namespace priv
{
////////////////////////////////////////////////////////////
WindowImplX11::WindowImplX11(WindowHandle handle) :
-m_window (0),
-m_inputMethod (NULL),
-m_inputContext(NULL),
-m_isExternal (true),
-m_atomClose (0),
-m_oldVideoMode(-1),
-m_hiddenCursor(0),
-m_keyRepeat (true),
-m_previousSize(-1, -1),
-m_useSizeHints(false)
+m_window (0),
+m_inputMethod (NULL),
+m_inputContext (NULL),
+m_isExternal (true),
+m_hiddenCursor (0),
+m_keyRepeat (true),
+m_previousSize (-1, -1),
+m_useSizeHints (false),
+m_fullscreen (false)
{
// Open a connection with the X server
m_display = OpenDisplay();
- m_screen = DefaultScreen(m_display);
+ m_connection = XGetXCBConnection(m_display);
+
+ std::memset(&m_oldVideoMode, 0, sizeof(m_oldVideoMode));
+
+ if (!m_connection)
+ {
+ err() << "Failed cast Display object to an XCB connection object" << std::endl;
+ return;
+ }
+
+ // Make sure to check for EWMH support before we do anything
+ ewmhSupported();
+
+ m_screen = XCBDefaultScreen(m_connection);
+ XSetEventQueueOwner(m_display, XCBOwnsEventQueue);
// Save the window handle
m_window = handle;
@@ -112,7 +533,17 @@ m_useSizeHints(false)
if (m_window)
{
// Make sure the window is listening to all the required events
- XSelectInput(m_display, m_window, eventMask & ~ButtonPressMask);
+ const uint32_t value_list[] = {static_cast<uint32_t>(eventMask)};
+
+ xcb_change_window_attributes(
+ m_connection,
+ m_window,
+ XCB_CW_EVENT_MASK,
+ value_list
+ );
+
+ // Set the WM protocols
+ setProtocols();
// Do some common initializations
initialize();
@@ -122,158 +553,139 @@ m_useSizeHints(false)
////////////////////////////////////////////////////////////
WindowImplX11::WindowImplX11(VideoMode mode, const String& title, unsigned long style, const ContextSettings& settings) :
-m_window (0),
-m_inputMethod (NULL),
-m_inputContext(NULL),
-m_isExternal (false),
-m_atomClose (0),
-m_oldVideoMode(-1),
-m_hiddenCursor(0),
-m_keyRepeat (true),
-m_previousSize(-1, -1),
-m_useSizeHints(false)
+m_window (0),
+m_inputMethod (NULL),
+m_inputContext (NULL),
+m_isExternal (false),
+m_hiddenCursor (0),
+m_keyRepeat (true),
+m_previousSize (-1, -1),
+m_useSizeHints (false),
+m_fullscreen ((style & Style::Fullscreen) != 0)
{
// Open a connection with the X server
m_display = OpenDisplay();
- m_screen = DefaultScreen(m_display);
- ::Window root = RootWindow(m_display, m_screen);
+ m_connection = XGetXCBConnection(m_display);
- // Compute position and size
- int left, top;
- bool fullscreen = (style & Style::Fullscreen) != 0;
- if (!fullscreen)
- {
- left = (DisplayWidth(m_display, m_screen) - mode.width) / 2;
- top = (DisplayHeight(m_display, m_screen) - mode.height) / 2;
- }
- else
+ std::memset(&m_oldVideoMode, 0, sizeof(m_oldVideoMode));
+
+ if (!m_connection)
{
- left = 0;
- top = 0;
+ err() << "Failed cast Display object to an XCB connection object" << std::endl;
+ return;
}
+
+ // Make sure to check for EWMH support before we do anything
+ ewmhSupported();
+
+ m_screen = XCBDefaultScreen(m_connection);
+ XSetEventQueueOwner(m_display, XCBOwnsEventQueue);
+
+ // Compute position and size
+ int left = m_fullscreen ? 0 : (m_screen->width_in_pixels - mode.width) / 2;
+ int top = m_fullscreen ? 0 : (m_screen->height_in_pixels - mode.height) / 2;
int width = mode.width;
int height = mode.height;
- // Switch to fullscreen if necessary
- if (fullscreen)
- switchToFullscreen(mode);
-
// Choose the visual according to the context settings
XVisualInfo visualInfo = ContextType::selectBestVisual(m_display, mode.bitsPerPixel, settings);
// Define the window attributes
- XSetWindowAttributes attributes;
- attributes.override_redirect = fullscreen;
- attributes.event_mask = eventMask;
- attributes.colormap = XCreateColormap(m_display, root, visualInfo.visual, AllocNone);
+ xcb_colormap_t colormap = xcb_generate_id(m_connection);
+ xcb_create_colormap(m_connection, XCB_COLORMAP_ALLOC_NONE, colormap, m_screen->root, visualInfo.visualid);
+ const uint32_t value_list[] = {m_fullscreen && !ewmhSupported(), static_cast<uint32_t>(eventMask), colormap};
// Create the window
- m_window = XCreateWindow(m_display,
- root,
- left, top,
- width, height,
- 0,
- visualInfo.depth,
- InputOutput,
- visualInfo.visual,
- CWEventMask | CWOverrideRedirect | CWColormap, &attributes);
- if (!m_window)
+ m_window = xcb_generate_id(m_connection);
+
+ ScopedXcbPtr<xcb_generic_error_t> errptr(xcb_request_check(
+ m_connection,
+ xcb_create_window_checked(
+ m_connection,
+ static_cast<uint8_t>(visualInfo.depth),
+ m_window,
+ m_screen->root,
+ left, top,
+ width, height,
+ 0,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT,
+ visualInfo.visualid,
+ XCB_CW_EVENT_MASK | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_COLORMAP,
+ value_list
+ )
+ ));
+
+ if (errptr)
{
err() << "Failed to create window" << std::endl;
return;
}
- // Set the window's name
- setTitle(title);
-
- // Set the window's style (tell the windows manager to change our window's decorations and functions according to the requested style)
- if (!fullscreen)
+ // Set the WM protocols
+ setProtocols();
+
+ // Set the WM initial state to the normal state
+ WMHints hints;
+ std::memset(&hints, 0, sizeof(hints));
+ hints.initial_state = 1;
+ hints.flags |= 1 << 1;
+ setWMHints(hints);
+
+ // If not in fullscreen, set the window's style (tell the window manager to
+ // change our window's decorations and functions according to the requested style)
+ if (!m_fullscreen)
+ setMotifHints(style);
+
+ WMSizeHints sizeHints;
+ std::memset(&sizeHints, 0, sizeof(sizeHints));
+
+ // This is a hack to force some windows managers to disable resizing
+ // Fullscreen is bugged on Openbox. Unless size hints are set, there
+ // will be a region of the window that is off-screen. We try to workaround
+ // this by setting size hints even in fullscreen just for Openbox.
+ if ((!m_fullscreen || (windowManagerName == "Openbox")) && !(style & Style::Resize))
{
- Atom WMHintsAtom = XInternAtom(m_display, "_MOTIF_WM_HINTS", false);
- if (WMHintsAtom)
- {
- 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;
- static const unsigned long MWM_DECOR_TITLE = 1 << 3;
- static const unsigned long MWM_DECOR_MENU = 1 << 4;
- static const unsigned long MWM_DECOR_MINIMIZE = 1 << 5;
- static const unsigned long MWM_DECOR_MAXIMIZE = 1 << 6;
-
- //static const unsigned long MWM_FUNC_ALL = 1 << 0;
- static const unsigned long MWM_FUNC_RESIZE = 1 << 1;
- static const unsigned long MWM_FUNC_MOVE = 1 << 2;
- 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;
- unsigned long functions;
- unsigned long decorations;
- long inputMode;
- unsigned long state;
- };
-
- WMHints hints;
- hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS;
- hints.decorations = 0;
- hints.functions = 0;
-
- if (style & Style::Titlebar)
- {
- hints.decorations |= MWM_DECOR_BORDER | MWM_DECOR_TITLE | MWM_DECOR_MINIMIZE | MWM_DECOR_MENU;
- hints.functions |= MWM_FUNC_MOVE | MWM_FUNC_MINIMIZE;
- }
- if (style & Style::Resize)
- {
- hints.decorations |= MWM_DECOR_MAXIMIZE | MWM_DECOR_RESIZEH;
- hints.functions |= MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE;
- }
- if (style & Style::Close)
- {
- hints.decorations |= 0;
- hints.functions |= MWM_FUNC_CLOSE;
- }
-
- const unsigned char* ptr = reinterpret_cast<const unsigned char*>(&hints);
- XChangeProperty(m_display, m_window, WMHintsAtom, WMHintsAtom, 32, PropModeReplace, ptr, 5);
- }
-
- // 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_height = sizeHints->max_height = height;
- XSetWMNormalHints(m_display, m_window, sizeHints);
- XFree(sizeHints);
- }
+ m_useSizeHints = true;
+ sizeHints.flags |= ((1 << 4) | (1 << 5));
+ sizeHints.min_width = width;
+ sizeHints.max_width = width;
+ sizeHints.min_height = height;
+ sizeHints.max_height = height;
}
+ // Set the WM hints of the normal state
+ setWMSizeHints(sizeHints);
+
// Set the window's WM class (this can be used by window managers)
- char windowClass[512];
- findExecutableName(windowClass, sizeof(windowClass));
- XClassHint* classHint = XAllocClassHint();
- classHint->res_name = windowClass;
- classHint->res_class = windowClass;
- XSetClassHint(m_display, m_window, classHint);
- XFree(classHint);
+ // The WM_CLASS property actually consists of 2 parts,
+ // the instance name and the class name both of which should be
+ // null terminated strings.
+ // The instance name should be something unique to this invokation
+ // of the application but is rarely if ever used these days.
+ // For simplicity, we retrieve it via the base executable name.
+ // The class name identifies a class of windows that
+ // "are of the same type". We simply use the initial window name as
+ // the class name.
+ std::string windowClass = findExecutableName();
+ windowClass += '\0'; // Important to separate instance from class
+ windowClass += title.toAnsiString();
+
+ // We add 1 to the size of the string to include the null at the end
+ if (!changeWindowProperty(XCB_ATOM_WM_CLASS, XCB_ATOM_STRING, 8, windowClass.size() + 1, windowClass.c_str()))
+ sf::err() << "Failed to set WM_CLASS property" << std::endl;
+
+ // Set the window's name
+ setTitle(title);
// Do some common initializations
initialize();
- // In fullscreen mode, we must grab keyboard and mouse inputs
- if (fullscreen)
+ // Set fullscreen video mode and switch to fullscreen if necessary
+ if (m_fullscreen)
{
- XGrabPointer(m_display, m_window, true, 0, GrabModeAsync, GrabModeAsync, m_window, None, CurrentTime);
- XGrabKeyboard(m_display, m_window, true, GrabModeAsync, GrabModeAsync, CurrentTime);
+ setPosition(Vector2i(0, 0));
+ setVideoMode(mode);
+ switchToFullscreen();
}
}
@@ -286,17 +698,16 @@ WindowImplX11::~WindowImplX11()
// Destroy the cursor
if (m_hiddenCursor)
- XFreeCursor(m_display, m_hiddenCursor);
+ xcb_free_cursor(m_connection, m_hiddenCursor);
// Destroy the input context
if (m_inputContext)
XDestroyIC(m_inputContext);
-
// Destroy the window
if (m_window && !m_isExternal)
{
- XDestroyWindow(m_display, m_window);
- XFlush(m_display);
+ xcb_destroy_window(m_connection, m_window);
+ xcb_flush(m_connection);
}
// Close the input method
@@ -307,6 +718,7 @@ WindowImplX11::~WindowImplX11()
CloseDisplay(m_display);
// Remove this window from the global list of windows (required for focus request)
+ Lock lock(allWindowsMutex);
allWindows.erase(std::find(allWindows.begin(), allWindows.end(), this));
}
@@ -321,10 +733,105 @@ WindowHandle WindowImplX11::getSystemHandle() const
////////////////////////////////////////////////////////////
void WindowImplX11::processEvents()
{
- XEvent event;
- while (XCheckIfEvent(m_display, &event, &checkEvent, reinterpret_cast<XPointer>(m_window)))
+ // Key repeat workaround: If key repeat is enabled, XCB will spawn two
+ // events for each repeat interval: key release and key press. Both have
+ // the same timestamp and key code. We are holding back the release event
+ // to check for the matching key press event and if so, discard the release
+ // event.
+
+ xcb_generic_event_t* event = NULL;
+ xcb_key_release_event_t* lastKeyReleaseEvent = NULL;
+ uint8_t eventType = 0;
+
+ if (!m_xcbEvents.empty())
{
- processEvent(event);
+ event = m_xcbEvents.front();
+ m_xcbEvents.pop_front();
+ }
+ else
+ {
+ event = xcb_poll_for_event(m_connection);
+ }
+
+ while (event)
+ {
+ eventType = event->response_type & ~0x80;
+
+ // Key was pressed and one has been released prior to that.
+ if (eventType == XCB_KEY_PRESS && lastKeyReleaseEvent)
+ {
+ // If the key press event matches the held back key release event,
+ // then we have a key repeat and discard the held back release
+ // event.
+ if (lastKeyReleaseEvent->time == reinterpret_cast<xcb_key_press_event_t*>(event)->time &&
+ lastKeyReleaseEvent->detail == reinterpret_cast<xcb_key_press_event_t*>(event)->detail)
+ {
+ free(lastKeyReleaseEvent);
+ lastKeyReleaseEvent = NULL;
+
+ // If key repeat is disabled, discard the matching key press event as well
+ if (!m_keyRepeat)
+ {
+ free(event);
+
+ if (!m_xcbEvents.empty())
+ {
+ event = m_xcbEvents.front();
+ m_xcbEvents.pop_front();
+ }
+ else
+ {
+ event = xcb_poll_for_event(m_connection);
+ }
+
+ continue;
+ }
+ }
+ }
+
+ // If there's still a key release event held back, process it now.
+ if (lastKeyReleaseEvent)
+ {
+ if (processEvent(reinterpret_cast<xcb_generic_event_t*>(lastKeyReleaseEvent)))
+ free(lastKeyReleaseEvent);
+
+ lastKeyReleaseEvent = NULL;
+ }
+
+ if (eventType == XCB_KEY_RELEASE)
+ {
+ // Check if we're in charge of the key release
+ if (!passEvent(event, reinterpret_cast<xcb_key_release_event_t*>(event)->event))
+ {
+ // Remember this key release event.
+ lastKeyReleaseEvent = reinterpret_cast<xcb_key_release_event_t*>(event);
+ event = NULL; // For safety reasons.
+ }
+ }
+ else
+ {
+ if (processEvent(event))
+ free(event);
+ }
+
+ if (!m_xcbEvents.empty())
+ {
+ event = m_xcbEvents.front();
+ m_xcbEvents.pop_front();
+ }
+ else
+ {
+ event = xcb_poll_for_event(m_connection);
+ }
+ }
+
+ // Process any held back release event.
+ if (lastKeyReleaseEvent)
+ {
+ if (processEvent(reinterpret_cast<xcb_generic_event_t*>(lastKeyReleaseEvent)))
+ free(lastKeyReleaseEvent);
+
+ lastKeyReleaseEvent = NULL;
}
}
@@ -332,71 +839,146 @@ void WindowImplX11::processEvents()
////////////////////////////////////////////////////////////
Vector2i WindowImplX11::getPosition() const
{
- ::Window root, child;
- int localX, localY, x, y;
- unsigned int width, height, border, depth;
+ ::Window topLevelWindow = m_window;
+ ::Window nextWindow = topLevelWindow;
+
+ ScopedXcbPtr<xcb_generic_error_t> error(NULL);
+
+ // Get "top level" window, i.e. the window with the root window as its parent.
+ while (nextWindow != m_screen->root)
+ {
+ topLevelWindow = nextWindow;
+
+ ScopedXcbPtr<xcb_query_tree_reply_t> treeReply(xcb_query_tree_reply(
+ m_connection,
+ xcb_query_tree(
+ m_connection,
+ topLevelWindow
+ ),
+ &error
+ ));
+
+ if (error)
+ {
+ err() << "Failed to get window position (query_tree)" << std::endl;
+ return Vector2i(0, 0);
+ }
+
+ nextWindow = treeReply->parent;
+ }
+
+ ScopedXcbPtr<xcb_get_geometry_reply_t> geometryReply(xcb_get_geometry_reply(
+ m_connection,
+ xcb_get_geometry(
+ m_connection,
+ topLevelWindow
+ ),
+ &error
+ ));
- XGetGeometry(m_display, m_window, &root, &localX, &localY, &width, &height, &border, &depth);
- XTranslateCoordinates(m_display, m_window, root, localX, localY, &x, &y, &child);
+ if (error)
+ {
+ err() << "Failed to get window position (get_geometry)" << std::endl;
+ return Vector2i(0, 0);
+ }
- return Vector2i(x, y);
+ return Vector2i(geometryReply->x, geometryReply->y);
}
////////////////////////////////////////////////////////////
void WindowImplX11::setPosition(const Vector2i& position)
{
- XMoveWindow(m_display, m_window, position.x, position.y);
- XFlush(m_display);
+ uint32_t values[] = {static_cast<uint32_t>(position.x), static_cast<uint32_t>(position.y)};
+ xcb_configure_window(m_connection, m_window,
+ XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y,
+ values);
+ xcb_flush(m_connection);
}
////////////////////////////////////////////////////////////
Vector2u WindowImplX11::getSize() const
{
- XWindowAttributes attributes;
- XGetWindowAttributes(m_display, m_window, &attributes);
- return Vector2u(attributes.width, attributes.height);
+ ScopedXcbPtr<xcb_get_geometry_reply_t> reply(xcb_get_geometry_reply(m_connection, xcb_get_geometry(m_connection, m_window), NULL));
+
+ return Vector2u(reply->width, reply->height);
}
////////////////////////////////////////////////////////////
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);
+ // If resizing is disable for the window we have to update the size hints (required by some window managers).
+ if( m_useSizeHints ) {
+ WMSizeHints sizeHints;
+ std::memset(&sizeHints, 0, sizeof(sizeHints));
+
+ sizeHints.flags |= (1 << 4 | 1 << 5);
+ sizeHints.min_width = size.x;
+ sizeHints.max_width = size.x;
+ sizeHints.min_height = size.y;
+ sizeHints.max_height = size.y;
+
+ setWMSizeHints(sizeHints);
}
- XResizeWindow(m_display, m_window, size.x, size.y);
- XFlush(m_display);
+ uint32_t values[] = {size.x, size.y};
+
+ ScopedXcbPtr<xcb_generic_error_t> configureWindowError(xcb_request_check(
+ m_connection,
+ xcb_configure_window(
+ m_connection,
+ m_window,
+ XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT,
+ values
+ )
+ ));
+
+ if (configureWindowError)
+ err() << "Failed to set window size" << std::endl;
+
+ xcb_flush(m_connection);
}
////////////////////////////////////////////////////////////
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.
+ // XCB takes UTF-8-encoded strings.
+ xcb_atom_t utf8StringType = getAtom("UTF8_STRING");
+
+ if (!utf8StringType)
+ utf8StringType = XCB_ATOM_STRING;
+
+ std::string utf8String;
+ Utf<32>::toUtf8(title.begin(), title.end(), std::back_inserter(utf8String));
+
+ if (!changeWindowProperty(XCB_ATOM_WM_NAME, utf8StringType, 8, utf8String.length(), utf8String.c_str()))
+ err() << "Failed to set window title" << std::endl;
- // Convert to UTF-8 encoding.
- std::basic_string<Uint8> utf8Title;
- Utf32::toUtf8(title.begin(), title.end(), std::back_inserter(utf8Title));
+ if (!changeWindowProperty(XCB_ATOM_WM_ICON_NAME, utf8StringType, 8, utf8String.length(), utf8String.c_str()))
+ err() << "Failed to set WM_ICON_NAME property" << std::endl;
- // 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());
+ if (ewmhSupported())
+ {
+ xcb_atom_t netWmName = getAtom("_NET_WM_NAME", true);
+ xcb_atom_t netWmIconName = getAtom("_NET_WM_ICON_NAME", true);
+
+ if (utf8StringType && netWmName)
+ {
+ if (!changeWindowProperty(netWmName, utf8StringType, 8, utf8String.length(), utf8String.c_str()))
+ err() << "Failed to set _NET_WM_NAME property" << std::endl;
+ }
+
+ if (utf8StringType && netWmName)
+ {
+ if (!changeWindowProperty(netWmIconName, utf8StringType, 8, utf8String.length(), utf8String.c_str()))
+ err() << "Failed to set _NET_WM_ICON_NAME property" << std::endl;
+ }
+ }
- // 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());
+ xcb_flush(m_connection);
}
@@ -404,8 +986,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
- // Note: this memory will be freed by XDestroyImage
- Uint8* iconPixels = static_cast<Uint8*>(std::malloc(width * height * 4));
+ Uint8 iconPixels[width * height * 4];
for (std::size_t i = 0; i < width * height; ++i)
{
iconPixels[i * 4 + 0] = pixels[i * 4 + 2];
@@ -415,20 +996,85 @@ void WindowImplX11::setIcon(unsigned int width, unsigned int height, const Uint8
}
// Create the icon pixmap
- Visual* defVisual = DefaultVisual(m_display, m_screen);
- unsigned int defDepth = DefaultDepth(m_display, m_screen);
- XImage* iconImage = XCreateImage(m_display, defVisual, defDepth, ZPixmap, 0, (char*)iconPixels, width, height, 32, 0);
- if (!iconImage)
+ xcb_pixmap_t iconPixmap = xcb_generate_id(m_connection);
+
+ ScopedXcbPtr<xcb_generic_error_t> createPixmapError(xcb_request_check(
+ m_connection,
+ xcb_create_pixmap_checked(
+ m_connection,
+ m_screen->root_depth,
+ iconPixmap,
+ m_screen->root,
+ width,
+ height
+ )
+ ));
+
+ if (createPixmapError)
{
- err() << "Failed to set the window's icon" << std::endl;
+ err() << "Failed to set the window's icon (create_pixmap): ";
+ err() << "Error code " << static_cast<int>(createPixmapError->error_code) << std::endl;
+ return;
+ }
+
+ xcb_gcontext_t iconGC = xcb_generate_id(m_connection);
+
+ ScopedXcbPtr<xcb_generic_error_t> createGcError(xcb_request_check(
+ m_connection,
+ xcb_create_gc(
+ m_connection,
+ iconGC,
+ iconPixmap,
+ 0,
+ NULL
+ )
+ ));
+
+ if (createGcError)
+ {
+ err() << "Failed to set the window's icon (create_gc): ";
+ err() << "Error code " << static_cast<int>(createGcError->error_code) << std::endl;
+ return;
+ }
+
+ ScopedXcbPtr<xcb_generic_error_t> putImageError(xcb_request_check(
+ m_connection,
+ xcb_put_image_checked(
+ m_connection,
+ XCB_IMAGE_FORMAT_Z_PIXMAP,
+ iconPixmap,
+ iconGC,
+ width,
+ height,
+ 0,
+ 0,
+ 0,
+ m_screen->root_depth,
+ sizeof(iconPixels),
+ iconPixels
+ )
+ ));
+
+ ScopedXcbPtr<xcb_generic_error_t> freeGcError(xcb_request_check(
+ m_connection,
+ xcb_free_gc(
+ m_connection,
+ iconGC
+ )
+ ));
+
+ if (freeGcError)
+ {
+ err() << "Failed to free icon GC: ";
+ err() << "Error code " << static_cast<int>(freeGcError->error_code) << std::endl;
+ }
+
+ if (putImageError)
+ {
+ err() << "Failed to set the window's icon (put_image): ";
+ err() << "Error code " << static_cast<int>(putImageError->error_code) << std::endl;
return;
}
- Pixmap iconPixmap = XCreatePixmap(m_display, RootWindow(m_display, m_screen), width, height, defDepth);
- XGCValues values;
- GC iconGC = XCreateGC(m_display, iconPixmap, 0, &values);
- XPutImage(m_display, iconPixmap, iconGC, iconImage, 0, 0, 0, 0, width, height);
- XFreeGC(m_display, iconGC);
- XDestroyImage(iconImage);
// Create the mask pixmap (must have 1 bit depth)
std::size_t pitch = (width + 7) / 8;
@@ -447,17 +1093,43 @@ void WindowImplX11::setIcon(unsigned int width, unsigned int height, const Uint8
}
}
}
- Pixmap maskPixmap = XCreatePixmapFromBitmapData(m_display, m_window, (char*)&maskPixels[0], width, height, 1, 0, 1);
+
+ xcb_pixmap_t maskPixmap = xcb_create_pixmap_from_bitmap_data(
+ m_connection,
+ m_window,
+ reinterpret_cast<uint8_t*>(&maskPixels[0]),
+ width,
+ height,
+ 1,
+ 0,
+ 1,
+ NULL
+ );
// Send our new icon to the window through the WMHints
- XWMHints* hints = XAllocWMHints();
- hints->flags = IconPixmapHint | IconMaskHint;
- hints->icon_pixmap = iconPixmap;
- hints->icon_mask = maskPixmap;
- XSetWMHints(m_display, m_window, hints);
- XFree(hints);
-
- XFlush(m_display);
+ WMHints hints;
+ std::memset(&hints, 0, sizeof(hints));
+ hints.flags |= ((1 << 2) | (1 << 5));
+ hints.icon_pixmap = iconPixmap;
+ hints.icon_mask = maskPixmap;
+
+ setWMHints(hints);
+
+ xcb_flush(m_connection);
+
+ ScopedXcbPtr<xcb_generic_error_t> freePixmapError(xcb_request_check(
+ m_connection,
+ xcb_free_pixmap_checked(
+ m_connection,
+ iconPixmap
+ )
+ ));
+
+ if (freePixmapError)
+ {
+ err() << "Failed to free icon pixmap: ";
+ err() << "Error code " << static_cast<int>(freePixmapError->error_code) << std::endl;
+ }
}
@@ -465,19 +1137,55 @@ void WindowImplX11::setIcon(unsigned int width, unsigned int height, const Uint8
void WindowImplX11::setVisible(bool visible)
{
if (visible)
- XMapWindow(m_display, m_window);
+ {
+ ScopedXcbPtr<xcb_generic_error_t> error(xcb_request_check(
+ m_connection,
+ xcb_map_window(
+ m_connection,
+ m_window
+ )
+ ));
+
+ if (error)
+ err() << "Failed to change window visibility" << std::endl;
+ }
else
- XUnmapWindow(m_display, m_window);
+ {
+ ScopedXcbPtr<xcb_generic_error_t> error(xcb_request_check(
+ m_connection,
+ xcb_unmap_window(
+ m_connection,
+ m_window
+ )
+ ));
+
+ if (error)
+ err() << "Failed to change window visibility" << std::endl;
+ }
- XFlush(m_display);
+ xcb_flush(m_connection);
}
////////////////////////////////////////////////////////////
void WindowImplX11::setMouseCursorVisible(bool visible)
{
- XDefineCursor(m_display, m_window, visible ? None : m_hiddenCursor);
- XFlush(m_display);
+ const uint32_t values = visible ? XCB_NONE : m_hiddenCursor;
+
+ ScopedXcbPtr<xcb_generic_error_t> error(xcb_request_check(
+ m_connection,
+ xcb_change_window_attributes(
+ m_connection,
+ m_window,
+ XCB_CW_CURSOR,
+ &values
+ )
+ ));
+
+ if (error)
+ err() << "Failed to change mouse cursor visibility" << std::endl;
+
+ xcb_flush(m_connection);
}
@@ -495,45 +1203,73 @@ void WindowImplX11::requestFocus()
// 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())
+ Lock lock(allWindowsMutex);
+ for (std::vector<WindowImplX11*>::iterator itr = allWindows.begin(); itr != allWindows.end(); ++itr)
{
- sfmlWindowFocused = true;
- break;
+ if ((*itr)->hasFocus())
+ {
+ sfmlWindowFocused = true;
+ break;
+ }
}
}
-
+
+ ScopedXcbPtr<xcb_generic_error_t> error(NULL);
+
// Check if window is viewable (not on other desktop, ...)
// TODO: Check also if minimized
- XWindowAttributes attributes;
- if (XGetWindowAttributes(m_display, m_window, &attributes) == 0)
+ ScopedXcbPtr<xcb_get_window_attributes_reply_t> attributes(xcb_get_window_attributes_reply(
+ m_connection,
+ xcb_get_window_attributes(
+ m_connection,
+ m_window
+ ),
+ &error
+ ));
+
+ if (error || !attributes)
{
- sf::err() << "Failed to check if window is viewable while requesting focus" << std::endl;
+ err() << "Failed to check if window is viewable while requesting focus" << std::endl;
return; // error getting attribute
}
- bool windowViewable = (attributes.map_state == IsViewable);
-
+ bool windowViewable = (attributes->map_state == XCB_MAP_STATE_VIEWABLE);
+
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);
+ grabFocus();
}
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);
+ // Get current WM hints.
+ ScopedXcbPtr<xcb_get_property_reply_t> hintsReply(xcb_get_property_reply(
+ m_connection,
+ xcb_get_property(m_connection, 0, m_window, XCB_ATOM_WM_HINTS, XCB_ATOM_WM_HINTS, 0, 9),
+ &error
+ ));
+
+ if (error || !hintsReply)
+ {
+ err() << "Failed to get WM hints while requesting focus" << std::endl;
+ return;
+ }
+
+ WMHints* hints = reinterpret_cast<WMHints*>(xcb_get_property_value(hintsReply.get()));
+
+ if (!hints)
+ {
+ err() << "Failed to get WM hints while requesting focus" << std::endl;
+ return;
+ }
+
+ // Even if no hints were returned, we can simply set the proper flags we need and go on. This is
+ // different from Xlib where XAllocWMHints() has to be called.
+ hints->flags |= (1 << 8);
+ setWMHints(*hints);
}
}
@@ -541,101 +1277,498 @@ void WindowImplX11::requestFocus()
////////////////////////////////////////////////////////////
bool WindowImplX11::hasFocus() const
{
- ::Window focusedWindow = 0;
- int revertToReturn = 0;
- XGetInputFocus(m_display, &focusedWindow, &revertToReturn);
+ ScopedXcbPtr<xcb_generic_error_t> error(NULL);
+
+ ScopedXcbPtr<xcb_get_input_focus_reply_t> reply(xcb_get_input_focus_reply(
+ m_connection,
+ xcb_get_input_focus_unchecked(
+ m_connection
+ ),
+ &error
+ ));
- return m_window == focusedWindow;
+ if (error)
+ err() << "Failed to check if window has focus" << std::endl;
+
+ return (reply->focus == m_window);
}
////////////////////////////////////////////////////////////
-void WindowImplX11::switchToFullscreen(const VideoMode& mode)
+void WindowImplX11::grabFocus()
{
- // Check if the XRandR extension is present
- int version;
- if (XQueryExtension(m_display, "RANDR", &version, &version, &version))
+ xcb_atom_t netActiveWindow = XCB_ATOM_NONE;
+
+ if (ewmhSupported())
+ netActiveWindow = getAtom("_NET_ACTIVE_WINDOW");
+
+ if (netActiveWindow)
+ {
+ xcb_client_message_event_t event;
+ std::memset(&event, 0, sizeof(event));
+
+ event.response_type = XCB_CLIENT_MESSAGE;
+ event.window = m_window;
+ event.format = 32;
+ event.sequence = 0;
+ event.type = netActiveWindow;
+ event.data.data32[0] = 1; // Normal application
+ event.data.data32[1] = XCB_CURRENT_TIME;
+ event.data.data32[2] = 0; // We don't know the currently active window
+
+ ScopedXcbPtr<xcb_generic_error_t> activeWindowError(xcb_request_check(
+ m_connection,
+ xcb_send_event_checked(
+ m_connection,
+ 0,
+ XCBDefaultRootWindow(m_connection),
+ XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT,
+ reinterpret_cast<char*>(&event)
+ )
+ ));
+
+ if (activeWindowError)
+ err() << "Setting fullscreen failed, could not send \"_NET_ACTIVE_WINDOW\" event" << std::endl;
+ }
+ else
{
- // Get the current configuration
- XRRScreenConfiguration* config = XRRGetScreenInfo(m_display, RootWindow(m_display, m_screen));
- if (config)
+ ScopedXcbPtr<xcb_generic_error_t> setInputFocusError(xcb_request_check(
+ m_connection,
+ xcb_set_input_focus(
+ m_connection,
+ XCB_INPUT_FOCUS_POINTER_ROOT,
+ m_window,
+ XCB_CURRENT_TIME
+ )
+ ));
+
+ if (setInputFocusError)
{
- // Get the current rotation
- Rotation currentRotation;
- m_oldVideoMode = XRRConfigCurrentConfiguration(config, &currentRotation);
-
- // Get the available screen sizes
- int nbSizes;
- XRRScreenSize* sizes = XRRConfigSizes(config, &nbSizes);
- if (sizes && (nbSizes > 0))
- {
- // Search a matching size
- for (int i = 0; i < nbSizes; ++i)
- {
- if ((sizes[i].width == static_cast<int>(mode.width)) && (sizes[i].height == static_cast<int>(mode.height)))
- {
- // Switch to fullscreen mode
- XRRSetScreenConfig(m_display, config, RootWindow(m_display, m_screen), i, currentRotation, CurrentTime);
+ err() << "Failed to change active window (set_input_focus)" << std::endl;
+ return;
+ }
- // Set "this" as the current fullscreen window
- fullscreenWindow = this;
- break;
- }
- }
- }
+ const uint32_t values[] = {XCB_STACK_MODE_ABOVE};
+
+ ScopedXcbPtr<xcb_generic_error_t> configureWindowError(xcb_request_check(
+ m_connection,
+ xcb_configure_window(
+ m_connection,
+ m_window,
+ XCB_CONFIG_WINDOW_STACK_MODE,
+ values
+ )
+ ));
+
+ if (configureWindowError)
+ err() << "Failed to change active window (configure_window)" << std::endl;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplX11::setVideoMode(const VideoMode& mode)
+{
+ // Skip mode switching if the new mode is equal to the desktop mode
+ if (mode == VideoMode::getDesktopMode())
+ return;
+
+ ScopedXcbPtr<xcb_generic_error_t> error(NULL);
+
+ // Check if the RandR extension is present
+ const xcb_query_extension_reply_t* randrExt = xcb_get_extension_data(m_connection, &xcb_randr_id);
- // Free the configuration instance
- XRRFreeScreenConfigInfo(config);
+ if (!randrExt || !randrExt->present)
+ {
+ // RandR extension is not supported: we cannot use fullscreen mode
+ err() << "Fullscreen is not supported, switching to window mode" << std::endl;
+ return;
+ }
+
+ // Load RandR and check its version
+ ScopedXcbPtr<xcb_randr_query_version_reply_t> randrVersion(xcb_randr_query_version_reply(
+ m_connection,
+ xcb_randr_query_version(
+ m_connection,
+ 1,
+ 1
+ ),
+ &error
+ ));
+
+ if (error)
+ {
+ err() << "Failed to load RandR, switching to window mode" << std::endl;
+ return;
+ }
+
+ // Get the current configuration
+ ScopedXcbPtr<xcb_randr_get_screen_info_reply_t> config(xcb_randr_get_screen_info_reply(
+ m_connection,
+ xcb_randr_get_screen_info(
+ m_connection,
+ m_screen->root
+ ),
+ &error
+ ));
+
+ if (error || !config)
+ {
+ // Failed to get the screen configuration
+ err() << "Failed to get the current screen configuration for fullscreen mode, switching to window mode" << std::endl;
+ return;
+ }
+
+ // Save the current video mode before we switch to fullscreen
+ m_oldVideoMode = *config.get();
+
+ // Get the available screen sizes
+ xcb_randr_screen_size_t* sizes = xcb_randr_get_screen_info_sizes(config.get());
+
+ if (!sizes || !config->nSizes)
+ {
+ err() << "Failed to get the fullscreen sizes, switching to window mode" << std::endl;
+ return;
+ }
+
+ // Search for a matching size
+ for (int i = 0; i < config->nSizes; ++i)
+ {
+ if (config->rotation == XCB_RANDR_ROTATION_ROTATE_90 ||
+ config->rotation == XCB_RANDR_ROTATION_ROTATE_270)
+ std::swap(sizes[i].height, sizes[i].width);
+
+ if ((sizes[i].width == static_cast<int>(mode.width)) &&
+ (sizes[i].height == static_cast<int>(mode.height)))
+ {
+ // Switch to fullscreen mode
+ ScopedXcbPtr<xcb_randr_set_screen_config_reply_t> setScreenConfig(xcb_randr_set_screen_config_reply(
+ m_connection,
+ xcb_randr_set_screen_config(
+ m_connection,
+ config->root,
+ XCB_CURRENT_TIME,
+ config->config_timestamp,
+ i,
+ config->rotation,
+ config->rate
+ ),
+ &error
+ ));
+
+ if (error)
+ err() << "Failed to set new screen configuration" << std::endl;
+
+ // Set "this" as the current fullscreen window
+ fullscreenWindow = this;
+ return;
}
- else
+ }
+
+ err() << "Failed to find matching fullscreen size, switching to window mode" << std::endl;
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplX11::resetVideoMode()
+{
+ if (fullscreenWindow == this)
+ {
+ // Get current screen info
+ ScopedXcbPtr<xcb_generic_error_t> error(NULL);
+
+ // Reset the video mode
+ ScopedXcbPtr<xcb_randr_set_screen_config_reply_t> setScreenConfig(xcb_randr_set_screen_config_reply(
+ m_connection,
+ xcb_randr_set_screen_config(
+ m_connection,
+ m_oldVideoMode.root,
+ XCB_CURRENT_TIME,
+ m_oldVideoMode.config_timestamp,
+ m_oldVideoMode.sizeID,
+ m_oldVideoMode.rotation,
+ m_oldVideoMode.rate
+ ),
+ &error
+ ));
+
+ if (error)
+ err() << "Failed to reset old screen configuration" << std::endl;
+
+ // Reset the fullscreen window
+ fullscreenWindow = NULL;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplX11::switchToFullscreen()
+{
+ grabFocus();
+
+ if (ewmhSupported())
+ {
+ xcb_atom_t netWmBypassCompositor = getAtom("_NET_WM_BYPASS_COMPOSITOR");
+
+ if (netWmBypassCompositor)
+ {
+ static const Uint32 bypassCompositor = 1;
+
+ // Not being able to bypass the compositor is not a fatal error
+ if (!changeWindowProperty(netWmBypassCompositor, XCB_ATOM_CARDINAL, 32, 1, &bypassCompositor))
+ err() << "xcb_change_property failed, unable to set _NET_WM_BYPASS_COMPOSITOR" << std::endl;
+ }
+
+ xcb_atom_t netWmState = getAtom("_NET_WM_STATE", true);
+ xcb_atom_t netWmStateFullscreen = getAtom("_NET_WM_STATE_FULLSCREEN", true);
+
+ if (!netWmState || !netWmStateFullscreen)
{
- // Failed to get the screen configuration
- err() << "Failed to get the current screen configuration for fullscreen mode, switching to window mode" << std::endl;
+ err() << "Setting fullscreen failed. Could not get required atoms" << std::endl;
+ return;
}
+
+ xcb_client_message_event_t event;
+ std::memset(&event, 0, sizeof(event));
+
+ event.response_type = XCB_CLIENT_MESSAGE;
+ event.window = m_window;
+ event.format = 32;
+ event.sequence = 0;
+ event.type = netWmState;
+ event.data.data32[0] = 1; // _NET_WM_STATE_ADD
+ event.data.data32[1] = netWmStateFullscreen;
+ event.data.data32[2] = 0; // No second property
+ event.data.data32[3] = 1; // Normal window
+
+ ScopedXcbPtr<xcb_generic_error_t> wmStateError(xcb_request_check(
+ m_connection,
+ xcb_send_event_checked(
+ m_connection,
+ 0,
+ XCBDefaultRootWindow(m_connection),
+ XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT,
+ reinterpret_cast<char*>(&event)
+ )
+ ));
+
+ if (wmStateError)
+ err() << "Setting fullscreen failed. Could not send \"_NET_WM_STATE\" event" << std::endl;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplX11::setProtocols()
+{
+ xcb_atom_t wmProtocols = getAtom("WM_PROTOCOLS");
+ xcb_atom_t wmDeleteWindow = getAtom("WM_DELETE_WINDOW");
+
+ if (!wmProtocols)
+ {
+ err() << "Failed to request WM_PROTOCOLS atom." << std::endl;
+ return;
+ }
+
+ std::vector<xcb_atom_t> atoms;
+
+ if (wmDeleteWindow)
+ {
+ atoms.push_back(wmDeleteWindow);
}
else
{
- // XRandr extension is not supported: we cannot use fullscreen mode
- err() << "Fullscreen is not supported, switching to window mode" << std::endl;
+ err() << "Failed to request WM_DELETE_WINDOW atom." << std::endl;
+ }
+
+ xcb_atom_t netWmPing = XCB_ATOM_NONE;
+ xcb_atom_t netWmPid = XCB_ATOM_NONE;
+
+ if (ewmhSupported())
+ {
+ netWmPing = getAtom("_NET_WM_PING", true);
+ netWmPid = getAtom("_NET_WM_PID", true);
+ }
+
+ ScopedXcbPtr<xcb_generic_error_t> error(NULL);
+
+ if (netWmPing && netWmPid)
+ {
+ uint32_t pid = getpid();
+
+ if (changeWindowProperty(netWmPid, XCB_ATOM_CARDINAL, 32, 1, &pid))
+ atoms.push_back(netWmPing);
+ }
+
+ if (!atoms.empty())
+ {
+ if (!changeWindowProperty(wmProtocols, XCB_ATOM_ATOM, 32, atoms.size(), &atoms[0]))
+ err() << "Failed to set window protocols" << std::endl;
+ }
+ else
+ {
+ err() << "Didn't set any window protocols" << std::endl;
}
}
////////////////////////////////////////////////////////////
-void WindowImplX11::initialize()
+void WindowImplX11::setMotifHints(unsigned long style)
{
- // Get the atom defining the close event
- m_atomClose = XInternAtom(m_display, "WM_DELETE_WINDOW", false);
- XSetWMProtocols(m_display, m_window, &m_atomClose, 1);
+ ScopedXcbPtr<xcb_generic_error_t> error(NULL);
+
+ static const std::string MOTIF_WM_HINTS = "_MOTIF_WM_HINTS";
+ ScopedXcbPtr<xcb_intern_atom_reply_t> hintsAtomReply(xcb_intern_atom_reply(
+ m_connection,
+ xcb_intern_atom(
+ m_connection,
+ 0,
+ MOTIF_WM_HINTS.size(),
+ MOTIF_WM_HINTS.c_str()
+ ),
+ &error
+ ));
+
+ if (!error && hintsAtomReply)
+ {
+ 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;
+ static const unsigned long MWM_DECOR_TITLE = 1 << 3;
+ static const unsigned long MWM_DECOR_MENU = 1 << 4;
+ static const unsigned long MWM_DECOR_MINIMIZE = 1 << 5;
+ static const unsigned long MWM_DECOR_MAXIMIZE = 1 << 6;
+
+ //static const unsigned long MWM_FUNC_ALL = 1 << 0;
+ static const unsigned long MWM_FUNC_RESIZE = 1 << 1;
+ static const unsigned long MWM_FUNC_MOVE = 1 << 2;
+ 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 MotifWMHints
+ {
+ uint32_t flags;
+ uint32_t functions;
+ uint32_t decorations;
+ int32_t inputMode;
+ uint32_t state;
+ };
+
+ MotifWMHints hints;
+ hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS;
+ hints.decorations = 0;
+ hints.functions = 0;
+ hints.inputMode = 0;
+ hints.state = 0;
+
+ if (style & Style::Titlebar)
+ {
+ hints.decorations |= MWM_DECOR_BORDER | MWM_DECOR_TITLE | MWM_DECOR_MINIMIZE | MWM_DECOR_MENU;
+ hints.functions |= MWM_FUNC_MOVE | MWM_FUNC_MINIMIZE;
+ }
+ if (style & Style::Resize)
+ {
+ hints.decorations |= MWM_DECOR_MAXIMIZE | MWM_DECOR_RESIZEH;
+ hints.functions |= MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE;
+ }
+ if (style & Style::Close)
+ {
+ hints.decorations |= 0;
+ hints.functions |= MWM_FUNC_CLOSE;
+ }
+
+ if (!changeWindowProperty(hintsAtomReply->atom, hintsAtomReply->atom, 32, 5, &hints))
+ err() << "xcb_change_property failed, could not set window hints" << std::endl;
+ }
+ else
+ {
+ err() << "Failed to request _MOTIF_WM_HINTS atom." << std::endl;
+ }
+}
+
+////////////////////////////////////////////////////////////
+void WindowImplX11::setWMHints(const WMHints& hints)
+{
+ if (!changeWindowProperty(XCB_ATOM_WM_HINTS, XCB_ATOM_WM_HINTS, 32, sizeof(hints) / 4, &hints))
+ sf::err() << "Failed to set WM_HINTS property" << std::endl;
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplX11::setWMSizeHints(const WMSizeHints& hints)
+{
+ if (!changeWindowProperty(XCB_ATOM_WM_NORMAL_HINTS, XCB_ATOM_WM_SIZE_HINTS, 32, sizeof(hints) / 4, &hints))
+ sf::err() << "Failed to set XCB_ATOM_WM_NORMAL_HINTS property" << std::endl;
+}
+
+
+////////////////////////////////////////////////////////////
+bool WindowImplX11::changeWindowProperty(xcb_atom_t property, xcb_atom_t type, uint8_t format, uint32_t length, const void* data)
+{
+ ScopedXcbPtr<xcb_generic_error_t> error(xcb_request_check(
+ m_connection,
+ xcb_change_property_checked(
+ m_connection,
+ XCB_PROP_MODE_REPLACE,
+ m_window,
+ property,
+ type,
+ format,
+ length,
+ data
+ )
+ ));
+
+ return !error;
+}
+
+
+////////////////////////////////////////////////////////////
+void WindowImplX11::initialize()
+{
// Create the input context
m_inputMethod = XOpenIM(m_display, NULL, NULL, NULL);
+
if (m_inputMethod)
{
- m_inputContext = XCreateIC(m_inputMethod,
- XNClientWindow, m_window,
- XNFocusWindow, m_window,
- XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
- (void*)NULL);
+ m_inputContext = XCreateIC(
+ m_inputMethod,
+ XNClientWindow,
+ m_window,
+ XNFocusWindow,
+ m_window,
+ XNInputStyle,
+ XIMPreeditNothing | XIMStatusNothing,
+ reinterpret_cast<void*>(NULL)
+ );
}
else
{
m_inputContext = NULL;
}
+
if (!m_inputContext)
err() << "Failed to create input context for window -- TextEntered event won't be able to return unicode" << std::endl;
// Show the window
- XMapWindow(m_display, m_window);
- XFlush(m_display);
+ setVisible(true);
+
+ // Raise the window and grab input focus
+ grabFocus();
// Create the hidden cursor
createHiddenCursor();
// Flush the commands queue
- XFlush(m_display);
-
+ xcb_flush(m_connection);
+
// Add this window to the global list of windows (required for focus request)
+ Lock lock(allWindowsMutex);
allWindows.push_back(this);
}
@@ -643,20 +1776,58 @@ void WindowImplX11::initialize()
////////////////////////////////////////////////////////////
void WindowImplX11::createHiddenCursor()
{
+ xcb_pixmap_t cursorPixmap = xcb_generate_id(m_connection);
+
// Create the cursor's pixmap (1x1 pixels)
- Pixmap cursorPixmap = XCreatePixmap(m_display, m_window, 1, 1, 1);
- GC graphicsContext = XCreateGC(m_display, cursorPixmap, 0, NULL);
- XDrawPoint(m_display, cursorPixmap, graphicsContext, 0, 0);
- XFreeGC(m_display, graphicsContext);
+ ScopedXcbPtr<xcb_generic_error_t> createPixmapError(xcb_request_check(
+ m_connection,
+ xcb_create_pixmap(
+ m_connection,
+ 1,
+ cursorPixmap,
+ m_window,
+ 1,
+ 1
+ )
+ ));
+
+ if (createPixmapError)
+ {
+ err() << "Failed to create pixmap for hidden cursor" << std::endl;
+ return;
+ }
+
+ m_hiddenCursor = xcb_generate_id(m_connection);
// Create the cursor, using the pixmap as both the shape and the mask of the cursor
- XColor color;
- color.flags = DoRed | DoGreen | DoBlue;
- color.red = color.blue = color.green = 0;
- m_hiddenCursor = XCreatePixmapCursor(m_display, cursorPixmap, cursorPixmap, &color, &color, 0, 0);
+ ScopedXcbPtr<xcb_generic_error_t> createCursorError(xcb_request_check(
+ m_connection,
+ xcb_create_cursor(
+ m_connection,
+ m_hiddenCursor,
+ cursorPixmap,
+ cursorPixmap,
+ 0, 0, 0, // Foreground RGB color
+ 0, 0, 0, // Background RGB color
+ 0, // X
+ 0 // Y
+ )
+ ));
+
+ if (createCursorError)
+ err() << "Failed to create hidden cursor" << std::endl;
// We don't need the pixmap any longer, free it
- XFreePixmap(m_display, cursorPixmap);
+ ScopedXcbPtr<xcb_generic_error_t> freePixmapError(xcb_request_check(
+ m_connection,
+ xcb_free_pixmap(
+ m_connection,
+ cursorPixmap
+ )
+ ));
+
+ if (freePixmapError)
+ err() << "Failed to free pixmap for hidden cursor" << std::endl;
}
@@ -664,26 +1835,7 @@ void WindowImplX11::createHiddenCursor()
void WindowImplX11::cleanup()
{
// Restore the previous video mode (in case we were running in fullscreen)
- if (fullscreenWindow == this)
- {
- // Get current screen info
- XRRScreenConfiguration* config = XRRGetScreenInfo(m_display, RootWindow(m_display, m_screen));
- if (config)
- {
- // Get the current rotation
- Rotation currentRotation;
- XRRConfigCurrentConfiguration(config, &currentRotation);
-
- // Reset the video mode
- XRRSetScreenConfig(m_display, config, RootWindow(m_display, m_screen), m_oldVideoMode, currentRotation, CurrentTime);
-
- // Free the configuration instance
- XRRFreeScreenConfigInfo(config);
- }
-
- // Reset the fullscreen window
- fullscreenWindow = NULL;
- }
+ resetVideoMode();
// Unhide the mouse cursor (in case it was hidden)
setMouseCursorVisible(true);
@@ -691,57 +1843,28 @@ void WindowImplX11::cleanup()
////////////////////////////////////////////////////////////
-bool WindowImplX11::processEvent(XEvent windowEvent)
+bool WindowImplX11::processEvent(xcb_generic_event_t* windowEvent)
{
- // This function implements a workaround to properly discard
- // repeated key events when necessary. The problem is that the
- // system's key events policy doesn't match SFML's one: X server will generate
- // both repeated KeyPress and KeyRelease events when maintaining a key down, while
- // SFML only wants repeated KeyPress events. Thus, we have to:
- // - Discard duplicated KeyRelease events when KeyRepeatEnabled is true
- // - Discard both duplicated KeyPress and KeyRelease events when KeyRepeatEnabled is false
-
- // Detect repeated key events
- // (code shamelessly taken from SDL)
- if (windowEvent.type == KeyRelease)
- {
- // Check if there's a matching KeyPress event in the queue
- XEvent nextEvent;
- if (XPending(m_display))
- {
- // Grab it but don't remove it from the queue, it still needs to be processed :)
- XPeekEvent(m_display, &nextEvent);
- if (nextEvent.type == KeyPress)
- {
- // Check if it is a duplicated event (same timestamp as the KeyRelease event)
- if ((nextEvent.xkey.keycode == windowEvent.xkey.keycode) &&
- (nextEvent.xkey.time - windowEvent.xkey.time < 2))
- {
- // If we don't want repeated events, remove the next KeyPress from the queue
- if (!m_keyRepeat)
- XNextEvent(m_display, &nextEvent);
-
- // This KeyRelease is a repeated event and we don't want it
- return false;
- }
- }
- }
- }
-
// Convert the X11 event to a sf::Event
- switch (windowEvent.type)
+ switch (windowEvent->response_type & ~0x80)
{
// Destroy event
- case DestroyNotify:
+ case XCB_DESTROY_NOTIFY:
{
+ if (passEvent(windowEvent, reinterpret_cast<xcb_destroy_notify_event_t*>(windowEvent)->window))
+ return false;
+
// The window is about to be destroyed: we must cleanup resources
cleanup();
break;
}
// Gain focus event
- case FocusIn:
+ case XCB_FOCUS_IN:
{
+ if (passEvent(windowEvent, reinterpret_cast<xcb_focus_in_event_t*>(windowEvent)->event))
+ return false;
+
// Update the input context
if (m_inputContext)
XSetICFocus(m_inputContext);
@@ -751,20 +1874,42 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
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)
+ ScopedXcbPtr<xcb_generic_error_t> error(NULL);
+
+ ScopedXcbPtr<xcb_get_property_reply_t> hintsReply(xcb_get_property_reply(
+ m_connection,
+ xcb_get_property(m_connection, 0, m_window, XCB_ATOM_WM_HINTS, XCB_ATOM_WM_HINTS, 0, 9),
+ &error
+ ));
+
+ if (error || !hintsReply)
+ {
+ err() << "Failed to get WM hints in XCB_FOCUS_IN" << std::endl;
+ break;
+ }
+
+ WMHints* hints = reinterpret_cast<WMHints*>(xcb_get_property_value(hintsReply.get()));
+
+ if (!hints)
{
- // Remove urgency (notification) flag from hints
- hints->flags &= ~XUrgencyHint;
- XSetWMHints(m_display, m_window, hints);
- XFree(hints);
+ err() << "Failed to get WM hints in XCB_FOCUS_IN" << std::endl;
+ break;
}
+
+ // Remove urgency (notification) flag from hints
+ hints->flags &= ~(1 << 8);
+
+ setWMHints(*hints);
+
break;
}
// Lost focus event
- case FocusOut:
+ case XCB_FOCUS_OUT:
{
+ if (passEvent(windowEvent, reinterpret_cast<xcb_focus_out_event_t*>(windowEvent)->event))
+ return false;
+
// Update the input context
if (m_inputContext)
XUnsetICFocus(m_inputContext);
@@ -776,64 +1921,110 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
}
// Resize event
- case ConfigureNotify:
+ case XCB_CONFIGURE_NOTIFY:
{
- // 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;
- event.type = Event::Resized;
- event.size.width = windowEvent.xconfigure.width;
- event.size.height = windowEvent.xconfigure.height;
- pushEvent(event);
+ if (passEvent(windowEvent, reinterpret_cast<xcb_configure_notify_event_t*>(windowEvent)->window))
+ return false;
- m_previousSize.x = windowEvent.xconfigure.width;
- m_previousSize.y = windowEvent.xconfigure.height;
- }
+ xcb_configure_notify_event_t* e = reinterpret_cast<xcb_configure_notify_event_t*>(windowEvent);
+ Event event;
+ event.type = Event::Resized;
+ event.size.width = e->width;
+ event.size.height = e->height;
+ pushEvent(event);
break;
}
// Close event
- case ClientMessage:
+ case XCB_CLIENT_MESSAGE:
{
- if ((windowEvent.xclient.format == 32) && (windowEvent.xclient.data.l[0]) == static_cast<long>(m_atomClose))
+ if (passEvent(windowEvent, reinterpret_cast<xcb_client_message_event_t*>(windowEvent)->window))
+ return false;
+
+ xcb_client_message_event_t* e = reinterpret_cast<xcb_client_message_event_t*>(windowEvent);
+
+ static xcb_atom_t wmProtocols = getAtom("WM_PROTOCOLS");
+
+ // Handle window manager protocol messages we support
+ if (e->type == wmProtocols)
{
- Event event;
- event.type = Event::Closed;
- pushEvent(event);
+ static xcb_atom_t wmDeleteWindow = getAtom("WM_DELETE_WINDOW");
+ static xcb_atom_t netWmPing = ewmhSupported() ? getAtom("_NET_WM_PING", true) : XCB_ATOM_NONE;
+
+ if ((e->format == 32) && (e->data.data32[0]) == static_cast<long>(wmDeleteWindow))
+ {
+ // Handle the WM_DELETE_WINDOW message
+ Event event;
+ event.type = Event::Closed;
+ pushEvent(event);
+ }
+ else if (netWmPing && (e->format == 32) && (e->data.data32[0]) == static_cast<long>(netWmPing))
+ {
+ // Handle the _NET_WM_PING message, send pong back to WM to show that we are responsive
+ e->window = XCBDefaultRootWindow(m_connection);
+
+ ScopedXcbPtr<xcb_generic_error_t> pongError(xcb_request_check(
+ m_connection,
+ xcb_send_event_checked(
+ m_connection,
+ 0,
+ XCBDefaultRootWindow(m_connection),
+ XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT,
+ reinterpret_cast<char*>(e)
+ )
+ ));
+
+ if (pongError)
+ err() << "Could not send pong event back to WM" << std::endl;
+ }
}
break;
}
// Key down event
- case KeyPress:
+ case XCB_KEY_PRESS:
{
- // Get the keysym of the key that has been pressed
- static XComposeStatus keyboard;
- char buffer[32];
- KeySym symbol;
- XLookupString(&windowEvent.xkey, buffer, sizeof(buffer), &symbol, &keyboard);
+ if (passEvent(windowEvent, reinterpret_cast<xcb_key_press_event_t*>(windowEvent)->event))
+ return false;
+
+ xcb_key_press_event_t* e = reinterpret_cast<xcb_key_press_event_t*>(windowEvent);
// Fill the event parameters
// TODO: if modifiers are wrong, use XGetModifierMapping to retrieve the actual modifiers mapping
Event event;
event.type = Event::KeyPressed;
- event.key.code = keysymToSF(symbol);
- event.key.alt = windowEvent.xkey.state & Mod1Mask;
- event.key.control = windowEvent.xkey.state & ControlMask;
- event.key.shift = windowEvent.xkey.state & ShiftMask;
- event.key.system = windowEvent.xkey.state & Mod4Mask;
+ event.key.code = keycodeToSF(e->detail);
+ event.key.alt = e->state & XCB_MOD_MASK_1;
+ event.key.control = e->state & XCB_MOD_MASK_CONTROL;
+ event.key.shift = e->state & XCB_MOD_MASK_SHIFT;
+ event.key.system = e->state & XCB_MOD_MASK_4;
pushEvent(event);
+ XEvent fakeEvent;
+ fakeEvent.type = KeyPress;
+ fakeEvent.xany.display = m_display;
+ fakeEvent.xany.window = e->event;
+ fakeEvent.xkey.state = e->state;
+ fakeEvent.xkey.keycode = e->detail;
+
// Generate a TextEntered event
- if (!XFilterEvent(&windowEvent, None))
+ if (!XFilterEvent(&fakeEvent, None))
{
#ifdef X_HAVE_UTF8_STRING
if (m_inputContext)
{
Status status;
Uint8 keyBuffer[16];
- int length = Xutf8LookupString(m_inputContext, &windowEvent.xkey, reinterpret_cast<char*>(keyBuffer), sizeof(keyBuffer), NULL, &status);
+
+ int length = Xutf8LookupString(
+ m_inputContext,
+ &fakeEvent.xkey,
+ reinterpret_cast<char*>(keyBuffer),
+ sizeof(keyBuffer),
+ NULL,
+ &status
+ );
+
if (length > 0)
{
Uint32 unicode = 0;
@@ -852,7 +2043,7 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
{
static XComposeStatus status;
char keyBuffer[16];
- if (XLookupString(&windowEvent.xkey, keyBuffer, sizeof(keyBuffer), NULL, &status))
+ if (XLookupString(&fakeEvent.xkey, keyBuffer, sizeof(keyBuffer), NULL, &status))
{
Event textEvent;
textEvent.type = Event::TextEntered;
@@ -866,43 +2057,54 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
}
// Key up event
- case KeyRelease:
+ case XCB_KEY_RELEASE:
{
- // Get the keysym of the key that has been pressed
- char buffer[32];
- KeySym symbol;
- XLookupString(&windowEvent.xkey, buffer, 32, &symbol, NULL);
+ if (passEvent(windowEvent, reinterpret_cast<xcb_key_release_event_t*>(windowEvent)->event))
+ return false;
+
+ xcb_key_release_event_t* e = reinterpret_cast<xcb_key_release_event_t*>(windowEvent);
// Fill the event parameters
Event event;
event.type = Event::KeyReleased;
- event.key.code = keysymToSF(symbol);
- event.key.alt = windowEvent.xkey.state & Mod1Mask;
- event.key.control = windowEvent.xkey.state & ControlMask;
- event.key.shift = windowEvent.xkey.state & ShiftMask;
- event.key.system = windowEvent.xkey.state & Mod4Mask;
+ event.key.code = keycodeToSF(e->detail);
+ event.key.alt = e->state & XCB_MOD_MASK_1;
+ event.key.control = e->state & XCB_MOD_MASK_CONTROL;
+ event.key.shift = e->state & XCB_MOD_MASK_SHIFT;
+ event.key.system = e->state & XCB_MOD_MASK_4;
pushEvent(event);
break;
}
// Mouse button pressed
- case ButtonPress:
+ case XCB_BUTTON_PRESS:
{
- unsigned int button = windowEvent.xbutton.button;
- if ((button == Button1) || (button == Button2) || (button == Button3) || (button == 8) || (button == 9))
+ if (passEvent(windowEvent, reinterpret_cast<xcb_button_press_event_t*>(windowEvent)->event))
+ return false;
+
+ xcb_button_press_event_t* e = reinterpret_cast<xcb_button_press_event_t*>(windowEvent);
+
+ // XXX: Why button 8 and 9?
+ // Because 4 and 5 are the vertical wheel and 6 and 7 are horizontal wheel ;)
+ xcb_button_t button = e->detail;
+ if ((button == XCB_BUTTON_INDEX_1) ||
+ (button == XCB_BUTTON_INDEX_2) ||
+ (button == XCB_BUTTON_INDEX_3) ||
+ (button == 8) ||
+ (button == 9))
{
Event event;
event.type = Event::MouseButtonPressed;
- event.mouseButton.x = windowEvent.xbutton.x;
- event.mouseButton.y = windowEvent.xbutton.y;
- switch (button)
+ event.mouseButton.x = e->event_x;
+ event.mouseButton.y = e->event_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 XCB_BUTTON_INDEX_1: event.mouseButton.button = Mouse::Left; break;
+ case XCB_BUTTON_INDEX_2: event.mouseButton.button = Mouse::Middle; break;
+ case XCB_BUTTON_INDEX_3: event.mouseButton.button = Mouse::Right; break;
+ case 8: event.mouseButton.button = Mouse::XButton1; break;
+ case 9: event.mouseButton.button = Mouse::XButton2; break;
}
pushEvent(event);
}
@@ -910,52 +2112,88 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
}
// Mouse button released
- case ButtonRelease:
+ case XCB_BUTTON_RELEASE:
{
- unsigned int button = windowEvent.xbutton.button;
- if ((button == Button1) || (button == Button2) || (button == Button3) || (button == 8) || (button == 9))
+ if (passEvent(windowEvent, reinterpret_cast<xcb_button_release_event_t*>(windowEvent)->event))
+ return false;
+
+ xcb_button_release_event_t* e = reinterpret_cast<xcb_button_press_event_t*>(windowEvent);
+
+ xcb_button_t button = e->detail;
+ if ((button == XCB_BUTTON_INDEX_1) ||
+ (button == XCB_BUTTON_INDEX_2) ||
+ (button == XCB_BUTTON_INDEX_3) ||
+ (button == 8) ||
+ (button == 9))
{
Event event;
event.type = Event::MouseButtonReleased;
- event.mouseButton.x = windowEvent.xbutton.x;
- event.mouseButton.y = windowEvent.xbutton.y;
- switch (button)
+ event.mouseButton.x = e->event_x;
+ event.mouseButton.y = e->event_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 XCB_BUTTON_INDEX_1: event.mouseButton.button = Mouse::Left; break;
+ case XCB_BUTTON_INDEX_2: event.mouseButton.button = Mouse::Middle; break;
+ case XCB_BUTTON_INDEX_3: event.mouseButton.button = Mouse::Right; break;
+ case 8: event.mouseButton.button = Mouse::XButton1; break;
+ case 9: event.mouseButton.button = Mouse::XButton2; break;
}
pushEvent(event);
}
- else if ((button == Button4) || (button == Button5))
+ else if ((button == XCB_BUTTON_INDEX_4) || (button == XCB_BUTTON_INDEX_5))
{
Event event;
+
event.type = Event::MouseWheelMoved;
- event.mouseWheel.delta = windowEvent.xbutton.button == Button4 ? 1 : -1;
- event.mouseWheel.x = windowEvent.xbutton.x;
- event.mouseWheel.y = windowEvent.xbutton.y;
+ event.mouseWheel.delta = (button == XCB_BUTTON_INDEX_4) ? 1 : -1;
+ event.mouseWheel.x = e->event_x;
+ event.mouseWheel.y = e->event_y;
+ pushEvent(event);
+
+ event.type = Event::MouseWheelScrolled;
+ event.mouseWheelScroll.wheel = Mouse::VerticalWheel;
+ event.mouseWheelScroll.delta = (button == XCB_BUTTON_INDEX_4) ? 1 : -1;
+ event.mouseWheelScroll.x = e->event_x;
+ event.mouseWheelScroll.y = e->event_y;
+ pushEvent(event);
+ }
+ else if ((button == 6) || (button == 7))
+ {
+ Event event;
+ event.type = Event::MouseWheelScrolled;
+ event.mouseWheelScroll.wheel = Mouse::HorizontalWheel;
+ event.mouseWheelScroll.delta = (button == 6) ? 1 : -1;
+ event.mouseWheelScroll.x = e->event_x;
+ event.mouseWheelScroll.y = e->event_y;
pushEvent(event);
}
break;
}
// Mouse moved
- case MotionNotify:
+ case XCB_MOTION_NOTIFY:
{
+ if (passEvent(windowEvent, reinterpret_cast<xcb_motion_notify_event_t*>(windowEvent)->event))
+ return false;
+
+ xcb_motion_notify_event_t* e = reinterpret_cast<xcb_motion_notify_event_t*>(windowEvent);
Event event;
event.type = Event::MouseMoved;
- event.mouseMove.x = windowEvent.xmotion.x;
- event.mouseMove.y = windowEvent.xmotion.y;
+ event.mouseMove.x = e->event_x;
+ event.mouseMove.y = e->event_y;
pushEvent(event);
break;
}
// Mouse entered
- case EnterNotify:
+ case XCB_ENTER_NOTIFY:
{
- if (windowEvent.xcrossing.mode == NotifyNormal)
+ if (passEvent(windowEvent, reinterpret_cast<xcb_enter_notify_event_t*>(windowEvent)->event))
+ return false;
+
+ xcb_enter_notify_event_t* enterNotifyEvent = reinterpret_cast<xcb_enter_notify_event_t*>(windowEvent);
+
+ if (enterNotifyEvent->mode == NotifyNormal)
{
Event event;
event.type = Event::MouseEntered;
@@ -965,9 +2203,14 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
}
// Mouse left
- case LeaveNotify:
+ case XCB_LEAVE_NOTIFY:
{
- if (windowEvent.xcrossing.mode == NotifyNormal)
+ if (passEvent(windowEvent, reinterpret_cast<xcb_leave_notify_event_t*>(windowEvent)->event))
+ return false;
+
+ xcb_leave_notify_event_t* leaveNotifyEvent = reinterpret_cast<xcb_leave_notify_event_t*>(windowEvent);
+
+ if (leaveNotifyEvent->mode == NotifyNormal)
{
Event event;
event.type = Event::MouseLeft;
@@ -977,9 +2220,91 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
}
// Parent window changed
- case ReparentNotify:
+ case XCB_REPARENT_NOTIFY:
+ {
+ if (passEvent(windowEvent, reinterpret_cast<xcb_reparent_notify_event_t*>(windowEvent)->window))
+ return false;
+
+ // Catch reparent events to properly apply fullscreen on
+ // some "strange" window managers (like Awesome) which
+ // seem to make use of temporary parents during mapping
+ if (m_fullscreen)
+ switchToFullscreen();
+
+ xcb_flush(m_connection); // Discard remaining events
+ break;
+ }
+
+ // The stuff that might pop up but we don't care about
+ // Whitelist more when necessary
+ // Window visibility changed (hide/unhide)
+ case XCB_MAP_NOTIFY:
+ case XCB_UNMAP_NOTIFY:
{
- XSync(m_display, True); // Discard remaining events
+ break;
+ }
+
+ // Handle the rest
+ default:
+ {
+ uint8_t responseType = windowEvent->response_type & ~0x80;
+
+ // Handle any extension events first
+
+ // DRI2
+ static xcb_query_extension_reply_t driExtension = getDriExtension();
+ if (driExtension.present)
+ {
+ // Because we are using the XCB event queue instead of the Xlib event
+ // queue, Mesa breaks a bit (VSync among other things) because DRI2 still
+ // expects certain Xlib events to come its way. We work around this by
+ // emulating the old Xlib event queue for these specific wire events.
+ // Sources (retrieved 27 Mar 2015):
+ // http://wrl.illest.net/post/45342765813/code-tip-glx-and-xcbownseventqueue
+ // https://bugs.freedesktop.org/show_bug.cgi?id=42131
+ // https://bugs.freedesktop.org/show_bug.cgi?id=35945
+ // Mesa src/glx/dri2.c
+ // QtBase src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp
+ // QtBase Commit bb22b4965070409df4658f16fdf549f0362e8a9c
+ // Qt Change-Id I3b4ef3f6e3efbae25f49f161e229e9b15e951778
+ // QtBase Commit 13c5c81cfa934c9b610720fe79e07465b00ebc8d
+ // Qt Change-Id Ia93eb8be1cbbc3d8ae7913a934c195af6b5ec538
+ // QtBase Commit decb88693c8a7f0c073889b91151f01a850e3adf
+ // Qt Change-Id Ic466ff26487937b03f072a57e0ee4df335492a5f
+ if ((responseType == driExtension.first_event + XCB_DRI2_BUFFER_SWAP_COMPLETE) ||
+ (responseType == driExtension.first_event + XCB_DRI2_INVALIDATE_BUFFERS))
+ {
+ // DRI2 BufferSwapComplete and InvalidateBuffers
+
+ // We lock/unlock the display to protect against concurrent access
+ XLockDisplay(m_display);
+
+ typedef Bool (*wireEventHandler)(Display*, XEvent*, xEvent*);
+
+ // Probe for any handlers that are registered for this event type
+ wireEventHandler handler = XESetWireToEvent(m_display, responseType, 0);
+
+ if (handler)
+ {
+ // Restore the previous handler if one was registered
+ XESetWireToEvent(m_display, responseType, handler);
+
+ XEvent event;
+ windowEvent->sequence = LastKnownRequestProcessed(m_display);
+
+ // Pretend to be the Xlib event queue
+ handler(m_display, &event, reinterpret_cast<xEvent*>(windowEvent));
+ }
+
+ XUnlockDisplay(m_display);
+
+ return true;
+ }
+ }
+
+ // Print any surprises to stderr (would be nice if people report when this happens)
+ dumpUnhandledEvent(responseType);
+
break;
}
}
@@ -989,119 +2314,29 @@ bool WindowImplX11::processEvent(XEvent windowEvent)
////////////////////////////////////////////////////////////
-Keyboard::Key WindowImplX11::keysymToSF(KeySym symbol)
+bool WindowImplX11::passEvent(xcb_generic_event_t* windowEvent, xcb_window_t window)
{
- // First convert to uppercase (to avoid dealing with two different keysyms for the same key)
- KeySym lower, key;
- XConvertCase(symbol, &lower, &key);
+ // Check if this is our event
+ if (window == m_window)
+ return false;
+
+ Lock lock(allWindowsMutex);
- switch (key)
+ // If we are the only window, there is nobody else to pass to
+ if (allWindows.size() == 1)
+ return false;
+
+ for (std::vector<WindowImplX11*>::iterator i = allWindows.begin(); i != allWindows.end(); ++i)
{
- 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;
+ if ((*i)->m_window == window)
+ {
+ (*i)->m_xcbEvents.push_back(windowEvent);
+ return true;
+ }
}
- return Keyboard::Unknown;
+ // It seems nobody wants the event, we'll just handle it ourselves
+ return false;
}
} // namespace priv
diff --git a/src/SFML/Window/Unix/WindowImplX11.hpp b/src/SFML/Window/Unix/WindowImplX11.hpp
index d824492..2e31fbf 100644
--- a/src/SFML/Window/Unix/WindowImplX11.hpp
+++ b/src/SFML/Window/Unix/WindowImplX11.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -31,8 +31,9 @@
#include <SFML/Window/Event.hpp>
#include <SFML/Window/WindowImpl.hpp>
#include <SFML/System/String.hpp>
-#include <X11/Xlib.h>
-#include <set>
+#include <X11/Xlib-xcb.h>
+#include <xcb/randr.h>
+#include <deque>
namespace sf
@@ -179,13 +180,100 @@ protected:
private:
+ struct WMHints
+ {
+ int32_t flags;
+ uint32_t input;
+ int32_t initial_state;
+ xcb_pixmap_t icon_pixmap;
+ xcb_window_t icon_window;
+ int32_t icon_x;
+ int32_t icon_y;
+ xcb_pixmap_t icon_mask;
+ xcb_window_t window_group;
+ };
+
+ struct WMSizeHints
+ {
+ uint32_t flags;
+ int32_t x, y;
+ int32_t width, height;
+ int32_t min_width, min_height;
+ int32_t max_width, max_height;
+ int32_t width_inc, height_inc;
+ int32_t min_aspect_num, min_aspect_den;
+ int32_t max_aspect_num, max_aspect_den;
+ int32_t base_width, base_height;
+ uint32_t win_gravity;
+ };
+
////////////////////////////////////////////////////////////
- /// \brief Switch to fullscreen mode
+ /// \brief Request the WM to make the current window active
+ ///
+ ////////////////////////////////////////////////////////////
+ void grabFocus();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Set fullscreen video mode
///
/// \param Mode video mode to switch to
///
////////////////////////////////////////////////////////////
- void switchToFullscreen(const VideoMode& mode);
+ void setVideoMode(const VideoMode& mode);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Reset to desktop video mode
+ ///
+ ////////////////////////////////////////////////////////////
+ void resetVideoMode();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Switch to fullscreen mode
+ ///
+ ////////////////////////////////////////////////////////////
+ void switchToFullscreen();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Set the WM protocols we support
+ ///
+ ////////////////////////////////////////////////////////////
+ void setProtocols();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Set Motif WM hints
+ ///
+ ////////////////////////////////////////////////////////////
+ void setMotifHints(unsigned long style);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Set WM hints
+ ///
+ /// \param hints Hints
+ ///
+ ////////////////////////////////////////////////////////////
+ void setWMHints(const WMHints& hints);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Set WM size hints
+ ///
+ /// \param hints Size hints
+ ///
+ ////////////////////////////////////////////////////////////
+ void setWMSizeHints(const WMSizeHints& hints);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Change a XCB window property
+ ///
+ /// \param property Property to change
+ /// \param type Type of the property
+ /// \param format Format of the property
+ /// \param length Length of the new value
+ /// \param data The new value of the property
+ ///
+ /// \return True if successful, false if unsuccessful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool changeWindowProperty(xcb_atom_t property, xcb_atom_t type, uint8_t format, uint32_t length, const void* data);
////////////////////////////////////////////////////////////
/// \brief Do some common initializations after the window has been created
@@ -213,33 +301,36 @@ private:
/// \return True if the event was processed, false if it was discarded
///
////////////////////////////////////////////////////////////
- bool processEvent(XEvent windowEvent);
+ bool processEvent(xcb_generic_event_t* windowEvent);
////////////////////////////////////////////////////////////
- /// \brief Convert a X11 keysym to SFML key code
+ /// \brief Pass an incoming event to another window
///
- /// \param symbol Key symbol to convert
+ /// \param windowEvent Event which is being processed
+ /// \param window Window to pass to
///
- /// \return Corresponding SFML key code
+ /// \return True if the event was passed to another window, false if it is destined for the current window
///
////////////////////////////////////////////////////////////
- static Keyboard::Key keysymToSF(KeySym symbol);
+ bool passEvent(xcb_generic_event_t* windowEvent, xcb_window_t window);
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
- ::Window m_window; ///< X11 structure defining our window
- ::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
- 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 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?
+ xcb_window_t m_window; ///< xcb identifier defining our window
+ ::Display* m_display; ///< Pointer to the display
+ xcb_connection_t* m_connection; ///< Pointer to the xcb connection
+ xcb_screen_t* 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
+ std::deque<xcb_generic_event_t*> m_xcbEvents; ///< Events that were received in another window's loop
+ bool m_isExternal; ///< Tell whether the window has been created externally or by SFML
+ xcb_randr_get_screen_info_reply_t 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?
+ 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?
+ bool m_fullscreen; ///< Is window in fullscreen?
};
} // namespace priv
diff --git a/src/SFML/Window/VideoMode.cpp b/src/SFML/Window/VideoMode.cpp
index 2f8d802..8f3861d 100644
--- a/src/SFML/Window/VideoMode.cpp
+++ b/src/SFML/Window/VideoMode.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/VideoModeImpl.hpp b/src/SFML/Window/VideoModeImpl.hpp
index cbc36a1..cc992f9 100644
--- a/src/SFML/Window/VideoModeImpl.hpp
+++ b/src/SFML/Window/VideoModeImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Win32/InputImpl.cpp b/src/SFML/Window/Win32/InputImpl.cpp
index bace512..6b1a472 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Win32/InputImpl.hpp b/src/SFML/Window/Win32/InputImpl.hpp
index f62f2d2..9f455f4 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-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Win32/JoystickImpl.cpp b/src/SFML/Window/Win32/JoystickImpl.cpp
index 380e25f..ab40d5f 100644
--- a/src/SFML/Window/Win32/JoystickImpl.cpp
+++ b/src/SFML/Window/Win32/JoystickImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Win32/JoystickImpl.hpp b/src/SFML/Window/Win32/JoystickImpl.hpp
index a5d258d..ab0a724 100644
--- a/src/SFML/Window/Win32/JoystickImpl.hpp
+++ b/src/SFML/Window/Win32/JoystickImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Win32/SensorImpl.cpp b/src/SFML/Window/Win32/SensorImpl.cpp
index be5e439..144c6d7 100644
--- a/src/SFML/Window/Win32/SensorImpl.cpp
+++ b/src/SFML/Window/Win32/SensorImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Win32/SensorImpl.hpp b/src/SFML/Window/Win32/SensorImpl.hpp
index e174fa2..666e5d2 100644
--- a/src/SFML/Window/Win32/SensorImpl.hpp
+++ b/src/SFML/Window/Win32/SensorImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Win32/VideoModeImpl.cpp b/src/SFML/Window/Win32/VideoModeImpl.cpp
index b19588a..4b34a0f 100644
--- a/src/SFML/Window/Win32/VideoModeImpl.cpp
+++ b/src/SFML/Window/Win32/VideoModeImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Win32/WglContext.cpp b/src/SFML/Window/Win32/WglContext.cpp
index c6e7c33..c4e8b93 100644
--- a/src/SFML/Window/Win32/WglContext.cpp
+++ b/src/SFML/Window/Win32/WglContext.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -27,10 +27,11 @@
////////////////////////////////////////////////////////////
#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/Window/Win32/WglExtensions.hpp>
#include <SFML/System/Lock.hpp>
#include <SFML/System/Mutex.hpp>
#include <SFML/System/Err.hpp>
+#include <sstream>
namespace sf
@@ -38,6 +39,34 @@ namespace sf
namespace priv
{
////////////////////////////////////////////////////////////
+void ensureExtensionsInit(HDC deviceContext)
+{
+ static bool initialized = false;
+ if (!initialized)
+ {
+ initialized = true;
+
+ // We don't check the return value since the extension
+ // flags are cleared even if loading fails
+ sfwgl_LoadFunctions(deviceContext);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+String getErrorString(DWORD errorCode)
+{
+ std::basic_ostringstream<TCHAR, std::char_traits<TCHAR> > ss;
+ TCHAR errBuff[256];
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, errorCode, 0, errBuff, sizeof(errBuff), NULL);
+ ss << errBuff;
+ String errMsg(ss.str());
+
+ return errMsg;
+}
+
+
+////////////////////////////////////////////////////////////
WglContext::WglContext(WglContext* shared) :
m_window (NULL),
m_deviceContext(NULL),
@@ -121,6 +150,32 @@ WglContext::~WglContext()
////////////////////////////////////////////////////////////
+GlFunctionPointer WglContext::getFunction(const char* name)
+{
+ GlFunctionPointer address = reinterpret_cast<GlFunctionPointer>(wglGetProcAddress(reinterpret_cast<LPCSTR>(name)));
+
+ if (address)
+ {
+ // Test whether the returned value is a valid error code
+ ptrdiff_t errorCode = reinterpret_cast<ptrdiff_t>(address);
+
+ if ((errorCode != -1) && (errorCode != 1) && (errorCode != 2) && (errorCode != 3))
+ return address;
+ }
+
+ static HMODULE module = NULL;
+
+ if (!module)
+ module = GetModuleHandleA("OpenGL32.dll");
+
+ if (module)
+ return reinterpret_cast<GlFunctionPointer>(GetProcAddress(module, reinterpret_cast<LPCSTR>(name)));
+
+ return 0;
+}
+
+
+////////////////////////////////////////////////////////////
bool WglContext::makeCurrent()
{
return m_deviceContext && m_context && wglMakeCurrent(m_deviceContext, m_context);
@@ -138,85 +193,107 @@ void WglContext::display()
////////////////////////////////////////////////////////////
void WglContext::setVerticalSyncEnabled(bool enabled)
{
- PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = reinterpret_cast<PFNWGLSWAPINTERVALEXTPROC>(wglGetProcAddress("wglSwapIntervalEXT"));
- if (wglSwapIntervalEXT)
- wglSwapIntervalEXT(enabled ? 1 : 0);
+ // Make sure that extensions are initialized
+ ensureExtensionsInit(m_deviceContext);
+
+ if (sfwgl_ext_EXT_swap_control == sfwgl_LOAD_SUCCEEDED)
+ {
+ if (wglSwapIntervalEXT(enabled ? 1 : 0) == FALSE)
+ err() << "Setting vertical sync failed" << std::endl;
+ }
+ else
+ {
+ static bool warned = false;
+
+ if (!warned)
+ {
+ // wglSwapIntervalEXT not supported
+ err() << "Setting vertical sync not supported" << std::endl;
+
+ warned = true;
+ }
+ }
}
////////////////////////////////////////////////////////////
-void WglContext::createContext(WglContext* shared, unsigned int bitsPerPixel, const ContextSettings& settings)
+int WglContext::selectBestPixelFormat(HDC deviceContext, unsigned int bitsPerPixel, const ContextSettings& settings)
{
- // Save the creation settings
- m_settings = settings;
-
- // Let's find a suitable pixel format -- first try with antialiasing
+ // Let's find a suitable pixel format -- first try with wglChoosePixelFormatARB
int bestFormat = 0;
- if (m_settings.antialiasingLevel > 0)
+ if (sfwgl_ext_ARB_pixel_format == sfwgl_LOAD_SUCCEEDED)
{
- // 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[] =
{
- // 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)
+ WGL_DRAW_TO_WINDOW_ARB, GL_TRUE,
+ WGL_SUPPORT_OPENGL_ARB, GL_TRUE,
+ WGL_DOUBLE_BUFFER_ARB, GL_TRUE,
+ WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB,
+ 0, 0
+ };
+
+ // Let's check how many formats are supporting our requirements
+ int formats[512];
+ UINT nbFormats;
+ bool isValid = wglChoosePixelFormatARB(deviceContext, intAttributes, NULL, 512, formats, &nbFormats) != 0;
+
+ // Get the best format among the returned ones
+ if (isValid && (nbFormats > 0))
+ {
+ int bestScore = 0x7FFFFFFF;
+ for (UINT i = 0; i < nbFormats; ++i)
{
- // 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;
- }
+ // Extract the components of the current format
+ int values[7];
+ const int attributes[] =
+ {
+ WGL_RED_BITS_ARB,
+ WGL_GREEN_BITS_ARB,
+ WGL_BLUE_BITS_ARB,
+ WGL_ALPHA_BITS_ARB,
+ WGL_DEPTH_BITS_ARB,
+ WGL_STENCIL_BITS_ARB,
+ WGL_ACCELERATION_ARB
+ };
+
+ if (!wglGetPixelFormatAttribivARB(deviceContext, formats[i], PFD_MAIN_PLANE, 7, attributes, values))
+ {
+ err() << "Failed to retrieve pixel format information: " << getErrorString(GetLastError()).toAnsiString() << std::endl;
+ break;
+ }
- // Get the best format among the returned ones
- if (isValid && (nbFormats > 0))
- {
- int bestScore = 0xFFFF;
- for (UINT i = 0; i < nbFormats; ++i)
+ int sampleValues[2] = {0, 0};
+ if (sfwgl_ext_ARB_multisample == sfwgl_LOAD_SUCCEEDED)
{
- // 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)
+ const int sampleAttributes[] =
{
- bestScore = score;
- bestFormat = formats[i];
+ WGL_SAMPLE_BUFFERS_ARB,
+ WGL_SAMPLES_ARB
+ };
+
+ if (!wglGetPixelFormatAttribivARB(deviceContext, formats[i], PFD_MAIN_PLANE, 2, sampleAttributes, sampleValues))
+ {
+ err() << "Failed to retrieve pixel format multisampling information: " << getErrorString(GetLastError()).toAnsiString() << std::endl;
+ break;
}
}
+
+ // Evaluate the current configuration
+ int color = values[0] + values[1] + values[2] + values[3];
+ int score = evaluateFormat(bitsPerPixel, settings, color, values[4], values[5], sampleValues[0] ? sampleValues[1] : 0, values[6] == WGL_FULL_ACCELERATION_ARB);
+
+ // 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
+ // Find a pixel format with ChoosePixelFormat, if wglChoosePixelFormatARB is not supported
if (bestFormat == 0)
{
// Setup a pixel format descriptor from the rendering settings
@@ -228,17 +305,36 @@ void WglContext::createContext(WglContext* shared, unsigned int bitsPerPixel, co
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.cDepthBits = static_cast<BYTE>(settings.depthBits);
+ descriptor.cStencilBits = static_cast<BYTE>(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;
- }
+ bestFormat = ChoosePixelFormat(deviceContext, &descriptor);
+ }
+
+ return bestFormat;
+}
+
+
+////////////////////////////////////////////////////////////
+void WglContext::createContext(WglContext* shared, unsigned int bitsPerPixel, const ContextSettings& settings)
+{
+ // Save the creation settings
+ m_settings = settings;
+
+ // Make sure that extensions are initialized if this is not the shared context
+ // The shared context is the context used to initialize the extensions
+ if (shared)
+ ensureExtensionsInit(m_deviceContext);
+
+ int bestFormat = selectBestPixelFormat(m_deviceContext, bitsPerPixel, settings);
+
+ if (bestFormat == 0)
+ {
+ err() << "Failed to find a suitable pixel format for device context: " << getErrorString(GetLastError()).toAnsiString() << std::endl
+ << "Cannot create OpenGL context" << std::endl;
+ return;
}
// Extract the depth and stencil bits from the chosen format
@@ -246,64 +342,145 @@ void WglContext::createContext(WglContext* shared, unsigned int bitsPerPixel, co
actualFormat.nSize = sizeof(actualFormat);
actualFormat.nVersion = 1;
DescribePixelFormat(m_deviceContext, bestFormat, sizeof(actualFormat), &actualFormat);
- m_settings.depthBits = actualFormat.cDepthBits;
- m_settings.stencilBits = actualFormat.cStencilBits;
+
+ if (sfwgl_ext_ARB_pixel_format == sfwgl_LOAD_SUCCEEDED)
+ {
+ const int attributes[] = {WGL_DEPTH_BITS_ARB, WGL_STENCIL_BITS_ARB};
+ int values[2];
+
+ if (wglGetPixelFormatAttribivARB(m_deviceContext, bestFormat, PFD_MAIN_PLANE, 2, attributes, values))
+ {
+ m_settings.depthBits = values[0];
+ m_settings.stencilBits = values[1];
+ }
+ else
+ {
+ err() << "Failed to retrieve pixel format information: " << getErrorString(GetLastError()).toAnsiString() << std::endl;
+ m_settings.depthBits = actualFormat.cDepthBits;
+ m_settings.stencilBits = actualFormat.cStencilBits;
+ }
+
+ if (sfwgl_ext_ARB_multisample == sfwgl_LOAD_SUCCEEDED)
+ {
+ const int sampleAttributes[] = {WGL_SAMPLE_BUFFERS_ARB, WGL_SAMPLES_ARB};
+ int sampleValues[2];
+
+ if (wglGetPixelFormatAttribivARB(m_deviceContext, bestFormat, PFD_MAIN_PLANE, 2, sampleAttributes, sampleValues))
+ {
+ m_settings.antialiasingLevel = sampleValues[0] ? sampleValues[1] : 0;
+ }
+ else
+ {
+ err() << "Failed to retrieve pixel format multisampling information: " << getErrorString(GetLastError()).toAnsiString() << std::endl;
+ m_settings.antialiasingLevel = 0;
+ }
+ }
+ else
+ {
+ m_settings.antialiasingLevel = 0;
+ }
+ }
+ else
+ {
+ m_settings.depthBits = actualFormat.cDepthBits;
+ m_settings.stencilBits = actualFormat.cStencilBits;
+ m_settings.antialiasingLevel = 0;
+ }
// 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;
+ err() << "Failed to set pixel format for device context: " << getErrorString(GetLastError()).toAnsiString() << std::endl
+ << "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))
+ // Create the OpenGL context -- first try using wglCreateContextAttribsARB
+ while (!m_context && m_settings.majorVersion)
{
- PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = reinterpret_cast<PFNWGLCREATECONTEXTATTRIBSARBPROC>(wglGetProcAddress("wglCreateContextAttribsARB"));
- if (wglCreateContextAttribsARB)
+ if (sfwgl_ext_ARB_create_context == sfwgl_LOAD_SUCCEEDED)
{
- int attributes[] =
+ // Check if setting the profile is supported
+ if (sfwgl_ext_ARB_create_context_profile == sfwgl_LOAD_SUCCEEDED)
{
- 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);
+ int profile = (m_settings.attributeFlags & ContextSettings::Core) ? WGL_CONTEXT_CORE_PROFILE_BIT_ARB : WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
+ int debug = (m_settings.attributeFlags & ContextSettings::Debug) ? WGL_CONTEXT_DEBUG_BIT_ARB : 0;
+
+ 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, profile,
+ WGL_CONTEXT_FLAGS_ARB, debug,
+ 0, 0
+ };
+ m_context = wglCreateContextAttribsARB(m_deviceContext, sharedContext, attributes);
+ }
+ else
+ {
+ if ((m_settings.attributeFlags & ContextSettings::Core) || (m_settings.attributeFlags & ContextSettings::Debug))
+ err() << "Selecting a profile during context creation is not supported,"
+ << "disabling comptibility and debug" << std::endl;
+
+ m_settings.attributeFlags = ContextSettings::Default;
+
+ int attributes[] =
+ {
+ WGL_CONTEXT_MAJOR_VERSION_ARB, static_cast<int>(m_settings.majorVersion),
+ WGL_CONTEXT_MINOR_VERSION_ARB, static_cast<int>(m_settings.minorVersion),
+ 0, 0
+ };
+ m_context = wglCreateContextAttribsARB(m_deviceContext, sharedContext, attributes);
+ }
+ }
+ else
+ {
+ // If wglCreateContextAttribsARB is not supported, there is no need to keep trying
+ break;
}
- // If we couldn't create the context, lower the version number and try again -- stop at 3.0
+ // If we couldn't create the context, first try disabling flags,
+ // then lower the version number and try again -- stop at 0.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 (m_settings.attributeFlags != ContextSettings::Default)
+ {
+ m_settings.attributeFlags = ContextSettings::Default;
+ }
+ else if (m_settings.minorVersion > 0)
{
// If the minor version is not 0, we decrease it and try again
m_settings.minorVersion--;
+
+ m_settings.attributeFlags = settings.attributeFlags;
}
else
{
// If the minor version is 0, we decrease the major version
m_settings.majorVersion--;
m_settings.minorVersion = 9;
+
+ m_settings.attributeFlags = settings.attributeFlags;
}
}
}
- // If the OpenGL >= 3.0 context failed or if we don't want one, create a regular OpenGL 1.x/2.x context
+ // If wglCreateContextAttribsARB failed, use wglCreateContext
if (!m_context)
{
- // set the context version to 2.0 (arbitrary)
- m_settings.majorVersion = 2;
- m_settings.minorVersion = 0;
+ // set the context version to 1.1 (arbitrary) and disable flags
+ m_settings.majorVersion = 1;
+ m_settings.minorVersion = 1;
+ m_settings.attributeFlags = ContextSettings::Default;
m_context = wglCreateContext(m_deviceContext);
if (!m_context)
{
- err() << "Failed to create an OpenGL context for this window" << std::endl;
+ err() << "Failed to create an OpenGL context for this window: " << getErrorString(GetLastError()).toAnsiString() << std::endl;
return;
}
@@ -315,7 +492,7 @@ void WglContext::createContext(WglContext* shared, unsigned int bitsPerPixel, co
Lock lock(mutex);
if (!wglShareLists(sharedContext, m_context))
- err() << "Failed to share the OpenGL context" << std::endl;
+ err() << "Failed to share the OpenGL context: " << getErrorString(GetLastError()).toAnsiString() << std::endl;
}
}
}
diff --git a/src/SFML/Window/Win32/WglContext.hpp b/src/SFML/Window/Win32/WglContext.hpp
index 75ef4d5..45070f6 100644
--- a/src/SFML/Window/Win32/WglContext.hpp
+++ b/src/SFML/Window/Win32/WglContext.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -82,6 +82,16 @@ public:
~WglContext();
////////////////////////////////////////////////////////////
+ /// \brief Get the address of an OpenGL function
+ ///
+ /// \param name Name of the function to get the address of
+ ///
+ /// \return Address of the OpenGL function, 0 on failure
+ ///
+ ////////////////////////////////////////////////////////////
+ static GlFunctionPointer getFunction(const char* name);
+
+ ////////////////////////////////////////////////////////////
/// \brief Activate the context as the current target for rendering
///
/// \return True on success, false if any error happened
@@ -108,6 +118,18 @@ public:
////////////////////////////////////////////////////////////
virtual void setVerticalSyncEnabled(bool enabled);
+ ////////////////////////////////////////////////////////////
+ /// \brief Select the best pixel format for a given set of settings
+ ///
+ /// \param deviceContext Device context
+ /// \param bitsPerPixel Pixel depth, in bits per pixel
+ /// \param settings Requested context settings
+ ///
+ /// \return The best pixel format
+ ///
+ ////////////////////////////////////////////////////////////
+ static int selectBestPixelFormat(HDC deviceContext, unsigned int bitsPerPixel, const ContextSettings& settings);
+
private:
////////////////////////////////////////////////////////////
diff --git a/src/SFML/Window/Win32/WglExtensions.cpp b/src/SFML/Window/Win32/WglExtensions.cpp
new file mode 100644
index 0000000..0d82b74
--- /dev/null
+++ b/src/SFML/Window/Win32/WglExtensions.cpp
@@ -0,0 +1,198 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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/Win32/WglExtensions.hpp>
+#include <SFML/Window/Context.hpp>
+#include <cstdlib>
+#include <cstring>
+#include <cstddef>
+
+static sf::GlFunctionPointer IntGetProcAddress(const char* name)
+{
+ return sf::Context::getFunction(name);
+}
+
+int sfwgl_ext_EXT_swap_control = sfwgl_LOAD_FAILED;
+int sfwgl_ext_ARB_multisample = sfwgl_LOAD_FAILED;
+int sfwgl_ext_ARB_pixel_format = sfwgl_LOAD_FAILED;
+int sfwgl_ext_ARB_create_context = sfwgl_LOAD_FAILED;
+int sfwgl_ext_ARB_create_context_profile = sfwgl_LOAD_FAILED;
+
+int (CODEGEN_FUNCPTR *sf_ptrc_wglGetSwapIntervalEXT)(void) = NULL;
+BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglSwapIntervalEXT)(int) = NULL;
+
+static int Load_EXT_swap_control(void)
+{
+ int numFailed = 0;
+ sf_ptrc_wglGetSwapIntervalEXT = (int (CODEGEN_FUNCPTR *)(void))IntGetProcAddress("wglGetSwapIntervalEXT");
+ if(!sf_ptrc_wglGetSwapIntervalEXT) numFailed++;
+ sf_ptrc_wglSwapIntervalEXT = (BOOL (CODEGEN_FUNCPTR *)(int))IntGetProcAddress("wglSwapIntervalEXT");
+ if(!sf_ptrc_wglSwapIntervalEXT) numFailed++;
+ return numFailed;
+}
+
+BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglChoosePixelFormatARB)(HDC, const int *, const FLOAT *, UINT, int *, UINT *) = NULL;
+BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglGetPixelFormatAttribfvARB)(HDC, int, int, UINT, const int *, FLOAT *) = NULL;
+BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglGetPixelFormatAttribivARB)(HDC, int, int, UINT, const int *, int *) = NULL;
+
+static int Load_ARB_pixel_format(void)
+{
+ int numFailed = 0;
+ sf_ptrc_wglChoosePixelFormatARB = (BOOL (CODEGEN_FUNCPTR *)(HDC, const int *, const FLOAT *, UINT, int *, UINT *))IntGetProcAddress("wglChoosePixelFormatARB");
+ if(!sf_ptrc_wglChoosePixelFormatARB) numFailed++;
+ sf_ptrc_wglGetPixelFormatAttribfvARB = (BOOL (CODEGEN_FUNCPTR *)(HDC, int, int, UINT, const int *, FLOAT *))IntGetProcAddress("wglGetPixelFormatAttribfvARB");
+ if(!sf_ptrc_wglGetPixelFormatAttribfvARB) numFailed++;
+ sf_ptrc_wglGetPixelFormatAttribivARB = (BOOL (CODEGEN_FUNCPTR *)(HDC, int, int, UINT, const int *, int *))IntGetProcAddress("wglGetPixelFormatAttribivARB");
+ if(!sf_ptrc_wglGetPixelFormatAttribivARB) numFailed++;
+ return numFailed;
+}
+
+HGLRC (CODEGEN_FUNCPTR *sf_ptrc_wglCreateContextAttribsARB)(HDC, HGLRC, const int *) = NULL;
+
+static int Load_ARB_create_context(void)
+{
+ int numFailed = 0;
+ sf_ptrc_wglCreateContextAttribsARB = (HGLRC (CODEGEN_FUNCPTR *)(HDC, HGLRC, const int *))IntGetProcAddress("wglCreateContextAttribsARB");
+ if(!sf_ptrc_wglCreateContextAttribsARB) numFailed++;
+ return numFailed;
+}
+
+
+static const char * (CODEGEN_FUNCPTR *sf_ptrc_wglGetExtensionsStringARB)(HDC) = NULL;
+
+typedef int (*PFN_LOADFUNCPOINTERS)(void);
+typedef struct sfwgl_StrToExtMap_s
+{
+ const char *extensionName;
+ int *extensionVariable;
+ PFN_LOADFUNCPOINTERS LoadExtension;
+} sfwgl_StrToExtMap;
+
+static sfwgl_StrToExtMap ExtensionMap[5] = {
+ {"WGL_EXT_swap_control", &sfwgl_ext_EXT_swap_control, Load_EXT_swap_control},
+ {"WGL_ARB_multisample", &sfwgl_ext_ARB_multisample, NULL},
+ {"WGL_ARB_pixel_format", &sfwgl_ext_ARB_pixel_format, Load_ARB_pixel_format},
+ {"WGL_ARB_create_context", &sfwgl_ext_ARB_create_context, Load_ARB_create_context},
+ {"WGL_ARB_create_context_profile", &sfwgl_ext_ARB_create_context_profile, NULL},
+};
+
+static int g_extensionMapSize = 5;
+
+static sfwgl_StrToExtMap *FindExtEntry(const char *extensionName)
+{
+ int loop;
+ sfwgl_StrToExtMap *currLoc = ExtensionMap;
+ for(loop = 0; loop < g_extensionMapSize; ++loop, ++currLoc)
+ {
+ if(strcmp(extensionName, currLoc->extensionName) == 0)
+ return currLoc;
+ }
+
+ return NULL;
+}
+
+static void ClearExtensionVars(void)
+{
+ sfwgl_ext_EXT_swap_control = sfwgl_LOAD_FAILED;
+ sfwgl_ext_ARB_multisample = sfwgl_LOAD_FAILED;
+ sfwgl_ext_ARB_pixel_format = sfwgl_LOAD_FAILED;
+ sfwgl_ext_ARB_create_context = sfwgl_LOAD_FAILED;
+ sfwgl_ext_ARB_create_context_profile = sfwgl_LOAD_FAILED;
+}
+
+
+static void LoadExtByName(const char *extensionName)
+{
+ sfwgl_StrToExtMap *entry = NULL;
+ entry = FindExtEntry(extensionName);
+ if(entry)
+ {
+ if(entry->LoadExtension)
+ {
+ int numFailed = entry->LoadExtension();
+ if(numFailed == 0)
+ {
+ *(entry->extensionVariable) = sfwgl_LOAD_SUCCEEDED;
+ }
+ else
+ {
+ *(entry->extensionVariable) = sfwgl_LOAD_SUCCEEDED + numFailed;
+ }
+ }
+ else
+ {
+ *(entry->extensionVariable) = sfwgl_LOAD_SUCCEEDED;
+ }
+ }
+}
+
+
+static void ProcExtsFromExtString(const char *strExtList)
+{
+ size_t iExtListLen = strlen(strExtList);
+ const char *strExtListEnd = strExtList + iExtListLen;
+ const char *strCurrPos = strExtList;
+ char strWorkBuff[256];
+
+ while(*strCurrPos)
+ {
+ /*Get the extension at our position.*/
+ int iStrLen = 0;
+ const char *strEndStr = strchr(strCurrPos, ' ');
+ int iStop = 0;
+ if(strEndStr == NULL)
+ {
+ strEndStr = strExtListEnd;
+ iStop = 1;
+ }
+
+ iStrLen = (int)((ptrdiff_t)strEndStr - (ptrdiff_t)strCurrPos);
+
+ if(iStrLen > 255)
+ return;
+
+ strncpy(strWorkBuff, strCurrPos, iStrLen);
+ strWorkBuff[iStrLen] = '\0';
+
+ LoadExtByName(strWorkBuff);
+
+ strCurrPos = strEndStr + 1;
+ if(iStop) break;
+ }
+}
+
+int sfwgl_LoadFunctions(HDC hdc)
+{
+ ClearExtensionVars();
+
+ sf_ptrc_wglGetExtensionsStringARB = (const char * (CODEGEN_FUNCPTR *)(HDC))IntGetProcAddress("wglGetExtensionsStringARB");
+ if(!sf_ptrc_wglGetExtensionsStringARB) return sfwgl_LOAD_FAILED;
+
+ ProcExtsFromExtString((const char *)sf_ptrc_wglGetExtensionsStringARB(hdc));
+ return sfwgl_LOAD_SUCCEEDED;
+}
+
diff --git a/src/SFML/Window/Win32/WglExtensions.hpp b/src/SFML/Window/Win32/WglExtensions.hpp
new file mode 100644
index 0000000..1b389c0
--- /dev/null
+++ b/src/SFML/Window/Win32/WglExtensions.hpp
@@ -0,0 +1,206 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+//
+// This software is provided 'as-is', without 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 SF_POINTER_C_GENERATED_HEADER_WINDOWSGL_HPP
+#define SF_POINTER_C_GENERATED_HEADER_WINDOWSGL_HPP
+
+#ifdef __wglext_h_
+#error Attempt to include auto-generated WGL header after wglext.h
+#endif
+
+#define __wglext_h_
+
+#ifndef WIN32_LEAN_AND_MEAN
+ #define WIN32_LEAN_AND_MEAN 1
+#endif
+#ifndef NOMINMAX
+ #define NOMINMAX
+#endif
+#include <windows.h>
+
+#ifdef CODEGEN_FUNCPTR
+#undef CODEGEN_FUNCPTR
+#endif /*CODEGEN_FUNCPTR*/
+#define CODEGEN_FUNCPTR WINAPI
+
+#ifndef GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS
+#define GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS
+
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef signed char GLbyte;
+typedef short GLshort;
+typedef int GLint;
+typedef int GLsizei;
+typedef unsigned char GLubyte;
+typedef unsigned short GLushort;
+typedef unsigned int GLuint;
+typedef float GLfloat;
+typedef float GLclampf;
+typedef double GLdouble;
+typedef double GLclampd;
+#define GLvoid void
+
+#endif /*GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS*/
+
+
+#ifndef GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS
+#define GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS
+
+
+#endif /*GL_LOAD_GEN_BASIC_OPENGL_TYPEDEFS*/
+
+
+struct _GPU_DEVICE {
+ DWORD cb;
+ CHAR DeviceName[32];
+ CHAR DeviceString[128];
+ DWORD Flags;
+ RECT rcVirtualScreen;
+};
+DECLARE_HANDLE(HPBUFFERARB);
+DECLARE_HANDLE(HPBUFFEREXT);
+DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
+DECLARE_HANDLE(HPVIDEODEV);
+DECLARE_HANDLE(HGPUNV);
+DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
+typedef struct _GPU_DEVICE *PGPU_DEVICE;
+
+#ifdef __cplusplus
+extern "C" {
+#endif /*__cplusplus*/
+
+extern int sfwgl_ext_EXT_swap_control;
+extern int sfwgl_ext_ARB_multisample;
+extern int sfwgl_ext_ARB_pixel_format;
+extern int sfwgl_ext_ARB_create_context;
+extern int sfwgl_ext_ARB_create_context_profile;
+
+#define WGL_SAMPLES_ARB 0x2042
+#define WGL_SAMPLE_BUFFERS_ARB 0x2041
+
+#define WGL_ACCELERATION_ARB 0x2003
+#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
+#define WGL_ACCUM_BITS_ARB 0x201D
+#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
+#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
+#define WGL_ACCUM_RED_BITS_ARB 0x201E
+#define WGL_ALPHA_BITS_ARB 0x201B
+#define WGL_ALPHA_SHIFT_ARB 0x201C
+#define WGL_AUX_BUFFERS_ARB 0x2024
+#define WGL_BLUE_BITS_ARB 0x2019
+#define WGL_BLUE_SHIFT_ARB 0x201A
+#define WGL_COLOR_BITS_ARB 0x2014
+#define WGL_DEPTH_BITS_ARB 0x2022
+#define WGL_DOUBLE_BUFFER_ARB 0x2011
+#define WGL_DRAW_TO_BITMAP_ARB 0x2002
+#define WGL_DRAW_TO_WINDOW_ARB 0x2001
+#define WGL_FULL_ACCELERATION_ARB 0x2027
+#define WGL_GENERIC_ACCELERATION_ARB 0x2026
+#define WGL_GREEN_BITS_ARB 0x2017
+#define WGL_GREEN_SHIFT_ARB 0x2018
+#define WGL_NEED_PALETTE_ARB 0x2004
+#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
+#define WGL_NO_ACCELERATION_ARB 0x2025
+#define WGL_NUMBER_OVERLAYS_ARB 0x2008
+#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
+#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
+#define WGL_PIXEL_TYPE_ARB 0x2013
+#define WGL_RED_BITS_ARB 0x2015
+#define WGL_RED_SHIFT_ARB 0x2016
+#define WGL_SHARE_ACCUM_ARB 0x200E
+#define WGL_SHARE_DEPTH_ARB 0x200C
+#define WGL_SHARE_STENCIL_ARB 0x200D
+#define WGL_STENCIL_BITS_ARB 0x2023
+#define WGL_STEREO_ARB 0x2012
+#define WGL_SUPPORT_GDI_ARB 0x200F
+#define WGL_SUPPORT_OPENGL_ARB 0x2010
+#define WGL_SWAP_COPY_ARB 0x2029
+#define WGL_SWAP_EXCHANGE_ARB 0x2028
+#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
+#define WGL_SWAP_METHOD_ARB 0x2007
+#define WGL_SWAP_UNDEFINED_ARB 0x202A
+#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
+#define WGL_TRANSPARENT_ARB 0x200A
+#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
+#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
+#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
+#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
+#define WGL_TYPE_COLORINDEX_ARB 0x202C
+#define WGL_TYPE_RGBA_ARB 0x202B
+
+#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
+#define WGL_CONTEXT_FLAGS_ARB 0x2094
+#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
+#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
+#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
+#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
+#define WGL_ERROR_INVALID_VERSION_ARB 0x2095
+
+#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
+#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
+#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
+#define WGL_ERROR_INVALID_PROFILE_ARB 0x2096
+
+#ifndef WGL_EXT_swap_control
+#define WGL_EXT_swap_control 1
+extern int (CODEGEN_FUNCPTR *sf_ptrc_wglGetSwapIntervalEXT)(void);
+#define wglGetSwapIntervalEXT sf_ptrc_wglGetSwapIntervalEXT
+extern BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglSwapIntervalEXT)(int);
+#define wglSwapIntervalEXT sf_ptrc_wglSwapIntervalEXT
+#endif /*WGL_EXT_swap_control*/
+
+
+#ifndef WGL_ARB_pixel_format
+#define WGL_ARB_pixel_format 1
+extern BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglChoosePixelFormatARB)(HDC, const int *, const FLOAT *, UINT, int *, UINT *);
+#define wglChoosePixelFormatARB sf_ptrc_wglChoosePixelFormatARB
+extern BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglGetPixelFormatAttribfvARB)(HDC, int, int, UINT, const int *, FLOAT *);
+#define wglGetPixelFormatAttribfvARB sf_ptrc_wglGetPixelFormatAttribfvARB
+extern BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglGetPixelFormatAttribivARB)(HDC, int, int, UINT, const int *, int *);
+#define wglGetPixelFormatAttribivARB sf_ptrc_wglGetPixelFormatAttribivARB
+#endif /*WGL_ARB_pixel_format*/
+
+#ifndef WGL_ARB_create_context
+#define WGL_ARB_create_context 1
+extern HGLRC (CODEGEN_FUNCPTR *sf_ptrc_wglCreateContextAttribsARB)(HDC, HGLRC, const int *);
+#define wglCreateContextAttribsARB sf_ptrc_wglCreateContextAttribsARB
+#endif /*WGL_ARB_create_context*/
+
+
+enum sfwgl_LoadStatus
+{
+ sfwgl_LOAD_FAILED = 0,
+ sfwgl_LOAD_SUCCEEDED = 1
+};
+
+int sfwgl_LoadFunctions(HDC hdc);
+
+
+#ifdef __cplusplus
+}
+#endif /*__cplusplus*/
+
+#endif /* SF_POINTER_C_GENERATED_HEADER_WINDOWSGL_HPP */
diff --git a/src/SFML/Window/Win32/WglExtensions.txt b/src/SFML/Window/Win32/WglExtensions.txt
new file mode 100644
index 0000000..99610a6
--- /dev/null
+++ b/src/SFML/Window/Win32/WglExtensions.txt
@@ -0,0 +1,10 @@
+// Created with:
+// https://bitbucket.org/Anteru/glloadgen-reloaded
+// Commit 20f19482b7a844d20b9785c3e3fd1f16419f6e0a
+// lua LoadGen.lua -style=pointer_c -spec=wgl -indent=space -prefix=sf -extfile=WglExtensions.txt WglExtensions
+
+EXT_swap_control
+WGL_ARB_multisample
+WGL_ARB_pixel_format
+WGL_ARB_create_context
+WGL_ARB_create_context_profile \ No newline at end of file
diff --git a/src/SFML/Window/Win32/WindowImplWin32.cpp b/src/SFML/Window/Win32/WindowImplWin32.cpp
index 69fe2ea..8bf86ab 100644
--- a/src/SFML/Window/Win32/WindowImplWin32.cpp
+++ b/src/SFML/Window/Win32/WindowImplWin32.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -48,6 +48,9 @@
#ifndef XBUTTON2
#define XBUTTON2 0x0002
#endif
+#ifndef WM_MOUSEHWHEEL
+ #define WM_MOUSEHWHEEL 0x020E
+#endif
#ifndef MAPVK_VK_TO_VSC
#define MAPVK_VK_TO_VSC (0)
#endif
@@ -373,7 +376,7 @@ 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
@@ -662,7 +665,7 @@ void WindowImplWin32::processEvent(UINT message, WPARAM wParam, LPARAM lParam)
break;
}
- // Mouse wheel event
+ // Vertical mouse wheel event
case WM_MOUSEWHEEL:
{
// Mouse position is in screen coordinates, convert it to window coordinates
@@ -671,11 +674,42 @@ void WindowImplWin32::processEvent(UINT message, WPARAM wParam, LPARAM lParam)
position.y = static_cast<Int16>(HIWORD(lParam));
ScreenToClient(m_handle, &position);
+ Int16 delta = static_cast<Int16>(HIWORD(wParam));
+
+ Event event;
+
+ event.type = Event::MouseWheelMoved;
+ event.mouseWheel.delta = delta / 120;
+ event.mouseWheel.x = position.x;
+ event.mouseWheel.y = position.y;
+ pushEvent(event);
+
+ event.type = Event::MouseWheelScrolled;
+ event.mouseWheelScroll.wheel = Mouse::VerticalWheel;
+ event.mouseWheelScroll.delta = static_cast<float>(delta) / 120.f;
+ event.mouseWheelScroll.x = position.x;
+ event.mouseWheelScroll.y = position.y;
+ pushEvent(event);
+ break;
+ }
+
+ // Horizontal mouse wheel event
+ case WM_MOUSEHWHEEL:
+ {
+ // 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);
+
+ Int16 delta = static_cast<Int16>(HIWORD(wParam));
+
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;
+ event.type = Event::MouseWheelScrolled;
+ event.mouseWheelScroll.wheel = Mouse::HorizontalWheel;
+ event.mouseWheelScroll.delta = -static_cast<float>(delta) / 120.f;
+ event.mouseWheelScroll.x = position.x;
+ event.mouseWheelScroll.y = position.y;
pushEvent(event);
break;
}
diff --git a/src/SFML/Window/Win32/WindowImplWin32.hpp b/src/SFML/Window/Win32/WindowImplWin32.hpp
index 0bb3ce8..fb5fe0f 100644
--- a/src/SFML/Window/Win32/WindowImplWin32.hpp
+++ b/src/SFML/Window/Win32/WindowImplWin32.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/Window.cpp b/src/SFML/Window/Window.cpp
index 2f7bff3..a091325 100644
--- a/src/SFML/Window/Window.cpp
+++ b/src/SFML/Window/Window.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/WindowImpl.cpp b/src/SFML/Window/WindowImpl.cpp
index db4518e..679aaed 100644
--- a/src/SFML/Window/WindowImpl.cpp
+++ b/src/SFML/Window/WindowImpl.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/WindowImpl.hpp b/src/SFML/Window/WindowImpl.hpp
index e30b42c..1e07a0f 100644
--- a/src/SFML/Window/WindowImpl.hpp
+++ b/src/SFML/Window/WindowImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/glext/glext.h b/src/SFML/Window/glext/glext.h
deleted file mode 100644
index 997dfe0..0000000
--- a/src/SFML/Window/glext/glext.h
+++ /dev/null
@@ -1,11162 +0,0 @@
-#ifndef __glext_h_
-#define __glext_h_ 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** 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
-** 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.
-*/
-/*
-** 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
-
-#ifndef APIENTRY
-#define APIENTRY
-#endif
-#ifndef APIENTRYP
-#define APIENTRYP APIENTRY *
-#endif
-#ifndef GLAPI
-#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
-#define GL_UNSIGNED_INT_8_8_8_8 0x8035
-#define GL_UNSIGNED_INT_10_10_10_2 0x8036
-#define GL_TEXTURE_BINDING_3D 0x806A
-#define GL_PACK_SKIP_IMAGES 0x806B
-#define GL_PACK_IMAGE_HEIGHT 0x806C
-#define GL_UNPACK_SKIP_IMAGES 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT 0x806E
-#define GL_TEXTURE_3D 0x806F
-#define GL_PROXY_TEXTURE_3D 0x8070
-#define GL_TEXTURE_DEPTH 0x8071
-#define GL_TEXTURE_WRAP_R 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE 0x8073
-#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
-#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
-#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
-#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
-#define GL_BGR 0x80E0
-#define GL_BGRA 0x80E1
-#define GL_MAX_ELEMENTS_VERTICES 0x80E8
-#define GL_MAX_ELEMENTS_INDICES 0x80E9
-#define GL_CLAMP_TO_EDGE 0x812F
-#define GL_TEXTURE_MIN_LOD 0x813A
-#define GL_TEXTURE_MAX_LOD 0x813B
-#define GL_TEXTURE_BASE_LEVEL 0x813C
-#define GL_TEXTURE_MAX_LEVEL 0x813D
-#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
-#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
-#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
-#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#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
-#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
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-#define GL_ACTIVE_TEXTURE 0x84E0
-#define GL_MULTISAMPLE 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
-#define GL_SAMPLE_COVERAGE 0x80A0
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLES 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
-#define GL_COMPRESSED_RGB 0x84ED
-#define GL_COMPRESSED_RGBA 0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
-#define GL_TEXTURE_COMPRESSED 0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-#define GL_CLAMP_TO_BORDER 0x812D
-#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
-#define GL_MAX_TEXTURE_UNITS 0x84E2
-#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
-#define GL_MULTISAMPLE_BIT 0x20000000
-#define GL_NORMAL_MAP 0x8511
-#define GL_REFLECTION_MAP 0x8512
-#define GL_COMPRESSED_ALPHA 0x84E9
-#define GL_COMPRESSED_LUMINANCE 0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
-#define GL_COMPRESSED_INTENSITY 0x84EC
-#define GL_COMBINE 0x8570
-#define GL_COMBINE_RGB 0x8571
-#define GL_COMBINE_ALPHA 0x8572
-#define GL_SOURCE0_RGB 0x8580
-#define GL_SOURCE1_RGB 0x8581
-#define GL_SOURCE2_RGB 0x8582
-#define GL_SOURCE0_ALPHA 0x8588
-#define GL_SOURCE1_ALPHA 0x8589
-#define GL_SOURCE2_ALPHA 0x858A
-#define GL_OPERAND0_RGB 0x8590
-#define GL_OPERAND1_RGB 0x8591
-#define GL_OPERAND2_RGB 0x8592
-#define GL_OPERAND0_ALPHA 0x8598
-#define GL_OPERAND1_ALPHA 0x8599
-#define GL_OPERAND2_ALPHA 0x859A
-#define GL_RGB_SCALE 0x8573
-#define GL_ADD_SIGNED 0x8574
-#define GL_INTERPOLATE 0x8575
-#define GL_SUBTRACT 0x84E7
-#define GL_CONSTANT 0x8576
-#define GL_PRIMARY_COLOR 0x8577
-#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
-#define GL_BLEND_SRC_ALPHA 0x80CB
-#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
-#define GL_DEPTH_COMPONENT16 0x81A5
-#define GL_DEPTH_COMPONENT24 0x81A6
-#define GL_DEPTH_COMPONENT32 0x81A7
-#define GL_MIRRORED_REPEAT 0x8370
-#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
-#define GL_TEXTURE_LOD_BIAS 0x8501
-#define GL_INCR_WRAP 0x8507
-#define GL_DECR_WRAP 0x8508
-#define GL_TEXTURE_DEPTH_SIZE 0x884A
-#define GL_TEXTURE_COMPARE_MODE 0x884C
-#define GL_TEXTURE_COMPARE_FUNC 0x884D
-#define GL_POINT_SIZE_MIN 0x8126
-#define GL_POINT_SIZE_MAX 0x8127
-#define GL_POINT_DISTANCE_ATTENUATION 0x8129
-#define GL_GENERATE_MIPMAP 0x8191
-#define GL_GENERATE_MIPMAP_HINT 0x8192
-#define GL_FOG_COORDINATE_SOURCE 0x8450
-#define GL_FOG_COORDINATE 0x8451
-#define GL_FRAGMENT_DEPTH 0x8452
-#define GL_CURRENT_FOG_COORDINATE 0x8453
-#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
-#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
-#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
-#define GL_FOG_COORDINATE_ARRAY 0x8457
-#define GL_COLOR_SUM 0x8458
-#define GL_CURRENT_SECONDARY_COLOR 0x8459
-#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
-#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
-#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
-#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
-#define GL_SECONDARY_COLOR_ARRAY 0x845E
-#define GL_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
-#define GL_CURRENT_QUERY 0x8865
-#define GL_QUERY_RESULT 0x8866
-#define GL_QUERY_RESULT_AVAILABLE 0x8867
-#define GL_ARRAY_BUFFER 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-#define GL_ARRAY_BUFFER_BINDING 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
-#define GL_READ_ONLY 0x88B8
-#define GL_WRITE_ONLY 0x88B9
-#define GL_READ_WRITE 0x88BA
-#define GL_BUFFER_ACCESS 0x88BB
-#define GL_BUFFER_MAPPED 0x88BC
-#define GL_BUFFER_MAP_POINTER 0x88BD
-#define GL_STREAM_DRAW 0x88E0
-#define GL_STREAM_READ 0x88E1
-#define GL_STREAM_COPY 0x88E2
-#define GL_STATIC_DRAW 0x88E4
-#define GL_STATIC_READ 0x88E5
-#define GL_STATIC_COPY 0x88E6
-#define GL_DYNAMIC_DRAW 0x88E8
-#define GL_DYNAMIC_READ 0x88E9
-#define GL_DYNAMIC_COPY 0x88EA
-#define GL_SAMPLES_PASSED 0x8914
-#define GL_SRC1_ALPHA 0x8589
-#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
-#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
-#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
-#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
-#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
-#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
-#define GL_FOG_COORD_SRC 0x8450
-#define GL_FOG_COORD 0x8451
-#define GL_CURRENT_FOG_COORD 0x8453
-#define GL_FOG_COORD_ARRAY_TYPE 0x8454
-#define GL_FOG_COORD_ARRAY_STRIDE 0x8455
-#define GL_FOG_COORD_ARRAY_POINTER 0x8456
-#define GL_FOG_COORD_ARRAY 0x8457
-#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D
-#define GL_SRC0_RGB 0x8580
-#define GL_SRC1_RGB 0x8581
-#define GL_SRC2_RGB 0x8582
-#define GL_SRC0_ALPHA 0x8588
-#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
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
-#define GL_CURRENT_VERTEX_ATTRIB 0x8626
-#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
-#define GL_STENCIL_BACK_FUNC 0x8800
-#define GL_STENCIL_BACK_FAIL 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
-#define GL_MAX_DRAW_BUFFERS 0x8824
-#define GL_DRAW_BUFFER0 0x8825
-#define GL_DRAW_BUFFER1 0x8826
-#define GL_DRAW_BUFFER2 0x8827
-#define GL_DRAW_BUFFER3 0x8828
-#define GL_DRAW_BUFFER4 0x8829
-#define GL_DRAW_BUFFER5 0x882A
-#define GL_DRAW_BUFFER6 0x882B
-#define GL_DRAW_BUFFER7 0x882C
-#define GL_DRAW_BUFFER8 0x882D
-#define GL_DRAW_BUFFER9 0x882E
-#define GL_DRAW_BUFFER10 0x882F
-#define GL_DRAW_BUFFER11 0x8830
-#define GL_DRAW_BUFFER12 0x8831
-#define GL_DRAW_BUFFER13 0x8832
-#define GL_DRAW_BUFFER14 0x8833
-#define GL_DRAW_BUFFER15 0x8834
-#define GL_BLEND_EQUATION_ALPHA 0x883D
-#define GL_MAX_VERTEX_ATTRIBS 0x8869
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
-#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
-#define GL_MAX_VARYING_FLOATS 0x8B4B
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
-#define GL_SHADER_TYPE 0x8B4F
-#define GL_FLOAT_VEC2 0x8B50
-#define GL_FLOAT_VEC3 0x8B51
-#define GL_FLOAT_VEC4 0x8B52
-#define GL_INT_VEC2 0x8B53
-#define GL_INT_VEC3 0x8B54
-#define GL_INT_VEC4 0x8B55
-#define GL_BOOL 0x8B56
-#define GL_BOOL_VEC2 0x8B57
-#define GL_BOOL_VEC3 0x8B58
-#define GL_BOOL_VEC4 0x8B59
-#define GL_FLOAT_MAT2 0x8B5A
-#define GL_FLOAT_MAT3 0x8B5B
-#define GL_FLOAT_MAT4 0x8B5C
-#define GL_SAMPLER_1D 0x8B5D
-#define GL_SAMPLER_2D 0x8B5E
-#define GL_SAMPLER_3D 0x8B5F
-#define GL_SAMPLER_CUBE 0x8B60
-#define GL_SAMPLER_1D_SHADOW 0x8B61
-#define GL_SAMPLER_2D_SHADOW 0x8B62
-#define GL_DELETE_STATUS 0x8B80
-#define GL_COMPILE_STATUS 0x8B81
-#define GL_LINK_STATUS 0x8B82
-#define GL_VALIDATE_STATUS 0x8B83
-#define GL_INFO_LOG_LENGTH 0x8B84
-#define GL_ATTACHED_SHADERS 0x8B85
-#define GL_ACTIVE_UNIFORMS 0x8B86
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
-#define GL_SHADER_SOURCE_LENGTH 0x8B88
-#define GL_ACTIVE_ATTRIBUTES 0x8B89
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
-#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
-#define GL_CURRENT_PROGRAM 0x8B8D
-#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
-#define GL_LOWER_LEFT 0x8CA1
-#define GL_UPPER_LEFT 0x8CA2
-#define GL_STENCIL_BACK_REF 0x8CA3
-#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
-#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
-#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
-#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
-#define GL_FLOAT_MAT2x3 0x8B65
-#define GL_FLOAT_MAT2x4 0x8B66
-#define GL_FLOAT_MAT3x2 0x8B67
-#define GL_FLOAT_MAT3x4 0x8B68
-#define GL_FLOAT_MAT4x2 0x8B69
-#define GL_FLOAT_MAT4x3 0x8B6A
-#define GL_SRGB 0x8C40
-#define GL_SRGB8 0x8C41
-#define GL_SRGB_ALPHA 0x8C42
-#define GL_SRGB8_ALPHA8 0x8C43
-#define GL_COMPRESSED_SRGB 0x8C48
-#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
-#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
-#define GL_SLUMINANCE_ALPHA 0x8C44
-#define GL_SLUMINANCE8_ALPHA8 0x8C45
-#define GL_SLUMINANCE 0x8C46
-#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
-#define GL_CLIP_DISTANCE2 0x3002
-#define GL_CLIP_DISTANCE3 0x3003
-#define GL_CLIP_DISTANCE4 0x3004
-#define GL_CLIP_DISTANCE5 0x3005
-#define GL_CLIP_DISTANCE6 0x3006
-#define GL_CLIP_DISTANCE7 0x3007
-#define GL_MAX_CLIP_DISTANCES 0x0D32
-#define GL_MAJOR_VERSION 0x821B
-#define GL_MINOR_VERSION 0x821C
-#define GL_NUM_EXTENSIONS 0x821D
-#define GL_CONTEXT_FLAGS 0x821E
-#define GL_COMPRESSED_RED 0x8225
-#define GL_COMPRESSED_RG 0x8226
-#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001
-#define GL_RGBA32F 0x8814
-#define GL_RGB32F 0x8815
-#define GL_RGBA16F 0x881A
-#define GL_RGB16F 0x881B
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
-#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
-#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
-#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
-#define GL_CLAMP_READ_COLOR 0x891C
-#define GL_FIXED_ONLY 0x891D
-#define GL_MAX_VARYING_COMPONENTS 0x8B4B
-#define GL_TEXTURE_1D_ARRAY 0x8C18
-#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19
-#define GL_TEXTURE_2D_ARRAY 0x8C1A
-#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B
-#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
-#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
-#define GL_R11F_G11F_B10F 0x8C3A
-#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
-#define GL_RGB9_E5 0x8C3D
-#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
-#define GL_TEXTURE_SHARED_SIZE 0x8C3F
-#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
-#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
-#define GL_PRIMITIVES_GENERATED 0x8C87
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
-#define GL_RASTERIZER_DISCARD 0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
-#define GL_INTERLEAVED_ATTRIBS 0x8C8C
-#define GL_SEPARATE_ATTRIBS 0x8C8D
-#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
-#define GL_RGBA32UI 0x8D70
-#define GL_RGB32UI 0x8D71
-#define GL_RGBA16UI 0x8D76
-#define GL_RGB16UI 0x8D77
-#define GL_RGBA8UI 0x8D7C
-#define GL_RGB8UI 0x8D7D
-#define GL_RGBA32I 0x8D82
-#define GL_RGB32I 0x8D83
-#define GL_RGBA16I 0x8D88
-#define GL_RGB16I 0x8D89
-#define GL_RGBA8I 0x8D8E
-#define GL_RGB8I 0x8D8F
-#define GL_RED_INTEGER 0x8D94
-#define GL_GREEN_INTEGER 0x8D95
-#define GL_BLUE_INTEGER 0x8D96
-#define GL_RGB_INTEGER 0x8D98
-#define GL_RGBA_INTEGER 0x8D99
-#define GL_BGR_INTEGER 0x8D9A
-#define GL_BGRA_INTEGER 0x8D9B
-#define GL_SAMPLER_1D_ARRAY 0x8DC0
-#define GL_SAMPLER_2D_ARRAY 0x8DC1
-#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
-#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
-#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
-#define GL_UNSIGNED_INT_VEC2 0x8DC6
-#define GL_UNSIGNED_INT_VEC3 0x8DC7
-#define GL_UNSIGNED_INT_VEC4 0x8DC8
-#define GL_INT_SAMPLER_1D 0x8DC9
-#define GL_INT_SAMPLER_2D 0x8DCA
-#define GL_INT_SAMPLER_3D 0x8DCB
-#define GL_INT_SAMPLER_CUBE 0x8DCC
-#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
-#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
-#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
-#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
-#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
-#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
-#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
-#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
-#define GL_QUERY_WAIT 0x8E13
-#define GL_QUERY_NO_WAIT 0x8E14
-#define GL_QUERY_BY_REGION_WAIT 0x8E15
-#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16
-#define GL_BUFFER_ACCESS_FLAGS 0x911F
-#define GL_BUFFER_MAP_LENGTH 0x9120
-#define GL_BUFFER_MAP_OFFSET 0x9121
-#define GL_DEPTH_COMPONENT32F 0x8CAC
-#define GL_DEPTH32F_STENCIL8 0x8CAD
-#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
-#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
-#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
-#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
-#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
-#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
-#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
-#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
-#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
-#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
-#define GL_FRAMEBUFFER_DEFAULT 0x8218
-#define GL_FRAMEBUFFER_UNDEFINED 0x8219
-#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
-#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
-#define GL_DEPTH_STENCIL 0x84F9
-#define GL_UNSIGNED_INT_24_8 0x84FA
-#define GL_DEPTH24_STENCIL8 0x88F0
-#define GL_TEXTURE_STENCIL_SIZE 0x88F1
-#define GL_TEXTURE_RED_TYPE 0x8C10
-#define GL_TEXTURE_GREEN_TYPE 0x8C11
-#define GL_TEXTURE_BLUE_TYPE 0x8C12
-#define GL_TEXTURE_ALPHA_TYPE 0x8C13
-#define GL_TEXTURE_DEPTH_TYPE 0x8C16
-#define GL_UNSIGNED_NORMALIZED 0x8C17
-#define GL_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_RENDERBUFFER_BINDING 0x8CA7
-#define GL_READ_FRAMEBUFFER 0x8CA8
-#define GL_DRAW_FRAMEBUFFER 0x8CA9
-#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
-#define GL_RENDERBUFFER_SAMPLES 0x8CAB
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
-#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
-#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
-#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
-#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
-#define GL_COLOR_ATTACHMENT0 0x8CE0
-#define GL_COLOR_ATTACHMENT1 0x8CE1
-#define GL_COLOR_ATTACHMENT2 0x8CE2
-#define GL_COLOR_ATTACHMENT3 0x8CE3
-#define GL_COLOR_ATTACHMENT4 0x8CE4
-#define GL_COLOR_ATTACHMENT5 0x8CE5
-#define GL_COLOR_ATTACHMENT6 0x8CE6
-#define GL_COLOR_ATTACHMENT7 0x8CE7
-#define GL_COLOR_ATTACHMENT8 0x8CE8
-#define GL_COLOR_ATTACHMENT9 0x8CE9
-#define GL_COLOR_ATTACHMENT10 0x8CEA
-#define GL_COLOR_ATTACHMENT11 0x8CEB
-#define GL_COLOR_ATTACHMENT12 0x8CEC
-#define GL_COLOR_ATTACHMENT13 0x8CED
-#define GL_COLOR_ATTACHMENT14 0x8CEE
-#define GL_COLOR_ATTACHMENT15 0x8CEF
-#define GL_DEPTH_ATTACHMENT 0x8D00
-#define GL_STENCIL_ATTACHMENT 0x8D20
-#define GL_FRAMEBUFFER 0x8D40
-#define GL_RENDERBUFFER 0x8D41
-#define GL_RENDERBUFFER_WIDTH 0x8D42
-#define GL_RENDERBUFFER_HEIGHT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
-#define GL_STENCIL_INDEX1 0x8D46
-#define GL_STENCIL_INDEX4 0x8D47
-#define GL_STENCIL_INDEX8 0x8D48
-#define GL_STENCIL_INDEX16 0x8D49
-#define GL_RENDERBUFFER_RED_SIZE 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
-#define GL_MAX_SAMPLES 0x8D57
-#define GL_INDEX 0x8222
-#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14
-#define GL_TEXTURE_INTENSITY_TYPE 0x8C15
-#define GL_FRAMEBUFFER_SRGB 0x8DB9
-#define GL_HALF_FLOAT 0x140B
-#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
-#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
-#define GL_RG 0x8227
-#define GL_RG_INTEGER 0x8228
-#define GL_R8 0x8229
-#define GL_R16 0x822A
-#define GL_RG8 0x822B
-#define GL_RG16 0x822C
-#define GL_R16F 0x822D
-#define GL_R32F 0x822E
-#define GL_RG16F 0x822F
-#define GL_RG32F 0x8230
-#define GL_R8I 0x8231
-#define GL_R8UI 0x8232
-#define GL_R16I 0x8233
-#define GL_R16UI 0x8234
-#define GL_R32I 0x8235
-#define GL_R32UI 0x8236
-#define GL_RG8I 0x8237
-#define GL_RG8UI 0x8238
-#define GL_RG16I 0x8239
-#define GL_RG16UI 0x823A
-#define GL_RG32I 0x823B
-#define GL_RG32UI 0x823C
-#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_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_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_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
-#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
-#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
-#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
-#define GL_UNIFORM_TYPE 0x8A37
-#define GL_UNIFORM_SIZE 0x8A38
-#define GL_UNIFORM_NAME_LENGTH 0x8A39
-#define GL_UNIFORM_BLOCK_INDEX 0x8A3A
-#define GL_UNIFORM_OFFSET 0x8A3B
-#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
-#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
-#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
-#define GL_UNIFORM_BLOCK_BINDING 0x8A3F
-#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
-#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
-#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_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_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
-#endif
-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
-#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
-#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
-#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
-#define GL_OBJECT_TYPE 0x9112
-#define GL_SYNC_CONDITION 0x9113
-#define GL_SYNC_STATUS 0x9114
-#define GL_SYNC_FLAGS 0x9115
-#define GL_SYNC_FENCE 0x9116
-#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
-#define GL_UNSIGNALED 0x9118
-#define GL_SIGNALED 0x9119
-#define GL_ALREADY_SIGNALED 0x911A
-#define GL_TIMEOUT_EXPIRED 0x911B
-#define GL_CONDITION_SATISFIED 0x911C
-#define GL_WAIT_FAILED 0x911D
-#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull
-#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
-#define GL_SAMPLE_POSITION 0x8E50
-#define GL_SAMPLE_MASK 0x8E51
-#define GL_SAMPLE_MASK_VALUE 0x8E52
-#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59
-#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
-#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101
-#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102
-#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103
-#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
-#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105
-#define GL_TEXTURE_SAMPLES 0x9106
-#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
-#define GL_SAMPLER_2D_MULTISAMPLE 0x9108
-#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
-#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
-#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B
-#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
-#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
-#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_VERSION_3_3
-#define GL_VERSION_3_3 1
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
-#define GL_SRC1_COLOR 0x88F9
-#define GL_ONE_MINUS_SRC1_COLOR 0x88FA
-#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB
-#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC
-#define GL_ANY_SAMPLES_PASSED 0x8C2F
-#define GL_SAMPLER_BINDING 0x8919
-#define GL_RGB10_A2UI 0x906F
-#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
-#define GL_TIME_ELAPSED 0x88BF
-#define GL_TIMESTAMP 0x8E28
-#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_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
-#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
-#define GL_MAX_VERTEX_STREAMS 0x8E71
-#define GL_DOUBLE_VEC2 0x8FFC
-#define GL_DOUBLE_VEC3 0x8FFD
-#define GL_DOUBLE_VEC4 0x8FFE
-#define GL_DOUBLE_MAT2 0x8F46
-#define GL_DOUBLE_MAT3 0x8F47
-#define GL_DOUBLE_MAT4 0x8F48
-#define GL_DOUBLE_MAT2x3 0x8F49
-#define GL_DOUBLE_MAT2x4 0x8F4A
-#define GL_DOUBLE_MAT3x2 0x8F4B
-#define GL_DOUBLE_MAT3x4 0x8F4C
-#define GL_DOUBLE_MAT4x2 0x8F4D
-#define GL_DOUBLE_MAT4x3 0x8F4E
-#define GL_ACTIVE_SUBROUTINES 0x8DE5
-#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6
-#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47
-#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48
-#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49
-#define GL_MAX_SUBROUTINES 0x8DE7
-#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8
-#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A
-#define GL_COMPATIBLE_SUBROUTINES 0x8E4B
-#define GL_PATCHES 0x000E
-#define GL_PATCH_VERTICES 0x8E72
-#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73
-#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74
-#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75
-#define GL_TESS_GEN_MODE 0x8E76
-#define GL_TESS_GEN_SPACING 0x8E77
-#define GL_TESS_GEN_VERTEX_ORDER 0x8E78
-#define GL_TESS_GEN_POINT_MODE 0x8E79
-#define GL_ISOLINES 0x8E7A
-#define GL_FRACTIONAL_ODD 0x8E7B
-#define GL_FRACTIONAL_EVEN 0x8E7C
-#define GL_MAX_PATCH_VERTICES 0x8E7D
-#define GL_MAX_TESS_GEN_LEVEL 0x8E7E
-#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F
-#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80
-#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81
-#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82
-#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83
-#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84
-#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85
-#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86
-#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89
-#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A
-#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C
-#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D
-#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E
-#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1
-#define GL_TESS_EVALUATION_SHADER 0x8E87
-#define GL_TESS_CONTROL_SHADER 0x8E88
-#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
-#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70
-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_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
-#define GL_LOW_FLOAT 0x8DF0
-#define GL_MEDIUM_FLOAT 0x8DF1
-#define GL_HIGH_FLOAT 0x8DF2
-#define GL_LOW_INT 0x8DF3
-#define GL_MEDIUM_INT 0x8DF4
-#define GL_HIGH_INT 0x8DF5
-#define GL_SHADER_COMPILER 0x8DFA
-#define GL_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
-#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
-#define GL_VERTEX_SHADER_BIT 0x00000001
-#define GL_FRAGMENT_SHADER_BIT 0x00000002
-#define GL_GEOMETRY_SHADER_BIT 0x00000004
-#define GL_TESS_CONTROL_SHADER_BIT 0x00000008
-#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010
-#define GL_ALL_SHADER_BITS 0xFFFFFFFF
-#define GL_PROGRAM_SEPARABLE 0x8258
-#define GL_ACTIVE_PROGRAM 0x8259
-#define GL_PROGRAM_PIPELINE_BINDING 0x825A
-#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
-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
-#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245
-#define GL_DEBUG_SOURCE_API_ARB 0x8246
-#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247
-#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248
-#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249
-#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A
-#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B
-#define GL_DEBUG_TYPE_ERROR_ARB 0x824C
-#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D
-#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E
-#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F
-#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250
-#define GL_DEBUG_TYPE_OTHER_ARB 0x8251
-#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143
-#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144
-#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145
-#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146
-#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147
-#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148
-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_depth_buffer_float
-#define GL_ARB_depth_buffer_float 1
-#endif /* GL_ARB_depth_buffer_float */
-
-#ifndef GL_ARB_depth_clamp
-#define GL_ARB_depth_clamp 1
-#endif /* GL_ARB_depth_clamp */
-
-#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_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_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_ARB_draw_elements_base_vertex
-#define GL_ARB_draw_elements_base_vertex 1
-#endif /* GL_ARB_draw_elements_base_vertex */
-
-#ifndef GL_ARB_draw_indirect
-#define GL_ARB_draw_indirect 1
-#endif /* GL_ARB_draw_indirect */
-
-#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_ARB_enhanced_layouts
-#define GL_ARB_enhanced_layouts 1
-#endif /* GL_ARB_enhanced_layouts */
-
-#ifndef GL_ARB_explicit_attrib_location
-#define GL_ARB_explicit_attrib_location 1
-#endif /* GL_ARB_explicit_attrib_location */
-
-#ifndef GL_ARB_explicit_uniform_location
-#define GL_ARB_explicit_uniform_location 1
-#endif /* GL_ARB_explicit_uniform_location */
-
-#ifndef GL_ARB_fragment_coord_conventions
-#define GL_ARB_fragment_coord_conventions 1
-#endif /* GL_ARB_fragment_coord_conventions */
-
-#ifndef GL_ARB_fragment_layer_viewport
-#define GL_ARB_fragment_layer_viewport 1
-#endif /* GL_ARB_fragment_layer_viewport */
-
-#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_ARB_fragment_program_shadow
-#define GL_ARB_fragment_program_shadow 1
-#endif /* GL_ARB_fragment_program_shadow */
-
-#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_ARB_framebuffer_no_attachments
-#define GL_ARB_framebuffer_no_attachments 1
-#endif /* GL_ARB_framebuffer_no_attachments */
-
-#ifndef GL_ARB_framebuffer_object
-#define GL_ARB_framebuffer_object 1
-#endif /* GL_ARB_framebuffer_object */
-
-#ifndef GL_ARB_framebuffer_sRGB
-#define GL_ARB_framebuffer_sRGB 1
-#endif /* GL_ARB_framebuffer_sRGB */
-
-#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_ARB_get_program_binary
-#define GL_ARB_get_program_binary 1
-#endif /* GL_ARB_get_program_binary */
-
-#ifndef GL_ARB_gpu_shader5
-#define GL_ARB_gpu_shader5 1
-#endif /* GL_ARB_gpu_shader5 */
-
-#ifndef GL_ARB_gpu_shader_fp64
-#define GL_ARB_gpu_shader_fp64 1
-#endif /* GL_ARB_gpu_shader_fp64 */
-
-#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_ARB_half_float_vertex
-#define GL_ARB_half_float_vertex 1
-#endif /* GL_ARB_half_float_vertex */
-
-#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_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_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_ARB_internalformat_query
-#define GL_ARB_internalformat_query 1
-#endif /* GL_ARB_internalformat_query */
-
-#ifndef GL_ARB_internalformat_query2
-#define GL_ARB_internalformat_query2 1
-#define GL_SRGB_DECODE_ARB 0x8299
-#endif /* GL_ARB_internalformat_query2 */
-
-#ifndef GL_ARB_invalidate_subdata
-#define GL_ARB_invalidate_subdata 1
-#endif /* GL_ARB_invalidate_subdata */
-
-#ifndef GL_ARB_map_buffer_alignment
-#define GL_ARB_map_buffer_alignment 1
-#endif /* GL_ARB_map_buffer_alignment */
-
-#ifndef GL_ARB_map_buffer_range
-#define GL_ARB_map_buffer_range 1
-#endif /* GL_ARB_map_buffer_range */
-
-#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_ARB_multi_bind
-#define GL_ARB_multi_bind 1
-#endif /* GL_ARB_multi_bind */
-
-#ifndef GL_ARB_multi_draw_indirect
-#define GL_ARB_multi_draw_indirect 1
-#endif /* GL_ARB_multi_draw_indirect */
-
-#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_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_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_ARB_occlusion_query2
-#define GL_ARB_occlusion_query2 1
-#endif /* GL_ARB_occlusion_query2 */
-
-#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_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_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_ARB_program_interface_query
-#define GL_ARB_program_interface_query 1
-#endif /* GL_ARB_program_interface_query */
-
-#ifndef GL_ARB_provoking_vertex
-#define GL_ARB_provoking_vertex 1
-#endif /* GL_ARB_provoking_vertex */
-
-#ifndef GL_ARB_query_buffer_object
-#define GL_ARB_query_buffer_object 1
-#endif /* GL_ARB_query_buffer_object */
-
-#ifndef GL_ARB_robust_buffer_access_behavior
-#define GL_ARB_robust_buffer_access_behavior 1
-#endif /* GL_ARB_robust_buffer_access_behavior */
-
-#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_ARB_robustness_isolation
-#define GL_ARB_robustness_isolation 1
-#endif /* GL_ARB_robustness_isolation */
-
-#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_ARB_sampler_objects
-#define GL_ARB_sampler_objects 1
-#endif /* GL_ARB_sampler_objects */
-
-#ifndef GL_ARB_seamless_cube_map
-#define GL_ARB_seamless_cube_map 1
-#endif /* GL_ARB_seamless_cube_map */
-
-#ifndef GL_ARB_seamless_cubemap_per_texture
-#define GL_ARB_seamless_cubemap_per_texture 1
-#endif /* GL_ARB_seamless_cubemap_per_texture */
-
-#ifndef GL_ARB_separate_shader_objects
-#define GL_ARB_separate_shader_objects 1
-#endif /* GL_ARB_separate_shader_objects */
-
-#ifndef GL_ARB_shader_atomic_counters
-#define GL_ARB_shader_atomic_counters 1
-#endif /* GL_ARB_shader_atomic_counters */
-
-#ifndef GL_ARB_shader_bit_encoding
-#define GL_ARB_shader_bit_encoding 1
-#endif /* GL_ARB_shader_bit_encoding */
-
-#ifndef GL_ARB_shader_draw_parameters
-#define GL_ARB_shader_draw_parameters 1
-#endif /* GL_ARB_shader_draw_parameters */
-
-#ifndef GL_ARB_shader_group_vote
-#define GL_ARB_shader_group_vote 1
-#endif /* GL_ARB_shader_group_vote */
-
-#ifndef GL_ARB_shader_image_load_store
-#define GL_ARB_shader_image_load_store 1
-#endif /* GL_ARB_shader_image_load_store */
-
-#ifndef GL_ARB_shader_image_size
-#define GL_ARB_shader_image_size 1
-#endif /* GL_ARB_shader_image_size */
-
-#ifndef GL_ARB_shader_objects
-#define GL_ARB_shader_objects 1
-#ifdef __APPLE__
-typedef void *GLhandleARB;
-#else
-typedef unsigned int GLhandleARB;
-#endif
-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_ARB_shader_precision
-#define GL_ARB_shader_precision 1
-#endif /* GL_ARB_shader_precision */
-
-#ifndef GL_ARB_shader_stencil_export
-#define GL_ARB_shader_stencil_export 1
-#endif /* GL_ARB_shader_stencil_export */
-
-#ifndef GL_ARB_shader_storage_buffer_object
-#define GL_ARB_shader_storage_buffer_object 1
-#endif /* GL_ARB_shader_storage_buffer_object */
-
-#ifndef GL_ARB_shader_subroutine
-#define GL_ARB_shader_subroutine 1
-#endif /* GL_ARB_shader_subroutine */
-
-#ifndef GL_ARB_shader_texture_lod
-#define GL_ARB_shader_texture_lod 1
-#endif /* GL_ARB_shader_texture_lod */
-
-#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_ARB_shading_language_420pack
-#define GL_ARB_shading_language_420pack 1
-#endif /* GL_ARB_shading_language_420pack */
-
-#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_ARB_shading_language_packing
-#define GL_ARB_shading_language_packing 1
-#endif /* GL_ARB_shading_language_packing */
-
-#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_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_ARB_sync
-#define GL_ARB_sync 1
-#endif /* GL_ARB_sync */
-
-#ifndef GL_ARB_tessellation_shader
-#define GL_ARB_tessellation_shader 1
-#endif /* GL_ARB_tessellation_shader */
-
-#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_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_ARB_texture_buffer_object_rgb32
-#define GL_ARB_texture_buffer_object_rgb32 1
-#endif /* GL_ARB_texture_buffer_object_rgb32 */
-
-#ifndef GL_ARB_texture_buffer_range
-#define GL_ARB_texture_buffer_range 1
-#endif /* GL_ARB_texture_buffer_range */
-
-#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_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_ARB_texture_compression_rgtc
-#define GL_ARB_texture_compression_rgtc 1
-#endif /* GL_ARB_texture_compression_rgtc */
-
-#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_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_ARB_texture_env_add
-#define GL_ARB_texture_env_add 1
-#endif /* GL_ARB_texture_env_add */
-
-#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_ARB_texture_env_crossbar
-#define GL_ARB_texture_env_crossbar 1
-#endif /* GL_ARB_texture_env_crossbar */
-
-#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_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_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_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_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_ARB_texture_multisample
-#define GL_ARB_texture_multisample 1
-#endif /* GL_ARB_texture_multisample */
-
-#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_ARB_texture_query_levels
-#define GL_ARB_texture_query_levels 1
-#endif /* GL_ARB_texture_query_levels */
-
-#ifndef GL_ARB_texture_query_lod
-#define GL_ARB_texture_query_lod 1
-#endif /* GL_ARB_texture_query_lod */
-
-#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_ARB_texture_rg
-#define GL_ARB_texture_rg 1
-#endif /* GL_ARB_texture_rg */
-
-#ifndef GL_ARB_texture_rgb10_a2ui
-#define GL_ARB_texture_rgb10_a2ui 1
-#endif /* GL_ARB_texture_rgb10_a2ui */
-
-#ifndef GL_ARB_texture_stencil8
-#define GL_ARB_texture_stencil8 1
-#endif /* GL_ARB_texture_stencil8 */
-
-#ifndef GL_ARB_texture_storage
-#define GL_ARB_texture_storage 1
-#endif /* GL_ARB_texture_storage */
-
-#ifndef GL_ARB_texture_storage_multisample
-#define GL_ARB_texture_storage_multisample 1
-#endif /* GL_ARB_texture_storage_multisample */
-
-#ifndef GL_ARB_texture_swizzle
-#define GL_ARB_texture_swizzle 1
-#endif /* GL_ARB_texture_swizzle */
-
-#ifndef GL_ARB_texture_view
-#define GL_ARB_texture_view 1
-#endif /* GL_ARB_texture_view */
-
-#ifndef GL_ARB_timer_query
-#define GL_ARB_timer_query 1
-#endif /* GL_ARB_timer_query */
-
-#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_ARB_transform_feedback3
-#define GL_ARB_transform_feedback3 1
-#endif /* GL_ARB_transform_feedback3 */
-
-#ifndef GL_ARB_transform_feedback_instanced
-#define GL_ARB_transform_feedback_instanced 1
-#endif /* GL_ARB_transform_feedback_instanced */
-
-#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_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_ARB_vertex_array_bgra
-#define GL_ARB_vertex_array_bgra 1
-#endif /* GL_ARB_vertex_array_bgra */
-
-#ifndef GL_ARB_vertex_array_object
-#define GL_ARB_vertex_array_object 1
-#endif /* GL_ARB_vertex_array_object */
-
-#ifndef GL_ARB_vertex_attrib_64bit
-#define GL_ARB_vertex_attrib_64bit 1
-#endif /* GL_ARB_vertex_attrib_64bit */
-
-#ifndef GL_ARB_vertex_attrib_binding
-#define GL_ARB_vertex_attrib_binding 1
-#endif /* GL_ARB_vertex_attrib_binding */
-
-#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_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_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_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_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_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_ARB_viewport_array
-#define GL_ARB_viewport_array 1
-#endif /* GL_ARB_viewport_array */
-
-#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_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_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_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_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_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_AMD_conservative_depth
-#define GL_AMD_conservative_depth 1
-#endif /* GL_AMD_conservative_depth */
-
-#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_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_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_AMD_gcn_shader
-#define GL_AMD_gcn_shader 1
-#endif /* GL_AMD_gcn_shader */
-
-#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_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_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_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_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_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_AMD_pinned_memory
-#define GL_AMD_pinned_memory 1
-#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160
-#endif /* GL_AMD_pinned_memory */
-
-#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_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_AMD_seamless_cubemap_per_texture
-#define GL_AMD_seamless_cubemap_per_texture 1
-#endif /* GL_AMD_seamless_cubemap_per_texture */
-
-#ifndef GL_AMD_shader_atomic_counter_ops
-#define GL_AMD_shader_atomic_counter_ops 1
-#endif /* GL_AMD_shader_atomic_counter_ops */
-
-#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_AMD_texture_texture4
-#define GL_AMD_texture_texture4 1
-#endif /* GL_AMD_texture_texture4 */
-
-#ifndef GL_AMD_transform_feedback3_lines_triangles
-#define GL_AMD_transform_feedback3_lines_triangles 1
-#endif /* GL_AMD_transform_feedback3_lines_triangles */
-
-#ifndef GL_AMD_transform_feedback4
-#define GL_AMD_transform_feedback4 1
-#define GL_STREAM_RASTERIZATION_AMD 0x91A0
-#endif /* GL_AMD_transform_feedback4 */
-
-#ifndef GL_AMD_vertex_shader_layer
-#define GL_AMD_vertex_shader_layer 1
-#endif /* GL_AMD_vertex_shader_layer */
-
-#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_AMD_vertex_shader_viewport_index
-#define GL_AMD_vertex_shader_viewport_index 1
-#endif /* GL_AMD_vertex_shader_viewport_index */
-
-#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_APPLE_client_storage
-#define GL_APPLE_client_storage 1
-#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
-#endif /* GL_APPLE_client_storage */
-
-#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_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_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_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_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_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_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_APPLE_specular_vector
-#define GL_APPLE_specular_vector 1
-#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
-#endif /* GL_APPLE_specular_vector */
-
-#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_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_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_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_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_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
-#define GL_BUMP_TEX_UNITS_ATI 0x8778
-#define GL_DUDV_ATI 0x8779
-#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
-#define GL_REG_2_ATI 0x8923
-#define GL_REG_3_ATI 0x8924
-#define GL_REG_4_ATI 0x8925
-#define GL_REG_5_ATI 0x8926
-#define GL_REG_6_ATI 0x8927
-#define GL_REG_7_ATI 0x8928
-#define GL_REG_8_ATI 0x8929
-#define GL_REG_9_ATI 0x892A
-#define GL_REG_10_ATI 0x892B
-#define GL_REG_11_ATI 0x892C
-#define GL_REG_12_ATI 0x892D
-#define GL_REG_13_ATI 0x892E
-#define GL_REG_14_ATI 0x892F
-#define GL_REG_15_ATI 0x8930
-#define GL_REG_16_ATI 0x8931
-#define GL_REG_17_ATI 0x8932
-#define GL_REG_18_ATI 0x8933
-#define GL_REG_19_ATI 0x8934
-#define GL_REG_20_ATI 0x8935
-#define GL_REG_21_ATI 0x8936
-#define GL_REG_22_ATI 0x8937
-#define GL_REG_23_ATI 0x8938
-#define GL_REG_24_ATI 0x8939
-#define GL_REG_25_ATI 0x893A
-#define GL_REG_26_ATI 0x893B
-#define GL_REG_27_ATI 0x893C
-#define GL_REG_28_ATI 0x893D
-#define GL_REG_29_ATI 0x893E
-#define GL_REG_30_ATI 0x893F
-#define GL_REG_31_ATI 0x8940
-#define GL_CON_0_ATI 0x8941
-#define GL_CON_1_ATI 0x8942
-#define GL_CON_2_ATI 0x8943
-#define GL_CON_3_ATI 0x8944
-#define GL_CON_4_ATI 0x8945
-#define GL_CON_5_ATI 0x8946
-#define GL_CON_6_ATI 0x8947
-#define GL_CON_7_ATI 0x8948
-#define GL_CON_8_ATI 0x8949
-#define GL_CON_9_ATI 0x894A
-#define GL_CON_10_ATI 0x894B
-#define GL_CON_11_ATI 0x894C
-#define GL_CON_12_ATI 0x894D
-#define GL_CON_13_ATI 0x894E
-#define GL_CON_14_ATI 0x894F
-#define GL_CON_15_ATI 0x8950
-#define GL_CON_16_ATI 0x8951
-#define GL_CON_17_ATI 0x8952
-#define GL_CON_18_ATI 0x8953
-#define GL_CON_19_ATI 0x8954
-#define GL_CON_20_ATI 0x8955
-#define GL_CON_21_ATI 0x8956
-#define GL_CON_22_ATI 0x8957
-#define GL_CON_23_ATI 0x8958
-#define GL_CON_24_ATI 0x8959
-#define GL_CON_25_ATI 0x895A
-#define GL_CON_26_ATI 0x895B
-#define GL_CON_27_ATI 0x895C
-#define GL_CON_28_ATI 0x895D
-#define GL_CON_29_ATI 0x895E
-#define GL_CON_30_ATI 0x895F
-#define GL_CON_31_ATI 0x8960
-#define GL_MOV_ATI 0x8961
-#define GL_ADD_ATI 0x8963
-#define GL_MUL_ATI 0x8964
-#define GL_SUB_ATI 0x8965
-#define GL_DOT3_ATI 0x8966
-#define GL_DOT4_ATI 0x8967
-#define GL_MAD_ATI 0x8968
-#define GL_LERP_ATI 0x8969
-#define GL_CND_ATI 0x896A
-#define GL_CND0_ATI 0x896B
-#define GL_DOT2_ADD_ATI 0x896C
-#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D
-#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E
-#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F
-#define GL_NUM_PASSES_ATI 0x8970
-#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971
-#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972
-#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
-#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974
-#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975
-#define GL_SWIZZLE_STR_ATI 0x8976
-#define GL_SWIZZLE_STQ_ATI 0x8977
-#define GL_SWIZZLE_STR_DR_ATI 0x8978
-#define GL_SWIZZLE_STQ_DQ_ATI 0x8979
-#define GL_SWIZZLE_STRQ_ATI 0x897A
-#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B
-#define GL_RED_BIT_ATI 0x00000001
-#define GL_GREEN_BIT_ATI 0x00000002
-#define GL_BLUE_BIT_ATI 0x00000004
-#define GL_2X_BIT_ATI 0x00000001
-#define GL_4X_BIT_ATI 0x00000002
-#define GL_8X_BIT_ATI 0x00000004
-#define GL_HALF_BIT_ATI 0x00000008
-#define GL_QUARTER_BIT_ATI 0x00000010
-#define GL_EIGHTH_BIT_ATI 0x00000020
-#define GL_SATURATE_BIT_ATI 0x00000040
-#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
-#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3
-#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4
-#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5
-#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
-#define GL_DISCARD_ATI 0x8763
-#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764
-#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_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
-#define GL_VERTEX_STREAM2_ATI 0x876E
-#define GL_VERTEX_STREAM3_ATI 0x876F
-#define GL_VERTEX_STREAM4_ATI 0x8770
-#define GL_VERTEX_STREAM5_ATI 0x8771
-#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_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_EXT_abgr
-#define GL_EXT_abgr 1
-#define GL_ABGR_EXT 0x8000
-#endif /* GL_EXT_abgr */
-
-#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_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_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_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_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_EXT_blend_logic_op
-#define GL_EXT_blend_logic_op 1
-#endif /* GL_EXT_blend_logic_op */
-
-#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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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
-#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
-#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
-#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
-#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
-#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
-#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
-#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
-#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
-#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
-#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
-#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
-#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
-#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
-#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
-#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
-#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
-#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
-#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
-#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
-#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
-#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
-#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
-#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
-#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
-#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
-#define GL_FRAMEBUFFER_EXT 0x8D40
-#define GL_RENDERBUFFER_EXT 0x8D41
-#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
-#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
-#define GL_STENCIL_INDEX1_EXT 0x8D46
-#define GL_STENCIL_INDEX4_EXT 0x8D47
-#define GL_STENCIL_INDEX8_EXT 0x8D48
-#define GL_STENCIL_INDEX16_EXT 0x8D49
-#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
-#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_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_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_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
-#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_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
-#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3
-#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4
-#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5
-#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6
-#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7
-#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8
-#define GL_INT_SAMPLER_1D_EXT 0x8DC9
-#define GL_INT_SAMPLER_2D_EXT 0x8DCA
-#define GL_INT_SAMPLER_3D_EXT 0x8DCB
-#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC
-#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD
-#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE
-#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF
-#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0
-#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1
-#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2
-#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4
-#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5
-#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_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_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_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_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_index_texture
-#define GL_EXT_index_texture 1
-#endif /* GL_EXT_index_texture */
-
-#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_EXT_misc_attribute
-#define GL_EXT_misc_attribute 1
-#endif /* GL_EXT_misc_attribute */
-
-#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_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_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_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_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_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_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_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_EXT_pixel_transform_color_table
-#define GL_EXT_pixel_transform_color_table 1
-#endif /* GL_EXT_pixel_transform_color_table */
-
-#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_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_rescale_normal
-#define GL_EXT_rescale_normal 1
-#define GL_RESCALE_NORMAL_EXT 0x803A
-#endif /* GL_EXT_rescale_normal */
-
-#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_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_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
-#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B
-#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C
-#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D
-#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E
-#define GL_IMAGE_1D_EXT 0x904C
-#define GL_IMAGE_2D_EXT 0x904D
-#define GL_IMAGE_3D_EXT 0x904E
-#define GL_IMAGE_2D_RECT_EXT 0x904F
-#define GL_IMAGE_CUBE_EXT 0x9050
-#define GL_IMAGE_BUFFER_EXT 0x9051
-#define GL_IMAGE_1D_ARRAY_EXT 0x9052
-#define GL_IMAGE_2D_ARRAY_EXT 0x9053
-#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054
-#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055
-#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056
-#define GL_INT_IMAGE_1D_EXT 0x9057
-#define GL_INT_IMAGE_2D_EXT 0x9058
-#define GL_INT_IMAGE_3D_EXT 0x9059
-#define GL_INT_IMAGE_2D_RECT_EXT 0x905A
-#define GL_INT_IMAGE_CUBE_EXT 0x905B
-#define GL_INT_IMAGE_BUFFER_EXT 0x905C
-#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D
-#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E
-#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F
-#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060
-#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061
-#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062
-#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063
-#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064
-#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065
-#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066
-#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067
-#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068
-#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069
-#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C
-#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D
-#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E
-#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001
-#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002
-#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004
-#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008
-#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020
-#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040
-#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080
-#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100
-#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200
-#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400
-#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800
-#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000
-#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF
-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 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_EXT_shader_integer_mix
-#define GL_EXT_shader_integer_mix 1
-#endif /* GL_EXT_shader_integer_mix */
-
-#ifndef GL_EXT_shadow_funcs
-#define GL_EXT_shadow_funcs 1
-#endif /* GL_EXT_shadow_funcs */
-
-#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_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 glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag);
-#endif
-#endif /* GL_EXT_stencil_clear_tag */
-
-#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 void APIENTRY glActiveStencilFaceEXT (GLenum face);
-#endif
-#endif /* GL_EXT_stencil_two_side */
-
-#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_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 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
-#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 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_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_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 glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer);
-#endif
-#endif /* GL_EXT_texture_buffer_object */
-
-#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_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_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_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_EXT_texture_env_add
-#define GL_EXT_texture_env_add 1
-#endif /* GL_EXT_texture_env_add */
-
-#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_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_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 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_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_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);
-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
-#endif /* GL_EXT_texture_object */
-
-#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 glTextureNormalEXT (GLenum mode);
-#endif
-#endif /* GL_EXT_texture_perturb_normal */
-
-#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_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_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_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 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_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
-#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 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, 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 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_EXT_vertex_array_bgra
-#define GL_EXT_vertex_array_bgra 1
-#endif /* GL_EXT_vertex_array_bgra */
-
-#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 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_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 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_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 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_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 GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
-#endif
-#endif /* GL_EXT_x11_sync_object */
-
-#ifndef GL_GREMEDY_frame_terminator
-#define GL_GREMEDY_frame_terminator 1
-typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFrameTerminatorGREMEDY (void);
-#endif
-#endif /* GL_GREMEDY_frame_terminator */
-
-#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 glStringMarkerGREMEDY (GLsizei len, const void *string);
-#endif
-#endif /* GL_GREMEDY_string_marker */
-
-#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
-#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);
-#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
-#endif /* GL_HP_image_transform */
-
-#ifndef GL_HP_occlusion_test
-#define GL_HP_occlusion_test 1
-#define GL_OCCLUSION_TEST_HP 0x8165
-#define GL_OCCLUSION_TEST_RESULT_HP 0x8166
-#endif /* GL_HP_occlusion_test */
-
-#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_IBM_cull_vertex
-#define GL_IBM_cull_vertex 1
-#define GL_CULL_VERTEX_IBM 103050
-#endif /* GL_IBM_cull_vertex */
-
-#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 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_IBM_rasterpos_clip
-#define GL_IBM_rasterpos_clip 1
-#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262
-#endif /* GL_IBM_rasterpos_clip */
-
-#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 glFlushStaticDataIBM (GLenum target);
-#endif
-#endif /* GL_IBM_static_data */
-
-#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_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
-#endif /* GL_INGR_blend_func_separate */
-
-#ifndef GL_INGR_color_clamp
-#define GL_INGR_color_clamp 1
-#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
-#define GL_INTERLACE_READ_INGR 0x8568
-#endif /* GL_INGR_interlace_read */
-
-#ifndef GL_INTEL_fragment_shader_ordering
-#define GL_INTEL_fragment_shader_ordering 1
-#endif /* GL_INTEL_fragment_shader_ordering */
-
-#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 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_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_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_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
-#endif /* GL_MESA_resize_buffers */
-
-#ifndef GL_MESA_window_pos
-#define GL_MESA_window_pos 1
-typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
-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);
-#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
-#endif /* GL_MESA_window_pos */
-
-#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_NV_blend_square
-#define GL_NV_blend_square 1
-#endif /* GL_NV_blend_square */
-
-#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_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 glBeginConditionalRenderNV (GLuint id, GLenum mode);
-GLAPI void APIENTRY glEndConditionalRenderNV (void);
-#endif
-#endif /* GL_NV_conditional_render */
-
-#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_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 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_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_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_NV_depth_clamp
-#define GL_NV_depth_clamp 1
-#define GL_DEPTH_CLAMP_NV 0x864F
-#endif /* GL_NV_depth_clamp */
-
-#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 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
-#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, 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);
-#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 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_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 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_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 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_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_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_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 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_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_NV_fragment_program4
-#define GL_NV_fragment_program4 1
-#endif /* GL_NV_fragment_program4 */
-
-#ifndef GL_NV_fragment_program_option
-#define GL_NV_fragment_program_option 1
-#endif /* GL_NV_fragment_program_option */
-
-#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 glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
-#endif
-#endif /* GL_NV_framebuffer_multisample_coverage */
-
-#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 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_NV_geometry_shader4
-#define GL_NV_geometry_shader4 1
-#endif /* GL_NV_geometry_shader4 */
-
-#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 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_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 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_gpu_program5_mem_extended
-#define GL_NV_gpu_program5_mem_extended 1
-#endif /* GL_NV_gpu_program5_mem_extended */
-
-#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);
-GLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z);
-GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
-GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
-GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s);
-GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t);
-GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r);
-GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s);
-GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v);
-GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t);
-GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v);
-GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
-GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v);
-GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v);
-GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog);
-GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog);
-GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight);
-GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight);
-GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x);
-GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y);
-GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
-GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
-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
-#endif /* GL_NV_half_float */
-
-#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 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_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 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_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_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_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 void APIENTRY glPointParameteriNV (GLenum pname, GLint param);
-GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params);
-#endif
-#endif /* GL_NV_point_sprite */
-
-#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 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_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 glPrimitiveRestartNV (void);
-GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index);
-#endif
-#endif /* GL_NV_primitive_restart */
-
-#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_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 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_NV_shader_atomic_counters
-#define GL_NV_shader_atomic_counters 1
-#endif /* GL_NV_shader_atomic_counters */
-
-#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 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_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_NV_shader_storage_buffer_object
-#define GL_NV_shader_storage_buffer_object 1
-#endif /* GL_NV_shader_storage_buffer_object */
-
-#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_shader_thread_shuffle
-#define GL_NV_shader_thread_shuffle 1
-#endif /* GL_NV_shader_thread_shuffle */
-
-#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_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_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_NV_texture_barrier
-#define GL_NV_texture_barrier 1
-typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureBarrierNV (void);
-#endif
-#endif /* GL_NV_texture_barrier */
-
-#ifndef GL_NV_texture_compression_vtc
-#define GL_NV_texture_compression_vtc 1
-#endif /* GL_NV_texture_compression_vtc */
-
-#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_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_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_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_NV_texture_shader2
-#define GL_NV_texture_shader2 1
-#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF
-#endif /* GL_NV_texture_shader2 */
-
-#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_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 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_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 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_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 glFlushVertexArrayRangeNV (void);
-GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const void *pointer);
-#endif
-#endif /* GL_NV_vertex_array_range */
-
-#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 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_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 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_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 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);
-GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x);
-GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y);
-GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z);
-GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v);
-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 void *pointer);
-GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params);
-#endif
-#endif /* GL_NV_vertex_program4 */
-
-#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 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_OML_interlace
-#define GL_OML_interlace 1
-#define GL_INTERLACE_OML 0x8980
-#define GL_INTERLACE_READ_OML 0x8981
-#endif /* GL_OML_interlace */
-
-#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_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_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 glHintPGI (GLenum target, GLint mode);
-#endif
-#endif /* GL_PGI_misc_hints */
-
-#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_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_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_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 glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);
-GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points);
-#endif
-#endif /* GL_SGIS_detail_texture */
-
-#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 glFogFuncSGIS (GLsizei n, const GLfloat *points);
-GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points);
-#endif
-#endif /* GL_SGIS_fog_function */
-
-#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_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 glSampleMaskSGIS (GLclampf value, GLboolean invert);
-GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern);
-#endif
-#endif /* GL_SGIS_multisample */
-
-#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 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_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_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 glPointParameterfSGIS (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params);
-#endif
-#endif /* GL_SGIS_point_parameters */
-
-#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 glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);
-GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points);
-#endif
-#endif /* GL_SGIS_sharpen_texture */
-
-#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 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_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_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 glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-#endif
-#endif /* GL_SGIS_texture_color_mask */
-
-#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_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 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_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_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_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 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_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_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_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_SGIX_calligraphic_fragment
-#define GL_SGIX_calligraphic_fragment 1
-#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183
-#endif /* GL_SGIX_calligraphic_fragment */
-
-#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_SGIX_convolution_accuracy
-#define GL_SGIX_convolution_accuracy 1
-#define GL_CONVOLUTION_HINT_SGIX 0x8316
-#endif /* GL_SGIX_convolution_accuracy */
-
-#ifndef GL_SGIX_depth_pass_instrument
-#define GL_SGIX_depth_pass_instrument 1
-#endif /* GL_SGIX_depth_pass_instrument */
-
-#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_SGIX_flush_raster
-#define GL_SGIX_flush_raster 1
-typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFlushRasterSGIX (void);
-#endif
-#endif /* GL_SGIX_flush_raster */
-
-#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_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 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_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_SGIX_igloo_interface
-#define GL_SGIX_igloo_interface 1
-typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const void *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const void *params);
-#endif
-#endif /* GL_SGIX_igloo_interface */
-
-#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_SGIX_interlace
-#define GL_SGIX_interlace 1
-#define GL_INTERLACE_SGIX 0x8094
-#endif /* GL_SGIX_interlace */
-
-#ifndef GL_SGIX_ir_instrument1
-#define GL_SGIX_ir_instrument1 1
-#define GL_IR_INSTRUMENT1_SGIX 0x817F
-#endif /* GL_SGIX_ir_instrument1 */
-
-#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 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_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 glPixelTexGenSGIX (GLenum mode);
-#endif
-#endif /* GL_SGIX_pixel_texture */
-
-#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_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 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_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 glReferencePlaneSGIX (const GLdouble *equation);
-#endif
-#endif /* GL_SGIX_reference_plane */
-
-#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_SGIX_scalebias_hint
-#define GL_SGIX_scalebias_hint 1
-#define GL_SCALEBIAS_HINT_SGIX 0x8322
-#endif /* GL_SGIX_scalebias_hint */
-
-#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_SGIX_shadow_ambient
-#define GL_SGIX_shadow_ambient 1
-#define GL_SHADOW_AMBIENT_SGIX 0x80BF
-#endif /* GL_SGIX_shadow_ambient */
-
-#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 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_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_SGIX_tag_sample_buffer
-#define GL_SGIX_tag_sample_buffer 1
-typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTagSampleBufferSGIX (void);
-#endif
-#endif /* GL_SGIX_tag_sample_buffer */
-
-#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_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_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_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 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_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_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 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_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 glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width);
-#endif
-#endif /* GL_SUN_mesh_array */
-
-#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 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_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
-}
-#endif
-
-#endif
diff --git a/src/SFML/Window/glext/wglext.h b/src/SFML/Window/glext/wglext.h
deleted file mode 100644
index e9648c3..0000000
--- a/src/SFML/Window/glext/wglext.h
+++ /dev/null
@@ -1,833 +0,0 @@
-#ifndef __wglext_h_
-#define __wglext_h_ 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** 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
-** 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.
-*/
-/*
-** 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
-
-#define WGL_WGLEXT_VERSION 20140416
-
-/* 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_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_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
-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_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 /* 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_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
-#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
-const char *WINAPI wglGetExtensionsStringARB (HDC hdc);
-#endif
-#endif /* WGL_ARB_extensions_string */
-
-#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
-#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
-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
-#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_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_robustness_share_group_isolation
-#define WGL_ARB_robustness_share_group_isolation 1
-#endif /* WGL_ARB_robustness_share_group_isolation */
-
-#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
-BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState);
-#endif
-#endif /* WGL_3DL_stereo_control */
-
-#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_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
-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
-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
-#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
-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
-#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
-typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
-typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
-#ifdef WGL_WGLEXT_PROTOTYPES
-BOOL WINAPI wglSwapIntervalEXT (int interval);
-int WINAPI wglGetSwapIntervalEXT (void);
-#endif
-#endif /* WGL_EXT_swap_control */
-
-#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
-#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
-#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
-#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);
-typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
-typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
-typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
-typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
-typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
-typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
-typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
-typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
-typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
-#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
-#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
-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
-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_NV_DX_interop2
-#define WGL_NV_DX_interop2 1
-#endif /* WGL_NV_DX_interop2 */
-
-#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_NV_delay_before_swap
-#define WGL_NV_delay_before_swap 1
-typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds);
-#ifdef WGL_WGLEXT_PROTOTYPES
-BOOL WINAPI wglDelayBeforeSwapNV (HDC hDC, GLfloat seconds);
-#endif
-#endif /* WGL_NV_delay_before_swap */
-
-#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_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
-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);
-#ifdef WGL_WGLEXT_PROTOTYPES
-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
-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);
-#ifdef WGL_WGLEXT_PROTOTYPES
-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_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
-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
-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);
-#ifdef WGL_WGLEXT_PROTOTYPES
-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_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
-}
-#endif
-
-#endif
diff --git a/src/SFML/Window/iOS/EaglContext.hpp b/src/SFML/Window/iOS/EaglContext.hpp
index dfdeae4..1ad457f 100644
--- a/src/SFML/Window/iOS/EaglContext.hpp
+++ b/src/SFML/Window/iOS/EaglContext.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/iOS/EaglContext.mm b/src/SFML/Window/iOS/EaglContext.mm
index 450c9e6..380c139 100644
--- a/src/SFML/Window/iOS/EaglContext.mm
+++ b/src/SFML/Window/iOS/EaglContext.mm
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -132,13 +132,15 @@ void EaglContext::recreateRenderBuffers(SFView* glView)
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);
+ 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;
+ GLenum format = m_settings.depthBits > 16
+ ? (m_settings.stencilBits == 0 ? GL_DEPTH_COMPONENT24_OES : GL_DEPTH24_STENCIL8_OES)
+ : GL_DEPTH_COMPONENT16_OES;
// Get the size of the color-buffer (which fits the current size of the GL view)
GLint width, height;
@@ -150,6 +152,8 @@ void EaglContext::recreateRenderBuffers(SFView* glView)
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);
+ if (m_settings.stencilBits > 0)
+ glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_STENCIL_ATTACHMENT_OES, GL_RENDERBUFFER_OES, m_depthbuffer);
}
// Make sure that everything's ok
diff --git a/src/SFML/Window/iOS/InputImpl.hpp b/src/SFML/Window/iOS/InputImpl.hpp
index 1c01fa3..43733cb 100644
--- a/src/SFML/Window/iOS/InputImpl.hpp
+++ b/src/SFML/Window/iOS/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-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/iOS/InputImpl.mm b/src/SFML/Window/iOS/InputImpl.mm
index 35b61e5..b8dd103 100644
--- a/src/SFML/Window/iOS/InputImpl.mm
+++ b/src/SFML/Window/iOS/InputImpl.mm
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/iOS/JoystickImpl.hpp b/src/SFML/Window/iOS/JoystickImpl.hpp
index a0890c8..59f31f2 100644
--- a/src/SFML/Window/iOS/JoystickImpl.hpp
+++ b/src/SFML/Window/iOS/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-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/iOS/JoystickImpl.mm b/src/SFML/Window/iOS/JoystickImpl.mm
index 9fc45e9..6821e03 100644
--- a/src/SFML/Window/iOS/JoystickImpl.mm
+++ b/src/SFML/Window/iOS/JoystickImpl.mm
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/iOS/ObjCType.hpp b/src/SFML/Window/iOS/ObjCType.hpp
index 29283e4..5b111d5 100644
--- a/src/SFML/Window/iOS/ObjCType.hpp
+++ b/src/SFML/Window/iOS/ObjCType.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/iOS/SFAppDelegate.hpp b/src/SFML/Window/iOS/SFAppDelegate.hpp
index 77f1a63..cd20bfc 100644
--- a/src/SFML/Window/iOS/SFAppDelegate.hpp
+++ b/src/SFML/Window/iOS/SFAppDelegate.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -101,10 +101,33 @@
- (void)notifyCharacter:(sf::Uint32)character;
////////////////////////////////////////////////////////////
+/// \brief Tells if the dimensions of the current window must be flipped when switching to a given orientation
+///
+/// \param orientation the device has changed to
+///
+////////////////////////////////////////////////////////////
+- (bool)needsToFlipFrameForOrientation:(UIDeviceOrientation)orientation;
+
+////////////////////////////////////////////////////////////
+/// \brief Tells if app and view support a requested device orientation or not
+///
+/// \param orientation the device has changed to
+///
+////////////////////////////////////////////////////////////
+- (bool)supportsOrientation:(UIDeviceOrientation)orientation;
+
+////////////////////////////////////////////////////////////
+/// \brief Initializes the factor which is required to convert from points to pixels and back
+///
+////////////////////////////////////////////////////////////
+- (void)initBackingScale;
+
+////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
@property (nonatomic) sf::priv::WindowImplUIKit* sfWindow; ///< Main window of the application
@property (readonly, nonatomic) CMMotionManager* motionManager; ///< Instance of the motion manager
+@property (nonatomic) CGFloat backingScaleFactor;
@end
diff --git a/src/SFML/Window/iOS/SFAppDelegate.mm b/src/SFML/Window/iOS/SFAppDelegate.mm
index f63060b..5908b4e 100644
--- a/src/SFML/Window/iOS/SFAppDelegate.mm
+++ b/src/SFML/Window/iOS/SFAppDelegate.mm
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -50,17 +50,18 @@ namespace
@implementation SFAppDelegate
@synthesize sfWindow;
+@synthesize backingScaleFactor;
////////////////////////////////////////////////////////////
-+(SFAppDelegate*)getInstance
++ (SFAppDelegate*)getInstance
{
return delegateInstance;
}
////////////////////////////////////////////////////////////
--(void)runUserMain
+- (void)runUserMain
{
// Arguments intentionally dropped, see comments in main in sfml-main
sfmlMain(0, NULL);
@@ -73,6 +74,8 @@ namespace
// Save the delegate instance
delegateInstance = self;
+ [self initBackingScale];
+
// Instantiate the motion manager
self.motionManager = [[CMMotionManager alloc] init];
@@ -90,6 +93,14 @@ namespace
return true;
}
+- (void)initBackingScale
+{
+ id data = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSHighResolutionCapable"];
+ if(data && [data boolValue])
+ backingScaleFactor = [[UIScreen mainScreen] scale];
+ else
+ backingScaleFactor = 1;
+}
////////////////////////////////////////////////////////////
- (void)applicationWillResignActive:(UIApplication *)application
@@ -151,6 +162,38 @@ namespace
}
}
+- (bool)supportsOrientation:(UIDeviceOrientation)orientation
+{
+ if (!self.sfWindow)
+ return false;
+
+ UIViewController* rootViewController = [((__bridge UIWindow*)(self.sfWindow->getSystemHandle())) rootViewController];
+ if (!rootViewController || ![rootViewController shouldAutorotate])
+ return false;
+
+ NSArray *supportedOrientations = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UISupportedInterfaceOrientations"];
+ if (!supportedOrientations)
+ return false;
+
+ int appFlags = 0;
+ if ([supportedOrientations containsObject:@"UIInterfaceOrientationPortrait"])
+ appFlags += UIInterfaceOrientationMaskPortrait;
+ if ([supportedOrientations containsObject:@"UIInterfaceOrientationPortraitUpsideDown"])
+ appFlags += UIInterfaceOrientationMaskPortraitUpsideDown;
+ if ([supportedOrientations containsObject:@"UIInterfaceOrientationLandscapeLeft"])
+ appFlags += UIInterfaceOrientationMaskLandscapeLeft;
+ if ([supportedOrientations containsObject:@"UIInterfaceOrientationLandscapeRight"])
+ appFlags += UIInterfaceOrientationMaskLandscapeRight;
+
+ return (1 << orientation) & [rootViewController supportedInterfaceOrientations] & appFlags;
+}
+
+- (bool)needsToFlipFrameForOrientation:(UIDeviceOrientation)orientation
+{
+ sf::Vector2u size = self.sfWindow->getSize();
+ return ((!UIDeviceOrientationIsLandscape(orientation) && size.x > size.y)
+ || (UIDeviceOrientationIsLandscape(orientation) && size.y > size.x));
+}
////////////////////////////////////////////////////////////
- (void)deviceOrientationDidChange:(NSNotification *)notification
@@ -159,23 +202,20 @@ namespace
{
// Get the new orientation
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
-
// Filter interesting orientations
- if ((orientation == UIDeviceOrientationLandscapeLeft) ||
- (orientation == UIDeviceOrientationLandscapeRight) ||
- (orientation == UIDeviceOrientationPortrait) ||
- (orientation == UIDeviceOrientationPortraitUpsideDown))
+ if (UIDeviceOrientationIsValidInterfaceOrientation(orientation))
{
// Get the new size
sf::Vector2u size = self.sfWindow->getSize();
- if (UIDeviceOrientationIsLandscape(orientation))
+ // Check if the app can switch to this orientation and if so if the window's size must be adjusted
+ if ([self supportsOrientation:orientation] && [self needsToFlipFrameForOrientation: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;
+ event.size.width = size.x * backingScaleFactor;
+ event.size.height = size.y * backingScaleFactor;
sfWindow->forwardEvent(event);
}
}
@@ -202,6 +242,9 @@ namespace
////////////////////////////////////////////////////////////
- (void)notifyTouchBegin:(unsigned int)index atPosition:(sf::Vector2i)position;
{
+ position.x *= backingScaleFactor;
+ position.y *= backingScaleFactor;
+
// save the touch position
if (index >= touchPositions.size())
touchPositions.resize(index + 1, sf::Vector2i(-1, -1));
@@ -223,6 +266,9 @@ namespace
////////////////////////////////////////////////////////////
- (void)notifyTouchMove:(unsigned int)index atPosition:(sf::Vector2i)position;
{
+ position.x *= backingScaleFactor;
+ position.y *= backingScaleFactor;
+
// save the touch position
if (index >= touchPositions.size())
touchPositions.resize(index + 1, sf::Vector2i(-1, -1));
@@ -254,8 +300,8 @@ namespace
sf::Event event;
event.type = sf::Event::TouchEnded;
event.touch.finger = index;
- event.touch.x = position.x;
- event.touch.y = position.y;
+ event.touch.x = position.x * backingScaleFactor;
+ event.touch.y = position.y * backingScaleFactor;
sfWindow->forwardEvent(event);
}
}
diff --git a/src/SFML/Window/iOS/SFMain.hpp b/src/SFML/Window/iOS/SFMain.hpp
index e80d820..f52857b 100644
--- a/src/SFML/Window/iOS/SFMain.hpp
+++ b/src/SFML/Window/iOS/SFMain.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/iOS/SFMain.mm b/src/SFML/Window/iOS/SFMain.mm
index 7d793a3..0e9d481 100644
--- a/src/SFML/Window/iOS/SFMain.mm
+++ b/src/SFML/Window/iOS/SFMain.mm
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/iOS/SFView.hpp b/src/SFML/Window/iOS/SFView.hpp
index 1720a60..4804797 100644
--- a/src/SFML/Window/iOS/SFView.hpp
+++ b/src/SFML/Window/iOS/SFView.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -47,7 +47,7 @@
/// \return Id of the view
///
////////////////////////////////////////////////////////////
--(id)initWithFrame:(CGRect)frame;
+- (id)initWithFrame:(CGRect)frame andContentScaleFactor:(CGFloat)factor;
////////////////////////////////////////////////////////////
// Member data
diff --git a/src/SFML/Window/iOS/SFView.mm b/src/SFML/Window/iOS/SFView.mm
index bac46c8..b818749 100644
--- a/src/SFML/Window/iOS/SFView.mm
+++ b/src/SFML/Window/iOS/SFView.mm
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -31,7 +31,6 @@
#include <QuartzCore/CAEAGLLayer.h>
#include <cstring>
-
@interface SFView()
@property (nonatomic) NSMutableArray* touches;
@@ -170,17 +169,19 @@
////////////////////////////////////////////////////////////
-+(Class)layerClass
++ (Class)layerClass
{
- return [CAEAGLLayer class];
+ return [CAEAGLLayer class];
}
-
////////////////////////////////////////////////////////////
--(id)initWithFrame:(CGRect)frame
+- (id)initWithFrame:(CGRect)frame andContentScaleFactor:(CGFloat)factor
{
- self = [super initWithFrame:frame];
- if (self)
+ self = [super initWithFrame:frame];
+
+ self.contentScaleFactor = factor;
+
+ if (self)
{
self.context = NULL;
self.touches = [NSMutableArray array];
@@ -198,7 +199,7 @@
self.multipleTouchEnabled = true;
}
- return self;
+ return self;
}
diff --git a/src/SFML/Window/iOS/SFViewController.hpp b/src/SFML/Window/iOS/SFViewController.hpp
index b65688f..ecc8476 100644
--- a/src/SFML/Window/iOS/SFViewController.hpp
+++ b/src/SFML/Window/iOS/SFViewController.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/iOS/SFViewController.mm b/src/SFML/Window/iOS/SFViewController.mm
index 748ced1..0142297 100644
--- a/src/SFML/Window/iOS/SFViewController.mm
+++ b/src/SFML/Window/iOS/SFViewController.mm
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,8 +36,6 @@
////////////////////////////////////////////////////////////
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
- (void)interfaceOrientation;
-
return self.orientationCanChange;
}
diff --git a/src/SFML/Window/iOS/SensorImpl.hpp b/src/SFML/Window/iOS/SensorImpl.hpp
index b9dd5c2..0e3f211 100644
--- a/src/SFML/Window/iOS/SensorImpl.hpp
+++ b/src/SFML/Window/iOS/SensorImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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/iOS/SensorImpl.mm b/src/SFML/Window/iOS/SensorImpl.mm
index 1278ee1..96e4c7a 100644
--- a/src/SFML/Window/iOS/SensorImpl.mm
+++ b/src/SFML/Window/iOS/SensorImpl.mm
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -138,7 +138,7 @@ Vector3f SensorImpl::update()
switch (m_sensor)
{
case Sensor::Accelerometer:
- // Acceleration is given in G, convert to m/sē
+ // Acceleration is given in G, convert to m/s^2
value.x = manager.accelerometerData.acceleration.x * 9.81f;
value.y = manager.accelerometerData.acceleration.y * 9.81f;
value.z = manager.accelerometerData.acceleration.z * 9.81f;
@@ -159,7 +159,7 @@ Vector3f SensorImpl::update()
break;
case Sensor::UserAcceleration:
- // User acceleration is given in G, convert to m/sē
+ // User acceleration is given in G, convert to m/s^2
value.x = manager.deviceMotion.userAcceleration.x * 9.81f;
value.y = manager.deviceMotion.userAcceleration.y * 9.81f;
value.z = manager.deviceMotion.userAcceleration.z * 9.81f;
diff --git a/src/SFML/Window/iOS/VideoModeImpl.mm b/src/SFML/Window/iOS/VideoModeImpl.mm
index 96adb7b..dd3d134 100644
--- a/src/SFML/Window/iOS/VideoModeImpl.mm
+++ b/src/SFML/Window/iOS/VideoModeImpl.mm
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,9 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window/VideoModeImpl.hpp>
+#include <SFML/Window/iOS/SFAppDelegate.hpp>
#include <UIKit/UIKit.h>
-
namespace sf
{
namespace priv
@@ -50,7 +50,8 @@ std::vector<VideoMode> VideoModeImpl::getFullscreenModes()
VideoMode VideoModeImpl::getDesktopMode()
{
CGRect bounds = [[UIScreen mainScreen] bounds];
- return VideoMode(bounds.size.width, bounds.size.height);
+ float backingScale = [SFAppDelegate getInstance].backingScaleFactor;
+ return VideoMode(bounds.size.width * backingScale, bounds.size.height * backingScale);
}
} // namespace priv
diff --git a/src/SFML/Window/iOS/WindowImplUIKit.hpp b/src/SFML/Window/iOS/WindowImplUIKit.hpp
index 5bb98ed..53c066e 100644
--- a/src/SFML/Window/iOS/WindowImplUIKit.hpp
+++ b/src/SFML/Window/iOS/WindowImplUIKit.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -215,6 +215,7 @@ private:
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
+ float m_backingScale; ///< Converts from points to pixels and vice versa
};
} // namespace priv
diff --git a/src/SFML/Window/iOS/WindowImplUIKit.mm b/src/SFML/Window/iOS/WindowImplUIKit.mm
index 4d401b8..3e7c833 100644
--- a/src/SFML/Window/iOS/WindowImplUIKit.mm
+++ b/src/SFML/Window/iOS/WindowImplUIKit.mm
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without 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,7 +33,6 @@
#include <SFML/System/Err.hpp>
#include <UIKit/UIKit.h>
-
namespace sf
{
namespace priv
@@ -51,6 +50,8 @@ WindowImplUIKit::WindowImplUIKit(VideoMode mode,
unsigned long style,
const ContextSettings& /*settings*/)
{
+ m_backingScale = [SFAppDelegate getInstance].backingScaleFactor;
+
// Apply the fullscreen flag
[UIApplication sharedApplication].statusBarHidden = !(style & Style::Titlebar) || (style & Style::Fullscreen);
@@ -68,8 +69,15 @@ WindowImplUIKit::WindowImplUIKit(VideoMode mode,
// Assign it to the application delegate
[SFAppDelegate getInstance].sfWindow = this;
+ CGRect viewRect = frame;
+ // if UI-orientation doesn't match window-layout, swap the view size and notify the window about it
+ // iOS 7 and 8 do different stuff here. In iOS 7 frame.x<frame.y always! In iOS 8 it correctly depends on orientation
+ if (NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_7_1)
+ if ((mode.width > mode.height) != (frame.size.width > frame.size.height))
+ std::swap(viewRect.size.width, viewRect.size.height);
+
// Create the view
- m_view = [[SFView alloc] initWithFrame:frame];
+ m_view = [[SFView alloc] initWithFrame:viewRect andContentScaleFactor:m_backingScale];
[m_view resignFirstResponder];
// Create the view controller
@@ -107,7 +115,8 @@ WindowHandle WindowImplUIKit::getSystemHandle() const
////////////////////////////////////////////////////////////
Vector2i WindowImplUIKit::getPosition() const
{
- return Vector2i(m_window.frame.origin.x, m_window.frame.origin.y);
+ CGPoint origin = m_window.frame.origin;
+ return Vector2i(origin.x * m_backingScale, origin.y * m_backingScale);
}
@@ -120,7 +129,12 @@ void WindowImplUIKit::setPosition(const Vector2i& position)
////////////////////////////////////////////////////////////
Vector2u WindowImplUIKit::getSize() const
{
- return Vector2u(m_window.frame.size.width, m_window.frame.size.height);
+ auto physicalFrame = m_window.frame;
+ // iOS 7 and 8 do different stuff here. In iOS 7 frame.x<frame.y always! In iOS 8 it correctly depends on orientation
+ if ((NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_7_1)
+ && UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]))
+ std::swap(physicalFrame.size.width, physicalFrame.size.height);
+ return Vector2u(physicalFrame.size.width * m_backingScale, physicalFrame.size.height * m_backingScale);
}
@@ -129,6 +143,10 @@ void WindowImplUIKit::setSize(const Vector2u& size)
{
// @todo ...
+ // if these sizes are required one day, don't forget to scale them!
+ // size.x /= m_backingScale;
+ // size.y /= m_backingScale;
+
// Set the orientation according to the requested size
if (size.x > size.y)
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft];
diff --git a/tools/android/compile_libs.sh b/tools/android/compile_libs.sh
index dbd3914..fa833fc 100755
--- a/tools/android/compile_libs.sh
+++ b/tools/android/compile_libs.sh
@@ -14,23 +14,23 @@ export LDFLAGS=$7
if [ "$1" = "arm" ]
then
- ARCH=arm-linux
- ANDROID_ABI=armeabi
+ ARCH=arm-linux
+ ANDROID_ABI=armeabi
elif [ "$1" = "arm-v7a" ]
then
- ARCH=arm-linux
- ANDROID_ABI=armeabi-v7a
+ ARCH=arm-linux
+ ANDROID_ABI=armeabi-v7a
elif [ "$1" = "x86" ]
then
- ARCH=i686-linux
- ANDROID_ABI=x86
+ ARCH=i686-linux
+ ANDROID_ABI=x86
elif [ "$1" = "mips" ]
then
- ARCH=mips-linux
- ANDROID_ABI=mips
+ ARCH=mips-linux
+ ANDROID_ABI=mips
fi
HOST="--host=$ARCH"
diff --git a/tools/android/create_toolchains.sh b/tools/android/create_toolchains.sh
index dc6ed4e..635d788 100755
--- a/tools/android/create_toolchains.sh
+++ b/tools/android/create_toolchains.sh
@@ -2,43 +2,43 @@
create_toolchain () {
- # abort if already created
- if [ -d "$PWD/toolchains/$2" ]
- then
- return
- fi
-
- # save the working directory and move to the NDK directory
- WORKING_DIRECTORY=$PWD
- cd $NDK
-
- # prepare the command according to chosen options
- PLATFORM=--platform=android-$1
- DIR=--install-dir=$WORKING_DIRECTORY/toolchains/$2
- MAKE=$NDK/build/tools/make-standalone-toolchain.sh
-
- if [ "$2" = "arm" ]
- then
- TOOLCHAIN=--toolchain=arm-linux-androideabi-4.8
- elif [ "$2" = "x86" ]
- then
- TOOLCHAIN=--toolchain=x86-4.8
- elif [ "$2" = "mips" ]
- then
- TOOLCHAIN=--toolchain=mipsel-linux-android-4.8
- else
- echo "Abort."
- exit 1
- fi
-
- # create the standalone toolchain
- $MAKE $PLATFORM $TOOLCHAIN $DIR --stl=libc++
-
- # go back to our working directory
- cd $WORKING_DIRECTORY
-
- # move linux/soundcard.h to sys/soundcard.h
- mv $PWD/toolchains/$2/sysroot/usr/include/linux/soundcard.h $PWD/toolchains/$2/sysroot/usr/include/sys
+ # abort if already created
+ if [ -d "$PWD/toolchains/$2" ]
+ then
+ return
+ fi
+
+ # save the working directory and move to the NDK directory
+ WORKING_DIRECTORY=$PWD
+ cd $NDK
+
+ # prepare the command according to chosen options
+ PLATFORM=--platform=android-$1
+ DIR=--install-dir=$WORKING_DIRECTORY/toolchains/$2
+ MAKE=$NDK/build/tools/make-standalone-toolchain.sh
+
+ if [ "$2" = "arm" ]
+ then
+ TOOLCHAIN=--toolchain=arm-linux-androideabi-4.8
+ elif [ "$2" = "x86" ]
+ then
+ TOOLCHAIN=--toolchain=x86-4.8
+ elif [ "$2" = "mips" ]
+ then
+ TOOLCHAIN=--toolchain=mipsel-linux-android-4.8
+ else
+ echo "Abort."
+ exit 1
+ fi
+
+ # create the standalone toolchain
+ $MAKE $PLATFORM $TOOLCHAIN $DIR --stl=libc++
+
+ # go back to our working directory
+ cd $WORKING_DIRECTORY
+
+ # move linux/soundcard.h to sys/soundcard.h
+ mv $PWD/toolchains/$2/sysroot/usr/include/linux/soundcard.h $PWD/toolchains/$2/sysroot/usr/include/sys
}
create_toolchain 9 arm
diff --git a/tools/android/download_sources.sh b/tools/android/download_sources.sh
index 2fc56a3..b85e776 100755
--- a/tools/android/download_sources.sh
+++ b/tools/android/download_sources.sh
@@ -22,43 +22,43 @@ mkdir build
wget -nc -P src http://downloads.xiph.org/releases/flac/$FLAC.tar.gz
if [ ! -d "$PWD/tmp/$FLAC" ]
then
- tar -C build -xf src/$FLAC.tar.gz
+ tar -C build -xf src/$FLAC.tar.gz
fi
wget -nc -P src http://downloads.xiph.org/releases/vorbis/$VORBIS.tar.gz
if [ ! -d "$PWD/tmp/$VORBIS" ]
then
- tar -C build -xf src/$VORBIS.tar.gz
+ tar -C build -xf src/$VORBIS.tar.gz
fi
wget -nc -P src http://downloads.xiph.org/releases/ogg/$OGG.tar.gz
if [ ! -d "$PWD/tmp/$OGG" ]
then
- tar -C build -xf src/$OGG.tar.gz
+ tar -C build -xf src/$OGG.tar.gz
fi
wget -nc -P src http://www.mega-nerd.com/libsndfile/files/$SNDFILE.tar.gz
if [ ! -d "$PWD/tmp/$SNDFILE" ]
then
- tar -C build -xf src/$SNDFILE.tar.gz
+ tar -C build -xf src/$SNDFILE.tar.gz
fi
wget -nc -P src http://www.ijg.org/files/jpegsrc.v$JPEG_VERSION.tar.gz
if [ ! -d "$PWD/tmp/$JPEG" ]
then
- tar -C build -xf src/jpegsrc.v$JPEG_VERSION.tar.gz
+ tar -C build -xf src/jpegsrc.v$JPEG_VERSION.tar.gz
fi
wget -nc -P src http://download.savannah.gnu.org/releases/freetype/$FREETYPE.tar.gz
if [ ! -d "$PWD/tmp/$FREETYPE" ]
then
- tar -C build -xf src/$FREETYPE.tar.gz
+ tar -C build -xf src/$FREETYPE.tar.gz
fi
wget -nc -P src https://github.com/AerialX/openal-soft-android/archive/master.tar.gz
if [ ! -d "$PWD/tmp/openal-soft-android-master" ]
then
- tar -C build -xf src/master.tar.gz
+ tar -C build -xf src/master.tar.gz
fi
patch build/openal-soft-android-master/CMakeLists.txt patches/remove-so-version-suffix.diff
diff --git a/tools/android/make_all.sh b/tools/android/make_all.sh
index 2281aa2..d7d3517 100755
--- a/tools/android/make_all.sh
+++ b/tools/android/make_all.sh
@@ -3,9 +3,9 @@
# Abort if no known installation of NDK
if [ "$NDK" == "" ]
then
- echo "Where is the NDK location ?"
- echo -n "NDK: "; read NDK
- export NDK=$NDK
+ echo "Where is the NDK location ?"
+ echo -n "NDK: "; read NDK
+ export NDK=$NDK
fi
export ANDROID_NDK=$NDK
@@ -13,9 +13,9 @@ export ANDROID_NDK=$NDK
# Abort if we don't know the Android CMake toolchain location
if [ "$ANDROID_CMAKE_TOOLCHAIN" == "" ]
then
- echo "Where is the Android CMake toolchain ?"
- echo -n "ANDROID_CMAKE_TOOLCHAIN: "; read ANDROID_CMAKE_TOOLCHAIN
- export ANDROID_CMAKE_TOOLCHAIN=$ANDROID_CMAKE_TOOLCHAIN
+ echo "Where is the Android CMake toolchain ?"
+ echo -n "ANDROID_CMAKE_TOOLCHAIN: "; read ANDROID_CMAKE_TOOLCHAIN
+ export ANDROID_CMAKE_TOOLCHAIN=$ANDROID_CMAKE_TOOLCHAIN
fi
./clean_all.sh
diff --git a/tools/android/patches/remove-so-version-suffix.diff b/tools/android/patches/remove-so-version-suffix.diff
index 257d553..60b9805 100644
--- a/tools/android/patches/remove-so-version-suffix.diff
+++ b/tools/android/patches/remove-so-version-suffix.diff
@@ -1,5 +1,5 @@
---- CMakeLists.txt.orig 2013-09-21 15:23:49.305453804 +0200
-+++ CMakeLists.txt 2013-09-21 15:24:08.621454210 +0200
+--- CMakeLists.txt.orig 2013-09-21 15:23:49.305453804 +0200
++++ CMakeLists.txt 2013-09-21 15:24:08.621454210 +0200
@@ -717,9 +717,7 @@
# Build a library
ADD_LIBRARY(${LIBNAME} ${LIBTYPE} ${OPENAL_OBJS} ${ALC_OBJS})