From 6dc64041615a943507b692b6d4bda715be57f1f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 15 Nov 2013 19:26:31 +0100 Subject: [PATCH 001/105] WavAudioImporter: explicitly find OpenAL also here. Fixes random issues with al.h not found (based on whether Audio library CMakeLists.txt gets processed before or after this plugin). --- src/Plugins/WavAudioImporter/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Plugins/WavAudioImporter/CMakeLists.txt b/src/Plugins/WavAudioImporter/CMakeLists.txt index 4f25d3ab6..477f04e53 100644 --- a/src/Plugins/WavAudioImporter/CMakeLists.txt +++ b/src/Plugins/WavAudioImporter/CMakeLists.txt @@ -22,6 +22,8 @@ # DEALINGS IN THE SOFTWARE. # +find_package(OpenAL REQUIRED) + include_directories(${OPENAL_INCLUDE_DIR}) set(WavAudioImporter_SRCS From 19b66d111babd26eb99556293eb4601ffe0a950c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 16 Nov 2013 21:49:46 +0100 Subject: [PATCH 002/105] doc: various fixes. Thx @biosek. --- doc/best-practices.dox | 4 ++-- doc/platform.dox | 2 +- doc/transformations.dox | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/best-practices.dox b/doc/best-practices.dox index 2b04dffe9..537b66e19 100644 --- a/doc/best-practices.dox +++ b/doc/best-practices.dox @@ -77,11 +77,11 @@ vertex and index buffers in both Native Client and Emscripten. @subsection best-practices-powervr PowerVR hardware -- [PowerVR Performance Recommendations](http://www.imgtec.com/powervr/insider/docs/PowerVR.Performance%20Recommendations.1.0.28.External.pdf) [PDF] +- [PowerVR Performance Recommendations](https://github.com/burningsun/pecker_framework/blob/master/参考资料/PowerVR.Performance%20Recommendations.pdf?raw=true) [PDF] @subsection best-practices-tegra NVidia Tegra hardware -- [Optimize OpenGL ES 2.0 Performance for Tegra](http://docs.nvidia.com/tegra/data/Optimize_OpenGL_ES_2_0_Performance_for_Tegra.html) +- [Optimize OpenGL ES 2.0 Performance for Tegra](http://docs.nvidia.com/tegra/index.html#GLES2_Perf_Main.html) */ } diff --git a/doc/platform.dox b/doc/platform.dox index 18293bca0..17e946156 100644 --- a/doc/platform.dox +++ b/doc/platform.dox @@ -190,7 +190,7 @@ constructor. Using method chaining it can be done conveniently like this: MyApplication::MyApplication(int& argc, char** argv): Platform::Application(argc, argv, Configuration() .setTitle("My Application") - .setSize({800, 600}) + .setSize({800, 600})) { // ... } diff --git a/doc/transformations.dox b/doc/transformations.dox index 14ccd13f5..730ce9b25 100644 --- a/doc/transformations.dox +++ b/doc/transformations.dox @@ -154,7 +154,7 @@ auto b = Matrix4::reflection(axis.normalized()); Scaling and reflection is also done relative to origin, you can use method mentioned above to scale or reflect around arbitrary point. -Sscaling and reflection can be (to some extent) also represented by complex +Scaling and reflection can be (to some extent) also represented by complex numbers and quaternions, but it has some bad properties and would make some operations more expensive, so it's not implemented. From c7ef09d5dc0bfdf296d31ff4f3d56a39ca4a705a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Nov 2013 18:17:15 +0100 Subject: [PATCH 003/105] MeshTools: don't allocate and memcpy zeros in interleave(). We have std::memset for that. What the hell I was thinking back then. Found when trying to get rid of as many naked allocations and deletions as possible. Also improved the test with some ASCII-art documentation. --- src/MeshTools/Interleave.h | 4 +--- src/MeshTools/Test/InterleaveTest.cpp | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/MeshTools/Interleave.h b/src/MeshTools/Interleave.h index 4a5c2d2c9..fdf052d83 100644 --- a/src/MeshTools/Interleave.h +++ b/src/MeshTools/Interleave.h @@ -113,11 +113,9 @@ class Interleave { /* Fill gap with zeros */ std::size_t writeOne(char* startingOffset, std::size_t gap) { - char* data = new char[gap](); for(std::size_t i = 0; i != _attributeCount; ++i) - memcpy(startingOffset+i*_stride, data, gap); + std::memset(startingOffset+i*_stride, 0, gap); - delete[] data; return gap; } diff --git a/src/MeshTools/Test/InterleaveTest.cpp b/src/MeshTools/Test/InterleaveTest.cpp index 13375461f..beb57aa35 100644 --- a/src/MeshTools/Test/InterleaveTest.cpp +++ b/src/MeshTools/Test/InterleaveTest.cpp @@ -122,13 +122,16 @@ void InterleaveTest::writeGaps() { CORRADE_COMPARE(attributeCount, std::size_t(3)); CORRADE_COMPARE(stride, std::size_t(12)); std::size_t size = attributeCount*stride; + if(!Utility::Endianness::isBigEndian()) { + /* byte, _____________gap, int___________________, short_____, _______gap */ CORRADE_COMPARE(std::vector(data, data+size), (std::vector{ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00 })); } else { + /* byte, _____________gap, ___________________int, _____short, _______gap */ CORRADE_COMPARE(std::vector(data, data+size), (std::vector{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, From 277dabc90ef6fb67ad4878ea980fa05e510a7d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Nov 2013 18:26:02 +0100 Subject: [PATCH 004/105] MeshTools: use std:: prefix everywhere. --- src/MeshTools/Interleave.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MeshTools/Interleave.h b/src/MeshTools/Interleave.h index fdf052d83..27203196c 100644 --- a/src/MeshTools/Interleave.h +++ b/src/MeshTools/Interleave.h @@ -106,7 +106,7 @@ class Interleave { template typename std::enable_if::value, std::size_t>::type writeOne(char* startingOffset, const T& attributeList) { auto it = attributeList.begin(); for(std::size_t i = 0; i != _attributeCount; ++i, ++it) - memcpy(startingOffset+i*_stride, reinterpret_cast(&*it), sizeof(typename T::value_type)); + std::memcpy(startingOffset+i*_stride, reinterpret_cast(&*it), sizeof(typename T::value_type)); return sizeof(typename T::value_type); } From 090006d8185440806207f6a9c35361a8c9316c89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Nov 2013 18:29:54 +0100 Subject: [PATCH 005/105] TgaImageConverter: use static data and ImageReference instead of `new`. --- .../Test/TgaImageConverterTest.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Plugins/TgaImageConverter/Test/TgaImageConverterTest.cpp b/src/Plugins/TgaImageConverter/Test/TgaImageConverterTest.cpp index 3688a6dcd..a63aa1c14 100644 --- a/src/Plugins/TgaImageConverter/Test/TgaImageConverterTest.cpp +++ b/src/Plugins/TgaImageConverter/Test/TgaImageConverterTest.cpp @@ -49,16 +49,18 @@ class TgaImageConverterTest: public TestSuite::Tester { }; namespace { - #ifndef MAGNUM_TARGET_GLES - const Image2D original(ColorFormat::BGR, ColorType::UnsignedByte, {2, 3}, new char[18] - #else - const Image2D original(ColorFormat::RGB, ColorType::UnsignedByte, {2, 3}, new char[18] - #endif - { + /** @todo `const` when ImageReference is sane */ + char originalData[] = { 1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 6, 5, 6, 7, 6, 7, 8 - }); + }; + + #ifndef MAGNUM_TARGET_GLES + const ImageReference2D original(ColorFormat::BGR, ColorType::UnsignedByte, {2, 3}, originalData); + #else + const ImageReference2D original(ColorFormat::RGB, ColorType::UnsignedByte, {2, 3}, originalData); + #endif } TgaImageConverterTest::TgaImageConverterTest() { From d6c4bb03008d20aa4d6607a75bf7a24041384127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Nov 2013 18:47:27 +0100 Subject: [PATCH 006/105] Use "constructor cast" instead of `static_cast(...)`. Makes the lines shorter, the conversions are mainly from strongly-typed enums to underlying type, so nothing potentially harmful which should be marked with static_cast. --- src/AbstractFramebuffer.cpp | 12 ++++++------ src/AbstractTexture.cpp | 37 ++++++++++++++++++------------------- src/AbstractTexture.h | 4 ++-- src/Buffer.cpp | 22 +++++++++++----------- src/CubeMapTexture.h | 10 +++++----- src/CubeMapTextureArray.h | 2 +- src/DefaultFramebuffer.cpp | 2 +- src/DefaultFramebuffer.h | 4 ++-- src/Framebuffer.cpp | 4 ++-- src/Mesh.cpp | 6 +++--- src/Mesh.h | 12 ++++++------ src/Query.h | 2 +- src/Shader.cpp | 2 +- src/Texture.h | 2 +- 14 files changed, 60 insertions(+), 61 deletions(-) diff --git a/src/AbstractFramebuffer.cpp b/src/AbstractFramebuffer.cpp index 2b9043bdb..56e95f9ba 100644 --- a/src/AbstractFramebuffer.cpp +++ b/src/AbstractFramebuffer.cpp @@ -112,7 +112,7 @@ void AbstractFramebuffer::bindInternal(FramebufferTarget target) { state->readBinding = state->drawBinding = _id; } else CORRADE_ASSERT_UNREACHABLE(); - glBindFramebuffer(static_cast(target), _id); + glBindFramebuffer(GLenum(target), _id); } FramebufferTarget AbstractFramebuffer::bindInternal() { @@ -144,7 +144,7 @@ void AbstractFramebuffer::blit(AbstractFramebuffer& source, AbstractFramebuffer& destination.bindInternal(FramebufferTarget::Draw); /** @todo Get some extension wrangler instead to avoid undeclared glBlitFramebuffer() on ES2 */ #ifndef MAGNUM_TARGET_GLES2 - glBlitFramebuffer(sourceRectangle.left(), sourceRectangle.bottom(), sourceRectangle.right(), sourceRectangle.top(), destinationRectangle.left(), destinationRectangle.bottom(), destinationRectangle.right(), destinationRectangle.top(), static_cast(mask), static_cast(filter)); + glBlitFramebuffer(sourceRectangle.left(), sourceRectangle.bottom(), sourceRectangle.right(), sourceRectangle.top(), destinationRectangle.left(), destinationRectangle.bottom(), destinationRectangle.right(), destinationRectangle.top(), GLbitfield(mask), GLenum(filter)); #else static_cast(sourceRectangle); static_cast(destinationRectangle); @@ -183,7 +183,7 @@ void AbstractFramebuffer::clear(FramebufferClearMask mask) { #else bindInternal(drawTarget); #endif - glClear(static_cast(mask)); + glClear(GLbitfield(mask)); } void AbstractFramebuffer::read(const Vector2i& offset, const Vector2i& size, Image2D& image) { @@ -377,17 +377,17 @@ void AbstractFramebuffer::readBufferImplementationDSA(GLenum buffer) { #endif void AbstractFramebuffer::readImplementationDefault(const Vector2i& offset, const Vector2i& size, const ColorFormat format, const ColorType type, const std::size_t, GLvoid* const data) { - glReadPixels(offset.x(), offset.y(), size.x(), size.y(), static_cast(format), static_cast(type), data); + glReadPixels(offset.x(), offset.y(), size.x(), size.y(), GLenum(format), GLenum(type), data); } #ifndef MAGNUM_TARGET_GLES3 void AbstractFramebuffer::readImplementationRobustness(const Vector2i& offset, const Vector2i& size, const ColorFormat format, const ColorType type, const std::size_t dataSize, GLvoid* const data) { /** @todo Enable when extension wrangler for ES is available */ #ifndef MAGNUM_TARGET_GLES - glReadnPixelsARB(offset.x(), offset.y(), size.x(), size.y(), static_cast(format), static_cast(type), dataSize, data); + glReadnPixelsARB(offset.x(), offset.y(), size.x(), size.y(), GLenum(format), GLenum(type), dataSize, data); #else CORRADE_INTERNAL_ASSERT(false); - //glReadnPixelsEXT(offset.x(), offset.y(), size.x(), size.y(), static_cast(format), static_cast(type), data); + //glReadnPixelsEXT(offset.x(), offset.y(), size.x(), size.y(), GLenum(format), GLenum(type), data); static_cast(offset); static_cast(size); static_cast(format); diff --git a/src/AbstractTexture.cpp b/src/AbstractTexture.cpp index a49539ca4..c43b6ce3d 100644 --- a/src/AbstractTexture.cpp +++ b/src/AbstractTexture.cpp @@ -190,8 +190,7 @@ AbstractTexture& AbstractTexture::setMinificationFilter(Sampler::Filter filter, CORRADE_ASSERT(_target != GL_TEXTURE_RECTANGLE || mipmap == Sampler::Mipmap::Base, "AbstractTexture: rectangle textures cannot have mipmaps", *this); #endif - (this->*parameteriImplementation)(GL_TEXTURE_MIN_FILTER, - static_cast(filter)|static_cast(mipmap)); + (this->*parameteriImplementation)(GL_TEXTURE_MIN_FILTER, GLint(filter)|GLint(mipmap)); return *this; } @@ -886,22 +885,22 @@ void AbstractTexture::getImageImplementationRobustness(const GLenum target, cons #ifndef MAGNUM_TARGET_GLES void AbstractTexture::imageImplementationDefault(GLenum target, GLint level, TextureFormat internalFormat, const Math::Vector<1, GLsizei>& size, ColorFormat format, ColorType type, const GLvoid* data) { bindInternal(); - glTexImage1D(target, level, static_cast(internalFormat), size[0], 0, static_cast(format), static_cast(type), data); + glTexImage1D(target, level, GLint(internalFormat), size[0], 0, GLenum(format), GLenum(type), data); } void AbstractTexture::imageImplementationDSA(GLenum target, GLint level, TextureFormat internalFormat, const Math::Vector<1, GLsizei>& size, ColorFormat format, ColorType type, const GLvoid* data) { - glTextureImage1DEXT(_id, target, level, GLint(internalFormat), size[0], 0, static_cast(format), static_cast(type), data); + glTextureImage1DEXT(_id, target, level, GLint(internalFormat), size[0], 0, GLenum(format), GLenum(type), data); } #endif void AbstractTexture::imageImplementationDefault(GLenum target, GLint level, TextureFormat internalFormat, const Vector2i& size, ColorFormat format, ColorType type, const GLvoid* data) { bindInternal(); - glTexImage2D(target, level, GLint(internalFormat), size.x(), size.y(), 0, static_cast(format), static_cast(type), data); + glTexImage2D(target, level, GLint(internalFormat), size.x(), size.y(), 0, GLenum(format), GLenum(type), data); } #ifndef MAGNUM_TARGET_GLES void AbstractTexture::imageImplementationDSA(GLenum target, GLint level, TextureFormat internalFormat, const Vector2i& size, ColorFormat format, ColorType type, const GLvoid* data) { - glTextureImage2DEXT(_id, target, level, GLint(internalFormat), size.x(), size.y(), 0, static_cast(format), static_cast(type), data); + glTextureImage2DEXT(_id, target, level, GLint(internalFormat), size.x(), size.y(), 0, GLenum(format), GLenum(type), data); } #endif @@ -909,7 +908,7 @@ void AbstractTexture::imageImplementationDefault(GLenum target, GLint level, Tex bindInternal(); /** @todo Get some extension wrangler instead to avoid linker errors to glTexImage3D() on ES2 */ #ifndef MAGNUM_TARGET_GLES2 - glTexImage3D(target, level, GLint(internalFormat), size.x(), size.y(), size.z(), 0, static_cast(format), static_cast(type), data); + glTexImage3D(target, level, GLint(internalFormat), size.x(), size.y(), size.z(), 0, GLenum(format), GLenum(type), data); #else static_cast(target); static_cast(level); @@ -923,29 +922,29 @@ void AbstractTexture::imageImplementationDefault(GLenum target, GLint level, Tex #ifndef MAGNUM_TARGET_GLES void AbstractTexture::imageImplementationDSA(GLenum target, GLint level, TextureFormat internalFormat, const Vector3i& size, ColorFormat format, ColorType type, const GLvoid* data) { - glTextureImage3DEXT(_id, target, level, GLint(internalFormat), size.x(), size.y(), size.z(), 0, static_cast(format), static_cast(type), data); + glTextureImage3DEXT(_id, target, level, GLint(internalFormat), size.x(), size.y(), size.z(), 0, GLenum(format), GLenum(type), data); } #endif #ifndef MAGNUM_TARGET_GLES void AbstractTexture::subImageImplementationDefault(GLenum target, GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLsizei>& size, ColorFormat format, ColorType type, const GLvoid* data) { bindInternal(); - glTexSubImage1D(target, level, offset[0], size[0], static_cast(format), static_cast(type), data); + glTexSubImage1D(target, level, offset[0], size[0], GLenum(format), GLenum(type), data); } void AbstractTexture::subImageImplementationDSA(GLenum target, GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLsizei>& size, ColorFormat format, ColorType type, const GLvoid* data) { - glTextureSubImage1DEXT(_id, target, level, offset[0], size[0], static_cast(format), static_cast(type), data); + glTextureSubImage1DEXT(_id, target, level, offset[0], size[0], GLenum(format), GLenum(type), data); } #endif void AbstractTexture::subImageImplementationDefault(GLenum target, GLint level, const Vector2i& offset, const Vector2i& size, ColorFormat format, ColorType type, const GLvoid* data) { bindInternal(); - glTexSubImage2D(target, level, offset.x(), offset.y(), size.x(), size.y(), static_cast(format), static_cast(type), data); + glTexSubImage2D(target, level, offset.x(), offset.y(), size.x(), size.y(), GLenum(format), GLenum(type), data); } #ifndef MAGNUM_TARGET_GLES void AbstractTexture::subImageImplementationDSA(GLenum target, GLint level, const Vector2i& offset, const Vector2i& size, ColorFormat format, ColorType type, const GLvoid* data) { - glTextureSubImage2DEXT(_id, target, level, offset.x(), offset.y(), size.x(), size.y(), static_cast(format), static_cast(type), data); + glTextureSubImage2DEXT(_id, target, level, offset.x(), offset.y(), size.x(), size.y(), GLenum(format), GLenum(type), data); } #endif @@ -953,7 +952,7 @@ void AbstractTexture::subImageImplementationDefault(GLenum target, GLint level, bindInternal(); /** @todo Get some extension wrangler instead to avoid linker errors to glTexSubImage3D() on ES2 */ #ifndef MAGNUM_TARGET_GLES2 - glTexSubImage3D(target, level, offset.x(), offset.y(), offset.z(), size.x(), size.y(), size.z(), static_cast(format), static_cast(type), data); + glTexSubImage3D(target, level, offset.x(), offset.y(), offset.z(), size.x(), size.y(), size.z(), GLenum(format), GLenum(type), data); #else static_cast(target); static_cast(level); @@ -967,7 +966,7 @@ void AbstractTexture::subImageImplementationDefault(GLenum target, GLint level, #ifndef MAGNUM_TARGET_GLES void AbstractTexture::subImageImplementationDSA(GLenum target, GLint level, const Vector3i& offset, const Vector3i& size, ColorFormat format, ColorType type, const GLvoid* data) { - glTextureSubImage3DEXT(_id, target, level, offset.x(), offset.y(), offset.z(), size.x(), size.y(), size.z(), static_cast(format), static_cast(type), data); + glTextureSubImage3DEXT(_id, target, level, offset.x(), offset.y(), offset.z(), size.x(), size.y(), size.z(), GLenum(format), GLenum(type), data); } #endif @@ -1124,15 +1123,15 @@ void AbstractTexture::DataHelper<2>::setWrapping(AbstractTexture* texture, const CORRADE_ASSERT(texture->_target != GL_TEXTURE_RECTANGLE || ((wrapping.x() == Sampler::Wrapping::ClampToEdge || wrapping.x() == Sampler::Wrapping::ClampToBorder) && (wrapping.y() == Sampler::Wrapping::ClampToEdge || wrapping.y() == Sampler::Wrapping::ClampToEdge)), "AbstractTexture: rectangle texture wrapping must either clamp to border or to edge", ); #endif - (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_S, static_cast(wrapping.x())); - (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_T, static_cast(wrapping.y())); + (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_S, GLint(wrapping.x())); + (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_T, GLint(wrapping.y())); } void AbstractTexture::DataHelper<3>::setWrapping(AbstractTexture* texture, const Array3D& wrapping) { - (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_S, static_cast(wrapping.x())); - (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_T, static_cast(wrapping.y())); + (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_S, GLint(wrapping.x())); + (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_T, GLint(wrapping.y())); #ifndef MAGNUM_TARGET_GLES - (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_R, static_cast(wrapping.z())); + (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_R, GLint(wrapping.z())); #endif } #endif diff --git a/src/AbstractTexture.h b/src/AbstractTexture.h index 69befeed2..815b6c811 100644 --- a/src/AbstractTexture.h +++ b/src/AbstractTexture.h @@ -216,7 +216,7 @@ class MAGNUM_EXPORT AbstractTexture { * with @def_gl{TEXTURE_MAG_FILTER} */ AbstractTexture& setMagnificationFilter(Sampler::Filter filter) { - (this->*parameteriImplementation)(GL_TEXTURE_MAG_FILTER, static_cast(filter)); + (this->*parameteriImplementation)(GL_TEXTURE_MAG_FILTER, GLint(filter)); return *this; } @@ -478,7 +478,7 @@ template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<1> { static Math::Vector<1, GLint> imageSize(AbstractTexture* texture, GLenum target, GLint level); static void setWrapping(AbstractTexture* texture, const Array1D& wrapping) { - (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_S, static_cast(wrapping.x())); + (texture->*parameteriImplementation)(GL_TEXTURE_WRAP_S, GLint(wrapping.x())); } static void setStorage(AbstractTexture* texture, GLenum target, GLsizei levels, TextureFormat internalFormat, const Math::Vector<1, GLsizei>& size) { diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 507f080da..e343bea04 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -170,7 +170,7 @@ void Buffer::bind(Target target, GLuint id) { /* Bind the buffer otherwise */ bound = id; - glBindBuffer(static_cast(target), id); + glBindBuffer(GLenum(target), id); } Buffer::Target Buffer::bindInternal(Target hint) { @@ -187,7 +187,7 @@ Buffer::Target Buffer::bindInternal(Target hint) { /* Bind the buffer to hint target otherwise */ hintBinding = _id; - glBindBuffer(static_cast(hint), _id); + glBindBuffer(GLenum(hint), _id); return hint; } @@ -206,7 +206,7 @@ void* Buffer::mapSub(const GLintptr offset, const GLsizeiptr length, const MapAc /** @todo Enable also in Emscripten (?) when extension wrangler is available */ #ifdef CORRADE_TARGET_NACL CORRADE_ASSERT(!_mappedBuffer, "Buffer::mapSub(): the buffer is already mapped", nullptr); - return _mappedBuffer = glMapBufferSubDataCHROMIUM(static_cast(bindInternal(_targetHint)), offset, length, GLenum(access)); + return _mappedBuffer = glMapBufferSubDataCHROMIUM(GLenum(bindInternal(_targetHint)), offset, length, GLenum(access)); #else CORRADE_INTERNAL_ASSERT(false); static_cast(offset); @@ -228,7 +228,7 @@ void Buffer::unmapSub() { #ifndef MAGNUM_TARGET_GLES2 void Buffer::copyImplementationDefault(Buffer& read, Buffer& write, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) { - glCopyBufferSubData(static_cast(read.bindInternal(Target::CopyRead)), static_cast(write.bindInternal(Target::CopyWrite)), readOffset, writeOffset, size); + glCopyBufferSubData(GLenum(read.bindInternal(Target::CopyRead)), GLenum(write.bindInternal(Target::CopyWrite)), readOffset, writeOffset, size); } #ifndef MAGNUM_TARGET_GLES @@ -259,17 +259,17 @@ void Buffer::getSubDataImplementationDSA(const GLintptr offset, const GLsizeiptr #endif void Buffer::dataImplementationDefault(GLsizeiptr size, const GLvoid* data, Buffer::Usage usage) { - glBufferData(static_cast(bindInternal(_targetHint)), size, data, static_cast(usage)); + glBufferData(GLenum(bindInternal(_targetHint)), size, data, GLenum(usage)); } #ifndef MAGNUM_TARGET_GLES void Buffer::dataImplementationDSA(GLsizeiptr size, const GLvoid* data, Buffer::Usage usage) { - glNamedBufferDataEXT(_id, size, data, static_cast(usage)); + glNamedBufferDataEXT(_id, size, data, GLenum(usage)); } #endif void Buffer::subDataImplementationDefault(GLintptr offset, GLsizeiptr size, const GLvoid* data) { - glBufferSubData(static_cast(bindInternal(_targetHint)), offset, size, data); + glBufferSubData(GLenum(bindInternal(_targetHint)), offset, size, data); } #ifndef MAGNUM_TARGET_GLES @@ -298,7 +298,7 @@ void Buffer::invalidateSubImplementationARB(GLintptr offset, GLsizeiptr length) void* Buffer::mapImplementationDefault(MapAccess access) { /** @todo Re-enable when extension wrangler is available for ES */ #ifndef MAGNUM_TARGET_GLES - return glMapBuffer(static_cast(bindInternal(_targetHint)), GLenum(access)); + return glMapBuffer(GLenum(bindInternal(_targetHint)), GLenum(access)); #else static_cast(access); return nullptr; @@ -315,7 +315,7 @@ void* Buffer::mapImplementationDSA(MapAccess access) { void* Buffer::mapRangeImplementationDefault(GLintptr offset, GLsizeiptr length, MapFlags access) { /** @todo Re-enable when extension wrangler is available for ES */ #ifndef MAGNUM_TARGET_GLES2 - return glMapBufferRange(static_cast(bindInternal(_targetHint)), offset, length, GLenum(access)); + return glMapBufferRange(GLenum(bindInternal(_targetHint)), offset, length, GLenum(access)); #else static_cast(offset); static_cast(length); @@ -333,7 +333,7 @@ void* Buffer::mapRangeImplementationDSA(GLintptr offset, GLsizeiptr length, MapF void Buffer::flushMappedRangeImplementationDefault(GLintptr offset, GLsizeiptr length) { /** @todo Re-enable when extension wrangler is available for ES */ #ifndef MAGNUM_TARGET_GLES2 - glFlushMappedBufferRange(static_cast(bindInternal(_targetHint)), offset, length); + glFlushMappedBufferRange(GLenum(bindInternal(_targetHint)), offset, length); #else static_cast(offset); static_cast(length); @@ -349,7 +349,7 @@ void Buffer::flushMappedRangeImplementationDSA(GLintptr offset, GLsizeiptr lengt bool Buffer::unmapImplementationDefault() { /** @todo Re-enable when extension wrangler is available for ES */ #ifndef MAGNUM_TARGET_GLES2 - return glUnmapBuffer(static_cast(bindInternal(_targetHint))); + return glUnmapBuffer(GLenum(bindInternal(_targetHint))); #else return false; #endif diff --git a/src/CubeMapTexture.h b/src/CubeMapTexture.h index 4505bf0d4..b69237a1a 100644 --- a/src/CubeMapTexture.h +++ b/src/CubeMapTexture.h @@ -116,7 +116,7 @@ class CubeMapTexture: public AbstractTexture { * @requires_gl %Texture image queries are not available in OpenGL ES. */ Vector2i imageSize(Coordinate coordinate, Int level) { - return DataHelper<2>::imageSize(this, static_cast(coordinate), level); + return DataHelper<2>::imageSize(this, GLenum(coordinate), level); } #endif @@ -171,14 +171,14 @@ class CubeMapTexture: public AbstractTexture { * See Texture::setImage() for more information. */ CubeMapTexture& setImage(Coordinate coordinate, Int level, TextureFormat internalFormat, const ImageReference2D& image) { - DataHelper<2>::setImage(this, static_cast(coordinate), level, internalFormat, image); + DataHelper<2>::setImage(this, GLenum(coordinate), level, internalFormat, image); return *this; } #ifndef MAGNUM_TARGET_GLES2 /** @overload */ CubeMapTexture& setImage(Coordinate coordinate, Int level, TextureFormat internalFormat, BufferImage2D& image) { - DataHelper<2>::setImage(this, static_cast(coordinate), level, internalFormat, image); + DataHelper<2>::setImage(this, GLenum(coordinate), level, internalFormat, image); return *this; } #endif @@ -194,14 +194,14 @@ class CubeMapTexture: public AbstractTexture { * See Texture::setSubImage() for more information. */ CubeMapTexture& setSubImage(Coordinate coordinate, Int level, const Vector2i& offset, const ImageReference2D& image) { - DataHelper<2>::setSubImage(this, static_cast(coordinate), level, offset, image); + DataHelper<2>::setSubImage(this, GLenum(coordinate), level, offset, image); return *this; } #ifndef MAGNUM_TARGET_GLES2 /** @overload */ CubeMapTexture& setSubImage(Coordinate coordinate, Int level, const Vector2i& offset, BufferImage2D& image) { - DataHelper<2>::setSubImage(this, static_cast(coordinate), level, offset, image); + DataHelper<2>::setSubImage(this, GLenum(coordinate), level, offset, image); return *this; } #endif diff --git a/src/CubeMapTextureArray.h b/src/CubeMapTextureArray.h index 0f61a1f5c..feeccd090 100644 --- a/src/CubeMapTextureArray.h +++ b/src/CubeMapTextureArray.h @@ -118,7 +118,7 @@ class CubeMapTextureArray: public AbstractTexture { * See Texture::imageSize() for more information. */ Vector3i imageSize(Coordinate coordinate, Int level) { - return DataHelper<3>::imageSize(this, GL_TEXTURE_CUBE_MAP_POSITIVE_X + static_cast(coordinate), level); + return DataHelper<3>::imageSize(this, GL_TEXTURE_CUBE_MAP_POSITIVE_X + GLenum(coordinate), level); } /** diff --git a/src/DefaultFramebuffer.cpp b/src/DefaultFramebuffer.cpp index 02fabecdd..9f165a1bc 100644 --- a/src/DefaultFramebuffer.cpp +++ b/src/DefaultFramebuffer.cpp @@ -48,7 +48,7 @@ DefaultFramebuffer& DefaultFramebuffer::mapForDraw(std::initializer_list(attachment.second); + _attachments[attachment.first] = GLenum(attachment.second); (this->*drawBuffersImplementation)(max+1, _attachments); delete[] _attachments; diff --git a/src/DefaultFramebuffer.h b/src/DefaultFramebuffer.h index c7e7ee0fa..d1bdc2671 100644 --- a/src/DefaultFramebuffer.h +++ b/src/DefaultFramebuffer.h @@ -349,7 +349,7 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer { * available only in OpenGL ES 3.0. */ DefaultFramebuffer& mapForDraw(DrawAttachment attachment) { - (this->*drawBufferImplementation)(static_cast(attachment)); + (this->*drawBufferImplementation)(GLenum(attachment)); return *this; } #endif @@ -367,7 +367,7 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer { * @requires_gles30 %Extension @es_extension2{NV,read_buffer,GL_NV_read_buffer} */ DefaultFramebuffer& mapForRead(ReadAttachment attachment) { - (this->*readBufferImplementation)(static_cast(attachment)); + (this->*readBufferImplementation)(GLenum(attachment)); return *this; } diff --git a/src/Framebuffer.cpp b/src/Framebuffer.cpp index c332f2db8..189319243 100644 --- a/src/Framebuffer.cpp +++ b/src/Framebuffer.cpp @@ -157,7 +157,7 @@ void Framebuffer::renderbufferImplementationDSA(BufferAttachment attachment, Ren } void Framebuffer::texture1DImplementationDefault(BufferAttachment attachment, Texture1D& texture, GLint mipLevel) { - glFramebufferTexture1D(GLenum(bindInternal()), GLenum(attachment), static_cast(texture.target()), texture.id(), mipLevel); + glFramebufferTexture1D(GLenum(bindInternal()), GLenum(attachment), GLenum(texture.target()), texture.id(), mipLevel); } void Framebuffer::texture1DImplementationDSA(BufferAttachment attachment, Texture1D& texture, GLint mipLevel) { @@ -179,7 +179,7 @@ void Framebuffer::texture3DImplementationDefault(BufferAttachment attachment, Te /** @todo Check for texture target compatibility */ /** @todo Get some extension wrangler for glFramebufferTexture3D() (extension only) */ #ifndef MAGNUM_TARGET_GLES - glFramebufferTexture3D(GLenum(bindInternal()), GLenum(attachment), static_cast(texture.target()), texture.id(), mipLevel, layer); + glFramebufferTexture3D(GLenum(bindInternal()), GLenum(attachment), GLenum(texture.target()), texture.id(), mipLevel, layer); #else static_cast(attachment); static_cast(texture); diff --git a/src/Mesh.cpp b/src/Mesh.cpp index 8755b8ad3..8c8cdd234 100644 --- a/src/Mesh.cpp +++ b/src/Mesh.cpp @@ -169,17 +169,17 @@ void Mesh::drawInternal(Int firstVertex, Int vertexCount, GLintptr indexOffset, /* Non-indexed mesh */ if(!indexCount) - glDrawArrays(static_cast(_primitive), firstVertex, vertexCount); + glDrawArrays(GLenum(_primitive), firstVertex, vertexCount); #ifndef MAGNUM_TARGET_GLES2 /* Indexed mesh with specified range */ else if(indexEnd) - glDrawRangeElements(static_cast(_primitive), indexStart, indexEnd, indexCount, static_cast(_indexType), reinterpret_cast(indexOffset)); + glDrawRangeElements(GLenum(_primitive), indexStart, indexEnd, indexCount, GLenum(_indexType), reinterpret_cast(indexOffset)); #endif /* Indexed mesh without specified range */ else - glDrawElements(static_cast(_primitive), indexCount, static_cast(_indexType), reinterpret_cast(indexOffset)); + glDrawElements(GLenum(_primitive), indexCount, GLenum(_indexType), reinterpret_cast(indexOffset)); (this->*unbindImplementation)(); } diff --git a/src/Mesh.h b/src/Mesh.h index ddaf9827e..6888d8ced 100644 --- a/src/Mesh.h +++ b/src/Mesh.h @@ -639,8 +639,8 @@ class MAGNUM_EXPORT Mesh { (this->*attributePointerImplementation)(Attribute{ &buffer, location+i, - static_cast(attribute.components()), - static_cast(attribute.dataType()), + GLint(attribute.components()), + GLenum(attribute.dataType()), bool(attribute.dataOptions() & AbstractShaderProgram::Attribute::DataOption::Normalized), offset, stride @@ -652,8 +652,8 @@ class MAGNUM_EXPORT Mesh { (this->*attributeIPointerImplementation)(IntegerAttribute{ &buffer, location, - static_cast(attribute.components()), - static_cast(attribute.dataType()), + GLint(attribute.components()), + GLenum(attribute.dataType()), offset, stride }); @@ -665,8 +665,8 @@ class MAGNUM_EXPORT Mesh { (this->*attributeLPointerImplementation)(LongAttribute{ &buffer, location+i, - static_cast(attribute.components()), - static_cast(attribute.dataType()), + GLint(attribute.components()), + GLenum(attribute.dataType()), offset, stride }); diff --git a/src/Query.h b/src/Query.h index aebfddbfb..624d33969 100644 --- a/src/Query.h +++ b/src/Query.h @@ -291,7 +291,7 @@ class SampleQuery: public AbstractQuery { * @requires_gl Conditional rendering is not available in OpenGL ES. */ void beginConditionalRender(ConditionalRenderMode mode) { - glBeginConditionalRender(id(), static_cast(mode)); + glBeginConditionalRender(id(), GLenum(mode)); } /** diff --git a/src/Shader.cpp b/src/Shader.cpp index d69e12778..1767ce98b 100644 --- a/src/Shader.cpp +++ b/src/Shader.cpp @@ -534,7 +534,7 @@ Int Shader::maxCombinedUniformComponents(const Type type) { #endif Shader::Shader(const Version version, const Type type): _type(type), _id(0) { - _id = glCreateShader(static_cast(_type)); + _id = glCreateShader(GLenum(_type)); switch(version) { #ifndef MAGNUM_TARGET_GLES diff --git a/src/Texture.h b/src/Texture.h index 615f8665e..517f050b9 100644 --- a/src/Texture.h +++ b/src/Texture.h @@ -227,7 +227,7 @@ template class Texture: public AbstractTexture { * Creates one OpenGL texture. * @see @fn_gl{GenTextures} */ - explicit Texture(Target target = DataHelper::target()): AbstractTexture(static_cast(target)) {} + explicit Texture(Target target = DataHelper::target()): AbstractTexture(GLenum(target)) {} /** @brief %Texture target */ constexpr Target target() const { return static_cast(_target); } From 14cff2bdb88f2c41b6b3c6ec51df73a32068c13b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Nov 2013 19:00:47 +0100 Subject: [PATCH 007/105] Use Containers::Array instead of naked allocation in *Framebuffer. GL_NONE is fortunately zero, so we can skip std::fill_n altogether and replace it with zero-initialized allocation. Added just-in-case static_assert to check that. --- src/DefaultFramebuffer.cpp | 13 ++++--------- src/Framebuffer.cpp | 13 ++++--------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/DefaultFramebuffer.cpp b/src/DefaultFramebuffer.cpp index 9f165a1bc..b0f9e7995 100644 --- a/src/DefaultFramebuffer.cpp +++ b/src/DefaultFramebuffer.cpp @@ -45,37 +45,32 @@ DefaultFramebuffer& DefaultFramebuffer::mapForDraw(std::initializer_list::zeroInitialized(max+1); for(const auto& attachment: attachments) _attachments[attachment.first] = GLenum(attachment.second); (this->*drawBuffersImplementation)(max+1, _attachments); - delete[] _attachments; return *this; } #endif void DefaultFramebuffer::invalidate(std::initializer_list attachments) { /** @todo C++14: use VLA to avoid heap allocation */ - GLenum* _attachments = new GLenum[attachments.size()]; + Containers::Array _attachments(attachments.size()); for(std::size_t i = 0; i != attachments.size(); ++i) _attachments[i] = GLenum(*(attachments.begin()+i)); invalidateImplementation(attachments.size(), _attachments); - - delete[] _attachments; } void DefaultFramebuffer::invalidate(std::initializer_list attachments, const Rectanglei& rectangle) { /** @todo C++14: use VLA to avoid heap allocation */ - GLenum* _attachments = new GLenum[attachments.size()]; + Containers::Array _attachments(attachments.size()); for(std::size_t i = 0; i != attachments.size(); ++i) _attachments[i] = GLenum(*(attachments.begin()+i)); invalidateImplementation(attachments.size(), _attachments, rectangle); - - delete[] _attachments; } void DefaultFramebuffer::initializeContextBasedFunctionality(Context& context) { diff --git a/src/Framebuffer.cpp b/src/Framebuffer.cpp index 189319243..265cf91d6 100644 --- a/src/Framebuffer.cpp +++ b/src/Framebuffer.cpp @@ -94,36 +94,31 @@ Framebuffer& Framebuffer::mapForDraw(std::initializer_list::zeroInitialized(max+1); for(const auto& attachment: attachments) _attachments[attachment.first] = GLenum(attachment.second); (this->*drawBuffersImplementation)(max+1, _attachments); - delete[] _attachments; return *this; } void Framebuffer::invalidate(std::initializer_list attachments) { /** @todo C++14: use VLA to avoid heap allocation */ - GLenum* _attachments = new GLenum[attachments.size()]; + Containers::Array _attachments(attachments.size()); for(std::size_t i = 0; i != attachments.size(); ++i) _attachments[i] = GLenum(*(attachments.begin()+i)); invalidateImplementation(attachments.size(), _attachments); - - delete[] _attachments; } void Framebuffer::invalidate(std::initializer_list attachments, const Rectanglei& rectangle) { /** @todo C++14: use VLA to avoid heap allocation */ - GLenum* _attachments = new GLenum[attachments.size()]; + Containers::Array _attachments(attachments.size()); for(std::size_t i = 0; i != attachments.size(); ++i) _attachments[i] = GLenum(*(attachments.begin()+i)); invalidateImplementation(attachments.size(), _attachments, rectangle); - - delete[] _attachments; } Framebuffer& Framebuffer::attachTexture2D(BufferAttachment attachment, Texture2D& texture, Int mipLevel) { From d306eac7b65f0a40a53be7213fb9568afd19f41b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Nov 2013 19:04:10 +0100 Subject: [PATCH 008/105] Shapes: added forgotten test for Composition::transformed(). Crashes, as I could imagine. Why I am constantly forgetting to write tests for essential functionality?! --- src/Shapes/Test/CompositionTest.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Shapes/Test/CompositionTest.cpp b/src/Shapes/Test/CompositionTest.cpp index e07e34a9d..381616b5e 100644 --- a/src/Shapes/Test/CompositionTest.cpp +++ b/src/Shapes/Test/CompositionTest.cpp @@ -24,6 +24,7 @@ #include +#include "Math/Matrix3.h" #include "Math/Matrix4.h" #include "Shapes/Point.h" #include "Shapes/AxisAlignedBox.h" @@ -44,6 +45,8 @@ class CompositionTest: public TestSuite::Tester { void multipleUnary(); void hierarchy(); void empty(); + + void transformed(); }; CompositionTest::CompositionTest() { @@ -52,7 +55,9 @@ CompositionTest::CompositionTest() { &CompositionTest::ored, &CompositionTest::multipleUnary, &CompositionTest::hierarchy, - &CompositionTest::empty}); + &CompositionTest::empty, + + &CompositionTest::transformed}); } void CompositionTest::negated() { @@ -125,6 +130,18 @@ void CompositionTest::empty() { VERIFY_NOT_COLLIDES(a, Shapes::Sphere2D({}, 1.0f)); } +void CompositionTest::transformed() { + const Shapes::Composition2D a = Shapes::Sphere2D({}, 1.0f) && + (Shapes::Point2D(Vector2::xAxis(1.5f)) || !Shapes::AxisAlignedBox2D({}, Vector2(0.5f))); + + const Shapes::Composition2D b = a.transformed(Matrix3::translation({1.5f, -7.0f})); + CORRADE_COMPARE(b.get(0).position(), Vector2(1.5f, -7.0f)); + CORRADE_COMPARE(b.get(0).radius(), 1.0f); + CORRADE_COMPARE(b.get(1).position(), Vector2(3.0f, -7.0f)); + CORRADE_COMPARE(b.get(2).min(), Vector2(1.5f, -7.0f)); + CORRADE_COMPARE(b.get(2).max(), Vector2(2.0f, -6.5f)); +} + }}} CORRADE_TEST_MAIN(Magnum::Shapes::Test::CompositionTest) From 0d73256627a6624f173c8b91852a52d89702c6c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Nov 2013 19:12:18 +0100 Subject: [PATCH 009/105] Shapes: test also copying and movement of Composition. Now we know where it crashes. --- src/Shapes/Test/CompositionTest.cpp | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/Shapes/Test/CompositionTest.cpp b/src/Shapes/Test/CompositionTest.cpp index 381616b5e..da9a4d08e 100644 --- a/src/Shapes/Test/CompositionTest.cpp +++ b/src/Shapes/Test/CompositionTest.cpp @@ -46,6 +46,8 @@ class CompositionTest: public TestSuite::Tester { void hierarchy(); void empty(); + void copy(); + void move(); void transformed(); }; @@ -57,6 +59,8 @@ CompositionTest::CompositionTest() { &CompositionTest::hierarchy, &CompositionTest::empty, + &CompositionTest::copy, + &CompositionTest::move, &CompositionTest::transformed}); } @@ -130,6 +134,45 @@ void CompositionTest::empty() { VERIFY_NOT_COLLIDES(a, Shapes::Sphere2D({}, 1.0f)); } +void CompositionTest::copy() { + const Shapes::Composition3D a = Shapes::Sphere3D({}, 1.0f) && + (Shapes::Point3D(Vector3::xAxis(1.5f)) || !Shapes::AxisAlignedBox3D({}, Vector3(0.5f))); + + /* Copy constructor */ + const Shapes::Composition3D b(a); + CORRADE_COMPARE(b.size(), 3); + CORRADE_COMPARE(b.get(2).max(), Vector3(0.5f)); + + /* Copy assignment */ + Shapes::Composition3D c; + c = a; + CORRADE_COMPARE(c.size(), 3); + CORRADE_COMPARE(c.get(1).position(), Vector3::xAxis(1.5f)); +} + +void CompositionTest::move() { + { + Shapes::Composition3D a = Shapes::Sphere3D({}, 1.0f) && + (Shapes::Point3D(Vector3::xAxis(1.5f)) || !Shapes::AxisAlignedBox3D({}, Vector3(0.5f))); + + /* Move constructor */ + const Shapes::Composition3D b(std::move(a)); + CORRADE_COMPARE(a.size(), 0); + CORRADE_COMPARE(b.size(), 3); + CORRADE_COMPARE(b.get(1).position(), Vector3::xAxis(1.5f)); + } { + Shapes::Composition3D a = Shapes::Sphere3D({}, 1.0f) && + (Shapes::Point3D(Vector3::xAxis(1.5f)) || !Shapes::AxisAlignedBox3D({}, Vector3(0.5f))); + + /* Move assignment */ + Shapes::Composition3D b; + b = std::move(a); + CORRADE_COMPARE(a.size(), 0); + CORRADE_COMPARE(b.size(), 3); + CORRADE_COMPARE(b.get(2).max(), Vector3(0.5f)); + } +} + void CompositionTest::transformed() { const Shapes::Composition2D a = Shapes::Sphere2D({}, 1.0f) && (Shapes::Point2D(Vector2::xAxis(1.5f)) || !Shapes::AxisAlignedBox2D({}, Vector2(0.5f))); From d9e7096a9bb6296a075054eb7b275a16e8f54890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Nov 2013 19:16:53 +0100 Subject: [PATCH 010/105] Shapes: use Containers::Array instead of naked array in Composition. Makes the copying code simpler. Also added assertion that we copy into available memory and not somewhere out of bounds. The test now fails the assertion. --- src/Shapes/Composition.cpp | 49 ++++++++++++++------------------------ src/Shapes/Composition.h | 20 ++++++++-------- 2 files changed, 28 insertions(+), 41 deletions(-) diff --git a/src/Shapes/Composition.cpp b/src/Shapes/Composition.cpp index 7a9fe3857..08c424180 100644 --- a/src/Shapes/Composition.cpp +++ b/src/Shapes/Composition.cpp @@ -59,42 +59,30 @@ Because these values are relative to parent, they don't need to be modified when concatenating. */ -template Composition::Composition(const Composition& other): _shapeCount(other._shapeCount), _nodeCount(other._nodeCount) { +template Composition::Composition(const Composition& other) { copyShapes(0, other); copyNodes(0, other); } -template Composition::Composition(Composition&& other): _shapeCount(other._shapeCount), _nodeCount(other._nodeCount), _shapes(other._shapes), _nodes(other._nodes) { +template Composition::Composition(Composition&& other): _shapes(std::move(other._shapes)), _nodes(std::move(other._nodes)) { other._shapes = nullptr; - other._shapeCount = 0; - other._nodes = nullptr; - other._nodeCount = 0; } template Composition::~Composition() { - for(std::size_t i = 0; i != _shapeCount; ++i) + for(std::size_t i = 0; i != _shapes.size(); ++i) delete _shapes[i]; - - delete[] _shapes; - delete[] _nodes; } template Composition& Composition::operator=(const Composition& other) { - for(std::size_t i = 0; i != _shapeCount; ++i) + for(std::size_t i = 0; i != _shapes.size(); ++i) delete _shapes[i]; - if(_shapeCount != other._shapeCount) { - delete[] _shapes; - _shapeCount = other._shapeCount; - _shapes = new Implementation::AbstractShape*[_shapeCount]; - } + if(_shapes.size() != other._shapes.size()) + _shapes = Containers::Array*>(other._shapes.size()); - if(_nodeCount != other._nodeCount) { - delete[] _nodes; - _nodeCount = other._nodeCount; - _nodes = new Node[_nodeCount]; - } + if(_nodes.size() != other._nodes.size()) + _nodes = Containers::Array(other._nodes.size()); copyShapes(0, other); copyNodes(0, other); @@ -102,33 +90,32 @@ template Composition& Composition Composition& Composition::operator=(Composition&& other) { - std::swap(other._shapeCount, _shapeCount); - std::swap(other._nodeCount, _nodeCount); std::swap(other._shapes, _shapes); std::swap(other._nodes, _nodes); return *this; } template void Composition::copyShapes(const std::size_t offset, Composition&& other) { - std::move(other._shapes, other._shapes+other._shapeCount, _shapes+offset); - delete[] other._shapes; + CORRADE_INTERNAL_ASSERT(_shapes.size() >= other._shapes.size()+offset); + std::move(other._shapes.begin(), other._shapes.end(), _shapes.begin()+offset); other._shapes = nullptr; - other._shapeCount = 0; } template void Composition::copyShapes(const std::size_t offset, const Composition& other) { - for(std::size_t i = 0; i != other._shapeCount; ++i) - _shapes[i+offset] = other._shapes[i]->clone(); + CORRADE_INTERNAL_ASSERT(_shapes.size() >= other._shapes.size()+offset); + for(Implementation::AbstractShape * const* i = other._shapes.begin(), ** o = _shapes.begin()+offset; i != other._shapes.end(); ++i, ++o) + *o = (*i)->clone(); } template void Composition::copyNodes(std::size_t offset, const Composition& other) { - std::copy(other._nodes, other._nodes+other._nodeCount, _nodes+offset); + CORRADE_INTERNAL_ASSERT(_nodes.size() >= other._nodes.size()+offset); + std::copy(other._nodes.begin(), other._nodes.end(), _nodes.begin()+offset); } template Composition Composition::transformed(const typename DimensionTraits::MatrixType& matrix) const { Composition out(*this); - for(std::size_t i = 0; i != _shapeCount; ++i) - _shapes[i]->transform(matrix, out._shapes[i]); + for(Implementation::AbstractShape * const* i = _shapes.begin(), * const* o = out._shapes.begin(); i != _shapes.end(); ++i, ++o) + (*i)->transform(matrix, *o); return out; } @@ -136,7 +123,7 @@ template bool Composition::collides(const Im /* Empty group */ if(shapeBegin == shapeEnd) return false; - CORRADE_INTERNAL_ASSERT(node < _nodeCount && shapeBegin < shapeEnd); + CORRADE_INTERNAL_ASSERT(node < _nodes.size() && shapeBegin < shapeEnd); /* Collision on the left child. If the node is leaf one (no left child exists), do it directly, recurse instead. */ diff --git a/src/Shapes/Composition.h b/src/Shapes/Composition.h index 55431878b..c07768397 100644 --- a/src/Shapes/Composition.h +++ b/src/Shapes/Composition.h @@ -30,6 +30,7 @@ #include #include +#include #include #include "DimensionTraits.h" @@ -95,7 +96,7 @@ template class MAGNUM_SHAPES_EXPORT Composition { * * Creates empty hierarchy. */ - explicit Composition(): _shapeCount(0), _nodeCount(0), _shapes(nullptr), _nodes(nullptr) {} + explicit Composition() {} /** * @brief Unary operation constructor @@ -130,7 +131,7 @@ template class MAGNUM_SHAPES_EXPORT Composition { Composition transformed(const typename DimensionTraits::MatrixType& matrix) const; /** @brief Count of shapes in the hierarchy */ - std::size_t size() const { return _shapeCount; } + std::size_t size() const { return _shapes.size(); } /** @brief Type of shape at given position */ Type type(std::size_t i) const { return _shapes[i]->type(); } @@ -154,7 +155,7 @@ template class MAGNUM_SHAPES_EXPORT Composition { }; bool collides(const Implementation::AbstractShape& a) const { - return collides(a, 0, 0, _shapeCount); + return collides(a, 0, 0, _shapes.size()); } bool collides(const Implementation::AbstractShape& a, std::size_t node, std::size_t shapeBegin, std::size_t shapeEnd) const; @@ -163,13 +164,13 @@ template class MAGNUM_SHAPES_EXPORT Composition { return 1; } constexpr static std::size_t shapeCount(const Composition& hierarchy) { - return hierarchy._shapeCount; + return hierarchy._shapes.size(); } template constexpr static std::size_t nodeCount(const T&) { return 0; } constexpr static std::size_t nodeCount(const Composition& hierarchy) { - return hierarchy._nodeCount; + return hierarchy._nodes.size(); } template void copyShapes(std::size_t offset, const T& shape) { @@ -181,9 +182,8 @@ template class MAGNUM_SHAPES_EXPORT Composition { template void copyNodes(std::size_t, const T&) {} void copyNodes(std::size_t offset, const Composition& other); - std::size_t _shapeCount, _nodeCount; - Implementation::AbstractShape** _shapes; - Node* _nodes; + Containers::Array*> _shapes; + Containers::Array _nodes; }; /** @brief Two-dimensional shape hierarchy */ @@ -255,7 +255,7 @@ template inline auto operator||(T&& a, U&& b) -> enableIfAreSh #undef enableIfAreShapeType #endif -template template Composition::Composition(CompositionOperation operation, T&& a): _shapeCount(shapeCount(a)), _nodeCount(nodeCount(a)+1), _shapes(new Implementation::AbstractShape*[_shapeCount]), _nodes(new Node[_nodeCount]) { +template template Composition::Composition(CompositionOperation operation, T&& a): _shapes(shapeCount(a)), _nodes(nodeCount(a)+1) { CORRADE_ASSERT(operation == CompositionOperation::Not, "Shapes::Composition::Composition(): unary operation expected", ); _nodes[0].operation = operation; @@ -267,7 +267,7 @@ template template Composition::Comp copyShapes(0, std::forward(a)); } -template template Composition::Composition(CompositionOperation operation, T&& a, U&& b): _shapeCount(shapeCount(a) + shapeCount(b)), _nodeCount(nodeCount(a) + nodeCount(b) + 1), _shapes(new Implementation::AbstractShape*[_shapeCount]), _nodes(new Node[_nodeCount]) { +template template Composition::Composition(CompositionOperation operation, T&& a, U&& b): _shapes(shapeCount(a) + shapeCount(b)), _nodes(nodeCount(a) + nodeCount(b) + 1) { CORRADE_ASSERT(operation != CompositionOperation::Not, "Shapes::Composition::Composition(): binary operation expected", ); _nodes[0].operation = operation; From e36525963547a3a9e0028b17a147c79d18e08222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Nov 2013 19:21:18 +0100 Subject: [PATCH 011/105] Shapes: fix copy constructor in Composition. The test now passes again. --- src/Shapes/Composition.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shapes/Composition.cpp b/src/Shapes/Composition.cpp index 08c424180..456071772 100644 --- a/src/Shapes/Composition.cpp +++ b/src/Shapes/Composition.cpp @@ -59,7 +59,7 @@ Because these values are relative to parent, they don't need to be modified when concatenating. */ -template Composition::Composition(const Composition& other) { +template Composition::Composition(const Composition& other): _shapes(other._shapes.size()), _nodes(other._nodes.size()) { copyShapes(0, other); copyNodes(0, other); } From da03d86e3efd35123912bfd233e4917caa0389c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Nov 2013 19:42:00 +0100 Subject: [PATCH 012/105] Explicitly pass also shader source sizes in Shader::compile(). Should avoid potentially costly `strlen` in glShaderSource() internals. --- src/Shader.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Shader.cpp b/src/Shader.cpp index 1767ce98b..3bd02eac6 100644 --- a/src/Shader.cpp +++ b/src/Shader.cpp @@ -25,6 +25,7 @@ #include "Shader.h" #include +#include #include #include "Extensions.h" @@ -625,17 +626,21 @@ Shader& Shader::addFile(const std::string& filename) { bool Shader::compile() { CORRADE_ASSERT(sources.size() > 1, "Shader::compile(): no files added", false); - /* Array of sources */ - const GLchar** _sources = new const GLchar*[sources.size()]; - for(std::size_t i = 0; i != sources.size(); ++i) - _sources[i] = static_cast(sources[i].c_str()); + /* Array of source string pointers and their lengths */ + /** @todo Use `Containers::::ArrayTuple` to avoid one allocation if it ever + gets to be implemented (we need properly aligned memory too) */ + Containers::Array pointers(sources.size()); + Containers::Array sizes(sources.size()); + for(std::size_t i = 0; i != sources.size(); ++i) { + pointers[i] = static_cast(sources[i].data()); + sizes[i] = sources[i].size(); + } /* Create shader and set its source */ - glShaderSource(_id, sources.size(), _sources, nullptr); + glShaderSource(_id, sources.size(), pointers, sizes); /* Compile shader */ glCompileShader(_id); - delete _sources; /* Check compilation status */ GLint success, logLength; From 819451f3c49118ac84919299c20a25341fd61234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Nov 2013 19:58:58 +0100 Subject: [PATCH 013/105] Audio: use Containers::Array instead of naked allocation in Source. --- src/Audio/Source.cpp | 52 +++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/src/Audio/Source.cpp b/src/Audio/Source.cpp index 8eba148bc..aaa0ab9d4 100644 --- a/src/Audio/Source.cpp +++ b/src/Audio/Source.cpp @@ -24,6 +24,8 @@ #include "Source.h" +#include + #include "Audio/Buffer.h" namespace Magnum { namespace Audio { @@ -37,8 +39,8 @@ Source& Source::setBuffer(Buffer* buffer) { namespace { -const ALuint* sourceIds(const std::initializer_list& sources) { - ALuint* const ids = new ALuint[sources.size()]; +Containers::Array sourceIds(const std::initializer_list& sources) { + Containers::Array ids(sources.size()); for(auto it = sources.begin(); it != sources.end(); ++it) { CORRADE_INTERNAL_ASSERT(*it); ids[it-sources.begin()] = (*it)->id(); @@ -46,8 +48,8 @@ const ALuint* sourceIds(const std::initializer_list& sources) { return ids; } -const ALuint* sourceIds(const std::vector& sources) { - ALuint* const ids = new ALuint[sources.size()]; +Containers::Array sourceIds(const std::vector& sources) { + Containers::Array ids(sources.size()); for(auto it = sources.begin(); it != sources.end(); ++it) { CORRADE_INTERNAL_ASSERT(*it); ids[it-sources.begin()] = (*it)->id(); @@ -57,54 +59,44 @@ const ALuint* sourceIds(const std::vector& sources) { } -/** @todo Okay, this is too much code copying even for me */ - void Source::play(std::initializer_list sources) { - const ALuint* const ids = sourceIds(sources); - alSourcePlayv(sources.size(), ids); - delete[] ids; + const auto ids = sourceIds(sources); + alSourcePlayv(ids.size(), ids); } void Source::play(const std::vector& sources) { - const ALuint* const ids = sourceIds(sources); - alSourcePlayv(sources.size(), ids); - delete[] ids; + const auto ids = sourceIds(sources); + alSourcePlayv(ids.size(), ids); } void Source::pause(std::initializer_list sources) { - const ALuint* const ids = sourceIds(sources); - alSourcePausev(sources.size(), ids); - delete[] ids; + const auto ids = sourceIds(sources); + alSourcePausev(ids.size(), ids); } void Source::pause(const std::vector& sources) { - const ALuint* const ids = sourceIds(sources); - alSourcePausev(sources.size(), ids); - delete[] ids; + const auto ids = sourceIds(sources); + alSourcePausev(ids.size(), ids); } void Source::stop(std::initializer_list sources) { - const ALuint* const ids = sourceIds(sources); - alSourceStopv(sources.size(), ids); - delete[] ids; + const auto ids = sourceIds(sources); + alSourceStopv(ids.size(), ids); } void Source::stop(const std::vector& sources) { - const ALuint* const ids = sourceIds(sources); - alSourceStopv(sources.size(), ids); - delete[] ids; + const auto ids = sourceIds(sources); + alSourceStopv(ids.size(), ids); } void Source::rewind(std::initializer_list sources) { - const ALuint* const ids = sourceIds(sources); - alSourceRewindv(sources.size(), ids); - delete[] ids; + const auto ids = sourceIds(sources); + alSourceRewindv(ids.size(), ids); } void Source::rewind(const std::vector& sources) { - const ALuint* const ids = sourceIds(sources); - alSourceRewindv(sources.size(), ids); - delete[] ids; + const auto ids = sourceIds(sources); + alSourceRewindv(ids.size(), ids); } Debug operator<<(Debug debug, const Source::State value) { From e491a0d7b6bc10a8cb5ed1ae3b5de3f93847ba3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Nov 2013 20:37:45 +0100 Subject: [PATCH 014/105] Fixed Buffer documentation to reflect set*Data() changes. --- src/Buffer.h | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/Buffer.h b/src/Buffer.h index 38995580d..d6ed27002 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -50,23 +50,14 @@ data updates. @section Buffer-data Data updating Default way to set or update buffer data with setData() or setSubData() is to -explicitly specify data size and pass the pointer to it: +use @ref Corrade::Containers::ArrayReference. See its documentation for more +information about automatic conversions etc. @code -Buffer buffer; -Vector3* data = new Vector3[200]; -buffer.setData(200*sizeof(Vector3), data, Buffer::Usage::StaticDraw); -@endcode -Howewer, in some cases, you have the data in fixed-size array with size known -at compile time. There is an convenient overload which detects the size of -passed array, so you don't have to repeat it: -@code -Vector3 data[] = { - // ... -}; +Containers::ArrayReference data; buffer.setData(data, Buffer::Usage::StaticDraw); @endcode -There is also overload for array-like containers from STL, such as `std::vector` or -`std::array`: +There is also overload for array-like containers from STL, such as `std::vector` +or `std::array`: @code std::vector data; buffer.setData(data, Buffer::Usage::StaticDraw); @@ -75,12 +66,12 @@ buffer.setData(data, Buffer::Usage::StaticDraw); @subsection Buffer-data-mapping Memory mapping %Buffer data can be also updated asynchronously. First you need to allocate -the buffer to desired size by passing `nullptr` to setData(), e.g.: +the buffer to desired size by passing `nullptr` to @ref setData(), e.g.: @code -buffer.setData(200*sizeof(Vector3)), nullptr, Buffer::Usage::StaticDraw); +buffer.setData({nullptr, 200*sizeof(Vector3)}, Buffer::Usage::StaticDraw); @endcode Then you can map the buffer to client memory and operate with the memory -directly. After you are done with the operation, call unmap() to unmap the +directly. After you are done with the operation, call @ref unmap() to unmap the buffer again. @code Vector3* data = static_cast(buffer.map(0, 200*sizeof(Vector3), Buffer::MapFlag::Write|Buffer::MapFlag::InvalidateBuffer)); @@ -89,8 +80,8 @@ for(std::size_t i = 0; i != 200; ++i) CORRADE_INTERNAL_ASSERT_OUTPUT(buffer.unmap()); @endcode If you are updating only a few discrete portions of the buffer, you can use -@ref MapFlag::FlushExplicit and flushMappedRange() to reduce number of memory -operations performed by OpenGL on unmapping. Example: +@ref MapFlag::FlushExplicit and @ref flushMappedRange() to reduce number of +memory operations performed by OpenGL on unmapping. Example: @code Vector3* data = static_cast(buffer.map(0, 200*sizeof(Vector3), Buffer::MapFlag::Write|Buffer::MapFlag::FlushExplicit)); for(std::size_t i: {7, 27, 56, 128}) { From b0c0e2d92da9db1cb9ea0da92be2d983cb06e91a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Nov 2013 23:00:26 +0100 Subject: [PATCH 015/105] MeshTools: return Containers::Array instead of pointer from compressIndices(). This is source-incompatible change, but this function probably wasn't used much in user code, rather its Mesh/Buffer convenience overload. Actually Containers::Array has _implicit_ conversion operator to char*, but this should not be an issue, as the conversion is not allowed on rvalue references, thus the following code shouldn't compile at all. Not available on GCC < 4.8.1, though. // ... char* data; std::tie(..., data) = MeshTools::compressIndices(...); --- src/MeshTools/CompressIndices.cpp | 18 ++++++++---------- src/MeshTools/CompressIndices.h | 13 ++++--------- src/MeshTools/Test/CompressIndicesTest.cpp | 22 ++++++++-------------- 3 files changed, 20 insertions(+), 33 deletions(-) diff --git a/src/MeshTools/CompressIndices.cpp b/src/MeshTools/CompressIndices.cpp index e81c890c9..c2b54c1a7 100644 --- a/src/MeshTools/CompressIndices.cpp +++ b/src/MeshTools/CompressIndices.cpp @@ -38,17 +38,17 @@ template<> constexpr Mesh::IndexType indexType() { return Mesh::In template<> constexpr Mesh::IndexType indexType() { return Mesh::IndexType::UnsignedShort; } template<> constexpr Mesh::IndexType indexType() { return Mesh::IndexType::UnsignedInt; } -template inline std::tuple compress(const std::vector& indices) { - char* buffer = new char[indices.size()*sizeof(T)]; +template inline std::tuple> compress(const std::vector& indices) { + Containers::Array buffer(indices.size()*sizeof(T)); for(std::size_t i = 0; i != indices.size(); ++i) { T index = static_cast(indices[i]); - std::memcpy(buffer+i*sizeof(T), &index, sizeof(T)); + std::memcpy(buffer.begin()+i*sizeof(T), &index, sizeof(T)); } - return std::make_tuple(indices.size(), indexType(), buffer); + return std::make_tuple(indices.size(), indexType(), std::move(buffer)); } -std::tuple compressIndicesInternal(const std::vector& indices, UnsignedInt max) { +std::tuple> compressIndicesInternal(const std::vector& indices, UnsignedInt max) { switch(Math::log(256, max)) { case 0: return compress(indices); @@ -65,7 +65,7 @@ std::tuple compressIndicesInternal(const st } -std::tuple compressIndices(const std::vector& indices) { +std::tuple> compressIndices(const std::vector& indices) { return compressIndicesInternal(indices, *std::max_element(indices.begin(), indices.end())); } @@ -76,14 +76,12 @@ void compressIndices(Mesh& mesh, Buffer& buffer, Buffer::Usage usage, const std: std::size_t indexCount; Mesh::IndexType indexType; - char* data; + Containers::Array data; std::tie(indexCount, indexType, data) = compressIndicesInternal(indices, *minmax.second); mesh.setIndexCount(indices.size()) .setIndexBuffer(buffer, 0, indexType, *minmax.first, *minmax.second); - buffer.setData({data, indexCount*Mesh::indexSize(indexType)}, usage); - - delete[] data; + buffer.setData(data, usage); } }} diff --git a/src/MeshTools/CompressIndices.h b/src/MeshTools/CompressIndices.h index 4acf0ff3b..b233b5eb8 100644 --- a/src/MeshTools/CompressIndices.h +++ b/src/MeshTools/CompressIndices.h @@ -40,28 +40,23 @@ namespace Magnum { namespace MeshTools { /** @brief Compress vertex indices @param indices Index array -@return Index count, type and compressed index array. Deleting the array is - user responsibility. +@return Index count, type and compressed index array This function takes index array and outputs them compressed to smallest possible size. For example when your indices have maximum number 463, it's wasteful to store them in array of 32bit integers, array of 16bit integers is -sufficient. Size of the buffer can be computed from index count and type, as -shown below. Example usage: +sufficient. Example usage: @code std::size_t indexCount; Mesh::IndexType indexType; -char* data; +Containers::Array data; std::tie(indexCount, indexType, data) = MeshTools::compressIndices(indices); -std::size_t dataSize = indexCount*Mesh::indexSize(indexType); -// ... -delete[] data; @endcode See also compressIndices(Mesh*, Buffer*, Buffer::Usage, const std::vector&), which writes the compressed data directly into index buffer of given mesh. */ -std::tuple MAGNUM_MESHTOOLS_EXPORT compressIndices(const std::vector& indices); +std::tuple> MAGNUM_MESHTOOLS_EXPORT compressIndices(const std::vector& indices); /** @brief Compress vertex indices and write them to index buffer diff --git a/src/MeshTools/Test/CompressIndicesTest.cpp b/src/MeshTools/Test/CompressIndicesTest.cpp index e4a7b0f1d..bee8535d5 100644 --- a/src/MeshTools/Test/CompressIndicesTest.cpp +++ b/src/MeshTools/Test/CompressIndicesTest.cpp @@ -47,48 +47,44 @@ CompressIndicesTest::CompressIndicesTest() { void CompressIndicesTest::compressChar() { std::size_t indexCount; Mesh::IndexType indexType; - char* data; + Containers::Array data; std::tie(indexCount, indexType, data) = MeshTools::compressIndices( std::vector{1, 2, 3, 0, 4}); CORRADE_COMPARE(indexCount, 5); CORRADE_VERIFY(indexType == Mesh::IndexType::UnsignedByte); - CORRADE_COMPARE(std::vector(data, data+indexCount*Mesh::indexSize(indexType)), + CORRADE_COMPARE(std::vector(data.begin(), data.end()), (std::vector{ 0x01, 0x02, 0x03, 0x00, 0x04 })); - - delete[] data; } void CompressIndicesTest::compressShort() { std::size_t indexCount; Mesh::IndexType indexType; - char* data; + Containers::Array data; std::tie(indexCount, indexType, data) = MeshTools::compressIndices( std::vector{1, 256, 0, 5}); CORRADE_COMPARE(indexCount, 4); CORRADE_VERIFY(indexType == Mesh::IndexType::UnsignedShort); if(!Utility::Endianness::isBigEndian()) { - CORRADE_COMPARE(std::vector(data, data+indexCount*Mesh::indexSize(indexType)), + CORRADE_COMPARE(std::vector(data.begin(), data.end()), (std::vector{ 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x05, 0x00 })); } else { - CORRADE_COMPARE(std::vector(data, data+indexCount*Mesh::indexSize(indexType)), + CORRADE_COMPARE(std::vector(data.begin(), data.end()), (std::vector{ 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05 })); } - - delete[] data; } void CompressIndicesTest::compressInt() { std::size_t indexCount; Mesh::IndexType indexType; - char* data; + Containers::Array data; std::tie(indexCount, indexType, data) = MeshTools::compressIndices( std::vector{65536, 3, 2}); @@ -96,18 +92,16 @@ void CompressIndicesTest::compressInt() { CORRADE_VERIFY(indexType == Mesh::IndexType::UnsignedInt); if(!Utility::Endianness::isBigEndian()) { - CORRADE_COMPARE(std::vector(data, data+indexCount*Mesh::indexSize(indexType)), + CORRADE_COMPARE(std::vector(data.begin(), data.end()), (std::vector{ 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 })); } else { - CORRADE_COMPARE(std::vector(data, data+indexCount*Mesh::indexSize(indexType)), + CORRADE_COMPARE(std::vector(data.begin(), data.end()), (std::vector{ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02 })); } - - delete[] data; } }}} From 4da0f4497f830eca5601c950d3944650ae50a663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Nov 2013 23:02:02 +0100 Subject: [PATCH 016/105] MeshTools: return Containers::Array also from interleave(). --- src/MeshTools/Interleave.h | 27 ++++++++++++--------------- src/MeshTools/Test/InterleaveTest.cpp | 18 ++++++------------ 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/src/MeshTools/Interleave.h b/src/MeshTools/Interleave.h index 27203196c..6d3034ad6 100644 --- a/src/MeshTools/Interleave.h +++ b/src/MeshTools/Interleave.h @@ -42,31 +42,31 @@ namespace Implementation { class Interleave { public: - Interleave(): _attributeCount(0), _stride(0), _data(nullptr) {} + Interleave(): _attributeCount(0), _stride(0) {} - template std::tuple operator()(const T&... attributes) { + template std::tuple> operator()(const T&... attributes) { /* Compute buffer size and stride */ _attributeCount = attributeCount(attributes...); + Containers::Array data; if(_attributeCount && _attributeCount != ~std::size_t(0)) { _stride = stride(attributes...); /* Create output buffer */ - _data = new char[_attributeCount*_stride]; + data = Containers::Array(_attributeCount*_stride); /* Save the data */ - write(_data, attributes...); + write(data.begin(), attributes...); } - return std::make_tuple(_attributeCount, _stride, _data); + return std::make_tuple(_attributeCount, _stride, std::move(data)); } template void operator()(Mesh& mesh, Buffer& buffer, Buffer::Usage usage, const T&... attributes) { - operator()(attributes...); + Containers::Array data; + std::tie(std::ignore, std::ignore, data) = operator()(attributes...); mesh.setVertexCount(_attributeCount); - buffer.setData({_data, _attributeCount*_stride}, usage); - - delete[] _data; + buffer.setData({data, _attributeCount*_stride}, usage); } /* Specialization for only one attribute array */ @@ -126,7 +126,6 @@ class Interleave { std::size_t _attributeCount; std::size_t _stride; - char* _data; }; } @@ -146,11 +145,9 @@ std::vector positions; std::vector textureCoordinates; std::size_t attributeCount; std::size_t stride; -char* data; +Containers::Array data; std::tie(attributeCount, stride, data) = MeshTools::interleave(positions, textureCoordinates); -std::size_t dataSize = attributeCount*stride; // ... -delete[] data; @endcode It's often desirable to align data for one vertex on 32bit boundaries. To @@ -161,7 +158,7 @@ std::vector weights; std::vector> vertexColors; std::size_t attributeCount; std::size_t stride; -char* data; +Containers::Array data; std::tie(attributeCount, stride, data) = MeshTools::interleave(positions, weights, 2, textureCoordinates, 1); @endcode This way vertex stride is 24 bytes, without gaps it would be 21 bytes, causing @@ -178,7 +175,7 @@ See also interleave(Mesh*, Buffer*, Buffer::Usage, const T&...), which writes the interleaved array directly into buffer of given mesh. */ /* enable_if to avoid clash with overloaded function below */ -template inline typename std::enable_if::value, std::tuple>::type interleave(const T& first, const U&... next) { +template inline typename std::enable_if::value, std::tuple>>::type interleave(const T& first, const U&... next) { return Implementation::Interleave()(first, next...); } diff --git a/src/MeshTools/Test/InterleaveTest.cpp b/src/MeshTools/Test/InterleaveTest.cpp index beb57aa35..036fe2e8e 100644 --- a/src/MeshTools/Test/InterleaveTest.cpp +++ b/src/MeshTools/Test/InterleaveTest.cpp @@ -84,7 +84,7 @@ void InterleaveTest::strideGaps() { void InterleaveTest::write() { std::size_t attributeCount; std::size_t stride; - char* data; + Containers::Array data; std::tie(attributeCount, stride, data) = MeshTools::interleave( std::vector{0, 1, 2}, std::vector{3, 4, 5}, @@ -92,28 +92,25 @@ void InterleaveTest::write() { CORRADE_COMPARE(attributeCount, std::size_t(3)); CORRADE_COMPARE(stride, std::size_t(7)); - std::size_t size = attributeCount*stride; if(!Utility::Endianness::isBigEndian()) { - CORRADE_COMPARE(std::vector(data, data+size), (std::vector{ + CORRADE_COMPARE(std::vector(data.begin(), data.end()), (std::vector{ 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x02, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00 })); } else { - CORRADE_COMPARE(std::vector(data, data+size), (std::vector{ + CORRADE_COMPARE(std::vector(data.begin(), data.end()), (std::vector{ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x06, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x07, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x08 })); } - - delete[] data; } void InterleaveTest::writeGaps() { std::size_t attributeCount; std::size_t stride; - char* data; + Containers::Array data; std::tie(attributeCount, stride, data) = MeshTools::interleave( std::vector{0, 1, 2}, 3, std::vector{3, 4, 5}, @@ -121,25 +118,22 @@ void InterleaveTest::writeGaps() { CORRADE_COMPARE(attributeCount, std::size_t(3)); CORRADE_COMPARE(stride, std::size_t(12)); - std::size_t size = attributeCount*stride; if(!Utility::Endianness::isBigEndian()) { /* byte, _____________gap, int___________________, short_____, _______gap */ - CORRADE_COMPARE(std::vector(data, data+size), (std::vector{ + CORRADE_COMPARE(std::vector(data.begin(), data.end()), (std::vector{ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00 })); } else { /* byte, _____________gap, ___________________int, _____short, _______gap */ - CORRADE_COMPARE(std::vector(data, data+size), (std::vector{ + CORRADE_COMPARE(std::vector(data.begin(), data.end()), (std::vector{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00 })); } - - delete[] data; } }}} From 4aadfd082821e2aff73ca51053f1c37f6da079a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Nov 2013 22:34:03 +0100 Subject: [PATCH 017/105] Math: fixed *::data() documentation. --- src/Math/RectangularMatrix.h | 2 +- src/Math/Vector.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Math/RectangularMatrix.h b/src/Math/RectangularMatrix.h index 12e57610a..cbb0a685f 100644 --- a/src/Math/RectangularMatrix.h +++ b/src/Math/RectangularMatrix.h @@ -159,7 +159,7 @@ template class RectangularMatrix { /** * @brief Raw data - * @return One-dimensional array of `size*size` length in column-major + * @return One-dimensional array of `cols*rows` length in column-major * order. * * @see operator[] diff --git a/src/Math/Vector.h b/src/Math/Vector.h index 25b0922a0..645b1b256 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -180,7 +180,7 @@ template class Vector { /** * @brief Raw data - * @return One-dimensional array of `size*size` length. + * @return One-dimensional array of `size` length. * * @see operator[]() */ From add989703e694f7719e015cc12717d9953de0322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Nov 2013 22:34:23 +0100 Subject: [PATCH 018/105] Math: don't allow *::data() to be called on rvalues. There are more cases that should be fixed, but this is the most problematic one, as this might look completely innocent: Vector2 a, b; float* c = (a + b).data(); Unlike this, which looks suspicious: Vector2& c = a + b; --- src/Math/RectangularMatrix.h | 16 ++++++++++++++-- src/Math/Vector.h | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/Math/RectangularMatrix.h b/src/Math/RectangularMatrix.h index cbb0a685f..89b365c56 100644 --- a/src/Math/RectangularMatrix.h +++ b/src/Math/RectangularMatrix.h @@ -164,8 +164,20 @@ template class RectangularMatrix { * * @see operator[] */ - T* data() { return _data[0].data(); } - constexpr const T* data() const { return _data[0].data(); } /**< @overload */ + T* data() + #ifndef CORRADE_GCC47_COMPATIBILITY + & + #endif + { return _data[0].data(); } + + /** @overload */ + constexpr const T* data() + #ifndef CORRADE_GCC47_COMPATIBILITY + const & + #else + const + #endif + { return _data[0].data(); } /** * @brief %Matrix column diff --git a/src/Math/Vector.h b/src/Math/Vector.h index 645b1b256..de6c77881 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -184,8 +184,20 @@ template class Vector { * * @see operator[]() */ - T* data() { return _data; } - constexpr const T* data() const { return _data; } /**< @overload */ + T* data() + #ifndef CORRADE_GCC47_COMPATIBILITY + & + #endif + { return _data; } + + /** @overload */ + constexpr const T* data() + #ifndef CORRADE_GCC47_COMPATIBILITY + const & + #else + const + #endif + { return _data; } /** * @brief Value at given position From 81f02a24c6118249fc92a114cb721040d9d8a33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 19 Nov 2013 13:31:06 +0100 Subject: [PATCH 019/105] Shaders: compile shaders also for GLSL 1.50 (GL 3.2). It seems that ARB_explicit_attrib_location is not supported on GLSL 1.40 on OSX (even that the support is advertised). --- src/Shaders/DistanceFieldVector.cpp | 2 +- src/Shaders/Flat.cpp | 2 +- src/Shaders/Phong.cpp | 2 +- src/Shaders/Vector.cpp | 2 +- src/Shaders/VertexColor.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Shaders/DistanceFieldVector.cpp b/src/Shaders/DistanceFieldVector.cpp index 0916f30d5..d26e2280a 100644 --- a/src/Shaders/DistanceFieldVector.cpp +++ b/src/Shaders/DistanceFieldVector.cpp @@ -42,7 +42,7 @@ template DistanceFieldVector::DistanceFieldV Utility::Resource rs("MagnumShaders"); #ifndef MAGNUM_TARGET_GLES - const Version version = Context::current()->supportedVersion({Version::GL310, Version::GL300, Version::GL210}); + const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); #else const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); #endif diff --git a/src/Shaders/Flat.cpp b/src/Shaders/Flat.cpp index 2ed8c5dcd..7f3f289ae 100644 --- a/src/Shaders/Flat.cpp +++ b/src/Shaders/Flat.cpp @@ -41,7 +41,7 @@ template Flat::Flat(const Flags flags): tran Utility::Resource rs("MagnumShaders"); #ifndef MAGNUM_TARGET_GLES - const Version version = Context::current()->supportedVersion({Version::GL310, Version::GL300, Version::GL210}); + const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); #else const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); #endif diff --git a/src/Shaders/Phong.cpp b/src/Shaders/Phong.cpp index 62366837a..a6e2bce8b 100644 --- a/src/Shaders/Phong.cpp +++ b/src/Shaders/Phong.cpp @@ -35,7 +35,7 @@ Phong::Phong(const Flags flags): transformationMatrixUniform(0), projectionMatri Utility::Resource rs("MagnumShaders"); #ifndef MAGNUM_TARGET_GLES - const Version version = Context::current()->supportedVersion({Version::GL310, Version::GL300, Version::GL210}); + const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); #else const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); #endif diff --git a/src/Shaders/Vector.cpp b/src/Shaders/Vector.cpp index 301ef4770..76ee1da9b 100644 --- a/src/Shaders/Vector.cpp +++ b/src/Shaders/Vector.cpp @@ -42,7 +42,7 @@ template Vector::Vector(): transformationPro Utility::Resource rs("MagnumShaders"); #ifndef MAGNUM_TARGET_GLES - const Version version = Context::current()->supportedVersion({Version::GL310, Version::GL300, Version::GL210}); + const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); #else const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); #endif diff --git a/src/Shaders/VertexColor.cpp b/src/Shaders/VertexColor.cpp index d059949e2..7cccca382 100644 --- a/src/Shaders/VertexColor.cpp +++ b/src/Shaders/VertexColor.cpp @@ -41,7 +41,7 @@ template VertexColor::VertexColor(): transfo Utility::Resource rs("MagnumShaders"); #ifndef MAGNUM_TARGET_GLES - const Version version = Context::current()->supportedVersion({Version::GL310, Version::GL300, Version::GL210}); + const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); #else const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); #endif From 01f6553fd66d385ca96960ed08f0635149671d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 19 Nov 2013 20:30:25 +0100 Subject: [PATCH 020/105] Math: simplified Vector*::*Axis() and Vector*::*Scale() functions. --- src/Math/Vector2.h | 8 ++++---- src/Math/Vector3.h | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Math/Vector2.h b/src/Math/Vector2.h index 5f7d31968..0d77e00e4 100644 --- a/src/Math/Vector2.h +++ b/src/Math/Vector2.h @@ -51,7 +51,7 @@ template class Vector2: public Vector<2, T> { * @endcode * @see yAxis(), xScale(), Matrix3::right() */ - constexpr static Vector2 xAxis(T length = T(1)) { return Vector2(length, T()); } + constexpr static Vector2 xAxis(T length = T(1)) { return {length, T(0)}; } /** * @brief %Vector in direction of Y axis (up) @@ -59,7 +59,7 @@ template class Vector2: public Vector<2, T> { * See xAxis() for more information. * @see yScale(), Matrix3::up() */ - constexpr static Vector2 yAxis(T length = T(1)) { return Vector2(T(), length); } + constexpr static Vector2 yAxis(T length = T(1)) { return {T(0), length}; } /** * @brief Scaling vector in direction of X axis (width) @@ -70,7 +70,7 @@ template class Vector2: public Vector<2, T> { * @endcode * @see yScale(), xAxis() */ - constexpr static Vector2 xScale(T scale) { return Vector2(scale, T(1)); } + constexpr static Vector2 xScale(T scale) { return {scale, T(1)}; } /** * @brief Scaling vector in direction of Y axis (height) @@ -78,7 +78,7 @@ template class Vector2: public Vector<2, T> { * See xScale() for more information. * @see yAxis() */ - constexpr static Vector2 yScale(T scale) { return Vector2(T(1), scale); } + constexpr static Vector2 yScale(T scale) { return {T(1), scale}; } /** * @brief 2D cross product diff --git a/src/Math/Vector3.h b/src/Math/Vector3.h index 4da38e208..ea1ff8411 100644 --- a/src/Math/Vector3.h +++ b/src/Math/Vector3.h @@ -53,7 +53,7 @@ template class Vector3: public Vector<3, T> { * @endcode * @see yAxis(), zAxis(), xScale(), Matrix4::right() */ - constexpr static Vector3 xAxis(T length = T(1)) { return Vector3(length, T(), T()); } + constexpr static Vector3 xAxis(T length = T(1)) { return {length, T(), T()}; } /** * @brief %Vector in direction of Y axis (up) @@ -61,7 +61,7 @@ template class Vector3: public Vector<3, T> { * See xAxis() for more information. * @see yScale(), Matrix4::up() */ - constexpr static Vector3 yAxis(T length = T(1)) { return Vector3(T(), length, T()); } + constexpr static Vector3 yAxis(T length = T(1)) { return {T(), length, T()}; } /** * @brief %Vector in direction of Z axis (backward) @@ -69,7 +69,7 @@ template class Vector3: public Vector<3, T> { * See xAxis() for more information. * @see zScale(), Matrix4::backward() */ - constexpr static Vector3 zAxis(T length = T(1)) { return Vector3(T(), T(), length); } + constexpr static Vector3 zAxis(T length = T(1)) { return {T(), T(), length}; } /** * @brief Scaling vector in direction of X axis (width) @@ -80,7 +80,7 @@ template class Vector3: public Vector<3, T> { * @endcode * @see yScale(), zScale(), xAxis() */ - constexpr static Vector3 xScale(T scale) { return Vector3(scale, T(1), T(1)); } + constexpr static Vector3 xScale(T scale) { return {scale, T(1), T(1)}; } /** * @brief Scaling vector in direction of Y axis (height) @@ -88,7 +88,7 @@ template class Vector3: public Vector<3, T> { * See xScale() for more information. * @see yAxis() */ - constexpr static Vector3 yScale(T scale) { return Vector3(T(1), scale, T(1)); } + constexpr static Vector3 yScale(T scale) { return {T(1), scale, T(1)}; } /** * @brief Scaling vector in direction of Z axis (depth) @@ -96,7 +96,7 @@ template class Vector3: public Vector<3, T> { * See xScale() for more information. * @see zAxis() */ - constexpr static Vector3 zScale(T scale) { return Vector3(T(1), T(1), scale); } + constexpr static Vector3 zScale(T scale) { return {T(1), T(1), scale}; } /** * @brief Cross product From 842c263d51f0874ca6d3f576d6fd615bc373c466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 19 Nov 2013 20:31:31 +0100 Subject: [PATCH 021/105] Color: internal helper function renaming. Will be used also elsewhere than for alpha only. --- src/Color.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Color.h b/src/Color.h index 2cc4e2ba1..08ded9936 100644 --- a/src/Color.h +++ b/src/Color.h @@ -123,11 +123,11 @@ template inline typename BasicColor3::HSV toHSV(typename std::enable return toHSV::FloatingPointType>(Math::normalize::FloatingPointType>>(color)); } -/* Default alpha value */ -template inline constexpr typename std::enable_if::value, T>::type defaultAlpha() { +/* Value for full channel (1.0f for floats, 255 for unsigned byte) */ +template inline constexpr typename std::enable_if::value, T>::type fullChannel() { return T(1); } -template inline constexpr typename std::enable_if::value, T>::type defaultAlpha() { +template inline constexpr typename std::enable_if::value, T>::type fullChannel() { return std::numeric_limits::max(); } @@ -281,7 +281,7 @@ class BasicColor4: public Math::Vector4 { * @param a Alpha value, defaults to 1.0 for floating-point types * and maximum positive value for integral types. */ - constexpr static BasicColor4 fromHSV(HSV hsv, T a = Implementation::defaultAlpha()) { + constexpr static BasicColor4 fromHSV(HSV hsv, T a = Implementation::fullChannel()) { return BasicColor4(Implementation::fromHSV(hsv), a); } /** @overload */ @@ -295,14 +295,14 @@ class BasicColor4: public Math::Vector4 { * RGB components are set to zero, A component is set to 1.0 for * floating-point types and maximum positive value for integral types. */ - constexpr /*implicit*/ BasicColor4(): Math::Vector4(T(0), T(0), T(0), Implementation::defaultAlpha()) {} + constexpr /*implicit*/ BasicColor4(): Math::Vector4(T(0), T(0), T(0), Implementation::fullChannel()) {} /** * @copydoc BasicColor3::BasicColor3(T) * @param alpha Alpha value, defaults to 1.0 for floating-point types * and maximum positive value for integral types. */ - constexpr explicit BasicColor4(T rgb, T alpha = Implementation::defaultAlpha()): Math::Vector4(rgb, rgb, rgb, alpha) {} + constexpr explicit BasicColor4(T rgb, T alpha = Implementation::fullChannel()): Math::Vector4(rgb, rgb, rgb, alpha) {} /** * @brief Constructor @@ -312,7 +312,7 @@ class BasicColor4: public Math::Vector4 { * @param a A value, defaults to 1.0 for floating-point types and * maximum positive value for integral types. */ - constexpr /*implicit*/ BasicColor4(T r, T g, T b, T a = Implementation::defaultAlpha()): Math::Vector4(r, g, b, a) {} + constexpr /*implicit*/ BasicColor4(T r, T g, T b, T a = Implementation::fullChannel()): Math::Vector4(r, g, b, a) {} /** * @brief Constructor @@ -321,7 +321,7 @@ class BasicColor4: public Math::Vector4 { */ /* Not marked as explicit, because conversion from BasicColor3 to BasicColor4 is fairly common, nearly always with A set to 1 */ - constexpr /*implicit*/ BasicColor4(const Math::Vector3& rgb, T a = Implementation::defaultAlpha()): Math::Vector4(rgb[0], rgb[1], rgb[2], a) {} + constexpr /*implicit*/ BasicColor4(const Math::Vector3& rgb, T a = Implementation::fullChannel()): Math::Vector4(rgb[0], rgb[1], rgb[2], a) {} /** @copydoc Math::Vector::Vector(const Vector&) */ template constexpr explicit BasicColor4(const Math::Vector<4, U>& other): Math::Vector4(other) {} From ab651bb61c12e32df014f417ab806cd3574a6a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 19 Nov 2013 21:00:52 +0100 Subject: [PATCH 022/105] Various minor cleanup. --- src/Math/Test/Matrix3Test.cpp | 5 ++--- src/Math/Test/Matrix4Test.cpp | 5 ++--- src/Math/Test/RectangularMatrixTest.cpp | 5 ++--- src/Math/Test/Vector2Test.cpp | 10 ++++------ src/Math/Test/Vector3Test.cpp | 10 ++++------ src/Math/Test/Vector4Test.cpp | 10 ++++------ src/Math/Test/VectorTest.cpp | 10 ++++------ src/Math/Vector3.h | 1 - src/Test/ColorTest.cpp | 4 ++-- 9 files changed, 24 insertions(+), 36 deletions(-) diff --git a/src/Math/Test/Matrix3Test.cpp b/src/Math/Test/Matrix3Test.cpp index 3349e6dcb..255927bfe 100644 --- a/src/Math/Test/Matrix3Test.cpp +++ b/src/Math/Test/Matrix3Test.cpp @@ -162,10 +162,9 @@ void Matrix3Test::constructConversion() { {4.5f, 4.0f, 7.0f}, {7.9f, -1.0f, 8.0f}); #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Matrix3i b(a); - #else - Matrix3i b(a); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Matrix3i b(a); CORRADE_COMPARE(b, Matrix3i({3, 5, 8}, {4, 4, 7}, {7, -1, 8})); diff --git a/src/Math/Test/Matrix4Test.cpp b/src/Math/Test/Matrix4Test.cpp index 106f6d4ad..d363351fd 100644 --- a/src/Math/Test/Matrix4Test.cpp +++ b/src/Math/Test/Matrix4Test.cpp @@ -181,10 +181,9 @@ void Matrix4Test::constructConversion() { {1.0f, 2.0f, 3.0f, -1.0f}, {7.9f, -1.0f, 8.0f, -1.5f}); #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Matrix4i b(a); - #else - Matrix4i b(a); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Matrix4i b(a); CORRADE_COMPARE(b, Matrix4i({3, 5, 8, -3}, {4, 4, 7, 2}, {1, 2, 3, -1}, diff --git a/src/Math/Test/RectangularMatrixTest.cpp b/src/Math/Test/RectangularMatrixTest.cpp index d77e97289..872c253ee 100644 --- a/src/Math/Test/RectangularMatrixTest.cpp +++ b/src/Math/Test/RectangularMatrixTest.cpp @@ -155,10 +155,9 @@ void RectangularMatrixTest::constructConversion() { constexpr Matrix2x2 a(Vector2( 1.3f, 2.7f), Vector2(-15.0f, 7.0f)); #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Matrix2x2i b(a); - #else - Matrix2x2i b(a); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Matrix2x2i b(a); CORRADE_COMPARE(b, Matrix2x2i(Vector2i( 1, 2), Vector2i(-15, 7))); diff --git a/src/Math/Test/Vector2Test.cpp b/src/Math/Test/Vector2Test.cpp index 902bbf5fa..d36c8e935 100644 --- a/src/Math/Test/Vector2Test.cpp +++ b/src/Math/Test/Vector2Test.cpp @@ -111,10 +111,9 @@ void Vector2Test::constructDefault() { void Vector2Test::constructOneValue() { #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Vector2 a(3.0f); - #else - Vector2 a(3.0f); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Vector2 a(3.0f); CORRADE_COMPARE(a, Vector2(3.0f, 3.0f)); /* Implicit conversion is not allowed */ @@ -124,10 +123,9 @@ void Vector2Test::constructOneValue() { void Vector2Test::constructConversion() { constexpr Vector2 a(1.5f, 2.5f); #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Vector2i b(a); - #else - Vector2i b(a); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Vector2i b(a); CORRADE_COMPARE(b, Vector2i(1, 2)); /* Implicit conversion is not allowed */ diff --git a/src/Math/Test/Vector3Test.cpp b/src/Math/Test/Vector3Test.cpp index 1ad831a5b..291a4cf08 100644 --- a/src/Math/Test/Vector3Test.cpp +++ b/src/Math/Test/Vector3Test.cpp @@ -111,10 +111,9 @@ void Vector3Test::constructDefault() { void Vector3Test::constructOneValue() { #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Vector3 a(-3.0f); - #else - Vector3 a(-3.0f); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Vector3 a(-3.0f); CORRADE_COMPARE(a, Vector3(-3.0f, -3.0f, -3.0f)); /* Implicit conversion is not allowed */ @@ -130,10 +129,9 @@ void Vector3Test::constructParts() { void Vector3Test::constructConversion() { constexpr Vector3 a(1.0f, 2.5f, -3.0f); #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Vector3i b(a); - #else - Vector3i b(a); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Vector3i b(a); CORRADE_COMPARE(b, Vector3i(1, 2, -3)); /* Implicit conversion is not allowed */ diff --git a/src/Math/Test/Vector4Test.cpp b/src/Math/Test/Vector4Test.cpp index 1d9176c77..3759df1c1 100644 --- a/src/Math/Test/Vector4Test.cpp +++ b/src/Math/Test/Vector4Test.cpp @@ -108,10 +108,9 @@ void Vector4Test::constructDefault() { void Vector4Test::constructOneValue() { #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Vector4 a(4.3f); - #else - Vector4 a(4.3f); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Vector4 a(4.3f); CORRADE_COMPARE(a, Vector4(4.3f, 4.3f, 4.3f, 4.3f)); /* Implicit conversion is not allowed */ @@ -127,10 +126,9 @@ void Vector4Test::constructParts() { void Vector4Test::constructConversion() { constexpr Vector4 a(1.0f, -2.5f, 3.0f, 4.1f); #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Vector4i b(a); - #else - Vector4i b(a); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Vector4i b(a); CORRADE_COMPARE(b, Vector4i(1, -2, 3, 4)); /* Implicit conversion is not allowed */ diff --git a/src/Math/Test/VectorTest.cpp b/src/Math/Test/VectorTest.cpp index cd9a8b8d6..a09684da3 100644 --- a/src/Math/Test/VectorTest.cpp +++ b/src/Math/Test/VectorTest.cpp @@ -175,10 +175,9 @@ void VectorTest::constructDefault() { void VectorTest::constructOneValue() { #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Vector4 a(7.25f); - #else - Vector4 a(7.25f); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Vector4 a(7.25f); CORRADE_COMPARE(a, Vector4(7.25f, 7.25f, 7.25f, 7.25f)); @@ -197,10 +196,9 @@ void VectorTest::constructOneComponent() { void VectorTest::constructConversion() { constexpr Vector4 a(1.3f, 2.7f, -15.0f, 7.0f); #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Vector4i b(a); - #else - Vector4i b(a); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Vector4i b(a); CORRADE_COMPARE(b, Vector4i(1, 2, -15, 7)); diff --git a/src/Math/Vector3.h b/src/Math/Vector3.h index ea1ff8411..eaa60390b 100644 --- a/src/Math/Vector3.h +++ b/src/Math/Vector3.h @@ -145,7 +145,6 @@ template class Vector3: public Vector<3, T> { /** @brief Copy constructor */ constexpr Vector3(const Vector<3, T>& other): Vector<3, T>(other) {} - /** * @brief X component * diff --git a/src/Test/ColorTest.cpp b/src/Test/ColorTest.cpp index 657802f65..d50751e41 100644 --- a/src/Test/ColorTest.cpp +++ b/src/Test/ColorTest.cpp @@ -51,8 +51,8 @@ class ColorTest: public TestSuite::Tester { void configuration(); }; -typedef Magnum::BasicColor3 Color3ub; -typedef Magnum::BasicColor4 Color4ub; +typedef BasicColor3 Color3ub; +typedef BasicColor4 Color4ub; ColorTest::ColorTest() { addTests({&ColorTest::fromHue, From 3b91f43e458a3208e027e9fb9e0699d1f31db83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 19 Nov 2013 21:48:06 +0100 Subject: [PATCH 023/105] Properly test all Color constructors. --- src/Test/ColorTest.cpp | 111 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 110 insertions(+), 1 deletion(-) diff --git a/src/Test/ColorTest.cpp b/src/Test/ColorTest.cpp index d50751e41..434e43460 100644 --- a/src/Test/ColorTest.cpp +++ b/src/Test/ColorTest.cpp @@ -34,6 +34,14 @@ class ColorTest: public TestSuite::Tester { public: ColorTest(); + void construct(); + void constructDefault(); + void constructOneValue(); + void constructParts(); + void constructConversion(); + void constructNormalization(); + void constructCopy(); + void fromHue(); void fromSaturation(); void fromValue(); @@ -55,7 +63,15 @@ typedef BasicColor3 Color3ub; typedef BasicColor4 Color4ub; ColorTest::ColorTest() { - addTests({&ColorTest::fromHue, + addTests({&ColorTest::construct, + &ColorTest::constructDefault, + &ColorTest::constructOneValue, + &ColorTest::constructParts, + &ColorTest::constructConversion, + &ColorTest::constructNormalization, + &ColorTest::constructCopy, + + &ColorTest::fromHue, &ColorTest::fromSaturation, &ColorTest::fromValue, @@ -72,6 +88,99 @@ ColorTest::ColorTest() { &ColorTest::configuration}); } +void ColorTest::construct() { + constexpr Color3 a = {1.0f, 0.5f, 0.75f}; + CORRADE_COMPARE(a, Vector3(1.0f, 0.5f, 0.75f)); + + constexpr Color4 b = {1.0f, 0.5f, 0.75f, 0.5f}; + CORRADE_COMPARE(b, Vector4(1.0f, 0.5f, 0.75f, 0.5f)); + + /* Default alpha */ + constexpr Color4 c = {1.0f, 0.5f, 0.75f}; + constexpr Color4ub d = {10, 25, 176}; + CORRADE_COMPARE(c, Vector4(1.0f, 0.5f, 0.75f, 1.0f)); + CORRADE_COMPARE(d, Math::Vector4(10, 25, 176, 255)); +} + +void ColorTest::constructDefault() { + constexpr Vector3 a; + CORRADE_COMPARE(a, Color3(0.0f, 0.0f, 0.0f)); + + constexpr Color4 b; + constexpr Color4ub c; + CORRADE_COMPARE(b, Color4(0.0f, 0.0f, 0.0f, 1.0f)); + CORRADE_COMPARE(c, Color4ub(0, 0, 0, 255)); +} + +void ColorTest::constructOneValue() { + constexpr Color3 a(0.25f); + CORRADE_COMPARE(a, Color3(0.25f, 0.25f, 0.25f)); + + constexpr Color4 b(0.25f, 0.5f); + CORRADE_COMPARE(b, Color4(0.25f, 0.25f, 0.25f, 0.5f)); + + /* Default alpha */ + constexpr Color4 c(0.25f); + constexpr Color4ub d(67); + CORRADE_COMPARE(c, Color4(0.25f, 0.25f, 0.25f, 1.0f)); + CORRADE_COMPARE(d, Color4ub(67, 67, 67, 255)); + + /* Implicit conversion is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); + CORRADE_VERIFY(!(std::is_convertible::value)); +} + +void ColorTest::constructParts() { + constexpr Color3 a(1.0f, 0.5f, 0.75f); + + constexpr Color4 b = {a, 0.25f}; + CORRADE_COMPARE(b, Color4(1.0f, 0.5f, 0.75f, 0.25f)); + + /* Default alpha */ + constexpr Color3ub c(10, 25, 176); + constexpr Color4 d = a; + constexpr Color4ub e = c; + CORRADE_COMPARE(d, Color4(1.0f, 0.5f, 0.75f, 1.0f)); + CORRADE_COMPARE(e, Color4ub(10, 25, 176, 255)); +} + +void ColorTest::constructConversion() { + typedef BasicColor3 Color3d; + typedef BasicColor4 Color4d; + + constexpr Color3 a(1.0f, 0.5f, 0.75f); + constexpr Color3d b(a); + CORRADE_COMPARE(b, Color3d(1.0, 0.5, 0.75)); + + constexpr Color4 c(1.0f, 0.5f, 0.75f, 0.25f); + constexpr Color4d d(c); + CORRADE_COMPARE(d, Color4d(1.0, 0.5, 0.75, 0.25)); + + /* Implicit conversion is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); + CORRADE_VERIFY(!(std::is_convertible::value)); +} + +void ColorTest::constructNormalization() { + constexpr Color3 a(1.0f, 0.5f, 0.75f); + auto b = Math::denormalize(a); + CORRADE_COMPARE(b, Color3ub(255, 127, 191)); + + constexpr Color4 c(1.0f, 0.5f, 0.75f, 0.25f); + auto d = Math::denormalize(c); + CORRADE_COMPARE(d, Color4ub(255, 127, 191, 63)); +} + +void ColorTest::constructCopy() { + constexpr Math::Vector<3, Float> a(1.0f, 0.5f, 0.75f); + constexpr Color3 b(a); + CORRADE_COMPARE(b, Color3(1.0f, 0.5f, 0.75f)); + + constexpr Math::Vector<4, Float> c(1.0f, 0.5f, 0.75f, 0.25f); + constexpr Color4 d(c); + CORRADE_COMPARE(d, Color4(1.0f, 0.5f, 0.75f, 0.25f)); +} + void ColorTest::fromHue() { CORRADE_COMPARE(Color3ub::fromHSV(Deg(27.0f), 1.0f, 1.0f), Color3ub(255, 114, 0)); CORRADE_COMPARE(Color3ub::fromHSV(Deg(86.0f), 1.0f, 1.0f), Color3ub(144, 255, 0)); From 361066fdbf5fb58f76781a8bd1f1d3554fb9eff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 19 Nov 2013 22:10:56 +0100 Subject: [PATCH 024/105] Math: test that constructing vector from parts can be done implicitly. --- src/Math/Test/Vector3Test.cpp | 2 +- src/Math/Test/Vector4Test.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Math/Test/Vector3Test.cpp b/src/Math/Test/Vector3Test.cpp index 291a4cf08..2611283e4 100644 --- a/src/Math/Test/Vector3Test.cpp +++ b/src/Math/Test/Vector3Test.cpp @@ -122,7 +122,7 @@ void Vector3Test::constructOneValue() { void Vector3Test::constructParts() { constexpr Vector2 a(1.0f, 2.0f); - constexpr Vector3 b(a, 3.0f); + constexpr Vector3 b = {a, 3.0f}; CORRADE_COMPARE(b, Vector3(1.0f, 2.0f, 3.0f)); } diff --git a/src/Math/Test/Vector4Test.cpp b/src/Math/Test/Vector4Test.cpp index 3759df1c1..e5480f870 100644 --- a/src/Math/Test/Vector4Test.cpp +++ b/src/Math/Test/Vector4Test.cpp @@ -119,7 +119,7 @@ void Vector4Test::constructOneValue() { void Vector4Test::constructParts() { constexpr Vector3 a(1.0f, 2.0f, 3.0f); - constexpr Vector4 b(a, 4.0f); + constexpr Vector4 b = {a, 4.0f}; CORRADE_COMPARE(b, Vector4(1.0f, 2.0f, 3.0f, 4.0f)); } From ebb855315c167a04c9e8a04f83505343e13f935b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 19 Nov 2013 22:16:46 +0100 Subject: [PATCH 025/105] Updated Color documentation with (de)normalization info. --- src/Color.h | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/Color.h b/src/Color.h index 08ded9936..c4d3c6aa0 100644 --- a/src/Color.h +++ b/src/Color.h @@ -136,9 +136,16 @@ template inline constexpr typename std::enable_if:: /** @brief Three-component (RGB) color -The class can store both floating-point (normalized) and integral -(denormalized) representation of color. You can convert between these two -representations using fromNormalized() and fromDenormalized(). +The class can store either floating-point (normalized) or integral +(denormalized) representation of color. Note that constructor conversion +between different types (like in @ref Math::Vector "Vector" classes) doesn't do +any (de)normalization, you should use @ref Math::normalize() and +@ref Math::denormalize() instead, for example: +@code +typedef BasicColor3 Color3ub; +Color3 a(1.0f, 0.5f, 0.75f); +auto b = Math::denormalize(a); // b == {255, 127, 191} +@endcode Conversion from and to HSV is done always using floating-point types, so hue is always in range in range @f$ [0.0, 360.0] @f$, saturation and value in @@ -196,7 +203,13 @@ template class BasicColor3: public Math::Vector3 { */ constexpr /*implicit*/ BasicColor3(T r, T g, T b): Math::Vector3(r, g, b) {} - /** @copydoc Math::Vector::Vector(const Vector&) */ + /** + * @copydoc Math::Vector::Vector(const Vector&) + * + * @attention This function doesn't do any (de)normalization, use + * @ref Math::normalize() and @ref Math::denormalize() instead. + * See class documentation for more information. + */ template constexpr explicit BasicColor3(const Math::Vector<3, U>& other): Math::Vector3(other) {} /** @brief Copy constructor */ @@ -323,7 +336,13 @@ class BasicColor4: public Math::Vector4 { is fairly common, nearly always with A set to 1 */ constexpr /*implicit*/ BasicColor4(const Math::Vector3& rgb, T a = Implementation::fullChannel()): Math::Vector4(rgb[0], rgb[1], rgb[2], a) {} - /** @copydoc Math::Vector::Vector(const Vector&) */ + /** + * @copydoc Math::Vector::Vector(const Vector&) + * + * @attention This function doesn't do any (de)normalization, use + * @ref Math::normalize() and @ref Math::denormalize() instead. + * See @ref BasicColor3 class documentation for more information. + */ template constexpr explicit BasicColor4(const Math::Vector<4, U>& other): Math::Vector4(other) {} /** @brief Copy constructor */ From beab448b4e25249e3b50874d600dd951d8e3d2a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 19 Nov 2013 22:18:38 +0100 Subject: [PATCH 026/105] Math: be more explicit in what we want to construct. --- src/Math/Vector3.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Math/Vector3.h b/src/Math/Vector3.h index eaa60390b..5beb801ca 100644 --- a/src/Math/Vector3.h +++ b/src/Math/Vector3.h @@ -53,7 +53,7 @@ template class Vector3: public Vector<3, T> { * @endcode * @see yAxis(), zAxis(), xScale(), Matrix4::right() */ - constexpr static Vector3 xAxis(T length = T(1)) { return {length, T(), T()}; } + constexpr static Vector3 xAxis(T length = T(1)) { return {length, T(0), T(0)}; } /** * @brief %Vector in direction of Y axis (up) @@ -61,7 +61,7 @@ template class Vector3: public Vector<3, T> { * See xAxis() for more information. * @see yScale(), Matrix4::up() */ - constexpr static Vector3 yAxis(T length = T(1)) { return {T(), length, T()}; } + constexpr static Vector3 yAxis(T length = T(1)) { return {T(0), length, T(0)}; } /** * @brief %Vector in direction of Z axis (backward) @@ -69,7 +69,7 @@ template class Vector3: public Vector<3, T> { * See xAxis() for more information. * @see zScale(), Matrix4::backward() */ - constexpr static Vector3 zAxis(T length = T(1)) { return {T(), T(), length}; } + constexpr static Vector3 zAxis(T length = T(1)) { return {T(0), T(0), length}; } /** * @brief Scaling vector in direction of X axis (width) From 22dc8170e8ca7a160e47f86931a0a914b6c68edd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 19 Nov 2013 22:20:37 +0100 Subject: [PATCH 027/105] Added Color*::{red,green.blue,cyan,magenta,yellow}() convenience functions. --- src/Color.h | 126 +++++++++++++++++++++++++++++++++++++++++ src/Math/Vector3.h | 21 +++---- src/Test/ColorTest.cpp | 31 ++++++++++ 3 files changed, 168 insertions(+), 10 deletions(-) diff --git a/src/Color.h b/src/Color.h index c4d3c6aa0..00d6ca14f 100644 --- a/src/Color.h +++ b/src/Color.h @@ -157,6 +157,72 @@ range @f$ [0.0, 1.0] @f$. impossible to explicitly instantiate */ template class BasicColor3: public Math::Vector3 { public: + /** + * @brief Red color + * + * Convenience alternative to e.g. `%Color3(red, 0.0f, 0.0f)`. With + * floating-point underlying type equivalent to @ref Vector3::xAxis(). + * @see @ref green(), @ref blue(), @ref cyan() + */ + constexpr static BasicColor3 red(T red = Implementation::fullChannel()) { + return Math::Vector3::xAxis(red); + } + + /** + * @brief Green color + * + * Convenience alternative to e.g. `%Color3(0.0f, green, 0.0f)`. With + * floating-point underlying type equivalent to @ref Vector3::yAxis(). + * @see @ref red(), @ref blue(), @ref magenta() + */ + constexpr static BasicColor3 green(T green = Implementation::fullChannel()) { + return Math::Vector3::yAxis(green); + } + + /** + * @brief Blue color + * + * Convenience alternative to e.g. `%Color3(0.0f, 0.0f, blue)`. With + * floating-point underlying type equivalent to @ref Vector3::zAxis(). + * @see @ref red(), @ref green(), @ref yellow() + */ + constexpr static BasicColor3 blue(T blue = Implementation::fullChannel()) { + return Math::Vector3::zAxis(blue); + } + + /** + * @brief Cyan color + * + * Convenience alternative to e.g. `%Color3(red, 1.0f, 1.0f)`. With + * floating-point underlying type equivalent to @ref Vector3::xScale(). + * @see @ref magenta(), @ref yellow(), @ref red() + */ + constexpr static BasicColor3 cyan(T red = T(0)) { + return {red, Implementation::fullChannel(), Implementation::fullChannel()}; + } + + /** + * @brief Magenta color + * + * Convenience alternative to e.g. `%Color3(0.0f, green, 0.0f)`. With + * floating-point underlying type equivalent to @ref Vector3::yScale(). + * @see @ref cyan(), @ref yellow(), @ref green() + */ + constexpr static BasicColor3 magenta(T green = T(0)) { + return {Implementation::fullChannel(), green, Implementation::fullChannel()}; + } + + /** + * @brief Yellow color + * + * Convenience alternative to `%Color3(0.0f, 0.0f, yellow)`. With + * floating-point underlying type equivalent to @ref Vector3::zScale(). + * @see @ref cyan(), @ref magenta(), @ref red() + */ + constexpr static BasicColor3 yellow(T blue = T(0)) { + return {Implementation::fullChannel(), Implementation::fullChannel(), blue}; + } + /** @brief Corresponding floating-point type for HSV computation */ typedef typename Math::TypeTraits::FloatingPointType FloatingPointType; @@ -289,6 +355,66 @@ class BasicColor4: public Math::Vector4 { /** @copydoc BasicColor3::HSV */ typedef typename BasicColor3::HSV HSV; + /** + * @brief Red color + * + * Convenience alternative to e.g. `%Color4(red, 0.0f, 0.0f, alpha)`. + * @see @ref green(), @ref blue(), @ref cyan() + */ + constexpr static BasicColor4 red(T red = Implementation::fullChannel(), T alpha = Implementation::fullChannel()) { + return {red, T(0), T(0), alpha}; + } + + /** + * @brief Green color + * + * Convenience alternative to e.g. `%Color4(0.0f, green, 0.0f, alpha)`. + * @see @ref red(), @ref blue(), @ref magenta() + */ + constexpr static BasicColor4 green(T green = Implementation::fullChannel(), T alpha = Implementation::fullChannel()) { + return {T(0), green, T(0), alpha}; + } + + /** + * @brief Blue color + * + * Convenience alternative to e.g. `%Color4(0.0f, 0.0f, blue, alpha)`. + * @see @ref red(), @ref green(), @ref yellow() + */ + constexpr static BasicColor4 blue(T blue = Implementation::fullChannel(), T alpha = Implementation::fullChannel()) { + return {T(0), T(0), blue, alpha}; + } + + /** + * @brief Cyan color + * + * Convenience alternative to e.g. `%Color4(red, 1.0f, 1.0f, alpha)`. + * @see @ref magenta(), @ref yellow(), @ref red() + */ + constexpr static BasicColor4 cyan(T red = T(0), T alpha = Implementation::fullChannel()) { + return {red, Implementation::fullChannel(), Implementation::fullChannel(), alpha}; + } + + /** + * @brief Magenta color + * + * Convenience alternative to e.g. `%Color4(1.0f, green, 1.0f, alpha)`. + * @see @ref cyan(), @ref yellow(), @ref green() + */ + constexpr static BasicColor4 magenta(T green = T(0), T alpha = Implementation::fullChannel()) { + return {Implementation::fullChannel(), green, Implementation::fullChannel(), alpha}; + } + + /** + * @brief Yellow color + * + * Convenience alternative to e.g. `%Color4(1.0f, 1.0f, blue, alpha)`. + * @see @ref cyan(), @ref magenta(), @ref red() + */ + constexpr static BasicColor4 yellow(T blue = T(0), T alpha = Implementation::fullChannel()) { + return {Implementation::fullChannel(), Implementation::fullChannel(), blue, alpha}; + } + /** * @copydoc BasicColor3::fromHSV() * @param a Alpha value, defaults to 1.0 for floating-point types diff --git a/src/Math/Vector3.h b/src/Math/Vector3.h index 5beb801ca..04147cea0 100644 --- a/src/Math/Vector3.h +++ b/src/Math/Vector3.h @@ -51,23 +51,24 @@ template class Vector3: public Vector<3, T> { * Matrix4::translation(Vector3::xAxis(5.0f)); // same as Matrix4::translation({5.0f, 0.0f, 0.0f}); * Matrix4::rotation(30.0_degf, Vector3::xAxis()); // same as Matrix::rotation(30.0_degf, {1.0f, 0.0f, 0.0f}); * @endcode - * @see yAxis(), zAxis(), xScale(), Matrix4::right() + * @see @ref yAxis(), @ref zAxis(), @ref xScale(), @ref Color3::red(), + * @ref Matrix4::right() */ constexpr static Vector3 xAxis(T length = T(1)) { return {length, T(0), T(0)}; } /** * @brief %Vector in direction of Y axis (up) * - * See xAxis() for more information. - * @see yScale(), Matrix4::up() + * See @ref xAxis() for more information. + * @see @ref yScale(), @ref Color3::green(), @ref Matrix4::up() */ constexpr static Vector3 yAxis(T length = T(1)) { return {T(0), length, T(0)}; } /** * @brief %Vector in direction of Z axis (backward) * - * See xAxis() for more information. - * @see zScale(), Matrix4::backward() + * See @ref xAxis() for more information. + * @see @ref zScale(), @ref Color3::blue(), @ref Matrix4::backward() */ constexpr static Vector3 zAxis(T length = T(1)) { return {T(0), T(0), length}; } @@ -78,23 +79,23 @@ template class Vector3: public Vector<3, T> { * @code * Matrix4::scaling(Vector3::xScale(-2.0f)); // same as Matrix4::scaling({-2.0f, 1.0f, 1.0f}); * @endcode - * @see yScale(), zScale(), xAxis() + * @see @ref yScale(), @ref zScale(), @ref Color3::cyan(), @ref xAxis() */ constexpr static Vector3 xScale(T scale) { return {scale, T(1), T(1)}; } /** * @brief Scaling vector in direction of Y axis (height) * - * See xScale() for more information. - * @see yAxis() + * See @ref xScale() for more information. + * @see @ref yAxis(), @ref Color3::magenta() */ constexpr static Vector3 yScale(T scale) { return {T(1), scale, T(1)}; } /** * @brief Scaling vector in direction of Z axis (depth) * - * See xScale() for more information. - * @see zAxis() + * See @ref xScale() for more information. + * @see @ref zAxis(), @ref Color3::yellow() */ constexpr static Vector3 zScale(T scale) { return {T(1), T(1), scale}; } diff --git a/src/Test/ColorTest.cpp b/src/Test/ColorTest.cpp index 434e43460..f138605b2 100644 --- a/src/Test/ColorTest.cpp +++ b/src/Test/ColorTest.cpp @@ -42,6 +42,8 @@ class ColorTest: public TestSuite::Tester { void constructNormalization(); void constructCopy(); + void colors(); + void fromHue(); void fromSaturation(); void fromValue(); @@ -71,6 +73,8 @@ ColorTest::ColorTest() { &ColorTest::constructNormalization, &ColorTest::constructCopy, + &ColorTest::colors, + &ColorTest::fromHue, &ColorTest::fromSaturation, &ColorTest::fromValue, @@ -181,6 +185,33 @@ void ColorTest::constructCopy() { CORRADE_COMPARE(d, Color4(1.0f, 0.5f, 0.75f, 0.25f)); } +void ColorTest::colors() { + CORRADE_COMPARE(Color3ub::red(75), Color3ub(75, 0, 0)); + CORRADE_COMPARE(Color3ub::green(75), Color3ub(0, 75, 0)); + CORRADE_COMPARE(Color3ub::blue(75), Color3ub(0, 0, 75)); + + CORRADE_COMPARE(Color3ub::cyan(75), Color3ub(75, 255, 255)); + CORRADE_COMPARE(Color3ub::magenta(75), Color3ub(255, 75, 255)); + CORRADE_COMPARE(Color3ub::yellow(75), Color3ub(255, 255, 75)); + + CORRADE_COMPARE(Color4ub::red(75, 138), Color4ub(75, 0, 0, 138)); + CORRADE_COMPARE(Color4ub::green(75, 138), Color4ub(0, 75, 0, 138)); + CORRADE_COMPARE(Color4ub::blue(75, 138), Color4ub(0, 0, 75, 138)); + + CORRADE_COMPARE(Color4ub::cyan(75, 138), Color4ub(75, 255, 255, 138)); + CORRADE_COMPARE(Color4ub::magenta(75, 138), Color4ub(255, 75, 255, 138)); + CORRADE_COMPARE(Color4ub::yellow(75, 138), Color4ub(255, 255, 75, 138)); + + /* Default alpha */ + CORRADE_COMPARE(Color4ub::red(75), Color4ub(75, 0, 0, 255)); + CORRADE_COMPARE(Color4ub::green(75), Color4ub(0, 75, 0, 255)); + CORRADE_COMPARE(Color4ub::blue(75), Color4ub(0, 0, 75, 255)); + + CORRADE_COMPARE(Color4ub::cyan(75), Color4ub(75, 255, 255, 255)); + CORRADE_COMPARE(Color4ub::magenta(75), Color4ub(255, 75, 255, 255)); + CORRADE_COMPARE(Color4ub::yellow(75), Color4ub(255, 255, 75, 255)); +} + void ColorTest::fromHue() { CORRADE_COMPARE(Color3ub::fromHSV(Deg(27.0f), 1.0f, 1.0f), Color3ub(255, 114, 0)); CORRADE_COMPARE(Color3ub::fromHSV(Deg(86.0f), 1.0f, 1.0f), Color3ub(144, 255, 0)); From 5949f7ae41f913eaa84c56f2ec6135a86f67e8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 19 Nov 2013 22:22:01 +0100 Subject: [PATCH 028/105] SceneGraph: added TODO. --- src/SceneGraph/AbstractTransformation.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/SceneGraph/AbstractTransformation.h b/src/SceneGraph/AbstractTransformation.h index 206ece1c6..7d4b5797b 100644 --- a/src/SceneGraph/AbstractTransformation.h +++ b/src/SceneGraph/AbstractTransformation.h @@ -83,7 +83,11 @@ template class MAGNUM_SCENEGRAPH_EXPORT Abstrac virtual void doResetTransformation() = 0; }; -/** @brief Transformation type */ +/** +@brief Transformation type + +@todo Get rid of this in favor of separate function for each type (less branching) +*/ enum class TransformationType: UnsignedByte { /** Global transformation, applied after all other transformations. */ Global = 0x00, From 18c9f5c44185e83e554a098991c935767be82dad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 19 Nov 2013 23:31:14 +0100 Subject: [PATCH 029/105] Test also default values in Color*::{red,green,blue,cyan,magenta,yellow}(). --- src/Test/ColorTest.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Test/ColorTest.cpp b/src/Test/ColorTest.cpp index f138605b2..545636ca3 100644 --- a/src/Test/ColorTest.cpp +++ b/src/Test/ColorTest.cpp @@ -202,14 +202,18 @@ void ColorTest::colors() { CORRADE_COMPARE(Color4ub::magenta(75, 138), Color4ub(255, 75, 255, 138)); CORRADE_COMPARE(Color4ub::yellow(75, 138), Color4ub(255, 255, 75, 138)); - /* Default alpha */ - CORRADE_COMPARE(Color4ub::red(75), Color4ub(75, 0, 0, 255)); - CORRADE_COMPARE(Color4ub::green(75), Color4ub(0, 75, 0, 255)); - CORRADE_COMPARE(Color4ub::blue(75), Color4ub(0, 0, 75, 255)); - - CORRADE_COMPARE(Color4ub::cyan(75), Color4ub(75, 255, 255, 255)); - CORRADE_COMPARE(Color4ub::magenta(75), Color4ub(255, 75, 255, 255)); - CORRADE_COMPARE(Color4ub::yellow(75), Color4ub(255, 255, 75, 255)); + /* Default values */ + CORRADE_COMPARE(Color3ub::red(), Color3ub(255, 0, 0)); + CORRADE_COMPARE(Color3ub::green(), Color3ub(0, 255, 0)); + CORRADE_COMPARE(Color3ub::blue(), Color3ub(0, 0, 255)); + + CORRADE_COMPARE(Color4ub::red(), Color4ub(255, 0, 0, 255)); + CORRADE_COMPARE(Color4ub::green(), Color4ub(0, 255, 0, 255)); + CORRADE_COMPARE(Color4ub::blue(), Color4ub(0, 0, 255, 255)); + + CORRADE_COMPARE(Color4ub::cyan(), Color4ub(0, 255, 255, 255)); + CORRADE_COMPARE(Color4ub::magenta(), Color4ub(255, 0, 255, 255)); + CORRADE_COMPARE(Color4ub::yellow(), Color4ub(255, 255, 0, 255)); } void ColorTest::fromHue() { From fd3f7febae45611c751bfaa057316862293d053a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 20 Nov 2013 00:45:36 +0100 Subject: [PATCH 030/105] Shaders: what the hell. --- src/Shaders/Flat.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Shaders/Flat.cpp b/src/Shaders/Flat.cpp index 7f3f289ae..acb40e535 100644 --- a/src/Shaders/Flat.cpp +++ b/src/Shaders/Flat.cpp @@ -46,17 +46,17 @@ template Flat::Flat(const Flags flags): tran const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); #endif - Shader vert(version, Shader::Type::Fragment); + Shader vert(version, Shader::Type::Vertex); vert.addSource(flags & Flag::Textured ? "#define TEXTURED\n" : "") .addSource(rs.get("compatibility.glsl")) - .addSource(rs.get("Flat.frag")); + .addSource(rs.get(vertexShaderName())); CORRADE_INTERNAL_ASSERT_OUTPUT(vert.compile()); attachShader(vert); - Shader frag(version, Shader::Type::Vertex); + Shader frag(version, Shader::Type::Fragment); frag.addSource(flags & Flag::Textured ? "#define TEXTURED\n" : "") .addSource(rs.get("compatibility.glsl")) - .addSource(rs.get(vertexShaderName())); + .addSource(rs.get("Flat.frag")); CORRADE_INTERNAL_ASSERT_OUTPUT(frag.compile()); attachShader(frag); From a12596427340295f7f8287bd5b987a6c1cf695ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 20 Nov 2013 01:08:25 +0100 Subject: [PATCH 031/105] Doc++ --- src/AbstractShaderProgram.h | 9 +++++---- src/Shaders/Phong.h | 2 +- src/Shaders/Vector.h | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/AbstractShaderProgram.h b/src/AbstractShaderProgram.h index 2c7a704db..87fef947a 100644 --- a/src/AbstractShaderProgram.h +++ b/src/AbstractShaderProgram.h @@ -216,8 +216,9 @@ layout(binding = 1) uniform sampler2D specularTexture; If you don't have the required extension (or if you want to change the layer later), declare the uniforms without the `layout()` qualifier and set the -texture layer uniform using @ref setUniform(Int, Int). Note that additional -syntax changes may be needed for GLSL 1.20 and GLSL ES 1.0. +texture layer uniform using @ref setUniform(Int, const T&) "setUniform(Int, Int)". +Note that additional syntax changes may be needed for GLSL 1.20 and GLSL ES +1.0. @code uniform sampler2D diffuseTexture; uniform sampler2D specularTexture; @@ -229,9 +230,9 @@ setUniform(SpecularTextureUniform, SpecularTextureLayer); @see @ref Shader::maxTextureImageUnits() @requires_gl42 %Extension @extension{ARB,shading_language_420pack} for explicit - texture layer binding instead of using setUniform(Int, Int). + texture layer binding instead of using @ref setUniform(Int, const T&) "setUniform(Int, Int)". @requires_gl Explicit texture layer binding is not supported in OpenGL ES. Use - setUniform(Int, Int) instead. + @ref setUniform(Int, const T&) "setUniform(Int, Int)" instead. @section AbstractShaderProgram-rendering-workflow Rendering workflow diff --git a/src/Shaders/Phong.h b/src/Shaders/Phong.h index 493599586..0f762a2bd 100644 --- a/src/Shaders/Phong.h +++ b/src/Shaders/Phong.h @@ -37,7 +37,7 @@ namespace Magnum { namespace Shaders { /** -@brief Phong shader +@brief %Phong shader Uses ambient, diffuse and specular color or texture. For colored mesh you need to provide @ref Position and @ref Normal attributes in your triangle mesh and diff --git a/src/Shaders/Vector.h b/src/Shaders/Vector.h index 10808325d..0d3b4e96d 100644 --- a/src/Shaders/Vector.h +++ b/src/Shaders/Vector.h @@ -37,7 +37,7 @@ namespace Magnum { namespace Shaders { /** -@brief Vector shader +@brief %Vector shader Renders vector art in plain grayscale form. See also DistanceFieldVector for more advanced effects. From 0a09b496ca9cd76dbf7e977635bde9e4f65b1dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 20 Nov 2013 01:09:15 +0100 Subject: [PATCH 032/105] Shaders: include cleanup. --- src/Shaders/AbstractVector.h | 1 - src/Shaders/DistanceFieldVector.h | 1 + src/Shaders/Vector.h | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Shaders/AbstractVector.h b/src/Shaders/AbstractVector.h index a90a14e1e..89115edd3 100644 --- a/src/Shaders/AbstractVector.h +++ b/src/Shaders/AbstractVector.h @@ -29,7 +29,6 @@ */ #include "AbstractShaderProgram.h" -#include "Color.h" #include "DimensionTraits.h" namespace Magnum { namespace Shaders { diff --git a/src/Shaders/DistanceFieldVector.h b/src/Shaders/DistanceFieldVector.h index be068f2fc..dc80aa958 100644 --- a/src/Shaders/DistanceFieldVector.h +++ b/src/Shaders/DistanceFieldVector.h @@ -30,6 +30,7 @@ #include "Math/Matrix3.h" #include "Math/Matrix4.h" +#include "Color.h" #include "AbstractVector.h" #include "magnumShadersVisibility.h" diff --git a/src/Shaders/Vector.h b/src/Shaders/Vector.h index 0d3b4e96d..33dcd3bbf 100644 --- a/src/Shaders/Vector.h +++ b/src/Shaders/Vector.h @@ -30,7 +30,8 @@ #include "Math/Matrix3.h" #include "Math/Matrix4.h" -#include "AbstractVector.h" +#include "Color.h" +#include "Shaders/AbstractVector.h" #include "magnumShadersVisibility.h" From 5542f82d9fb74220e365b552dc50ba083a236a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 20 Nov 2013 01:13:28 +0100 Subject: [PATCH 033/105] Shaders: set MeshVisualizer::VertexIndex attribute location to 3. Locations 0, 1 and 2 will be reserved for positions, texture coordinates and normals. --- src/Shaders/MeshVisualizer.h | 2 +- src/Shaders/MeshVisualizer.vert | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Shaders/MeshVisualizer.h b/src/Shaders/MeshVisualizer.h index 7b6740477..b7289410b 100644 --- a/src/Shaders/MeshVisualizer.h +++ b/src/Shaders/MeshVisualizer.h @@ -77,7 +77,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizer: public AbstractShaderProgram { * OpenGL 3.1, OpenGL ES 3.0 and newer this value is provided by the * shader itself, so the attribute is not needed. */ - typedef Attribute<1, Float> VertexIndex; + typedef Attribute<3, Float> VertexIndex; /** * @brief %Flag diff --git a/src/Shaders/MeshVisualizer.vert b/src/Shaders/MeshVisualizer.vert index a7ff4e35f..42391307a 100644 --- a/src/Shaders/MeshVisualizer.vert +++ b/src/Shaders/MeshVisualizer.vert @@ -42,7 +42,7 @@ in highp vec4 position; #if defined(WIREFRAME_RENDERING) && defined(NO_GEOMETRY_SHADER) #if (!defined(GL_ES) && __VERSION__ < 140) || (defined(GL_ES) && __VERSION__ < 300) #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 1) in lowp float vertexIndex; +layout(location = 3) in lowp float vertexIndex; #else in lowp float vertexIndex; #endif From ef42287cf9cacbffcbd9e8484dad9ea3203b3f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 20 Nov 2013 01:19:06 +0100 Subject: [PATCH 034/105] Shaders: use location 1 for texture coordinates and location 2 for normals. --- src/Shaders/Phong.h | 4 ++-- src/Shaders/Phong.vert | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Shaders/Phong.h b/src/Shaders/Phong.h index 0f762a2bd..f2a4c1234 100644 --- a/src/Shaders/Phong.h +++ b/src/Shaders/Phong.h @@ -59,7 +59,7 @@ myDiffuseTexture.bind(Shaders::Phong::DiffuseTextureLayer); class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram { public: typedef Attribute<0, Vector3> Position; /**< @brief Vertex position */ - typedef Attribute<1, Vector3> Normal; /**< @brief Normal direction */ + typedef Attribute<2, Vector3> Normal; /**< @brief Normal direction */ /** * @brief Texture coordinates @@ -67,7 +67,7 @@ class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram { * Used only if one of @ref Flag::AmbientTexture, @ref Flag::DiffuseTexture * or @ref Flag::SpecularTexture is set. */ - typedef Attribute<2, Vector2> TextureCoordinates; + typedef Attribute<1, Vector2> TextureCoordinates; enum: Int { /** diff --git a/src/Shaders/Phong.vert b/src/Shaders/Phong.vert index cdd51147d..b9d69aa79 100644 --- a/src/Shaders/Phong.vert +++ b/src/Shaders/Phong.vert @@ -41,7 +41,7 @@ uniform highp vec3 light; #ifdef EXPLICIT_ATTRIB_LOCATION layout(location = 0) in highp vec4 position; -layout(location = 1) in mediump vec3 normal; +layout(location = 2) in mediump vec3 normal; #else in highp vec4 position; in mediump vec3 normal; @@ -49,7 +49,7 @@ in mediump vec3 normal; #ifdef TEXTURED #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 2) in mediump vec2 textureCoords; +layout(location = 1) in mediump vec2 textureCoords; #else in mediump vec2 textureCoords; #endif From 4d68547cbe1b35db53fbc14a7448b7f2d86008b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 20 Nov 2013 01:20:34 +0100 Subject: [PATCH 035/105] Shaders: set VertexColor::Color attribute location to 3. Locations 0, 1 and 2 are reserved for positions, texture coordinates and normals. --- src/Shaders/VertexColor.h | 2 +- src/Shaders/VertexColor2D.vert | 2 +- src/Shaders/VertexColor3D.vert | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Shaders/VertexColor.h b/src/Shaders/VertexColor.h index 5c32f4b86..8bb656004 100644 --- a/src/Shaders/VertexColor.h +++ b/src/Shaders/VertexColor.h @@ -50,7 +50,7 @@ template class MAGNUM_SHADERS_EXPORT VertexColor: public typedef Attribute<0, typename DimensionTraits::VectorType> Position; /** @brief Vertex color */ - typedef Attribute<1, Color3> Color; + typedef Attribute<3, Color3> Color; explicit VertexColor(); diff --git a/src/Shaders/VertexColor2D.vert b/src/Shaders/VertexColor2D.vert index 627fe2a64..de59a8983 100644 --- a/src/Shaders/VertexColor2D.vert +++ b/src/Shaders/VertexColor2D.vert @@ -39,7 +39,7 @@ uniform highp mat3 transformationProjectionMatrix; #ifdef EXPLICIT_ATTRIB_LOCATION layout(location = 0) in highp vec2 position; -layout(location = 1) in lowp vec3 color; +layout(location = 3) in lowp vec3 color; #else in highp vec2 position; in lowp vec3 color; diff --git a/src/Shaders/VertexColor3D.vert b/src/Shaders/VertexColor3D.vert index cbc07d517..0e0e37b48 100644 --- a/src/Shaders/VertexColor3D.vert +++ b/src/Shaders/VertexColor3D.vert @@ -39,7 +39,7 @@ uniform highp mat4 transformationProjectionMatrix; #ifdef EXPLICIT_ATTRIB_LOCATION layout(location = 0) in highp vec4 position; -layout(location = 1) in lowp vec3 color; +layout(location = 3) in lowp vec3 color; #else in highp vec4 position; in lowp vec3 color; From 3eb7f6f2b8aa2b842b481e6bfc86d12e71b00e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 20 Nov 2013 01:31:25 +0100 Subject: [PATCH 036/105] Shaders: added generic shader definition. Defines common attributes which are shared by majority of the shaders, allowing mesh to be configured for the generic shader to be used with any of them. --- src/Shaders/AbstractVector.h | 7 +- src/Shaders/CMakeLists.txt | 1 + src/Shaders/DistanceFieldVector.h | 1 + src/Shaders/Flat.h | 6 +- src/Shaders/Generic.h | 108 ++++++++++++++++++++++++++++++ src/Shaders/Phong.h | 8 +-- src/Shaders/Shaders.h | 2 + src/Shaders/Vector.h | 1 + src/Shaders/VertexColor.h | 4 +- 9 files changed, 125 insertions(+), 13 deletions(-) create mode 100644 src/Shaders/Generic.h diff --git a/src/Shaders/AbstractVector.h b/src/Shaders/AbstractVector.h index 89115edd3..ec4bedcb9 100644 --- a/src/Shaders/AbstractVector.h +++ b/src/Shaders/AbstractVector.h @@ -28,8 +28,7 @@ * @brief Class Magnum::Shaders::AbstractVector, typedef Magnum::Shaders::AbstractVector2D, Magnum::Shaders::AbstractVector3D */ -#include "AbstractShaderProgram.h" -#include "DimensionTraits.h" +#include "Shaders/Generic.h" namespace Magnum { namespace Shaders { @@ -41,10 +40,10 @@ namespace Magnum { namespace Shaders { template class AbstractVector: public AbstractShaderProgram { public: /** @brief Vertex position */ - typedef Attribute<0, typename DimensionTraits::VectorType> Position; + typedef typename Generic::Position Position; /** @brief Texture coordinates */ - typedef Attribute<1, Vector2> TextureCoordinates; + typedef typename Generic::TextureCoordinates TextureCoordinates; enum: Int { VectorTextureLayer = 16 /**< Layer for vector texture */ diff --git a/src/Shaders/CMakeLists.txt b/src/Shaders/CMakeLists.txt index 41b921b8f..cd66e8b93 100644 --- a/src/Shaders/CMakeLists.txt +++ b/src/Shaders/CMakeLists.txt @@ -37,6 +37,7 @@ set(MagnumShaders_HEADERS DistanceFieldVector.h AbstractVector.h Flat.h + Generic.h MeshVisualizer.h Phong.h Shaders.h diff --git a/src/Shaders/DistanceFieldVector.h b/src/Shaders/DistanceFieldVector.h index dc80aa958..9c61647de 100644 --- a/src/Shaders/DistanceFieldVector.h +++ b/src/Shaders/DistanceFieldVector.h @@ -31,6 +31,7 @@ #include "Math/Matrix3.h" #include "Math/Matrix4.h" #include "Color.h" +#include "DimensionTraits.h" #include "AbstractVector.h" #include "magnumShadersVisibility.h" diff --git a/src/Shaders/Flat.h b/src/Shaders/Flat.h index 862023537..8e2b69627 100644 --- a/src/Shaders/Flat.h +++ b/src/Shaders/Flat.h @@ -30,9 +30,9 @@ #include "Math/Matrix3.h" #include "Math/Matrix4.h" -#include "AbstractShaderProgram.h" #include "Color.h" #include "DimensionTraits.h" +#include "Shaders/Generic.h" #include "magnumShadersVisibility.h" @@ -67,14 +67,14 @@ myTexture.bind(Shaders::Flat2D::TextureLayer); template class MAGNUM_SHADERS_EXPORT Flat: public AbstractShaderProgram { public: /** @brief Vertex position */ - typedef Attribute<0, typename DimensionTraits::VectorType> Position; + typedef typename Generic::Position Position; /** * @brief Texture coordinates * * Used only if @ref Flag::Textured is set. */ - typedef Attribute<1, Vector2> TextureCoordinates; + typedef typename Generic::TextureCoordinates TextureCoordinates; enum: Int { /** Layer for color texture. Used only if @ref Flag::Textured is set. */ diff --git a/src/Shaders/Generic.h b/src/Shaders/Generic.h new file mode 100644 index 000000000..5676cbd0c --- /dev/null +++ b/src/Shaders/Generic.h @@ -0,0 +1,108 @@ +#ifndef Magnum_Shaders_GenericShader_h +#define Magnum_Shaders_GenericShader_h +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +/** @file + * @brief Struct @ref Magnum::Shaders::Generic, typedef @ref Magnum::Shaders::Generic2D, @ref Magnum::Shaders::Generic3D + */ + +#include "AbstractShaderProgram.h" + +namespace Magnum { namespace Shaders { + +/** +@brief %Generic shader definition + +Definitions common for majority of shaders in @ref Shaders namespace, allowing +mesh configured for the generic shader to be used with any of them. + +Example usage (configuring the mesh for generic shader, then using it with +@ref Shaders::Phong): +@code +Mesh mesh; +Buffer vertexBuffer; + +// ... + +mesh.addVertexBuffer(vertexBuffer, 0, + Shaders::Generic3D::Position(), + Shaders::Generic3D::Normal(), + Shaders::Generic3D::TextureCoordinates()); + +Shaders::Phong phong; +// ... +phong.use(); +mesh.draw(); +@endcode + +@see @ref Generic2D, @ref Generic3D +*/ +#ifndef DOXYGEN_GENERATING_OUTPUT +template struct Generic; +#else +template struct Generic { + /** + * @brief Vertex position + * + * Defined as @ref Vector2 in 2D and @ref Vector3 in 3D. + */ + typedef AbstractShaderProgram::Attribute<0, T> Position; + + /** @brief 2D texture coordinates */ + typedef AbstractShaderProgram::Attribute<1, Vector2> TextureCoordinates; + + /** + * @brief Vertex normal + * + * Defined only in 3D. + */ + typedef AbstractShaderProgram::Attribute<2, Vector3> Normal; +}; +#endif + +/** @brief Generic 2D shader definition */ +typedef Generic<2> Generic2D; + +/** @brief Generic 3D shader definition */ +typedef Generic<3> Generic3D; + +#ifndef DOXYGEN_GENERATING_OUTPUT +struct BaseGeneric { + typedef AbstractShaderProgram::Attribute<1, Vector2> TextureCoordinates; +}; + +template<> struct Generic<2>: BaseGeneric { + typedef AbstractShaderProgram::Attribute<0, Vector2> Position; +}; + +template<> struct Generic<3>: BaseGeneric { + typedef AbstractShaderProgram::Attribute<0, Vector3> Position; + typedef AbstractShaderProgram::Attribute<2, Vector3> Normal; +}; +#endif + +}} + +#endif diff --git a/src/Shaders/Phong.h b/src/Shaders/Phong.h index f2a4c1234..2d380a7d7 100644 --- a/src/Shaders/Phong.h +++ b/src/Shaders/Phong.h @@ -29,8 +29,8 @@ */ #include "Math/Matrix4.h" -#include "AbstractShaderProgram.h" #include "Color.h" +#include "Shaders/Generic.h" #include "magnumShadersVisibility.h" @@ -58,8 +58,8 @@ myDiffuseTexture.bind(Shaders::Phong::DiffuseTextureLayer); */ class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram { public: - typedef Attribute<0, Vector3> Position; /**< @brief Vertex position */ - typedef Attribute<2, Vector3> Normal; /**< @brief Normal direction */ + typedef Generic3D::Position Position; /**< @brief Vertex position */ + typedef Generic3D::Normal Normal; /**< @brief Normal direction */ /** * @brief Texture coordinates @@ -67,7 +67,7 @@ class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram { * Used only if one of @ref Flag::AmbientTexture, @ref Flag::DiffuseTexture * or @ref Flag::SpecularTexture is set. */ - typedef Attribute<1, Vector2> TextureCoordinates; + typedef Generic3D::TextureCoordinates TextureCoordinates; enum: Int { /** diff --git a/src/Shaders/Shaders.h b/src/Shaders/Shaders.h index 96ee60972..95d259f1d 100644 --- a/src/Shaders/Shaders.h +++ b/src/Shaders/Shaders.h @@ -44,6 +44,8 @@ template class Flat; typedef Flat<2> Flat2D; typedef Flat<3> Flat3D; +/* Generic is used only statically */ + class MeshVisualizer; class Phong; diff --git a/src/Shaders/Vector.h b/src/Shaders/Vector.h index 33dcd3bbf..45c800bab 100644 --- a/src/Shaders/Vector.h +++ b/src/Shaders/Vector.h @@ -31,6 +31,7 @@ #include "Math/Matrix3.h" #include "Math/Matrix4.h" #include "Color.h" +#include "DimensionTraits.h" #include "Shaders/AbstractVector.h" #include "magnumShadersVisibility.h" diff --git a/src/Shaders/VertexColor.h b/src/Shaders/VertexColor.h index 8bb656004..067e859f9 100644 --- a/src/Shaders/VertexColor.h +++ b/src/Shaders/VertexColor.h @@ -30,9 +30,9 @@ #include "Math/Matrix3.h" #include "Math/Matrix4.h" -#include "AbstractShaderProgram.h" #include "Color.h" #include "DimensionTraits.h" +#include "Shaders/Generic.h" #include "magnumShadersVisibility.h" @@ -47,7 +47,7 @@ Draws vertex-colored mesh. template class MAGNUM_SHADERS_EXPORT VertexColor: public AbstractShaderProgram { public: /** @brief Vertex position */ - typedef Attribute<0, typename DimensionTraits::VectorType> Position; + typedef typename Generic::Position Position; /** @brief Vertex color */ typedef Attribute<3, Color3> Color; From 51db425bdb714ef023151de09936350e7ed21142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 20 Nov 2013 01:33:14 +0100 Subject: [PATCH 037/105] Shaders: use generic definitions also in GLSL sources. So each sourcs doesn't need to be manually rewritten each time the generic definition changes. --- src/Shaders/AbstractVector2D.vert | 4 ++-- src/Shaders/AbstractVector3D.vert | 4 ++-- src/Shaders/DistanceFieldVector.cpp | 1 + src/Shaders/Flat.cpp | 1 + src/Shaders/Flat2D.vert | 4 ++-- src/Shaders/Flat3D.vert | 4 ++-- src/Shaders/MeshVisualizer.cpp | 1 + src/Shaders/MeshVisualizer.vert | 2 +- src/Shaders/Phong.cpp | 1 + src/Shaders/Phong.vert | 6 +++--- src/Shaders/Vector.cpp | 1 + src/Shaders/VertexColor.cpp | 1 + src/Shaders/VertexColor2D.vert | 2 +- src/Shaders/VertexColor3D.vert | 2 +- src/Shaders/generic.glsl | 27 +++++++++++++++++++++++++++ src/Shaders/resources.conf | 3 +++ 16 files changed, 50 insertions(+), 14 deletions(-) create mode 100644 src/Shaders/generic.glsl diff --git a/src/Shaders/AbstractVector2D.vert b/src/Shaders/AbstractVector2D.vert index 6f0f9baa4..82dfb3914 100644 --- a/src/Shaders/AbstractVector2D.vert +++ b/src/Shaders/AbstractVector2D.vert @@ -34,8 +34,8 @@ uniform highp mat3 transformationProjectionMatrix; #endif #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 0) in highp vec2 position; -layout(location = 1) in mediump vec2 textureCoordinates; +layout(location = POSITION_ATTRIBUTE_LOCATION) in highp vec2 position; +layout(location = TEXTURECOORDINATES_ATTRIBUTE_LOCATION) in mediump vec2 textureCoordinates; #else in highp vec2 position; in mediump vec2 textureCoordinates; diff --git a/src/Shaders/AbstractVector3D.vert b/src/Shaders/AbstractVector3D.vert index f74fb0989..3da3fba47 100644 --- a/src/Shaders/AbstractVector3D.vert +++ b/src/Shaders/AbstractVector3D.vert @@ -34,8 +34,8 @@ uniform highp mat4 transformationProjectionMatrix; #endif #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 0) in highp vec4 position; -layout(location = 1) in mediump vec2 textureCoordinates; +layout(location = POSITION_ATTRIBUTE_LOCATION) in highp vec4 position; +layout(location = TEXTURECOORDINATES_ATTRIBUTE_LOCATION) in mediump vec2 textureCoordinates; #else in highp vec4 position; in mediump vec2 textureCoordinates; diff --git a/src/Shaders/DistanceFieldVector.cpp b/src/Shaders/DistanceFieldVector.cpp index d26e2280a..fac5a9b88 100644 --- a/src/Shaders/DistanceFieldVector.cpp +++ b/src/Shaders/DistanceFieldVector.cpp @@ -49,6 +49,7 @@ template DistanceFieldVector::DistanceFieldV Shader frag(version, Shader::Type::Vertex); frag.addSource(rs.get("compatibility.glsl")) + .addSource(rs.get("generic.glsl")) .addSource(rs.get(vertexShaderName())); CORRADE_INTERNAL_ASSERT_OUTPUT(frag.compile()); AbstractShaderProgram::attachShader(frag); diff --git a/src/Shaders/Flat.cpp b/src/Shaders/Flat.cpp index acb40e535..a6f94d830 100644 --- a/src/Shaders/Flat.cpp +++ b/src/Shaders/Flat.cpp @@ -49,6 +49,7 @@ template Flat::Flat(const Flags flags): tran Shader vert(version, Shader::Type::Vertex); vert.addSource(flags & Flag::Textured ? "#define TEXTURED\n" : "") .addSource(rs.get("compatibility.glsl")) + .addSource(rs.get("generic.glsl")) .addSource(rs.get(vertexShaderName())); CORRADE_INTERNAL_ASSERT_OUTPUT(vert.compile()); attachShader(vert); diff --git a/src/Shaders/Flat2D.vert b/src/Shaders/Flat2D.vert index aa0577bc7..34bd475af 100644 --- a/src/Shaders/Flat2D.vert +++ b/src/Shaders/Flat2D.vert @@ -34,14 +34,14 @@ uniform highp mat3 transformationProjectionMatrix; #endif #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 0) in highp vec2 position; +layout(location = POSITION_ATTRIBUTE_LOCATION) in highp vec2 position; #else in highp vec2 position; #endif #ifdef TEXTURED #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 1) in mediump vec2 textureCoords; +layout(location = TEXTURECOORDINATES_ATTRIBUTE_LOCATION) in mediump vec2 textureCoords; #else in mediump vec2 textureCoords; #endif diff --git a/src/Shaders/Flat3D.vert b/src/Shaders/Flat3D.vert index 5ddc90060..000db457f 100644 --- a/src/Shaders/Flat3D.vert +++ b/src/Shaders/Flat3D.vert @@ -34,14 +34,14 @@ uniform highp mat4 transformationProjectionMatrix; #endif #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 0) in highp vec4 position; +layout(location = POSITION_ATTRIBUTE_LOCATION) in highp vec4 position; #else in highp vec4 position; #endif #ifdef TEXTURED #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 1) in mediump vec2 textureCoords; +layout(location = TEXTURECOORDINATES_ATTRIBUTE_LOCATION) in mediump vec2 textureCoords; #else in mediump vec2 textureCoords; #endif diff --git a/src/Shaders/MeshVisualizer.cpp b/src/Shaders/MeshVisualizer.cpp index 2baeef4a8..bc7dcbbac 100644 --- a/src/Shaders/MeshVisualizer.cpp +++ b/src/Shaders/MeshVisualizer.cpp @@ -56,6 +56,7 @@ MeshVisualizer::MeshVisualizer(const Flags flags): flags(flags), transformationP vert.addSource(flags & Flag::Wireframe ? "#define WIREFRAME_RENDERING\n" : "") .addSource(flags & Flag::NoGeometryShader ? "#define NO_GEOMETRY_SHADER\n" : "") .addSource(rs.get("compatibility.glsl")) + .addSource(rs.get("generic.glsl")) .addSource(rs.get("MeshVisualizer.vert")); CORRADE_INTERNAL_ASSERT_OUTPUT(vert.compile()); vert.compile(); diff --git a/src/Shaders/MeshVisualizer.vert b/src/Shaders/MeshVisualizer.vert index 42391307a..117de747e 100644 --- a/src/Shaders/MeshVisualizer.vert +++ b/src/Shaders/MeshVisualizer.vert @@ -34,7 +34,7 @@ uniform highp mat4 transformationProjectionMatrix; #endif #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 0) highp in vec4 position; +layout(location = POSITION_ATTRIBUTE_LOCATION) highp in vec4 position; #else in highp vec4 position; #endif diff --git a/src/Shaders/Phong.cpp b/src/Shaders/Phong.cpp index a6e2bce8b..c352fc98a 100644 --- a/src/Shaders/Phong.cpp +++ b/src/Shaders/Phong.cpp @@ -43,6 +43,7 @@ Phong::Phong(const Flags flags): transformationMatrixUniform(0), projectionMatri Shader vert(version, Shader::Type::Vertex); vert.addSource(flags ? "#define TEXTURED\n" : "") .addSource(rs.get("compatibility.glsl")) + .addSource(rs.get("generic.glsl")) .addSource(rs.get("Phong.vert")); CORRADE_INTERNAL_ASSERT_OUTPUT(vert.compile()); attachShader(vert); diff --git a/src/Shaders/Phong.vert b/src/Shaders/Phong.vert index b9d69aa79..bc0f711cb 100644 --- a/src/Shaders/Phong.vert +++ b/src/Shaders/Phong.vert @@ -40,8 +40,8 @@ uniform highp vec3 light; #endif #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 0) in highp vec4 position; -layout(location = 2) in mediump vec3 normal; +layout(location = POSITION_ATTRIBUTE_LOCATION) in highp vec4 position; +layout(location = NORMAL_ATTRIBUTE_LOCATION) in mediump vec3 normal; #else in highp vec4 position; in mediump vec3 normal; @@ -49,7 +49,7 @@ in mediump vec3 normal; #ifdef TEXTURED #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 1) in mediump vec2 textureCoords; +layout(location = TEXTURECOORDINATES_ATTRIBUTE_LOCATION) in mediump vec2 textureCoords; #else in mediump vec2 textureCoords; #endif diff --git a/src/Shaders/Vector.cpp b/src/Shaders/Vector.cpp index 76ee1da9b..c2895bdc6 100644 --- a/src/Shaders/Vector.cpp +++ b/src/Shaders/Vector.cpp @@ -49,6 +49,7 @@ template Vector::Vector(): transformationPro Shader vert(version, Shader::Type::Vertex); vert.addSource(rs.get("compatibility.glsl")) + .addSource(rs.get("generic.glsl")) .addSource(rs.get(vertexShaderName())); CORRADE_INTERNAL_ASSERT_OUTPUT(vert.compile()); AbstractShaderProgram::attachShader(vert); diff --git a/src/Shaders/VertexColor.cpp b/src/Shaders/VertexColor.cpp index 7cccca382..a91dad60a 100644 --- a/src/Shaders/VertexColor.cpp +++ b/src/Shaders/VertexColor.cpp @@ -48,6 +48,7 @@ template VertexColor::VertexColor(): transfo Shader vert(version, Shader::Type::Vertex); vert.addSource(rs.get("compatibility.glsl")) + .addSource(rs.get("generic.glsl")) .addSource(rs.get(vertexShaderName())); CORRADE_INTERNAL_ASSERT_OUTPUT(vert.compile()); attachShader(vert); diff --git a/src/Shaders/VertexColor2D.vert b/src/Shaders/VertexColor2D.vert index de59a8983..ffa189dc6 100644 --- a/src/Shaders/VertexColor2D.vert +++ b/src/Shaders/VertexColor2D.vert @@ -38,7 +38,7 @@ uniform highp mat3 transformationProjectionMatrix; #endif #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 0) in highp vec2 position; +layout(location = POSITION_ATTRIBUTE_LOCATION) in highp vec2 position; layout(location = 3) in lowp vec3 color; #else in highp vec2 position; diff --git a/src/Shaders/VertexColor3D.vert b/src/Shaders/VertexColor3D.vert index 0e0e37b48..89efd7132 100644 --- a/src/Shaders/VertexColor3D.vert +++ b/src/Shaders/VertexColor3D.vert @@ -38,7 +38,7 @@ uniform highp mat4 transformationProjectionMatrix; #endif #ifdef EXPLICIT_ATTRIB_LOCATION -layout(location = 0) in highp vec4 position; +layout(location = POSITION_ATTRIBUTE_LOCATION) in highp vec4 position; layout(location = 3) in lowp vec3 color; #else in highp vec4 position; diff --git a/src/Shaders/generic.glsl b/src/Shaders/generic.glsl new file mode 100644 index 000000000..5c9044877 --- /dev/null +++ b/src/Shaders/generic.glsl @@ -0,0 +1,27 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#define POSITION_ATTRIBUTE_LOCATION 0 +#define TEXTURECOORDINATES_ATTRIBUTE_LOCATION 1 +#define NORMAL_ATTRIBUTE_LOCATION 2 diff --git a/src/Shaders/resources.conf b/src/Shaders/resources.conf index 8edde95b8..a9aa28940 100644 --- a/src/Shaders/resources.conf +++ b/src/Shaders/resources.conf @@ -18,6 +18,9 @@ filename=Flat.frag [file] filename=FullScreenTriangle.glsl +[file] +filename=generic.glsl + [file] filename=MeshVisualizer.vert From 8dfd6fd4fc805ac9d1c0e783486384d76dfcce18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 20 Nov 2013 12:40:34 +0100 Subject: [PATCH 038/105] Trade: convenience MeshData*D::has*() functions. Makes it more intuitive (and shorter) than calling `if(data.textureCoords2DArrayCount())`. --- src/Trade/MeshData2D.h | 9 ++++++++- src/Trade/MeshData3D.h | 12 +++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/Trade/MeshData2D.h b/src/Trade/MeshData2D.h index 43b7ac6fb..bed9b2d3e 100644 --- a/src/Trade/MeshData2D.h +++ b/src/Trade/MeshData2D.h @@ -83,7 +83,11 @@ class MAGNUM_EXPORT MeshData2D { std::vector& indices(); const std::vector& indices() const; /**< @overload */ - /** @brief Count of position arrays */ + /** + * @brief Count of position arrays + * + * There is always at least one. + */ UnsignedInt positionArrayCount() const { return _positions.size(); } /** @@ -95,6 +99,9 @@ class MAGNUM_EXPORT MeshData2D { std::vector& positions(UnsignedInt id); const std::vector& positions(UnsignedInt id) const; /**< @overload */ + /** @brief Whether the data contain any 2D texture coordinates */ + bool hasTextureCoords2D() const { return !_textureCoords2D.empty(); } + /** @brief Count of 2D texture coordinate arrays */ UnsignedInt textureCoords2DArrayCount() const { return _textureCoords2D.size(); } diff --git a/src/Trade/MeshData3D.h b/src/Trade/MeshData3D.h index c1cffca6f..d157da1cc 100644 --- a/src/Trade/MeshData3D.h +++ b/src/Trade/MeshData3D.h @@ -84,7 +84,11 @@ class MAGNUM_EXPORT MeshData3D { std::vector& indices(); const std::vector& indices() const; /**< @overload */ - /** @brief Count of position arrays */ + /** + * @brief Count of position arrays + * + * There is always at least one. + */ UnsignedInt positionArrayCount() const { return _positions.size(); } /** @@ -96,6 +100,9 @@ class MAGNUM_EXPORT MeshData3D { std::vector& positions(UnsignedInt id); const std::vector& positions(UnsignedInt id) const; /**< @overload */ + /** @brief Whether the data contain any normals */ + bool hasNormals() const { return !_normals.empty(); } + /** @brief Count of normal arrays */ UnsignedInt normalArrayCount() const { return _normals.size(); } @@ -108,6 +115,9 @@ class MAGNUM_EXPORT MeshData3D { std::vector& normals(UnsignedInt id); const std::vector& normals(UnsignedInt id) const; /**< @overload */ + /** @brief Whether the data contain any 2D texture coordinates */ + bool hasTextureCoords2D() const { return !_textureCoords2D.empty(); } + /** @brief Count of 2D texture coordinate arrays */ UnsignedInt textureCoords2DArrayCount() const { return _textureCoords2D.size(); } From f1ac93266097adf370f919ff52409f40ed42bb13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 20 Nov 2013 21:51:52 +0100 Subject: [PATCH 039/105] Extract Buffer::Usage enum out of Buffer class. Buffer usage is used as parameter in many functions, e.g. in *Framebuffer::read() and *Texture::image(), but they are rather seldom used and including whole Buffer.h file just for one enum is just overkill. The old Buffer::Usage is now alias to BufferUsage, it is marked as deprecated and will be removed in future release. --- src/AbstractFramebuffer.cpp | 2 +- src/AbstractFramebuffer.h | 5 +- src/AbstractTexture.cpp | 9 +- src/AbstractTexture.h | 5 +- src/Buffer.cpp | 4 +- src/Buffer.h | 174 +++++++++--------- src/BufferImage.cpp | 2 +- src/BufferImage.h | 2 +- src/CubeMapTexture.h | 2 +- src/DebugTools/ForceRenderer.cpp | 4 +- .../Implementation/AbstractShapeRenderer.cpp | 8 +- src/DebugTools/ObjectRenderer.cpp | 4 +- src/DefaultFramebuffer.cpp | 5 +- src/Magnum.h | 1 + src/MeshTools/CompressIndices.cpp | 4 +- src/MeshTools/CompressIndices.h | 3 +- src/MeshTools/FullScreenTriangle.cpp | 2 +- src/MeshTools/Interleave.h | 6 +- src/MeshTools/Test/CompressIndicesTest.cpp | 1 + src/Test/BufferGLTest.cpp | 18 +- src/Text/Renderer.cpp | 6 +- src/Text/Renderer.h | 4 +- src/Text/Test/RendererGLTest.cpp | 4 +- src/Texture.h | 2 +- src/TextureTools/DistanceField.cpp | 4 +- 25 files changed, 146 insertions(+), 135 deletions(-) diff --git a/src/AbstractFramebuffer.cpp b/src/AbstractFramebuffer.cpp index 56e95f9ba..f9bb9c33d 100644 --- a/src/AbstractFramebuffer.cpp +++ b/src/AbstractFramebuffer.cpp @@ -199,7 +199,7 @@ void AbstractFramebuffer::read(const Vector2i& offset, const Vector2i& size, Ima } #ifndef MAGNUM_TARGET_GLES2 -void AbstractFramebuffer::read(const Vector2i& offset, const Vector2i& size, BufferImage2D& image, Buffer::Usage usage) { +void AbstractFramebuffer::read(const Vector2i& offset, const Vector2i& size, BufferImage2D& image, BufferUsage usage) { #ifndef MAGNUM_TARGET_GLES2 bindInternal(FramebufferTarget::Read); #else diff --git a/src/AbstractFramebuffer.h b/src/AbstractFramebuffer.h index 4d8fd75d1..00781be99 100644 --- a/src/AbstractFramebuffer.h +++ b/src/AbstractFramebuffer.h @@ -31,7 +31,8 @@ #include #include "Math/Geometry/Rectangle.h" -#include "Buffer.h" +#include "Magnum.h" +#include "OpenGL.h" namespace Magnum { @@ -296,7 +297,7 @@ class MAGNUM_EXPORT AbstractFramebuffer { * information. * @requires_gles30 Pixel buffer objects are not available in OpenGL ES 2.0. */ - void read(const Vector2i& offset, const Vector2i& size, BufferImage2D& image, Buffer::Usage usage); + void read(const Vector2i& offset, const Vector2i& size, BufferImage2D& image, BufferUsage usage); #endif #ifdef DOXYGEN_GENERATING_OUTPUT diff --git a/src/AbstractTexture.cpp b/src/AbstractTexture.cpp index c43b6ce3d..a7dd1c781 100644 --- a/src/AbstractTexture.cpp +++ b/src/AbstractTexture.cpp @@ -24,7 +24,6 @@ #include "AbstractTexture.h" -#include "Buffer.h" #include "BufferImage.h" #include "ColorFormat.h" #include "Context.h" @@ -1000,7 +999,7 @@ template void MAGNUM_EXPORT AbstractTexture::image<1>(GLenum, GLint, Image<1>&); template void MAGNUM_EXPORT AbstractTexture::image<2>(GLenum, GLint, Image<2>&); template void MAGNUM_EXPORT AbstractTexture::image<3>(GLenum, GLint, Image<3>&); -template void AbstractTexture::image(GLenum target, GLint level, BufferImage& image, Buffer::Usage usage) { +template void AbstractTexture::image(GLenum target, GLint level, BufferImage& image, BufferUsage usage) { const Math::Vector size = DataHelper::imageSize(this, target, level); const std::size_t dataSize = size.product()*image.pixelSize(); if(image.size() != size) @@ -1010,9 +1009,9 @@ template void AbstractTexture::image(GLenum target, GLin (this->*getImageImplementation)(target, level, image.format(), image.type(), dataSize, nullptr); } -template void MAGNUM_EXPORT AbstractTexture::image<1>(GLenum, GLint, BufferImage<1>&, Buffer::Usage); -template void MAGNUM_EXPORT AbstractTexture::image<2>(GLenum, GLint, BufferImage<2>&, Buffer::Usage); -template void MAGNUM_EXPORT AbstractTexture::image<3>(GLenum, GLint, BufferImage<3>&, Buffer::Usage); +template void MAGNUM_EXPORT AbstractTexture::image<1>(GLenum, GLint, BufferImage<1>&, BufferUsage); +template void MAGNUM_EXPORT AbstractTexture::image<2>(GLenum, GLint, BufferImage<2>&, BufferUsage); +template void MAGNUM_EXPORT AbstractTexture::image<3>(GLenum, GLint, BufferImage<3>&, BufferUsage); #endif #endif diff --git a/src/AbstractTexture.h b/src/AbstractTexture.h index 815b6c811..c26bd4eee 100644 --- a/src/AbstractTexture.h +++ b/src/AbstractTexture.h @@ -29,9 +29,6 @@ */ #include "Array.h" -#ifndef MAGNUM_TARGET_GLES2 -#include "Buffer.h" -#endif #include "Color.h" #include "Sampler.h" @@ -320,7 +317,7 @@ class MAGNUM_EXPORT AbstractTexture { #ifndef MAGNUM_TARGET_GLES template void image(GLenum target, GLint level, Image& image); - template void image(GLenum target, GLint level, BufferImage& image, Buffer::Usage usage); + template void image(GLenum target, GLint level, BufferImage& image, BufferUsage usage); #endif GLenum _target; diff --git a/src/Buffer.cpp b/src/Buffer.cpp index e343bea04..c445d38dd 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -258,12 +258,12 @@ void Buffer::getSubDataImplementationDSA(const GLintptr offset, const GLsizeiptr } #endif -void Buffer::dataImplementationDefault(GLsizeiptr size, const GLvoid* data, Buffer::Usage usage) { +void Buffer::dataImplementationDefault(GLsizeiptr size, const GLvoid* data, BufferUsage usage) { glBufferData(GLenum(bindInternal(_targetHint)), size, data, GLenum(usage)); } #ifndef MAGNUM_TARGET_GLES -void Buffer::dataImplementationDSA(GLsizeiptr size, const GLvoid* data, Buffer::Usage usage) { +void Buffer::dataImplementationDSA(GLsizeiptr size, const GLvoid* data, BufferUsage usage) { glNamedBufferDataEXT(_id, size, data, GLenum(usage)); } #endif diff --git a/src/Buffer.h b/src/Buffer.h index d6ed27002..14a3447b8 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -25,7 +25,7 @@ */ /** @file /Buffer.h - * @brief Class Magnum::Buffer + * @brief Class @ref Magnum::Buffer, enum @ref Magnum::BufferUsage */ #include @@ -41,6 +41,85 @@ namespace Magnum { +/** + * @brief %Buffer usage + * + * @see @ref Buffer::setData(Containers::ArrayReference, BufferUsage) + */ +enum class BufferUsage: GLenum { + /** + * Set once by the application and used infrequently for drawing. + */ + StreamDraw = GL_STREAM_DRAW, + + #ifndef MAGNUM_TARGET_GLES2 + /** + * Set once as output from an OpenGL command and used infequently + * for drawing. + * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::StreamDraw" + * is available in OpenGL ES 2.0. + */ + StreamRead = GL_STREAM_READ, + + /** + * Set once as output from an OpenGL command and used infrequently + * for drawing or copying to other buffers. + * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::StreamDraw" + * is available in OpenGL ES 2.0. + */ + StreamCopy = GL_STREAM_COPY, + #endif + + /** + * Set once by the application and used frequently for drawing. + */ + StaticDraw = GL_STATIC_DRAW, + + #ifndef MAGNUM_TARGET_GLES2 + /** + * Set once as output from an OpenGL command and queried many + * times by the application. + * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::StaticDraw" + * is available in OpenGL ES 2.0. + */ + StaticRead = GL_STATIC_READ, + + /** + * Set once as output from an OpenGL command and used frequently + * for drawing or copying to other buffers. + * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::StaticDraw" + * is available in OpenGL ES 2.0. + */ + StaticCopy = GL_STATIC_COPY, + #endif + + /** + * Updated frequently by the application and used frequently + * for drawing or copying to other images. + */ + DynamicDraw = GL_DYNAMIC_DRAW + + #ifndef MAGNUM_TARGET_GLES2 + , + + /** + * Updated frequently as output from OpenGL command and queried + * many times from the application. + * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::DynamicDraw" + * is available in OpenGL ES 2.0. + */ + DynamicRead = GL_DYNAMIC_READ, + + /** + * Updated frequently as output from OpenGL command and used + * frequently for drawing or copying to other images. + * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::DynamicDraw" + * is available in OpenGL ES 2.0. + */ + DynamicCopy = GL_DYNAMIC_COPY + #endif +}; + /** @brief %Buffer @@ -227,84 +306,13 @@ class MAGNUM_EXPORT Buffer { #endif }; + #ifdef MAGNUM_BUILD_DEPRECATED /** - * @brief %Buffer usage - * - * @see setData(GLsizeiptr, const GLvoid*, Usage) + * @copybrief BufferUsage + * @deprecated Use @ref Magnum::BufferUsage "BufferUsage" instead. */ - enum class Usage: GLenum { - /** - * Set once by the application and used infrequently for drawing. - */ - StreamDraw = GL_STREAM_DRAW, - - #ifndef MAGNUM_TARGET_GLES2 - /** - * Set once as output from an OpenGL command and used infequently - * for drawing. - * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::StreamDraw" - * is available in OpenGL ES 2.0. - */ - StreamRead = GL_STREAM_READ, - - /** - * Set once as output from an OpenGL command and used infrequently - * for drawing or copying to other buffers. - * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::StreamDraw" - * is available in OpenGL ES 2.0. - */ - StreamCopy = GL_STREAM_COPY, - #endif - - /** - * Set once by the application and used frequently for drawing. - */ - StaticDraw = GL_STATIC_DRAW, - - #ifndef MAGNUM_TARGET_GLES2 - /** - * Set once as output from an OpenGL command and queried many - * times by the application. - * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::StaticDraw" - * is available in OpenGL ES 2.0. - */ - StaticRead = GL_STATIC_READ, - - /** - * Set once as output from an OpenGL command and used frequently - * for drawing or copying to other buffers. - * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::StaticDraw" - * is available in OpenGL ES 2.0. - */ - StaticCopy = GL_STATIC_COPY, - #endif - - /** - * Updated frequently by the application and used frequently - * for drawing or copying to other images. - */ - DynamicDraw = GL_DYNAMIC_DRAW - - #ifndef MAGNUM_TARGET_GLES2 - , - - /** - * Updated frequently as output from OpenGL command and queried - * many times from the application. - * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::DynamicDraw" - * is available in OpenGL ES 2.0. - */ - DynamicRead = GL_DYNAMIC_READ, - - /** - * Updated frequently as output from OpenGL command and used - * frequently for drawing or copying to other images. - * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::DynamicDraw" - * is available in OpenGL ES 2.0. - */ - DynamicCopy = GL_DYNAMIC_COPY - #endif - }; + typedef BufferUsage Usage; + #endif #ifndef MAGNUM_TARGET_GLES3 /** @@ -643,7 +651,7 @@ class MAGNUM_EXPORT Buffer { * @see setTargetHint(), @fn_gl{BindBuffer} and @fn_gl{BufferData} or * @fn_gl_extension{NamedBufferData,EXT,direct_state_access} */ - Buffer& setData(Containers::ArrayReference data, Usage usage) { + Buffer& setData(Containers::ArrayReference data, BufferUsage usage) { (this->*dataImplementation)(data.size(), data, usage); return *this; } @@ -667,13 +675,13 @@ class MAGNUM_EXPORT Buffer { * * @see setData(GLsizeiptr, const GLvoid*, Usage) */ - template Buffer& setData(const std::vector& data, Usage usage) { + template Buffer& setData(const std::vector& data, BufferUsage usage) { setData({data.data(), data.size()}, usage); return *this; } /** @overload */ - template Buffer& setData(const std::array& data, Usage usage) { + template Buffer& setData(const std::array& data, BufferUsage usage) { setData({data.data(), data.size()}, usage); return *this; } @@ -905,10 +913,10 @@ class MAGNUM_EXPORT Buffer { static GetSubDataImplementation getSubDataImplementation; #endif - typedef void(Buffer::*DataImplementation)(GLsizeiptr, const GLvoid*, Usage); - void MAGNUM_LOCAL dataImplementationDefault(GLsizeiptr size, const GLvoid* data, Usage usage); + typedef void(Buffer::*DataImplementation)(GLsizeiptr, const GLvoid*, BufferUsage); + void MAGNUM_LOCAL dataImplementationDefault(GLsizeiptr size, const GLvoid* data, BufferUsage usage); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL dataImplementationDSA(GLsizeiptr size, const GLvoid* data, Usage usage); + void MAGNUM_LOCAL dataImplementationDSA(GLsizeiptr size, const GLvoid* data, BufferUsage usage); #endif static DataImplementation dataImplementation; diff --git a/src/BufferImage.cpp b/src/BufferImage.cpp index 9099845d8..81d877d52 100644 --- a/src/BufferImage.cpp +++ b/src/BufferImage.cpp @@ -27,7 +27,7 @@ namespace Magnum { #ifndef MAGNUM_TARGET_GLES2 -template void BufferImage::setData(const typename DimensionTraits::VectorType& size, ColorFormat format, ColorType type, const void* data, Buffer::Usage usage) { +template void BufferImage::setData(const typename DimensionTraits::VectorType& size, ColorFormat format, ColorType type, const void* data, BufferUsage usage) { _format = format; _type = type; _size = size; diff --git a/src/BufferImage.h b/src/BufferImage.h index 67577ba7c..fbc472d64 100644 --- a/src/BufferImage.h +++ b/src/BufferImage.h @@ -81,7 +81,7 @@ template class MAGNUM_EXPORT BufferImage: public Abstrac * * @see Buffer::setData() */ - void setData(const typename DimensionTraits::VectorType& size, ColorFormat format, ColorType type, const void* data, Buffer::Usage usage); + void setData(const typename DimensionTraits::VectorType& size, ColorFormat format, ColorType type, const void* data, BufferUsage usage); private: Math::Vector _size; diff --git a/src/CubeMapTexture.h b/src/CubeMapTexture.h index b69237a1a..aff742119 100644 --- a/src/CubeMapTexture.h +++ b/src/CubeMapTexture.h @@ -155,7 +155,7 @@ class CubeMapTexture: public AbstractTexture { * information. * @requires_gl %Texture image queries are not available in OpenGL ES. */ - void image(Coordinate coordinate, Int level, BufferImage2D& image, Buffer::Usage usage) { + void image(Coordinate coordinate, Int level, BufferImage2D& image, BufferUsage usage) { AbstractTexture::image<2>(GLenum(coordinate), level, image, usage); } #endif diff --git a/src/DebugTools/ForceRenderer.cpp b/src/DebugTools/ForceRenderer.cpp index c1bbb53bd..e72c03551 100644 --- a/src/DebugTools/ForceRenderer.cpp +++ b/src/DebugTools/ForceRenderer.cpp @@ -79,10 +79,10 @@ template ForceRenderer::ForceRenderer(SceneG Buffer* vertexBuffer = new Buffer(Buffer::Target::Array); Buffer* indexBuffer = new Buffer(Buffer::Target::ElementArray); - vertexBuffer->setData(positions, Buffer::Usage::StaticDraw); + vertexBuffer->setData(positions, BufferUsage::StaticDraw); ResourceManager::instance().set(this->vertexBuffer.key(), vertexBuffer, ResourceDataState::Final, ResourcePolicy::Manual); - indexBuffer->setData(indices, Buffer::Usage::StaticDraw); + indexBuffer->setData(indices, BufferUsage::StaticDraw); ResourceManager::instance().set(this->indexBuffer.key(), indexBuffer, ResourceDataState::Final, ResourcePolicy::Manual); Mesh* mesh = new Mesh; diff --git a/src/DebugTools/Implementation/AbstractShapeRenderer.cpp b/src/DebugTools/Implementation/AbstractShapeRenderer.cpp index 856d9497b..d570806b0 100644 --- a/src/DebugTools/Implementation/AbstractShapeRenderer.cpp +++ b/src/DebugTools/Implementation/AbstractShapeRenderer.cpp @@ -46,7 +46,7 @@ template void create(typename MeshData::Type template<> void create<2>(Trade::MeshData2D& data, Resource& meshResource, Resource& vertexBufferResource, Resource& indexBufferResource) { /* Vertex buffer */ Buffer* buffer = new Buffer(Buffer::Target::Array); - buffer->setData(data.positions(0), Buffer::Usage::StaticDraw); + buffer->setData(data.positions(0), BufferUsage::StaticDraw); ResourceManager::instance().set(vertexBufferResource.key(), buffer, ResourceDataState::Final, ResourcePolicy::Manual); /* Mesh configuration */ @@ -60,7 +60,7 @@ template<> void create<2>(Trade::MeshData2D& data, Resource& meshResource, if(data.isIndexed()) { CORRADE_INTERNAL_ASSERT(indexBufferResource.key() != ResourceKey()); Buffer* indexBuffer = new Buffer(Buffer::Target::ElementArray); - MeshTools::compressIndices(*mesh, *indexBuffer, Buffer::Usage::StaticDraw, data.indices()); + MeshTools::compressIndices(*mesh, *indexBuffer, BufferUsage::StaticDraw, data.indices()); ResourceManager::instance().set(indexBufferResource.key(), indexBuffer, ResourceDataState::Final, ResourcePolicy::Manual); } } @@ -68,7 +68,7 @@ template<> void create<2>(Trade::MeshData2D& data, Resource& meshResource, template<> void create<3>(Trade::MeshData3D& data, Resource& meshResource, Resource& vertexBufferResource, Resource& indexBufferResource) { /* Vertex buffer */ Buffer* vertexBuffer = new Buffer(Buffer::Target::Array); - vertexBuffer->setData(data.positions(0), Buffer::Usage::StaticDraw); + vertexBuffer->setData(data.positions(0), BufferUsage::StaticDraw); ResourceManager::instance().set(vertexBufferResource.key(), vertexBuffer, ResourceDataState::Final, ResourcePolicy::Manual); /* Mesh configuration */ @@ -82,7 +82,7 @@ template<> void create<3>(Trade::MeshData3D& data, Resource& meshResource, if(data.isIndexed()) { CORRADE_INTERNAL_ASSERT(indexBufferResource.key() != ResourceKey()); Buffer* indexBuffer = new Buffer(Buffer::Target::ElementArray); - MeshTools::compressIndices(*mesh, *indexBuffer, Buffer::Usage::StaticDraw, data.indices()); + MeshTools::compressIndices(*mesh, *indexBuffer, BufferUsage::StaticDraw, data.indices()); ResourceManager::instance().set(indexBufferResource.key(), indexBuffer, ResourceDataState::Final, ResourcePolicy::Manual); } } diff --git a/src/DebugTools/ObjectRenderer.cpp b/src/DebugTools/ObjectRenderer.cpp index 721ad3145..84cb49177 100644 --- a/src/DebugTools/ObjectRenderer.cpp +++ b/src/DebugTools/ObjectRenderer.cpp @@ -158,10 +158,10 @@ template ObjectRenderer::ObjectRenderer(Scen Buffer* indexBuffer = new Buffer(Buffer::Target::ElementArray); Mesh* mesh = new Mesh; - MeshTools::interleave(*mesh, *vertexBuffer, Buffer::Usage::StaticDraw, Renderer::positions, Renderer::colors); + MeshTools::interleave(*mesh, *vertexBuffer, BufferUsage::StaticDraw, Renderer::positions, Renderer::colors); ResourceManager::instance().set(this->vertexBuffer.key(), vertexBuffer, ResourceDataState::Final, ResourcePolicy::Manual); - indexBuffer->setData(Renderer::indices, Buffer::Usage::StaticDraw); + indexBuffer->setData(Renderer::indices, BufferUsage::StaticDraw); ResourceManager::instance().set(this->indexBuffer.key(), indexBuffer, ResourceDataState::Final, ResourcePolicy::Manual); mesh->setPrimitive(Mesh::Primitive::Lines) diff --git a/src/DefaultFramebuffer.cpp b/src/DefaultFramebuffer.cpp index b0f9e7995..8468f784b 100644 --- a/src/DefaultFramebuffer.cpp +++ b/src/DefaultFramebuffer.cpp @@ -24,11 +24,12 @@ #include "DefaultFramebuffer.h" -#include "Context.h" +#include +#include "Context.h" +#include "Extensions.h" #include "Implementation/State.h" #include "Implementation/FramebufferState.h" -#include "Extensions.h" namespace Magnum { diff --git a/src/Magnum.h b/src/Magnum.h index 0fcece5ab..0b38b8e8f 100644 --- a/src/Magnum.h +++ b/src/Magnum.h @@ -475,6 +475,7 @@ template class Array1D; template class Array2D; template class Array3D; +enum class BufferUsage: GLenum; class Buffer; #ifndef MAGNUM_TARGET_GLES2 diff --git a/src/MeshTools/CompressIndices.cpp b/src/MeshTools/CompressIndices.cpp index c2b54c1a7..ed2886d36 100644 --- a/src/MeshTools/CompressIndices.cpp +++ b/src/MeshTools/CompressIndices.cpp @@ -26,8 +26,10 @@ #include #include +#include #include "Math/Functions.h" +#include "Buffer.h" namespace Magnum { namespace MeshTools { @@ -69,7 +71,7 @@ std::tuple> compressIndice return compressIndicesInternal(indices, *std::max_element(indices.begin(), indices.end())); } -void compressIndices(Mesh& mesh, Buffer& buffer, Buffer::Usage usage, const std::vector& indices) { +void compressIndices(Mesh& mesh, Buffer& buffer, BufferUsage usage, const std::vector& indices) { auto minmax = std::minmax_element(indices.begin(), indices.end()); /** @todo Performance hint when range can be represented by smaller value? */ diff --git a/src/MeshTools/CompressIndices.h b/src/MeshTools/CompressIndices.h index b233b5eb8..781b9d295 100644 --- a/src/MeshTools/CompressIndices.h +++ b/src/MeshTools/CompressIndices.h @@ -30,7 +30,6 @@ #include -#include "Buffer.h" #include "Mesh.h" #include "magnumMeshToolsVisibility.h" @@ -72,7 +71,7 @@ Mesh::setIndexCount() and Mesh::setIndexBuffer() on your own. @see MeshTools::interleave() */ -void MAGNUM_MESHTOOLS_EXPORT compressIndices(Mesh& mesh, Buffer& buffer, Buffer::Usage usage, const std::vector& indices); +void MAGNUM_MESHTOOLS_EXPORT compressIndices(Mesh& mesh, Buffer& buffer, BufferUsage usage, const std::vector& indices); }} diff --git a/src/MeshTools/FullScreenTriangle.cpp b/src/MeshTools/FullScreenTriangle.cpp index c2a810eba..da3518248 100644 --- a/src/MeshTools/FullScreenTriangle.cpp +++ b/src/MeshTools/FullScreenTriangle.cpp @@ -50,7 +50,7 @@ std::pair fullScreenTriangle() { Vector2(-1.0, -3.0), Vector2( 3.0, 1.0) }; - buffer->setData(triangle, Buffer::Usage::StaticDraw); + buffer->setData(triangle, BufferUsage::StaticDraw); /** @todo Is it possible to attach moveable buffer here to avoid heap allocation? OTOH this is more effective in most (modern) cases */ mesh.addVertexBuffer(*buffer, 0, AbstractShaderProgram::Attribute<0, Vector2>()); diff --git a/src/MeshTools/Interleave.h b/src/MeshTools/Interleave.h index 6d3034ad6..4e4dc804b 100644 --- a/src/MeshTools/Interleave.h +++ b/src/MeshTools/Interleave.h @@ -61,7 +61,7 @@ class Interleave { return std::make_tuple(_attributeCount, _stride, std::move(data)); } - template void operator()(Mesh& mesh, Buffer& buffer, Buffer::Usage usage, const T&... attributes) { + template void operator()(Mesh& mesh, Buffer& buffer, BufferUsage usage, const T&... attributes) { Containers::Array data; std::tie(std::ignore, std::ignore, data) = operator()(attributes...); @@ -70,7 +70,7 @@ class Interleave { } /* Specialization for only one attribute array */ - template typename std::enable_if::value, void>::type operator()(Mesh& mesh, Buffer& buffer, Buffer::Usage usage, const T& attribute) { + template typename std::enable_if::value, void>::type operator()(Mesh& mesh, Buffer& buffer, BufferUsage usage, const T& attribute) { mesh.setVertexCount(attribute.size()); buffer.setData(attribute, usage); } @@ -202,7 +202,7 @@ mesh->setVertexCount(attribute.size()); @see MeshTools::compressIndices() */ -template inline void interleave(Mesh& mesh, Buffer& buffer, Buffer::Usage usage, const T&... attributes) { +template inline void interleave(Mesh& mesh, Buffer& buffer, BufferUsage usage, const T&... attributes) { return Implementation::Interleave()(mesh, buffer, usage, attributes...); } diff --git a/src/MeshTools/Test/CompressIndicesTest.cpp b/src/MeshTools/Test/CompressIndicesTest.cpp index bee8535d5..47e4b03cd 100644 --- a/src/MeshTools/Test/CompressIndicesTest.cpp +++ b/src/MeshTools/Test/CompressIndicesTest.cpp @@ -22,6 +22,7 @@ DEALINGS IN THE SOFTWARE. */ +#include #include #include diff --git a/src/Test/BufferGLTest.cpp b/src/Test/BufferGLTest.cpp index 9ece79fad..9cb5cdf7a 100644 --- a/src/Test/BufferGLTest.cpp +++ b/src/Test/BufferGLTest.cpp @@ -86,19 +86,19 @@ void BufferGLTest::data() { /* Plain array */ constexpr Int data[] = {2, 7, 5, 13, 25}; - buffer.setData({data, 5}, Buffer::Usage::StaticDraw); + buffer.setData({data, 5}, BufferUsage::StaticDraw); MAGNUM_VERIFY_NO_ERROR(); CORRADE_COMPARE(buffer.size(), 5*4); /* STL vector */ std::vector data2{2, 7, 5, 13, 25}; - buffer.setData(data2, Buffer::Usage::StaticDraw); + buffer.setData(data2, BufferUsage::StaticDraw); MAGNUM_VERIFY_NO_ERROR(); CORRADE_COMPARE(buffer.size(), 5*4); /* STL array */ std::array data3{{2, 7, 5, 13, 25}}; - buffer.setData(data3, Buffer::Usage::StaticDraw); + buffer.setData(data3, BufferUsage::StaticDraw); MAGNUM_VERIFY_NO_ERROR(); CORRADE_COMPARE(buffer.size(), 5*4); @@ -152,7 +152,7 @@ void BufferGLTest::map() { Buffer buffer; constexpr char data[] = {2, 7, 5, 13, 25}; - buffer.setData(data, Buffer::Usage::StaticDraw); + buffer.setData(data, BufferUsage::StaticDraw); #ifndef MAGNUM_TARGET_GLES2 char* contents = reinterpret_cast(buffer.map(Buffer::MapAccess::ReadWrite)); @@ -213,7 +213,7 @@ void BufferGLTest::mapRange() { constexpr char data[] = {2, 7, 5, 13, 25}; Buffer buffer; - buffer.setData(data, Buffer::Usage::StaticDraw); + buffer.setData(data, BufferUsage::StaticDraw); char* contents = reinterpret_cast(buffer.map(1, 4, Buffer::MapFlag::Read|Buffer::MapFlag::Write)); MAGNUM_VERIFY_NO_ERROR(); @@ -244,7 +244,7 @@ void BufferGLTest::mapRangeExplicitFlush() { constexpr char data[] = {2, 7, 5, 13, 25}; Buffer buffer; - buffer.setData(data, Buffer::Usage::StaticDraw); + buffer.setData(data, BufferUsage::StaticDraw); /* Map, set byte, don't flush and unmap */ char* contents = reinterpret_cast(buffer.map(1, 4, Buffer::MapFlag::Write|Buffer::MapFlag::FlushExplicit)); @@ -277,10 +277,10 @@ void BufferGLTest::mapRangeExplicitFlush() { void BufferGLTest::copy() { Buffer buffer1; constexpr char data[] = {2, 7, 5, 13, 25}; - buffer1.setData(data, Buffer::Usage::StaticDraw); + buffer1.setData(data, BufferUsage::StaticDraw); Buffer buffer2; - buffer2.setData({nullptr, 5}, Buffer::Usage::StaticDraw); + buffer2.setData({nullptr, 5}, BufferUsage::StaticDraw); Buffer::copy(buffer1, buffer2, 1, 2, 3); MAGNUM_VERIFY_NO_ERROR(); @@ -303,7 +303,7 @@ void BufferGLTest::invalidate() { Buffer buffer; constexpr char data[] = {2, 7, 5, 13, 25}; - buffer.setData(data, Buffer::Usage::StaticDraw); + buffer.setData(data, BufferUsage::StaticDraw); /* Just test that no errors are emitted */ diff --git a/src/Text/Renderer.cpp b/src/Text/Renderer.cpp index fb25201d2..40c0bb36b 100644 --- a/src/Text/Renderer.cpp +++ b/src/Text/Renderer.cpp @@ -191,7 +191,7 @@ std::pair, Mesh::IndexType> renderIndicesIntern return {std::move(indices), indexType}; } -std::tuple renderInternal(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, Buffer& vertexBuffer, Buffer& indexBuffer, Buffer::Usage usage, Alignment alignment) { +std::tuple renderInternal(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, Buffer& vertexBuffer, Buffer& indexBuffer, BufferUsage usage, Alignment alignment) { /* Render vertices and upload them */ std::vector vertices; Rectangle rectangle; @@ -243,7 +243,7 @@ std::tuple, std::vector, std::vector, return std::make_tuple(std::move(positions), std::move(textureCoordinates), std::move(indices), rectangle); } -template std::tuple Renderer::render(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, Buffer& vertexBuffer, Buffer& indexBuffer, Buffer::Usage usage, Alignment alignment) { +template std::tuple Renderer::render(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, Buffer& vertexBuffer, Buffer& indexBuffer, BufferUsage usage, Alignment alignment) { /* Finalize mesh configuration and return the result */ auto r = renderInternal(font, cache, size, text, vertexBuffer, indexBuffer, usage, alignment); Mesh& mesh = std::get<0>(r); @@ -329,7 +329,7 @@ template Renderer::Renderer(AbstractFont& fo typename Shaders::AbstractVector::TextureCoordinates()); } -void AbstractRenderer::reserve(const uint32_t glyphCount, const Buffer::Usage vertexBufferUsage, const Buffer::Usage indexBufferUsage) { +void AbstractRenderer::reserve(const uint32_t glyphCount, const BufferUsage vertexBufferUsage, const BufferUsage indexBufferUsage) { _capacity = glyphCount; const UnsignedInt vertexCount = glyphCount*4; diff --git a/src/Text/Renderer.h b/src/Text/Renderer.h index a74740d85..8f794e489 100644 --- a/src/Text/Renderer.h +++ b/src/Text/Renderer.h @@ -95,7 +95,7 @@ class MAGNUM_TEXT_EXPORT AbstractRenderer { * Initially zero capacity is reserved. * @see @ref capacity() */ - void reserve(UnsignedInt glyphCount, Buffer::Usage vertexBufferUsage, Buffer::Usage indexBufferUsage); + void reserve(UnsignedInt glyphCount, BufferUsage vertexBufferUsage, BufferUsage indexBufferUsage); /** * @brief Render text @@ -250,7 +250,7 @@ template class MAGNUM_TEXT_EXPORT Renderer: public Abstr * Returns mesh prepared for use with @ref Shaders::AbstractVector * subclasses and rectangle spanning the rendered text. */ - static std::tuple render(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, Buffer& vertexBuffer, Buffer& indexBuffer, Buffer::Usage usage, Alignment alignment = Alignment::LineLeft); + static std::tuple render(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, Buffer& vertexBuffer, Buffer& indexBuffer, BufferUsage usage, Alignment alignment = Alignment::LineLeft); /** * @brief Constructor diff --git a/src/Text/Test/RendererGLTest.cpp b/src/Text/Test/RendererGLTest.cpp index 4e6115a7e..637b82122 100644 --- a/src/Text/Test/RendererGLTest.cpp +++ b/src/Text/Test/RendererGLTest.cpp @@ -169,7 +169,7 @@ void RendererGLTest::renderMesh() { Mesh mesh; Buffer vertexBuffer, indexBuffer; Rectangle bounds; - std::tie(mesh, bounds) = Text::Renderer3D::render(font, *static_cast(nullptr), 0.25f, "abc", vertexBuffer, indexBuffer, Buffer::Usage::StaticDraw, Alignment::TopCenter); + std::tie(mesh, bounds) = Text::Renderer3D::render(font, *static_cast(nullptr), 0.25f, "abc", vertexBuffer, indexBuffer, BufferUsage::StaticDraw, Alignment::TopCenter); MAGNUM_VERIFY_NO_ERROR(); /* Alignment offset */ @@ -216,7 +216,7 @@ void RendererGLTest::mutableText() { CORRADE_COMPARE(renderer.rectangle(), Rectangle()); /* Reserve some capacity */ - renderer.reserve(4, Buffer::Usage::StaticDraw, Buffer::Usage::StaticDraw); + renderer.reserve(4, BufferUsage::StaticDraw, BufferUsage::StaticDraw); MAGNUM_VERIFY_NO_ERROR(); CORRADE_COMPARE(renderer.capacity(), 4); /** @todo How to verify this on ES? */ diff --git a/src/Texture.h b/src/Texture.h index 517f050b9..b189c4d47 100644 --- a/src/Texture.h +++ b/src/Texture.h @@ -339,7 +339,7 @@ template class Texture: public AbstractTexture { * See image(Int, Image&) for more information. * @requires_gl %Texture image queries are not available in OpenGL ES. */ - void image(Int level, BufferImage& image, Buffer::Usage usage) { + void image(Int level, BufferImage& image, BufferUsage usage) { AbstractTexture::image(_target, level, image, usage); } #endif diff --git a/src/TextureTools/DistanceField.cpp b/src/TextureTools/DistanceField.cpp index 5165a3a51..5805ec200 100644 --- a/src/TextureTools/DistanceField.cpp +++ b/src/TextureTools/DistanceField.cpp @@ -25,8 +25,10 @@ #include "TextureTools/DistanceField.h" #include + #include "Math/Geometry/Rectangle.h" #include "AbstractShaderProgram.h" +#include "Buffer.h" #include "Extensions.h" #include "Framebuffer.h" #include "Mesh.h" @@ -189,7 +191,7 @@ void distanceField(Texture2D& input, Texture2D& output, const Rectanglei& rectan Vector2(-1.0, -3.0), Vector2( 3.0, 1.0) }; - buffer.setData(triangle, Buffer::Usage::StaticDraw); + buffer.setData(triangle, BufferUsage::StaticDraw); mesh.addVertexBuffer(buffer, 0, DistanceFieldShader::Position()); } From 34a04ae8aee776819ae1254bc17619c976b554e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 23 Nov 2013 10:43:21 +0100 Subject: [PATCH 040/105] Math: minor test cleanup. --- src/Math/Test/Vector2Test.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Math/Test/Vector2Test.cpp b/src/Math/Test/Vector2Test.cpp index d36c8e935..f2b2a9873 100644 --- a/src/Math/Test/Vector2Test.cpp +++ b/src/Math/Test/Vector2Test.cpp @@ -199,8 +199,7 @@ void Vector2Test::perpendicular() { } void Vector2Test::aspectRatio() { - const Vector2 a(3.0f, 4.0f); - CORRADE_COMPARE(a.aspectRatio(), 0.75f); + CORRADE_COMPARE(Vector2(3.0f, 4.0f).aspectRatio(), 0.75f); } void Vector2Test::swizzleType() { From 4059bd752f36e862c0cdbd1ddf891933631660ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 23 Nov 2013 10:43:54 +0100 Subject: [PATCH 041/105] Math: added minmax() and Vector2::minmax(). No Vector and std::initializer_list versions yet, as the algorithm for it is pretty complicated and I'm not sure that they will be used frequently enough to deserve their existence. --- src/Math/Functions.h | 26 +++++++++++++++++++++++--- src/Math/Test/FunctionsTest.cpp | 14 ++++++++++++++ src/Math/Test/Vector2Test.cpp | 8 ++++++++ src/Math/Vector.h | 4 ++-- src/Math/Vector2.h | 9 +++++++++ 5 files changed, 56 insertions(+), 5 deletions(-) diff --git a/src/Math/Functions.h b/src/Math/Functions.h index 25f6776be..e7bf0228c 100644 --- a/src/Math/Functions.h +++ b/src/Math/Functions.h @@ -25,8 +25,9 @@ */ #include -#include #include +#include +#include #include "Math/Vector.h" @@ -124,7 +125,7 @@ perform the operations component-wise. /** @brief Minimum -@see min(), clamp(), Vector::min() +@see @ref max(), @ref minmax(), @ref clamp(), @ref Vector::min() */ #ifdef DOXYGEN_GENERATING_OUTPUT template inline T min(T a, T b); @@ -151,7 +152,7 @@ template inline T min(std::initializer_list list) { /** @brief Maximum -@see max(), clamp(), Vector::max() +@see @ref min(), @ref minmax(), @ref clamp(), @ref Vector::max() */ #ifdef DOXYGEN_GENERATING_OUTPUT template inline T max(const T& a, const T& b); @@ -175,6 +176,25 @@ template inline T max(std::initializer_list list) { return out; } +/** +@brief Minimum and maximum of two values + +@see @ref min(), @ref max(), @ref clamp(), @ref Vector2::minmax() +*/ +#ifdef DOXYGEN_GENERATING_OUTPUT +template inline std::pair minmax(const T& a, const T& b); +#else +template inline typename std::enable_if::value, std::pair>::type minmax(T a, T b) { + return a < b ? std::make_pair(a, b) : std::make_pair(b, a); +} +template std::pair, Vector> minmax(const Vector& a, const Vector& b) { + std::pair, Vector> out{a, b}; + for(std::size_t i = 0; i != size; ++i) + if(out.first[i] > out.second[i]) std::swap(out.first[i], out.second[i]); + return out; +} +#endif + /** @brief Sign diff --git a/src/Math/Test/FunctionsTest.cpp b/src/Math/Test/FunctionsTest.cpp index 1b86f1985..dc682e664 100644 --- a/src/Math/Test/FunctionsTest.cpp +++ b/src/Math/Test/FunctionsTest.cpp @@ -37,6 +37,7 @@ class FunctionsTest: public Corrade::TestSuite::Tester { void minList(); void max(); void maxList(); + void minmax(); void sign(); void abs(); @@ -79,6 +80,7 @@ FunctionsTest::FunctionsTest() { &FunctionsTest::minList, &FunctionsTest::max, &FunctionsTest::maxList, + &FunctionsTest::minmax, &FunctionsTest::sign, &FunctionsTest::abs, @@ -132,6 +134,18 @@ void FunctionsTest::maxList() { Vector3i(9, -5, 18)}), Vector3i(9, 14, 18)); } +void FunctionsTest::minmax() { + const auto expectedScalar = std::make_pair(-5.0f, 4.0f); + CORRADE_COMPARE(Math::minmax(-5.0f, 4.0f), expectedScalar); + CORRADE_COMPARE(Math::minmax(4.0f, -5.0f), expectedScalar); + + const Vector3 a(5.0f, -4.0f, 1.0f); + const Vector3 b(7.0f, -3.0f, 1.0f); + const std::pair expectedVector{{5.0f, -4.0f, 1.0f}, {7.0f, -3.0f, 1.0f}}; + CORRADE_COMPARE_AS(Math::minmax(a, b), expectedVector, std::pair); + CORRADE_COMPARE_AS(Math::minmax(b, a), expectedVector, std::pair); +} + void FunctionsTest::sign() { CORRADE_COMPARE(Math::sign(3516), 1); CORRADE_COMPARE(Math::sign(0.0f), 0.0f); diff --git a/src/Math/Test/Vector2Test.cpp b/src/Math/Test/Vector2Test.cpp index f2b2a9873..69c67c879 100644 --- a/src/Math/Test/Vector2Test.cpp +++ b/src/Math/Test/Vector2Test.cpp @@ -68,6 +68,7 @@ class Vector2Test: public Corrade::TestSuite::Tester { void scales(); void perpendicular(); void aspectRatio(); + void minmax(); void swizzleType(); void debug(); @@ -93,6 +94,7 @@ Vector2Test::Vector2Test() { &Vector2Test::scales, &Vector2Test::perpendicular, &Vector2Test::aspectRatio, + &Vector2Test::minmax, &Vector2Test::swizzleType, &Vector2Test::debug, @@ -202,6 +204,12 @@ void Vector2Test::aspectRatio() { CORRADE_COMPARE(Vector2(3.0f, 4.0f).aspectRatio(), 0.75f); } +void Vector2Test::minmax() { + const auto expected = std::make_pair(-5.0f, 4.0f); + CORRADE_COMPARE(Vector2(-5.0f, 4.0f).minmax(), expected); + CORRADE_COMPARE(Vector2(4.0f, -5.0f).minmax(), expected); +} + void Vector2Test::swizzleType() { constexpr Vector<4, Int> orig; constexpr auto a = swizzle<'y', 'a'>(orig); diff --git a/src/Math/Vector.h b/src/Math/Vector.h index de6c77881..5f13d62ba 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -514,14 +514,14 @@ template class Vector { /** * @brief Minimal value in the vector * - * @see Math::min() + * @see @ref Math::min(), @ref Vector2::minmax() */ T min() const; /** * @brief Maximal value in the vector * - * @see Math::max() + * @see @ref Math::max(), @ref Vector2::minmax() */ T max() const; diff --git a/src/Math/Vector2.h b/src/Math/Vector2.h index 0d77e00e4..4eac0abb7 100644 --- a/src/Math/Vector2.h +++ b/src/Math/Vector2.h @@ -143,6 +143,15 @@ template class Vector2: public Vector<2, T> { */ T aspectRatio() const { return x()/y(); } + /** + * @brief Minimum and maximum value + * + * @see @ref min(), @ref max(), @ref Math::minmax() + */ + std::pair minmax() const { + return x() < y() ? std::make_pair(x(), y()) : std::make_pair(y(), x()); + } + MAGNUM_VECTOR_SUBCLASS_IMPLEMENTATION(2, Vector2) }; From 28032a39098af7c1b3d7c59c33bf3498e09ed547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 23 Nov 2013 10:54:56 +0100 Subject: [PATCH 042/105] Doc++ --- src/AbstractShaderProgram.h | 8 +++++--- src/Buffer.h | 2 +- src/Shader.cpp | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/AbstractShaderProgram.h b/src/AbstractShaderProgram.h index 87fef947a..eaa4b3c2b 100644 --- a/src/AbstractShaderProgram.h +++ b/src/AbstractShaderProgram.h @@ -216,7 +216,7 @@ layout(binding = 1) uniform sampler2D specularTexture; If you don't have the required extension (or if you want to change the layer later), declare the uniforms without the `layout()` qualifier and set the -texture layer uniform using @ref setUniform(Int, const T&) "setUniform(Int, Int)". +texture layer uniform using @ref Magnum::AbstractShaderProgram::setUniform(Int, const T&) "setUniform(Int, Int)". Note that additional syntax changes may be needed for GLSL 1.20 and GLSL ES 1.0. @code @@ -230,9 +230,11 @@ setUniform(SpecularTextureUniform, SpecularTextureLayer); @see @ref Shader::maxTextureImageUnits() @requires_gl42 %Extension @extension{ARB,shading_language_420pack} for explicit - texture layer binding instead of using @ref setUniform(Int, const T&) "setUniform(Int, Int)". + texture layer binding instead of using + @ref Magnum::AbstractShaderProgram::setUniform(Int, const T&) "setUniform(Int, Int)". @requires_gl Explicit texture layer binding is not supported in OpenGL ES. Use - @ref setUniform(Int, const T&) "setUniform(Int, Int)" instead. + @ref Magnum::AbstractShaderProgram::setUniform(Int, const T&) "setUniform(Int, Int)" + instead. @section AbstractShaderProgram-rendering-workflow Rendering workflow diff --git a/src/Buffer.h b/src/Buffer.h index 14a3447b8..0c7384777 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -44,7 +44,7 @@ namespace Magnum { /** * @brief %Buffer usage * - * @see @ref Buffer::setData(Containers::ArrayReference, BufferUsage) + * @see @ref Buffer::setData(Containers::ArrayReference, BufferUsage) */ enum class BufferUsage: GLenum { /** diff --git a/src/Shader.cpp b/src/Shader.cpp index 3bd02eac6..4993c0f4b 100644 --- a/src/Shader.cpp +++ b/src/Shader.cpp @@ -627,7 +627,7 @@ bool Shader::compile() { CORRADE_ASSERT(sources.size() > 1, "Shader::compile(): no files added", false); /* Array of source string pointers and their lengths */ - /** @todo Use `Containers::::ArrayTuple` to avoid one allocation if it ever + /** @todo Use `Containers::ArrayTuple` to avoid one allocation if it ever gets to be implemented (we need properly aligned memory too) */ Containers::Array pointers(sources.size()); Containers::Array sizes(sources.size()); From 9a387a7469c52ef8b4017130960e7c08befeaa32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 15:12:40 +0100 Subject: [PATCH 043/105] Fixed ColorTest on ES. --- src/Test/ColorTest.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Test/ColorTest.cpp b/src/Test/ColorTest.cpp index 545636ca3..506115cf4 100644 --- a/src/Test/ColorTest.cpp +++ b/src/Test/ColorTest.cpp @@ -149,20 +149,20 @@ void ColorTest::constructParts() { } void ColorTest::constructConversion() { - typedef BasicColor3 Color3d; - typedef BasicColor4 Color4d; + typedef BasicColor3 Color3ub; + typedef BasicColor4 Color4ub; - constexpr Color3 a(1.0f, 0.5f, 0.75f); - constexpr Color3d b(a); - CORRADE_COMPARE(b, Color3d(1.0, 0.5, 0.75)); + constexpr Color3 a(10.1f, 12.5f, 0.75f); + constexpr Color3ub b(a); + CORRADE_COMPARE(b, Color3ub(10, 12, 0)); - constexpr Color4 c(1.0f, 0.5f, 0.75f, 0.25f); - constexpr Color4d d(c); - CORRADE_COMPARE(d, Color4d(1.0, 0.5, 0.75, 0.25)); + constexpr Color4 c(10.1f, 12.5f, 0.75f, 5.25f); + constexpr Color4ub d(c); + CORRADE_COMPARE(d, Color4ub(10, 12, 0, 5)); /* Implicit conversion is not allowed */ - CORRADE_VERIFY(!(std::is_convertible::value)); - CORRADE_VERIFY(!(std::is_convertible::value)); + CORRADE_VERIFY(!(std::is_convertible::value)); + CORRADE_VERIFY(!(std::is_convertible::value)); } void ColorTest::constructNormalization() { From 60a064c92078667db66b7e657f602571b0a40cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 15:15:03 +0100 Subject: [PATCH 044/105] Ensure that all GL tests have `*GLTest` suffix. Makes it easier to selectively run GL/non-GL tests. --- src/Shaders/Test/CMakeLists.txt | 12 ++++++------ src/Test/CMakeLists.txt | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Shaders/Test/CMakeLists.txt b/src/Shaders/Test/CMakeLists.txt index 5a5025c83..1614b55d4 100644 --- a/src/Shaders/Test/CMakeLists.txt +++ b/src/Shaders/Test/CMakeLists.txt @@ -23,10 +23,10 @@ # if(BUILD_GL_TESTS) - corrade_add_test(ShadersDistanceFieldVectorTest DistanceFieldVectorTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) - corrade_add_test(ShadersFlatTest FlatTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) - corrade_add_test(ShadersMeshVisualizerTest MeshVisualizerTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) - corrade_add_test(ShadersPhongTest PhongTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) - corrade_add_test(ShadersVectorTest VectorTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) - corrade_add_test(ShadersVertexColorTest VertexColorTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) + corrade_add_test(ShadersDistanceFieldVectorGLTest DistanceFieldVectorTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) + corrade_add_test(ShadersFlatGLTest FlatTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) + corrade_add_test(ShadersMeshVisualizerGLTest MeshVisualizerTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) + corrade_add_test(ShadersPhongGLTest PhongTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) + corrade_add_test(ShadersVectorGLTest VectorTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) + corrade_add_test(ShadersVertexColorGLTest VertexColorTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) endif() diff --git a/src/Test/CMakeLists.txt b/src/Test/CMakeLists.txt index f3c741aed..bfe91f600 100644 --- a/src/Test/CMakeLists.txt +++ b/src/Test/CMakeLists.txt @@ -36,7 +36,7 @@ corrade_add_test(SamplerTest SamplerTest.cpp LIBRARIES Magnum) if(BUILD_GL_TESTS) corrade_add_test(BufferGLTest BufferGLTest.cpp LIBRARIES ${GL_TEST_LIBRARIES}) - corrade_add_test(ContextTest ContextTest.cpp LIBRARIES ${GL_TEST_LIBRARIES}) + corrade_add_test(ContextGLTest ContextTest.cpp LIBRARIES ${GL_TEST_LIBRARIES}) endif() set_target_properties(ResourceManagerTest PROPERTIES COMPILE_FLAGS -DCORRADE_GRACEFUL_ASSERT) From efd5aa89ac6ba4b6931ab04671d1e8e33ec767a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 16:12:15 +0100 Subject: [PATCH 045/105] Fixed BufferGLTest on ES2 non-deprecated build. Combinatorial explosion of build problems. --- src/Test/BufferGLTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Test/BufferGLTest.cpp b/src/Test/BufferGLTest.cpp index 9cb5cdf7a..9c066b604 100644 --- a/src/Test/BufferGLTest.cpp +++ b/src/Test/BufferGLTest.cpp @@ -187,7 +187,7 @@ void BufferGLTest::mapSub() { Buffer buffer; constexpr char data[] = {2, 7, 5, 13, 25}; - buffer.setData(data, Buffer::Usage::StaticDraw); + buffer.setData(data, BufferUsage::StaticDraw); char* contents = reinterpret_cast(buffer.mapSub(1, 4, Buffer::MapAccess::WriteOnly)); MAGNUM_VERIFY_NO_ERROR(); From 121d3a91bc04b2450f939d0de1d6e380cdddd797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 16:13:12 +0100 Subject: [PATCH 046/105] MagnumFont: fixed compilation with Clang. --- src/Plugins/MagnumFont/MagnumFont.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plugins/MagnumFont/MagnumFont.cpp b/src/Plugins/MagnumFont/MagnumFont.cpp index 4bfd97c61..f43ea8b24 100644 --- a/src/Plugins/MagnumFont/MagnumFont.cpp +++ b/src/Plugins/MagnumFont/MagnumFont.cpp @@ -148,7 +148,7 @@ std::pair MagnumFont::doOpenFile(const std::string& filename, Floa std::pair MagnumFont::openInternal(Utility::Configuration&& conf, Trade::ImageData2D&& image) { /* Everything okay, save the data internally */ - _opened = new Data{std::move(conf), std::move(image), {}, {}}; + _opened = new Data{std::move(conf), std::move(image), std::unordered_map{}, {}}; /* Glyph advances */ const std::vector glyphs = _opened->conf.groups("glyph"); From 1a608a5b7e5a533214982f35bda45042d3fba237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 16:35:50 +0100 Subject: [PATCH 047/105] TgaImporter: fix test on ES2. --- src/Plugins/TgaImporter/Test/TgaImporterTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Plugins/TgaImporter/Test/TgaImporterTest.cpp b/src/Plugins/TgaImporter/Test/TgaImporterTest.cpp index 67dd92e7a..241d71f04 100644 --- a/src/Plugins/TgaImporter/Test/TgaImporterTest.cpp +++ b/src/Plugins/TgaImporter/Test/TgaImporterTest.cpp @@ -197,7 +197,11 @@ void TgaImporterTest::grayscaleBits8() { std::optional image = importer.image2D(0); CORRADE_VERIFY(image); + #ifndef MAGNUM_TARGET_GLES2 CORRADE_COMPARE(image->format(), ColorFormat::Red); + #else + CORRADE_COMPARE(image->format(), ColorFormat::Luminance); + #endif CORRADE_COMPARE(image->size(), Vector2i(2, 3)); CORRADE_COMPARE(image->type(), ColorType::UnsignedByte); CORRADE_COMPARE(std::string(reinterpret_cast(image->data()), 2*3), @@ -227,7 +231,11 @@ void TgaImporterTest::file() { std::optional image = importer.image2D(0); CORRADE_VERIFY(image); + #ifndef MAGNUM_TARGET_GLES2 CORRADE_COMPARE(image->format(), ColorFormat::Red); + #else + CORRADE_COMPARE(image->format(), ColorFormat::Luminance); + #endif CORRADE_COMPARE(image->size(), Vector2i(2, 3)); CORRADE_COMPARE(image->type(), ColorType::UnsignedByte); CORRADE_COMPARE(std::string(reinterpret_cast(image->data()), 2*3), From 80b61be4851910d575547516e6ce75b883aca4a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 17:26:40 +0100 Subject: [PATCH 048/105] Fixed constexpr issues in ColorTest under GCC 4.6. --- src/Test/ColorTest.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Test/ColorTest.cpp b/src/Test/ColorTest.cpp index 506115cf4..d7dc1926a 100644 --- a/src/Test/ColorTest.cpp +++ b/src/Test/ColorTest.cpp @@ -117,7 +117,10 @@ void ColorTest::constructDefault() { } void ColorTest::constructOneValue() { - constexpr Color3 a(0.25f); + #ifndef CORRADE_GCC46_COMPATIBILITY + constexpr /* Not constexpr under GCC < 4.7 */ + #endif + Color3 a(0.25f); CORRADE_COMPARE(a, Color3(0.25f, 0.25f, 0.25f)); constexpr Color4 b(0.25f, 0.5f); From f163009f45ba052eed5c12fd47b4b7502dd118a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 17:30:01 +0100 Subject: [PATCH 049/105] TgaImporter: ColorFormat::Luminance is available only on ES2. --- src/Plugins/TgaImporter/TgaImporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plugins/TgaImporter/TgaImporter.cpp b/src/Plugins/TgaImporter/TgaImporter.cpp index 471e3d652..201939127 100644 --- a/src/Plugins/TgaImporter/TgaImporter.cpp +++ b/src/Plugins/TgaImporter/TgaImporter.cpp @@ -121,7 +121,7 @@ std::optional TgaImporter::doImage2D(UnsignedInt) { /* Grayscale */ } else if(header.imageType == 3) { - #ifdef MAGNUM_TARGET_GLES + #ifdef MAGNUM_TARGET_GLES2 format = Context::current() && Context::current()->isExtensionSupported() ? ColorFormat::Red : ColorFormat::Luminance; #else From 80263eb318034e1617e5cf7faddff63f411a0b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 18:35:29 +0100 Subject: [PATCH 050/105] Trade: explicitly link tests to CORRADE_PLUGINMANAGER_LIBRARIES. Compilation of tests in static build fails with missing reference to dlclose(). --- src/Trade/Test/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Trade/Test/CMakeLists.txt b/src/Trade/Test/CMakeLists.txt index d1a162e92..5d40b3102 100644 --- a/src/Trade/Test/CMakeLists.txt +++ b/src/Trade/Test/CMakeLists.txt @@ -27,8 +27,8 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testConfigure.h.cmake include_directories(${CMAKE_CURRENT_BINARY_DIR}) -corrade_add_test(TradeAbstractImageConverterTest AbstractImageConverterTest.cpp LIBRARIES Magnum) -corrade_add_test(TradeAbstractImporterTest AbstractImporterTest.cpp LIBRARIES Magnum) +corrade_add_test(TradeAbstractImageConverterTest AbstractImageConverterTest.cpp LIBRARIES Magnum ${CORRADE_PLUGINMANAGER_LIBRARIES}) +corrade_add_test(TradeAbstractImporterTest AbstractImporterTest.cpp LIBRARIES Magnum ${CORRADE_PLUGINMANAGER_LIBRARIES}) corrade_add_test(TradeAbstractMaterialDataTest AbstractMaterialDataTest.cpp LIBRARIES Magnum) corrade_add_test(TradeImageDataTest ImageDataTest.cpp LIBRARIES Magnum) corrade_add_test(TradeObjectData2DTest ObjectData2DTest.cpp LIBRARIES Magnum) From 3098ad26502f5f3cba27b1894ec4dc8765d844f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 18:42:04 +0100 Subject: [PATCH 051/105] Audio: missing inline. Caused static build to fail on multiple definitons. --- src/Audio/Source.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Audio/Source.h b/src/Audio/Source.h index 6838ecd42..591d35d7a 100644 --- a/src/Audio/Source.h +++ b/src/Audio/Source.h @@ -560,7 +560,7 @@ inline Source& Source::operator=(Source&& other) { return *this; } -auto Source::state() const -> State { +inline auto Source::state() const -> State { ALint state; alGetSourcei(_id, AL_SOURCE_STATE, &state); return State(state); From 6dbe31f0f03856d78b61d7214a3ded49f70010cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 18:55:39 +0100 Subject: [PATCH 052/105] Link CORRADE_PLUGINMANAGER_LIBRARIES to all plugin-enabled executables. Should fix another bunch of static build errors. --- src/Audio/Test/CMakeLists.txt | 2 +- src/Text/CMakeLists.txt | 2 +- src/Text/Test/CMakeLists.txt | 4 ++-- src/TextureTools/CMakeLists.txt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Audio/Test/CMakeLists.txt b/src/Audio/Test/CMakeLists.txt index 3a42d1f27..796f2aae5 100644 --- a/src/Audio/Test/CMakeLists.txt +++ b/src/Audio/Test/CMakeLists.txt @@ -27,7 +27,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testConfigure.h.cmake include_directories(${CMAKE_CURRENT_BINARY_DIR}) -corrade_add_test(AudioAbstractImporterTest AbstractImporterTest.cpp LIBRARIES MagnumAudio) +corrade_add_test(AudioAbstractImporterTest AbstractImporterTest.cpp LIBRARIES MagnumAudio ${CORRADE_PLUGINMANAGER_LIBRARIES}) corrade_add_test(AudioBufferTest BufferTest.cpp LIBRARIES MagnumAudio) corrade_add_test(AudioRendererTest RendererTest.cpp LIBRARIES MagnumAudio) corrade_add_test(AudioSourceTest SourceTest.cpp LIBRARIES MagnumAudio) diff --git a/src/Text/CMakeLists.txt b/src/Text/CMakeLists.txt index 8f61ce1fe..515d19a79 100644 --- a/src/Text/CMakeLists.txt +++ b/src/Text/CMakeLists.txt @@ -68,7 +68,7 @@ if(WITH_FONTCONVERTER) include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_executable(magnum-fontconverter fontconverter.cpp) - target_link_libraries(magnum-fontconverter MagnumText Magnum MagnumWindowlessGlxApplication ${X11_LIBRARIES}) + target_link_libraries(magnum-fontconverter MagnumText Magnum MagnumWindowlessGlxApplication ${CORRADE_PLUGINMANAGER_LIBRARIES} ${X11_LIBRARIES}) install(TARGETS magnum-fontconverter DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}) endif() diff --git a/src/Text/Test/CMakeLists.txt b/src/Text/Test/CMakeLists.txt index e48529eaa..073d501e8 100644 --- a/src/Text/Test/CMakeLists.txt +++ b/src/Text/Test/CMakeLists.txt @@ -27,8 +27,8 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testConfigure.h.cmake include_directories(${CMAKE_CURRENT_BINARY_DIR}) -corrade_add_test(TextAbstractFontTest AbstractFontTest.cpp LIBRARIES Magnum MagnumText) -corrade_add_test(TextAbstractFontConverterTest AbstractFontConverterTest.cpp LIBRARIES Magnum MagnumText) +corrade_add_test(TextAbstractFontTest AbstractFontTest.cpp LIBRARIES Magnum MagnumText ${CORRADE_PLUGINMANAGER_LIBRARIES}) +corrade_add_test(TextAbstractFontConverterTest AbstractFontConverterTest.cpp LIBRARIES Magnum MagnumText ${CORRADE_PLUGINMANAGER_LIBRARIES}) corrade_add_test(TextAbstractLayouterTest AbstractLayouterTest.cpp LIBRARIES Magnum MagnumText) if(BUILD_GL_TESTS) diff --git a/src/TextureTools/CMakeLists.txt b/src/TextureTools/CMakeLists.txt index 05623f9c0..a61c8c741 100644 --- a/src/TextureTools/CMakeLists.txt +++ b/src/TextureTools/CMakeLists.txt @@ -57,7 +57,7 @@ if(WITH_DISTANCEFIELDCONVERTER) include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_executable(magnum-distancefieldconverter distancefieldconverter.cpp) - target_link_libraries(magnum-distancefieldconverter MagnumTextureTools Magnum MagnumWindowlessGlxApplication ${X11_LIBRARIES}) + target_link_libraries(magnum-distancefieldconverter MagnumTextureTools Magnum MagnumWindowlessGlxApplication ${CORRADE_PLUGINMANAGER_LIBRARIES} ${X11_LIBRARIES}) install(TARGETS magnum-distancefieldconverter DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}) endif() From a156593a895e53e151e19ddb4c8d0c17cb27ec87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 19:51:51 +0100 Subject: [PATCH 053/105] Hopefully finally fixed constexpr issues in ColorTest with GCC 4.6. Follow-up to 80b61be4851910d575547516e6ce75b883aca4a4, I am too lazy to test it before commiting. --- src/Test/ColorTest.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Test/ColorTest.cpp b/src/Test/ColorTest.cpp index d7dc1926a..4f70770d0 100644 --- a/src/Test/ColorTest.cpp +++ b/src/Test/ColorTest.cpp @@ -156,11 +156,17 @@ void ColorTest::constructConversion() { typedef BasicColor4 Color4ub; constexpr Color3 a(10.1f, 12.5f, 0.75f); - constexpr Color3ub b(a); + #ifndef CORRADE_GCC46_COMPATIBILITY + constexpr /* Not constexpr under GCC < 4.7 */ + #endif + Color3ub b(a); CORRADE_COMPARE(b, Color3ub(10, 12, 0)); constexpr Color4 c(10.1f, 12.5f, 0.75f, 5.25f); - constexpr Color4ub d(c); + #ifndef CORRADE_GCC46_COMPATIBILITY + constexpr /* Not constexpr under GCC < 4.7 */ + #endif + Color4ub d(c); CORRADE_COMPARE(d, Color4ub(10, 12, 0, 5)); /* Implicit conversion is not allowed */ From e49be200d452e55aa8b0e37c1f352e443557743b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 20:02:47 +0100 Subject: [PATCH 054/105] Properly fix linking to libdl. Use CORRADE_PLUGINMANAGER_LIBRARIES instead of CORRADE_PLUGINMANAGER_LIBRARY when linking core Magnum library. This reverts commit 80263eb318034e1617e5cf7faddff63f411a0b82 and 6dbe31f0f03856d78b61d7214a3ded49f70010cf. --- src/Audio/Test/CMakeLists.txt | 2 +- src/CMakeLists.txt | 2 +- src/Text/CMakeLists.txt | 2 +- src/Text/Test/CMakeLists.txt | 4 ++-- src/TextureTools/CMakeLists.txt | 2 +- src/Trade/Test/CMakeLists.txt | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Audio/Test/CMakeLists.txt b/src/Audio/Test/CMakeLists.txt index 796f2aae5..3a42d1f27 100644 --- a/src/Audio/Test/CMakeLists.txt +++ b/src/Audio/Test/CMakeLists.txt @@ -27,7 +27,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testConfigure.h.cmake include_directories(${CMAKE_CURRENT_BINARY_DIR}) -corrade_add_test(AudioAbstractImporterTest AbstractImporterTest.cpp LIBRARIES MagnumAudio ${CORRADE_PLUGINMANAGER_LIBRARIES}) +corrade_add_test(AudioAbstractImporterTest AbstractImporterTest.cpp LIBRARIES MagnumAudio) corrade_add_test(AudioBufferTest BufferTest.cpp LIBRARIES MagnumAudio) corrade_add_test(AudioRendererTest RendererTest.cpp LIBRARIES MagnumAudio) corrade_add_test(AudioSourceTest SourceTest.cpp LIBRARIES MagnumAudio) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 85bc050e9..ff12dfcb8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -180,7 +180,7 @@ if(BUILD_STATIC_PIC) endif() set(Magnum_LIBS ${CORRADE_UTILITY_LIBRARY} - ${CORRADE_PLUGINMANAGER_LIBRARY}) + ${CORRADE_PLUGINMANAGER_LIBRARIES}) if(NOT TARGET_GLES OR TARGET_DESKTOP_GLES) set(Magnum_LIBS ${Magnum_LIBS} ${OPENGL_gl_LIBRARY}) elseif(TARGET_GLES2) diff --git a/src/Text/CMakeLists.txt b/src/Text/CMakeLists.txt index 515d19a79..8f61ce1fe 100644 --- a/src/Text/CMakeLists.txt +++ b/src/Text/CMakeLists.txt @@ -68,7 +68,7 @@ if(WITH_FONTCONVERTER) include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_executable(magnum-fontconverter fontconverter.cpp) - target_link_libraries(magnum-fontconverter MagnumText Magnum MagnumWindowlessGlxApplication ${CORRADE_PLUGINMANAGER_LIBRARIES} ${X11_LIBRARIES}) + target_link_libraries(magnum-fontconverter MagnumText Magnum MagnumWindowlessGlxApplication ${X11_LIBRARIES}) install(TARGETS magnum-fontconverter DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}) endif() diff --git a/src/Text/Test/CMakeLists.txt b/src/Text/Test/CMakeLists.txt index 073d501e8..e48529eaa 100644 --- a/src/Text/Test/CMakeLists.txt +++ b/src/Text/Test/CMakeLists.txt @@ -27,8 +27,8 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testConfigure.h.cmake include_directories(${CMAKE_CURRENT_BINARY_DIR}) -corrade_add_test(TextAbstractFontTest AbstractFontTest.cpp LIBRARIES Magnum MagnumText ${CORRADE_PLUGINMANAGER_LIBRARIES}) -corrade_add_test(TextAbstractFontConverterTest AbstractFontConverterTest.cpp LIBRARIES Magnum MagnumText ${CORRADE_PLUGINMANAGER_LIBRARIES}) +corrade_add_test(TextAbstractFontTest AbstractFontTest.cpp LIBRARIES Magnum MagnumText) +corrade_add_test(TextAbstractFontConverterTest AbstractFontConverterTest.cpp LIBRARIES Magnum MagnumText) corrade_add_test(TextAbstractLayouterTest AbstractLayouterTest.cpp LIBRARIES Magnum MagnumText) if(BUILD_GL_TESTS) diff --git a/src/TextureTools/CMakeLists.txt b/src/TextureTools/CMakeLists.txt index a61c8c741..05623f9c0 100644 --- a/src/TextureTools/CMakeLists.txt +++ b/src/TextureTools/CMakeLists.txt @@ -57,7 +57,7 @@ if(WITH_DISTANCEFIELDCONVERTER) include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_executable(magnum-distancefieldconverter distancefieldconverter.cpp) - target_link_libraries(magnum-distancefieldconverter MagnumTextureTools Magnum MagnumWindowlessGlxApplication ${CORRADE_PLUGINMANAGER_LIBRARIES} ${X11_LIBRARIES}) + target_link_libraries(magnum-distancefieldconverter MagnumTextureTools Magnum MagnumWindowlessGlxApplication ${X11_LIBRARIES}) install(TARGETS magnum-distancefieldconverter DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}) endif() diff --git a/src/Trade/Test/CMakeLists.txt b/src/Trade/Test/CMakeLists.txt index 5d40b3102..d1a162e92 100644 --- a/src/Trade/Test/CMakeLists.txt +++ b/src/Trade/Test/CMakeLists.txt @@ -27,8 +27,8 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testConfigure.h.cmake include_directories(${CMAKE_CURRENT_BINARY_DIR}) -corrade_add_test(TradeAbstractImageConverterTest AbstractImageConverterTest.cpp LIBRARIES Magnum ${CORRADE_PLUGINMANAGER_LIBRARIES}) -corrade_add_test(TradeAbstractImporterTest AbstractImporterTest.cpp LIBRARIES Magnum ${CORRADE_PLUGINMANAGER_LIBRARIES}) +corrade_add_test(TradeAbstractImageConverterTest AbstractImageConverterTest.cpp LIBRARIES Magnum) +corrade_add_test(TradeAbstractImporterTest AbstractImporterTest.cpp LIBRARIES Magnum) corrade_add_test(TradeAbstractMaterialDataTest AbstractMaterialDataTest.cpp LIBRARIES Magnum) corrade_add_test(TradeImageDataTest ImageDataTest.cpp LIBRARIES Magnum) corrade_add_test(TradeObjectData2DTest ObjectData2DTest.cpp LIBRARIES Magnum) From 01194d43160b9af61c5defb352591bd3a34969d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 22:36:36 +0100 Subject: [PATCH 055/105] Rename also classes and files for GL tests. --- src/Shaders/Test/CMakeLists.txt | 12 +++--- ...Test.cpp => DistanceFieldVectorGLTest.cpp} | 16 ++++---- .../Test/{FlatTest.cpp => FlatGLTest.cpp} | 24 +++++------ ...lizerTest.cpp => MeshVisualizerGLTest.cpp} | 20 +++++----- .../Test/{PhongTest.cpp => PhongGLTest.cpp} | 40 +++++++++---------- .../Test/{VectorTest.cpp => VectorGLTest.cpp} | 16 ++++---- ...texColorTest.cpp => VertexColorGLTest.cpp} | 16 ++++---- src/Test/CMakeLists.txt | 2 +- .../{ContextTest.cpp => ContextGLTest.cpp} | 34 ++++++++-------- 9 files changed, 90 insertions(+), 90 deletions(-) rename src/Shaders/Test/{DistanceFieldVectorTest.cpp => DistanceFieldVectorGLTest.cpp} (78%) rename src/Shaders/Test/{FlatTest.cpp => FlatGLTest.cpp} (79%) rename src/Shaders/Test/{MeshVisualizerTest.cpp => MeshVisualizerGLTest.cpp} (79%) rename src/Shaders/Test/{PhongTest.cpp => PhongGLTest.cpp} (73%) rename src/Shaders/Test/{VectorTest.cpp => VectorGLTest.cpp} (82%) rename src/Shaders/Test/{VertexColorTest.cpp => VertexColorGLTest.cpp} (80%) rename src/Test/{ContextTest.cpp => ContextGLTest.cpp} (88%) diff --git a/src/Shaders/Test/CMakeLists.txt b/src/Shaders/Test/CMakeLists.txt index 1614b55d4..994bf925f 100644 --- a/src/Shaders/Test/CMakeLists.txt +++ b/src/Shaders/Test/CMakeLists.txt @@ -23,10 +23,10 @@ # if(BUILD_GL_TESTS) - corrade_add_test(ShadersDistanceFieldVectorGLTest DistanceFieldVectorTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) - corrade_add_test(ShadersFlatGLTest FlatTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) - corrade_add_test(ShadersMeshVisualizerGLTest MeshVisualizerTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) - corrade_add_test(ShadersPhongGLTest PhongTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) - corrade_add_test(ShadersVectorGLTest VectorTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) - corrade_add_test(ShadersVertexColorGLTest VertexColorTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) + corrade_add_test(ShadersDistanceFieldVectorGLTest DistanceFieldVectorGLTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) + corrade_add_test(ShadersFlatGLTest FlatGLTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) + corrade_add_test(ShadersMeshVisualizerGLTest MeshVisualizerGLTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) + corrade_add_test(ShadersPhongGLTest PhongGLTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) + corrade_add_test(ShadersVectorGLTest VectorGLTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) + corrade_add_test(ShadersVertexColorGLTest VertexColorGLTest.cpp LIBRARIES MagnumShaders ${GL_TEST_LIBRARIES}) endif() diff --git a/src/Shaders/Test/DistanceFieldVectorTest.cpp b/src/Shaders/Test/DistanceFieldVectorGLTest.cpp similarity index 78% rename from src/Shaders/Test/DistanceFieldVectorTest.cpp rename to src/Shaders/Test/DistanceFieldVectorGLTest.cpp index fe7323af3..0e6bc2598 100644 --- a/src/Shaders/Test/DistanceFieldVectorTest.cpp +++ b/src/Shaders/Test/DistanceFieldVectorGLTest.cpp @@ -27,29 +27,29 @@ namespace Magnum { namespace Shaders { namespace Test { -class DistanceFieldVectorTest: public Magnum::Test::AbstractOpenGLTester { +class DistanceFieldVectorGLTest: public Magnum::Test::AbstractOpenGLTester { public: - explicit DistanceFieldVectorTest(); + explicit DistanceFieldVectorGLTest(); void compile2D(); void compile3D(); }; -DistanceFieldVectorTest::DistanceFieldVectorTest() { - addTests({&DistanceFieldVectorTest::compile2D, - &DistanceFieldVectorTest::compile3D}); +DistanceFieldVectorGLTest::DistanceFieldVectorGLTest() { + addTests({&DistanceFieldVectorGLTest::compile2D, + &DistanceFieldVectorGLTest::compile3D}); } -void DistanceFieldVectorTest::compile2D() { +void DistanceFieldVectorGLTest::compile2D() { Shaders::DistanceFieldVector2D shader; CORRADE_VERIFY(shader.validate().first); } -void DistanceFieldVectorTest::compile3D() { +void DistanceFieldVectorGLTest::compile3D() { Shaders::DistanceFieldVector3D shader; CORRADE_VERIFY(shader.validate().first); } }}} -CORRADE_TEST_MAIN(Magnum::Shaders::Test::DistanceFieldVectorTest) +CORRADE_TEST_MAIN(Magnum::Shaders::Test::DistanceFieldVectorGLTest) diff --git a/src/Shaders/Test/FlatTest.cpp b/src/Shaders/Test/FlatGLTest.cpp similarity index 79% rename from src/Shaders/Test/FlatTest.cpp rename to src/Shaders/Test/FlatGLTest.cpp index fd376a76c..08be1e375 100644 --- a/src/Shaders/Test/FlatTest.cpp +++ b/src/Shaders/Test/FlatGLTest.cpp @@ -27,9 +27,9 @@ namespace Magnum { namespace Shaders { namespace Test { -class FlatTest: public Magnum::Test::AbstractOpenGLTester { +class FlatGLTest: public Magnum::Test::AbstractOpenGLTester { public: - explicit FlatTest(); + explicit FlatGLTest(); void compile2D(); void compile3D(); @@ -37,33 +37,33 @@ class FlatTest: public Magnum::Test::AbstractOpenGLTester { void compile3DTextured(); }; -FlatTest::FlatTest() { - addTests({&FlatTest::compile2D, - &FlatTest::compile3D, - &FlatTest::compile2DTextured, - &FlatTest::compile3DTextured}); +FlatGLTest::FlatGLTest() { + addTests({&FlatGLTest::compile2D, + &FlatGLTest::compile3D, + &FlatGLTest::compile2DTextured, + &FlatGLTest::compile3DTextured}); } -void FlatTest::compile2D() { +void FlatGLTest::compile2D() { Shaders::Flat2D shader; CORRADE_VERIFY(shader.validate().first); } -void FlatTest::compile3D() { +void FlatGLTest::compile3D() { Shaders::Flat3D shader; CORRADE_VERIFY(shader.validate().first); } -void FlatTest::compile2DTextured() { +void FlatGLTest::compile2DTextured() { Shaders::Flat2D shader(Shaders::Flat2D::Flag::Textured); CORRADE_VERIFY(shader.validate().first); } -void FlatTest::compile3DTextured() { +void FlatGLTest::compile3DTextured() { Shaders::Flat3D shader(Shaders::Flat3D::Flag::Textured); CORRADE_VERIFY(shader.validate().first); } }}} -CORRADE_TEST_MAIN(Magnum::Shaders::Test::FlatTest) +CORRADE_TEST_MAIN(Magnum::Shaders::Test::FlatGLTest) diff --git a/src/Shaders/Test/MeshVisualizerTest.cpp b/src/Shaders/Test/MeshVisualizerGLTest.cpp similarity index 79% rename from src/Shaders/Test/MeshVisualizerTest.cpp rename to src/Shaders/Test/MeshVisualizerGLTest.cpp index aa2740422..1b7b12c42 100644 --- a/src/Shaders/Test/MeshVisualizerTest.cpp +++ b/src/Shaders/Test/MeshVisualizerGLTest.cpp @@ -29,27 +29,27 @@ namespace Magnum { namespace Shaders { namespace Test { -class MeshVisualizerTest: public Magnum::Test::AbstractOpenGLTester { +class MeshVisualizerGLTest: public Magnum::Test::AbstractOpenGLTester { public: - explicit MeshVisualizerTest(); + explicit MeshVisualizerGLTest(); void compile(); void compileWireframeGeometryShader(); void compileWireframeNoGeometryShader(); }; -MeshVisualizerTest::MeshVisualizerTest() { - addTests({&MeshVisualizerTest::compile, - &MeshVisualizerTest::compileWireframeGeometryShader, - &MeshVisualizerTest::compileWireframeNoGeometryShader}); +MeshVisualizerGLTest::MeshVisualizerGLTest() { + addTests({&MeshVisualizerGLTest::compile, + &MeshVisualizerGLTest::compileWireframeGeometryShader, + &MeshVisualizerGLTest::compileWireframeNoGeometryShader}); } -void MeshVisualizerTest::compile() { +void MeshVisualizerGLTest::compile() { Shaders::MeshVisualizer shader; CORRADE_VERIFY(shader.validate().first); } -void MeshVisualizerTest::compileWireframeGeometryShader() { +void MeshVisualizerGLTest::compileWireframeGeometryShader() { #ifdef MAGNUM_TARGET_GLES CORRADE_SKIP("Geometry shader is not available in OpenGL ES"); #else @@ -61,11 +61,11 @@ void MeshVisualizerTest::compileWireframeGeometryShader() { #endif } -void MeshVisualizerTest::compileWireframeNoGeometryShader() { +void MeshVisualizerGLTest::compileWireframeNoGeometryShader() { Shaders::MeshVisualizer shader(Shaders::MeshVisualizer::Flag::Wireframe|Shaders::MeshVisualizer::Flag::NoGeometryShader); CORRADE_VERIFY(shader.validate().first); } }}} -CORRADE_TEST_MAIN(Magnum::Shaders::Test::MeshVisualizerTest) +CORRADE_TEST_MAIN(Magnum::Shaders::Test::MeshVisualizerGLTest) diff --git a/src/Shaders/Test/PhongTest.cpp b/src/Shaders/Test/PhongGLTest.cpp similarity index 73% rename from src/Shaders/Test/PhongTest.cpp rename to src/Shaders/Test/PhongGLTest.cpp index 7b426b79f..5e6f79fa5 100644 --- a/src/Shaders/Test/PhongTest.cpp +++ b/src/Shaders/Test/PhongGLTest.cpp @@ -27,9 +27,9 @@ namespace Magnum { namespace Shaders { namespace Test { -class PhongTest: public Magnum::Test::AbstractOpenGLTester { +class PhongGLTest: public Magnum::Test::AbstractOpenGLTester { public: - explicit PhongTest(); + explicit PhongGLTest(); void compile(); void compileAmbientTexture(); @@ -41,57 +41,57 @@ class PhongTest: public Magnum::Test::AbstractOpenGLTester { void compileAmbientDiffuseSpecularTexture(); }; -PhongTest::PhongTest() { - addTests({&PhongTest::compile, - &PhongTest::compileAmbientTexture, - &PhongTest::compileDiffuseTexture, - &PhongTest::compileSpecularTexture, - &PhongTest::compileAmbientDiffuseTexture, - &PhongTest::compileAmbientSpecularTexture, - &PhongTest::compileDiffuseSpecularTexture, - &PhongTest::compileAmbientDiffuseSpecularTexture}); +PhongGLTest::PhongGLTest() { + addTests({&PhongGLTest::compile, + &PhongGLTest::compileAmbientTexture, + &PhongGLTest::compileDiffuseTexture, + &PhongGLTest::compileSpecularTexture, + &PhongGLTest::compileAmbientDiffuseTexture, + &PhongGLTest::compileAmbientSpecularTexture, + &PhongGLTest::compileDiffuseSpecularTexture, + &PhongGLTest::compileAmbientDiffuseSpecularTexture}); } -void PhongTest::compile() { +void PhongGLTest::compile() { Shaders::Phong shader; CORRADE_VERIFY(shader.validate().first); } -void PhongTest::compileAmbientTexture() { +void PhongGLTest::compileAmbientTexture() { Shaders::Phong shader(Shaders::Phong::Flag::AmbientTexture); CORRADE_VERIFY(shader.validate().first); } -void PhongTest::compileDiffuseTexture() { +void PhongGLTest::compileDiffuseTexture() { Shaders::Phong shader(Shaders::Phong::Flag::DiffuseTexture); CORRADE_VERIFY(shader.validate().first); } -void PhongTest::compileSpecularTexture() { +void PhongGLTest::compileSpecularTexture() { Shaders::Phong shader(Shaders::Phong::Flag::SpecularTexture); CORRADE_VERIFY(shader.validate().first); } -void PhongTest::compileAmbientDiffuseTexture() { +void PhongGLTest::compileAmbientDiffuseTexture() { Shaders::Phong shader(Shaders::Phong::Flag::AmbientTexture|Shaders::Phong::Flag::DiffuseTexture); CORRADE_VERIFY(shader.validate().first); } -void PhongTest::compileAmbientSpecularTexture() { +void PhongGLTest::compileAmbientSpecularTexture() { Shaders::Phong shader(Shaders::Phong::Flag::AmbientTexture|Shaders::Phong::Flag::SpecularTexture); CORRADE_VERIFY(shader.validate().first); } -void PhongTest::compileDiffuseSpecularTexture() { +void PhongGLTest::compileDiffuseSpecularTexture() { Shaders::Phong shader(Shaders::Phong::Flag::DiffuseTexture|Shaders::Phong::Flag::SpecularTexture); CORRADE_VERIFY(shader.validate().first); } -void PhongTest::compileAmbientDiffuseSpecularTexture() { +void PhongGLTest::compileAmbientDiffuseSpecularTexture() { Shaders::Phong shader(Shaders::Phong::Flag::AmbientTexture|Shaders::Phong::Flag::DiffuseTexture|Shaders::Phong::Flag::SpecularTexture); CORRADE_VERIFY(shader.validate().first); } }}} -CORRADE_TEST_MAIN(Magnum::Shaders::Test::PhongTest) +CORRADE_TEST_MAIN(Magnum::Shaders::Test::PhongGLTest) diff --git a/src/Shaders/Test/VectorTest.cpp b/src/Shaders/Test/VectorGLTest.cpp similarity index 82% rename from src/Shaders/Test/VectorTest.cpp rename to src/Shaders/Test/VectorGLTest.cpp index 58b112900..ed187caab 100644 --- a/src/Shaders/Test/VectorTest.cpp +++ b/src/Shaders/Test/VectorGLTest.cpp @@ -27,29 +27,29 @@ namespace Magnum { namespace Shaders { namespace Test { -class VectorTest: public Magnum::Test::AbstractOpenGLTester { +class VectorGLTest: public Magnum::Test::AbstractOpenGLTester { public: - explicit VectorTest(); + explicit VectorGLTest(); void compile2D(); void compile3D(); }; -VectorTest::VectorTest() { - addTests({&VectorTest::compile2D, - &VectorTest::compile3D}); +VectorGLTest::VectorGLTest() { + addTests({&VectorGLTest::compile2D, + &VectorGLTest::compile3D}); } -void VectorTest::compile2D() { +void VectorGLTest::compile2D() { Shaders::Vector2D shader; CORRADE_VERIFY(shader.validate().first); } -void VectorTest::compile3D() { +void VectorGLTest::compile3D() { Shaders::Vector3D shader; CORRADE_VERIFY(shader.validate().first); } }}} -CORRADE_TEST_MAIN(Magnum::Shaders::Test::VectorTest) +CORRADE_TEST_MAIN(Magnum::Shaders::Test::VectorGLTest) diff --git a/src/Shaders/Test/VertexColorTest.cpp b/src/Shaders/Test/VertexColorGLTest.cpp similarity index 80% rename from src/Shaders/Test/VertexColorTest.cpp rename to src/Shaders/Test/VertexColorGLTest.cpp index c20915b4d..e0e381d4f 100644 --- a/src/Shaders/Test/VertexColorTest.cpp +++ b/src/Shaders/Test/VertexColorGLTest.cpp @@ -27,29 +27,29 @@ namespace Magnum { namespace Shaders { namespace Test { -class VertexColorTest: public Magnum::Test::AbstractOpenGLTester { +class VertexColorGLTest: public Magnum::Test::AbstractOpenGLTester { public: - explicit VertexColorTest(); + explicit VertexColorGLTest(); void compile2D(); void compile3D(); }; -VertexColorTest::VertexColorTest() { - addTests({&VertexColorTest::compile2D, - &VertexColorTest::compile3D}); +VertexColorGLTest::VertexColorGLTest() { + addTests({&VertexColorGLTest::compile2D, + &VertexColorGLTest::compile3D}); } -void VertexColorTest::compile2D() { +void VertexColorGLTest::compile2D() { Shaders::VertexColor2D shader; CORRADE_VERIFY(shader.validate().first); } -void VertexColorTest::compile3D() { +void VertexColorGLTest::compile3D() { Shaders::VertexColor3D shader; CORRADE_VERIFY(shader.validate().first); } }}} -CORRADE_TEST_MAIN(Magnum::Shaders::Test::VertexColorTest) +CORRADE_TEST_MAIN(Magnum::Shaders::Test::VertexColorGLTest) diff --git a/src/Test/CMakeLists.txt b/src/Test/CMakeLists.txt index bfe91f600..855cd581b 100644 --- a/src/Test/CMakeLists.txt +++ b/src/Test/CMakeLists.txt @@ -36,7 +36,7 @@ corrade_add_test(SamplerTest SamplerTest.cpp LIBRARIES Magnum) if(BUILD_GL_TESTS) corrade_add_test(BufferGLTest BufferGLTest.cpp LIBRARIES ${GL_TEST_LIBRARIES}) - corrade_add_test(ContextGLTest ContextTest.cpp LIBRARIES ${GL_TEST_LIBRARIES}) + corrade_add_test(ContextGLTest ContextGLTest.cpp LIBRARIES ${GL_TEST_LIBRARIES}) endif() set_target_properties(ResourceManagerTest PROPERTIES COMPILE_FLAGS -DCORRADE_GRACEFUL_ASSERT) diff --git a/src/Test/ContextTest.cpp b/src/Test/ContextGLTest.cpp similarity index 88% rename from src/Test/ContextTest.cpp rename to src/Test/ContextGLTest.cpp index ba2a9cb22..f957e24fe 100644 --- a/src/Test/ContextTest.cpp +++ b/src/Test/ContextGLTest.cpp @@ -24,13 +24,13 @@ #include "Test/AbstractOpenGLTester.h" #include "Context.h" -#include +#include "Extensions.h" namespace Magnum { namespace Test { -class ContextTest: public AbstractOpenGLTester { +class ContextGLTest: public AbstractOpenGLTester { public: - explicit ContextTest(); + explicit ContextGLTest(); void version(); void versionList(); @@ -40,16 +40,16 @@ class ContextTest: public AbstractOpenGLTester { void versionDependentExtension(); }; -ContextTest::ContextTest() { - addTests({&ContextTest::version, - &ContextTest::versionList, - &ContextTest::supportedExtension, - &ContextTest::unsupportedExtension, - &ContextTest::pastExtension, - &ContextTest::versionDependentExtension}); +ContextGLTest::ContextGLTest() { + addTests({&ContextGLTest::version, + &ContextGLTest::versionList, + &ContextGLTest::supportedExtension, + &ContextGLTest::unsupportedExtension, + &ContextGLTest::pastExtension, + &ContextGLTest::versionDependentExtension}); } -void ContextTest::version() { +void ContextGLTest::version() { const Version v = Context::current()->version(); CORRADE_VERIFY(Context::current()->isVersionSupported(v)); CORRADE_VERIFY(Context::current()->isVersionSupported(Version(Int(v)-1))); @@ -60,7 +60,7 @@ void ContextTest::version() { MAGNUM_ASSERT_VERSION_SUPPORTED(Version(Int(v)-1)); } -void ContextTest::versionList() { +void ContextGLTest::versionList() { const Version v = Context::current()->version(); /* Selects first supported version (thus not necessarily the highest) */ @@ -68,7 +68,7 @@ void ContextTest::versionList() { CORRADE_VERIFY(Context::current()->supportedVersion({Version(Int(v)+1), Version(Int(v)-1), v}) == Version(Int(v)-1)); } -void ContextTest::supportedExtension() { +void ContextGLTest::supportedExtension() { if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_filter_anisotropic::string() + std::string(" extension should be supported, can't test")); @@ -76,7 +76,7 @@ void ContextTest::supportedExtension() { CORRADE_VERIFY(extensions.find(Extensions::GL::EXT::texture_filter_anisotropic::string()) != std::string::npos); } -void ContextTest::unsupportedExtension() { +void ContextGLTest::unsupportedExtension() { #ifndef MAGNUM_TARGET_GLES if(Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::GREMEDY::string_marker::string() + std::string(" extension shouldn't be supported, can't test")); @@ -98,7 +98,7 @@ void ContextTest::unsupportedExtension() { #endif } -void ContextTest::pastExtension() { +void ContextGLTest::pastExtension() { #ifndef MAGNUM_TARGET_GLES if(!Context::current()->isVersionSupported(Version::GL300)) CORRADE_SKIP("No already supported extensions exist in OpenGL 2.1"); @@ -116,7 +116,7 @@ void ContextTest::pastExtension() { #endif } -void ContextTest::versionDependentExtension() { +void ContextGLTest::versionDependentExtension() { #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(Extensions::GL::ARB::get_program_binary::requiredVersion(), Version::GL300); if(!Context::current()->isExtensionSupported()) @@ -131,4 +131,4 @@ void ContextTest::versionDependentExtension() { }} -CORRADE_TEST_MAIN(Magnum::Test::ContextTest) +CORRADE_TEST_MAIN(Magnum::Test::ContextGLTest) From 694c250e507289408fd8529c391f913db571c430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 21:20:35 +0100 Subject: [PATCH 056/105] Use plural form also for CORRADE_UTILITY_LIBRARIES. --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ff12dfcb8..36ff7eaff 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -179,7 +179,7 @@ if(BUILD_STATIC_PIC) set_target_properties(Magnum PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}") endif() set(Magnum_LIBS - ${CORRADE_UTILITY_LIBRARY} + ${CORRADE_UTILITY_LIBRARIES} ${CORRADE_PLUGINMANAGER_LIBRARIES}) if(NOT TARGET_GLES OR TARGET_DESKTOP_GLES) set(Magnum_LIBS ${Magnum_LIBS} ${OPENGL_gl_LIBRARY}) From efa1647571a9b182f94bce0eaeb29bf17b397029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 21:18:49 +0100 Subject: [PATCH 057/105] package: Jenkins CI configuration. --- doc/building.dox | 24 +++++ package/ci/jenkins-gltests.xml | 90 +++++++++++++++++ package/ci/jenkins.xml | 172 +++++++++++++++++++++++++++++++++ 3 files changed, 286 insertions(+) create mode 100644 package/ci/jenkins-gltests.xml create mode 100644 package/ci/jenkins.xml diff --git a/doc/building.dox b/doc/building.dox index c0ee2f5e0..6fb48bbab 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -385,6 +385,30 @@ depending projects. If you have Node.js installed, you can also build and run unit tests using `ctest`. See `BUILD_TESTS` above. +@section building-ci-jenkins Jenkins Continuous Integration + +In `package/ci/` there are `jenkins.xml` and `jenkins-gltests.xml` files +containing job configuration, one for build and non-GL tests and the other for +GL tests only. Setup your Jenkins server, enable the **Git** and +**Text-finder** plugin and download the CLI application from here: + + http://your-jenkins-server/cli + +Then add new jobs or update existing ones (replace `` with `create-job` +or `update-job`). + + java -jar jenkins-cli.jar -s http://your-jenkins-server Magnum < jenkins.xml + java -jar jenkins-cli.jar -s http://your-jenkins-server Magnum-GLTests < jenkins-gltests.xml + +Build is done using **Ninja** build system and everything possible is enabled, +thus you need also **SDL2**, **GLUT** and **OpenAL** libraries. It expects that +**GCC** >=4.8.2, 4.7, 4.6 and **Clang** are installed and there are **OpenGL**, +**OpenGL ES 2.0** and **OpenGL ES 3.0** librares as it tries to compile the +library with every combination of them. You can add/remove the axes in +`axes/hudson.matrix.TextAxis` or via the web interface later. + +Magnum-GLTests depend on active X11 session, thus they should be run from +Jenkins instance running on graphical user session. */ } diff --git a/package/ci/jenkins-gltests.xml b/package/ci/jenkins-gltests.xml new file mode 100644 index 000000000..63cc38a58 --- /dev/null +++ b/package/ci/jenkins-gltests.xml @@ -0,0 +1,90 @@ + + + + + + -1 + 10 + -1 + -1 + + false + + + true + false + false + false + + false + Magnum + + + compiler + + g++ + g++-4.7 + g++-4.6 + clang++ + + + + libraries + + static + dynamic + + + + compatibility + + + deprecated + + + + gl + + desktop + es2 + es2desktop + es3 + + + + + + + + + + + + + Errors while running CTest + false + true + true + + + + + false + + + + + SUCCESS + 0 + BLUE + true + + + . + diff --git a/package/ci/jenkins.xml b/package/ci/jenkins.xml new file mode 100644 index 000000000..1c8ab5127 --- /dev/null +++ b/package/ci/jenkins.xml @@ -0,0 +1,172 @@ + + + + + + -1 + 10 + -1 + -1 + + false + + + 2 + + + git://github.com/mosra/magnum.git + + + + + */master + + + false + + + + true + + + + + true + false + false + false + + false + Magnum + + + compiler + + g++ + g++-4.7 + g++-4.6 + clang++ + + + + libraries + + static + dynamic + + + + compatibility + + + deprecated + + + + gl + + desktop + es2 + es2desktop + es3 + + + + + + + + + + + + + Magnum-GLTests + + SUCCESS + 0 + BLUE + true + + + + Errors while running CTest + false + true + true + + + + + true + + + + + SUCCESS + 0 + BLUE + true + + + . + From 1188e08034f39fdec93fad562c8871f8902d4f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 21:19:23 +0100 Subject: [PATCH 058/105] Moved development PKGBUILDs to `package/archlinux`. They cluttered the root project dir way too much. --- doc/building.dox | 11 +++++++---- PKGBUILD => package/archlinux/PKGBUILD | 0 .../archlinux/PKGBUILD-emscripten | 0 PKGBUILD-es2 => package/archlinux/PKGBUILD-es2 | 0 .../archlinux/PKGBUILD-es2desktop | 0 PKGBUILD-es3 => package/archlinux/PKGBUILD-es3 | 0 PKGBUILD-gcc46 => package/archlinux/PKGBUILD-gcc46 | 0 PKGBUILD-gcc47 => package/archlinux/PKGBUILD-gcc47 | 0 .../archlinux/PKGBUILD-mingw32 | 0 .../archlinux/PKGBUILD-nacl-glibc | 0 .../archlinux/PKGBUILD-nacl-newlib | 0 .../archlinux/PKGBUILD-release | 0 12 files changed, 7 insertions(+), 4 deletions(-) rename PKGBUILD => package/archlinux/PKGBUILD (100%) rename PKGBUILD-emscripten => package/archlinux/PKGBUILD-emscripten (100%) rename PKGBUILD-es2 => package/archlinux/PKGBUILD-es2 (100%) rename PKGBUILD-es2desktop => package/archlinux/PKGBUILD-es2desktop (100%) rename PKGBUILD-es3 => package/archlinux/PKGBUILD-es3 (100%) rename PKGBUILD-gcc46 => package/archlinux/PKGBUILD-gcc46 (100%) rename PKGBUILD-gcc47 => package/archlinux/PKGBUILD-gcc47 (100%) rename PKGBUILD-mingw32 => package/archlinux/PKGBUILD-mingw32 (100%) rename PKGBUILD-nacl-glibc => package/archlinux/PKGBUILD-nacl-glibc (100%) rename PKGBUILD-nacl-newlib => package/archlinux/PKGBUILD-nacl-newlib (100%) rename PKGBUILD-release => package/archlinux/PKGBUILD-release (100%) diff --git a/doc/building.dox b/doc/building.dox index 6fb48bbab..27adeb34a 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -253,10 +253,13 @@ Integration with various external math and physics libraries is provided by In `package/archlinux` directory is currently one PKGBUILD for Git development build. The package is also in AUR under the same name. -There are also a few development PKGBUILDs in project root, which allow you to -build and install the package directly from source tree without downloading -anything. The native PKGBUILD also contains `check()` function which will run -all unit tests before packaging. +There are also a few development PKGBUILDs in `package/archlinux`, which allow +you to build and install the package directly from source tree without +downloading anything. The native PKGBUILDs also contain `check()` function +which will run all unit tests before packaging. You need to build them from +project root: + + makepkg -p package/archlinux/ If you want to build with another compiler (e.g. Clang), run makepkg this way: diff --git a/PKGBUILD b/package/archlinux/PKGBUILD similarity index 100% rename from PKGBUILD rename to package/archlinux/PKGBUILD diff --git a/PKGBUILD-emscripten b/package/archlinux/PKGBUILD-emscripten similarity index 100% rename from PKGBUILD-emscripten rename to package/archlinux/PKGBUILD-emscripten diff --git a/PKGBUILD-es2 b/package/archlinux/PKGBUILD-es2 similarity index 100% rename from PKGBUILD-es2 rename to package/archlinux/PKGBUILD-es2 diff --git a/PKGBUILD-es2desktop b/package/archlinux/PKGBUILD-es2desktop similarity index 100% rename from PKGBUILD-es2desktop rename to package/archlinux/PKGBUILD-es2desktop diff --git a/PKGBUILD-es3 b/package/archlinux/PKGBUILD-es3 similarity index 100% rename from PKGBUILD-es3 rename to package/archlinux/PKGBUILD-es3 diff --git a/PKGBUILD-gcc46 b/package/archlinux/PKGBUILD-gcc46 similarity index 100% rename from PKGBUILD-gcc46 rename to package/archlinux/PKGBUILD-gcc46 diff --git a/PKGBUILD-gcc47 b/package/archlinux/PKGBUILD-gcc47 similarity index 100% rename from PKGBUILD-gcc47 rename to package/archlinux/PKGBUILD-gcc47 diff --git a/PKGBUILD-mingw32 b/package/archlinux/PKGBUILD-mingw32 similarity index 100% rename from PKGBUILD-mingw32 rename to package/archlinux/PKGBUILD-mingw32 diff --git a/PKGBUILD-nacl-glibc b/package/archlinux/PKGBUILD-nacl-glibc similarity index 100% rename from PKGBUILD-nacl-glibc rename to package/archlinux/PKGBUILD-nacl-glibc diff --git a/PKGBUILD-nacl-newlib b/package/archlinux/PKGBUILD-nacl-newlib similarity index 100% rename from PKGBUILD-nacl-newlib rename to package/archlinux/PKGBUILD-nacl-newlib diff --git a/PKGBUILD-release b/package/archlinux/PKGBUILD-release similarity index 100% rename from PKGBUILD-release rename to package/archlinux/PKGBUILD-release From fcd48a50f5bfd4533b58bff6fa1429a47ba0ebbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 21:22:06 +0100 Subject: [PATCH 059/105] package: added Clang PKGBUILD. --- doc/building.dox | 7 ---- package/archlinux/PKGBUILD | 5 --- package/archlinux/PKGBUILD-clang | 49 +++++++++++++++++++++++++++ package/archlinux/PKGBUILD-es2 | 5 --- package/archlinux/PKGBUILD-es2desktop | 5 --- package/archlinux/PKGBUILD-es3 | 5 --- package/archlinux/PKGBUILD-release | 5 --- 7 files changed, 49 insertions(+), 32 deletions(-) create mode 100644 package/archlinux/PKGBUILD-clang diff --git a/doc/building.dox b/doc/building.dox index 27adeb34a..78278816e 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -261,13 +261,6 @@ project root: makepkg -p package/archlinux/ -If you want to build with another compiler (e.g. Clang), run makepkg this way: - - CXX=clang++ makepkg - -Development PKGBUILDs can detect when Clang is used and remove unsupported CXX -flags. - @section building-crosscompiling Crosscompiling For crosscompiling you need to have *both* target and native version of diff --git a/package/archlinux/PKGBUILD b/package/archlinux/PKGBUILD index 8ea54a4b0..5ef00d4c1 100644 --- a/package/archlinux/PKGBUILD +++ b/package/archlinux/PKGBUILD @@ -19,11 +19,6 @@ build() { newcxxflags=$(echo $CXXFLAGS | sed s/-O.//g | sed s/-D_FORTIFY_SOURCE=.//g) export CXXFLAGS="$newcxxflags" - if [ "$CXX" = clang++ ] ; then - newcxxflags=$(echo $CXXFLAGS | sed s/--param=ssp-buffer-size=4//g) - export CXXFLAGS="$newcxxflags" - fi - cmake .. \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=/usr \ diff --git a/package/archlinux/PKGBUILD-clang b/package/archlinux/PKGBUILD-clang new file mode 100644 index 000000000..6c8f7d717 --- /dev/null +++ b/package/archlinux/PKGBUILD-clang @@ -0,0 +1,49 @@ +# Author: mosra +pkgname=magnum +pkgver=dev.clang +pkgrel=1 +pkgdesc="C++11 and OpenGL 2D/3D graphics engine (built with clang)" +arch=('i686' 'x86_64') +url="https://github.com/mosra/magnum" +license=('MIT') +depends=('corrade' 'openal' 'freeglut' 'sdl2') +makedepends=('cmake' 'clang' 'ninja') +options=(!strip) +provides=('magnum-git') + +build() { + if [ ! -d "$startdir/build-clang" ] ; then + mkdir "$startdir/build-clang" + cd "$startdir/build-clang" + + cmake .. \ + -DCMAKE_CXX_COMPILER=clang++ \ + -G Ninja + fi + + cd "$startdir/build-clang" + + cmake .. \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DWITH_GLUTAPPLICATION=ON \ + -DWITH_GLXAPPLICATION=ON \ + -DWITH_SDL2APPLICATION=ON \ + -DWITH_MAGNUMFONT=ON \ + -DWITH_MAGNUMFONTCONVERTER=ON \ + -DWITH_TGAIMAGECONVERTER=ON \ + -DWITH_TGAIMPORTER=ON \ + -DWITH_WAVAUDIOIMPORTER=ON \ + -DBUILD_TESTS=TRUE + ninja +} + +check() { + cd "$startdir/build-clang" + ctest --output-on-failure +} + +package() { + cd "$startdir/build-clang" + DESTDIR="$pkgdir/" ninja install +} diff --git a/package/archlinux/PKGBUILD-es2 b/package/archlinux/PKGBUILD-es2 index 3fdc6db93..d33708476 100644 --- a/package/archlinux/PKGBUILD-es2 +++ b/package/archlinux/PKGBUILD-es2 @@ -15,11 +15,6 @@ build() { mkdir -p "$startdir/build-es2" cd "$startdir/build-es2" - if [ "$CXX" = clang++ ] ; then - newcxxflags=$(echo $CXXFLAGS | sed s/--param=ssp-buffer-size=4//g) - export CXXFLAGS="$newcxxflags" - fi - cmake .. \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=/usr \ diff --git a/package/archlinux/PKGBUILD-es2desktop b/package/archlinux/PKGBUILD-es2desktop index ec8961771..c7e4c70a5 100644 --- a/package/archlinux/PKGBUILD-es2desktop +++ b/package/archlinux/PKGBUILD-es2desktop @@ -15,11 +15,6 @@ build() { mkdir -p "$startdir/build-es2desktop" cd "$startdir/build-es2desktop" - if [ "$CXX" = clang++ ] ; then - newcxxflags=$(echo $CXXFLAGS | sed s/--param=ssp-buffer-size=4//g) - export CXXFLAGS="$newcxxflags" - fi - cmake .. \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=/usr \ diff --git a/package/archlinux/PKGBUILD-es3 b/package/archlinux/PKGBUILD-es3 index 1182f880c..c6477fdc2 100644 --- a/package/archlinux/PKGBUILD-es3 +++ b/package/archlinux/PKGBUILD-es3 @@ -15,11 +15,6 @@ build() { mkdir -p "$startdir/build-es3" cd "$startdir/build-es3" - if [ "$CXX" = clang++ ] ; then - newcxxflags=$(echo $CXXFLAGS | sed s/--param=ssp-buffer-size=4//g) - export CXXFLAGS="$newcxxflags" - fi - cmake .. \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=/usr \ diff --git a/package/archlinux/PKGBUILD-release b/package/archlinux/PKGBUILD-release index 1d41b3cfe..fcdb04932 100644 --- a/package/archlinux/PKGBUILD-release +++ b/package/archlinux/PKGBUILD-release @@ -14,11 +14,6 @@ build() { mkdir -p "$startdir/build" cd "$startdir/build/" - if [ "$CXX" = clang++ ] ; then - newcxxflags=$(echo $CXXFLAGS | sed s/--param=ssp-buffer-size=4//g) - export CXXFLAGS="$newcxxflags" - fi - cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ From d6a54ea5e5e1c992b75e9fee4c789f33b5131f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 24 Nov 2013 22:38:46 +0100 Subject: [PATCH 060/105] package: enable everything possible for development PKGBUILDs. --- package/archlinux/PKGBUILD-clang | 7 ++++++- package/archlinux/PKGBUILD-es2 | 4 ++-- package/archlinux/PKGBUILD-es2desktop | 6 ++++-- package/archlinux/PKGBUILD-es3 | 4 ++-- package/archlinux/PKGBUILD-release | 7 ++++++- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/package/archlinux/PKGBUILD-clang b/package/archlinux/PKGBUILD-clang index 6c8f7d717..5a9512582 100644 --- a/package/archlinux/PKGBUILD-clang +++ b/package/archlinux/PKGBUILD-clang @@ -26,6 +26,7 @@ build() { cmake .. \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=/usr \ + -DWITH_AUDIO=ON \ -DWITH_GLUTAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ @@ -34,7 +35,11 @@ build() { -DWITH_TGAIMAGECONVERTER=ON \ -DWITH_TGAIMPORTER=ON \ -DWITH_WAVAUDIOIMPORTER=ON \ - -DBUILD_TESTS=TRUE + -DWITH_DISTANCEFIELDCONVERTER=ON \ + -DWITH_FONTCONVERTER=ON \ + -DWITH_MAGNUMINFO=ON \ + -DBUILD_TESTS=ON \ + -DBUILD_GL_TESTS=ON ninja } diff --git a/package/archlinux/PKGBUILD-es2 b/package/archlinux/PKGBUILD-es2 index d33708476..de4f09680 100644 --- a/package/archlinux/PKGBUILD-es2 +++ b/package/archlinux/PKGBUILD-es2 @@ -18,15 +18,15 @@ build() { cmake .. \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=/usr \ - -DBUILD_TESTS=ON \ -DTARGET_GLES=ON \ -DTARGET_GLES2=ON \ - -DWITH_MAGNUMINFO=OFF \ + -DWITH_AUDIO=ON \ -DWITH_XEGLAPPLICATION=ON \ -DWITH_MAGNUMFONT=ON \ -DWITH_TGAIMAGECONVERTER=ON \ -DWITH_TGAIMPORTER=ON \ -DWITH_WAVAUDIOIMPORTER=ON \ + -DBUILD_TESTS=ON \ -G Ninja ninja } diff --git a/package/archlinux/PKGBUILD-es2desktop b/package/archlinux/PKGBUILD-es2desktop index c7e4c70a5..a25b1a271 100644 --- a/package/archlinux/PKGBUILD-es2desktop +++ b/package/archlinux/PKGBUILD-es2desktop @@ -18,17 +18,19 @@ build() { cmake .. \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=/usr \ - -DBUILD_TESTS=ON \ -DTARGET_GLES=ON \ -DTARGET_GLES2=ON \ -DTARGET_DESKTOP_GLES=ON \ - -DWITH_MAGNUMINFO=ON \ + -DWITH_AUDIO=ON \ -DWITH_GLXAPPLICATION=ON \ -DWITH_WINDOWLESSGLXAPPLICATION=ON \ -DWITH_MAGNUMFONT=ON \ -DWITH_TGAIMAGECONVERTER=ON \ -DWITH_TGAIMPORTER=ON \ -DWITH_WAVAUDIOIMPORTER=ON \ + -DWITH_MAGNUMINFO=ON \ + -DBUILD_TESTS=ON \ + -DBUILD_GL_TESTS=ON \ -G Ninja ninja } diff --git a/package/archlinux/PKGBUILD-es3 b/package/archlinux/PKGBUILD-es3 index c6477fdc2..e5a1070d2 100644 --- a/package/archlinux/PKGBUILD-es3 +++ b/package/archlinux/PKGBUILD-es3 @@ -18,15 +18,15 @@ build() { cmake .. \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=/usr \ - -DBUILD_TESTS=ON \ -DTARGET_GLES=ON \ -DTARGET_GLES2=OFF \ - -DWITH_MAGNUMINFO=OFF \ + -DWITH_AUDIO=ON \ -DWITH_XEGLAPPLICATION=ON \ -DWITH_MAGNUMFONT=ON \ -DWITH_TGAIMAGECONVERTER=ON \ -DWITH_TGAIMPORTER=ON \ -DWITH_WAVAUDIOIMPORTER=ON \ + -DBUILD_TESTS=ON \ -G Ninja ninja } diff --git a/package/archlinux/PKGBUILD-release b/package/archlinux/PKGBUILD-release index fcdb04932..3b592146b 100644 --- a/package/archlinux/PKGBUILD-release +++ b/package/archlinux/PKGBUILD-release @@ -17,6 +17,7 @@ build() { cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ + -DWITH_AUDIO=ON \ -DWITH_GLUTAPPLICATION=ON \ -DWITH_GLXAPPLICATION=ON \ -DWITH_SDL2APPLICATION=ON \ @@ -25,7 +26,11 @@ build() { -DWITH_TGAIMAGECONVERTER=ON \ -DWITH_TGAIMPORTER=ON \ -DWITH_WAVAUDIOIMPORTER=ON \ - -DBUILD_TESTS=TRUE \ + -DWITH_DISTANCEFIELDCONVERTER=ON \ + -DWITH_FONTCONVERTER=ON \ + -DWITH_MAGNUMINFO=ON \ + -DBUILD_TESTS=ON \ + -DBUILD_GL_TESTS=ON \ -G Ninja ninja } From beb6eb11b2c6cb7f45b950b875433d1d541d5a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 25 Nov 2013 23:43:51 +0100 Subject: [PATCH 061/105] external: updated OpenGL ES 2.0 and 3.0 headers. --- external/OpenGL/GLES2/gl2.h | 579 +++--- external/OpenGL/GLES2/gl2ext.h | 2528 +++++++++++---------------- external/OpenGL/GLES2/gl2platform.h | 2 +- external/OpenGL/GLES3/gl3.h | 1922 ++++++++++---------- external/OpenGL/GLES3/gl3platform.h | 2 +- external/OpenGL/KHR/khrplatform.h | 15 +- 6 files changed, 2196 insertions(+), 2852 deletions(-) diff --git a/external/OpenGL/GLES2/gl2.h b/external/OpenGL/GLES2/gl2.h index c2d835726..f6bed7d1b 100644 --- a/external/OpenGL/GLES2/gl2.h +++ b/external/OpenGL/GLES2/gl2.h @@ -1,56 +1,81 @@ #ifndef __gl2_h_ -#define __gl2_h_ - -/* $Revision: 20555 $ on $Date:: 2013-02-12 14:32:47 -0800 #$ */ - -#include +#define __gl2_h_ 1 #ifdef __cplusplus extern "C" { #endif /* - * This document is licensed under the SGI Free Software B License Version - * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . - */ +** Copyright (c) 2013 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$ on $Date$ +*/ -/*------------------------------------------------------------------------- - * Data type definitions - *-----------------------------------------------------------------------*/ +#include -typedef void GLvoid; -typedef char GLchar; -typedef unsigned int GLenum; -typedef unsigned char GLboolean; -typedef unsigned int GLbitfield; -typedef khronos_int8_t GLbyte; -typedef short GLshort; -typedef int GLint; -typedef int GLsizei; -typedef khronos_uint8_t GLubyte; -typedef unsigned short GLushort; -typedef unsigned int GLuint; -typedef khronos_float_t GLfloat; -typedef khronos_float_t GLclampf; -typedef khronos_int32_t GLfixed; +/* Generated C header for: + * API: gles2 + * Profile: common + * Versions considered: 2\.[0-9] + * Versions emitted: .* + * Default extensions included: None + * Additional extensions included: _nomatch_^ + * Extensions removed: _nomatch_^ + */ -/* GL types for handling large vertex buffer objects */ +#ifndef GL_ES_VERSION_2_0 +#define GL_ES_VERSION_2_0 1 +#include +typedef khronos_int8_t GLbyte; +typedef khronos_float_t GLclampf; +typedef khronos_int32_t GLfixed; +typedef short GLshort; +typedef unsigned short GLushort; +typedef void GLvoid; +typedef struct __GLsync *GLsync; +typedef khronos_int64_t GLint64; +typedef khronos_uint64_t GLuint64; +typedef unsigned int GLenum; +typedef unsigned int GLuint; +typedef char GLchar; +typedef khronos_float_t GLfloat; +typedef khronos_ssize_t GLsizeiptr; typedef khronos_intptr_t GLintptr; -typedef khronos_ssize_t GLsizeiptr; - -/* OpenGL ES core versions */ -#define GL_ES_VERSION_2_0 1 - -/* ClearBufferMask */ +typedef unsigned int GLbitfield; +typedef int GLint; +typedef unsigned char GLboolean; +typedef int GLsizei; +typedef khronos_uint8_t GLubyte; #define GL_DEPTH_BUFFER_BIT 0x00000100 #define GL_STENCIL_BUFFER_BIT 0x00000400 #define GL_COLOR_BUFFER_BIT 0x00004000 - -/* Boolean */ #define GL_FALSE 0 #define GL_TRUE 1 - -/* BeginMode */ #define GL_POINTS 0x0000 #define GL_LINES 0x0001 #define GL_LINE_LOOP 0x0002 @@ -58,18 +83,6 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_TRIANGLES 0x0004 #define GL_TRIANGLE_STRIP 0x0005 #define GL_TRIANGLE_FAN 0x0006 - -/* AlphaFunction (not supported in ES20) */ -/* GL_NEVER */ -/* GL_LESS */ -/* GL_EQUAL */ -/* GL_LEQUAL */ -/* GL_GREATER */ -/* GL_NOTEQUAL */ -/* GL_GEQUAL */ -/* GL_ALWAYS */ - -/* BlendingFactorDest */ #define GL_ZERO 0 #define GL_ONE 1 #define GL_SRC_COLOR 0x0300 @@ -78,29 +91,15 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_ONE_MINUS_SRC_ALPHA 0x0303 #define GL_DST_ALPHA 0x0304 #define GL_ONE_MINUS_DST_ALPHA 0x0305 - -/* BlendingFactorSrc */ -/* GL_ZERO */ -/* GL_ONE */ #define GL_DST_COLOR 0x0306 #define GL_ONE_MINUS_DST_COLOR 0x0307 #define GL_SRC_ALPHA_SATURATE 0x0308 -/* GL_SRC_ALPHA */ -/* GL_ONE_MINUS_SRC_ALPHA */ -/* GL_DST_ALPHA */ -/* GL_ONE_MINUS_DST_ALPHA */ - -/* BlendEquationSeparate */ #define GL_FUNC_ADD 0x8006 #define GL_BLEND_EQUATION 0x8009 -#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */ +#define GL_BLEND_EQUATION_RGB 0x8009 #define GL_BLEND_EQUATION_ALPHA 0x883D - -/* BlendSubtract */ #define GL_FUNC_SUBTRACT 0x800A #define GL_FUNC_REVERSE_SUBTRACT 0x800B - -/* Separate Blend Functions */ #define GL_BLEND_DST_RGB 0x80C8 #define GL_BLEND_SRC_RGB 0x80C9 #define GL_BLEND_DST_ALPHA 0x80CA @@ -110,38 +109,19 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_CONSTANT_ALPHA 0x8003 #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 #define GL_BLEND_COLOR 0x8005 - -/* Buffer Objects */ #define GL_ARRAY_BUFFER 0x8892 #define GL_ELEMENT_ARRAY_BUFFER 0x8893 #define GL_ARRAY_BUFFER_BINDING 0x8894 #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 - #define GL_STREAM_DRAW 0x88E0 #define GL_STATIC_DRAW 0x88E4 #define GL_DYNAMIC_DRAW 0x88E8 - #define GL_BUFFER_SIZE 0x8764 #define GL_BUFFER_USAGE 0x8765 - #define GL_CURRENT_VERTEX_ATTRIB 0x8626 - -/* CullFaceMode */ #define GL_FRONT 0x0404 #define GL_BACK 0x0405 #define GL_FRONT_AND_BACK 0x0408 - -/* DepthFunction */ -/* GL_NEVER */ -/* GL_LESS */ -/* GL_EQUAL */ -/* GL_LEQUAL */ -/* GL_GREATER */ -/* GL_NOTEQUAL */ -/* GL_GEQUAL */ -/* GL_ALWAYS */ - -/* EnableCap */ #define GL_TEXTURE_2D 0x0DE1 #define GL_CULL_FACE 0x0B44 #define GL_BLEND 0x0BE2 @@ -152,19 +132,13 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_POLYGON_OFFSET_FILL 0x8037 #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E #define GL_SAMPLE_COVERAGE 0x80A0 - -/* ErrorCode */ #define GL_NO_ERROR 0 #define GL_INVALID_ENUM 0x0500 #define GL_INVALID_VALUE 0x0501 #define GL_INVALID_OPERATION 0x0502 #define GL_OUT_OF_MEMORY 0x0505 - -/* FrontFaceDirection */ #define GL_CW 0x0900 #define GL_CCW 0x0901 - -/* GetPName */ #define GL_LINE_WIDTH 0x0B21 #define GL_ALIASED_POINT_SIZE_RANGE 0x846D #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E @@ -191,7 +165,6 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_STENCIL_BACK_WRITEMASK 0x8CA5 #define GL_VIEWPORT 0x0BA2 #define GL_SCISSOR_BOX 0x0C10 -/* GL_SCISSOR_TEST */ #define GL_COLOR_CLEAR_VALUE 0x0C22 #define GL_COLOR_WRITEMASK 0x0C23 #define GL_UNPACK_ALIGNMENT 0x0CF5 @@ -206,32 +179,18 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_DEPTH_BITS 0x0D56 #define GL_STENCIL_BITS 0x0D57 #define GL_POLYGON_OFFSET_UNITS 0x2A00 -/* GL_POLYGON_OFFSET_FILL */ #define GL_POLYGON_OFFSET_FACTOR 0x8038 #define GL_TEXTURE_BINDING_2D 0x8069 #define GL_SAMPLE_BUFFERS 0x80A8 #define GL_SAMPLES 0x80A9 #define GL_SAMPLE_COVERAGE_VALUE 0x80AA #define GL_SAMPLE_COVERAGE_INVERT 0x80AB - -/* GetTextureParameter */ -/* GL_TEXTURE_MAG_FILTER */ -/* GL_TEXTURE_MIN_FILTER */ -/* GL_TEXTURE_WRAP_S */ -/* GL_TEXTURE_WRAP_T */ - #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 - -/* HintMode */ #define GL_DONT_CARE 0x1100 #define GL_FASTEST 0x1101 #define GL_NICEST 0x1102 - -/* HintTarget */ -#define GL_GENERATE_MIPMAP_HINT 0x8192 - -/* DataType */ +#define GL_GENERATE_MIPMAP_HINT 0x8192 #define GL_BYTE 0x1400 #define GL_UNSIGNED_BYTE 0x1401 #define GL_SHORT 0x1402 @@ -240,44 +199,35 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_UNSIGNED_INT 0x1405 #define GL_FLOAT 0x1406 #define GL_FIXED 0x140C - -/* PixelFormat */ #define GL_DEPTH_COMPONENT 0x1902 #define GL_ALPHA 0x1906 #define GL_RGB 0x1907 #define GL_RGBA 0x1908 #define GL_LUMINANCE 0x1909 #define GL_LUMINANCE_ALPHA 0x190A - -/* PixelType */ -/* GL_UNSIGNED_BYTE */ #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 #define GL_UNSIGNED_SHORT_5_6_5 0x8363 - -/* Shaders */ -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB -#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD -#define GL_SHADER_TYPE 0x8B4F -#define GL_DELETE_STATUS 0x8B80 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D - -/* StencilFunction */ +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD +#define GL_SHADER_TYPE 0x8B4F +#define GL_DELETE_STATUS 0x8B80 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D #define GL_NEVER 0x0200 #define GL_LESS 0x0201 #define GL_EQUAL 0x0202 @@ -286,9 +236,6 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_NOTEQUAL 0x0205 #define GL_GEQUAL 0x0206 #define GL_ALWAYS 0x0207 - -/* StencilOp */ -/* GL_ZERO */ #define GL_KEEP 0x1E00 #define GL_REPLACE 0x1E01 #define GL_INCR 0x1E02 @@ -296,35 +243,21 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_INVERT 0x150A #define GL_INCR_WRAP 0x8507 #define GL_DECR_WRAP 0x8508 - -/* StringName */ #define GL_VENDOR 0x1F00 #define GL_RENDERER 0x1F01 #define GL_VERSION 0x1F02 #define GL_EXTENSIONS 0x1F03 - -/* TextureMagFilter */ #define GL_NEAREST 0x2600 #define GL_LINEAR 0x2601 - -/* TextureMinFilter */ -/* GL_NEAREST */ -/* GL_LINEAR */ #define GL_NEAREST_MIPMAP_NEAREST 0x2700 #define GL_LINEAR_MIPMAP_NEAREST 0x2701 #define GL_NEAREST_MIPMAP_LINEAR 0x2702 #define GL_LINEAR_MIPMAP_LINEAR 0x2703 - -/* TextureParameterName */ #define GL_TEXTURE_MAG_FILTER 0x2800 #define GL_TEXTURE_MIN_FILTER 0x2801 #define GL_TEXTURE_WRAP_S 0x2802 #define GL_TEXTURE_WRAP_T 0x2803 - -/* TextureTarget */ -/* GL_TEXTURE_2D */ #define GL_TEXTURE 0x1702 - #define GL_TEXTURE_CUBE_MAP 0x8513 #define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 @@ -334,8 +267,6 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A #define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C - -/* TextureUnit */ #define GL_TEXTURE0 0x84C0 #define GL_TEXTURE1 0x84C1 #define GL_TEXTURE2 0x84C2 @@ -369,13 +300,9 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_TEXTURE30 0x84DE #define GL_TEXTURE31 0x84DF #define GL_ACTIVE_TEXTURE 0x84E0 - -/* TextureWrapMode */ #define GL_REPEAT 0x2901 #define GL_CLAMP_TO_EDGE 0x812F #define GL_MIRRORED_REPEAT 0x8370 - -/* Uniform Types */ #define GL_FLOAT_VEC2 0x8B50 #define GL_FLOAT_VEC3 0x8B51 #define GL_FLOAT_VEC4 0x8B52 @@ -391,48 +318,34 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_FLOAT_MAT4 0x8B5C #define GL_SAMPLER_2D 0x8B5E #define GL_SAMPLER_CUBE 0x8B60 - -/* Vertex Arrays */ -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F - -/* Read Format */ -#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A #define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B - -/* Shader Source */ #define GL_COMPILE_STATUS 0x8B81 #define GL_INFO_LOG_LENGTH 0x8B84 #define GL_SHADER_SOURCE_LENGTH 0x8B88 #define GL_SHADER_COMPILER 0x8DFA - -/* Shader Binary */ #define GL_SHADER_BINARY_FORMATS 0x8DF8 #define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 - -/* Shader Precision-Specified Types */ #define GL_LOW_FLOAT 0x8DF0 #define GL_MEDIUM_FLOAT 0x8DF1 #define GL_HIGH_FLOAT 0x8DF2 #define GL_LOW_INT 0x8DF3 #define GL_MEDIUM_INT 0x8DF4 #define GL_HIGH_INT 0x8DF5 - -/* Framebuffer Object. */ #define GL_FRAMEBUFFER 0x8D40 #define GL_RENDERBUFFER 0x8D41 - #define GL_RGBA4 0x8056 #define GL_RGB5_A1 0x8057 #define GL_RGB565 0x8D62 #define GL_DEPTH_COMPONENT16 0x81A5 #define GL_STENCIL_INDEX8 0x8D48 - #define GL_RENDERBUFFER_WIDTH 0x8D42 #define GL_RENDERBUFFER_HEIGHT 0x8D43 #define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 @@ -442,179 +355,169 @@ typedef khronos_ssize_t GLsizeiptr; #define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 #define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 #define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 - -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 - #define GL_COLOR_ATTACHMENT0 0x8CE0 #define GL_DEPTH_ATTACHMENT 0x8D00 #define GL_STENCIL_ATTACHMENT 0x8D20 - #define GL_NONE 0 - -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9 -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD - +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9 +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD #define GL_FRAMEBUFFER_BINDING 0x8CA6 #define GL_RENDERBUFFER_BINDING 0x8CA7 #define GL_MAX_RENDERBUFFER_SIZE 0x84E8 - #define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 - -/*------------------------------------------------------------------------- - * GL core functions. - *-----------------------------------------------------------------------*/ - -GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture); -GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader); -GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name); -GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); -GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); -GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); -GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); -GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode ); -GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); -GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); -GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); -GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); -GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target); -GL_APICALL void GL_APIENTRY glClear (GLbitfield mask); -GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth); -GL_APICALL void GL_APIENTRY glClearStencil (GLint s); -GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader); -GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data); -GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL GLuint GL_APIENTRY glCreateProgram (void); -GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type); -GL_APICALL void GL_APIENTRY glCullFace (GLenum mode); -GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers); -GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers); -GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program); -GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers); -GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader); -GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures); -GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func); -GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag); -GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar); -GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader); -GL_APICALL void GL_APIENTRY glDisable (GLenum cap); -GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index); -GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); -GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices); -GL_APICALL void GL_APIENTRY glEnable (GLenum cap); -GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index); -GL_APICALL void GL_APIENTRY glFinish (void); -GL_APICALL void GL_APIENTRY glFlush (void); -GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode); -GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers); -GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target); -GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers); -GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers); -GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures); -GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); -GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); -GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders); -GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name); -GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params); -GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params); -GL_APICALL GLenum GL_APIENTRY glGetError (void); -GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params); -GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog); -GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog); -GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); -GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); -GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name); -GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params); -GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params); -GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params); -GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name); -GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params); -GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer); -GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode); -GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); -GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap); -GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer); -GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program); -GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer); -GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader); -GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture); -GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width); -GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program); -GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); -GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); -GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); -GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); -GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length); -GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length); -GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask); -GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); -GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass); -GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels); -GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); -GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params); -GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params); -GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels); -GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x); -GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v); -GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x); -GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v); -GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y); -GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v); -GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y); -GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v); -GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v); -GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z); -GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v); -GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v); -GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w); -GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v); -GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glUseProgram (GLuint program); -GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program); -GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x); -GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values); -GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y); -GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values); -GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values); -GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values); -GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr); -GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture); +GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader); +GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name); +GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); +GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); +GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); +GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode); +GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); +GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage); +GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); +GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target); +GL_APICALL void GL_APIENTRY glClear (GLbitfield mask); +GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d); +GL_APICALL void GL_APIENTRY glClearStencil (GLint s); +GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader); +GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL GLuint GL_APIENTRY glCreateProgram (void); +GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type); +GL_APICALL void GL_APIENTRY glCullFace (GLenum mode); +GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); +GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers); +GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program); +GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers); +GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader); +GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func); +GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag); +GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f); +GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader); +GL_APICALL void GL_APIENTRY glDisable (GLenum cap); +GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index); +GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices); +GL_APICALL void GL_APIENTRY glEnable (GLenum cap); +GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index); +GL_APICALL void GL_APIENTRY glFinish (void); +GL_APICALL void GL_APIENTRY glFlush (void); +GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode); +GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); +GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target); +GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers); +GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers); +GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures); +GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); +GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name); +GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); +GL_APICALL GLenum GL_APIENTRY glGetError (void); +GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name); +GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params); +GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params); +GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name); +GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); +GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer); +GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode); +GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); +GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap); +GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer); +GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program); +GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer); +GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader); +GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture); +GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width); +GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program); +GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); +GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); +GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); +GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); +GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); +GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask); +GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0); +GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0); +GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1); +GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1); +GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2); +GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUseProgram (GLuint program); +GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program); +GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x); +GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v); +GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y); +GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v); +GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v); +GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v); +GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); +#endif /* GL_ES_VERSION_2_0 */ #ifdef __cplusplus } #endif -#endif /* __gl2_h_ */ +#endif diff --git a/external/OpenGL/GLES2/gl2ext.h b/external/OpenGL/GLES2/gl2ext.h index 162a09cfb..790fd3a31 100644 --- a/external/OpenGL/GLES2/gl2ext.h +++ b/external/OpenGL/GLES2/gl2ext.h @@ -1,1344 +1,560 @@ #ifndef __gl2ext_h_ -#define __gl2ext_h_ +#define __gl2ext_h_ 1 -/* $Revision: 21470 $ on $Date:: 2013-05-08 17:33:40 -0700 #$ */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * This document is licensed under the SGI Free Software B License Version - * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . - */ - -#ifndef GL_APIENTRYP -# define GL_APIENTRYP GL_APIENTRY* -#endif - -/* New types shared by several extensions */ - -#ifndef __gl3_h_ -/* These are defineed with respect to in the - * Apple extension spec, but they are also used by non-APPLE - * extensions, and in the Khronos header we use the Khronos - * portable types in khrplatform.h, which must be defined. - */ -typedef khronos_int64_t GLint64; -typedef khronos_uint64_t GLuint64; -typedef struct __GLsync *GLsync; -#endif - - -/*------------------------------------------------------------------------* - * OES extension tokens - *------------------------------------------------------------------------*/ - -/* GL_OES_compressed_ETC1_RGB8_texture */ -#ifndef GL_OES_compressed_ETC1_RGB8_texture -#define GL_ETC1_RGB8_OES 0x8D64 -#endif - -/* GL_OES_compressed_paletted_texture */ -#ifndef GL_OES_compressed_paletted_texture -#define GL_PALETTE4_RGB8_OES 0x8B90 -#define GL_PALETTE4_RGBA8_OES 0x8B91 -#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 -#define GL_PALETTE4_RGBA4_OES 0x8B93 -#define GL_PALETTE4_RGB5_A1_OES 0x8B94 -#define GL_PALETTE8_RGB8_OES 0x8B95 -#define GL_PALETTE8_RGBA8_OES 0x8B96 -#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 -#define GL_PALETTE8_RGBA4_OES 0x8B98 -#define GL_PALETTE8_RGB5_A1_OES 0x8B99 -#endif - -/* GL_OES_depth24 */ -#ifndef GL_OES_depth24 -#define GL_DEPTH_COMPONENT24_OES 0x81A6 -#endif - -/* GL_OES_depth32 */ -#ifndef GL_OES_depth32 -#define GL_DEPTH_COMPONENT32_OES 0x81A7 -#endif - -/* GL_OES_depth_texture */ -/* No new tokens introduced by this extension. */ - -/* GL_OES_EGL_image */ -#ifndef GL_OES_EGL_image -typedef void* GLeglImageOES; -#endif - -/* GL_OES_EGL_image_external */ -#ifndef GL_OES_EGL_image_external -/* GLeglImageOES defined in GL_OES_EGL_image already. */ -#define GL_TEXTURE_EXTERNAL_OES 0x8D65 -#define GL_SAMPLER_EXTERNAL_OES 0x8D66 -#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 -#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 -#endif - -/* GL_OES_element_index_uint */ -#ifndef GL_OES_element_index_uint -#define GL_UNSIGNED_INT 0x1405 -#endif - -/* GL_OES_get_program_binary */ -#ifndef GL_OES_get_program_binary -#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741 -#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE -#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF -#endif - -/* GL_OES_mapbuffer */ -#ifndef GL_OES_mapbuffer -#define GL_WRITE_ONLY_OES 0x88B9 -#define GL_BUFFER_ACCESS_OES 0x88BB -#define GL_BUFFER_MAPPED_OES 0x88BC -#define GL_BUFFER_MAP_POINTER_OES 0x88BD -#endif - -/* GL_OES_packed_depth_stencil */ -#ifndef GL_OES_packed_depth_stencil -#define GL_DEPTH_STENCIL_OES 0x84F9 -#define GL_UNSIGNED_INT_24_8_OES 0x84FA -#define GL_DEPTH24_STENCIL8_OES 0x88F0 -#endif - -/* GL_OES_required_internalformat */ -#ifndef GL_OES_required_internalformat -#define GL_ALPHA8_OES 0x803C -#define GL_DEPTH_COMPONENT16_OES 0x81A5 -/* reuse GL_DEPTH_COMPONENT24_OES */ -/* reuse GL_DEPTH24_STENCIL8_OES */ -/* reuse GL_DEPTH_COMPONENT32_OES */ -#define GL_LUMINANCE4_ALPHA4_OES 0x8043 -#define GL_LUMINANCE8_ALPHA8_OES 0x8045 -#define GL_LUMINANCE8_OES 0x8040 -#define GL_RGBA4_OES 0x8056 -#define GL_RGB5_A1_OES 0x8057 -#define GL_RGB565_OES 0x8D62 -/* reuse GL_RGB8_OES */ -/* reuse GL_RGBA8_OES */ -/* reuse GL_RGB10_EXT */ -/* reuse GL_RGB10_A2_EXT */ -#endif - -/* GL_OES_rgb8_rgba8 */ -#ifndef GL_OES_rgb8_rgba8 -#define GL_RGB8_OES 0x8051 -#define GL_RGBA8_OES 0x8058 -#endif - -/* GL_OES_standard_derivatives */ -#ifndef GL_OES_standard_derivatives -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B -#endif - -/* GL_OES_stencil1 */ -#ifndef GL_OES_stencil1 -#define GL_STENCIL_INDEX1_OES 0x8D46 -#endif - -/* GL_OES_stencil4 */ -#ifndef GL_OES_stencil4 -#define GL_STENCIL_INDEX4_OES 0x8D47 -#endif - -#ifndef GL_OES_surfaceless_context -#define GL_FRAMEBUFFER_UNDEFINED_OES 0x8219 -#endif - -/* GL_OES_texture_3D */ -#ifndef GL_OES_texture_3D -#define GL_TEXTURE_WRAP_R_OES 0x8072 -#define GL_TEXTURE_3D_OES 0x806F -#define GL_TEXTURE_BINDING_3D_OES 0x806A -#define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073 -#define GL_SAMPLER_3D_OES 0x8B5F -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4 -#endif - -/* GL_OES_texture_float */ -/* No new tokens introduced by this extension. */ - -/* GL_OES_texture_float_linear */ -/* No new tokens introduced by this extension. */ - -/* GL_OES_texture_half_float */ -#ifndef GL_OES_texture_half_float -#define GL_HALF_FLOAT_OES 0x8D61 -#endif - -/* GL_OES_texture_half_float_linear */ -/* No new tokens introduced by this extension. */ - -/* GL_OES_texture_npot */ -/* No new tokens introduced by this extension. */ - -/* GL_OES_vertex_array_object */ -#ifndef GL_OES_vertex_array_object -#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5 -#endif - -/* GL_OES_vertex_half_float */ -/* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */ - -/* GL_OES_vertex_type_10_10_10_2 */ -#ifndef GL_OES_vertex_type_10_10_10_2 -#define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6 -#define GL_INT_10_10_10_2_OES 0x8DF7 -#endif - -/*------------------------------------------------------------------------* - * KHR extension tokens - *------------------------------------------------------------------------*/ - -#ifndef GL_KHR_debug -typedef void (GL_APIENTRYP GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); -#define GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION_KHR 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM_KHR 0x8245 -#define GL_DEBUG_SOURCE_API_KHR 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY_KHR 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION_KHR 0x824A -#define GL_DEBUG_SOURCE_OTHER_KHR 0x824B -#define GL_DEBUG_TYPE_ERROR_KHR 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR 0x824E -#define GL_DEBUG_TYPE_PORTABILITY_KHR 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE_KHR 0x8250 -#define GL_DEBUG_TYPE_OTHER_KHR 0x8251 -#define GL_DEBUG_TYPE_MARKER_KHR 0x8268 -#define GL_DEBUG_TYPE_PUSH_GROUP_KHR 0x8269 -#define GL_DEBUG_TYPE_POP_GROUP_KHR 0x826A -#define GL_DEBUG_SEVERITY_NOTIFICATION_KHR 0x826B -#define GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR 0x826C -#define GL_DEBUG_GROUP_STACK_DEPTH_KHR 0x826D -#define GL_BUFFER_KHR 0x82E0 -#define GL_SHADER_KHR 0x82E1 -#define GL_PROGRAM_KHR 0x82E2 -#define GL_QUERY_KHR 0x82E3 -/* PROGRAM_PIPELINE only in GL */ -#define GL_SAMPLER_KHR 0x82E6 -/* DISPLAY_LIST only in GL */ -#define GL_MAX_LABEL_LENGTH_KHR 0x82E8 -#define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_KHR 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_KHR 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_KHR 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_KHR 0x9147 -#define GL_DEBUG_SEVERITY_LOW_KHR 0x9148 -#define GL_DEBUG_OUTPUT_KHR 0x92E0 -#define GL_CONTEXT_FLAG_DEBUG_BIT_KHR 0x00000002 -#define GL_STACK_OVERFLOW_KHR 0x0503 -#define GL_STACK_UNDERFLOW_KHR 0x0504 -#endif - -#ifndef GL_KHR_texture_compression_astc_ldr -#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 - -/*------------------------------------------------------------------------* - * AMD extension tokens - *------------------------------------------------------------------------*/ - -/* GL_AMD_compressed_3DC_texture */ -#ifndef GL_AMD_compressed_3DC_texture -#define GL_3DC_X_AMD 0x87F9 -#define GL_3DC_XY_AMD 0x87FA -#endif - -/* GL_AMD_compressed_ATC_texture */ -#ifndef GL_AMD_compressed_ATC_texture -#define GL_ATC_RGB_AMD 0x8C92 -#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 -#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE -#endif - -/* GL_AMD_performance_monitor */ -#ifndef GL_AMD_performance_monitor -#define GL_COUNTER_TYPE_AMD 0x8BC0 -#define GL_COUNTER_RANGE_AMD 0x8BC1 -#define GL_UNSIGNED_INT64_AMD 0x8BC2 -#define GL_PERCENTAGE_AMD 0x8BC3 -#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 -#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 -#define GL_PERFMON_RESULT_AMD 0x8BC6 -#endif - -/* GL_AMD_program_binary_Z400 */ -#ifndef GL_AMD_program_binary_Z400 -#define GL_Z400_BINARY_AMD 0x8740 -#endif - -/*------------------------------------------------------------------------* - * ANGLE extension tokens - *------------------------------------------------------------------------*/ - -/* GL_ANGLE_depth_texture */ -#ifndef GL_ANGLE_depth_texture -#define GL_DEPTH_COMPONENT 0x1902 -#define GL_DEPTH_STENCIL_OES 0x84F9 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_UNSIGNED_INT 0x1405 -#define GL_UNSIGNED_INT_24_8_OES 0x84FA -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT32_OES 0x81A7 -#define GL_DEPTH24_STENCIL8_OES 0x88F0 -#endif - -/* GL_ANGLE_framebuffer_blit */ -#ifndef GL_ANGLE_framebuffer_blit -#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA -#endif - -/* GL_ANGLE_framebuffer_multisample */ -#ifndef GL_ANGLE_framebuffer_multisample -#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 -#define GL_MAX_SAMPLES_ANGLE 0x8D57 -#endif - -/* GL_ANGLE_instanced_arrays */ -#ifndef GL_ANGLE_instanced_arrays -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE -#endif - -/* GL_ANGLE_pack_reverse_row_order */ -#ifndef GL_ANGLE_pack_reverse_row_order -#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 -#endif - -/* GL_ANGLE_program_binary */ -#ifndef GL_ANGLE_program_binary -#define GL_PROGRAM_BINARY_ANGLE 0x93A6 -#endif - -/* GL_ANGLE_texture_compression_dxt3 */ -#ifndef GL_ANGLE_texture_compression_dxt3 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 -#endif - -/* GL_ANGLE_texture_compression_dxt5 */ -#ifndef GL_ANGLE_texture_compression_dxt5 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 -#endif - -/* GL_ANGLE_texture_usage */ -#ifndef GL_ANGLE_texture_usage -#define GL_TEXTURE_USAGE_ANGLE 0x93A2 -#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 -#endif - -/* GL_ANGLE_translated_shader_source */ -#ifndef GL_ANGLE_translated_shader_source -#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 -#endif - -/*------------------------------------------------------------------------* - * APPLE extension tokens - *------------------------------------------------------------------------*/ - -/* GL_APPLE_copy_texture_levels */ -/* No new tokens introduced by this extension. */ - -/* GL_APPLE_framebuffer_multisample */ -#ifndef GL_APPLE_framebuffer_multisample -#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 -#define GL_MAX_SAMPLES_APPLE 0x8D57 -#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA -#endif - -/* GL_APPLE_rgb_422 */ -#ifndef GL_APPLE_rgb_422 -#define GL_RGB_422_APPLE 0x8A1F -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#endif - -/* GL_APPLE_sync */ -#ifndef GL_APPLE_sync - -#define GL_SYNC_OBJECT_APPLE 0x8A53 -#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111 -#define GL_OBJECT_TYPE_APPLE 0x9112 -#define GL_SYNC_CONDITION_APPLE 0x9113 -#define GL_SYNC_STATUS_APPLE 0x9114 -#define GL_SYNC_FLAGS_APPLE 0x9115 -#define GL_SYNC_FENCE_APPLE 0x9116 -#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117 -#define GL_UNSIGNALED_APPLE 0x9118 -#define GL_SIGNALED_APPLE 0x9119 -#define GL_ALREADY_SIGNALED_APPLE 0x911A -#define GL_TIMEOUT_EXPIRED_APPLE 0x911B -#define GL_CONDITION_SATISFIED_APPLE 0x911C -#define GL_WAIT_FAILED_APPLE 0x911D -#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001 -#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull -#endif - -/* GL_APPLE_texture_format_BGRA8888 */ -#ifndef GL_APPLE_texture_format_BGRA8888 -#define GL_BGRA_EXT 0x80E1 -#endif - -/* GL_APPLE_texture_max_level */ -#ifndef GL_APPLE_texture_max_level -#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D -#endif - -/*------------------------------------------------------------------------* - * ARM extension tokens - *------------------------------------------------------------------------*/ - -/* GL_ARM_mali_program_binary */ -#ifndef GL_ARM_mali_program_binary -#define GL_MALI_PROGRAM_BINARY_ARM 0x8F61 -#endif - -/* GL_ARM_mali_shader_binary */ -#ifndef GL_ARM_mali_shader_binary -#define GL_MALI_SHADER_BINARY_ARM 0x8F60 -#endif - -/* GL_ARM_rgba8 */ -/* No new tokens introduced by this extension. */ - -/*------------------------------------------------------------------------* - * EXT extension tokens - *------------------------------------------------------------------------*/ - -/* GL_EXT_blend_minmax */ -#ifndef GL_EXT_blend_minmax -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#endif - -/* GL_EXT_color_buffer_half_float */ -#ifndef GL_EXT_color_buffer_half_float -#define GL_RGBA16F_EXT 0x881A -#define GL_RGB16F_EXT 0x881B -#define GL_RG16F_EXT 0x822F -#define GL_R16F_EXT 0x822D -#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211 -#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17 -#endif - -/* GL_EXT_debug_label */ -#ifndef GL_EXT_debug_label -#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 -#endif - -/* GL_EXT_debug_marker */ -/* No new tokens introduced by this extension. */ - -/* GL_EXT_discard_framebuffer */ -#ifndef GL_EXT_discard_framebuffer -#define GL_COLOR_EXT 0x1800 -#define GL_DEPTH_EXT 0x1801 -#define GL_STENCIL_EXT 0x1802 -#endif - -#ifndef GL_EXT_disjoint_timer_query -#define GL_EXT_disjoint_timer_query 1 -#define GL_QUERY_COUNTER_BITS_EXT 0x8864 -#define GL_CURRENT_QUERY_EXT 0x8865 -#define GL_QUERY_RESULT_EXT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867 -#define GL_TIME_ELAPSED_EXT 0x88BF -#define GL_TIMESTAMP_EXT 0x8E28 -#define GL_GPU_DISJOINT_EXT 0x8FBB -#endif - -/* GL_EXT_map_buffer_range */ -#ifndef GL_EXT_map_buffer_range -#define GL_MAP_READ_BIT_EXT 0x0001 -#define GL_MAP_WRITE_BIT_EXT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 -#endif - -/* GL_EXT_multisampled_render_to_texture */ -#ifndef GL_EXT_multisampled_render_to_texture -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C -/* reuse values from GL_EXT_framebuffer_multisample (desktop extension) */ -#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 -#define GL_MAX_SAMPLES_EXT 0x8D57 -#endif - -/* GL_EXT_multiview_draw_buffers */ -#ifndef GL_EXT_multiview_draw_buffers -#define GL_COLOR_ATTACHMENT_EXT 0x90F0 -#define GL_MULTIVIEW_EXT 0x90F1 -#define GL_DRAW_BUFFER_EXT 0x0C01 -#define GL_READ_BUFFER_EXT 0x0C02 -#define GL_MAX_MULTIVIEW_BUFFERS_EXT 0x90F2 -#endif - -/* GL_EXT_multi_draw_arrays */ -/* No new tokens introduced by this extension. */ - -/* GL_EXT_occlusion_query_boolean */ -#ifndef GL_EXT_occlusion_query_boolean -#define GL_ANY_SAMPLES_PASSED_EXT 0x8C2F -#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A -#define GL_CURRENT_QUERY_EXT 0x8865 -#define GL_QUERY_RESULT_EXT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867 -#endif - -/* GL_EXT_read_format_bgra */ -#ifndef GL_EXT_read_format_bgra -#define GL_BGRA_EXT 0x80E1 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 -#endif - -/* GL_EXT_robustness */ -#ifndef GL_EXT_robustness -/* reuse GL_NO_ERROR */ -#define GL_GUILTY_CONTEXT_RESET_EXT 0x8253 -#define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255 -#define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3 -#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256 -#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252 -#define GL_NO_RESET_NOTIFICATION_EXT 0x8261 -#endif - -/* GL_EXT_separate_shader_objects */ -#ifndef GL_EXT_separate_shader_objects -#define GL_VERTEX_SHADER_BIT_EXT 0x00000001 -#define GL_FRAGMENT_SHADER_BIT_EXT 0x00000002 -#define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF -#define GL_PROGRAM_SEPARABLE_EXT 0x8258 -#define GL_ACTIVE_PROGRAM_EXT 0x8259 -#define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A -#endif - -/* GL_EXT_shader_framebuffer_fetch */ -#ifndef GL_EXT_shader_framebuffer_fetch -#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 -#endif - -/* GL_EXT_shader_texture_lod */ -/* No new tokens introduced by this extension. */ - -/* GL_EXT_shadow_samplers */ -#ifndef GL_EXT_shadow_samplers -#define GL_TEXTURE_COMPARE_MODE_EXT 0x884C -#define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D -#define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E -#define GL_SAMPLER_2D_SHADOW_EXT 0x8B62 -#endif - -/* GL_EXT_sRGB */ -#ifndef GL_EXT_sRGB -#define GL_SRGB_EXT 0x8C40 -#define GL_SRGB_ALPHA_EXT 0x8C42 -#define GL_SRGB8_ALPHA8_EXT 0x8C43 -#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210 -#endif - -/* GL_EXT_texture_compression_dxt1 */ -#ifndef GL_EXT_texture_compression_dxt1 -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#endif - -/* GL_EXT_texture_filter_anisotropic */ -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif - -/* GL_EXT_texture_format_BGRA8888 */ -#ifndef GL_EXT_texture_format_BGRA8888 -#define GL_BGRA_EXT 0x80E1 -#endif - -/* GL_EXT_texture_rg */ -#ifndef GL_EXT_texture_rg -#define GL_RED_EXT 0x1903 -#define GL_RG_EXT 0x8227 -#define GL_R8_EXT 0x8229 -#define GL_RG8_EXT 0x822B -#endif - -/* GL_EXT_texture_storage */ -#ifndef GL_EXT_texture_storage -#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F -#define GL_ALPHA8_EXT 0x803C -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_RGBA32F_EXT 0x8814 -#define GL_RGB32F_EXT 0x8815 -#define GL_ALPHA32F_EXT 0x8816 -#define GL_LUMINANCE32F_EXT 0x8818 -#define GL_LUMINANCE_ALPHA32F_EXT 0x8819 -/* reuse GL_RGBA16F_EXT */ -/* reuse GL_RGB16F_EXT */ -#define GL_ALPHA16F_EXT 0x881C -#define GL_LUMINANCE16F_EXT 0x881E -#define GL_LUMINANCE_ALPHA16F_EXT 0x881F -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGB10_EXT 0x8052 -#define GL_BGRA8_EXT 0x93A1 -#define GL_R8_EXT 0x8229 -#define GL_RG8_EXT 0x822B -#define GL_R32F_EXT 0x822E -#define GL_RG32F_EXT 0x8230 -#define GL_R16F_EXT 0x822D -#define GL_RG16F_EXT 0x822F -#endif - -/* GL_EXT_texture_type_2_10_10_10_REV */ -#ifndef GL_EXT_texture_type_2_10_10_10_REV -#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 -#endif - -/* GL_EXT_unpack_subimage */ -#ifndef GL_EXT_unpack_subimage -#define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2 -#define GL_UNPACK_SKIP_ROWS_EXT 0x0CF3 -#define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4 -#endif - -/*------------------------------------------------------------------------* - * DMP extension tokens - *------------------------------------------------------------------------*/ - -/* GL_DMP_shader_binary */ -#ifndef GL_DMP_shader_binary -#define GL_SHADER_BINARY_DMP 0x9250 -#endif - -/*------------------------------------------------------------------------* - * FJ extension tokens - *------------------------------------------------------------------------*/ - -/* GL_FJ_shader_binary_GCCSO */ -#ifndef GL_FJ_shader_binary_GCCSO -#define GL_GCCSO_SHADER_BINARY_FJ 0x9260 -#endif - -/*------------------------------------------------------------------------* - * IMG extension tokens - *------------------------------------------------------------------------*/ - -/* GL_IMG_program_binary */ -#ifndef GL_IMG_program_binary -#define GL_SGX_PROGRAM_BINARY_IMG 0x9130 -#endif - -/* GL_IMG_read_format */ -#ifndef GL_IMG_read_format -#define GL_BGRA_IMG 0x80E1 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365 -#endif - -/* GL_IMG_shader_binary */ -#ifndef GL_IMG_shader_binary -#define GL_SGX_BINARY_IMG 0x8C0A -#endif - -/* GL_IMG_texture_compression_pvrtc */ -#ifndef GL_IMG_texture_compression_pvrtc -#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 -#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 -#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 -#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 -#endif - -/* GL_IMG_texture_compression_pvrtc2 */ -#ifndef GL_IMG_texture_compression_pvrtc2 -#define GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 0x9137 -#define GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG 0x9138 -#endif - -/* GL_IMG_multisampled_render_to_texture */ -#ifndef GL_IMG_multisampled_render_to_texture -#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134 -#define GL_MAX_SAMPLES_IMG 0x9135 -#define GL_TEXTURE_SAMPLES_IMG 0x9136 -#endif - -/*------------------------------------------------------------------------* - * NV extension tokens - *------------------------------------------------------------------------*/ - -/* GL_NV_coverage_sample */ -#ifndef GL_NV_coverage_sample -#define GL_COVERAGE_COMPONENT_NV 0x8ED0 -#define GL_COVERAGE_COMPONENT4_NV 0x8ED1 -#define GL_COVERAGE_ATTACHMENT_NV 0x8ED2 -#define GL_COVERAGE_BUFFERS_NV 0x8ED3 -#define GL_COVERAGE_SAMPLES_NV 0x8ED4 -#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5 -#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6 -#define GL_COVERAGE_AUTOMATIC_NV 0x8ED7 -#define GL_COVERAGE_BUFFER_BIT_NV 0x00008000 -#endif - -/* GL_NV_depth_nonlinear */ -#ifndef GL_NV_depth_nonlinear -#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C -#endif - -/* GL_NV_draw_buffers */ -#ifndef GL_NV_draw_buffers -#define GL_MAX_DRAW_BUFFERS_NV 0x8824 -#define GL_DRAW_BUFFER0_NV 0x8825 -#define GL_DRAW_BUFFER1_NV 0x8826 -#define GL_DRAW_BUFFER2_NV 0x8827 -#define GL_DRAW_BUFFER3_NV 0x8828 -#define GL_DRAW_BUFFER4_NV 0x8829 -#define GL_DRAW_BUFFER5_NV 0x882A -#define GL_DRAW_BUFFER6_NV 0x882B -#define GL_DRAW_BUFFER7_NV 0x882C -#define GL_DRAW_BUFFER8_NV 0x882D -#define GL_DRAW_BUFFER9_NV 0x882E -#define GL_DRAW_BUFFER10_NV 0x882F -#define GL_DRAW_BUFFER11_NV 0x8830 -#define GL_DRAW_BUFFER12_NV 0x8831 -#define GL_DRAW_BUFFER13_NV 0x8832 -#define GL_DRAW_BUFFER14_NV 0x8833 -#define GL_DRAW_BUFFER15_NV 0x8834 -#define GL_COLOR_ATTACHMENT0_NV 0x8CE0 -#define GL_COLOR_ATTACHMENT1_NV 0x8CE1 -#define GL_COLOR_ATTACHMENT2_NV 0x8CE2 -#define GL_COLOR_ATTACHMENT3_NV 0x8CE3 -#define GL_COLOR_ATTACHMENT4_NV 0x8CE4 -#define GL_COLOR_ATTACHMENT5_NV 0x8CE5 -#define GL_COLOR_ATTACHMENT6_NV 0x8CE6 -#define GL_COLOR_ATTACHMENT7_NV 0x8CE7 -#define GL_COLOR_ATTACHMENT8_NV 0x8CE8 -#define GL_COLOR_ATTACHMENT9_NV 0x8CE9 -#define GL_COLOR_ATTACHMENT10_NV 0x8CEA -#define GL_COLOR_ATTACHMENT11_NV 0x8CEB -#define GL_COLOR_ATTACHMENT12_NV 0x8CEC -#define GL_COLOR_ATTACHMENT13_NV 0x8CED -#define GL_COLOR_ATTACHMENT14_NV 0x8CEE -#define GL_COLOR_ATTACHMENT15_NV 0x8CEF -#endif - -/* GL_NV_draw_instanced */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_fbo_color_attachments */ -#ifndef GL_NV_fbo_color_attachments -#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF -/* GL_COLOR_ATTACHMENT{0-15}_NV defined in GL_NV_draw_buffers already. */ -#endif - -/* GL_NV_fence */ -#ifndef GL_NV_fence -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 -#endif - -/* GL_NV_framebuffer_blit */ -#ifndef GL_NV_framebuffer_blit -#define GL_READ_FRAMEBUFFER_NV 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_NV 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_NV 0x8CAA -#endif - -/* GL_NV_framebuffer_multisample */ -#ifndef GL_NV_framebuffer_multisample -#define GL_RENDERBUFFER_SAMPLES_NV 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56 -#define GL_MAX_SAMPLES_NV 0x8D57 -#endif - -/* GL_NV_generate_mipmap_sRGB */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_instanced_arrays */ -#ifndef GL_NV_instanced_arrays -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE -#endif - -/* GL_NV_read_buffer */ -#ifndef GL_NV_read_buffer -#define GL_READ_BUFFER_NV 0x0C02 -#endif - -/* GL_NV_read_buffer_front */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_read_depth */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_read_depth_stencil */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_read_stencil */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_shadow_samplers_array */ -#ifndef GL_NV_shadow_samplers_array -#define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4 -#endif - -/* GL_NV_shadow_samplers_cube */ -#ifndef GL_NV_shadow_samplers_cube -#define GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5 -#endif - -/* GL_NV_sRGB_formats */ -#ifndef GL_NV_sRGB_formats -#define GL_SLUMINANCE_NV 0x8C46 -#define GL_SLUMINANCE_ALPHA_NV 0x8C44 -#define GL_SRGB8_NV 0x8C41 -#define GL_SLUMINANCE8_NV 0x8C47 -#define GL_SLUMINANCE8_ALPHA8_NV 0x8C45 -#define GL_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F -#define GL_ETC1_SRGB8_NV 0x88EE -#endif - -/* GL_NV_texture_border_clamp */ -#ifndef GL_NV_texture_border_clamp -#define GL_TEXTURE_BORDER_COLOR_NV 0x1004 -#define GL_CLAMP_TO_BORDER_NV 0x812D -#endif - -/* GL_NV_texture_compression_s3tc_update */ -/* No new tokens introduced by this extension. */ - -/* GL_NV_texture_npot_2D_mipmap */ -/* No new tokens introduced by this extension. */ - -/*------------------------------------------------------------------------* - * QCOM extension tokens - *------------------------------------------------------------------------*/ - -/* GL_QCOM_alpha_test */ -#ifndef GL_QCOM_alpha_test -#define GL_ALPHA_TEST_QCOM 0x0BC0 -#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1 -#define GL_ALPHA_TEST_REF_QCOM 0x0BC2 -#endif - -/* GL_QCOM_binning_control */ -#ifndef GL_QCOM_binning_control -#define GL_BINNING_CONTROL_HINT_QCOM 0x8FB0 -#define GL_CPU_OPTIMIZED_QCOM 0x8FB1 -#define GL_GPU_OPTIMIZED_QCOM 0x8FB2 -#define GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3 -#endif - -/* GL_QCOM_driver_control */ -/* No new tokens introduced by this extension. */ - -/* GL_QCOM_extended_get */ -#ifndef GL_QCOM_extended_get -#define GL_TEXTURE_WIDTH_QCOM 0x8BD2 -#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 -#define GL_TEXTURE_DEPTH_QCOM 0x8BD4 -#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 -#define GL_TEXTURE_FORMAT_QCOM 0x8BD6 -#define GL_TEXTURE_TYPE_QCOM 0x8BD7 -#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 -#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 -#define GL_TEXTURE_TARGET_QCOM 0x8BDA -#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB -#define GL_STATE_RESTORE 0x8BDC +#ifdef __cplusplus +extern "C" { #endif -/* GL_QCOM_extended_get2 */ -/* No new tokens introduced by this extension. */ +/* +** Copyright (c) 2013 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$ on $Date$ +*/ -/* GL_QCOM_perfmon_global_mode */ -#ifndef GL_QCOM_perfmon_global_mode -#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 +#ifndef GL_APIENTRYP +#define GL_APIENTRYP GL_APIENTRY* #endif -/* GL_QCOM_writeonly_rendering */ -#ifndef GL_QCOM_writeonly_rendering -#define GL_WRITEONLY_RENDERING_QCOM 0x8823 -#endif +/* Generated C header for: + * API: gles2 + * Profile: common + * Versions considered: 2\.[0-9] + * Versions emitted: _nomatch_^ + * Default extensions included: gles2 + * Additional extensions included: _nomatch_^ + * Extensions removed: _nomatch_^ + */ -/* GL_QCOM_tiled_rendering */ -#ifndef GL_QCOM_tiled_rendering -#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 -#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 -#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 -#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 -#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 -#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 -#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 -#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 -#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 -#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 -#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 -#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 -#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 -#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 -#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 -#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 -#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 -#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 -#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 -#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 -#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 -#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 -#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 -#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 -#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 -#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 -#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 -#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 -#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 -#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 -#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 -#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 +typedef void (GL_APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +#define GL_SAMPLER 0x82E6 +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_KHR 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_KHR 0x8245 +#define GL_DEBUG_SOURCE_API_KHR 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_KHR 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_KHR 0x824A +#define GL_DEBUG_SOURCE_OTHER_KHR 0x824B +#define GL_DEBUG_TYPE_ERROR_KHR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_KHR 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_KHR 0x8250 +#define GL_DEBUG_TYPE_OTHER_KHR 0x8251 +#define GL_DEBUG_TYPE_MARKER_KHR 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP_KHR 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP_KHR 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION_KHR 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH_KHR 0x826D +#define GL_BUFFER_KHR 0x82E0 +#define GL_SHADER_KHR 0x82E1 +#define GL_PROGRAM_KHR 0x82E2 +#define GL_VERTEX_ARRAY_KHR 0x8074 +#define GL_QUERY_KHR 0x82E3 +#define GL_SAMPLER_KHR 0x82E6 +#define GL_MAX_LABEL_LENGTH_KHR 0x82E8 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_KHR 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_KHR 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_KHR 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_KHR 0x9147 +#define GL_DEBUG_SEVERITY_LOW_KHR 0x9148 +#define GL_DEBUG_OUTPUT_KHR 0x92E0 +#define GL_CONTEXT_FLAG_DEBUG_BIT_KHR 0x00000002 +#define GL_STACK_OVERFLOW_KHR 0x0503 +#define GL_STACK_UNDERFLOW_KHR 0x0504 +typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRPROC) (GLDEBUGPROCKHR callback, const void *userParam); +typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPKHRPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); +typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC) (void); +typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei length, const GLchar *label); +typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (GL_APIENTRYP PFNGLGETPOINTERVKHRPROC) (GLenum pname, void **params); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDebugMessageControlKHR (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GL_APICALL void GL_APIENTRY glDebugMessageInsertKHR (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GL_APICALL void GL_APIENTRY glDebugMessageCallbackKHR (GLDEBUGPROCKHR callback, const void *userParam); +GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLogKHR (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +GL_APICALL void GL_APIENTRY glPushDebugGroupKHR (GLenum source, GLuint id, GLsizei length, const GLchar *message); +GL_APICALL void GL_APIENTRY glPopDebugGroupKHR (void); +GL_APICALL void GL_APIENTRY glObjectLabelKHR (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +GL_APICALL void GL_APIENTRY glGetObjectLabelKHR (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +GL_APICALL void GL_APIENTRY glObjectPtrLabelKHR (const void *ptr, GLsizei length, const GLchar *label); +GL_APICALL void GL_APIENTRY glGetObjectPtrLabelKHR (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); +GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum pname, void **params); #endif +#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 */ -/*------------------------------------------------------------------------* - * VIV extension tokens - *------------------------------------------------------------------------*/ +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 +#endif /* GL_KHR_texture_compression_astc_ldr */ -/* GL_VIV_shader_binary */ -#ifndef GL_VIV_shader_binary -#define GL_SHADER_BINARY_VIV 0x8FC4 +#ifndef GL_OES_EGL_image +#define GL_OES_EGL_image 1 +typedef void *GLeglImageOES; +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); +GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); #endif +#endif /* GL_OES_EGL_image */ -/*------------------------------------------------------------------------* - * End of extension tokens, start of corresponding extension functions - *------------------------------------------------------------------------*/ - -/*------------------------------------------------------------------------* - * OES extension functions - *------------------------------------------------------------------------*/ +#ifndef GL_OES_EGL_image_external +#define GL_OES_EGL_image_external 1 +#define GL_TEXTURE_EXTERNAL_OES 0x8D65 +#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 +#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 +#define GL_SAMPLER_EXTERNAL_OES 0x8D66 +#endif /* GL_OES_EGL_image_external */ -/* GL_OES_compressed_ETC1_RGB8_texture */ #ifndef GL_OES_compressed_ETC1_RGB8_texture #define GL_OES_compressed_ETC1_RGB8_texture 1 -#endif +#define GL_ETC1_RGB8_OES 0x8D64 +#endif /* GL_OES_compressed_ETC1_RGB8_texture */ -/* GL_OES_compressed_paletted_texture */ #ifndef GL_OES_compressed_paletted_texture #define GL_OES_compressed_paletted_texture 1 -#endif +#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 */ -/* GL_OES_depth24 */ #ifndef GL_OES_depth24 #define GL_OES_depth24 1 -#endif +#define GL_DEPTH_COMPONENT24_OES 0x81A6 +#endif /* GL_OES_depth24 */ -/* GL_OES_depth32 */ #ifndef GL_OES_depth32 #define GL_OES_depth32 1 -#endif +#define GL_DEPTH_COMPONENT32_OES 0x81A7 +#endif /* GL_OES_depth32 */ -/* GL_OES_depth_texture */ #ifndef GL_OES_depth_texture #define GL_OES_depth_texture 1 -#endif - -/* GL_OES_EGL_image */ -#ifndef GL_OES_EGL_image -#define GL_OES_EGL_image 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); -GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); -#endif -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); -#endif - -/* GL_OES_EGL_image_external */ -#ifndef GL_OES_EGL_image_external -#define GL_OES_EGL_image_external 1 -/* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */ -#endif +#endif /* GL_OES_depth_texture */ -/* GL_OES_element_index_uint */ #ifndef GL_OES_element_index_uint #define GL_OES_element_index_uint 1 -#endif +#endif /* GL_OES_element_index_uint */ -/* GL_OES_fbo_render_mipmap */ #ifndef GL_OES_fbo_render_mipmap #define GL_OES_fbo_render_mipmap 1 -#endif +#endif /* GL_OES_fbo_render_mipmap */ -/* GL_OES_fragment_precision_high */ #ifndef GL_OES_fragment_precision_high #define GL_OES_fragment_precision_high 1 -#endif +#endif /* GL_OES_fragment_precision_high */ -/* GL_OES_get_program_binary */ #ifndef GL_OES_get_program_binary #define GL_OES_get_program_binary 1 +#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE +#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF +typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); +typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLint length); #ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); -GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length); -#endif -typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); -typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length); +GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); +GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const void *binary, GLint length); #endif +#endif /* GL_OES_get_program_binary */ -/* GL_OES_mapbuffer */ #ifndef GL_OES_mapbuffer #define GL_OES_mapbuffer 1 +#define GL_WRITE_ONLY_OES 0x88B9 +#define GL_BUFFER_ACCESS_OES 0x88BB +#define GL_BUFFER_MAPPED_OES 0x88BC +#define GL_BUFFER_MAP_POINTER_OES 0x88BD +typedef void *(GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); +typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); +typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void **params); #ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); +GL_APICALL void *GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); -GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid** params); -#endif -typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); -typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); -typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid** params); +GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void **params); #endif +#endif /* GL_OES_mapbuffer */ -/* GL_OES_packed_depth_stencil */ #ifndef GL_OES_packed_depth_stencil #define GL_OES_packed_depth_stencil 1 -#endif +#define GL_DEPTH_STENCIL_OES 0x84F9 +#define GL_UNSIGNED_INT_24_8_OES 0x84FA +#define GL_DEPTH24_STENCIL8_OES 0x88F0 +#endif /* GL_OES_packed_depth_stencil */ -/* GL_OES_required_internalformat */ #ifndef GL_OES_required_internalformat #define GL_OES_required_internalformat 1 -#endif +#define GL_ALPHA8_OES 0x803C +#define GL_DEPTH_COMPONENT16_OES 0x81A5 +#define GL_LUMINANCE4_ALPHA4_OES 0x8043 +#define GL_LUMINANCE8_ALPHA8_OES 0x8045 +#define GL_LUMINANCE8_OES 0x8040 +#define GL_RGBA4_OES 0x8056 +#define GL_RGB5_A1_OES 0x8057 +#define GL_RGB565_OES 0x8D62 +#define GL_RGB8_OES 0x8051 +#define GL_RGBA8_OES 0x8058 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB10_A2_EXT 0x8059 +#endif /* GL_OES_required_internalformat */ -/* GL_OES_rgb8_rgba8 */ #ifndef GL_OES_rgb8_rgba8 #define GL_OES_rgb8_rgba8 1 -#endif +#endif /* GL_OES_rgb8_rgba8 */ -/* GL_OES_standard_derivatives */ #ifndef GL_OES_standard_derivatives #define GL_OES_standard_derivatives 1 -#endif +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B +#endif /* GL_OES_standard_derivatives */ -/* GL_OES_stencil1 */ #ifndef GL_OES_stencil1 #define GL_OES_stencil1 1 -#endif +#define GL_STENCIL_INDEX1_OES 0x8D46 +#endif /* GL_OES_stencil1 */ -/* GL_OES_stencil4 */ #ifndef GL_OES_stencil4 #define GL_OES_stencil4 1 -#endif +#define GL_STENCIL_INDEX4_OES 0x8D47 +#endif /* GL_OES_stencil4 */ #ifndef GL_OES_surfaceless_context #define GL_OES_surfaceless_context 1 -#endif +#define GL_FRAMEBUFFER_UNDEFINED_OES 0x8219 +#endif /* GL_OES_surfaceless_context */ -/* GL_OES_texture_3D */ #ifndef GL_OES_texture_3D #define GL_OES_texture_3D 1 +#define GL_TEXTURE_WRAP_R_OES 0x8072 +#define GL_TEXTURE_3D_OES 0x806F +#define GL_TEXTURE_BINDING_3D_OES 0x806A +#define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073 +#define GL_SAMPLER_3D_OES 0x8B5F +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4 +typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (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 (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (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 (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); #ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); -GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels); +GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data); +GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); #endif -typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); -typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels); -typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOES) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -#endif +#endif /* GL_OES_texture_3D */ + +#ifndef GL_OES_texture_compression_astc +#define GL_OES_texture_compression_astc 1 +#endif /* GL_OES_texture_compression_astc */ -/* GL_OES_texture_float */ #ifndef GL_OES_texture_float #define GL_OES_texture_float 1 -#endif +#endif /* GL_OES_texture_float */ -/* GL_OES_texture_float_linear */ #ifndef GL_OES_texture_float_linear #define GL_OES_texture_float_linear 1 -#endif +#endif /* GL_OES_texture_float_linear */ -/* GL_OES_texture_half_float */ #ifndef GL_OES_texture_half_float #define GL_OES_texture_half_float 1 -#endif +#define GL_HALF_FLOAT_OES 0x8D61 +#endif /* GL_OES_texture_half_float */ -/* GL_OES_texture_half_float_linear */ #ifndef GL_OES_texture_half_float_linear #define GL_OES_texture_half_float_linear 1 -#endif +#endif /* GL_OES_texture_half_float_linear */ -/* GL_OES_texture_npot */ #ifndef GL_OES_texture_npot #define GL_OES_texture_npot 1 -#endif +#endif /* GL_OES_texture_npot */ -/* GL_OES_vertex_array_object */ #ifndef GL_OES_vertex_array_object #define GL_OES_vertex_array_object 1 +#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5 +typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array); +typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays); +typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array); GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays); GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays); GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array); #endif -typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array); -typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays); -typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays); -typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array); -#endif +#endif /* GL_OES_vertex_array_object */ -/* GL_OES_vertex_half_float */ #ifndef GL_OES_vertex_half_float #define GL_OES_vertex_half_float 1 -#endif +#endif /* GL_OES_vertex_half_float */ -/* GL_OES_vertex_type_10_10_10_2 */ #ifndef GL_OES_vertex_type_10_10_10_2 #define GL_OES_vertex_type_10_10_10_2 1 -#endif - -/*------------------------------------------------------------------------* - * KHR extension functions - *------------------------------------------------------------------------*/ - -#ifndef GL_KHR_debug -#define GL_KHR_debug 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDebugMessageControlKHR (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GL_APICALL void GL_APIENTRY glDebugMessageInsertKHR (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -GL_APICALL void GL_APIENTRY glDebugMessageCallbackKHR (GLDEBUGPROCKHR callback, const void *userParam); -GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLogKHR (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -GL_APICALL void GL_APIENTRY glPushDebugGroupKHR (GLenum source, GLuint id, GLsizei length, const GLchar *message); -GL_APICALL void GL_APIENTRY glPopDebugGroupKHR (void); -GL_APICALL void GL_APIENTRY glObjectLabelKHR (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glGetObjectLabelKHR (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -GL_APICALL void GL_APIENTRY glObjectPtrLabelKHR (const void *ptr, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glGetObjectPtrLabelKHR (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum pname, void **params); -#endif -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRPROC) (GLDEBUGPROCKHR callback, const void *userParam); -typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPKHRPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); -typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC) (void); -typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETPOINTERVKHRPROC) (GLenum pname, void **params); -#endif - -#ifndef GL_KHR_texture_compression_astc_ldr -#define GL_KHR_texture_compression_astc_ldr 1 -#endif - - -/*------------------------------------------------------------------------* - * AMD extension functions - *------------------------------------------------------------------------*/ +#define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6 +#define GL_INT_10_10_10_2_OES 0x8DF7 +#endif /* GL_OES_vertex_type_10_10_10_2 */ -/* GL_AMD_compressed_3DC_texture */ #ifndef GL_AMD_compressed_3DC_texture #define GL_AMD_compressed_3DC_texture 1 -#endif +#define GL_3DC_X_AMD 0x87F9 +#define GL_3DC_XY_AMD 0x87FA +#endif /* GL_AMD_compressed_3DC_texture */ -/* GL_AMD_compressed_ATC_texture */ #ifndef GL_AMD_compressed_ATC_texture #define GL_AMD_compressed_ATC_texture 1 -#endif +#define GL_ATC_RGB_AMD 0x8C92 +#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 +#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE +#endif /* GL_AMD_compressed_ATC_texture */ -/* AMD_performance_monitor */ #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 (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); +typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data); +GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data); GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); -GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList); +GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor); GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor); GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); #endif -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); -typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList); -typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); -typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#endif +#endif /* GL_AMD_performance_monitor */ -/* GL_AMD_program_binary_Z400 */ #ifndef GL_AMD_program_binary_Z400 #define GL_AMD_program_binary_Z400 1 -#endif +#define GL_Z400_BINARY_AMD 0x8740 +#endif /* GL_AMD_program_binary_Z400 */ -/*------------------------------------------------------------------------* - * ANGLE extension functions - *------------------------------------------------------------------------*/ - -/* GL_ANGLE_depth_texture */ #ifndef GL_ANGLE_depth_texture #define GL_ANGLE_depth_texture 1 -#endif +#endif /* GL_ANGLE_depth_texture */ -/* GL_ANGLE_framebuffer_blit */ #ifndef GL_ANGLE_framebuffer_blit #define GL_ANGLE_framebuffer_blit 1 +#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA +typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); #endif -typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif +#endif /* GL_ANGLE_framebuffer_blit */ -/* GL_ANGLE_framebuffer_multisample */ #ifndef GL_ANGLE_framebuffer_multisample #define GL_ANGLE_framebuffer_multisample 1 +#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 +#define GL_MAX_SAMPLES_ANGLE 0x8D57 +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #endif -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif +#endif /* GL_ANGLE_framebuffer_multisample */ #ifndef GL_ANGLE_instanced_arrays #define GL_ANGLE_instanced_arrays 1 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE +typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE (GLenum mode, GLint first, GLsizei count, GLsizei primcount); GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint divisor); #endif -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); -#endif +#endif /* GL_ANGLE_instanced_arrays */ -/* GL_ANGLE_pack_reverse_row_order */ #ifndef GL_ANGLE_pack_reverse_row_order #define GL_ANGLE_pack_reverse_row_order 1 -#endif +#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 +#endif /* GL_ANGLE_pack_reverse_row_order */ -/* GL_ANGLE_program_binary */ #ifndef GL_ANGLE_program_binary #define GL_ANGLE_program_binary 1 -#endif +#define GL_PROGRAM_BINARY_ANGLE 0x93A6 +#endif /* GL_ANGLE_program_binary */ -/* GL_ANGLE_texture_compression_dxt3 */ #ifndef GL_ANGLE_texture_compression_dxt3 #define GL_ANGLE_texture_compression_dxt3 1 -#endif +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#endif /* GL_ANGLE_texture_compression_dxt3 */ -/* GL_ANGLE_texture_compression_dxt5 */ #ifndef GL_ANGLE_texture_compression_dxt5 #define GL_ANGLE_texture_compression_dxt5 1 -#endif +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 +#endif /* GL_ANGLE_texture_compression_dxt5 */ -/* GL_ANGLE_texture_usage */ #ifndef GL_ANGLE_texture_usage #define GL_ANGLE_texture_usage 1 -#endif +#define GL_TEXTURE_USAGE_ANGLE 0x93A2 +#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 +#endif /* GL_ANGLE_texture_usage */ #ifndef GL_ANGLE_translated_shader_source #define GL_ANGLE_translated_shader_source 1 +#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 +typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source); #endif -typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source); -#endif - -/*------------------------------------------------------------------------* - * APPLE extension functions - *------------------------------------------------------------------------*/ +#endif /* GL_ANGLE_translated_shader_source */ -/* GL_APPLE_copy_texture_levels */ #ifndef GL_APPLE_copy_texture_levels #define GL_APPLE_copy_texture_levels 1 +typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); #endif -typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); -#endif +#endif /* GL_APPLE_copy_texture_levels */ -/* GL_APPLE_framebuffer_multisample */ #ifndef GL_APPLE_framebuffer_multisample #define GL_APPLE_framebuffer_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum, GLsizei, GLenum, GLsizei, GLsizei); -GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void); -#endif /* GL_GLEXT_PROTOTYPES */ +#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 +#define GL_MAX_SAMPLES_APPLE 0x8D57 +#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void); #endif +#endif /* GL_APPLE_framebuffer_multisample */ -/* GL_APPLE_rgb_422 */ #ifndef GL_APPLE_rgb_422 #define GL_APPLE_rgb_422 1 -#endif +#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 */ -/* GL_APPLE_sync */ #ifndef GL_APPLE_sync #define GL_APPLE_sync 1 +#define GL_SYNC_OBJECT_APPLE 0x8A53 +#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111 +#define GL_OBJECT_TYPE_APPLE 0x9112 +#define GL_SYNC_CONDITION_APPLE 0x9113 +#define GL_SYNC_STATUS_APPLE 0x9114 +#define GL_SYNC_FLAGS_APPLE 0x9115 +#define GL_SYNC_FENCE_APPLE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117 +#define GL_UNSIGNALED_APPLE 0x9118 +#define GL_SIGNALED_APPLE 0x9119 +#define GL_ALREADY_SIGNALED_APPLE 0x911A +#define GL_TIMEOUT_EXPIRED_APPLE 0x911B +#define GL_CONDITION_SATISFIED_APPLE 0x911C +#define GL_WAIT_FAILED_APPLE 0x911D +#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001 +#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull +typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags); +typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync); +typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync); +typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params); +typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags); GL_APICALL GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync); @@ -1348,93 +564,114 @@ GL_APICALL void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLui GL_APICALL void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params); GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); #endif -typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags); -typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync); -typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync); -typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params); -typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -#endif +#endif /* GL_APPLE_sync */ -/* GL_APPLE_texture_format_BGRA8888 */ #ifndef GL_APPLE_texture_format_BGRA8888 #define GL_APPLE_texture_format_BGRA8888 1 -#endif +#define GL_BGRA_EXT 0x80E1 +#define GL_BGRA8_EXT 0x93A1 +#endif /* GL_APPLE_texture_format_BGRA8888 */ -/* GL_APPLE_texture_max_level */ #ifndef GL_APPLE_texture_max_level #define GL_APPLE_texture_max_level 1 -#endif - -/*------------------------------------------------------------------------* - * ARM extension functions - *------------------------------------------------------------------------*/ +#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D +#endif /* GL_APPLE_texture_max_level */ -/* GL_ARM_mali_program_binary */ #ifndef GL_ARM_mali_program_binary #define GL_ARM_mali_program_binary 1 -#endif +#define GL_MALI_PROGRAM_BINARY_ARM 0x8F61 +#endif /* GL_ARM_mali_program_binary */ -/* GL_ARM_mali_shader_binary */ #ifndef GL_ARM_mali_shader_binary #define GL_ARM_mali_shader_binary 1 -#endif +#define GL_MALI_SHADER_BINARY_ARM 0x8F60 +#endif /* GL_ARM_mali_shader_binary */ -/* GL_ARM_rgba8 */ #ifndef GL_ARM_rgba8 #define GL_ARM_rgba8 1 -#endif +#endif /* GL_ARM_rgba8 */ -/*------------------------------------------------------------------------* - * EXT extension functions - *------------------------------------------------------------------------*/ +#ifndef GL_DMP_shader_binary +#define GL_DMP_shader_binary 1 +#define GL_SHADER_BINARY_DMP 0x9250 +#endif /* GL_DMP_shader_binary */ -/* GL_EXT_blend_minmax */ #ifndef GL_EXT_blend_minmax #define GL_EXT_blend_minmax 1 -#endif +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#endif /* GL_EXT_blend_minmax */ -/* GL_EXT_color_buffer_half_float */ #ifndef GL_EXT_color_buffer_half_float #define GL_EXT_color_buffer_half_float 1 -#endif +#define GL_RGBA16F_EXT 0x881A +#define GL_RGB16F_EXT 0x881B +#define GL_RG16F_EXT 0x822F +#define GL_R16F_EXT 0x822D +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211 +#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17 +#endif /* GL_EXT_color_buffer_half_float */ -/* GL_EXT_debug_label */ #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 +#define GL_TRANSFORM_FEEDBACK 0x8E22 +typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); +typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label); GL_APICALL void GL_APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); #endif -typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -#endif +#endif /* GL_EXT_debug_label */ -/* GL_EXT_debug_marker */ #ifndef GL_EXT_debug_marker #define GL_EXT_debug_marker 1 +typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void); #endif -typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); -#endif +#endif /* GL_EXT_debug_marker */ -/* GL_EXT_discard_framebuffer */ #ifndef GL_EXT_discard_framebuffer #define GL_EXT_discard_framebuffer 1 +#define GL_COLOR_EXT 0x1800 +#define GL_DEPTH_EXT 0x1801 +#define GL_STENCIL_EXT 0x1802 +typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments); #endif -typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); -#endif +#endif /* GL_EXT_discard_framebuffer */ #ifndef GL_EXT_disjoint_timer_query #define GL_EXT_disjoint_timer_query 1 +#define GL_QUERY_COUNTER_BITS_EXT 0x8864 +#define GL_CURRENT_QUERY_EXT 0x8865 +#define GL_QUERY_RESULT_EXT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867 +#define GL_TIME_ELAPSED_EXT 0x88BF +#define GL_TIMESTAMP_EXT 0x8E28 +#define GL_GPU_DISJOINT_EXT 0x8FBB +typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids); +typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id); +typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id); +typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target); +typedef void (GL_APIENTRYP PFNGLQUERYCOUNTEREXTPROC) (GLuint id, GLenum target); +typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVEXTPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params); +typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params); +typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids); GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids); @@ -1445,218 +682,363 @@ GL_APICALL void GL_APIENTRY glQueryCounterEXT (GLuint id, GLenum target); GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glGetQueryObjectivEXT (GLuint id, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64EXT *params); -GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64EXT *params); +GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params); +GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params); #endif -typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids); -typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id); -typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id); -typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target); -typedef void (GL_APIENTRYP PFNGLQUERYCOUNTEREXTPROC) (GLuint id, GLenum target); -typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVEXTPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); #endif /* GL_EXT_disjoint_timer_query */ -/* GL_EXT_map_buffer_range */ +#ifndef GL_EXT_draw_buffers +#define GL_EXT_draw_buffers 1 +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_MAX_DRAW_BUFFERS_EXT 0x8824 +#define GL_DRAW_BUFFER0_EXT 0x8825 +#define GL_DRAW_BUFFER1_EXT 0x8826 +#define GL_DRAW_BUFFER2_EXT 0x8827 +#define GL_DRAW_BUFFER3_EXT 0x8828 +#define GL_DRAW_BUFFER4_EXT 0x8829 +#define GL_DRAW_BUFFER5_EXT 0x882A +#define GL_DRAW_BUFFER6_EXT 0x882B +#define GL_DRAW_BUFFER7_EXT 0x882C +#define GL_DRAW_BUFFER8_EXT 0x882D +#define GL_DRAW_BUFFER9_EXT 0x882E +#define GL_DRAW_BUFFER10_EXT 0x882F +#define GL_DRAW_BUFFER11_EXT 0x8830 +#define GL_DRAW_BUFFER12_EXT 0x8831 +#define GL_DRAW_BUFFER13_EXT 0x8832 +#define GL_DRAW_BUFFER14_EXT 0x8833 +#define GL_DRAW_BUFFER15_EXT 0x8834 +#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 +typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSEXTPROC) (GLsizei n, const GLenum *bufs); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawBuffersEXT (GLsizei n, const GLenum *bufs); +#endif +#endif /* GL_EXT_draw_buffers */ + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 +typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +GL_APICALL void GL_APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#endif +#endif /* GL_EXT_draw_instanced */ + +#ifndef GL_EXT_instanced_arrays +#define GL_EXT_instanced_arrays 1 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_EXT 0x88FE +typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glVertexAttribDivisorEXT (GLuint index, GLuint divisor); +#endif +#endif /* GL_EXT_instanced_arrays */ + #ifndef GL_EXT_map_buffer_range #define GL_EXT_map_buffer_range 1 +#define GL_MAP_READ_BIT_EXT 0x0001 +#define GL_MAP_WRITE_BIT_EXT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 +typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length); #ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void* GL_APIENTRY glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +GL_APICALL void *GL_APIENTRY glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); GL_APICALL void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length); #endif -typedef void* (GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +#endif /* GL_EXT_map_buffer_range */ + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); #endif +#endif /* GL_EXT_multi_draw_arrays */ -/* GL_EXT_multisampled_render_to_texture */ #ifndef GL_EXT_multisampled_render_to_texture #define GL_EXT_multisampled_render_to_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei); -GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei); -#endif +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); #endif +#endif /* GL_EXT_multisampled_render_to_texture */ -/* GL_EXT_multiview_draw_buffers */ #ifndef GL_EXT_multiview_draw_buffers #define GL_EXT_multiview_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glReadBufferIndexedEXT (GLenum src, GLint index); -GL_APICALL void GL_APIENTRY glDrawBuffersIndexedEXT (GLint n, const GLenum *location, const GLint *indices); -GL_APICALL void GL_APIENTRY glGetIntegeri_vEXT (GLenum target, GLuint index, GLint *data); -#endif +#define GL_COLOR_ATTACHMENT_EXT 0x90F0 +#define GL_MULTIVIEW_EXT 0x90F1 +#define GL_DRAW_BUFFER_EXT 0x0C01 +#define GL_READ_BUFFER_EXT 0x0C02 +#define GL_MAX_MULTIVIEW_BUFFERS_EXT 0x90F2 typedef void (GL_APIENTRYP PFNGLREADBUFFERINDEXEDEXTPROC) (GLenum src, GLint index); typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSINDEXEDEXTPROC) (GLint n, const GLenum *location, const GLint *indices); typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint index, GLint *data); -#endif - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 #ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum, const GLint *, const GLsizei *, GLsizei); -GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +GL_APICALL void GL_APIENTRY glReadBufferIndexedEXT (GLenum src, GLint index); +GL_APICALL void GL_APIENTRY glDrawBuffersIndexedEXT (GLint n, const GLenum *location, const GLint *indices); +GL_APICALL void GL_APIENTRY glGetIntegeri_vEXT (GLenum target, GLuint index, GLint *data); #endif +#endif /* GL_EXT_multiview_draw_buffers */ -/* GL_EXT_occlusion_query_boolean */ #ifndef GL_EXT_occlusion_query_boolean #define GL_EXT_occlusion_query_boolean 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids); -GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids); -GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id); -GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id); -GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target); -GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params); -#endif -typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids); -typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id); -typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id); -typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target); -typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params); -#endif +#define GL_ANY_SAMPLES_PASSED_EXT 0x8C2F +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A +#endif /* GL_EXT_occlusion_query_boolean */ + +#ifndef GL_EXT_pvrtc_sRGB +#define GL_EXT_pvrtc_sRGB 1 +#define GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT 0x8A54 +#define GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT 0x8A55 +#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT 0x8A56 +#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT 0x8A57 +#endif /* GL_EXT_pvrtc_sRGB */ -/* GL_EXT_read_format_bgra */ #ifndef GL_EXT_read_format_bgra #define GL_EXT_read_format_bgra 1 -#endif +#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 +#endif /* GL_EXT_read_format_bgra */ -/* GL_EXT_robustness */ #ifndef GL_EXT_robustness #define GL_EXT_robustness 1 +#define GL_GUILTY_CONTEXT_RESET_EXT 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255 +#define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3 +#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256 +#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252 +#define GL_NO_RESET_NOTIFICATION_EXT 0x8261 +typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void); +typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void); GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, float *params); +GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params); #endif -typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void); -typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, float *params); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); -#endif +#endif /* GL_EXT_robustness */ + +#ifndef GL_EXT_sRGB +#define GL_EXT_sRGB 1 +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210 +#endif /* GL_EXT_sRGB */ + +#ifndef GL_EXT_sRGB_write_control +#define GL_EXT_sRGB_write_control 1 +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#endif /* GL_EXT_sRGB_write_control */ -/* GL_EXT_separate_shader_objects */ #ifndef GL_EXT_separate_shader_objects #define GL_EXT_separate_shader_objects 1 +#define GL_ACTIVE_PROGRAM_EXT 0x8259 +#define GL_VERTEX_SHADER_BIT_EXT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT_EXT 0x00000002 +#define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF +#define GL_PROGRAM_SEPARABLE_EXT 0x8258 +#define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A +typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program); +typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline); +typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings); +typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines); +typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines); +typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params); +typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline); +typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); #ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program); GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program); -GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings); GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline); +GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings); GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines); GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines); +GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params); GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXT (GLuint pipeline); GL_APICALL void GL_APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); -GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint x); -GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint x, GLint y); -GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z); -GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); -GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat x); -GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat x, GLfloat y); -GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0); GL_APICALL void GL_APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0); +GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1); GL_APICALL void GL_APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1); +GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); GL_APICALL void GL_APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); GL_APICALL void GL_APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program); GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXT (GLuint pipeline); -GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -#endif -typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program); -typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program); -typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings); -typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines); -typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines); -typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint x); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint x, GLint y); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat x); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -#endif +GL_APICALL void GL_APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0); +GL_APICALL void GL_APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1); +GL_APICALL void GL_APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GL_APICALL void GL_APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GL_APICALL void GL_APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GL_APICALL void GL_APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GL_APICALL void GL_APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GL_APICALL void GL_APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#endif +#endif /* GL_EXT_separate_shader_objects */ -/* GL_EXT_shader_framebuffer_fetch */ #ifndef GL_EXT_shader_framebuffer_fetch #define GL_EXT_shader_framebuffer_fetch 1 -#endif +#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 +#endif /* GL_EXT_shader_framebuffer_fetch */ + +#ifndef GL_EXT_shader_integer_mix +#define GL_EXT_shader_integer_mix 1 +#endif /* GL_EXT_shader_integer_mix */ -/* GL_EXT_shader_texture_lod */ #ifndef GL_EXT_shader_texture_lod #define GL_EXT_shader_texture_lod 1 -#endif +#endif /* GL_EXT_shader_texture_lod */ -/* GL_EXT_shadow_samplers */ #ifndef GL_EXT_shadow_samplers #define GL_EXT_shadow_samplers 1 -#endif - -/* GL_EXT_sRGB */ -#ifndef GL_EXT_sRGB -#define GL_EXT_sRGB 1 -#endif +#define GL_TEXTURE_COMPARE_MODE_EXT 0x884C +#define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D +#define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E +#define GL_SAMPLER_2D_SHADOW_EXT 0x8B62 +#endif /* GL_EXT_shadow_samplers */ -/* GL_EXT_texture_compression_dxt1 */ #ifndef GL_EXT_texture_compression_dxt1 #define GL_EXT_texture_compression_dxt1 1 -#endif +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#endif /* GL_EXT_texture_compression_dxt1 */ + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif /* GL_EXT_texture_compression_s3tc */ -/* GL_EXT_texture_filter_anisotropic */ #ifndef GL_EXT_texture_filter_anisotropic #define GL_EXT_texture_filter_anisotropic 1 -#endif +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif /* GL_EXT_texture_filter_anisotropic */ -/* GL_EXT_texture_format_BGRA8888 */ #ifndef GL_EXT_texture_format_BGRA8888 #define GL_EXT_texture_format_BGRA8888 1 -#endif +#endif /* GL_EXT_texture_format_BGRA8888 */ -/* GL_EXT_texture_rg */ #ifndef GL_EXT_texture_rg #define GL_EXT_texture_rg 1 -#endif +#define GL_RED_EXT 0x1903 +#define GL_RG_EXT 0x8227 +#define GL_R8_EXT 0x8229 +#define GL_RG8_EXT 0x822B +#endif /* GL_EXT_texture_rg */ + +#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 */ -/* GL_EXT_texture_storage */ #ifndef GL_EXT_texture_storage #define GL_EXT_texture_storage 1 +#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F +#define GL_ALPHA8_EXT 0x803C +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_RGBA32F_EXT 0x8814 +#define GL_RGB32F_EXT 0x8815 +#define GL_ALPHA32F_EXT 0x8816 +#define GL_LUMINANCE32F_EXT 0x8818 +#define GL_LUMINANCE_ALPHA32F_EXT 0x8819 +#define GL_ALPHA16F_EXT 0x881C +#define GL_LUMINANCE16F_EXT 0x881E +#define GL_LUMINANCE_ALPHA16F_EXT 0x881F +#define GL_R32F_EXT 0x822E +#define GL_RG32F_EXT 0x8230 +typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); @@ -1665,139 +1047,232 @@ GL_APICALL void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target GL_APICALL void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); #endif -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -#endif +#endif /* GL_EXT_texture_storage */ -/* GL_EXT_texture_type_2_10_10_10_REV */ #ifndef GL_EXT_texture_type_2_10_10_10_REV #define GL_EXT_texture_type_2_10_10_10_REV 1 -#endif +#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 +#endif /* GL_EXT_texture_type_2_10_10_10_REV */ -/* GL_EXT_unpack_subimage */ #ifndef GL_EXT_unpack_subimage #define GL_EXT_unpack_subimage 1 -#endif - -/*------------------------------------------------------------------------* - * DMP extension functions - *------------------------------------------------------------------------*/ +#define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2 +#define GL_UNPACK_SKIP_ROWS_EXT 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4 +#endif /* GL_EXT_unpack_subimage */ -/* GL_DMP_shader_binary */ -#ifndef GL_DMP_shader_binary -#define GL_DMP_shader_binary 1 -#endif - -/*------------------------------------------------------------------------* - * FJ extension functions - *------------------------------------------------------------------------*/ - -/* GL_FJ_shader_binary_GCCSO */ #ifndef GL_FJ_shader_binary_GCCSO #define GL_FJ_shader_binary_GCCSO 1 -#endif +#define GL_GCCSO_SHADER_BINARY_FJ 0x9260 +#endif /* GL_FJ_shader_binary_GCCSO */ -/*------------------------------------------------------------------------* - * IMG extension functions - *------------------------------------------------------------------------*/ +#ifndef GL_IMG_multisampled_render_to_texture +#define GL_IMG_multisampled_render_to_texture 1 +#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134 +#define GL_MAX_SAMPLES_IMG 0x9135 +#define GL_TEXTURE_SAMPLES_IMG 0x9136 +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +#endif +#endif /* GL_IMG_multisampled_render_to_texture */ -/* GL_IMG_program_binary */ #ifndef GL_IMG_program_binary #define GL_IMG_program_binary 1 -#endif +#define GL_SGX_PROGRAM_BINARY_IMG 0x9130 +#endif /* GL_IMG_program_binary */ -/* GL_IMG_read_format */ #ifndef GL_IMG_read_format #define GL_IMG_read_format 1 -#endif +#define GL_BGRA_IMG 0x80E1 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365 +#endif /* GL_IMG_read_format */ -/* GL_IMG_shader_binary */ #ifndef GL_IMG_shader_binary #define GL_IMG_shader_binary 1 -#endif +#define GL_SGX_BINARY_IMG 0x8C0A +#endif /* GL_IMG_shader_binary */ -/* GL_IMG_texture_compression_pvrtc */ #ifndef GL_IMG_texture_compression_pvrtc #define GL_IMG_texture_compression_pvrtc 1 -#endif +#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 +#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 +#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 +#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 +#endif /* GL_IMG_texture_compression_pvrtc */ -/* GL_IMG_texture_compression_pvrtc2 */ #ifndef GL_IMG_texture_compression_pvrtc2 #define GL_IMG_texture_compression_pvrtc2 1 +#define GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 0x9137 +#define GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG 0x9138 +#endif /* GL_IMG_texture_compression_pvrtc2 */ + +#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 (GL_APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); +typedef void (GL_APIENTRYP PFNGLBLENDBARRIERNVPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBlendParameteriNV (GLenum pname, GLint value); +GL_APICALL void GL_APIENTRY glBlendBarrierNV (void); #endif +#endif /* GL_NV_blend_equation_advanced */ -/* GL_IMG_multisampled_render_to_texture */ -#ifndef GL_IMG_multisampled_render_to_texture -#define GL_IMG_multisampled_render_to_texture 1 +#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_copy_buffer +#define GL_NV_copy_buffer 1 +#define GL_COPY_READ_BUFFER_NV 0x8F36 +#define GL_COPY_WRITE_BUFFER_NV 0x8F37 +typedef void (GL_APIENTRYP PFNGLCOPYBUFFERSUBDATANVPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); #ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum, GLsizei, GLenum, GLsizei, GLsizei); -GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei); +GL_APICALL void GL_APIENTRY glCopyBufferSubDataNV (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); #endif -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -#endif - -/*------------------------------------------------------------------------* - * NV extension functions - *------------------------------------------------------------------------*/ +#endif /* GL_NV_copy_buffer */ -/* GL_NV_coverage_sample */ #ifndef GL_NV_coverage_sample #define GL_NV_coverage_sample 1 +#define GL_COVERAGE_COMPONENT_NV 0x8ED0 +#define GL_COVERAGE_COMPONENT4_NV 0x8ED1 +#define GL_COVERAGE_ATTACHMENT_NV 0x8ED2 +#define GL_COVERAGE_BUFFERS_NV 0x8ED3 +#define GL_COVERAGE_SAMPLES_NV 0x8ED4 +#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5 +#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6 +#define GL_COVERAGE_AUTOMATIC_NV 0x8ED7 +#define GL_COVERAGE_BUFFER_BIT_NV 0x00008000 +typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask); +typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask); GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation); #endif -typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask); -typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation); -#endif +#endif /* GL_NV_coverage_sample */ -/* GL_NV_depth_nonlinear */ #ifndef GL_NV_depth_nonlinear #define GL_NV_depth_nonlinear 1 -#endif +#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C +#endif /* GL_NV_depth_nonlinear */ -/* GL_NV_draw_buffers */ #ifndef GL_NV_draw_buffers #define GL_NV_draw_buffers 1 +#define GL_MAX_DRAW_BUFFERS_NV 0x8824 +#define GL_DRAW_BUFFER0_NV 0x8825 +#define GL_DRAW_BUFFER1_NV 0x8826 +#define GL_DRAW_BUFFER2_NV 0x8827 +#define GL_DRAW_BUFFER3_NV 0x8828 +#define GL_DRAW_BUFFER4_NV 0x8829 +#define GL_DRAW_BUFFER5_NV 0x882A +#define GL_DRAW_BUFFER6_NV 0x882B +#define GL_DRAW_BUFFER7_NV 0x882C +#define GL_DRAW_BUFFER8_NV 0x882D +#define GL_DRAW_BUFFER9_NV 0x882E +#define GL_DRAW_BUFFER10_NV 0x882F +#define GL_DRAW_BUFFER11_NV 0x8830 +#define GL_DRAW_BUFFER12_NV 0x8831 +#define GL_DRAW_BUFFER13_NV 0x8832 +#define GL_DRAW_BUFFER14_NV 0x8833 +#define GL_DRAW_BUFFER15_NV 0x8834 +#define GL_COLOR_ATTACHMENT0_NV 0x8CE0 +#define GL_COLOR_ATTACHMENT1_NV 0x8CE1 +#define GL_COLOR_ATTACHMENT2_NV 0x8CE2 +#define GL_COLOR_ATTACHMENT3_NV 0x8CE3 +#define GL_COLOR_ATTACHMENT4_NV 0x8CE4 +#define GL_COLOR_ATTACHMENT5_NV 0x8CE5 +#define GL_COLOR_ATTACHMENT6_NV 0x8CE6 +#define GL_COLOR_ATTACHMENT7_NV 0x8CE7 +#define GL_COLOR_ATTACHMENT8_NV 0x8CE8 +#define GL_COLOR_ATTACHMENT9_NV 0x8CE9 +#define GL_COLOR_ATTACHMENT10_NV 0x8CEA +#define GL_COLOR_ATTACHMENT11_NV 0x8CEB +#define GL_COLOR_ATTACHMENT12_NV 0x8CEC +#define GL_COLOR_ATTACHMENT13_NV 0x8CED +#define GL_COLOR_ATTACHMENT14_NV 0x8CEE +#define GL_COLOR_ATTACHMENT15_NV 0x8CEF +typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs); #endif -typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs); -#endif +#endif /* GL_NV_draw_buffers */ -/* GL_NV_draw_instanced */ #ifndef GL_NV_draw_instanced #define GL_NV_draw_instanced 1 +typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDrawArraysInstancedNV (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedNV (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); -#endif -typedef void (GL_APIENTRYP PFNDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +GL_APICALL void GL_APIENTRY glDrawElementsInstancedNV (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); #endif +#endif /* GL_NV_draw_instanced */ + +#ifndef GL_NV_explicit_attrib_location +#define GL_NV_explicit_attrib_location 1 +#endif /* GL_NV_explicit_attrib_location */ -/* GL_NV_fbo_color_attachments */ #ifndef GL_NV_fbo_color_attachments #define GL_NV_fbo_color_attachments 1 -#endif +#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF +#endif /* GL_NV_fbo_color_attachments */ -/* GL_NV_fence */ #ifndef GL_NV_fence #define GL_NV_fence 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); -GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei, GLuint *); -GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint); -GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint); -GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); -GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint); -GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint, GLenum); -#endif +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); @@ -1805,135 +1280,194 @@ typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); +GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); +GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint fence); +GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint fence); +GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint fence); +GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition); #endif +#endif /* GL_NV_fence */ -/* GL_NV_framebuffer_blit */ #ifndef GL_NV_framebuffer_blit #define GL_NV_framebuffer_blit 1 +#define GL_READ_FRAMEBUFFER_NV 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_NV 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6 +#define GL_READ_FRAMEBUFFER_BINDING_NV 0x8CAA +typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); #ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBlitFramebufferNV (int srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif -typedef void (GL_APIENTRYP PFNBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GL_APICALL void GL_APIENTRY glBlitFramebufferNV (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); #endif +#endif /* GL_NV_framebuffer_blit */ -/* GL_NV_framebuffer_multisample */ #ifndef GL_NV_framebuffer_multisample #define GL_NV_framebuffer_multisample 1 +#define GL_RENDERBUFFER_SAMPLES_NV 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56 +#define GL_MAX_SAMPLES_NV 0x8D57 +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleNV ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -typedef void (GL_APIENTRYP PFNRENDERBUFFERSTORAGEMULTISAMPLENVPROC) ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleNV (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #endif +#endif /* GL_NV_framebuffer_multisample */ -/* GL_NV_generate_mipmap_sRGB */ #ifndef GL_NV_generate_mipmap_sRGB #define GL_NV_generate_mipmap_sRGB 1 -#endif +#endif /* GL_NV_generate_mipmap_sRGB */ -/* GL_NV_instanced_arrays */ #ifndef GL_NV_instanced_arrays #define GL_NV_instanced_arrays 1 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE +typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glVertexAttribDivisorNV (GLuint index, GLuint divisor); #endif -typedef void (GL_APIENTRYP PFNVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor); +#endif /* GL_NV_instanced_arrays */ + +#ifndef GL_NV_non_square_matrices +#define GL_NV_non_square_matrices 1 +#define GL_FLOAT_MAT2x3_NV 0x8B65 +#define GL_FLOAT_MAT2x4_NV 0x8B66 +#define GL_FLOAT_MAT3x2_NV 0x8B67 +#define GL_FLOAT_MAT3x4_NV 0x8B68 +#define GL_FLOAT_MAT4x2_NV 0x8B69 +#define GL_FLOAT_MAT4x3_NV 0x8B6A +typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glUniformMatrix2x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix3x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix2x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix4x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix3x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix4x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); #endif +#endif /* GL_NV_non_square_matrices */ -/* GL_NV_read_buffer */ #ifndef GL_NV_read_buffer #define GL_NV_read_buffer 1 +#define GL_READ_BUFFER_NV 0x0C02 +typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode); #endif -typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode); -#endif +#endif /* GL_NV_read_buffer */ -/* GL_NV_read_buffer_front */ #ifndef GL_NV_read_buffer_front #define GL_NV_read_buffer_front 1 -#endif +#endif /* GL_NV_read_buffer_front */ -/* GL_NV_read_depth */ #ifndef GL_NV_read_depth #define GL_NV_read_depth 1 -#endif +#endif /* GL_NV_read_depth */ -/* GL_NV_read_depth_stencil */ #ifndef GL_NV_read_depth_stencil #define GL_NV_read_depth_stencil 1 -#endif +#endif /* GL_NV_read_depth_stencil */ -/* GL_NV_read_stencil */ #ifndef GL_NV_read_stencil #define GL_NV_read_stencil 1 -#endif +#endif /* GL_NV_read_stencil */ + +#ifndef GL_NV_sRGB_formats +#define GL_NV_sRGB_formats 1 +#define GL_SLUMINANCE_NV 0x8C46 +#define GL_SLUMINANCE_ALPHA_NV 0x8C44 +#define GL_SRGB8_NV 0x8C41 +#define GL_SLUMINANCE8_NV 0x8C47 +#define GL_SLUMINANCE8_ALPHA8_NV 0x8C45 +#define GL_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F +#define GL_ETC1_SRGB8_NV 0x88EE +#endif /* GL_NV_sRGB_formats */ -/* GL_NV_shadow_samplers_array */ #ifndef GL_NV_shadow_samplers_array #define GL_NV_shadow_samplers_array 1 -#endif +#define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4 +#endif /* GL_NV_shadow_samplers_array */ -/* GL_NV_shadow_samplers_cube */ #ifndef GL_NV_shadow_samplers_cube #define GL_NV_shadow_samplers_cube 1 -#endif - -/* GL_NV_sRGB_formats */ -#ifndef GL_NV_sRGB_formats -#define GL_NV_sRGB_formats 1 -#endif +#define GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5 +#endif /* GL_NV_shadow_samplers_cube */ -/* GL_NV_texture_border_clamp */ #ifndef GL_NV_texture_border_clamp #define GL_NV_texture_border_clamp 1 -#endif +#define GL_TEXTURE_BORDER_COLOR_NV 0x1004 +#define GL_CLAMP_TO_BORDER_NV 0x812D +#endif /* GL_NV_texture_border_clamp */ -/* GL_NV_texture_compression_s3tc_update */ #ifndef GL_NV_texture_compression_s3tc_update #define GL_NV_texture_compression_s3tc_update 1 -#endif +#endif /* GL_NV_texture_compression_s3tc_update */ -/* GL_NV_texture_npot_2D_mipmap */ #ifndef GL_NV_texture_npot_2D_mipmap #define GL_NV_texture_npot_2D_mipmap 1 -#endif +#endif /* GL_NV_texture_npot_2D_mipmap */ -/*------------------------------------------------------------------------* - * QCOM extension functions - *------------------------------------------------------------------------*/ - -/* GL_QCOM_alpha_test */ #ifndef GL_QCOM_alpha_test #define GL_QCOM_alpha_test 1 +#define GL_ALPHA_TEST_QCOM 0x0BC0 +#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1 +#define GL_ALPHA_TEST_REF_QCOM 0x0BC2 +typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref); #endif -typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref); -#endif +#endif /* GL_QCOM_alpha_test */ -/* GL_QCOM_binning_control */ #ifndef GL_QCOM_binning_control #define GL_QCOM_binning_control 1 -#endif +#define GL_BINNING_CONTROL_HINT_QCOM 0x8FB0 +#define GL_CPU_OPTIMIZED_QCOM 0x8FB1 +#define GL_GPU_OPTIMIZED_QCOM 0x8FB2 +#define GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3 +#endif /* GL_QCOM_binning_control */ -/* GL_QCOM_driver_control */ #ifndef GL_QCOM_driver_control #define GL_QCOM_driver_control 1 +typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); +typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); +typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls); GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl); GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl); #endif -typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); -typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); -typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); -typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); -#endif +#endif /* GL_QCOM_driver_control */ -/* GL_QCOM_extended_get */ #ifndef GL_QCOM_extended_get #define GL_QCOM_extended_get 1 +#define GL_TEXTURE_WIDTH_QCOM 0x8BD2 +#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 +#define GL_TEXTURE_DEPTH_QCOM 0x8BD4 +#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 +#define GL_TEXTURE_FORMAT_QCOM 0x8BD6 +#define GL_TEXTURE_TYPE_QCOM 0x8BD7 +#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 +#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 +#define GL_TEXTURE_TARGET_QCOM 0x8BDA +#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB +#define GL_STATE_RESTORE 0x8BDC +typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures); +typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); +typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, void **params); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures); GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); @@ -1941,66 +1475,84 @@ GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GL GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); -GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params); -#endif -typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures); -typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); -typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); -typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); -typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); -typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); -typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params); +GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); +GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, void **params); #endif +#endif /* GL_QCOM_extended_get */ -/* GL_QCOM_extended_get2 */ #ifndef GL_QCOM_extended_get2 #define GL_QCOM_extended_get2 1 +typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders); +typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms); +typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); +typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders); GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms); GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program); GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length); #endif -typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders); -typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms); -typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); -typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length); -#endif +#endif /* GL_QCOM_extended_get2 */ -/* GL_QCOM_perfmon_global_mode */ #ifndef GL_QCOM_perfmon_global_mode #define GL_QCOM_perfmon_global_mode 1 -#endif - -/* GL_QCOM_writeonly_rendering */ -#ifndef GL_QCOM_writeonly_rendering -#define GL_QCOM_writeonly_rendering 1 -#endif +#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 +#endif /* GL_QCOM_perfmon_global_mode */ -/* GL_QCOM_tiled_rendering */ #ifndef GL_QCOM_tiled_rendering #define GL_QCOM_tiled_rendering 1 +#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 +#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 +#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 +#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 +#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 +#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 +#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 +#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 +#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 +#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 +#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 +#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 +#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 +#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 +#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 +#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 +#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 +#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 +#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 +#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 +#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 +#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 +#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 +#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 +#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 +#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 +#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 +#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 +#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 +#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 +#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 +#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 +typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); +typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask); #endif -typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); -typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); -#endif +#endif /* GL_QCOM_tiled_rendering */ -/*------------------------------------------------------------------------* - * VIV extension tokens - *------------------------------------------------------------------------*/ +#ifndef GL_QCOM_writeonly_rendering +#define GL_QCOM_writeonly_rendering 1 +#define GL_WRITEONLY_RENDERING_QCOM 0x8823 +#endif /* GL_QCOM_writeonly_rendering */ -/* GL_VIV_shader_binary */ #ifndef GL_VIV_shader_binary #define GL_VIV_shader_binary 1 -#endif +#define GL_SHADER_BINARY_VIV 0x8FC4 +#endif /* GL_VIV_shader_binary */ #ifdef __cplusplus } #endif -#endif /* __gl2ext_h_ */ +#endif diff --git a/external/OpenGL/GLES2/gl2platform.h b/external/OpenGL/GLES2/gl2platform.h index c9fa3c4d6..89d4d44dc 100644 --- a/external/OpenGL/GLES2/gl2platform.h +++ b/external/OpenGL/GLES2/gl2platform.h @@ -1,7 +1,7 @@ #ifndef __gl2platform_h_ #define __gl2platform_h_ -/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ +/* $Revision: 23328 $ on $Date:: 2013-10-02 02:28:28 -0700 #$ */ /* * This document is licensed under the SGI Free Software B License Version diff --git a/external/OpenGL/GLES3/gl3.h b/external/OpenGL/GLES3/gl3.h index b7e91e688..81b63bd03 100644 --- a/external/OpenGL/GLES3/gl3.h +++ b/external/OpenGL/GLES3/gl3.h @@ -1,18 +1,12 @@ #ifndef __gl3_h_ -#define __gl3_h_ - -/* - * gl3.h last updated on $Date: 2013-02-12 14:37:24 -0800 (Tue, 12 Feb 2013) $ - */ - -#include +#define __gl3_h_ 1 #ifdef __cplusplus extern "C" { #endif /* -** Copyright (c) 2007-2013 The Khronos Group Inc. +** Copyright (c) 2013 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 @@ -33,1026 +27,908 @@ extern "C" { ** 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$ on $Date$ +*/ -/*------------------------------------------------------------------------- - * Data type definitions - *-----------------------------------------------------------------------*/ - -/* OpenGL ES 2.0 */ - -typedef void GLvoid; -typedef char GLchar; -typedef unsigned int GLenum; -typedef unsigned char GLboolean; -typedef unsigned int GLbitfield; -typedef khronos_int8_t GLbyte; -typedef short GLshort; -typedef int GLint; -typedef int GLsizei; -typedef khronos_uint8_t GLubyte; -typedef unsigned short GLushort; -typedef unsigned int GLuint; -typedef khronos_float_t GLfloat; -typedef khronos_float_t GLclampf; -typedef khronos_int32_t GLfixed; -typedef khronos_intptr_t GLintptr; -typedef khronos_ssize_t GLsizeiptr; +#include -/* OpenGL ES 3.0 */ +/* Generated C header for: + * API: gles2 + * Profile: common + * Versions considered: [23]\.[0-9] + * Versions emitted: .* + * Default extensions included: None + * Additional extensions included: _nomatch_^ + * Extensions removed: _nomatch_^ + */ -typedef unsigned short GLhalf; -typedef khronos_int64_t GLint64; -typedef khronos_uint64_t GLuint64; +#ifndef GL_ES_VERSION_2_0 +#define GL_ES_VERSION_2_0 1 +#include +typedef khronos_int8_t GLbyte; +typedef khronos_float_t GLclampf; +typedef khronos_int32_t GLfixed; +typedef short GLshort; +typedef unsigned short GLushort; +typedef void GLvoid; typedef struct __GLsync *GLsync; - -/*------------------------------------------------------------------------- - * Token definitions - *-----------------------------------------------------------------------*/ - -/* OpenGL ES core versions */ -#define GL_ES_VERSION_3_0 1 -#define GL_ES_VERSION_2_0 1 - -/* OpenGL ES 2.0 */ - -/* ClearBufferMask */ -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_COLOR_BUFFER_BIT 0x00004000 - -/* Boolean */ -#define GL_FALSE 0 -#define GL_TRUE 1 - -/* BeginMode */ -#define GL_POINTS 0x0000 -#define GL_LINES 0x0001 -#define GL_LINE_LOOP 0x0002 -#define GL_LINE_STRIP 0x0003 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRIANGLE_FAN 0x0006 - -/* BlendingFactorDest */ -#define GL_ZERO 0 -#define GL_ONE 1 -#define GL_SRC_COLOR 0x0300 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_SRC_ALPHA 0x0302 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_DST_ALPHA 0x0304 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 - -/* BlendingFactorSrc */ -/* GL_ZERO */ -/* GL_ONE */ -#define GL_DST_COLOR 0x0306 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_SRC_ALPHA_SATURATE 0x0308 -/* GL_SRC_ALPHA */ -/* GL_ONE_MINUS_SRC_ALPHA */ -/* GL_DST_ALPHA */ -/* GL_ONE_MINUS_DST_ALPHA */ - -/* BlendEquationSeparate */ -#define GL_FUNC_ADD 0x8006 -#define GL_BLEND_EQUATION 0x8009 -#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */ -#define GL_BLEND_EQUATION_ALPHA 0x883D - -/* BlendSubtract */ -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B - -/* Separate Blend Functions */ -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BLEND_COLOR 0x8005 - -/* Buffer Objects */ -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 - -#define GL_STREAM_DRAW 0x88E0 -#define GL_STATIC_DRAW 0x88E4 -#define GL_DYNAMIC_DRAW 0x88E8 - -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 - -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 - -/* CullFaceMode */ -#define GL_FRONT 0x0404 -#define GL_BACK 0x0405 -#define GL_FRONT_AND_BACK 0x0408 - -/* DepthFunction */ -/* GL_NEVER */ -/* GL_LESS */ -/* GL_EQUAL */ -/* GL_LEQUAL */ -/* GL_GREATER */ -/* GL_NOTEQUAL */ -/* GL_GEQUAL */ -/* GL_ALWAYS */ - -/* EnableCap */ -#define GL_TEXTURE_2D 0x0DE1 -#define GL_CULL_FACE 0x0B44 -#define GL_BLEND 0x0BE2 -#define GL_DITHER 0x0BD0 -#define GL_STENCIL_TEST 0x0B90 -#define GL_DEPTH_TEST 0x0B71 -#define GL_SCISSOR_TEST 0x0C11 -#define GL_POLYGON_OFFSET_FILL 0x8037 -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_COVERAGE 0x80A0 - -/* ErrorCode */ -#define GL_NO_ERROR 0 -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVALID_OPERATION 0x0502 -#define GL_OUT_OF_MEMORY 0x0505 - -/* FrontFaceDirection */ -#define GL_CW 0x0900 -#define GL_CCW 0x0901 - -/* GetPName */ -#define GL_LINE_WIDTH 0x0B21 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_CULL_FACE_MODE 0x0B45 -#define GL_FRONT_FACE 0x0B46 -#define GL_DEPTH_RANGE 0x0B70 -#define GL_DEPTH_WRITEMASK 0x0B72 -#define GL_DEPTH_CLEAR_VALUE 0x0B73 -#define GL_DEPTH_FUNC 0x0B74 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_WRITEMASK 0x0B98 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#define GL_VIEWPORT 0x0BA2 -#define GL_SCISSOR_BOX 0x0C10 -/* GL_SCISSOR_TEST */ -#define GL_COLOR_CLEAR_VALUE 0x0C22 -#define GL_COLOR_WRITEMASK 0x0C23 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_PACK_ALIGNMENT 0x0D05 -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_MAX_VIEWPORT_DIMS 0x0D3A -#define GL_SUBPIXEL_BITS 0x0D50 -#define GL_RED_BITS 0x0D52 -#define GL_GREEN_BITS 0x0D53 -#define GL_BLUE_BITS 0x0D54 -#define GL_ALPHA_BITS 0x0D55 -#define GL_DEPTH_BITS 0x0D56 -#define GL_STENCIL_BITS 0x0D57 -#define GL_POLYGON_OFFSET_UNITS 0x2A00 -/* GL_POLYGON_OFFSET_FILL */ -#define GL_POLYGON_OFFSET_FACTOR 0x8038 -#define GL_TEXTURE_BINDING_2D 0x8069 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB - -/* GetTextureParameter */ -/* GL_TEXTURE_MAG_FILTER */ -/* GL_TEXTURE_MIN_FILTER */ -/* GL_TEXTURE_WRAP_S */ -/* GL_TEXTURE_WRAP_T */ - -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 - -/* HintMode */ -#define GL_DONT_CARE 0x1100 -#define GL_FASTEST 0x1101 -#define GL_NICEST 0x1102 - -/* HintTarget */ -#define GL_GENERATE_MIPMAP_HINT 0x8192 - -/* DataType */ -#define GL_BYTE 0x1400 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_SHORT 0x1402 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_INT 0x1404 -#define GL_UNSIGNED_INT 0x1405 -#define GL_FLOAT 0x1406 -#define GL_FIXED 0x140C - -/* PixelFormat */ -#define GL_DEPTH_COMPONENT 0x1902 -#define GL_ALPHA 0x1906 -#define GL_RGB 0x1907 -#define GL_RGBA 0x1908 -#define GL_LUMINANCE 0x1909 -#define GL_LUMINANCE_ALPHA 0x190A - -/* PixelType */ -/* GL_UNSIGNED_BYTE */ -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 - -/* Shaders */ -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB -#define GL_MAX_VARYING_VECTORS 0x8DFC -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD -#define GL_SHADER_TYPE 0x8B4F -#define GL_DELETE_STATUS 0x8B80 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D - -/* StencilFunction */ -#define GL_NEVER 0x0200 -#define GL_LESS 0x0201 -#define GL_EQUAL 0x0202 -#define GL_LEQUAL 0x0203 -#define GL_GREATER 0x0204 -#define GL_NOTEQUAL 0x0205 -#define GL_GEQUAL 0x0206 -#define GL_ALWAYS 0x0207 - -/* StencilOp */ -/* GL_ZERO */ -#define GL_KEEP 0x1E00 -#define GL_REPLACE 0x1E01 -#define GL_INCR 0x1E02 -#define GL_DECR 0x1E03 -#define GL_INVERT 0x150A -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 - -/* StringName */ -#define GL_VENDOR 0x1F00 -#define GL_RENDERER 0x1F01 -#define GL_VERSION 0x1F02 -#define GL_EXTENSIONS 0x1F03 - -/* TextureMagFilter */ -#define GL_NEAREST 0x2600 -#define GL_LINEAR 0x2601 - -/* TextureMinFilter */ -/* GL_NEAREST */ -/* GL_LINEAR */ -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 - -/* TextureParameterName */ -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 - -/* TextureTarget */ -/* GL_TEXTURE_2D */ -#define GL_TEXTURE 0x1702 - -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C - -/* TextureUnit */ -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 - -/* TextureWrapMode */ -#define GL_REPEAT 0x2901 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_MIRRORED_REPEAT 0x8370 - -/* Uniform Types */ -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_CUBE 0x8B60 - -/* Vertex Arrays */ -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F - -/* Read Format */ -#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B - -/* Shader Source */ -#define GL_COMPILE_STATUS 0x8B81 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_SHADER_COMPILER 0x8DFA - -/* Shader Binary */ -#define GL_SHADER_BINARY_FORMATS 0x8DF8 -#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 - -/* Shader Precision-Specified Types */ -#define GL_LOW_FLOAT 0x8DF0 -#define GL_MEDIUM_FLOAT 0x8DF1 -#define GL_HIGH_FLOAT 0x8DF2 -#define GL_LOW_INT 0x8DF3 -#define GL_MEDIUM_INT 0x8DF4 -#define GL_HIGH_INT 0x8DF5 - -/* Framebuffer Object. */ -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 - -#define GL_RGBA4 0x8056 -#define GL_RGB5_A1 0x8057 -#define GL_RGB565 0x8D62 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_STENCIL_INDEX8 0x8D48 - -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 - -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 - -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_STENCIL_ATTACHMENT 0x8D20 - -#define GL_NONE 0 - -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9 -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD - -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 - -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 - -/* OpenGL ES 3.0 */ - -#define GL_READ_BUFFER 0x0C02 -#define GL_UNPACK_ROW_LENGTH 0x0CF2 -#define GL_UNPACK_SKIP_ROWS 0x0CF3 -#define GL_UNPACK_SKIP_PIXELS 0x0CF4 -#define GL_PACK_ROW_LENGTH 0x0D02 -#define GL_PACK_SKIP_ROWS 0x0D03 -#define GL_PACK_SKIP_PIXELS 0x0D04 -#define GL_COLOR 0x1800 -#define GL_DEPTH 0x1801 -#define GL_STENCIL 0x1802 -#define GL_RED 0x1903 -#define GL_RGB8 0x8051 -#define GL_RGBA8 0x8058 -#define GL_RGB10_A2 0x8059 -#define GL_TEXTURE_BINDING_3D 0x806A -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#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_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_DEPTH_COMPONENT24 0x81A6 -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D -#define GL_CURRENT_QUERY 0x8865 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA -#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_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A -#define GL_SAMPLER_3D 0x8B5F -#define GL_SAMPLER_2D_SHADOW 0x8B62 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B -#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_SRGB8_ALPHA8 0x8C43 -#define GL_COMPARE_REF_TO_TEXTURE 0x884E -#define GL_MAJOR_VERSION 0x821B -#define GL_MINOR_VERSION 0x821C -#define GL_NUM_EXTENSIONS 0x821D -#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_MAX_VARYING_COMPONENTS 0x8B4B -#define GL_TEXTURE_2D_ARRAY 0x8C1A -#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_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_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 -#define GL_RASTERIZER_DISCARD 0x8C89 +typedef khronos_int64_t GLint64; +typedef khronos_uint64_t GLuint64; +typedef unsigned int GLenum; +typedef unsigned int GLuint; +typedef char GLchar; +typedef khronos_float_t GLfloat; +typedef khronos_ssize_t GLsizeiptr; +typedef khronos_intptr_t GLintptr; +typedef unsigned int GLbitfield; +typedef int GLint; +typedef unsigned char GLboolean; +typedef int GLsizei; +typedef khronos_uint8_t GLubyte; +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_FALSE 0 +#define GL_TRUE 1 +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_ZERO 0 +#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_FUNC_ADD 0x8006 +#define GL_BLEND_EQUATION 0x8009 +#define GL_BLEND_EQUATION_RGB 0x8009 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_STREAM_DRAW 0x88E0 +#define GL_STATIC_DRAW 0x88E4 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_CULL_FACE 0x0B44 +#define GL_BLEND 0x0BE2 +#define GL_DITHER 0x0BD0 +#define GL_STENCIL_TEST 0x0B90 +#define GL_DEPTH_TEST 0x0B71 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_LINE_WIDTH 0x0B21 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_FIXED 0x140C +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD +#define GL_SHADER_TYPE 0x8B4F +#define GL_DELETE_STATUS 0x8B80 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_INVERT 0x150A +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_TEXTURE 0x1702 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#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_REPEAT 0x2901 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_COMPILE_STATUS 0x8B81 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#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_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGB565 0x8D62 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_NONE 0 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9 +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture); +GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader); +GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name); +GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); +GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); +GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); +GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode); +GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); +GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage); +GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); +GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target); +GL_APICALL void GL_APIENTRY glClear (GLbitfield mask); +GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d); +GL_APICALL void GL_APIENTRY glClearStencil (GLint s); +GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader); +GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL GLuint GL_APIENTRY glCreateProgram (void); +GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type); +GL_APICALL void GL_APIENTRY glCullFace (GLenum mode); +GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); +GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers); +GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program); +GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers); +GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader); +GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func); +GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag); +GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f); +GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader); +GL_APICALL void GL_APIENTRY glDisable (GLenum cap); +GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index); +GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices); +GL_APICALL void GL_APIENTRY glEnable (GLenum cap); +GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index); +GL_APICALL void GL_APIENTRY glFinish (void); +GL_APICALL void GL_APIENTRY glFlush (void); +GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode); +GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); +GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target); +GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers); +GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers); +GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures); +GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); +GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name); +GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); +GL_APICALL GLenum GL_APIENTRY glGetError (void); +GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name); +GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params); +GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params); +GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name); +GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); +GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer); +GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode); +GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); +GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap); +GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer); +GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program); +GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer); +GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader); +GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture); +GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width); +GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program); +GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); +GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); +GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); +GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); +GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); +GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask); +GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0); +GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0); +GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1); +GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1); +GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2); +GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUseProgram (GLuint program); +GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program); +GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x); +GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v); +GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y); +GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v); +GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v); +GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v); +GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); +#endif /* GL_ES_VERSION_2_0 */ + +#ifndef GL_ES_VERSION_3_0 +#define GL_ES_VERSION_3_0 1 +typedef unsigned short GLhalf; +#define GL_READ_BUFFER 0x0C02 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_RED 0x1903 +#define GL_RGB8 0x8051 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#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_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#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_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#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_SRGB8_ALPHA8 0x8C43 +#define GL_COMPARE_REF_TO_TEXTURE 0x884E +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#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_MAX_VARYING_COMPONENTS 0x8B4B +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#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_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_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_RGB_INTEGER 0x8D98 -#define GL_RGBA_INTEGER 0x8D99 -#define GL_SAMPLER_2D_ARRAY 0x8DC1 -#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_2D 0x8DCA -#define GL_INT_SAMPLER_3D 0x8DCB -#define GL_INT_SAMPLER_CUBE 0x8DCC -#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF -#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_2D_ARRAY 0x8DD7 -#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_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_DEPTH_STENCIL 0x84F9 -#define GL_UNSIGNED_INT_24_8 0x84FA -#define GL_DEPTH24_STENCIL8 0x88F0 -#define GL_UNSIGNED_NORMALIZED 0x8C17 -#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING -#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_TEXTURE_LAYER 0x8CD4 -#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF -#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_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 -#define GL_MAX_SAMPLES 0x8D57 -#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_RG 0x8227 -#define GL_RG_INTEGER 0x8228 -#define GL_R8 0x8229 -#define GL_RG8 0x822B -#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_R8_SNORM 0x8F94 -#define GL_RG8_SNORM 0x8F95 -#define GL_RGB8_SNORM 0x8F96 -#define GL_RGBA8_SNORM 0x8F97 -#define GL_SIGNED_NORMALIZED 0x8F9C -#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 -#define GL_COPY_READ_BUFFER 0x8F36 -#define GL_COPY_WRITE_BUFFER 0x8F37 -#define GL_COPY_READ_BUFFER_BINDING GL_COPY_READ_BUFFER -#define GL_COPY_WRITE_BUFFER_BINDING GL_COPY_WRITE_BUFFER -#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 -#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 -#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 -#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_SYNC_FLUSH_COMMANDS_BIT 0x00000001 -#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE -#define GL_ANY_SAMPLES_PASSED 0x8C2F -#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A -#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_GREEN 0x1904 -#define GL_BLUE 0x1905 -#define GL_INT_2_10_10_10_REV 0x8D9F -#define GL_TRANSFORM_FEEDBACK 0x8E22 -#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 -#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 -#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_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_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_TEXTURE_IMMUTABLE_FORMAT 0x912F -#define GL_MAX_ELEMENT_INDEX 0x8D6B -#define GL_NUM_SAMPLE_COUNTS 0x9380 -#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF - -/*------------------------------------------------------------------------- - * Entrypoint definitions - *-----------------------------------------------------------------------*/ - -/* OpenGL ES 2.0 */ - -GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture); -GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader); -GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name); -GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); -GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); -GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); -GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); -GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode); -GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); -GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); -GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); -GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); -GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target); -GL_APICALL void GL_APIENTRY glClear (GLbitfield mask); -GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat depth); -GL_APICALL void GL_APIENTRY glClearStencil (GLint s); -GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader); -GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data); -GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL GLuint GL_APIENTRY glCreateProgram (void); -GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type); -GL_APICALL void GL_APIENTRY glCullFace (GLenum mode); -GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers); -GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers); -GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program); -GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers); -GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader); -GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures); -GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func); -GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag); -GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f); -GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader); -GL_APICALL void GL_APIENTRY glDisable (GLenum cap); -GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index); -GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); -GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices); -GL_APICALL void GL_APIENTRY glEnable (GLenum cap); -GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index); -GL_APICALL void GL_APIENTRY glFinish (void); -GL_APICALL void GL_APIENTRY glFlush (void); -GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode); -GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers); -GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target); -GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers); -GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers); -GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures); -GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); -GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); -GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders); -GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name); -GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params); -GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params); -GL_APICALL GLenum GL_APIENTRY glGetError (void); -GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params); -GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog); -GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog); -GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); -GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); -GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name); -GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params); -GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params); -GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params); -GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name); -GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params); -GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer); -GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode); -GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); -GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap); -GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer); -GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program); -GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer); -GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader); -GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture); -GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width); -GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program); -GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); -GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); -GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); -GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); -GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length); -GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length); -GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask); -GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); -GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass); -GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels); -GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); -GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params); -GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params); -GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels); -GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x); -GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v); -GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x); -GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v); -GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y); -GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v); -GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y); -GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v); -GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v); -GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z); -GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v); -GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v); -GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w); -GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v); -GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glUseProgram (GLuint program); -GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program); -GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x); -GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values); -GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y); -GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values); -GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values); -GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values); -GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr); -GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); - -/* OpenGL ES 3.0 */ - -GL_APICALL void GL_APIENTRY glReadBuffer (GLenum mode); -GL_APICALL void GL_APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices); -GL_APICALL void GL_APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); -GL_APICALL void GL_APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels); -GL_APICALL void GL_APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data); -GL_APICALL void GL_APIENTRY glGenQueries (GLsizei n, GLuint* ids); -GL_APICALL void GL_APIENTRY glDeleteQueries (GLsizei n, const GLuint* ids); -GL_APICALL GLboolean GL_APIENTRY glIsQuery (GLuint id); -GL_APICALL void GL_APIENTRY glBeginQuery (GLenum target, GLuint id); -GL_APICALL void GL_APIENTRY glEndQuery (GLenum target); -GL_APICALL void GL_APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint* params); -GL_APICALL GLboolean GL_APIENTRY glUnmapBuffer (GLenum target); -GL_APICALL void GL_APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, GLvoid** params); -GL_APICALL void GL_APIENTRY glDrawBuffers (GLsizei n, const GLenum* bufs); -GL_APICALL void GL_APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GL_APICALL void GL_APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GL_APICALL GLvoid* GL_APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -GL_APICALL void GL_APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length); -GL_APICALL void GL_APIENTRY glBindVertexArray (GLuint array); -GL_APICALL void GL_APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint* arrays); -GL_APICALL void GL_APIENTRY glGenVertexArrays (GLsizei n, GLuint* arrays); -GL_APICALL GLboolean GL_APIENTRY glIsVertexArray (GLuint array); -GL_APICALL void GL_APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint* data); -GL_APICALL void GL_APIENTRY glBeginTransformFeedback (GLenum primitiveMode); -GL_APICALL void GL_APIENTRY glEndTransformFeedback (void); -GL_APICALL void GL_APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GL_APICALL void GL_APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer); -GL_APICALL void GL_APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode); -GL_APICALL void GL_APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name); -GL_APICALL void GL_APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer); -GL_APICALL void GL_APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint* params); -GL_APICALL void GL_APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w); -GL_APICALL void GL_APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GL_APICALL void GL_APIENTRY glVertexAttribI4iv (GLuint index, const GLint* v); -GL_APICALL void GL_APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint* v); -GL_APICALL void GL_APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint* params); -GL_APICALL GLint GL_APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name); -GL_APICALL void GL_APIENTRY glUniform1ui (GLint location, GLuint v0); -GL_APICALL void GL_APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1); -GL_APICALL void GL_APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2); -GL_APICALL void GL_APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GL_APICALL void GL_APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint* value); -GL_APICALL void GL_APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint* value); -GL_APICALL void GL_APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint* value); -GL_APICALL void GL_APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint* value); -GL_APICALL void GL_APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint* value); -GL_APICALL void GL_APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint* value); -GL_APICALL void GL_APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat* value); -GL_APICALL void GL_APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -GL_APICALL const GLubyte* GL_APIENTRY glGetStringi (GLenum name, GLuint index); -GL_APICALL void GL_APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GL_APICALL void GL_APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, GLuint* uniformIndices); -GL_APICALL void GL_APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); -GL_APICALL GLuint GL_APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar* uniformBlockName); -GL_APICALL void GL_APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); -GL_APICALL void GL_APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); -GL_APICALL void GL_APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instanceCount); -GL_APICALL void GL_APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei instanceCount); -GL_APICALL GLsync GL_APIENTRY glFenceSync (GLenum condition, GLbitfield flags); -GL_APICALL GLboolean GL_APIENTRY glIsSync (GLsync sync); -GL_APICALL void GL_APIENTRY glDeleteSync (GLsync sync); -GL_APICALL GLenum GL_APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); -GL_APICALL void GL_APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); -GL_APICALL void GL_APIENTRY glGetInteger64v (GLenum pname, GLint64* params); -GL_APICALL void GL_APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values); -GL_APICALL void GL_APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64* data); -GL_APICALL void GL_APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64* params); -GL_APICALL void GL_APIENTRY glGenSamplers (GLsizei count, GLuint* samplers); -GL_APICALL void GL_APIENTRY glDeleteSamplers (GLsizei count, const GLuint* samplers); -GL_APICALL GLboolean GL_APIENTRY glIsSampler (GLuint sampler); -GL_APICALL void GL_APIENTRY glBindSampler (GLuint unit, GLuint sampler); -GL_APICALL void GL_APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint* param); -GL_APICALL void GL_APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param); -GL_APICALL void GL_APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat* param); -GL_APICALL void GL_APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat* params); -GL_APICALL void GL_APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor); -GL_APICALL void GL_APIENTRY glBindTransformFeedback (GLenum target, GLuint id); -GL_APICALL void GL_APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint* ids); -GL_APICALL void GL_APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint* ids); -GL_APICALL GLboolean GL_APIENTRY glIsTransformFeedback (GLuint id); -GL_APICALL void GL_APIENTRY glPauseTransformFeedback (void); -GL_APICALL void GL_APIENTRY glResumeTransformFeedback (void); -GL_APICALL void GL_APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary); -GL_APICALL void GL_APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const GLvoid* binary, GLsizei length); -GL_APICALL void GL_APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value); -GL_APICALL void GL_APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum* attachments); -GL_APICALL void GL_APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GL_APICALL void GL_APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); +#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_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#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_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#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_2D_ARRAY 0x8DD7 +#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_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_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 +#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_TEXTURE_LAYER 0x8CD4 +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#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_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 +#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_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_RG8 0x822B +#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_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 +#define GL_COPY_READ_BUFFER_BINDING 0x8F36 +#define GL_COPY_WRITE_BUFFER_BINDING 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 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#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_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +#define GL_ANY_SAMPLES_PASSED 0x8C2F +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#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_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_INT_2_10_10_10_REV 0x8D9F +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 +#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_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_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_TEXTURE_IMMUTABLE_FORMAT 0x912F +#define GL_MAX_ELEMENT_INDEX 0x8D6B +#define GL_NUM_SAMPLE_COUNTS 0x9380 +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF +GL_APICALL void GL_APIENTRY glReadBuffer (GLenum mode); +GL_APICALL void GL_APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +GL_APICALL void GL_APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GL_APICALL void GL_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); +GL_APICALL void GL_APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +GL_APICALL void GL_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); +GL_APICALL void GL_APIENTRY glGenQueries (GLsizei n, GLuint *ids); +GL_APICALL void GL_APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids); +GL_APICALL GLboolean GL_APIENTRY glIsQuery (GLuint id); +GL_APICALL void GL_APIENTRY glBeginQuery (GLenum target, GLuint id); +GL_APICALL void GL_APIENTRY glEndQuery (GLenum target); +GL_APICALL void GL_APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params); +GL_APICALL GLboolean GL_APIENTRY glUnmapBuffer (GLenum target); +GL_APICALL void GL_APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params); +GL_APICALL void GL_APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs); +GL_APICALL void GL_APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GL_APICALL void *GL_APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +GL_APICALL void GL_APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length); +GL_APICALL void GL_APIENTRY glBindVertexArray (GLuint array); +GL_APICALL void GL_APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays); +GL_APICALL void GL_APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays); +GL_APICALL GLboolean GL_APIENTRY glIsVertexArray (GLuint array); +GL_APICALL void GL_APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data); +GL_APICALL void GL_APIENTRY glBeginTransformFeedback (GLenum primitiveMode); +GL_APICALL void GL_APIENTRY glEndTransformFeedback (void); +GL_APICALL void GL_APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GL_APICALL void GL_APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer); +GL_APICALL void GL_APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); +GL_APICALL void GL_APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +GL_APICALL void GL_APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GL_APICALL void GL_APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params); +GL_APICALL void GL_APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w); +GL_APICALL void GL_APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GL_APICALL void GL_APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v); +GL_APICALL void GL_APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v); +GL_APICALL void GL_APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params); +GL_APICALL GLint GL_APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name); +GL_APICALL void GL_APIENTRY glUniform1ui (GLint location, GLuint v0); +GL_APICALL void GL_APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1); +GL_APICALL void GL_APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2); +GL_APICALL void GL_APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GL_APICALL void GL_APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value); +GL_APICALL void GL_APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value); +GL_APICALL void GL_APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value); +GL_APICALL void GL_APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value); +GL_APICALL void GL_APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value); +GL_APICALL void GL_APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value); +GL_APICALL void GL_APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value); +GL_APICALL void GL_APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +GL_APICALL const GLubyte *GL_APIENTRY glGetStringi (GLenum name, GLuint index); +GL_APICALL void GL_APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GL_APICALL void GL_APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices); +GL_APICALL void GL_APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); +GL_APICALL GLuint GL_APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName); +GL_APICALL void GL_APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); +GL_APICALL void GL_APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); +GL_APICALL void GL_APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); +GL_APICALL void GL_APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); +GL_APICALL GLsync GL_APIENTRY glFenceSync (GLenum condition, GLbitfield flags); +GL_APICALL GLboolean GL_APIENTRY glIsSync (GLsync sync); +GL_APICALL void GL_APIENTRY glDeleteSync (GLsync sync); +GL_APICALL GLenum GL_APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); +GL_APICALL void GL_APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); +GL_APICALL void GL_APIENTRY glGetInteger64v (GLenum pname, GLint64 *params); +GL_APICALL void GL_APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +GL_APICALL void GL_APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data); +GL_APICALL void GL_APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params); +GL_APICALL void GL_APIENTRY glGenSamplers (GLsizei count, GLuint *samplers); +GL_APICALL void GL_APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers); +GL_APICALL GLboolean GL_APIENTRY glIsSampler (GLuint sampler); +GL_APICALL void GL_APIENTRY glBindSampler (GLuint unit, GLuint sampler); +GL_APICALL void GL_APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param); +GL_APICALL void GL_APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param); +GL_APICALL void GL_APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param); +GL_APICALL void GL_APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params); +GL_APICALL void GL_APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor); +GL_APICALL void GL_APIENTRY glBindTransformFeedback (GLenum target, GLuint id); +GL_APICALL void GL_APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids); +GL_APICALL void GL_APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids); +GL_APICALL GLboolean GL_APIENTRY glIsTransformFeedback (GLuint id); +GL_APICALL void GL_APIENTRY glPauseTransformFeedback (void); +GL_APICALL void GL_APIENTRY glResumeTransformFeedback (void); +GL_APICALL void GL_APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); +GL_APICALL void GL_APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); +GL_APICALL void GL_APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value); +GL_APICALL void GL_APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments); +GL_APICALL void GL_APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +GL_APICALL void GL_APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +#endif /* GL_ES_VERSION_3_0 */ #ifdef __cplusplus } diff --git a/external/OpenGL/GLES3/gl3platform.h b/external/OpenGL/GLES3/gl3platform.h index 1bd1a850f..b1e869dd1 100644 --- a/external/OpenGL/GLES3/gl3platform.h +++ b/external/OpenGL/GLES3/gl3platform.h @@ -1,7 +1,7 @@ #ifndef __gl3platform_h_ #define __gl3platform_h_ -/* $Revision: 18437 $ on $Date:: 2012-07-08 23:31:39 -0700 #$ */ +/* $Revision: 23328 $ on $Date:: 2013-10-02 02:28:28 -0700 #$ */ /* * This document is licensed under the SGI Free Software B License Version diff --git a/external/OpenGL/KHR/khrplatform.h b/external/OpenGL/KHR/khrplatform.h index 8ec0d199f..43aac97a7 100644 --- a/external/OpenGL/KHR/khrplatform.h +++ b/external/OpenGL/KHR/khrplatform.h @@ -26,7 +26,7 @@ /* Khronos platform-specific types and definitions. * - * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $ + * $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $ * * Adopters may modify this file to suit their platform. Adopters are * encouraged to submit platform specific modifications to the Khronos @@ -221,10 +221,23 @@ typedef signed char khronos_int8_t; typedef unsigned char khronos_uint8_t; typedef signed short int khronos_int16_t; typedef unsigned short int khronos_uint16_t; + +/* + * Types that differ between LLP64 and LP64 architectures - in LLP64, + * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears + * to be the only LLP64 architecture in current use. + */ +#ifdef _WIN64 +typedef signed long long int khronos_intptr_t; +typedef unsigned long long int khronos_uintptr_t; +typedef signed long long int khronos_ssize_t; +typedef unsigned long long int khronos_usize_t; +#else typedef signed long int khronos_intptr_t; typedef unsigned long int khronos_uintptr_t; typedef signed long int khronos_ssize_t; typedef unsigned long int khronos_usize_t; +#endif #if KHRONOS_SUPPORT_FLOAT /* From db5618c3258415f9a42aee96e49672836b0d11f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Nov 2013 14:44:22 +0100 Subject: [PATCH 062/105] OpenGL ES 2.0 and 3.0 share the same extension list. Until recently (or maybe not too recently) ES3 extension header was "currently empty", now the extension header is shared with ES2. It's nice to finally get rid of all the weird ifndefs. --- src/AbstractFramebuffer.cpp | 6 ------ src/AbstractFramebuffer.h | 2 -- src/AbstractImage.cpp | 8 -------- src/AbstractTexture.cpp | 14 -------------- src/AbstractTexture.h | 2 -- src/Buffer.cpp | 4 ---- src/Buffer.h | 10 +--------- src/ColorFormat.cpp | 8 -------- src/ColorFormat.h | 8 -------- src/Context.h | 2 -- src/CubeMapTexture.h | 2 -- src/CubeMapTextureArray.h | 2 -- src/Implementation/RendererState.h | 8 +------- src/OpenGL.h | 2 +- src/Platform/magnum-info.cpp | 2 -- src/Query.cpp | 8 +++----- src/Query.h | 4 ---- src/RenderbufferFormat.h | 4 ---- src/Renderer.cpp | 14 -------------- src/Renderer.h | 12 ++---------- src/Sampler.cpp | 4 ---- src/Sampler.h | 4 ---- src/Test/BufferGLTest.cpp | 2 -- src/Test/RendererTest.cpp | 4 ---- src/Texture.h | 2 -- src/TextureFormat.h | 18 +++--------------- 26 files changed, 11 insertions(+), 145 deletions(-) diff --git a/src/AbstractFramebuffer.cpp b/src/AbstractFramebuffer.cpp index f9bb9c33d..d6bbb95f4 100644 --- a/src/AbstractFramebuffer.cpp +++ b/src/AbstractFramebuffer.cpp @@ -277,7 +277,6 @@ void AbstractFramebuffer::initializeContextBasedFunctionality(Context& context) else readTarget = drawTarget = FramebufferTarget::ReadDraw; #endif - #ifndef MAGNUM_TARGET_GLES3 #ifndef MAGNUM_TARGET_GLES if(context.isExtensionSupported()) #else @@ -295,9 +294,6 @@ void AbstractFramebuffer::initializeContextBasedFunctionality(Context& context) readImplementation = &AbstractFramebuffer::readImplementationRobustness; #endif } - #else - static_cast(context); - #endif } GLenum AbstractFramebuffer::checkStatusImplementationDefault(const FramebufferTarget target) { @@ -380,7 +376,6 @@ void AbstractFramebuffer::readImplementationDefault(const Vector2i& offset, cons glReadPixels(offset.x(), offset.y(), size.x(), size.y(), GLenum(format), GLenum(type), data); } -#ifndef MAGNUM_TARGET_GLES3 void AbstractFramebuffer::readImplementationRobustness(const Vector2i& offset, const Vector2i& size, const ColorFormat format, const ColorType type, const std::size_t dataSize, GLvoid* const data) { /** @todo Enable when extension wrangler for ES is available */ #ifndef MAGNUM_TARGET_GLES @@ -396,6 +391,5 @@ void AbstractFramebuffer::readImplementationRobustness(const Vector2i& offset, c static_cast(data); #endif } -#endif } diff --git a/src/AbstractFramebuffer.h b/src/AbstractFramebuffer.h index 00781be99..ac7272622 100644 --- a/src/AbstractFramebuffer.h +++ b/src/AbstractFramebuffer.h @@ -360,9 +360,7 @@ class MAGNUM_EXPORT AbstractFramebuffer { typedef void(*ReadImplementation)(const Vector2i&, const Vector2i&, ColorFormat, ColorType, std::size_t, GLvoid*); static void MAGNUM_LOCAL readImplementationDefault(const Vector2i& offset, const Vector2i& size, ColorFormat format, ColorType type, std::size_t dataSize, GLvoid* data); - #ifndef MAGNUM_TARGET_GLES3 static void MAGNUM_LOCAL readImplementationRobustness(const Vector2i& offset, const Vector2i& size, ColorFormat format, ColorType type, std::size_t dataSize, GLvoid* data); - #endif static ReadImplementation MAGNUM_LOCAL readImplementation; }; diff --git a/src/AbstractImage.cpp b/src/AbstractImage.cpp index bde23f196..d593752a7 100644 --- a/src/AbstractImage.cpp +++ b/src/AbstractImage.cpp @@ -61,13 +61,9 @@ std::size_t AbstractImage::pixelSize(ColorFormat format, ColorType type) { case ColorType::UnsignedShort565Rev: #endif case ColorType::UnsignedShort4444: - #ifndef MAGNUM_TARGET_GLES3 case ColorType::UnsignedShort4444Rev: - #endif case ColorType::UnsignedShort5551: - #ifndef MAGNUM_TARGET_GLES3 case ColorType::UnsignedShort1555Rev: - #endif return 2; #ifndef MAGNUM_TARGET_GLES case ColorType::UnsignedInt8888: @@ -123,9 +119,7 @@ std::size_t AbstractImage::pixelSize(ColorFormat format, ColorType type) { #ifndef MAGNUM_TARGET_GLES2 case ColorFormat::RGBAInteger: #endif - #ifndef MAGNUM_TARGET_GLES3 case ColorFormat::BGRA: - #endif #ifndef MAGNUM_TARGET_GLES case ColorFormat::BGRAInteger: #endif @@ -133,9 +127,7 @@ std::size_t AbstractImage::pixelSize(ColorFormat format, ColorType type) { /* Handled above */ case ColorFormat::DepthComponent: - #ifndef MAGNUM_TARGET_GLES3 case ColorFormat::StencilIndex: - #endif case ColorFormat::DepthStencil: CORRADE_ASSERT_UNREACHABLE(); } diff --git a/src/AbstractTexture.cpp b/src/AbstractTexture.cpp index a7dd1c781..3402ee414 100644 --- a/src/AbstractTexture.cpp +++ b/src/AbstractTexture.cpp @@ -366,9 +366,7 @@ ColorFormat AbstractTexture::imageFormatForInternalFormat(const TextureFormat in case TextureFormat::RGB5: #endif case TextureFormat::RGB565: - #ifndef MAGNUM_TARGET_GLES3 case TextureFormat::RGB10: - #endif #ifndef MAGNUM_TARGET_GLES case TextureFormat::RGB12: #endif @@ -376,9 +374,7 @@ ColorFormat AbstractTexture::imageFormatForInternalFormat(const TextureFormat in case TextureFormat::R11FG11FB10F: case TextureFormat::RGB9E5: #endif - #ifndef MAGNUM_TARGET_GLES3 case TextureFormat::SRGB: - #endif #ifndef MAGNUM_TARGET_GLES2 case TextureFormat::SRGB8: #endif @@ -421,9 +417,7 @@ ColorFormat AbstractTexture::imageFormatForInternalFormat(const TextureFormat in #ifndef MAGNUM_TARGET_GLES case TextureFormat::RGBA12: #endif - #ifndef MAGNUM_TARGET_GLES3 case TextureFormat::SRGBAlpha: - #endif #ifndef MAGNUM_TARGET_GLES2 case TextureFormat::SRGB8Alpha8: #endif @@ -455,9 +449,7 @@ ColorFormat AbstractTexture::imageFormatForInternalFormat(const TextureFormat in case TextureFormat::DepthComponent: case TextureFormat::DepthComponent16: case TextureFormat::DepthComponent24: - #ifndef MAGNUM_TARGET_GLES3 case TextureFormat::DepthComponent32: - #endif #ifndef MAGNUM_TARGET_GLES2 case TextureFormat::DepthComponent32F: #endif @@ -501,10 +493,8 @@ ColorType AbstractTexture::imageTypeForInternalFormat(const TextureFormat intern case TextureFormat::Luminance: case TextureFormat::LuminanceAlpha: #endif - #ifndef MAGNUM_TARGET_GLES3 case TextureFormat::SRGB: case TextureFormat::SRGBAlpha: - #endif #ifndef MAGNUM_TARGET_GLES2 case TextureFormat::SRGB8: case TextureFormat::SRGB8Alpha8: @@ -619,9 +609,7 @@ ColorType AbstractTexture::imageTypeForInternalFormat(const TextureFormat intern case TextureFormat::RGB565: return ColorType::UnsignedShort565; - #ifndef MAGNUM_TARGET_GLES3 case TextureFormat::RGB10: - #endif case TextureFormat::RGB10A2: #ifndef MAGNUM_TARGET_GLES2 case TextureFormat::RGB10A2UI: @@ -640,9 +628,7 @@ ColorType AbstractTexture::imageTypeForInternalFormat(const TextureFormat intern case TextureFormat::DepthComponent: case TextureFormat::DepthComponent24: - #ifndef MAGNUM_TARGET_GLES3 case TextureFormat::DepthComponent32: - #endif return ColorType::UnsignedInt; #ifndef MAGNUM_TARGET_GLES2 diff --git a/src/AbstractTexture.h b/src/AbstractTexture.h index c26bd4eee..81121b703 100644 --- a/src/AbstractTexture.h +++ b/src/AbstractTexture.h @@ -217,7 +217,6 @@ class MAGNUM_EXPORT AbstractTexture { return *this; } - #ifndef MAGNUM_TARGET_GLES3 /** * @brief Set border color * @return Reference to self (for method chaining) @@ -259,7 +258,6 @@ class MAGNUM_EXPORT AbstractTexture { (this->*parameterfImplementation)(GL_TEXTURE_MAX_ANISOTROPY_EXT, anisotropy); return *this; } - #endif /** * @brief Invalidate texture image diff --git a/src/Buffer.cpp b/src/Buffer.cpp index c445d38dd..a0638faa7 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -44,9 +44,7 @@ Buffer::DataImplementation Buffer::dataImplementation = &Buffer::dataImplementat Buffer::SubDataImplementation Buffer::subDataImplementation = &Buffer::subDataImplementationDefault; Buffer::InvalidateImplementation Buffer::invalidateImplementation = &Buffer::invalidateImplementationNoOp; Buffer::InvalidateSubImplementation Buffer::invalidateSubImplementation = &Buffer::invalidateSubImplementationNoOp; -#ifndef MAGNUM_TARGET_GLES3 Buffer::MapImplementation Buffer::mapImplementation = &Buffer::mapImplementationDefault; -#endif Buffer::MapRangeImplementation Buffer::mapRangeImplementation = &Buffer::mapRangeImplementationDefault; Buffer::FlushMappedRangeImplementation Buffer::flushMappedRangeImplementation = &Buffer::flushMappedRangeImplementationDefault; Buffer::UnmapImplementation Buffer::unmapImplementation = &Buffer::unmapImplementationDefault; @@ -294,7 +292,6 @@ void Buffer::invalidateSubImplementationARB(GLintptr offset, GLsizeiptr length) } #endif -#ifndef MAGNUM_TARGET_GLES3 void* Buffer::mapImplementationDefault(MapAccess access) { /** @todo Re-enable when extension wrangler is available for ES */ #ifndef MAGNUM_TARGET_GLES @@ -310,7 +307,6 @@ void* Buffer::mapImplementationDSA(MapAccess access) { return glMapNamedBufferEXT(_id, GLenum(access)); } #endif -#endif void* Buffer::mapRangeImplementationDefault(GLintptr offset, GLsizeiptr length, MapFlags access) { /** @todo Re-enable when extension wrangler is available for ES */ diff --git a/src/Buffer.h b/src/Buffer.h index 0c7384777..3dfb0d479 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -314,7 +314,6 @@ class MAGNUM_EXPORT Buffer { typedef BufferUsage Usage; #endif - #ifndef MAGNUM_TARGET_GLES3 /** * @brief Memory mapping access * @@ -322,9 +321,7 @@ class MAGNUM_EXPORT Buffer { * instead, as it has more complete set of features. * @see map(MapAccess), mapSub() * @requires_es_extension %Extension @es_extension{OES,mapbuffer} or - * @es_extension{CHROMIUM,map_sub} in OpenGL ES 2.0, use - * @ref Magnum::Buffer::map(GLintptr, GLsizeiptr, MapFlags) "map(GLintptr, GLsizeiptr, MapFlags)" - * in OpenGL ES 3.0 instead. + * @es_extension{CHROMIUM,map_sub} */ enum class MapAccess: GLenum { #ifndef MAGNUM_TARGET_GLES @@ -352,7 +349,6 @@ class MAGNUM_EXPORT Buffer { ReadWrite = GL_READ_WRITE #endif }; - #endif /** * @brief Memory mapping flag @@ -763,7 +759,6 @@ class MAGNUM_EXPORT Buffer { } #endif - #ifndef MAGNUM_TARGET_GLES3 /** * @brief Map buffer to client memory * @param access Access @@ -784,7 +779,6 @@ class MAGNUM_EXPORT Buffer { void* map(MapAccess access) { return (this->*mapImplementation)(access); } - #endif #if defined(MAGNUM_TARGET_GLES2) || defined(DOXYGEN_GENERATING_OUTPUT) /** @@ -941,14 +935,12 @@ class MAGNUM_EXPORT Buffer { #endif static InvalidateSubImplementation invalidateSubImplementation; - #ifndef MAGNUM_TARGET_GLES3 typedef void*(Buffer::*MapImplementation)(MapAccess); void MAGNUM_LOCAL * mapImplementationDefault(MapAccess access); #ifndef MAGNUM_TARGET_GLES void MAGNUM_LOCAL * mapImplementationDSA(MapAccess access); #endif static MapImplementation mapImplementation; - #endif typedef void*(Buffer::*MapRangeImplementation)(GLintptr, GLsizeiptr, MapFlags); void MAGNUM_LOCAL * mapRangeImplementationDefault(GLintptr offset, GLsizeiptr length, MapFlags access); diff --git a/src/ColorFormat.cpp b/src/ColorFormat.cpp index 235e95f16..7b3403ec2 100644 --- a/src/ColorFormat.cpp +++ b/src/ColorFormat.cpp @@ -49,9 +49,7 @@ Debug operator<<(Debug debug, const ColorFormat value) { #ifndef MAGNUM_TARGET_GLES _c(BGR) #endif - #ifndef MAGNUM_TARGET_GLES3 _c(BGRA) - #endif #ifndef MAGNUM_TARGET_GLES2 _c(RedInteger) #ifndef MAGNUM_TARGET_GLES @@ -67,9 +65,7 @@ Debug operator<<(Debug debug, const ColorFormat value) { #endif #endif _c(DepthComponent) - #ifndef MAGNUM_TARGET_GLES3 _c(StencilIndex) - #endif _c(DepthStencil) #undef _c } @@ -103,13 +99,9 @@ Debug operator<<(Debug debug, const ColorType value) { _c(UnsignedShort565Rev) #endif _c(UnsignedShort4444) - #ifndef MAGNUM_TARGET_GLES3 _c(UnsignedShort4444Rev) - #endif _c(UnsignedShort5551) - #ifndef MAGNUM_TARGET_GLES3 _c(UnsignedShort1555Rev) - #endif #ifndef MAGNUM_TARGET_GLES _c(UnsignedInt8888) _c(UnsignedInt8888Rev) diff --git a/src/ColorFormat.h b/src/ColorFormat.h index 918ff0d42..54c014d7f 100644 --- a/src/ColorFormat.h +++ b/src/ColorFormat.h @@ -123,7 +123,6 @@ enum class ColorFormat: GLenum { BGR = GL_BGR, #endif - #ifndef MAGNUM_TARGET_GLES3 /** * Floating-point BGRA. * @requires_es_extension %Extension @es_extension{EXT,read_format_bgra} @@ -135,7 +134,6 @@ enum class ColorFormat: GLenum { #else BGRA = GL_BGRA_EXT, #endif - #endif #ifndef MAGNUM_TARGET_GLES2 /** @@ -221,7 +219,6 @@ enum class ColorFormat: GLenum { */ DepthComponent = GL_DEPTH_COMPONENT, - #ifndef MAGNUM_TARGET_GLES3 /** * Stencil index. * @requires_gl44 %Extension @extension{ARB,texture_stencil8} for texture @@ -235,7 +232,6 @@ enum class ColorFormat: GLenum { #else StencilIndex = 0x1901, #endif - #endif /** * Depth and stencil. @@ -361,7 +357,6 @@ enum class ColorType: GLenum { */ UnsignedShort4444 = GL_UNSIGNED_SHORT_4_4_4_4, - #ifndef MAGNUM_TARGET_GLES3 /** * ABGR, unsigned short, each component 4bit. * @requires_es_extension For framebuffer reading only, extension @@ -372,7 +367,6 @@ enum class ColorType: GLenum { #else UnsignedShort4444Rev = GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT, #endif - #endif /** * RGBA, unsigned short, each RGB component 5bit, alpha component 1bit. @@ -380,7 +374,6 @@ enum class ColorType: GLenum { */ UnsignedShort5551 = GL_UNSIGNED_SHORT_5_5_5_1, - #ifndef MAGNUM_TARGET_GLES3 /** * ABGR, unsigned short, each RGB component 5bit, alpha component 1bit. * @requires_es_extension For framebuffer reading only, extension @@ -391,7 +384,6 @@ enum class ColorType: GLenum { #else UnsignedShort1555Rev = GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT, #endif - #endif #ifndef MAGNUM_TARGET_GLES /** diff --git a/src/Context.h b/src/Context.h index b76878f77..f2aa1903a 100644 --- a/src/Context.h +++ b/src/Context.h @@ -154,7 +154,6 @@ class MAGNUM_EXPORT Context { * @see Flags, flags() */ enum class Flag: GLint { - #ifndef MAGNUM_TARGET_GLES3 /** * Debug context * @requires_gl43 %Extension @es_extension{KHR,debug} @@ -165,7 +164,6 @@ class MAGNUM_EXPORT Context { #else Debug = GL_CONTEXT_FLAG_DEBUG_BIT_KHR, #endif - #endif #ifndef MAGNUM_TARGET_GLES /** diff --git a/src/CubeMapTexture.h b/src/CubeMapTexture.h index aff742119..410b6125f 100644 --- a/src/CubeMapTexture.h +++ b/src/CubeMapTexture.h @@ -232,7 +232,6 @@ class CubeMapTexture: public AbstractTexture { AbstractTexture::setMagnificationFilter(filter); return *this; } - #ifndef MAGNUM_TARGET_GLES3 CubeMapTexture& setBorderColor(const Color4& color) { AbstractTexture::setBorderColor(color); return *this; @@ -241,7 +240,6 @@ class CubeMapTexture: public AbstractTexture { AbstractTexture::setMaxAnisotropy(anisotropy); return *this; } - #endif CubeMapTexture& generateMipmap() { AbstractTexture::generateMipmap(); return *this; diff --git a/src/CubeMapTextureArray.h b/src/CubeMapTextureArray.h index feeccd090..99d72f2ae 100644 --- a/src/CubeMapTextureArray.h +++ b/src/CubeMapTextureArray.h @@ -242,7 +242,6 @@ class CubeMapTextureArray: public AbstractTexture { AbstractTexture::setMagnificationFilter(filter); return *this; } - #ifndef MAGNUM_TARGET_GLES3 CubeMapTextureArray& setBorderColor(const Color4& color) { AbstractTexture::setBorderColor(color); return *this; @@ -251,7 +250,6 @@ class CubeMapTextureArray: public AbstractTexture { AbstractTexture::setMaxAnisotropy(anisotropy); return *this; } - #endif CubeMapTextureArray& generateMipmap() { AbstractTexture::generateMipmap(); return *this; diff --git a/src/Implementation/RendererState.h b/src/Implementation/RendererState.h index 3092f9165..e356c2e82 100644 --- a/src/Implementation/RendererState.h +++ b/src/Implementation/RendererState.h @@ -29,15 +29,9 @@ namespace Magnum { namespace Implementation { struct RendererState { - constexpr RendererState() - #ifndef MAGNUM_TARGET_GLES3 - : resetNotificationStrategy() - #endif - {} + constexpr RendererState(): resetNotificationStrategy() {} - #ifndef MAGNUM_TARGET_GLES3 Renderer::ResetNotificationStrategy resetNotificationStrategy; - #endif }; }} diff --git a/src/OpenGL.h b/src/OpenGL.h index 70b7d3a5c..534cc43d2 100644 --- a/src/OpenGL.h +++ b/src/OpenGL.h @@ -56,8 +56,8 @@ #else #include #include - #include #endif + #include #endif #endif diff --git a/src/Platform/magnum-info.cpp b/src/Platform/magnum-info.cpp index 228e4d164..c2e66e982 100644 --- a/src/Platform/magnum-info.cpp +++ b/src/Platform/magnum-info.cpp @@ -344,13 +344,11 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat } #endif - #ifndef MAGNUM_TARGET_GLES3 if(c->isExtensionSupported()) { _h(EXT::texture_filter_anisotropic) _l(Sampler::maxAnisotropy()) } - #endif #undef _l #undef _h diff --git a/src/Query.cpp b/src/Query.cpp index ac0f251fa..79203c0d7 100644 --- a/src/Query.cpp +++ b/src/Query.cpp @@ -91,13 +91,12 @@ template<> UnsignedInt AbstractQuery::result() { return result; } -#ifndef MAGNUM_TARGET_GLES3 template<> Int AbstractQuery::result() { CORRADE_ASSERT(!target, "AbstractQuery::result(): the query is currently running", {}); /** @todo Re-enable when extension wrangler is available for ES */ Int result; - #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_GLES glGetQueryObjectiv(_id, GL_QUERY_RESULT, &result); #else CORRADE_INTERNAL_ASSERT(false); @@ -111,7 +110,7 @@ template<> UnsignedLong AbstractQuery::result() { /** @todo Re-enable when extension wrangler is available for ES */ UnsignedLong result; - #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_GLES glGetQueryObjectui64v(_id, GL_QUERY_RESULT, &result); #else CORRADE_INTERNAL_ASSERT(false); @@ -125,7 +124,7 @@ template<> Long AbstractQuery::result() { /** @todo Re-enable when extension wrangler is available for ES */ Long result; - #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_GLES glGetQueryObjecti64v(_id, GL_QUERY_RESULT, &result); #else CORRADE_INTERNAL_ASSERT(false); @@ -134,7 +133,6 @@ template<> Long AbstractQuery::result() { return result; } #endif -#endif void AbstractQuery::begin(GLenum target) { CORRADE_ASSERT(!this->target, "AbstractQuery::begin(): the query is already running", ); diff --git a/src/Query.h b/src/Query.h index 624d33969..9e4f8fad0 100644 --- a/src/Query.h +++ b/src/Query.h @@ -110,12 +110,10 @@ class MAGNUM_EXPORT AbstractQuery { #ifndef DOXYGEN_GENERATING_OUTPUT template<> bool MAGNUM_EXPORT AbstractQuery::result(); template<> UnsignedInt MAGNUM_EXPORT AbstractQuery::result(); -#ifndef MAGNUM_TARGET_GLES3 template<> Int MAGNUM_EXPORT AbstractQuery::result(); template<> UnsignedLong MAGNUM_EXPORT AbstractQuery::result(); template<> Long MAGNUM_EXPORT AbstractQuery::result(); #endif -#endif #ifndef MAGNUM_TARGET_GLES2 /** @@ -307,7 +305,6 @@ class SampleQuery: public AbstractQuery { #endif }; -#ifndef MAGNUM_TARGET_GLES3 /** @brief Query for elapsed time @@ -374,7 +371,6 @@ class TimeQuery: public AbstractQuery { AbstractQuery::begin(GLenum(target)); } }; -#endif } diff --git a/src/RenderbufferFormat.h b/src/RenderbufferFormat.h index 9397bab46..9ba15e5eb 100644 --- a/src/RenderbufferFormat.h +++ b/src/RenderbufferFormat.h @@ -403,7 +403,6 @@ enum class RenderbufferFormat: GLenum { DepthComponent24 = GL_DEPTH_COMPONENT24_OES, #endif - #ifndef MAGNUM_TARGET_GLES3 /** * Depth component, 32bit. * @requires_es_extension %Extension @es_extension{OES,depth32} @@ -413,7 +412,6 @@ enum class RenderbufferFormat: GLenum { #else DepthComponent32 = GL_DEPTH_COMPONENT32_OES, #endif - #endif #ifndef MAGNUM_TARGET_GLES2 /** @@ -435,7 +433,6 @@ enum class RenderbufferFormat: GLenum { StencilIndex = GL_STENCIL_INDEX, #endif - #ifndef MAGNUM_TARGET_GLES3 /** * 1-bit stencil index. * @requires_es_extension %Extension @es_extension{OES,stencil1} @@ -455,7 +452,6 @@ enum class RenderbufferFormat: GLenum { #else StencilIndex4 = GL_STENCIL_INDEX4_OES, #endif - #endif /** 8-bit stencil index. */ StencilIndex8 = GL_STENCIL_INDEX8, diff --git a/src/Renderer.cpp b/src/Renderer.cpp index 88eb14fbd..9addf07b6 100644 --- a/src/Renderer.cpp +++ b/src/Renderer.cpp @@ -38,9 +38,7 @@ Renderer::ClearDepthfImplementation Renderer::clearDepthfImplementation = &Rende #else Renderer::ClearDepthfImplementation Renderer::clearDepthfImplementation = &Renderer::clearDepthfImplementationES; #endif -#ifndef MAGNUM_TARGET_GLES3 Renderer::GraphicsResetStatusImplementation Renderer::graphicsResetStatusImplementation = &Renderer::graphicsResetStatusImplementationDefault; -#endif void Renderer::setFeature(const Feature feature, const bool enabled) { enabled ? glEnable(GLenum(feature)) : glDisable(GLenum(feature)); @@ -162,7 +160,6 @@ void Renderer::setLogicOperation(const LogicOperation operation) { } #endif -#ifndef MAGNUM_TARGET_GLES3 Renderer::ResetNotificationStrategy Renderer::resetNotificationStrategy() { ResetNotificationStrategy& strategy = Context::current()->state().renderer->resetNotificationStrategy; @@ -176,7 +173,6 @@ Renderer::ResetNotificationStrategy Renderer::resetNotificationStrategy() { return strategy; } -#endif void Renderer::initializeContextBasedFunctionality(Context& context) { #ifndef MAGNUM_TARGET_GLES @@ -187,7 +183,6 @@ void Renderer::initializeContextBasedFunctionality(Context& context) { } #endif - #ifndef MAGNUM_TARGET_GLES3 #ifndef MAGNUM_TARGET_GLES if(context.isExtensionSupported()) #else @@ -202,9 +197,6 @@ void Renderer::initializeContextBasedFunctionality(Context& context) { graphicsResetStatusImplementation = &Renderer::graphicsResetStatusImplementationRobustness; } - #else - static_cast(context); - #endif /* Set some "corporate identity" */ setClearColor(Color3(0.125f)); @@ -220,7 +212,6 @@ void Renderer::clearDepthfImplementationES(const GLfloat depth) { glClearDepthf(depth); } -#ifndef MAGNUM_TARGET_GLES3 Renderer::GraphicsResetStatus Renderer::graphicsResetStatusImplementationDefault() { return GraphicsResetStatus::NoError; } @@ -234,7 +225,6 @@ Renderer::GraphicsResetStatus Renderer::graphicsResetStatusImplementationRobustn CORRADE_INTERNAL_ASSERT(false); #endif } -#endif #ifndef DOXYGEN_GENERATING_OUTPUT Debug operator<<(Debug debug, const Renderer::Error value) { @@ -246,17 +236,14 @@ Debug operator<<(Debug debug, const Renderer::Error value) { _c(InvalidOperation) _c(InvalidFramebufferOperation) _c(OutOfMemory) - #ifndef MAGNUM_TARGET_GLES3 _c(StackUnderflow) _c(StackOverflow) - #endif #undef _c } return debug << "Renderer::Error::(invalid)"; } -#ifndef MAGNUM_TARGET_GLES3 Debug operator<<(Debug debug, const Renderer::ResetNotificationStrategy value) { switch(value) { #define _c(value) case Renderer::ResetNotificationStrategy::value: return debug << "Renderer::ResetNotificationStrategy::" #value; @@ -281,6 +268,5 @@ Debug operator<<(Debug debug, const Renderer::GraphicsResetStatus value) { return debug << "Renderer::ResetNotificationStrategy::(invalid)"; } #endif -#endif } diff --git a/src/Renderer.h b/src/Renderer.h index 5c772e4e9..394fd2300 100644 --- a/src/Renderer.h +++ b/src/Renderer.h @@ -895,13 +895,12 @@ class MAGNUM_EXPORT Renderer { /** There is not enough memory left to execute the command. */ OutOfMemory = GL_OUT_OF_MEMORY, - #ifndef MAGNUM_TARGET_GLES3 /** * Given operation would cause an internal stack to underflow. * @requires_gl43 %Extension @extension{KHR,debug} * @requires_es_extension %Extension @es_extension2{KHR,debug,debug} */ - #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_GLES StackUnderflow = GL_STACK_UNDERFLOW, #else StackUnderflow = GL_STACK_UNDERFLOW_KHR, @@ -912,12 +911,11 @@ class MAGNUM_EXPORT Renderer { * @requires_gl43 %Extension @extension{KHR,debug} * @requires_es_extension %Extension @es_extension2{KHR,debug,debug} */ - #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_GLES StackOverflow = GL_STACK_OVERFLOW #else StackOverflow = GL_STACK_OVERFLOW_KHR #endif - #endif }; /** @@ -930,7 +928,6 @@ class MAGNUM_EXPORT Renderer { */ static Error error() { return static_cast(glGetError()); } - #ifndef MAGNUM_TARGET_GLES3 /** * @brief Graphics reset notification strategy * @@ -1016,7 +1013,6 @@ class MAGNUM_EXPORT Renderer { static GraphicsResetStatus graphicsResetStatus() { return graphicsResetStatusImplementation(); } - #endif /*@}*/ @@ -1030,24 +1026,20 @@ class MAGNUM_EXPORT Renderer { static void MAGNUM_LOCAL clearDepthfImplementationES(GLfloat depth); static ClearDepthfImplementation clearDepthfImplementation; - #ifndef MAGNUM_TARGET_GLES3 typedef GraphicsResetStatus(*GraphicsResetStatusImplementation)(); static GraphicsResetStatus MAGNUM_LOCAL graphicsResetStatusImplementationDefault(); static GraphicsResetStatus MAGNUM_LOCAL graphicsResetStatusImplementationRobustness(); static GraphicsResetStatusImplementation graphicsResetStatusImplementation; - #endif }; /** @debugoperator{Renderer} */ Debug MAGNUM_EXPORT operator<<(Debug debug, Renderer::Error value); -#ifndef MAGNUM_TARGET_GLES3 /** @debugoperator{Renderer} */ Debug MAGNUM_EXPORT operator<<(Debug debug, Renderer::ResetNotificationStrategy value); /** @debugoperator{Renderer} */ Debug MAGNUM_EXPORT operator<<(Debug debug, Renderer::GraphicsResetStatus value); -#endif } diff --git a/src/Sampler.cpp b/src/Sampler.cpp index 4aa722741..15bfd75d0 100644 --- a/src/Sampler.cpp +++ b/src/Sampler.cpp @@ -45,7 +45,6 @@ static_assert((filter_or(Nearest, Base) == GL_NEAREST) && "Unsupported constants for GL texture filtering"); #undef filter_or -#ifndef MAGNUM_TARGET_GLES3 Float Sampler::maxAnisotropy() { GLfloat& value = Context::current()->state().texture->maxAnisotropy; @@ -58,7 +57,6 @@ Float Sampler::maxAnisotropy() { return value; } -#endif #ifndef DOXYGEN_GENERATING_OUTPUT Debug operator<<(Debug debug, const Sampler::Filter value) { @@ -90,9 +88,7 @@ Debug operator<<(Debug debug, const Sampler::Wrapping value) { _c(Repeat) _c(MirroredRepeat) _c(ClampToEdge) - #ifndef MAGNUM_TARGET_GLES3 _c(ClampToBorder) - #endif #ifndef MAGNUM_TARGET_GLES _c(MirrorClampToEdge) #endif diff --git a/src/Sampler.h b/src/Sampler.h index a19249ab8..43d507720 100644 --- a/src/Sampler.h +++ b/src/Sampler.h @@ -107,7 +107,6 @@ class MAGNUM_EXPORT Sampler { */ ClampToEdge = GL_CLAMP_TO_EDGE, - #ifndef MAGNUM_TARGET_GLES3 /** * Clamp to border color. Coordinates out of range will be clamped * to border color (set with setBorderColor()). @@ -118,7 +117,6 @@ class MAGNUM_EXPORT Sampler { #else ClampToBorder = GL_CLAMP_TO_BORDER_NV, #endif - #endif #ifndef MAGNUM_TARGET_GLES /** @@ -134,7 +132,6 @@ class MAGNUM_EXPORT Sampler { #endif }; - #ifndef MAGNUM_TARGET_GLES3 /** * @brief Max supported anisotropy * @@ -154,7 +151,6 @@ class MAGNUM_EXPORT Sampler { */ static Float maxSupportedAnisotropy() { return maxAnisotropy(); } #endif - #endif }; /** @debugoperator{Magnum::Sampler} */ diff --git a/src/Test/BufferGLTest.cpp b/src/Test/BufferGLTest.cpp index 9c066b604..48029b5a8 100644 --- a/src/Test/BufferGLTest.cpp +++ b/src/Test/BufferGLTest.cpp @@ -143,7 +143,6 @@ void BufferGLTest::data() { #endif } -#ifndef MAGNUM_TARGET_GLES3 void BufferGLTest::map() { #ifdef MAGNUM_TARGET_GLES2 if(!Context::current()->isExtensionSupported()) @@ -177,7 +176,6 @@ void BufferGLTest::map() { CORRADE_COMPARE(changedContents[3], 107); #endif } -#endif #ifdef MAGNUM_TARGET_GLES2 void BufferGLTest::mapSub() { diff --git a/src/Test/RendererTest.cpp b/src/Test/RendererTest.cpp index 07a386634..7e784dc11 100644 --- a/src/Test/RendererTest.cpp +++ b/src/Test/RendererTest.cpp @@ -34,10 +34,8 @@ class RendererTest: public TestSuite::Tester { explicit RendererTest(); void debugError(); - #ifndef MAGNUM_TARGET_GLES3 void debugResetNotificationStrategy(); void debugGraphicsResetStatus(); - #endif }; RendererTest::RendererTest() { @@ -51,7 +49,6 @@ void RendererTest::debugError() { CORRADE_COMPARE(out.str(), "Renderer::Error::InvalidOperation\n"); } -#ifndef MAGNUM_TARGET_GLES3 void RendererTest::debugResetNotificationStrategy() { std::ostringstream out; @@ -65,7 +62,6 @@ void RendererTest::debugGraphicsResetStatus() { Debug(&out) << Renderer::GraphicsResetStatus::GuiltyContextReset; CORRADE_COMPARE(out.str(), "Renderer::GraphicsResetStatus::GuiltyContextReset\n"); } -#endif }} diff --git a/src/Texture.h b/src/Texture.h index b189c4d47..ed47fede3 100644 --- a/src/Texture.h +++ b/src/Texture.h @@ -428,7 +428,6 @@ template class Texture: public AbstractTexture { AbstractTexture::setMagnificationFilter(filter); return *this; } - #ifndef MAGNUM_TARGET_GLES3 Texture& setBorderColor(const Color4& color) { AbstractTexture::setBorderColor(color); return *this; @@ -437,7 +436,6 @@ template class Texture: public AbstractTexture { AbstractTexture::setMaxAnisotropy(anisotropy); return *this; } - #endif Texture& generateMipmap() { AbstractTexture::generateMipmap(); return *this; diff --git a/src/TextureFormat.h b/src/TextureFormat.h index c5be28182..57e16f9b8 100644 --- a/src/TextureFormat.h +++ b/src/TextureFormat.h @@ -521,7 +521,6 @@ enum class TextureFormat: GLenum { */ RGB565 = GL_RGB565, - #ifndef MAGNUM_TARGET_GLES3 /** * RGB, each component normalized unsigned 10bit. * @requires_es_extension %Extension @es_extension{OES,required_internalformat} @@ -532,7 +531,6 @@ enum class TextureFormat: GLenum { #else RGB10 = GL_RGB10_EXT, #endif - #endif #ifndef MAGNUM_TARGET_GLES /** @@ -560,22 +558,18 @@ enum class TextureFormat: GLenum { RGB9E5 = GL_RGB9_E5, #endif - #ifndef MAGNUM_TARGET_GLES3 /** * sRGB, normalized unsigned, size implementation-dependent. * @todo is this allowed in core? * @deprecated_gl Prefer to use the exactly specified version of this * format, i.e. @ref Magnum::TextureFormat "TextureFormat::SRGB8". - * @requires_es_extension %Extension @es_extension{EXT,sRGB} in OpenGL ES - * 2.0, use @ref Magnum::TextureFormat "TextureFormat::SRGB8" in - * OpenGL ES 3.0 instead. + * @requires_es_extension %Extension @es_extension{EXT,sRGB} */ #ifndef MAGNUM_TARGET_GLES SRGB = GL_SRGB, #else SRGB = GL_SRGB_EXT, #endif - #endif #ifndef MAGNUM_TARGET_GLES2 /** @@ -635,22 +629,18 @@ enum class TextureFormat: GLenum { RGBA12 = GL_RGBA12, #endif - #ifndef MAGNUM_TARGET_GLES3 /** * sRGBA, normalized unsigned, size implementation-dependent. * @todo is this allowed in core? * @deprecated_gl Prefer to use the exactly specified version of this * format, i.e. @ref Magnum::TextureFormat "TextureFormat::SRGB8Alpha8". - * @requires_es_extension %Extension @es_extension{EXT,sRGB} in OpenGL ES - * 2.0, use @ref Magnum::TextureFormat "TextureFormat::SRGB8Alpha8" in - * OpenGL ES 3.0 instead. + * @requires_es_extension %Extension @es_extension{EXT,sRGB} */ #ifndef MAGNUM_TARGET_GLES SRGBAlpha = GL_SRGB_ALPHA, #else SRGBAlpha = GL_SRGB_ALPHA_EXT, #endif - #endif #ifndef MAGNUM_TARGET_GLES2 /** @@ -777,19 +767,17 @@ enum class TextureFormat: GLenum { DepthComponent24 = GL_DEPTH_COMPONENT24_OES, #endif - #ifndef MAGNUM_TARGET_GLES3 /** * Depth component, 32bit. * @requires_es_extension %Extension (@es_extension{OES,required_internalformat}, * @es_extension{OES,depth_texture} and @es_extension{OES,depth32}) or * (@es_extension{EXT,texture_storage} and @es_extension{ANGLE,depth_texture}) */ - #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_GLES DepthComponent32 = GL_DEPTH_COMPONENT32, #else DepthComponent32 = GL_DEPTH_COMPONENT32_OES, #endif - #endif #ifndef MAGNUM_TARGET_GLES2 /** From b181cc315729bf2662a0af1c2c8f27e7c8032519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Nov 2013 14:54:06 +0100 Subject: [PATCH 063/105] package: compile in Release mode for Jenkins CI. Might point out various compiler misoptimizations. --- package/ci/jenkins.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/package/ci/jenkins.xml b/package/ci/jenkins.xml index 1c8ab5127..48a62e9f7 100644 --- a/package/ci/jenkins.xml +++ b/package/ci/jenkins.xml @@ -107,6 +107,7 @@ elif [ ${gl} = "es3" ] ; then fi cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_FIND_ROOT_PATH=${JENKINS_HOME}/filesystem/${compiler}-${libraries} \ -DCMAKE_INSTALL_PREFIX=${JENKINS_HOME}/filesystem/${compiler}-${libraries}-${compatibility}-${gl} \ -DCMAKE_CXX_COMPILER=${compiler} \ From 8cad81935dc23e0e3645f994253ceb916498b64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Nov 2013 14:59:23 +0100 Subject: [PATCH 064/105] package: Build other configurations even if the tests don't pass. More convenient for cases when the main compiler misoptimizes something and others do not. --- package/ci/jenkins.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/ci/jenkins.xml b/package/ci/jenkins.xml index 48a62e9f7..53ea46d72 100644 --- a/package/ci/jenkins.xml +++ b/package/ci/jenkins.xml @@ -163,9 +163,9 @@ compiler == "g++" && libraries == "dynamic" && compatibility == "deprecated" && ]]> - SUCCESS - 0 - BLUE + UNSTABLE + 1 + YELLOW true From e088da6c782473b4c5c7fe60b73f6f1f7b569fd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Nov 2013 15:00:23 +0100 Subject: [PATCH 065/105] Fix extension link in the documentation. --- src/Context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Context.h b/src/Context.h index f2aa1903a..dbce34aa8 100644 --- a/src/Context.h +++ b/src/Context.h @@ -168,7 +168,7 @@ class MAGNUM_EXPORT Context { #ifndef MAGNUM_TARGET_GLES /** * Context with robust buffer access - * @requires_extension %Extension @extension{EXT,robustness} + * @requires_extension %Extension @extension{ARB,robustness} * @requires_es_extension %Extension @es_extension{EXT,robustness} * @todo In ES available under glGetIntegerv(CONTEXT_ROBUST_ACCESS_EXT), * how to make it compatible? From af0e097f4190e8b15b94e1cb6a1557d79f254bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Nov 2013 15:00:39 +0100 Subject: [PATCH 066/105] Fix ES2 method name. It's been [0] days since last copypaste bug. --- src/Renderbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Renderbuffer.cpp b/src/Renderbuffer.cpp index c78bcfc5b..b97d860e0 100644 --- a/src/Renderbuffer.cpp +++ b/src/Renderbuffer.cpp @@ -136,7 +136,7 @@ void Renderbuffer::storageMultisampleImplementationANGLE(GLsizei, RenderbufferFo void Renderbuffer::storageMultisampleImplementationNV(GLsizei, RenderbufferFormat, const Vector2i&) { CORRADE_INTERNAL_ASSERT(false); - //glRenderbufferStorageMultisampleANGLE(GL_RENDERBUFFER, samples, internalFormat, size.x(), size.y()); + //glRenderbufferStorageMultisampleNV(GL_RENDERBUFFER, samples, internalFormat, size.x(), size.y()); } #endif From 4c97517ccc84b458975e490e48fb3d1a5154cf45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Nov 2013 15:40:41 +0100 Subject: [PATCH 067/105] doc: try deconfuse the ArchLinux packages section a bit. --- doc/building.dox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/building.dox b/doc/building.dox index 78278816e..ad9110668 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -250,7 +250,7 @@ Integration with various external math and physics libraries is provided by @subsection building-packages-arch ArchLinux packages -In `package/archlinux` directory is currently one PKGBUILD for Git development +In `package/archlinux` directory is currently one package for Git development build. The package is also in AUR under the same name. There are also a few development PKGBUILDs in `package/archlinux`, which allow From 1291626afc4c7b07f2d28f123b625583308967c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Nov 2013 19:30:17 +0100 Subject: [PATCH 068/105] Fixed compilation with Clang's libc++. --- src/Context.h | 1 + src/Platform/Implementation/GlxContextHandler.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Context.h b/src/Context.h index dbce34aa8..7ec706a56 100644 --- a/src/Context.h +++ b/src/Context.h @@ -28,6 +28,7 @@ * @brief Enum Magnum::Version, class Magnum::Context, Magnum::Extension, macro MAGNUM_ASSERT_VERSION_SUPPORTED(), MAGNUM_ASSERT_EXTENSION_SUPPORTED() */ +#include #include #include #include diff --git a/src/Platform/Implementation/GlxContextHandler.cpp b/src/Platform/Implementation/GlxContextHandler.cpp index 22f1a0330..dc80b6c7e 100644 --- a/src/Platform/Implementation/GlxContextHandler.cpp +++ b/src/Platform/Implementation/GlxContextHandler.cpp @@ -24,6 +24,7 @@ #include "GlxContextHandler.h" +#include #include #include From c2ad09706e2bae00581b9942041e0e8c91c4bb03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Nov 2013 19:31:24 +0100 Subject: [PATCH 069/105] Fixed compilation with GCC 4.9. Standards-conforming STL implementation has no implicit default constructor for std::vector, making me write this ugly verbose code. --- src/MeshTools/Test/GenerateFlatNormalsTest.cpp | 2 +- src/Plugins/MagnumFont/MagnumFont.cpp | 2 +- src/Primitives/Capsule.cpp | 8 ++++---- src/Primitives/Circle.cpp | 8 ++++---- src/Primitives/Crosshair.cpp | 8 ++++---- src/Primitives/Cube.cpp | 4 ++-- src/Primitives/Cylinder.cpp | 4 ++-- src/Primitives/Icosphere.cpp | 2 +- src/Primitives/Implementation/WireframeSpheroid.cpp | 2 +- src/Primitives/Line.cpp | 8 ++++---- src/Primitives/Plane.cpp | 6 +++--- src/Primitives/Square.cpp | 6 +++--- src/Primitives/UVSphere.cpp | 4 ++-- src/SceneGraph/Object.hpp | 8 ++++---- src/Text/AbstractFontConverter.cpp | 8 ++++---- src/Text/GlyphCache.cpp | 2 +- src/TextureTools/Atlas.cpp | 2 +- src/TextureTools/Test/AtlasTest.cpp | 2 +- 18 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/MeshTools/Test/GenerateFlatNormalsTest.cpp b/src/MeshTools/Test/GenerateFlatNormalsTest.cpp index fe3080cab..9e3f747d9 100644 --- a/src/MeshTools/Test/GenerateFlatNormalsTest.cpp +++ b/src/MeshTools/Test/GenerateFlatNormalsTest.cpp @@ -50,7 +50,7 @@ void GenerateFlatNormalsTest::wrongIndexCount() { std::vector normals; std::tie(indices, normals) = MeshTools::generateFlatNormals({ 0, 1 - }, {}); + }, std::vector{}); CORRADE_COMPARE(indices.size(), 0); CORRADE_COMPARE(normals.size(), 0); diff --git a/src/Plugins/MagnumFont/MagnumFont.cpp b/src/Plugins/MagnumFont/MagnumFont.cpp index f43ea8b24..9f9542a39 100644 --- a/src/Plugins/MagnumFont/MagnumFont.cpp +++ b/src/Plugins/MagnumFont/MagnumFont.cpp @@ -148,7 +148,7 @@ std::pair MagnumFont::doOpenFile(const std::string& filename, Floa std::pair MagnumFont::openInternal(Utility::Configuration&& conf, Trade::ImageData2D&& image) { /* Everything okay, save the data internally */ - _opened = new Data{std::move(conf), std::move(image), std::unordered_map{}, {}}; + _opened = new Data{std::move(conf), std::move(image), std::unordered_map{}, std::vector{}}; /* Glyph advances */ const std::vector glyphs = _opened->conf.groups("glyph"); diff --git a/src/Primitives/Capsule.cpp b/src/Primitives/Capsule.cpp index 852d23b8c..aec1057bf 100644 --- a/src/Primitives/Capsule.cpp +++ b/src/Primitives/Capsule.cpp @@ -34,7 +34,7 @@ namespace Magnum { namespace Primitives { Trade::MeshData2D Capsule2D::wireframe(UnsignedInt hemisphereRings, UnsignedInt cylinderRings, Float halfLength) { - CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1, "Capsule must have at least one hemisphere ring, one cylinder ring and three segments", Trade::MeshData2D(Mesh::Primitive::Lines, {}, {}, {})); + CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1, "Capsule must have at least one hemisphere ring, one cylinder ring and three segments", Trade::MeshData2D(Mesh::Primitive::Lines, std::vector{}, std::vector>{}, std::vector>{})); std::vector positions; positions.reserve(hemisphereRings*4+2+(cylinderRings-1)*2); @@ -85,11 +85,11 @@ Trade::MeshData2D Capsule2D::wireframe(UnsignedInt hemisphereRings, UnsignedInt {UnsignedInt(positions.size())-3, UnsignedInt(positions.size())-1, UnsignedInt(positions.size())-2, UnsignedInt(positions.size())-1}); - return Trade::MeshData2D(Mesh::Primitive::Lines, std::move(indices), {std::move(positions)}, {}); + return Trade::MeshData2D(Mesh::Primitive::Lines, std::move(indices), {std::move(positions)}, std::vector>{}); } Trade::MeshData3D Capsule3D::solid(UnsignedInt hemisphereRings, UnsignedInt cylinderRings, UnsignedInt segments, Float halfLength, TextureCoords textureCoords) { - CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1 && segments >= 3, "Capsule must have at least one hemisphere ring, one cylinder ring and three segments", Trade::MeshData3D(Mesh::Primitive::Triangles, {}, {}, {}, {})); + CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1 && segments >= 3, "Capsule must have at least one hemisphere ring, one cylinder ring and three segments", Trade::MeshData3D(Mesh::Primitive::Triangles, std::vector{}, std::vector>{}, std::vector>{}, std::vector>{})); Implementation::Spheroid capsule(segments, textureCoords == TextureCoords::Generate ? Implementation::Spheroid::TextureCoords::Generate : @@ -123,7 +123,7 @@ Trade::MeshData3D Capsule3D::solid(UnsignedInt hemisphereRings, UnsignedInt cyli } Trade::MeshData3D Capsule3D::wireframe(const UnsignedInt hemisphereRings, const UnsignedInt cylinderRings, const UnsignedInt segments, const Float halfLength) { - CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1 && segments >= 4 && segments%4 == 0, "Primitives::Capsule::wireframe(): improper parameters", Trade::MeshData3D(Mesh::Primitive::Lines, {}, {}, {}, {})); + CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1 && segments >= 4 && segments%4 == 0, "Primitives::Capsule::wireframe(): improper parameters", Trade::MeshData3D(Mesh::Primitive::Lines, std::vector{}, std::vector>{}, std::vector>{}, std::vector>{})); Implementation::WireframeSpheroid capsule(segments/4); diff --git a/src/Primitives/Circle.cpp b/src/Primitives/Circle.cpp index e6b019410..ac2d06e48 100644 --- a/src/Primitives/Circle.cpp +++ b/src/Primitives/Circle.cpp @@ -32,7 +32,7 @@ namespace Magnum { namespace Primitives { Trade::MeshData2D Circle::solid(UnsignedInt segments) { CORRADE_ASSERT(segments >= 3, "Primitives::Circle::solid(): segments must be >= 3", - Trade::MeshData2D(Mesh::Primitive::TriangleFan, {}, {}, {})); + Trade::MeshData2D(Mesh::Primitive::TriangleFan, std::vector{}, std::vector>{}, std::vector>{})); std::vector positions; positions.reserve(segments+1); @@ -47,12 +47,12 @@ Trade::MeshData2D Circle::solid(UnsignedInt segments) { positions.emplace_back(Math::cos(angle), Math::sin(angle)); } - return Trade::MeshData2D(Mesh::Primitive::TriangleFan, {}, {std::move(positions)}, {}); + return Trade::MeshData2D(Mesh::Primitive::TriangleFan, std::vector{}, {std::move(positions)}, std::vector>{}); } Trade::MeshData2D Circle::wireframe(UnsignedInt segments) { CORRADE_ASSERT(segments >= 3, "Primitives::Circle::wireframe(): segments must be >= 3", - Trade::MeshData2D(Mesh::Primitive::LineLoop, {}, {}, {})); + Trade::MeshData2D(Mesh::Primitive::LineLoop, std::vector{}, std::vector>{}, std::vector>{})); std::vector positions; positions.reserve(segments); @@ -64,7 +64,7 @@ Trade::MeshData2D Circle::wireframe(UnsignedInt segments) { positions.emplace_back(Math::cos(angle), Math::sin(angle)); } - return Trade::MeshData2D(Mesh::Primitive::LineLoop, {}, {std::move(positions)}, {}); + return Trade::MeshData2D(Mesh::Primitive::LineLoop, std::vector{}, {std::move(positions)}, std::vector>{}); } }} diff --git a/src/Primitives/Crosshair.cpp b/src/Primitives/Crosshair.cpp index a03aa2292..396cf24fa 100644 --- a/src/Primitives/Crosshair.cpp +++ b/src/Primitives/Crosshair.cpp @@ -31,18 +31,18 @@ namespace Magnum { namespace Primitives { Trade::MeshData2D Crosshair2D::wireframe() { - return Trade::MeshData2D(Mesh::Primitive::Lines, {}, {{ + return Trade::MeshData2D(Mesh::Primitive::Lines, std::vector{}, {{ {-1.0f, 0.0f}, {1.0f, 0.0f}, { 0.0f, -1.0f}, {0.0f, 1.0f} - }}, {}); + }}, std::vector>{}); } Trade::MeshData3D Crosshair3D::wireframe() { - return Trade::MeshData3D(Mesh::Primitive::Lines, {}, {{ + return Trade::MeshData3D(Mesh::Primitive::Lines, std::vector{}, {{ {-1.0f, 0.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, { 0.0f, -1.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, { 0.0f, 0.0f, -1.0f}, {0.0f, 0.0f, 1.0f} - }}, {}, {}); + }}, std::vector>{}, std::vector>{}); } }} diff --git a/src/Primitives/Cube.cpp b/src/Primitives/Cube.cpp index 084a2e9b2..6809b723b 100644 --- a/src/Primitives/Cube.cpp +++ b/src/Primitives/Cube.cpp @@ -97,7 +97,7 @@ Trade::MeshData3D Cube::solid() { {-1.0f, 0.0f, 0.0f}, {-1.0f, 0.0f, 0.0f}, /* -X */ {-1.0f, 0.0f, 0.0f} - }}, {}); + }}, std::vector>{}); } Trade::MeshData3D Cube::wireframe() { @@ -116,7 +116,7 @@ Trade::MeshData3D Cube::wireframe() { { 1.0f, -1.0f, -1.0f}, { 1.0f, 1.0f, -1.0f}, {-1.0f, 1.0f, -1.0f} - }}, {}, {}); + }}, std::vector>{}, std::vector>{}); } }} diff --git a/src/Primitives/Cylinder.cpp b/src/Primitives/Cylinder.cpp index da6b28b81..4f02a8d6d 100644 --- a/src/Primitives/Cylinder.cpp +++ b/src/Primitives/Cylinder.cpp @@ -32,7 +32,7 @@ namespace Magnum { namespace Primitives { Trade::MeshData3D Cylinder::solid(const UnsignedInt rings, const UnsignedInt segments, const Float halfLength, const Flags flags) { - CORRADE_ASSERT(rings >= 1 && segments >= 3, "Primitives::Cylinder::solid(): cylinder must have at least one ring and three segments", Trade::MeshData3D(Mesh::Primitive::Triangles, {}, {}, {}, {})); + CORRADE_ASSERT(rings >= 1 && segments >= 3, "Primitives::Cylinder::solid(): cylinder must have at least one ring and three segments", Trade::MeshData3D(Mesh::Primitive::Triangles, std::vector{}, std::vector>{}, std::vector>{}, std::vector>{})); Implementation::Spheroid cylinder(segments, flags & Flag::GenerateTextureCoords ? Implementation::Spheroid::TextureCoords::Generate : Implementation::Spheroid::TextureCoords::DontGenerate); @@ -63,7 +63,7 @@ Trade::MeshData3D Cylinder::solid(const UnsignedInt rings, const UnsignedInt seg } Trade::MeshData3D Cylinder::wireframe(const UnsignedInt rings, const UnsignedInt segments, const Float halfLength) { - CORRADE_ASSERT(rings >= 1 && segments >= 4 && segments%4 == 0, "Primitives::Cylinder::wireframe(): improper parameters", Trade::MeshData3D(Mesh::Primitive::Lines, {}, {}, {}, {})); + CORRADE_ASSERT(rings >= 1 && segments >= 4 && segments%4 == 0, "Primitives::Cylinder::wireframe(): improper parameters", Trade::MeshData3D(Mesh::Primitive::Lines, std::vector{}, std::vector>{}, std::vector>{}, std::vector>{})); Implementation::WireframeSpheroid cylinder(segments/4); diff --git a/src/Primitives/Icosphere.cpp b/src/Primitives/Icosphere.cpp index 452e38eb3..3ec685aa3 100644 --- a/src/Primitives/Icosphere.cpp +++ b/src/Primitives/Icosphere.cpp @@ -78,7 +78,7 @@ Trade::MeshData3D Icosphere::solid(const UnsignedInt subdivisions) { MeshTools::removeDuplicates(indices, positions); std::vector normals(positions); - return Trade::MeshData3D(Mesh::Primitive::Triangles, std::move(indices), {std::move(positions)}, {std::move(normals)}, {}); + return Trade::MeshData3D(Mesh::Primitive::Triangles, std::move(indices), {std::move(positions)}, {std::move(normals)}, std::vector>{}); } }} diff --git a/src/Primitives/Implementation/WireframeSpheroid.cpp b/src/Primitives/Implementation/WireframeSpheroid.cpp index 67bbaeed4..a53d7f371 100644 --- a/src/Primitives/Implementation/WireframeSpheroid.cpp +++ b/src/Primitives/Implementation/WireframeSpheroid.cpp @@ -109,7 +109,7 @@ void WireframeSpheroid::cylinder() { } Trade::MeshData3D WireframeSpheroid::finalize() { - return Trade::MeshData3D(Mesh::Primitive::Lines, std::move(_indices), {std::move(_positions)}, {}, {}); + return Trade::MeshData3D(Mesh::Primitive::Lines, std::move(_indices), {std::move(_positions)}, std::vector>{}, std::vector>{}); } }}} diff --git a/src/Primitives/Line.cpp b/src/Primitives/Line.cpp index fc0da8207..016f6d082 100644 --- a/src/Primitives/Line.cpp +++ b/src/Primitives/Line.cpp @@ -31,15 +31,15 @@ namespace Magnum { namespace Primitives { Trade::MeshData2D Line2D::wireframe() { - return Trade::MeshData2D(Mesh::Primitive::Lines, {}, {{ + return Trade::MeshData2D(Mesh::Primitive::Lines, std::vector{}, {{ {0.0f, 0.0f}, {1.0f, 0.0f} - }}, {}); + }}, std::vector>{}); } Trade::MeshData3D Line3D::wireframe() { - return Trade::MeshData3D(Mesh::Primitive::Lines, {}, {{ + return Trade::MeshData3D(Mesh::Primitive::Lines, std::vector{}, {{ {0.0f, 0.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, - }}, {}, {}); + }}, std::vector>{}, std::vector>{}); } }} diff --git a/src/Primitives/Plane.cpp b/src/Primitives/Plane.cpp index dc889f75d..a454ef645 100644 --- a/src/Primitives/Plane.cpp +++ b/src/Primitives/Plane.cpp @@ -38,7 +38,7 @@ Trade::MeshData3D Plane::solid(const TextureCoords textureCoords) { {0.0f, 1.0f} }); - return Trade::MeshData3D(Mesh::Primitive::TriangleStrip, {}, {{ + return Trade::MeshData3D(Mesh::Primitive::TriangleStrip, std::vector{}, {{ {1.0f, -1.0f, 0.0f}, {1.0f, 1.0f, 0.0f}, {-1.0f, -1.0f, 0.0f}, @@ -52,12 +52,12 @@ Trade::MeshData3D Plane::solid(const TextureCoords textureCoords) { } Trade::MeshData3D Plane::wireframe() { - return Trade::MeshData3D(Mesh::Primitive::LineLoop, {}, {{ + return Trade::MeshData3D(Mesh::Primitive::LineLoop, std::vector{}, {{ {-1.0f, -1.0f, 0.0f}, {1.0f, -1.0f, 0.0f}, {1.0f, 1.0f, 0.0f}, {-1.0f, 1.0f, 0.0f} - }}, {}, {}); + }}, std::vector>{}, std::vector>{}); } }} diff --git a/src/Primitives/Square.cpp b/src/Primitives/Square.cpp index 8f86b1dd3..93e72b198 100644 --- a/src/Primitives/Square.cpp +++ b/src/Primitives/Square.cpp @@ -38,7 +38,7 @@ Trade::MeshData2D Square::solid(const TextureCoords textureCoords) { {0.0f, 1.0f} }); - return Trade::MeshData2D(Mesh::Primitive::TriangleStrip, {}, {{ + return Trade::MeshData2D(Mesh::Primitive::TriangleStrip, std::vector{}, {{ {1.0f, -1.0f}, {1.0f, 1.0f}, {-1.0f, -1.0f}, @@ -47,12 +47,12 @@ Trade::MeshData2D Square::solid(const TextureCoords textureCoords) { } Trade::MeshData2D Square::wireframe() { - return Trade::MeshData2D(Mesh::Primitive::LineLoop, {}, {{ + return Trade::MeshData2D(Mesh::Primitive::LineLoop, std::vector{}, {{ {-1.0f, -1.0f}, {1.0f, -1.0f}, {1.0f, 1.0f}, {-1.0f, 1.0f} - }}, {}); + }}, std::vector>{}); } }} diff --git a/src/Primitives/UVSphere.cpp b/src/Primitives/UVSphere.cpp index 75e67ba5e..dd0c23972 100644 --- a/src/Primitives/UVSphere.cpp +++ b/src/Primitives/UVSphere.cpp @@ -32,7 +32,7 @@ namespace Magnum { namespace Primitives { Trade::MeshData3D UVSphere::solid(UnsignedInt rings, UnsignedInt segments, TextureCoords textureCoords) { - CORRADE_ASSERT(rings >= 2 && segments >= 3, "UVSphere must have at least two rings and three segments", Trade::MeshData3D(Mesh::Primitive::Triangles, {}, {}, {}, {})); + CORRADE_ASSERT(rings >= 2 && segments >= 3, "UVSphere must have at least two rings and three segments", Trade::MeshData3D(Mesh::Primitive::Triangles, std::vector{}, std::vector>{}, std::vector>{}, std::vector>{})); Implementation::Spheroid sphere(segments, textureCoords == TextureCoords::Generate ? Implementation::Spheroid::TextureCoords::Generate : @@ -59,7 +59,7 @@ Trade::MeshData3D UVSphere::solid(UnsignedInt rings, UnsignedInt segments, Textu } Trade::MeshData3D UVSphere::wireframe(const UnsignedInt rings, const UnsignedInt segments) { - CORRADE_ASSERT(rings >= 2 && rings%2 == 0 && segments >= 4 && segments%2 == 0, "Primitives::UVSphere::wireframe(): improper parameters", Trade::MeshData3D(Mesh::Primitive::Lines, {}, {}, {}, {})); + CORRADE_ASSERT(rings >= 2 && rings%2 == 0 && segments >= 4 && segments%2 == 0, "Primitives::UVSphere::wireframe(): improper parameters", Trade::MeshData3D(Mesh::Primitive::Lines, std::vector{}, std::vector>{}, std::vector>{}, std::vector>{})); Implementation::WireframeSpheroid sphere(segments/4); diff --git a/src/SceneGraph/Object.hpp b/src/SceneGraph/Object.hpp index f30ae68ed..a234549dc 100644 --- a/src/SceneGraph/Object.hpp +++ b/src/SceneGraph/Object.hpp @@ -194,7 +194,7 @@ computed and recursively concatenated together. Resulting transformations for joints which were originally in `object` list is then returned. */ template std::vector Object::transformations(std::vector*> objects, const typename Transformation::DataType& initialTransformation) const { - CORRADE_ASSERT(objects.size() < 0xFFFFu, "SceneGraph::Object::transformations(): too large scene", {}); + CORRADE_ASSERT(objects.size() < 0xFFFFu, "SceneGraph::Object::transformations(): too large scene", std::vector{}); /* Remember object count for later */ std::size_t objectCount = objects.size(); @@ -217,7 +217,7 @@ template std::vector Ob const Scene* scene = this->scene(); /* Nearest common ancestor not yet implemented - assert this is done on scene */ - CORRADE_ASSERT(scene == this, "SceneGraph::Object::transformationMatrices(): currently implemented only for Scene", {}); + CORRADE_ASSERT(scene == this, "SceneGraph::Object::transformationMatrices(): currently implemented only for Scene", std::vector{}); /* Mark all objects up the hierarchy as visited */ auto it = objects.begin(); @@ -235,7 +235,7 @@ template std::vector Ob /* If this is root object, remove from list */ if(!parent) { - CORRADE_ASSERT(*it == scene, "SceneGraph::Object::transformations(): the objects are not part of the same tree", {}); + CORRADE_ASSERT(*it == scene, "SceneGraph::Object::transformations(): the objects are not part of the same tree", std::vector{}); it = objects.erase(it); /* Parent is an joint or already visited - remove current from list */ @@ -246,7 +246,7 @@ template std::vector Ob list of joint objects */ if(!(parent->flags & Flag::Joint)) { CORRADE_ASSERT(jointObjects.size() < 0xFFFFu, - "SceneGraph::Object::transformations(): too large scene", {}); + "SceneGraph::Object::transformations(): too large scene", std::vector{}); CORRADE_INTERNAL_ASSERT(parent->counter == 0xFFFFu); parent->counter = jointObjects.size(); parent->flags |= Flag::Joint; diff --git a/src/Text/AbstractFontConverter.cpp b/src/Text/AbstractFontConverter.cpp index 055a15eb2..e754e00ff 100644 --- a/src/Text/AbstractFontConverter.cpp +++ b/src/Text/AbstractFontConverter.cpp @@ -40,7 +40,7 @@ AbstractFontConverter::AbstractFontConverter(PluginManager::AbstractManager* man std::vector>> AbstractFontConverter::exportFontToData(AbstractFont& font, GlyphCache& cache, const std::string& filename, const std::string& characters) const { CORRADE_ASSERT(features() >= (Feature::ExportFont|Feature::ConvertData), - "Text::AbstractFontConverter::exportFontToData(): feature not supported", {}); + "Text::AbstractFontConverter::exportFontToData(): feature not supported", (std::vector>>{})); return doExportFontToData(font, cache, filename, uniqueUnicode(characters)); } @@ -52,7 +52,7 @@ std::vector>> AbstractFo #endif { CORRADE_ASSERT(!(features() & Feature::MultiFile), - "Text::AbstractFontConverter::exportFontToData(): feature advertised but not implemented", {}); + "Text::AbstractFontConverter::exportFontToData(): feature advertised but not implemented", (std::vector>>{})); std::vector>> out; out.emplace_back(filename, std::move(doExportFontToSingleData(font, cache, characters))); @@ -113,14 +113,14 @@ bool AbstractFontConverter::doExportFontToFile(AbstractFont& font, GlyphCache& c std::vector>> AbstractFontConverter::exportGlyphCacheToData(GlyphCache& cache, const std::string& filename) const { CORRADE_ASSERT(features() >= (Feature::ExportGlyphCache|Feature::ConvertData), - "Text::AbstractFontConverter::exportGlyphCacheToData(): feature not supported", {}); + "Text::AbstractFontConverter::exportGlyphCacheToData(): feature not supported", (std::vector>>{})); return doExportGlyphCacheToData(cache, filename); } std::vector>> AbstractFontConverter::doExportGlyphCacheToData(GlyphCache& cache, const std::string& filename) const { CORRADE_ASSERT(!(features() & Feature::MultiFile), - "Text::AbstractFontConverter::exportGlyphCacheToData(): feature advertised but not implemented", {}); + "Text::AbstractFontConverter::exportGlyphCacheToData(): feature advertised but not implemented", (std::vector>>{})); std::vector>> out; out.emplace_back(filename, std::move(doExportGlyphCacheToSingleData(cache))); diff --git a/src/Text/GlyphCache.cpp b/src/Text/GlyphCache.cpp index 2202c5930..d9700a1a8 100644 --- a/src/Text/GlyphCache.cpp +++ b/src/Text/GlyphCache.cpp @@ -80,7 +80,7 @@ void GlyphCache::initialize(const TextureFormat internalFormat, const Vector2i& std::vector GlyphCache::reserve(const std::vector& sizes) { CORRADE_ASSERT((glyphs.size() == 1 && glyphs.at(0) == std::pair()), - "Text::GlyphCache::reserve(): reserving space in non-empty cache is not yet implemented", {}); + "Text::GlyphCache::reserve(): reserving space in non-empty cache is not yet implemented", std::vector{}); glyphs.reserve(glyphs.size() + sizes.size()); return TextureTools::atlas(_size, sizes, _padding); } diff --git a/src/TextureTools/Atlas.cpp b/src/TextureTools/Atlas.cpp index 08398437c..89f17dbc5 100644 --- a/src/TextureTools/Atlas.cpp +++ b/src/TextureTools/Atlas.cpp @@ -30,7 +30,7 @@ namespace Magnum { namespace TextureTools { std::vector atlas(const Vector2i& atlasSize, const std::vector& sizes, const Vector2i& padding) { - if(sizes.empty()) return {}; + if(sizes.empty()) return std::vector{}; /* Size of largest texture */ Vector2i maxSize; diff --git a/src/TextureTools/Test/AtlasTest.cpp b/src/TextureTools/Test/AtlasTest.cpp index 4bbb21ddd..178a57803 100644 --- a/src/TextureTools/Test/AtlasTest.cpp +++ b/src/TextureTools/Test/AtlasTest.cpp @@ -76,7 +76,7 @@ void AtlasTest::createPadding() { } void AtlasTest::createEmpty() { - std::vector atlas = TextureTools::atlas({}, {}); + std::vector atlas = TextureTools::atlas({}, std::vector{}); CORRADE_VERIFY(atlas.empty()); } From 377d575bef0af357aa560244314bfadaf164c1a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Nov 2013 19:32:06 +0100 Subject: [PATCH 070/105] package: added Clang/libc++ and GCC 4.9 development PKGBUILDs. --- package/archlinux/PKGBUILD-clang-libc++ | 56 +++++++++++++++++++++++++ package/archlinux/PKGBUILD-gcc49 | 54 ++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 package/archlinux/PKGBUILD-clang-libc++ create mode 100644 package/archlinux/PKGBUILD-gcc49 diff --git a/package/archlinux/PKGBUILD-clang-libc++ b/package/archlinux/PKGBUILD-clang-libc++ new file mode 100644 index 000000000..4d2eed5d0 --- /dev/null +++ b/package/archlinux/PKGBUILD-clang-libc++ @@ -0,0 +1,56 @@ +# Author: mosra +pkgname=magnum +pkgver=dev.clang.libc++ +pkgrel=1 +pkgdesc="C++11 and OpenGL 2D/3D graphics engine (built with clang and libc++)" +arch=('i686' 'x86_64') +url="https://github.com/mosra/magnum" +license=('MIT') +depends=('corrade' 'openal' 'freeglut' 'sdl2' 'libc++') +makedepends=('cmake' 'clang' 'ninja') +options=(!strip) +provides=('magnum-git') + +build() { + if [ ! -d "$startdir/build-clang-libc++" ] ; then + mkdir "$startdir/build-clang-libc++" + cd "$startdir/build-clang-libc++" + + cmake .. \ + -DCMAKE_CXX_COMPILER=clang++ \ + -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++" \ + -DCMAKE_EXE_LINKER_FLAGS=-lc++abi \ + -G Ninja + fi + + cd "$startdir/build-clang-libc++" + + cmake .. \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DWITH_AUDIO=ON \ + -DWITH_GLUTAPPLICATION=ON \ + -DWITH_GLXAPPLICATION=ON \ + -DWITH_SDL2APPLICATION=ON \ + -DWITH_MAGNUMFONT=ON \ + -DWITH_MAGNUMFONTCONVERTER=ON \ + -DWITH_TGAIMAGECONVERTER=ON \ + -DWITH_TGAIMPORTER=ON \ + -DWITH_WAVAUDIOIMPORTER=ON \ + -DWITH_DISTANCEFIELDCONVERTER=ON \ + -DWITH_FONTCONVERTER=ON \ + -DWITH_MAGNUMINFO=ON \ + -DBUILD_TESTS=ON \ + -DBUILD_GL_TESTS=ON + ninja +} + +check() { + cd "$startdir/build-clang-libc++" + ctest --output-on-failure +} + +package() { + cd "$startdir/build-clang-libc++" + DESTDIR="$pkgdir/" ninja install +} diff --git a/package/archlinux/PKGBUILD-gcc49 b/package/archlinux/PKGBUILD-gcc49 new file mode 100644 index 000000000..9880f0fdf --- /dev/null +++ b/package/archlinux/PKGBUILD-gcc49 @@ -0,0 +1,54 @@ +# Author: mosra +pkgname=magnum +pkgver=dev.gcc49 +pkgrel=1 +pkgdesc="C++11 and OpenGL 2D/3D graphics engine (built with GCC 4.9)" +arch=('i686' 'x86_64') +url="https://github.com/mosra/magnum" +license=('MIT') +depends=('corrade' 'openal' 'freeglut' 'sdl2') +makedepends=('cmake' 'ninja' 'gcc-git') +options=(!strip) +provides=('magnum-git') + +build() { + if [ ! -d "$startdir/build-gcc49" ] ; then + mkdir "$startdir/build-gcc49" + cd "$startdir/build-gcc49" + + cmake .. \ + -DCMAKE_CXX_COMPILER=g++-4.9 \ + -G Ninja + fi + + cd "$startdir/build-gcc49" + + cmake .. \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DWITH_AUDIO=ON \ + -DWITH_GLUTAPPLICATION=ON \ + -DWITH_GLXAPPLICATION=ON \ + -DWITH_SDL2APPLICATION=ON \ + -DWITH_MAGNUMFONT=ON \ + -DWITH_MAGNUMFONTCONVERTER=ON \ + -DWITH_TGAIMAGECONVERTER=ON \ + -DWITH_TGAIMPORTER=ON \ + -DWITH_WAVAUDIOIMPORTER=ON \ + -DWITH_DISTANCEFIELDCONVERTER=ON \ + -DWITH_FONTCONVERTER=ON \ + -DWITH_MAGNUMINFO=ON \ + -DBUILD_TESTS=ON \ + -DBUILD_GL_TESTS=ON + ninja +} + +check() { + cd "$startdir/build-gcc49" + ctest --output-on-failure +} + +package() { + cd "$startdir/build-gcc49" + DESTDIR="$pkgdir/" ninja install +} From a9361b2b8d6c276281790cc85bc9fcad2aee276c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Nov 2013 19:39:34 +0100 Subject: [PATCH 071/105] package: add Clang/libc++ combination to Jenkins CI configuration. Hello, shell? I hate you. --- package/ci/jenkins.xml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/package/ci/jenkins.xml b/package/ci/jenkins.xml index 53ea46d72..963b019ae 100644 --- a/package/ci/jenkins.xml +++ b/package/ci/jenkins.xml @@ -46,6 +46,7 @@ g++-4.7 g++-4.6 clang++ + clang++-libc++ @@ -76,8 +77,12 @@ Date: Wed, 27 Nov 2013 20:24:53 +0100 Subject: [PATCH 072/105] package: adapt GLTests Jenkins configuration to previous change. --- package/ci/jenkins-gltests.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/package/ci/jenkins-gltests.xml b/package/ci/jenkins-gltests.xml index 63cc38a58..aca573b46 100644 --- a/package/ci/jenkins-gltests.xml +++ b/package/ci/jenkins-gltests.xml @@ -26,6 +26,7 @@ g++-4.7 g++-4.6 clang++ + clang++-libc++ From d47f8ebdf335655356bbc0903ca2c04f18acd9c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Nov 2013 20:25:35 +0100 Subject: [PATCH 073/105] package: add Git configuration also to GLTests Jenkins configuration. So we have nice changelogs from build to build. We now need to run the tests sequentially, because the building instances would try to access the git repository all at once. --- package/ci/jenkins-gltests.xml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/package/ci/jenkins-gltests.xml b/package/ci/jenkins-gltests.xml index aca573b46..9c17e3bc1 100644 --- a/package/ci/jenkins-gltests.xml +++ b/package/ci/jenkins-gltests.xml @@ -10,7 +10,27 @@ false - + + 2 + + + git://github.com/mosra/magnum.git + + + + + */master + + + false + + + + true + + + + true false false @@ -74,7 +94,7 @@ ctest --output-on-failure -R GLTest || true - false + true Date: Wed, 27 Nov 2013 20:27:05 +0100 Subject: [PATCH 074/105] package: Fail GLTests Jenkins job if the build fails. --- package/ci/jenkins-gltests.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/ci/jenkins-gltests.xml b/package/ci/jenkins-gltests.xml index 9c17e3bc1..581872d5e 100644 --- a/package/ci/jenkins-gltests.xml +++ b/package/ci/jenkins-gltests.xml @@ -79,6 +79,8 @@ From 28e0361984ab6f30ebb899d96c9a694a883ca008 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Nov 2013 23:36:47 +0100 Subject: [PATCH 075/105] package: set RPATH to install dir so the proper dependencies are used. --- package/ci/jenkins.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/package/ci/jenkins.xml b/package/ci/jenkins.xml index 963b019ae..05ed62e86 100644 --- a/package/ci/jenkins.xml +++ b/package/ci/jenkins.xml @@ -118,6 +118,7 @@ cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_FIND_ROOT_PATH=${JENKINS_HOME}/filesystem/${compiler}-${libraries} \ -DCMAKE_INSTALL_PREFIX=${JENKINS_HOME}/filesystem/${compiler}-${libraries}-${compatibility}-${gl} \ + -DCMAKE_INSTALL_RPATH="${JENKINS_HOME}/filesystem/${compiler}-${libraries}/lib;${JENKINS_HOME}/filesystem/${compiler}-${libraries}-${compatibility}-${gl}/lib" \ -DCMAKE_CXX_COMPILER=${compiler_binary} \ "${compiler_flags[@]}" \ -DBUILD_TESTS=ON \ From ad85e73d7e09a2f0889d8b10ba5eda209447cf56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Nov 2013 23:37:30 +0100 Subject: [PATCH 076/105] external: install gl2ext.h also for ES3. Again, didn't bother with testing. --- external/OpenGL/CMakeLists.txt | 5 ++--- external/OpenGL/GLES2/CMakeLists.txt | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/external/OpenGL/CMakeLists.txt b/external/OpenGL/CMakeLists.txt index 9a8a35ef7..2ce01e6a4 100644 --- a/external/OpenGL/CMakeLists.txt +++ b/external/OpenGL/CMakeLists.txt @@ -26,9 +26,8 @@ if(NOT TARGET_GLES) add_subdirectory(GL) else() add_subdirectory(KHR) - if(TARGET_GLES2) - add_subdirectory(GLES2) - else() + add_subdirectory(GLES2) + if(NOT TARGET_GLES2) add_subdirectory(GLES3) endif() endif() diff --git a/external/OpenGL/GLES2/CMakeLists.txt b/external/OpenGL/GLES2/CMakeLists.txt index 59c230f13..2a1a501ca 100644 --- a/external/OpenGL/GLES2/CMakeLists.txt +++ b/external/OpenGL/GLES2/CMakeLists.txt @@ -25,8 +25,9 @@ set(MagnumOpenGL_HEADERS gl2ext.h) -# NaCl has its own gl2.h, this one causes linker issues -if(NOT CORRADE_TARGET_NACL) +# We need gl2ext.h also for ES3 (but not the others). NaCl has its own gl2.h, +# this one causes linker issues +if(TARGET_GLES2 AND NOT CORRADE_TARGET_NACL) set(MagnumOpenGL_HEADERS ${MagnumOpenGL_HEADERS} gl2platform.h gl2.h) From 0611f5856997c0aa3f1464d9a3c28a5da6f3d256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Nov 2013 23:42:51 +0100 Subject: [PATCH 077/105] Shaders: fix tests in static build. --- src/Shaders/Test/DistanceFieldVectorGLTest.cpp | 4 ++++ src/Shaders/Test/FlatGLTest.cpp | 4 ++++ src/Shaders/Test/MeshVisualizerGLTest.cpp | 4 ++++ src/Shaders/Test/PhongGLTest.cpp | 4 ++++ src/Shaders/Test/VectorGLTest.cpp | 4 ++++ src/Shaders/Test/VertexColorGLTest.cpp | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/src/Shaders/Test/DistanceFieldVectorGLTest.cpp b/src/Shaders/Test/DistanceFieldVectorGLTest.cpp index 0e6bc2598..6616f2fab 100644 --- a/src/Shaders/Test/DistanceFieldVectorGLTest.cpp +++ b/src/Shaders/Test/DistanceFieldVectorGLTest.cpp @@ -25,6 +25,10 @@ #include "Shaders/DistanceFieldVector.h" #include "Test/AbstractOpenGLTester.h" +#ifdef MAGNUM_BUILD_STATIC +#include "Shaders/magnumShadersResourceImport.hpp" +#endif + namespace Magnum { namespace Shaders { namespace Test { class DistanceFieldVectorGLTest: public Magnum::Test::AbstractOpenGLTester { diff --git a/src/Shaders/Test/FlatGLTest.cpp b/src/Shaders/Test/FlatGLTest.cpp index 08be1e375..f0a47d5e2 100644 --- a/src/Shaders/Test/FlatGLTest.cpp +++ b/src/Shaders/Test/FlatGLTest.cpp @@ -25,6 +25,10 @@ #include "Shaders/Flat.h" #include "Test/AbstractOpenGLTester.h" +#ifdef MAGNUM_BUILD_STATIC +#include "Shaders/magnumShadersResourceImport.hpp" +#endif + namespace Magnum { namespace Shaders { namespace Test { class FlatGLTest: public Magnum::Test::AbstractOpenGLTester { diff --git a/src/Shaders/Test/MeshVisualizerGLTest.cpp b/src/Shaders/Test/MeshVisualizerGLTest.cpp index 1b7b12c42..1a28c3a57 100644 --- a/src/Shaders/Test/MeshVisualizerGLTest.cpp +++ b/src/Shaders/Test/MeshVisualizerGLTest.cpp @@ -27,6 +27,10 @@ #include "Shaders/MeshVisualizer.h" #include "Test/AbstractOpenGLTester.h" +#ifdef MAGNUM_BUILD_STATIC +#include "Shaders/magnumShadersResourceImport.hpp" +#endif + namespace Magnum { namespace Shaders { namespace Test { class MeshVisualizerGLTest: public Magnum::Test::AbstractOpenGLTester { diff --git a/src/Shaders/Test/PhongGLTest.cpp b/src/Shaders/Test/PhongGLTest.cpp index 5e6f79fa5..87c1ffbca 100644 --- a/src/Shaders/Test/PhongGLTest.cpp +++ b/src/Shaders/Test/PhongGLTest.cpp @@ -25,6 +25,10 @@ #include "Shaders/Phong.h" #include "Test/AbstractOpenGLTester.h" +#ifdef MAGNUM_BUILD_STATIC +#include "Shaders/magnumShadersResourceImport.hpp" +#endif + namespace Magnum { namespace Shaders { namespace Test { class PhongGLTest: public Magnum::Test::AbstractOpenGLTester { diff --git a/src/Shaders/Test/VectorGLTest.cpp b/src/Shaders/Test/VectorGLTest.cpp index ed187caab..c69d706de 100644 --- a/src/Shaders/Test/VectorGLTest.cpp +++ b/src/Shaders/Test/VectorGLTest.cpp @@ -25,6 +25,10 @@ #include "Shaders/Vector.h" #include "Test/AbstractOpenGLTester.h" +#ifdef MAGNUM_BUILD_STATIC +#include "Shaders/magnumShadersResourceImport.hpp" +#endif + namespace Magnum { namespace Shaders { namespace Test { class VectorGLTest: public Magnum::Test::AbstractOpenGLTester { diff --git a/src/Shaders/Test/VertexColorGLTest.cpp b/src/Shaders/Test/VertexColorGLTest.cpp index e0e381d4f..971fd555a 100644 --- a/src/Shaders/Test/VertexColorGLTest.cpp +++ b/src/Shaders/Test/VertexColorGLTest.cpp @@ -25,6 +25,10 @@ #include "Shaders/VertexColor.h" #include "Test/AbstractOpenGLTester.h" +#ifdef MAGNUM_BUILD_STATIC +#include "Shaders/magnumShadersResourceImport.hpp" +#endif + namespace Magnum { namespace Shaders { namespace Test { class VertexColorGLTest: public Magnum::Test::AbstractOpenGLTester { From 714c243dd6bbb519e0b7dc1321b3305874255248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 28 Nov 2013 20:22:06 +0100 Subject: [PATCH 078/105] Math: added generic Range class. Will replace Geometry::Rectangle. --- src/Magnum.h | 39 ++++ src/Math/CMakeLists.txt | 1 + src/Math/Math.h | 10 +- src/Math/Range.h | 425 +++++++++++++++++++++++++++++++++++ src/Math/Test/CMakeLists.txt | 1 + src/Math/Test/RangeTest.cpp | 311 +++++++++++++++++++++++++ src/Math/instantiation.cpp | 10 + 7 files changed, 796 insertions(+), 1 deletion(-) create mode 100644 src/Math/Range.h create mode 100644 src/Math/Test/RangeTest.cpp diff --git a/src/Magnum.h b/src/Magnum.h index 0b38b8e8f..59f9b1773 100644 --- a/src/Magnum.h +++ b/src/Magnum.h @@ -301,6 +301,32 @@ typedef Math::Deg Deg; /** @brief Angle in float radians */ typedef Math::Rad Rad; +/** @brief Float 1D range */ +#ifndef CORRADE_GCC46_COMPATIBILITY +typedef Math::Range1D Range1D; +#else +typedef Math::Range<1, Float> Range1D; +#endif + +/** @brief Float 2D range */ +typedef Math::Range2D Range2D; + +/** @brief Float 3D range */ +typedef Math::Range3D Range3D; + +/** @brief Signed integer 1D range */ +#ifndef CORRADE_GCC46_COMPATIBILITY +typedef Math::Range1D Range1Di; +#else +typedef Math::Range<1, Int> Range1Di; +#endif + +/** @brief Signed integer 2D range */ +typedef Math::Range2D Range2Di; + +/** @brief Signed integer 3D range */ +typedef Math::Range3D Range3Di; + /** @brief Float rectangle */ typedef Math::Geometry::Rectangle Rectangle; @@ -444,6 +470,19 @@ typedef Math::Deg Degd; /** @brief Angle in double radians */ typedef Math::Rad Radd; +/** @brief Double 1D range */ +#ifndef CORRADE_GCC46_COMPATIBILITY +typedef Math::Range1D Range1Dd; +#else +typedef Math::Range<1, Double> Range1Dd; +#endif + +/** @brief Double 2D range */ +typedef Math::Range2D Range2Dd; + +/** @brief Double 3D range */ +typedef Math::Range3D Range3Dd; + /** @brief Double rectangle */ typedef Math::Geometry::Rectangle Rectangled; diff --git a/src/Math/CMakeLists.txt b/src/Math/CMakeLists.txt index 9552fd85c..3fe8950f2 100644 --- a/src/Math/CMakeLists.txt +++ b/src/Math/CMakeLists.txt @@ -37,6 +37,7 @@ set(MagnumMath_HEADERS Matrix3.h Matrix4.h Quaternion.h + Range.h RectangularMatrix.h Swizzle.h Unit.h diff --git a/src/Math/Math.h b/src/Math/Math.h index ab239d11b..9a53412b8 100644 --- a/src/Math/Math.h +++ b/src/Math/Math.h @@ -29,8 +29,9 @@ */ #include +#include -#include "corradeConfigure.h" +#include "Types.h" namespace Magnum { namespace Math { @@ -74,6 +75,13 @@ template class Vector2; template class Vector3; template class Vector4; +template class Range; +#ifndef CORRADE_GCC46_COMPATIBILITY +template using Range1D = Range<1, T>; +#endif +template class Range2D; +template class Range3D; + namespace Geometry { template class Rectangle; } diff --git a/src/Math/Range.h b/src/Math/Range.h new file mode 100644 index 000000000..e2fb51f23 --- /dev/null +++ b/src/Math/Range.h @@ -0,0 +1,425 @@ +#ifndef Magnum_Math_Range_h +#define Magnum_Math_Range_h +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +/** @file + * @brief Class @ref Magnum::Math::Range, @ref Magnum::Math::Range2D, @ref Magnum::Math::Range3D, alias @ref Magnum::Math::Range1D + */ + +#include "Math/Vector3.h" + +namespace Magnum { namespace Math { + +namespace Implementation { + template struct RangeTraits; + + template struct RangeTraits<1, T> { typedef Vector<1, T> Type; }; + template struct RangeTraits<2, T> { typedef Vector2 Type; }; + template struct RangeTraits<3, T> { typedef Vector3 Type; }; +} + +/** +@brief N-dimensional range + +Axis-aligned line (in 1D), rectangle (in 2D) or cube (in 3D). Minimal +coordinate is inclusive, maximal exclusive. See @ref Range1D, @ref Range2D and +@ref Range3D specializations for given dimension count. +*/ +template class Range { + template friend class Range; + + public: + /** + * @brief Underlying vector type + * + * `T` in 1D, @ref Vector2 in 2D, @ref Vector3 in 3D. + */ + typedef typename Implementation::RangeTraits::Type VectorType; + + /** + * Create range from minimal coordinates and size + * @param min Minimal coordinates + * @param size Range size + */ + static Range fromSize(const VectorType& min, const VectorType& size) { + return {min, min+size}; + } + + /** + * @brief Construct zero range + * + * Construct zero-size range positioned at origin. + */ + constexpr Range(): _min{}, _max{} {} + + /** @brief Construct range from minimal and maximal coordinates */ + constexpr Range(const VectorType& min, const VectorType& max): _min(min), _max(max) {} + + /** @brief Copy constructor */ + constexpr Range(const Range&) = default; + + /** + * @brief Construct range from another of different type + * + * Performs only default casting on the values, no rounding or + * anything else. Example usage: + * @code + * Range2D floatingPoint({1.3f, 2.7f}, {-15.0f, 7.0f}); + * Range2D integral(floatingPoint); // {{1, 2}, {-15, 7}} + * @endcode + */ + template constexpr explicit Range(const Range& other): _min(other._min), _max(other._max) {} + + /** @brief Equality comparison */ + constexpr bool operator==(const Range& other) const { + return _min == other._min && _max == other._max; + } + + /** @brief Non-equality comparison */ + constexpr bool operator!=(const Range& other) const { + return !operator==(other); + } + + /** + * @brief Minimal coordinates (inclusive) + * + * @see @ref size(), @ref Range2D::bottomLeft(), + * @ref Range3D::backBottomLeft() + */ + VectorType& min() { return _min; } + constexpr const VectorType min() const { return _min; } /**< @overload */ + + /** + * @brief Maximal coordinates (exclusive) + * + * @see @ref size(), @ref Range2D::topRight(), + * @ref Range3D::frontTopRight() + */ + VectorType& max() { return _max; } + constexpr const VectorType max() const { return _max; } /**< @overload */ + + /** + * @brief Range size + * + * @see @ref min(), @ref max(), @ref Range2D::sizeX(), + * @ref Range2D::sizeY(), @ref Range3D::sizeX(), + * @ref Range3D::sizeY(), @ref Range3D::sizeZ() + */ + VectorType size() const { return _max - _min; } + + /** + * @brief Translated range + * + * Translates the minimal and maximal coordinates by given amount. Size + * remains the same. + */ + Range translated(const VectorType& vector) const; + + private: + VectorType _min, _max; +}; + +#ifndef DOXYGEN_GENERATING_OUTPUT +#define MAGNUM_RANGE_SUBCLASS_IMPLEMENTATION(dimensions, Type, VectorType) \ + static Type fromSize(const VectorType& min, const VectorType& size) { \ + return Range::fromSize(min, size); \ + } \ + Type translated(const VectorType& vector) const { \ + return Range::translated(vector); \ + } +#endif + +#ifndef CORRADE_GCC46_COMPATIBILITY +/** +@brief One-dimensional range + +Convenience alternative to %Range<1, T>. See @ref Range for more +information. +@note Not available on GCC < 4.7. Use %Range<1, T> instead. +*/ +template using Range1D = Range<1, T>; +#endif + +/** +@brief Two-dimensional range + +See @ref Range for more information. +@see @ref Range1D, @ref Range3D +*/ +template class Range2D: public Range<2, T> { + public: + /** @copydoc Range() */ + constexpr Range2D() = default; + + /** @copydoc Range(const VectorType&, const VectorType&) */ + constexpr Range2D(const Vector2& min, const Vector2& max): Range<2, T>(min, max) {} + + /** @copydoc Range(const Range&) */ + constexpr Range2D(const Range<2, T>& other): Range<2, T>(other) {} + + /** @copydoc Range(const Range&) */ + template constexpr explicit Range2D(const Range2D& other): Range<2, T>(other) {} + + /** + * @brief Bottom left corner + * + * Equivalent to @ref min(). + */ + Vector2& bottomLeft() { return Range<2, T>::min(); } + constexpr Vector2 bottomLeft() const { return Range<2, T>::min(); } /**< @overload */ + + /** @brief Bottom right corner */ + constexpr Vector2 bottomRight() const { + return {Range<2, T>::max().x(), Range<2, T>::min().y()}; + } + + /** @brief Top left corner */ + constexpr Vector2 topLeft() const { + return {Range<2, T>::min().x(), Range<2, T>::max().y()}; + } + + /** + * @brief Top right corner + * + * Equivalent to @ref max(). + */ + Vector2& topRight() { return Range<2, T>::max(); } + constexpr Vector2 topRight() const { return Range<2, T>::max(); } /**< @overload */ + + /** @brief Left edge */ + T& left() { return Range<2, T>::min().x(); } + constexpr T left() const { return Range<2, T>::min().x(); } /**< @overload */ + + /** @brief Right edge */ + T& right() { return Range<2, T>::max().x(); } + constexpr T right() const { return Range<2, T>::max().x(); } /**< @overload */ + + /** @brief Bottom edge */ + T& bottom() { return Range<2, T>::min().y(); } + constexpr T bottom() const { return Range<2, T>::min().y(); } /**< @overload */ + + /** @brief Top edge */ + T& top() { return Range<2, T>::max().y(); } + constexpr T top() const { return Range<2, T>::max().y(); } /**< @overload */ + + /** + * @brief %Range width + * + * @see @ref size() + */ + T sizeX() const { + return Range<2, T>::max().x() - Range<2, T>::min().x(); + } + + /** + * @brief %Range height + * + * @see @ref size() + */ + T sizeY() const { + return Range<2, T>::max().y() - Range<2, T>::min().y(); + } + + MAGNUM_RANGE_SUBCLASS_IMPLEMENTATION(2, Range2D, Vector2) +}; + +/** +@brief Two-dimensional range + +See @ref Range for more information. +@see @ref Range1D, @ref Range2D +*/ +template class Range3D: public Range<3, T> { + public: + /** @copydoc Range() */ + constexpr Range3D() = default; + + /** @copydoc Range(const VectorType&, const VectorType&) */ + constexpr Range3D(const Vector3& min, const Vector3& max): Range<3, T>(min, max) {} + + /** @copydoc Range(const Range&) */ + constexpr Range3D(const Range<3, T>& other): Range<3, T>(other) {} + + /** @copydoc Range(const Range&) */ + template constexpr explicit Range3D(const Range3D& other): Range<3, T>(other) {} + + /** + * @brief Back bottom left corner + * + * Equivalent to @ref min(). + */ + Vector3& backBottomLeft() { return Range<3, T>::min(); } + constexpr Vector3 backBottomLeft() const { return Range<3, T>::min(); } /**< @overload */ + + /** @brief Back bottom right corner */ + constexpr Vector3 backBottomRight() const { + return {Range<3, T>::max().x(), Range<3, T>::min().y(), Range<3, T>::min().z()}; + } + + /** @brief Back top right corner */ + constexpr Vector3 backTopLeft() const { + return {Range<3, T>::min().x(), Range<3, T>::max().y(), Range<3, T>::min().z()}; + } + + /** @brief Back top right corner */ + constexpr Vector3 backTopRight() const { + return {Range<3, T>::max().x(), Range<3, T>::max().y(), Range<3, T>::min().z()}; + } + + /** + * @brief Front top right corner + * + * Equivalent to @ref max(). + */ + Vector3& frontTopRight() { return Range<3, T>::max(); } + constexpr Vector3 frontTopRight() const { return Range<3, T>::max(); } /**< @overload */ + + /** @brief Front top left corner */ + constexpr Vector3 frontTopLeft() const { + return {Range<3, T>::min().x(), Range<3, T>::max().y(), Range<3, T>::max().z()}; + } + + /** @brief Front bottom right corner */ + constexpr Vector3 frontBottomRight() const { + return {Range<3, T>::max().x(), Range<3, T>::min().y(), Range<3, T>::max().z()}; + } + + /** @brief Front bottom left corner */ + constexpr Vector3 frontBottomLeft() const { + return {Range<3, T>::min().x(), Range<3, T>::min().y(), Range<3, T>::max().z()}; + } + + /** @brief Left edge */ + T& left() { return Range<3, T>::min().x(); } + constexpr T left() const { return Range<3, T>::min().x(); } /**< @overload */ + + /** @brief Right edge */ + T& right() { return Range<3, T>::max().x(); } + constexpr T right() const { return Range<3, T>::max().x(); } /**< @overload */ + + /** @brief Bottom edge */ + T& bottom() { return Range<3, T>::min().y(); } + constexpr T bottom() const { return Range<3, T>::min().y(); } /**< @overload */ + + /** @brief Top edge */ + T& top() { return Range<3, T>::max().y(); } + constexpr T top() const { return Range<3, T>::max().y(); } /**< @overload */ + + /** @brief Back edge */ + T& back() { return Range<3, T>::min().z(); } + constexpr T back() const { return Range<3, T>::min().z(); } /**< @overload */ + + /** @brief Front edge */ + T& front() { return Range<3, T>::max().z(); } + constexpr T front() const { return Range<3, T>::max().z(); } /**< @overload */ + + /** + * @brief %Range width + * + * @see @ref size() + */ + T sizeX() const { + return Range<3, T>::max().x() - Range<3, T>::min().x(); + } + + /** + * @brief %Range height + * + * @see @ref size() + */ + T sizeY() const { + return Range<3, T>::max().y() - Range<3, T>::min().y(); + } + + /** + * @brief %Range depth + * + * @see @ref size() + */ + T sizeZ() const { + return Range<3, T>::max().z() - Range<3, T>::min().z(); + } + + MAGNUM_RANGE_SUBCLASS_IMPLEMENTATION(3, Range3D, Vector3) +}; + +/** @debugoperator{Magnum::Math::Range} */ +template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Range& value) { + debug << "Range({"; + debug.setFlag(Corrade::Utility::Debug::SpaceAfterEachValue, false); + debug << value.min()[0]; + for(UnsignedInt i = 1; i != dimensions; ++i) debug << ", " << value.min()[i]; + debug << "}, {" << value.max()[0]; + for(UnsignedInt i = 1; i != dimensions; ++i) debug << ", " << value.max()[i]; + debug << "})"; + debug.setFlag(Corrade::Utility::Debug::SpaceAfterEachValue, true); + return debug; +} + +template Range Range::translated(const VectorType& vector) const { + return {_min + vector, _max + vector}; +} + +}} + +namespace Corrade { namespace Utility { + +/** @configurationvalue{Magnum::Math::Range} */ +template struct ConfigurationValue> { + ConfigurationValue() = delete; + + /** @brief Writes elements separated with spaces */ + static std::string toString(const Magnum::Math::Range& value, const ConfigurationValueFlags flags) { + return ConfigurationValue>::toString( + reinterpret_cast&>(value), flags); + } + + /** @brief Reads elements separated with whitespace */ + static Magnum::Math::Range fromString(const std::string& stringValue, const ConfigurationValueFlags flags) { + const auto vec = ConfigurationValue>::fromString(stringValue, flags); + return *reinterpret_cast*>(vec.data()); + } +}; + +/** @configurationvalue{Magnum::Math::Range2D} */ +template struct ConfigurationValue>: public ConfigurationValue> {}; + +/** @configurationvalue{Magnum::Math::Range3D} */ +template struct ConfigurationValue>: public ConfigurationValue> {}; + +#ifndef DOXYGEN_GENERATING_OUTPUT +extern template struct MAGNUM_EXPORT ConfigurationValue>; +extern template struct MAGNUM_EXPORT ConfigurationValue>; +extern template struct MAGNUM_EXPORT ConfigurationValue>; +extern template struct MAGNUM_EXPORT ConfigurationValue>; +#ifndef MAGNUM_TARGET_GLES +extern template struct MAGNUM_EXPORT ConfigurationValue>; +extern template struct MAGNUM_EXPORT ConfigurationValue>; +#endif +#endif + +}} + +#endif diff --git a/src/Math/Test/CMakeLists.txt b/src/Math/Test/CMakeLists.txt index 65fe5141c..4dadcfcdf 100644 --- a/src/Math/Test/CMakeLists.txt +++ b/src/Math/Test/CMakeLists.txt @@ -40,6 +40,7 @@ corrade_add_test(MathMatrix4Test Matrix4Test.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(MathSwizzleTest SwizzleTest.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(MathUnitTest UnitTest.cpp) corrade_add_test(MathAngleTest AngleTest.cpp LIBRARIES MagnumMathTestLib) +corrade_add_test(MathRangeTest RangeTest.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(MathDualTest DualTest.cpp) corrade_add_test(MathComplexTest ComplexTest.cpp LIBRARIES MagnumMathTestLib) diff --git a/src/Math/Test/RangeTest.cpp b/src/Math/Test/RangeTest.cpp new file mode 100644 index 000000000..c0e4caa7a --- /dev/null +++ b/src/Math/Test/RangeTest.cpp @@ -0,0 +1,311 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include +#include +#include + +#include "Math/Range.h" + +#ifdef MAGNUM_BUILD_DEPRECATED +#include "Math/Geometry/Rectangle.h" +#endif + +namespace Magnum { namespace Math { namespace Test { + +class RangeTest: public Corrade::TestSuite::Tester { + public: + RangeTest(); + + void construct(); + void constructDefault(); + void constructFromSize(); + void constructConversion(); + void constructCopy(); + + void access(); + void compare(); + void size(); + + void translated(); + + void subclassTypes(); + void subclass(); + + void debug(); + void configuration(); +}; + +typedef Math::Range<1, Float> Range1D; +typedef Math::Range2D Range2D; +typedef Math::Range3D Range3D; +typedef Math::Range1D Range1Di; +typedef Math::Range2D Range2Di; +typedef Math::Range3D Range3Di; +typedef Vector2 Vector2i; +typedef Vector3 Vector3i; + +RangeTest::RangeTest() { + addTests({&RangeTest::construct, + &RangeTest::constructDefault, + &RangeTest::constructFromSize, + &RangeTest::constructConversion, + &RangeTest::constructCopy, + + &RangeTest::access, + &RangeTest::compare, + &RangeTest::size, + + &RangeTest::translated, + + &RangeTest::subclassTypes, + &RangeTest::subclass, + + &RangeTest::debug, + &RangeTest::configuration}); +} + +void RangeTest::construct() { + constexpr Range1Di a(3, 23); + constexpr Range2Di b({3, 5}, {23, 78}); + constexpr Range3Di c({3, 5, -7}, {23, 78, 2}); + + CORRADE_COMPARE(a, (Range<1, Int>(3, 23))); + CORRADE_COMPARE(b, (Range<2, Int>({3, 5}, {23, 78}))); + CORRADE_COMPARE(c, (Range<3, Int>({3, 5, -7}, {23, 78, 2}))); +} + +void RangeTest::constructDefault() { + constexpr Range1Di a; + constexpr Range2Di b; + constexpr Range3Di c; + + CORRADE_COMPARE(a, Range1Di(0, 0)); + CORRADE_COMPARE(b, Range2Di({0, 0}, {0, 0})); + CORRADE_COMPARE(c, Range3Di({0, 0, 0}, {0, 0, 0})); +} + +void RangeTest::constructFromSize() { + CORRADE_COMPARE(Range1Di::fromSize(3, 23), Range1Di(3, 26)); + CORRADE_COMPARE(Range2Di::fromSize({3, 5}, {23, 78}), Range2Di({3, 5}, {26, 83})); + CORRADE_COMPARE(Range3Di::fromSize({3, 5, -7}, {23, 78, 9}), Range3Di({3, 5, -7}, {26, 83, 2})); +} + +void RangeTest::constructConversion() { + constexpr Range1D a(1.3f, -15.0f); + constexpr Range2D b({1.3f, 2.7f}, {-15.0f, 7.0f}); + constexpr Range3D c({1.3f, 2.7f, -1.5f}, {-15.0f, 7.0f, 0.3f}); + + #ifndef CORRADE_GCC46_COMPATIBILITY + constexpr /* Not constexpr under GCC < 4.7 */ + #endif + Range1Di d(a); + CORRADE_COMPARE(d, Range1Di(1, -15)); + + #ifndef CORRADE_GCC46_COMPATIBILITY + constexpr /* Not constexpr under GCC < 4.7 */ + #endif + Range2Di e(b); + CORRADE_COMPARE(e, Range2Di({1, 2}, {-15, 7})); + + #ifndef CORRADE_GCC46_COMPATIBILITY + constexpr /* Not constexpr under GCC < 4.7 */ + #endif + Range3Di f(c); + CORRADE_COMPARE(f, Range3Di({1, 2, -1}, {-15, 7, 0})); + + /* Implicit conversion is not allowed */ + CORRADE_VERIFY(!(std::is_convertible, Range<2, Int>>::value)); + CORRADE_VERIFY(!(std::is_convertible::value)); + CORRADE_VERIFY(!(std::is_convertible::value)); + CORRADE_VERIFY(!(std::is_convertible::value)); +} + +void RangeTest::constructCopy() { + constexpr Range1Di a(3, 23); + constexpr Range2Di b({3, 5}, {23, 78}); + constexpr Range3Di c({3, 5, -7}, {23, 78, 2}); + + constexpr Range1Di d(a); + constexpr Range2Di e(b); + constexpr Range3Di f(c); + + CORRADE_COMPARE(d, Range1Di(3, 23)); + CORRADE_COMPARE(e, Range2Di({3, 5}, {23, 78})); + CORRADE_COMPARE(f, Range3Di({3, 5, -7}, {23, 78, 2})); +} + +void RangeTest::access() { + Range1Di line(34, 47); + Range2Di rect({34, 23}, {47, 30}); + Range3Di cube({34, 23, -17}, {47, 30, 12}); + + constexpr Range1Di cline(34, 47); + constexpr Range2Di crect({34, 23}, {47, 30}); + constexpr Range3Di ccube({34, 23, -17}, {47, 30, 12}); + + CORRADE_COMPARE(line.min(), 34); + CORRADE_COMPARE(cline.min(), 34); + CORRADE_COMPARE(line.max(), 47); + CORRADE_COMPARE(cline.max(), 47); + + CORRADE_COMPARE(rect.bottomLeft(), Vector2i(34, 23)); + CORRADE_COMPARE(rect.topRight(), Vector2i(47, 30)); + constexpr Vector2i bottomLeft = crect.bottomLeft(); + constexpr Vector2i topRight = crect.topRight(); + CORRADE_COMPARE(bottomLeft, Vector2i(34, 23)); + CORRADE_COMPARE(topRight, Vector2i(47, 30)); + + CORRADE_COMPARE(rect.left(), 34); + CORRADE_COMPARE(rect.right(), 47); + CORRADE_COMPARE(rect.bottom(), 23); + CORRADE_COMPARE(rect.top(), 30); + constexpr Int left2 = crect.left(); + constexpr Int right2 = crect.right(); + constexpr Int bottom2 = crect.bottom(); + constexpr Int top2 = crect.top(); + CORRADE_COMPARE(left2, 34); + CORRADE_COMPARE(right2, 47); + CORRADE_COMPARE(bottom2, 23); + CORRADE_COMPARE(top2, 30); + + CORRADE_COMPARE(cube.backBottomLeft(), Vector3i(34, 23, -17)); + CORRADE_COMPARE(cube.frontTopRight(), Vector3i(47, 30, 12)); + constexpr Vector3i backBottomLeft = ccube.backBottomLeft(); + constexpr Vector3i frontTopRight = ccube.frontTopRight(); + CORRADE_COMPARE(backBottomLeft, Vector3i(34, 23, -17)); + CORRADE_COMPARE(frontTopRight, Vector3i(47, 30, 12)); + + CORRADE_COMPARE(cube.left(), 34); + CORRADE_COMPARE(cube.right(), 47); + CORRADE_COMPARE(cube.bottom(), 23); + CORRADE_COMPARE(cube.top(), 30); + CORRADE_COMPARE(cube.back(), -17); + CORRADE_COMPARE(cube.front(), 12); + constexpr Int left3 = ccube.left(); + constexpr Int right3 = ccube.right(); + constexpr Int bottom3 = ccube.bottom(); + constexpr Int top3 = ccube.top(); + constexpr Int back3 = ccube.back(); + constexpr Int front3 = ccube.front(); + CORRADE_COMPARE(left3, 34); + CORRADE_COMPARE(right3, 47); + CORRADE_COMPARE(bottom3, 23); + CORRADE_COMPARE(top3, 30); + CORRADE_COMPARE(back3, -17); + CORRADE_COMPARE(front3, 12); + + CORRADE_COMPARE(rect.bottomRight(), Vector2i(47, 23)); + CORRADE_COMPARE(rect.topLeft(), Vector2i(34, 30)); + + CORRADE_COMPARE(cube.backBottomRight(), Vector3i(47, 23, -17)); + CORRADE_COMPARE(cube.backTopLeft(), Vector3i(34, 30, -17)); + CORRADE_COMPARE(cube.backTopRight(), Vector3i(47, 30, -17)); + CORRADE_COMPARE(cube.frontBottomLeft(), Vector3i(34, 23, 12)); + CORRADE_COMPARE(cube.frontBottomRight(), Vector3i(47, 23, 12)); + CORRADE_COMPARE(cube.frontTopLeft(), Vector3i(34, 30, 12)); +} + +void RangeTest::compare() { + CORRADE_VERIFY(Range2Di({34, 23}, {47, 30}) == Range2Di({34, 23}, {47, 30})); + CORRADE_VERIFY(Range2Di({34, 23}, {47, 30}) != Range2Di({34, 23}, {48, 30})); + CORRADE_VERIFY(Range2Di({34, 23}, {47, 30}) != Range2Di({35, 23}, {47, 30})); + + CORRADE_VERIFY(Range1D(1.0f, 1.0f) != Range1D(1.0f + TypeTraits::epsilon()*2, 1.0f)); + CORRADE_VERIFY(Range1D(1.0f, 1.0f) != Range1D(1.0f, 1.0f + TypeTraits::epsilon()*2)); + CORRADE_VERIFY(Range1D(1.0f, 1.0f) == Range1D(1.0f + TypeTraits::epsilon()/2.0f, + 1.0f + TypeTraits::epsilon()/2.0f)); +} + +void RangeTest::size() { + const Range1Di line(34, 47); + const Range2Di rect({34, 23}, {47, 30}); + const Range3Di cube({34, 23, -17}, {47, 30, 12}); + + CORRADE_COMPARE(line.size(), 13); + CORRADE_COMPARE(rect.size(), Vector2i(13, 7)); + CORRADE_COMPARE(cube.size(), Vector3i(13, 7, 29)); + + CORRADE_COMPARE(rect.sizeX(), 13); + CORRADE_COMPARE(rect.sizeY(), 7); + + CORRADE_COMPARE(cube.sizeX(), 13); + CORRADE_COMPARE(cube.sizeY(), 7); + CORRADE_COMPARE(cube.sizeZ(), 29); +} + +void RangeTest::translated() { + Range2Di a({34, 23}, {47, 30}); + Range2Di b({17, 63}, {30, 70}); + + CORRADE_COMPARE(a.translated({-17, 40}), b); + CORRADE_COMPARE(a.size(), b.size()); +} + +template class BasicRect: public Math::Range<2, T> { + public: + template BasicRect(U&&... args): Math::Range<2, T>{std::forward(args)...} {} + + MAGNUM_RANGE_SUBCLASS_IMPLEMENTATION(2, BasicRect, Vector2) +}; + +typedef BasicRect Recti; + +void RangeTest::subclassTypes() { + const Vector2i a; + CORRADE_VERIFY((std::is_same::value)); + + const Recti r; + CORRADE_VERIFY((std::is_same::value)); +} + +void RangeTest::subclass() { + CORRADE_COMPARE(Recti::fromSize({3, 5}, {23, 78}), + Recti(Vector2i{3, 5}, Vector2i{26, 83})); + + CORRADE_COMPARE(Recti(Vector2i{34, 23}, Vector2i{47, 30}).translated({-17, 40}), + Recti(Vector2i{17, 63}, Vector2i{30, 70})); +} + +void RangeTest::debug() { + std::ostringstream o; + Debug(&o) << Range2Di({34, 23}, {47, 30}); + + CORRADE_COMPARE(o.str(), "Range({34, 23}, {47, 30})\n"); +} + +void RangeTest::configuration() { + Corrade::Utility::Configuration c; + + Range2D rect({3.0f, 3.125f}, {9.0f, 9.55f}); + std::string value("3 3.125 9 9.55"); + + c.setValue("rectangle", rect); + CORRADE_COMPARE(c.value("rectangle"), value); + CORRADE_COMPARE(c.value("rectangle"), rect); +} + +}}} + +CORRADE_TEST_MAIN(Magnum::Math::Test::RangeTest) diff --git a/src/Math/instantiation.cpp b/src/Math/instantiation.cpp index fcb4772a8..27957187f 100644 --- a/src/Math/instantiation.cpp +++ b/src/Math/instantiation.cpp @@ -24,6 +24,7 @@ #include "Math/DualComplex.h" #include "Math/DualQuaternion.h" +#include "Math/Range.h" namespace Corrade { namespace Utility { @@ -78,6 +79,15 @@ template struct ConfigurationValue>; template struct ConfigurationValue>; #endif #endif + +template struct ConfigurationValue>; +template struct ConfigurationValue>; +template struct ConfigurationValue>; +template struct ConfigurationValue>; +#ifndef MAGNUM_TARGET_GLES +template struct ConfigurationValue>; +template struct ConfigurationValue>; +#endif #endif }} From 9a6c959b60c4d2b3040d0d1deb5ffccf49e71e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 28 Nov 2013 20:24:18 +0100 Subject: [PATCH 079/105] Math: added Range*::center*() convenience functions. --- src/Math/Range.h | 57 ++++++++++++++++++++++++++++++++++++- src/Math/Test/RangeTest.cpp | 19 +++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/src/Math/Range.h b/src/Math/Range.h index e2fb51f23..eff56d0a6 100644 --- a/src/Math/Range.h +++ b/src/Math/Range.h @@ -125,10 +125,19 @@ template class Range { * * @see @ref min(), @ref max(), @ref Range2D::sizeX(), * @ref Range2D::sizeY(), @ref Range3D::sizeX(), - * @ref Range3D::sizeY(), @ref Range3D::sizeZ() + * @ref Range3D::sizeY(), @ref Range3D::sizeZ(), @ref center() */ VectorType size() const { return _max - _min; } + /** + * @brief Range center + * + * @see @ref Range2D::centerX(), @ref Range2D::centerY(), + * @ref Range3D::centerX(), @ref Range3D::centerY(), + * @ref Range3D::centerZ(), @ref size() + */ + VectorType center() const { return (_min + _max)/T(2); } + /** * @brief Translated range * @@ -242,6 +251,24 @@ template class Range2D: public Range<2, T> { return Range<2, T>::max().y() - Range<2, T>::min().y(); } + /** + * @brief %Range center on X axis + * + * @see @ref center() + */ + T centerX() const { + return (Range<2, T>::min().x() + Range<2, T>::max().x())/T(2); + } + + /** + * @brief %Range center on Y axis + * + * @see @ref center() + */ + T centerY() const { + return (Range<2, T>::min().y() + Range<2, T>::max().y())/T(2); + } + MAGNUM_RANGE_SUBCLASS_IMPLEMENTATION(2, Range2D, Vector2) }; @@ -362,6 +389,34 @@ template class Range3D: public Range<3, T> { return Range<3, T>::max().z() - Range<3, T>::min().z(); } + /** + * + * @brief %Range center on X axis + * + * @see @ref center() + */ + T centerX() const { + return (Range<3, T>::min().x() + Range<3, T>::max().x())/T(2); + } + + /** + * @brief %Range center on Y axis + * + * @see @ref center() + */ + T centerY() const { + return (Range<3, T>::min().y() + Range<3, T>::max().y())/T(2); + } + + /** + * @brief %Range center on Z axis + * + * @see @ref center() + */ + T centerZ() const { + return (Range<3, T>::min().z() + Range<3, T>::max().z())/T(2); + } + MAGNUM_RANGE_SUBCLASS_IMPLEMENTATION(3, Range3D, Vector3) }; diff --git a/src/Math/Test/RangeTest.cpp b/src/Math/Test/RangeTest.cpp index c0e4caa7a..a6a482071 100644 --- a/src/Math/Test/RangeTest.cpp +++ b/src/Math/Test/RangeTest.cpp @@ -47,6 +47,7 @@ class RangeTest: public Corrade::TestSuite::Tester { void access(); void compare(); void size(); + void center(); void translated(); @@ -76,6 +77,7 @@ RangeTest::RangeTest() { &RangeTest::access, &RangeTest::compare, &RangeTest::size, + &RangeTest::center, &RangeTest::translated, @@ -255,6 +257,23 @@ void RangeTest::size() { CORRADE_COMPARE(cube.sizeZ(), 29); } +void RangeTest::center() { + const Range1Di line(34, 47); + const Range2Di rect({34, 23}, {47, 30}); + const Range3Di cube({34, 23, -17}, {47, 30, 12}); + + CORRADE_COMPARE(line.center(), 40); + CORRADE_COMPARE(rect.center(), Vector2i(40, 26)); + CORRADE_COMPARE(cube.center(), Vector3i(40, 26, -2)); + + CORRADE_COMPARE(rect.centerX(), 40); + CORRADE_COMPARE(rect.centerY(), 26); + + CORRADE_COMPARE(cube.centerX(), 40); + CORRADE_COMPARE(cube.centerY(), 26); + CORRADE_COMPARE(cube.centerZ(), -2); +} + void RangeTest::translated() { Range2Di a({34, 23}, {47, 30}); Range2Di b({17, 63}, {30, 70}); From 66e6ab6684ee5b3cdd748fa335a014a3b0f4aaec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 28 Nov 2013 20:27:07 +0100 Subject: [PATCH 080/105] Math: added Range::padded() function. --- src/Math/Range.h | 17 +++++++++++++++++ src/Math/Test/RangeTest.cpp | 13 +++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/Math/Range.h b/src/Math/Range.h index eff56d0a6..2df1c2c07 100644 --- a/src/Math/Range.h +++ b/src/Math/Range.h @@ -143,9 +143,19 @@ template class Range { * * Translates the minimal and maximal coordinates by given amount. Size * remains the same. + * @see @ref padded() */ Range translated(const VectorType& vector) const; + /** + * @brief Padded rage + * + * Translates the minimal and maximal coordinates by given amount. + * Center remains the same. + * @see @ref translated() + */ + Range padded(const VectorType& padding) const; + private: VectorType _min, _max; }; @@ -157,6 +167,9 @@ template class Range { } \ Type translated(const VectorType& vector) const { \ return Range::translated(vector); \ + } \ + Type padded(const VectorType& padding) const { \ + return Range::padded(padding); \ } #endif @@ -437,6 +450,10 @@ template Range Range Range Range::padded(const VectorType& padding) const { + return {_min - padding, _max + padding}; +} + }} namespace Corrade { namespace Utility { diff --git a/src/Math/Test/RangeTest.cpp b/src/Math/Test/RangeTest.cpp index a6a482071..c3b6e660c 100644 --- a/src/Math/Test/RangeTest.cpp +++ b/src/Math/Test/RangeTest.cpp @@ -50,6 +50,7 @@ class RangeTest: public Corrade::TestSuite::Tester { void center(); void translated(); + void padded(); void subclassTypes(); void subclass(); @@ -80,6 +81,7 @@ RangeTest::RangeTest() { &RangeTest::center, &RangeTest::translated, + &RangeTest::padded, &RangeTest::subclassTypes, &RangeTest::subclass, @@ -282,6 +284,14 @@ void RangeTest::translated() { CORRADE_COMPARE(a.size(), b.size()); } +void RangeTest::padded() { + Range2Di a({34, 23}, {47, 30}); + Range2Di b({31, 28}, {50, 25}); + + CORRADE_COMPARE(a.padded({3, -5}), b); + CORRADE_COMPARE(a.center(), b.center()); +} + template class BasicRect: public Math::Range<2, T> { public: template BasicRect(U&&... args): Math::Range<2, T>{std::forward(args)...} {} @@ -297,6 +307,7 @@ void RangeTest::subclassTypes() { const Recti r; CORRADE_VERIFY((std::is_same::value)); + CORRADE_VERIFY((std::is_same::value)); } void RangeTest::subclass() { @@ -305,6 +316,8 @@ void RangeTest::subclass() { CORRADE_COMPARE(Recti(Vector2i{34, 23}, Vector2i{47, 30}).translated({-17, 40}), Recti(Vector2i{17, 63}, Vector2i{30, 70})); + CORRADE_COMPARE(Recti(Vector2i{34, 23}, Vector2i{47, 30}).padded({3, -5}), + Recti(Vector2i{31, 28}, Vector2i{50, 25})); } void RangeTest::debug() { From b083935b94c31fae95c532504b101a42859d69da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 28 Nov 2013 21:47:52 +0100 Subject: [PATCH 081/105] Math: added Range::scaled(). --- src/Math/Range.h | 15 +++++++++++++++ src/Math/Test/RangeTest.cpp | 12 ++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/Math/Range.h b/src/Math/Range.h index 2df1c2c07..5489c9ff8 100644 --- a/src/Math/Range.h +++ b/src/Math/Range.h @@ -156,6 +156,14 @@ template class Range { */ Range padded(const VectorType& padding) const; + /** + * @brief Scaled range + * + * Multiplies the minimal and maximal coordinates by given amount. + * @see @ref padded() + */ + Range scaled(const VectorType& scaling) const; + private: VectorType _min, _max; }; @@ -170,6 +178,9 @@ template class Range { } \ Type padded(const VectorType& padding) const { \ return Range::padded(padding); \ + } \ + Type scaled(const VectorType& scaling) const { \ + return Range::scaled(scaling); \ } #endif @@ -454,6 +465,10 @@ template Range Range Range Range::scaled(const VectorType& scaling) const { + return {_min*scaling, _max*scaling}; +} + }} namespace Corrade { namespace Utility { diff --git a/src/Math/Test/RangeTest.cpp b/src/Math/Test/RangeTest.cpp index c3b6e660c..2f790bf81 100644 --- a/src/Math/Test/RangeTest.cpp +++ b/src/Math/Test/RangeTest.cpp @@ -51,6 +51,7 @@ class RangeTest: public Corrade::TestSuite::Tester { void translated(); void padded(); + void scaled(); void subclassTypes(); void subclass(); @@ -82,6 +83,7 @@ RangeTest::RangeTest() { &RangeTest::translated, &RangeTest::padded, + &RangeTest::scaled, &RangeTest::subclassTypes, &RangeTest::subclass, @@ -292,6 +294,13 @@ void RangeTest::padded() { CORRADE_COMPARE(a.center(), b.center()); } +void RangeTest::scaled() { + Range2Di a({34, 23}, {47, 30}); + Range2Di b({68, -69}, {94, -90}); + + CORRADE_COMPARE(a.scaled({2, -3}), b); +} + template class BasicRect: public Math::Range<2, T> { public: template BasicRect(U&&... args): Math::Range<2, T>{std::forward(args)...} {} @@ -308,6 +317,7 @@ void RangeTest::subclassTypes() { const Recti r; CORRADE_VERIFY((std::is_same::value)); CORRADE_VERIFY((std::is_same::value)); + CORRADE_VERIFY((std::is_same::value)); } void RangeTest::subclass() { @@ -318,6 +328,8 @@ void RangeTest::subclass() { Recti(Vector2i{17, 63}, Vector2i{30, 70})); CORRADE_COMPARE(Recti(Vector2i{34, 23}, Vector2i{47, 30}).padded({3, -5}), Recti(Vector2i{31, 28}, Vector2i{50, 25})); + CORRADE_COMPARE(Recti(Vector2i{34, 23}, Vector2i{47, 30}).scaled({2, -3}), + Recti(Vector2i{68, -69}, Vector2i{94, -90})); } void RangeTest::debug() { From ee8f7574195c981bf861ae4b2f79b2148e0a3295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 28 Nov 2013 22:21:19 +0100 Subject: [PATCH 082/105] Using Range2D instead of Rectangle everywhere. Encourages vectorization and generic usage even more. Some functions were rewritten to make use of the new features, resulting in shorter and more readable code. This also fixes the annoying naming collision with WINAPI Rectangle() function. The old Rectangle is now subclass of Range2D, is marked as deprecated and will be removed in future release. --- doc/types.dox | 7 +- src/AbstractFramebuffer.cpp | 10 +- src/AbstractFramebuffer.h | 12 +- src/CMakeLists.txt | 3 +- src/DefaultFramebuffer.cpp | 4 +- src/DefaultFramebuffer.h | 4 +- src/Framebuffer.cpp | 4 +- src/Framebuffer.h | 6 +- src/Implementation/FramebufferState.h | 4 +- src/Magnum.h | 19 +- src/Math/Geometry/CMakeLists.txt | 9 +- src/Math/Geometry/Rectangle.h | 166 +++-------------- src/Math/Geometry/Test/CMakeLists.txt | 1 - src/Math/Geometry/Test/RectangleTest.cpp | 176 ------------------ src/Math/Geometry/instantiation.cpp | 38 ---- src/Math/Math.h | 2 + src/Math/Test/RangeTest.cpp | 34 ++++ src/Math/instantiation.cpp | 12 -- src/Plugins/MagnumFont/MagnumFont.cpp | 24 +-- .../MagnumFont/Test/MagnumFontTest.cpp | 22 +-- .../MagnumFontConverter.cpp | 6 +- src/Renderer.cpp | 6 +- src/Renderer.h | 2 +- src/Text/AbstractFont.cpp | 4 +- src/Text/AbstractFont.h | 4 +- src/Text/DistanceFieldGlyphCache.cpp | 2 +- src/Text/GlyphCache.cpp | 8 +- src/Text/GlyphCache.h | 14 +- src/Text/Renderer.cpp | 22 +-- src/Text/Renderer.h | 12 +- src/Text/Test/AbstractLayouterTest.cpp | 32 ++-- src/Text/Test/GlyphCacheGLTest.cpp | 10 +- src/Text/Test/RendererGLTest.cpp | 26 +-- src/TextureTools/Atlas.cpp | 10 +- src/TextureTools/Atlas.h | 2 +- src/TextureTools/DistanceField.cpp | 6 +- src/TextureTools/DistanceField.h | 4 +- src/TextureTools/Test/AtlasTest.cpp | 26 +-- src/TextureTools/distancefieldconverter.cpp | 2 +- 39 files changed, 231 insertions(+), 524 deletions(-) delete mode 100644 src/Math/Geometry/Test/RectangleTest.cpp delete mode 100644 src/Math/Geometry/instantiation.cpp diff --git a/doc/types.dox b/doc/types.dox index 3dae4a703..eb74e03d0 100644 --- a/doc/types.dox +++ b/doc/types.dox @@ -90,9 +90,10 @@ equivalently (e.g. @ref Math::Vector or @ref Color3 instead of @ref Vector3). Other types, which don't have their GLSL equivalent, are: - - @ref Rectangle, @ref Rectanglei or @ref Rectangled - - @ref Complex or @ref Complexd, @ref DualComplex or @ref DualComplexd - - @ref Quaternion or @ref Quaterniond, @ref DualQuaternion or @ref DualQuaterniond +- @ref Complex or @ref Complexd, @ref DualComplex or @ref DualComplexd +- @ref Quaternion or @ref Quaterniond, @ref DualQuaternion or @ref DualQuaterniond +- @ref Range1D / @ref Range2D / @ref Range3D, @ref Range1Di / @ref Range2Di / @ref Range3Di or + @ref Range1Dd / @ref Range2Dd / @ref Range3Dd These types can be used in GLSL either by extracting values from their underlying structure or converting them to types supported by GLSL (e.g. diff --git a/src/AbstractFramebuffer.cpp b/src/AbstractFramebuffer.cpp index d6bbb95f4..bbd5659f8 100644 --- a/src/AbstractFramebuffer.cpp +++ b/src/AbstractFramebuffer.cpp @@ -139,7 +139,7 @@ FramebufferTarget AbstractFramebuffer::bindInternal() { #endif } -void AbstractFramebuffer::blit(AbstractFramebuffer& source, AbstractFramebuffer& destination, const Rectanglei& sourceRectangle, const Rectanglei& destinationRectangle, FramebufferBlitMask mask, FramebufferBlitFilter filter) { +void AbstractFramebuffer::blit(AbstractFramebuffer& source, AbstractFramebuffer& destination, const Range2Di& sourceRectangle, const Range2Di& destinationRectangle, FramebufferBlitMask mask, FramebufferBlitFilter filter) { source.bindInternal(FramebufferTarget::Read); destination.bindInternal(FramebufferTarget::Draw); /** @todo Get some extension wrangler instead to avoid undeclared glBlitFramebuffer() on ES2 */ @@ -153,7 +153,7 @@ void AbstractFramebuffer::blit(AbstractFramebuffer& source, AbstractFramebuffer& #endif } -AbstractFramebuffer& AbstractFramebuffer::setViewport(const Rectanglei& rectangle) { +AbstractFramebuffer& AbstractFramebuffer::setViewport(const Range2Di& rectangle) { _viewport = rectangle; /* Update the viewport if the framebuffer is currently bound */ @@ -174,7 +174,7 @@ void AbstractFramebuffer::setViewportInternal() { /* Update the state and viewport */ state->viewport = _viewport; - glViewport(_viewport.left(), _viewport.bottom(), _viewport.width(), _viewport.height()); + glViewport(_viewport.left(), _viewport.bottom(), _viewport.sizeX(), _viewport.sizeY()); } void AbstractFramebuffer::clear(FramebufferClearMask mask) { @@ -227,10 +227,10 @@ void AbstractFramebuffer::invalidateImplementation(GLsizei count, GLenum* attach #endif } -void AbstractFramebuffer::invalidateImplementation(GLsizei count, GLenum* attachments, const Rectanglei& rectangle) { +void AbstractFramebuffer::invalidateImplementation(GLsizei count, GLenum* attachments, const Range2Di& rectangle) { /** @todo Re-enable when extension wrangler is available for ES2 */ #ifndef MAGNUM_TARGET_GLES2 - glInvalidateSubFramebuffer(GLenum(bindInternal()), count, attachments, rectangle.left(), rectangle.bottom(), rectangle.width(), rectangle.height()); + glInvalidateSubFramebuffer(GLenum(bindInternal()), count, attachments, rectangle.left(), rectangle.bottom(), rectangle.sizeX(), rectangle.sizeY()); #else //glDiscardSubFramebufferEXT(GLenum(bindInternal()), count, attachments, rectangle.left(), rectangle.bottom(), rectangle.width(), rectangle.height()); static_cast(count); diff --git a/src/AbstractFramebuffer.h b/src/AbstractFramebuffer.h index ac7272622..073e1afc7 100644 --- a/src/AbstractFramebuffer.h +++ b/src/AbstractFramebuffer.h @@ -207,7 +207,7 @@ class MAGNUM_EXPORT AbstractFramebuffer { * @requires_gles30 %Extension @es_extension{ANGLE,framebuffer_blit} or * @es_extension{NV,framebuffer_blit} */ - static void blit(AbstractFramebuffer& source, AbstractFramebuffer& destination, const Rectanglei& sourceRectangle, const Rectanglei& destinationRectangle, FramebufferBlitMask mask, FramebufferBlitFilter filter); + static void blit(AbstractFramebuffer& source, AbstractFramebuffer& destination, const Range2Di& sourceRectangle, const Range2Di& destinationRectangle, FramebufferBlitMask mask, FramebufferBlitFilter filter); /** * @brief Copy block of pixels @@ -224,7 +224,7 @@ class MAGNUM_EXPORT AbstractFramebuffer { * @requires_gles30 %Extension @es_extension{ANGLE,framebuffer_blit} or * @es_extension{NV,framebuffer_blit} */ - static void blit(AbstractFramebuffer& source, AbstractFramebuffer& destination, const Rectanglei& rectangle, FramebufferBlitMask mask) { + static void blit(AbstractFramebuffer& source, AbstractFramebuffer& destination, const Range2Di& rectangle, FramebufferBlitMask mask) { blit(source, destination, rectangle, rectangle, mask, FramebufferBlitFilter::Nearest); } @@ -242,7 +242,7 @@ class MAGNUM_EXPORT AbstractFramebuffer { void bind(FramebufferTarget target); /** @brief Viewport rectangle */ - Rectanglei viewport() const { return _viewport; } + Range2Di viewport() const { return _viewport; } /** * @brief Set viewport @@ -253,7 +253,7 @@ class MAGNUM_EXPORT AbstractFramebuffer { * rectangle. * @see @ref maxViewportSize(), @fn_gl{Viewport} */ - AbstractFramebuffer& setViewport(const Rectanglei& rectangle); + AbstractFramebuffer& setViewport(const Range2Di& rectangle); /** * @brief Clear specified buffers in framebuffer @@ -330,10 +330,10 @@ class MAGNUM_EXPORT AbstractFramebuffer { static ReadBufferImplementation readBufferImplementation; void MAGNUM_LOCAL invalidateImplementation(GLsizei count, GLenum* attachments); - void MAGNUM_LOCAL invalidateImplementation(GLsizei count, GLenum* attachments, const Rectanglei& rectangle); + void MAGNUM_LOCAL invalidateImplementation(GLsizei count, GLenum* attachments, const Range2Di& rectangle); GLuint _id; - Rectanglei _viewport; + Range2Di _viewport; private: static void MAGNUM_LOCAL initializeContextBasedFunctionality(Context& context); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 36ff7eaff..1da7f8738 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -160,8 +160,7 @@ endif() # Files shared between main library and math unit test library set(MagnumMath_SRCS Math/Functions.cpp - Math/instantiation.cpp - Math/Geometry/instantiation.cpp) + Math/instantiation.cpp) # Set shared library flags for the objects, as they will be part of shared lib # TODO: fix when CMake sets target_EXPORTS for OBJECT targets as well diff --git a/src/DefaultFramebuffer.cpp b/src/DefaultFramebuffer.cpp index 8468f784b..51193daff 100644 --- a/src/DefaultFramebuffer.cpp +++ b/src/DefaultFramebuffer.cpp @@ -65,7 +65,7 @@ void DefaultFramebuffer::invalidate(std::initializer_list attachments, const Rectanglei& rectangle) { +void DefaultFramebuffer::invalidate(std::initializer_list attachments, const Range2Di& rectangle) { /** @todo C++14: use VLA to avoid heap allocation */ Containers::Array _attachments(attachments.size()); for(std::size_t i = 0; i != attachments.size(); ++i) @@ -80,7 +80,7 @@ void DefaultFramebuffer::initializeContextBasedFunctionality(Context& context) { /* Initial framebuffer size */ GLint viewport[4]; glGetIntegerv(GL_VIEWPORT, viewport); - defaultFramebuffer._viewport = state->viewport = Rectanglei::fromSize({viewport[0], viewport[1]}, {viewport[2], viewport[3]}); + defaultFramebuffer._viewport = state->viewport = Range2Di::fromSize({viewport[0], viewport[1]}, {viewport[2], viewport[3]}); /* Fake initial glViewport() call for ApiTrace */ #ifndef MAGNUM_TARGET_GLES diff --git a/src/DefaultFramebuffer.h b/src/DefaultFramebuffer.h index d1bdc2671..245fc4998 100644 --- a/src/DefaultFramebuffer.h +++ b/src/DefaultFramebuffer.h @@ -400,11 +400,11 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer { * @requires_gles30 %Extension @es_extension{EXT,discard_framebuffer}. * Use clear() instead where the extension is not supported. */ - void invalidate(std::initializer_list attachments, const Rectanglei& rectangle); + void invalidate(std::initializer_list attachments, const Range2Di& rectangle); /* Overloads to remove WTF-factor from method chaining order */ #ifndef DOXYGEN_GENERATING_OUTPUT - DefaultFramebuffer& setViewport(const Rectanglei& rectangle) { + DefaultFramebuffer& setViewport(const Range2Di& rectangle) { AbstractFramebuffer::setViewport(rectangle); return *this; } diff --git a/src/Framebuffer.cpp b/src/Framebuffer.cpp index 265cf91d6..be4eea498 100644 --- a/src/Framebuffer.cpp +++ b/src/Framebuffer.cpp @@ -71,7 +71,7 @@ Int Framebuffer::maxColorAttachments() { return value; } -Framebuffer::Framebuffer(const Rectanglei& viewport) { +Framebuffer::Framebuffer(const Range2Di& viewport) { _viewport = viewport; glGenFramebuffers(1, &_id); @@ -112,7 +112,7 @@ void Framebuffer::invalidate(std::initializer_list attac invalidateImplementation(attachments.size(), _attachments); } -void Framebuffer::invalidate(std::initializer_list attachments, const Rectanglei& rectangle) { +void Framebuffer::invalidate(std::initializer_list attachments, const Range2Di& rectangle) { /** @todo C++14: use VLA to avoid heap allocation */ Containers::Array _attachments(attachments.size()); for(std::size_t i = 0; i != attachments.size(); ++i) diff --git a/src/Framebuffer.h b/src/Framebuffer.h index 0e7f70fb9..7318c83cb 100644 --- a/src/Framebuffer.h +++ b/src/Framebuffer.h @@ -290,7 +290,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer { * Generates new OpenGL framebuffer. * @see setViewport(), @fn_gl{GenFramebuffers} */ - explicit Framebuffer(const Rectanglei& viewport); + explicit Framebuffer(const Range2Di& viewport); /** * @brief Destructor @@ -389,7 +389,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer { * @requires_gles30 %Extension @es_extension{EXT,discard_framebuffer}. * Use clear() instead where the extension is not supported. */ - void invalidate(std::initializer_list attachments, const Rectanglei& rectangle); + void invalidate(std::initializer_list attachments, const Range2Di& rectangle); /** * @brief Map given color attachment for reading @@ -503,7 +503,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer { /* Overloads to remove WTF-factor from method chaining order */ #ifndef DOXYGEN_GENERATING_OUTPUT - Framebuffer& setViewport(const Rectanglei& rectangle) { + Framebuffer& setViewport(const Range2Di& rectangle) { AbstractFramebuffer::setViewport(rectangle); return *this; } diff --git a/src/Implementation/FramebufferState.h b/src/Implementation/FramebufferState.h index a6138581d..87f72120d 100644 --- a/src/Implementation/FramebufferState.h +++ b/src/Implementation/FramebufferState.h @@ -24,7 +24,7 @@ DEALINGS IN THE SOFTWARE. */ -#include "Math/Geometry/Rectangle.h" +#include "Math/Range.h" #include "Magnum.h" #include "OpenGL.h" @@ -42,7 +42,7 @@ struct FramebufferState { #ifndef MAGNUM_TARGET_GLES GLint maxDualSourceDrawBuffers; #endif - Rectanglei viewport; + Range2Di viewport; Vector2i maxViewportSize; }; diff --git a/src/Magnum.h b/src/Magnum.h index 59f9b1773..3f6f49147 100644 --- a/src/Magnum.h +++ b/src/Magnum.h @@ -327,11 +327,19 @@ typedef Math::Range2D Range2Di; /** @brief Signed integer 3D range */ typedef Math::Range3D Range3Di; -/** @brief Float rectangle */ +#ifdef MAGNUM_BUILD_DEPRECATED +/** +@copybrief Range2D +@deprecated Use @ref Magnum::Range2D instead. +*/ typedef Math::Geometry::Rectangle Rectangle; -/** @brief Signed integer rectangle */ +/** +@copybrief Range2Di +@deprecated Use @ref Magnum::Range2Di instead. +*/ typedef Math::Geometry::Rectangle Rectanglei; +#endif /*@}*/ @@ -483,8 +491,13 @@ typedef Math::Range2D Range2Dd; /** @brief Double 3D range */ typedef Math::Range3D Range3Dd; -/** @brief Double rectangle */ +#ifdef MAGNUM_BUILD_DEPRECATED +/** +@copybrief Range2Dd +@deprecated Use @ref Magnum::Range2Dd instead. +*/ typedef Math::Geometry::Rectangle Rectangled; +#endif /*@}*/ #endif diff --git a/src/Math/Geometry/CMakeLists.txt b/src/Math/Geometry/CMakeLists.txt index bd64aff42..ad0e92d5e 100644 --- a/src/Math/Geometry/CMakeLists.txt +++ b/src/Math/Geometry/CMakeLists.txt @@ -24,11 +24,16 @@ set(MagnumMathGeometry_HEADERS Distance.h - Intersection.h - Rectangle.h) + Intersection.h) install(FILES ${MagnumMathGeometry_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Math/Geometry) +# Deprecated headers +if(BUILD_DEPRECATED) + set(MagnumMathGeometry_HEADERS ${MagnumMathGeometry_HEADERS} + Rectangle.h) +endif() + if(BUILD_TESTS) add_subdirectory(Test) endif() diff --git a/src/Math/Geometry/Rectangle.h b/src/Math/Geometry/Rectangle.h index 5d7ba1a66..4bc017c8e 100644 --- a/src/Math/Geometry/Rectangle.h +++ b/src/Math/Geometry/Rectangle.h @@ -25,162 +25,46 @@ */ /** @file - * @brief Class Magnum::Math::Geometry::Rectangle + * @brief Class @ref Magnum::Math::Geometry::Rectangle + * @deprecated Use @ref Math/Range.h instead. */ -#include "Math/Vector2.h" +#include "Math/Range.h" +#ifdef MAGNUM_BUILD_DEPRECATED namespace Magnum { namespace Math { namespace Geometry { /** -@brief %Rectangle - -Helper class for storing axis-aligned rectangles consisting of bottom left and -top right corner positions with origin in bottom left. Bottom/left positions -are inclusive, while top/right positions are exclusive. -@see Magnum::Rectangle, Magnum::Rectanglei, Magnum::Rectangled -@todo rename to Range, make it generic for one, two and three dimensions, add translated(), padded()... -@todo move outside Math? +@copybrief Math::Range2D +@deprecated Use @ref Math::Range2D instead. */ -template class Rectangle { - template friend class Rectangle; - +template class Rectangle: public Range2D { public: - /** - * Create rectangle from position and size - * @param bottomLeft Bottom left rectangle corner - * @param size %Rectangle size - */ - static Rectangle fromSize(const Vector2& bottomLeft, const Vector2& size) { - return {bottomLeft, bottomLeft+size}; - } - - /** - * @brief Construct zero rectangle - * - * Construct zero-area rectangle positioned at origin. - */ - constexpr Rectangle() {} - - /** @brief Construct rectangle from two corners */ - constexpr Rectangle(const Vector2& bottomLeft, const Vector2& topRight): _bottomLeft(bottomLeft), _topRight(topRight) {} - - /** - * @brief Construct rectangle from another of different type - * - * Performs only default casting on the values, no rounding or - * anything else. Example usage: - * @code - * Rectangle floatingPoint({1.3f, 2.7f}, {-15.0f, 7.0f}); - * Rectangle integral(floatingPoint); // {{1, 2}, {-15, 7}} - * @endcode - */ - template constexpr explicit Rectangle(const Rectangle& other): _bottomLeft(other._bottomLeft), _topRight(other._topRight) {} - - /** @brief Copy constructor */ - constexpr Rectangle(const Rectangle&) = default; - - /** @brief Assignment operator */ - Rectangle& operator=(const Rectangle&) = default; - - /** @brief Equality operator */ - constexpr bool operator==(const Rectangle& other) const { - return _bottomLeft == other._bottomLeft && _topRight == other._topRight; - } - - /** @brief Non-equality operator */ - constexpr bool operator!=(const Rectangle& other) const { - return !operator==(other); - } - - /** @brief Bottom left corner */ - Vector2& bottomLeft() { return _bottomLeft; } - constexpr Vector2 bottomLeft() const { return _bottomLeft; } /**< @overload */ - - /** @brief Bottom right corner */ - constexpr Vector2 bottomRight() const { return {_topRight.x(), _bottomLeft.y()}; } /**< @overload */ - - /** @brief Top left corner */ - constexpr Vector2 topLeft() const { return {_bottomLeft.x(), _topRight.y()}; } /**< @overload */ - - /** @brief Top right corner */ - Vector2& topRight() { return _topRight; } - constexpr Vector2 topRight() const { return _topRight; } /**< @overload */ - - /** @brief Bottom edge */ - T& bottom() { return _bottomLeft.y(); } - constexpr T bottom() const { return _bottomLeft.y(); } /**< @overload */ - - /** @brief Top edge */ - T& top() { return _topRight.y(); } - constexpr T top() const { return _topRight.y(); } /**< @overload */ - - /** @brief Left edge */ - T& left() { return _bottomLeft.x(); } - constexpr T left() const { return _bottomLeft.x(); } /**< @overload */ - - /** @brief Right edge */ - T& right() { return _topRight.x(); } - constexpr T right() const { return _topRight.x(); } /**< @overload */ - - /** @brief %Rectangle size */ - constexpr Vector2 size() const { return _topRight-_bottomLeft; } - - /** @brief %Rectangle width */ - constexpr T width() const { return _topRight.x() - _bottomLeft.x(); } - - /** @brief %Rectangle height */ - constexpr T height() const { return _topRight.y() - _bottomLeft.y(); } - - /** @brief Translated rectangle */ - Rectangle translated(const Vector2& vec) { - return {_bottomLeft + vec, _topRight + vec}; - }; - - private: - Vector2 _bottomLeft; - Vector2 _topRight; -}; + /** @copydoc Range2D() */ + constexpr Rectangle() = default; -/** @debugoperator{Magnum::Math::Geometry::Rectangle} */ -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Rectangle& value) { - debug << "Rectangle({"; - debug.setFlag(Corrade::Utility::Debug::SpaceAfterEachValue, false); - debug << value.left() << ", " << value.bottom() << "}, {" << value.right() << ", " << value.top() << "})"; - debug.setFlag(Corrade::Utility::Debug::SpaceAfterEachValue, true); - return debug; -} + /** @copydoc Range2D(const VectorType&, const VectorType&) */ + constexpr Rectangle(const Vector2& min, const Vector2& max): Range2D(min, max) {} -}}} + /** @copydoc Range2D(const Range&) */ + constexpr Rectangle(const Range<2, T>& other): Range2D(other) {} -namespace Corrade { namespace Utility { + /** @copydoc Range2D(const Range&) */ + template constexpr explicit Rectangle(const Range2D& other): Range2D(other) {} + + /** @copydoc Range2D::sizeX() */ + T width() const { return Range2D::sizeX(); } -/** @configurationvalue{Magnum::Math::Geometry::Rectangle} */ -template struct ConfigurationValue> { - ConfigurationValue() = delete; - - /** @brief Writes elements separated with spaces */ - static std::string toString(const Magnum::Math::Geometry::Rectangle& value, const ConfigurationValueFlags flags) { - return ConfigurationValue>::toString( - reinterpret_cast&>(value), flags); - } - - /** @brief Reads elements separated with whitespace */ - static Magnum::Math::Geometry::Rectangle fromString(const std::string& stringValue, const ConfigurationValueFlags flags) { - const auto vec = ConfigurationValue>::fromString(stringValue, flags); - return {{vec[0], vec[1]}, {vec[2], vec[3]}}; - } + /** @copydoc Range2D::sizeY() */ + T height() const { return Range2D::sizeY(); } }; -#ifndef DOXYGEN_GENERATING_OUTPUT -extern template struct MAGNUM_EXPORT ConfigurationValue>; -extern template struct MAGNUM_EXPORT ConfigurationValue>; -extern template struct MAGNUM_EXPORT ConfigurationValue>; -#ifndef MAGNUM_TARGET_GLES -extern template struct MAGNUM_EXPORT ConfigurationValue>; -#endif -#endif +}}} +namespace Corrade { namespace Utility { + /** @configurationvalue{Magnum::Math::Geometry::Rectangle} */ + template struct ConfigurationValue>: public ConfigurationValue> {}; }} +#endif #endif diff --git a/src/Math/Geometry/Test/CMakeLists.txt b/src/Math/Geometry/Test/CMakeLists.txt index 21fcaedb2..0f2129eb4 100644 --- a/src/Math/Geometry/Test/CMakeLists.txt +++ b/src/Math/Geometry/Test/CMakeLists.txt @@ -24,4 +24,3 @@ corrade_add_test(MathGeometryDistanceTest DistanceTest.cpp) corrade_add_test(MathGeometryIntersectionTest IntersectionTest.cpp LIBRARIES MagnumMathTestLib) -corrade_add_test(MathGeometryRectangleTest RectangleTest.cpp LIBRARIES MagnumMathTestLib) diff --git a/src/Math/Geometry/Test/RectangleTest.cpp b/src/Math/Geometry/Test/RectangleTest.cpp deleted file mode 100644 index 8bb46f434..000000000 --- a/src/Math/Geometry/Test/RectangleTest.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/* - This file is part of Magnum. - - Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. -*/ - -#include -#include -#include - -#include "Math/Geometry/Rectangle.h" - -namespace Magnum { namespace Math { namespace Geometry { namespace Test { - -class RectangleTest: public Corrade::TestSuite::Tester { - public: - RectangleTest(); - - void construct(); - void constructDefault(); - void constructFromSize(); - void constructConversion(); - void constructCopy(); - - void access(); - void compare(); - void size(); - - void translated(); - - void debug(); - void configuration(); -}; - -typedef Geometry::Rectangle Rectangle; -typedef Geometry::Rectangle Rectanglei; -typedef Vector2 Vector2i; - -RectangleTest::RectangleTest() { - addTests({&RectangleTest::construct, - &RectangleTest::constructDefault, - &RectangleTest::constructFromSize, - &RectangleTest::constructConversion, - &RectangleTest::constructCopy, - - &RectangleTest::access, - &RectangleTest::compare, - &RectangleTest::size, - - &RectangleTest::translated, - - &RectangleTest::debug, - &RectangleTest::configuration}); -} - -void RectangleTest::construct() { - constexpr Rectanglei a({3, 5}, {23, 78}); - CORRADE_COMPARE(a, Rectanglei({3, 5}, {23, 78})); -} - -void RectangleTest::constructDefault() { - constexpr Rectanglei a; - CORRADE_COMPARE(a, Rectanglei({0, 0}, {0, 0})); -} - -void RectangleTest::constructFromSize() { - CORRADE_COMPARE(Rectanglei::fromSize({3, 5}, {23, 78}), Rectanglei({3, 5}, {26, 83})); -} - -void RectangleTest::constructConversion() { - constexpr Rectangle a({1.3f, 2.7f}, {-15.0f, 7.0f}); - #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr /* Not constexpr under GCC < 4.7 */ - #endif - Rectanglei b(a); - CORRADE_COMPARE(b, Rectanglei({1, 2}, {-15, 7})); - - /* Implicit conversion is not allowed */ - CORRADE_VERIFY(!(std::is_convertible::value)); -} - -void RectangleTest::constructCopy() { - constexpr Rectanglei a({3, 5}, {23, 78}); - constexpr Rectanglei b(a); - CORRADE_COMPARE(b, Rectanglei({3, 5}, {23, 78})); -} - -void RectangleTest::access() { - Rectanglei rect({34, 23}, {47, 30}); - constexpr Rectanglei crect({34, 23}, {47, 30}); - - CORRADE_COMPARE(rect.bottomLeft(), Vector2i(34, 23)); - CORRADE_COMPARE(rect.topRight(), Vector2i(47, 30)); - CORRADE_COMPARE(rect.bottom(), 23); - CORRADE_COMPARE(rect.top(), 30); - CORRADE_COMPARE(rect.left(), 34); - CORRADE_COMPARE(rect.right(), 47); - CORRADE_COMPARE(rect.bottomLeft(), Vector2i(34, 23)); - CORRADE_COMPARE(rect.topRight(), Vector2i(47, 30)); - - constexpr Int bottom = crect.bottom(); - constexpr Int top = crect.top(); - constexpr Int left = crect.left(); - constexpr Int right = crect.right(); - CORRADE_COMPARE(bottom, 23); - CORRADE_COMPARE(top, 30); - CORRADE_COMPARE(left, 34); - CORRADE_COMPARE(right, 47); - - constexpr Vector2i bottomLeft = crect.bottomLeft(); - constexpr Vector2i topRight = crect.topRight(); - CORRADE_COMPARE(bottomLeft, Vector2i(34, 23)); - CORRADE_COMPARE(topRight, Vector2i(47, 30)); - - CORRADE_COMPARE(rect.topLeft(), Vector2i(34, 30)); - CORRADE_COMPARE(rect.bottomRight(), Vector2i(47, 23)); -} - -void RectangleTest::compare() { - CORRADE_VERIFY(Rectanglei({34, 23}, {47, 30}) == Rectanglei({34, 23}, {47, 30})); - CORRADE_VERIFY(Rectanglei({34, 23}, {47, 30}) != Rectanglei({34, 23}, {48, 30})); - CORRADE_VERIFY(Rectanglei({34, 23}, {47, 30}) != Rectanglei({35, 23}, {47, 30})); -} - -void RectangleTest::size() { - Rectanglei rect({34, 23}, {47, 30}); - - CORRADE_COMPARE(rect.size(), Vector2i(13, 7)); - CORRADE_COMPARE(rect.width(), 13); - CORRADE_COMPARE(rect.height(), 7); -} - -void RectangleTest::translated() { - CORRADE_COMPARE(Rectanglei({34, 23}, {47, 30}).translated({-17, 40}), - Rectanglei({17, 63}, {30, 70})); -} - -void RectangleTest::debug() { - std::ostringstream o; - Debug(&o) << Rectanglei({34, 23}, {47, 30}); - - CORRADE_COMPARE(o.str(), "Rectangle({34, 23}, {47, 30})\n"); -} - -void RectangleTest::configuration() { - Corrade::Utility::Configuration c; - - Rectangle rect({3.0f, 3.125f}, {9.0f, 9.55f}); - std::string value("3 3.125 9 9.55"); - - c.setValue("rectangle", rect); - CORRADE_COMPARE(c.value("rectangle"), value); - CORRADE_COMPARE(c.value("rectangle"), rect); -} - -}}}} - -CORRADE_TEST_MAIN(Magnum::Math::Geometry::Test::RectangleTest) diff --git a/src/Math/Geometry/instantiation.cpp b/src/Math/Geometry/instantiation.cpp deleted file mode 100644 index c483599aa..000000000 --- a/src/Math/Geometry/instantiation.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - This file is part of Magnum. - - Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. -*/ - -#include "Math/Geometry/Rectangle.h" - -namespace Corrade { namespace Utility { - -#ifndef DOXYGEN_GENERATING_OUTPUT -template struct ConfigurationValue>; -template struct ConfigurationValue>; -template struct ConfigurationValue>; -#ifndef MAGNUM_TARGET_GLES -template struct ConfigurationValue>; -#endif -#endif - -}} diff --git a/src/Math/Math.h b/src/Math/Math.h index 9a53412b8..27edab373 100644 --- a/src/Math/Math.h +++ b/src/Math/Math.h @@ -82,9 +82,11 @@ template using Range1D = Range<1, T>; template class Range2D; template class Range3D; +#ifdef MAGNUM_BUILD_DEPRECATED namespace Geometry { template class Rectangle; } +#endif }} diff --git a/src/Math/Test/RangeTest.cpp b/src/Math/Test/RangeTest.cpp index 2f790bf81..64cfdd0b3 100644 --- a/src/Math/Test/RangeTest.cpp +++ b/src/Math/Test/RangeTest.cpp @@ -56,6 +56,10 @@ class RangeTest: public Corrade::TestSuite::Tester { void subclassTypes(); void subclass(); + #ifdef MAGNUM_BUILD_DEPRECATED + void deprecated(); + #endif + void debug(); void configuration(); }; @@ -88,6 +92,10 @@ RangeTest::RangeTest() { &RangeTest::subclassTypes, &RangeTest::subclass, + #ifdef MAGNUM_BUILD_DEPRECATED + &RangeTest::deprecated, + #endif + &RangeTest::debug, &RangeTest::configuration}); } @@ -339,6 +347,32 @@ void RangeTest::debug() { CORRADE_COMPARE(o.str(), "Range({34, 23}, {47, 30})\n"); } +#ifdef MAGNUM_BUILD_DEPRECATED +void RangeTest::deprecated() { + typedef Geometry::Rectangle Rectangle; + typedef Geometry::Rectangle Rectanglei; + + Rectanglei a({45, 23}, {-17, 35}); + CORRADE_COMPARE(Rectanglei(), Range2Di({0, 0}, {0, 0})); + CORRADE_COMPARE(a, Range2Di({45, 23}, {-17, 35})); + CORRADE_COMPARE(Rectanglei(a), Range2Di({45, 23}, {-17, 35})); + CORRADE_COMPARE(Rectangle(a), Range2D({45.0f, 23.0f}, {-17.0f, 35.0f})); + + CORRADE_COMPARE(a.width(), -62); + CORRADE_COMPARE(a.height(), 12); + + CORRADE_VERIFY(!(std::is_convertible::value)); + + Corrade::Utility::Configuration c; + Rectangle rect({3.0f, 3.125f}, {9.0f, 9.55f}); + std::string value("3 3.125 9 9.55"); + + c.setValue("rectangle", rect); + CORRADE_COMPARE(c.value("rectangle"), value); + CORRADE_COMPARE(c.value("rectangle"), rect); +} +#endif + void RangeTest::configuration() { Corrade::Utility::Configuration c; diff --git a/src/Math/instantiation.cpp b/src/Math/instantiation.cpp index 27957187f..4c4b899ab 100644 --- a/src/Math/instantiation.cpp +++ b/src/Math/instantiation.cpp @@ -53,32 +53,20 @@ template struct ConfigurationValue>; #endif -/* For some reason mingw's GCC instantiates ConfigurationValue> - (which depends on ConfigurationValue) before - these and then loudly complains about multiple definitions. WTF. */ - template struct ConfigurationValue>; template struct ConfigurationValue>; -#ifndef __MINGW32__ template struct ConfigurationValue>; -#endif template struct ConfigurationValue>; template struct ConfigurationValue>; -#ifndef __MINGW32__ template struct ConfigurationValue>; -#endif template struct ConfigurationValue>; template struct ConfigurationValue>; -#ifndef __MINGW32__ template struct ConfigurationValue>; -#endif #ifndef MAGNUM_TARGET_GLES template struct ConfigurationValue>; template struct ConfigurationValue>; -#ifndef __MINGW32__ template struct ConfigurationValue>; #endif -#endif template struct ConfigurationValue>; template struct ConfigurationValue>; diff --git a/src/Plugins/MagnumFont/MagnumFont.cpp b/src/Plugins/MagnumFont/MagnumFont.cpp index 9f9542a39..09db70764 100644 --- a/src/Plugins/MagnumFont/MagnumFont.cpp +++ b/src/Plugins/MagnumFont/MagnumFont.cpp @@ -52,7 +52,7 @@ namespace { explicit MagnumFontLayouter(const std::vector& glyphAdvance, const GlyphCache& cache, Float fontSize, Float textSize, std::vector&& glyphs); private: - std::tuple doRenderGlyph(UnsignedInt i) override; + std::tuple doRenderGlyph(UnsignedInt i) override; const std::vector& glyphAdvance; const GlyphCache& cache; @@ -196,7 +196,7 @@ std::unique_ptr MagnumFont::doCreateGlyphCache() { /* Fill glyph map */ const std::vector glyphs = _opened->conf.groups("glyph"); for(std::size_t i = 0; i != glyphs.size(); ++i) - cache->insert(i, glyphs[i]->value("position"), glyphs[i]->value("rectangle")); + cache->insert(i, glyphs[i]->value("position"), glyphs[i]->value("rectangle")); return cache; } @@ -219,27 +219,23 @@ namespace { MagnumFontLayouter::MagnumFontLayouter(const std::vector& glyphAdvance, const GlyphCache& cache, const Float fontSize, const Float textSize, std::vector&& glyphs): AbstractLayouter(glyphs.size()), glyphAdvance(glyphAdvance), cache(cache), fontSize(fontSize), textSize(textSize), glyphs(std::move(glyphs)) {} -std::tuple MagnumFontLayouter::doRenderGlyph(const UnsignedInt i) { +std::tuple MagnumFontLayouter::doRenderGlyph(const UnsignedInt i) { /* Position of the texture in the resulting glyph, texture coordinates */ Vector2i position; - Rectanglei rectangle; + Range2Di rectangle; std::tie(position, rectangle) = cache[glyphs[i]]; - const Rectangle texturePosition = Rectangle::fromSize(Vector2(position)/fontSize, - Vector2(rectangle.size())/fontSize); - const Rectangle textureCoordinates(Vector2(rectangle.bottomLeft())/Vector2(cache.textureSize()), - Vector2(rectangle.topRight())/Vector2(cache.textureSize())); + /* Normalized texture coordinates */ + const auto textureCoordinates = Range2D(rectangle).scaled(1.0f/Vector2(cache.textureSize())); - /* Absolute quad position, composed from cursor position, glyph offset - and texture position, denormalized to requested text size */ - Rectangle quadPosition = Rectangle::fromSize( - Vector2(texturePosition.left(), texturePosition.bottom())*textSize, - texturePosition.size()*textSize); + /* Quad rectangle, computed from texture rectangle, denormalized to + requested text size */ + const auto quadRectangle = Range2D(Range2Di::fromSize(position, rectangle.size())).scaled(Vector2(textSize/fontSize)); /* Advance for given glyph, denormalized to requested text size */ const Vector2 advance = glyphAdvance[glyphs[i]]*textSize/fontSize; - return std::make_tuple(quadPosition, textureCoordinates, advance); + return std::make_tuple(quadRectangle, textureCoordinates, advance); } } diff --git a/src/Plugins/MagnumFont/Test/MagnumFontTest.cpp b/src/Plugins/MagnumFont/Test/MagnumFontTest.cpp index c46d5d293..2807c0ced 100644 --- a/src/Plugins/MagnumFont/Test/MagnumFontTest.cpp +++ b/src/Plugins/MagnumFont/Test/MagnumFontTest.cpp @@ -68,33 +68,33 @@ void MagnumFontTest::layout() { CORRADE_VERIFY(layouter); CORRADE_COMPARE(layouter->glyphCount(), 4); - Rectangle rectangle; - Rectangle position; - Rectangle textureCoordinates; + Range2D rectangle; + Range2D position; + Range2D textureCoordinates; /* 'W' */ Vector2 cursorPosition; std::tie(position, textureCoordinates) = layouter->renderGlyph(0, cursorPosition = {}, rectangle); - CORRADE_COMPARE(position, Rectangle({0.78125f, 1.0625f}, {1.28125f, 4.8125f})); - CORRADE_COMPARE(textureCoordinates, Rectangle({0, 0.03125f}, {0.0625f, 0.5f})); + CORRADE_COMPARE(position, Range2D({0.78125f, 1.0625f}, {1.28125f, 4.8125f})); + CORRADE_COMPARE(textureCoordinates, Range2D({0, 0.03125f}, {0.0625f, 0.5f})); CORRADE_COMPARE(cursorPosition, Vector2(0.71875f, 0.0f)); /* 'a' (not found) */ std::tie(position, textureCoordinates) = layouter->renderGlyph(1, cursorPosition = {}, rectangle); - CORRADE_COMPARE(position, Rectangle()); - CORRADE_COMPARE(textureCoordinates, Rectangle()); + CORRADE_COMPARE(position, Range2D()); + CORRADE_COMPARE(textureCoordinates, Range2D()); CORRADE_COMPARE(cursorPosition, Vector2(0.25f, 0.0f)); /* 'v' (not found) */ std::tie(position, textureCoordinates) = layouter->renderGlyph(2, cursorPosition = {}, rectangle); - CORRADE_COMPARE(position, Rectangle()); - CORRADE_COMPARE(textureCoordinates, Rectangle()); + CORRADE_COMPARE(position, Range2D()); + CORRADE_COMPARE(textureCoordinates, Range2D()); CORRADE_COMPARE(cursorPosition, Vector2(0.25f, 0.0f)); /* 'e' */ std::tie(position, textureCoordinates) = layouter->renderGlyph(3, cursorPosition = {}, rectangle); - CORRADE_COMPARE(position, Rectangle({0.78125f, 0.375f}, {2.28125f, 1.25f})); - CORRADE_COMPARE(textureCoordinates, Rectangle({0.0625f, 0.015625f}, {0.25f, 0.125f})); + CORRADE_COMPARE(position, Range2D({0.78125f, 0.375f}, {2.28125f, 1.25f})); + CORRADE_COMPARE(textureCoordinates, Range2D({0.0625f, 0.015625f}, {0.25f, 0.125f})); CORRADE_COMPARE(cursorPosition, Vector2(0.375f, 0.0f)); } diff --git a/src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp b/src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp index 8bea885a8..e21ce5f43 100644 --- a/src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp +++ b/src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp @@ -68,7 +68,7 @@ std::vector>> MagnumFont #else glyphIdMap.insert({0, 0}); #endif - for(const std::pair>& glyph: cache) + for(const std::pair>& glyph: cache) #ifndef CORRADE_GCC46_COMPATIBILITY glyphIdMap.emplace(glyph.first, glyphIdMap.size()); #else @@ -97,11 +97,11 @@ std::vector>> MagnumFont from the values so they aren't added twice when using the font later */ /** @todo Some better way to handle this padding stuff */ for(UnsignedInt oldGlyphId: inverseGlyphIdMap) { - std::pair glyph = cache[oldGlyphId]; + std::pair glyph = cache[oldGlyphId]; Utility::ConfigurationGroup* group = configuration.addGroup("glyph"); group->setValue("advance", font.glyphAdvance(oldGlyphId)); group->setValue("position", glyph.first+cache.padding()); - group->setValue("rectangle", Rectanglei(glyph.second.bottomLeft()+cache.padding(), + group->setValue("rectangle", Range2Di(glyph.second.bottomLeft()+cache.padding(), glyph.second.topRight()-cache.padding())); } diff --git a/src/Renderer.cpp b/src/Renderer.cpp index 9addf07b6..6ce26485d 100644 --- a/src/Renderer.cpp +++ b/src/Renderer.cpp @@ -24,8 +24,8 @@ #include "Renderer.h" +#include "Math/Range.h" #include "Color.h" -#include "Math/Geometry/Rectangle.h" #include "Context.h" #include "Extensions.h" #include "Implementation/State.h" @@ -94,8 +94,8 @@ void Renderer::setPointSize(const Float size) { } #endif -void Renderer::setScissor(const Rectanglei& rectangle) { - glScissor(rectangle.left(), rectangle.bottom(), rectangle.width(), rectangle.height()); +void Renderer::setScissor(const Range2Di& rectangle) { + glScissor(rectangle.left(), rectangle.bottom(), rectangle.sizeX(), rectangle.sizeY()); } void Renderer::setStencilFunction(const PolygonFacing facing, const StencilFunction function, const Int referenceValue, const UnsignedInt mask) { diff --git a/src/Renderer.h b/src/Renderer.h index 394fd2300..bdad9382d 100644 --- a/src/Renderer.h +++ b/src/Renderer.h @@ -414,7 +414,7 @@ class MAGNUM_EXPORT Renderer { * * @see @ref Feature::ScissorTest, @fn_gl{Scissor} */ - static void setScissor(const Rectanglei& rectangle); + static void setScissor(const Range2Di& rectangle); /*@}*/ diff --git a/src/Text/AbstractFont.cpp b/src/Text/AbstractFont.cpp index 75fd06609..dace4ac51 100644 --- a/src/Text/AbstractFont.cpp +++ b/src/Text/AbstractFont.cpp @@ -166,11 +166,11 @@ AbstractLayouter::AbstractLayouter(UnsignedInt glyphCount): _glyphCount(glyphCou AbstractLayouter::~AbstractLayouter() {} -std::pair AbstractLayouter::renderGlyph(const UnsignedInt i, Vector2& cursorPosition, Rectangle& rectangle) { +std::pair AbstractLayouter::renderGlyph(const UnsignedInt i, Vector2& cursorPosition, Range2D& rectangle) { CORRADE_ASSERT(i < glyphCount(), "Text::AbstractLayouter::renderGlyph(): glyph index out of bounds", {}); /* Render the glyph */ - Rectangle quadPosition, textureCoordinates; + Range2D quadPosition, textureCoordinates; Vector2 advance; std::tie(quadPosition, textureCoordinates, advance) = doRenderGlyph(i); diff --git a/src/Text/AbstractFont.h b/src/Text/AbstractFont.h index 96f034f1f..a32a7ef70 100644 --- a/src/Text/AbstractFont.h +++ b/src/Text/AbstractFont.h @@ -314,7 +314,7 @@ class MAGNUM_TEXT_EXPORT AbstractLayouter { * advances @p cursorPosition to next character and updates @p rectangle * with extended bounds. */ - std::pair renderGlyph(UnsignedInt i, Vector2& cursorPosition, Rectangle& rectangle); + std::pair renderGlyph(UnsignedInt i, Vector2& cursorPosition, Range2D& rectangle); protected: /** @@ -335,7 +335,7 @@ class MAGNUM_TEXT_EXPORT AbstractLayouter { * Return quad position (relative to current cursor position), texture * coordinates and advance to next glyph. */ - virtual std::tuple doRenderGlyph(UnsignedInt i) = 0; + virtual std::tuple doRenderGlyph(UnsignedInt i) = 0; #ifdef DOXYGEN_GENERATING_OUTPUT private: diff --git a/src/Text/DistanceFieldGlyphCache.cpp b/src/Text/DistanceFieldGlyphCache.cpp index 0e88dcc1f..9110108d4 100644 --- a/src/Text/DistanceFieldGlyphCache.cpp +++ b/src/Text/DistanceFieldGlyphCache.cpp @@ -80,7 +80,7 @@ void DistanceFieldGlyphCache::setImage(const Vector2i& offset, const ImageRefere .setImage(0, internalFormat, image); /* Create distance field from input texture */ - TextureTools::distanceField(input, texture(), Rectanglei::fromSize(offset*scale, image.size()*scale), radius, image.size()); + TextureTools::distanceField(input, texture(), Range2Di::fromSize(offset*scale, image.size()*scale), radius, image.size()); } void DistanceFieldGlyphCache::setDistanceFieldImage(const Vector2i& offset, const ImageReference2D& image) { diff --git a/src/Text/GlyphCache.cpp b/src/Text/GlyphCache.cpp index d9700a1a8..ec43b95d0 100644 --- a/src/Text/GlyphCache.cpp +++ b/src/Text/GlyphCache.cpp @@ -78,14 +78,14 @@ void GlyphCache::initialize(const TextureFormat internalFormat, const Vector2i& glyphs.insert({0, {}}); } -std::vector GlyphCache::reserve(const std::vector& sizes) { - CORRADE_ASSERT((glyphs.size() == 1 && glyphs.at(0) == std::pair()), - "Text::GlyphCache::reserve(): reserving space in non-empty cache is not yet implemented", std::vector{}); +std::vector GlyphCache::reserve(const std::vector& sizes) { + CORRADE_ASSERT((glyphs.size() == 1 && glyphs.at(0) == std::pair()), + "Text::GlyphCache::reserve(): reserving space in non-empty cache is not yet implemented", std::vector{}); glyphs.reserve(glyphs.size() + sizes.size()); return TextureTools::atlas(_size, sizes, _padding); } -void GlyphCache::insert(const UnsignedInt glyph, Vector2i position, Rectanglei rectangle) { +void GlyphCache::insert(const UnsignedInt glyph, Vector2i position, Range2Di rectangle) { position -= _padding; rectangle.bottomLeft() -= _padding; rectangle.topRight() += _padding; diff --git a/src/Text/GlyphCache.h b/src/Text/GlyphCache.h index 1070e7990..8e45ab68a 100644 --- a/src/Text/GlyphCache.h +++ b/src/Text/GlyphCache.h @@ -31,7 +31,7 @@ #include #include -#include "Math/Geometry/Rectangle.h" +#include "Math/Range.h" #include "Texture.h" #include "Text/magnumTextVisibility.h" @@ -130,18 +130,18 @@ class MAGNUM_TEXT_EXPORT GlyphCache { * to some meaningful value in @ref insert(). * @see @ref padding() */ - std::pair operator[](UnsignedInt glyph) const { + std::pair operator[](UnsignedInt glyph) const { auto it = glyphs.find(glyph); return it == glyphs.end() ? glyphs.at(0) : it->second; } /** @brief Iterator access to cache data */ - std::unordered_map>::const_iterator begin() const { + std::unordered_map>::const_iterator begin() const { return glyphs.begin(); } /** @brief Iterator access to cache data */ - std::unordered_map>::const_iterator end() const { + std::unordered_map>::const_iterator end() const { return glyphs.end(); } @@ -159,7 +159,7 @@ class MAGNUM_TEXT_EXPORT GlyphCache { * glyphs. * @see @ref padding() */ - std::vector reserve(const std::vector& sizes); + std::vector reserve(const std::vector& sizes); /** * @brief Insert glyph to cache @@ -176,7 +176,7 @@ class MAGNUM_TEXT_EXPORT GlyphCache { * See also @ref setImage() to upload glyph image. * @see @ref padding() */ - void insert(UnsignedInt glyph, Vector2i position, Rectanglei rectangle); + void insert(UnsignedInt glyph, Vector2i position, Range2Di rectangle); /** * @brief Set cache image @@ -193,7 +193,7 @@ class MAGNUM_TEXT_EXPORT GlyphCache { Vector2i _size, _padding; Texture2D _texture; - std::unordered_map> glyphs; + std::unordered_map> glyphs; }; }} diff --git a/src/Text/Renderer.cpp b/src/Text/Renderer.cpp index 40c0bb36b..96ae1ecad 100644 --- a/src/Text/Renderer.cpp +++ b/src/Text/Renderer.cpp @@ -58,7 +58,7 @@ struct Vertex { Vector2 position, textureCoordinates; }; -std::tuple, Rectangle> renderVerticesInternal(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, const Alignment alignment) { +std::tuple, Range2D> renderVerticesInternal(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, const Alignment alignment) { /* Output data, reserve memory as when the text would be ASCII-only. In reality the actual vertex count will be smaller, but allocating more at once is better than reallocating many times later. */ @@ -66,7 +66,7 @@ std::tuple, Rectangle> renderVerticesInternal(AbstractFont& vertices.reserve(text.size()*4); /* Total rendered bounds, intial line position, last+1 vertex on previous line */ - Rectangle rectangle; + Range2D rectangle; Vector2 linePosition; std::size_t lastLineLastVertex = 0; @@ -98,12 +98,12 @@ std::tuple, Rectangle> renderVerticesInternal(AbstractFont& CORRADE_INTERNAL_ASSERT(vertices.size()+vertexCount <= vertices.capacity()); /* Bounds of rendered line */ - Rectangle lineRectangle; + Range2D lineRectangle; /* Render all glyphs */ Vector2 cursorPosition(linePosition); for(UnsignedInt i = 0; i != layouter->glyphCount(); ++i) { - Rectangle quadPosition, textureCoordinates; + Range2D quadPosition, textureCoordinates; std::tie(quadPosition, textureCoordinates) = layouter->renderGlyph(i, cursorPosition, lineRectangle); /* 0---2 @@ -125,7 +125,7 @@ std::tuple, Rectangle> renderVerticesInternal(AbstractFont& /* Horizontally align the rendered line */ Float alignmentOffsetX = 0.0f; if((UnsignedByte(alignment) & Implementation::AlignmentHorizontal) == Implementation::AlignmentCenter) - alignmentOffsetX = -lineRectangle.left()-lineRectangle.width()*0.5f; + alignmentOffsetX = -lineRectangle.centerX(); else if((UnsignedByte(alignment) & Implementation::AlignmentHorizontal) == Implementation::AlignmentRight) alignmentOffsetX = -lineRectangle.right(); @@ -153,7 +153,7 @@ std::tuple, Rectangle> renderVerticesInternal(AbstractFont& /* Vertically align the rendered text */ Float alignmentOffsetY = 0.0f; if((UnsignedByte(alignment) & Implementation::AlignmentVertical) == Implementation::AlignmentMiddle) - alignmentOffsetY = -rectangle.bottom()-rectangle.height()*0.5f; + alignmentOffsetY = -rectangle.centerY(); else if((UnsignedByte(alignment) & Implementation::AlignmentVertical) == Implementation::AlignmentTop) alignmentOffsetY = -rectangle.top(); @@ -191,10 +191,10 @@ std::pair, Mesh::IndexType> renderIndicesIntern return {std::move(indices), indexType}; } -std::tuple renderInternal(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, Buffer& vertexBuffer, Buffer& indexBuffer, BufferUsage usage, Alignment alignment) { +std::tuple renderInternal(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, Buffer& vertexBuffer, Buffer& indexBuffer, BufferUsage usage, Alignment alignment) { /* Render vertices and upload them */ std::vector vertices; - Rectangle rectangle; + Range2D rectangle; std::tie(vertices, rectangle) = renderVerticesInternal(font, cache, size, text, alignment); vertexBuffer.setData(vertices, usage); @@ -220,10 +220,10 @@ std::tuple renderInternal(AbstractFont& font, const GlyphCache& } -std::tuple, std::vector, std::vector, Rectangle> AbstractRenderer::render(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, Alignment alignment) { +std::tuple, std::vector, std::vector, Range2D> AbstractRenderer::render(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, Alignment alignment) { /* Render vertices */ std::vector vertices; - Rectangle rectangle; + Range2D rectangle; std::tie(vertices, rectangle) = renderVerticesInternal(font, cache, size, text, alignment); /* Deinterleave the vertices */ @@ -243,7 +243,7 @@ std::tuple, std::vector, std::vector, return std::make_tuple(std::move(positions), std::move(textureCoordinates), std::move(indices), rectangle); } -template std::tuple Renderer::render(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, Buffer& vertexBuffer, Buffer& indexBuffer, BufferUsage usage, Alignment alignment) { +template std::tuple Renderer::render(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, Buffer& vertexBuffer, Buffer& indexBuffer, BufferUsage usage, Alignment alignment) { /* Finalize mesh configuration and return the result */ auto r = renderInternal(font, cache, size, text, vertexBuffer, indexBuffer, usage, alignment); Mesh& mesh = std::get<0>(r); diff --git a/src/Text/Renderer.h b/src/Text/Renderer.h index 8f794e489..235377b20 100644 --- a/src/Text/Renderer.h +++ b/src/Text/Renderer.h @@ -32,7 +32,7 @@ #include #include -#include "Math/Geometry/Rectangle.h" +#include "Math/Range.h" #include "Buffer.h" #include "DimensionTraits.h" #include "Mesh.h" @@ -62,7 +62,7 @@ class MAGNUM_TEXT_EXPORT AbstractRenderer { * Returns tuple with vertex positions, texture coordinates, indices * and rectangle spanning the rendered text. */ - static std::tuple, std::vector, std::vector, Rectangle> render(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, Alignment alignment = Alignment::LineLeft); + static std::tuple, std::vector, std::vector, Range2D> render(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, Alignment alignment = Alignment::LineLeft); /** * @brief Capacity for rendered glyphs @@ -72,7 +72,7 @@ class MAGNUM_TEXT_EXPORT AbstractRenderer { UnsignedInt capacity() const { return _capacity; } /** @brief Rectangle spanning the rendered text */ - Rectangle rectangle() const { return _rectangle; } + Range2D rectangle() const { return _rectangle; } /** @brief Vertex buffer */ Buffer& vertexBuffer() { return _vertexBuffer; } @@ -131,7 +131,7 @@ class MAGNUM_TEXT_EXPORT AbstractRenderer { Float size; Alignment _alignment; UnsignedInt _capacity; - Rectangle _rectangle; + Range2D _rectangle; #if defined(MAGNUM_TARGET_GLES2) && !defined(CORRADE_TARGET_EMSCRIPTEN) typedef void*(*BufferMapImplementation)(Buffer&, GLsizeiptr); @@ -184,7 +184,7 @@ Buffer vertexBuffer, indexBuffer; Mesh mesh; // Render the text -Rectangle rectangle; +Range2D rectangle; std::tie(mesh, rectangle) = Text::Renderer2D::render(*font, cache, 0.15f, "Hello World!", vertexBuffer, indexBuffer, Buffer::Usage::StaticDraw); @@ -250,7 +250,7 @@ template class MAGNUM_TEXT_EXPORT Renderer: public Abstr * Returns mesh prepared for use with @ref Shaders::AbstractVector * subclasses and rectangle spanning the rendered text. */ - static std::tuple render(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, Buffer& vertexBuffer, Buffer& indexBuffer, BufferUsage usage, Alignment alignment = Alignment::LineLeft); + static std::tuple render(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, Buffer& vertexBuffer, Buffer& indexBuffer, BufferUsage usage, Alignment alignment = Alignment::LineLeft); /** * @brief Constructor diff --git a/src/Text/Test/AbstractLayouterTest.cpp b/src/Text/Test/AbstractLayouterTest.cpp index 5da5b0584..18d5feb8e 100644 --- a/src/Text/Test/AbstractLayouterTest.cpp +++ b/src/Text/Test/AbstractLayouterTest.cpp @@ -24,7 +24,7 @@ #include -#include "Math/Geometry/Rectangle.h" +#include "Math/Range.h" #include "Text/AbstractFont.h" namespace Magnum { namespace Text { namespace Test { @@ -46,38 +46,38 @@ void AbstractLayouterTest::renderGlyph() { explicit Layouter(): AbstractLayouter(3) {} private: - std::tuple doRenderGlyph(UnsignedInt) override { - return std::make_tuple(Rectangle({1.0f, 0.5f}, {1.1f, 1.0f}), - Rectangle({0.3f, 1.1f}, {-0.5f, 0.7f}), + std::tuple doRenderGlyph(UnsignedInt) override { + return std::make_tuple(Range2D({1.0f, 0.5f}, {1.1f, 1.0f}), + Range2D({0.3f, 1.1f}, {-0.5f, 0.7f}), Vector2(2.0f, -1.0f)); } }; /* Rectangle of zero size shouldn't be merged, but replaced */ - Rectangle rectangle({-1.0f, -1.0f}, {-1.0f, -1.0f}); + Range2D rectangle({-1.0f, -1.0f}, {-1.0f, -1.0f}); Vector2 cursorPosition(1.0f, 2.0f); Layouter l; - Rectangle quadPosition; - Rectangle textureCoords; + Range2D quadPosition; + Range2D textureCoords; std::tie(quadPosition, textureCoords) = l.renderGlyph(0, cursorPosition, rectangle); - CORRADE_COMPARE(quadPosition, Rectangle({2.0f, 2.5f}, {2.1f, 3.0f})); - CORRADE_COMPARE(textureCoords, Rectangle({0.3f, 1.1f}, {-0.5f, 0.7f})); + CORRADE_COMPARE(quadPosition, Range2D({2.0f, 2.5f}, {2.1f, 3.0f})); + CORRADE_COMPARE(textureCoords, Range2D({0.3f, 1.1f}, {-0.5f, 0.7f})); CORRADE_COMPARE(cursorPosition, Vector2(3.0f, 1.0f)); - CORRADE_COMPARE(rectangle, Rectangle({2.0f, 2.5f}, {2.1f, 3.0f})); + CORRADE_COMPARE(rectangle, Range2D({2.0f, 2.5f}, {2.1f, 3.0f})); std::tie(quadPosition, textureCoords) = l.renderGlyph(1, cursorPosition, rectangle); - CORRADE_COMPARE(quadPosition, Rectangle({4.0f, 1.5f}, {4.1f, 2.0f})); - CORRADE_COMPARE(textureCoords, Rectangle({0.3f, 1.1f}, {-0.5f, 0.7f})); + CORRADE_COMPARE(quadPosition, Range2D({4.0f, 1.5f}, {4.1f, 2.0f})); + CORRADE_COMPARE(textureCoords, Range2D({0.3f, 1.1f}, {-0.5f, 0.7f})); CORRADE_COMPARE(cursorPosition, Vector2(5.0f, 0.0f)); - CORRADE_COMPARE(rectangle, Rectangle({2.0f, 1.5f}, {4.1f, 3.0f})); + CORRADE_COMPARE(rectangle, Range2D({2.0f, 1.5f}, {4.1f, 3.0f})); std::tie(quadPosition, textureCoords) = l.renderGlyph(2, cursorPosition, rectangle); - CORRADE_COMPARE(quadPosition, Rectangle({6.0f, 0.5f}, {6.1f, 1.0f})); - CORRADE_COMPARE(textureCoords, Rectangle({0.3f, 1.1f}, {-0.5f, 0.7f})); + CORRADE_COMPARE(quadPosition, Range2D({6.0f, 0.5f}, {6.1f, 1.0f})); + CORRADE_COMPARE(textureCoords, Range2D({0.3f, 1.1f}, {-0.5f, 0.7f})); CORRADE_COMPARE(cursorPosition, Vector2(7.0f, -1.0f)); - CORRADE_COMPARE(rectangle, Rectangle({2.0f, 0.5f}, {6.1f, 3.0f})); + CORRADE_COMPARE(rectangle, Range2D({2.0f, 0.5f}, {6.1f, 3.0f})); } }}} diff --git a/src/Text/Test/GlyphCacheGLTest.cpp b/src/Text/Test/GlyphCacheGLTest.cpp index 61790a90e..76c95f6a7 100644 --- a/src/Text/Test/GlyphCacheGLTest.cpp +++ b/src/Text/Test/GlyphCacheGLTest.cpp @@ -54,32 +54,32 @@ void GlyphCacheGLTest::initialize() { void GlyphCacheGLTest::access() { Text::GlyphCache cache(Vector2i(236)); Vector2i position; - Rectanglei rectangle; + Range2Di rectangle; /* Default "Not Found" glyph */ CORRADE_COMPARE(cache.glyphCount(), 1); std::tie(position, rectangle) = cache[0]; CORRADE_COMPARE(position, Vector2i(0, 0)); - CORRADE_COMPARE(rectangle, Rectanglei({0, 0}, {0, 0})); + CORRADE_COMPARE(rectangle, Range2Di({0, 0}, {0, 0})); /* Overwrite "Not Found" glyph */ cache.insert(0, {3, 5}, {{10, 10}, {23, 45}}); CORRADE_COMPARE(cache.glyphCount(), 1); std::tie(position, rectangle) = cache[0]; CORRADE_COMPARE(position, Vector2i(3, 5)); - CORRADE_COMPARE(rectangle, Rectanglei({10, 10}, {23, 45})); + CORRADE_COMPARE(rectangle, Range2Di({10, 10}, {23, 45})); /* Querying available glyph */ cache.insert(25, {3, 4}, {{15, 30}, {45, 35}}); CORRADE_COMPARE(cache.glyphCount(), 2); std::tie(position, rectangle) = cache[25]; CORRADE_COMPARE(position, Vector2i(3, 4)); - CORRADE_COMPARE(rectangle, Rectanglei({15, 30}, {45, 35})); + CORRADE_COMPARE(rectangle, Range2Di({15, 30}, {45, 35})); /* Querying not available glyph falls back to "Not Found" */ std::tie(position, rectangle) = cache[42]; CORRADE_COMPARE(position, Vector2i(3, 5)); - CORRADE_COMPARE(rectangle, Rectanglei({10, 10}, {23, 45})); + CORRADE_COMPARE(rectangle, Range2Di({10, 10}, {23, 45})); } void GlyphCacheGLTest::reserve() { diff --git a/src/Text/Test/RendererGLTest.cpp b/src/Text/Test/RendererGLTest.cpp index 637b82122..7822b74ab 100644 --- a/src/Text/Test/RendererGLTest.cpp +++ b/src/Text/Test/RendererGLTest.cpp @@ -54,10 +54,10 @@ class TestLayouter: public Text::AbstractLayouter { explicit TestLayouter(Float size, std::size_t glyphCount): AbstractLayouter(glyphCount), _size(size) {} private: - std::tuple doRenderGlyph(UnsignedInt i) override { + std::tuple doRenderGlyph(UnsignedInt i) override { return std::make_tuple( - Rectangle({}, Vector2(3.0f, 2.0f)*((i+1)*_size)), - Rectangle::fromSize({i*6.0f, 0.0f}, {6.0f, 10.0f}), + Range2D({}, Vector2(3.0f, 2.0f)*((i+1)*_size)), + Range2D::fromSize({i*6.0f, 0.0f}, {6.0f, 10.0f}), (Vector2::xAxis((i+1)*3.0f)+Vector2(1.0f, -1.0f))*_size ); } @@ -86,7 +86,7 @@ void RendererGLTest::renderData() { std::vector positions; std::vector textureCoordinates; std::vector indices; - Rectangle bounds; + Range2D bounds; std::tie(positions, textureCoordinates, indices, bounds) = Text::AbstractRenderer::render(font, *static_cast(nullptr), 0.25f, "abc", Alignment::MiddleRightIntegral); /* Three glyphs, three quads -> 12 vertices, 18 indices */ @@ -98,7 +98,7 @@ void RendererGLTest::renderData() { const Vector2 offset{-5.0f, 0.0f}; /* Bounds */ - CORRADE_COMPARE(bounds, Rectangle({0.0f, -0.5f}, {5.0f, 1.0f}).translated(offset)); + CORRADE_COMPARE(bounds, Range2D({0.0f, -0.5f}, {5.0f, 1.0f}).translated(offset)); /* Vertex positions and texture coordinates 0---2 @@ -168,7 +168,7 @@ void RendererGLTest::renderMesh() { TestFont font; Mesh mesh; Buffer vertexBuffer, indexBuffer; - Rectangle bounds; + Range2D bounds; std::tie(mesh, bounds) = Text::Renderer3D::render(font, *static_cast(nullptr), 0.25f, "abc", vertexBuffer, indexBuffer, BufferUsage::StaticDraw, Alignment::TopCenter); MAGNUM_VERIFY_NO_ERROR(); @@ -176,7 +176,7 @@ void RendererGLTest::renderMesh() { const Vector2 offset{-2.5f, -1.0f}; /* Bounds */ - CORRADE_COMPARE(bounds, Rectangle({0.0f, -0.5f}, {5.0f, 1.0f}).translated(offset)); + CORRADE_COMPARE(bounds, Range2D({0.0f, -0.5f}, {5.0f, 1.0f}).translated(offset)); /** @todo How to verify this on ES? */ #ifndef MAGNUM_TARGET_GLES @@ -213,7 +213,7 @@ void RendererGLTest::mutableText() { Text::Renderer2D renderer(font, *static_cast(nullptr), 0.25f); MAGNUM_VERIFY_NO_ERROR(); CORRADE_COMPARE(renderer.capacity(), 0); - CORRADE_COMPARE(renderer.rectangle(), Rectangle()); + CORRADE_COMPARE(renderer.rectangle(), Range2D()); /* Reserve some capacity */ renderer.reserve(4, BufferUsage::StaticDraw, BufferUsage::StaticDraw); @@ -235,7 +235,7 @@ void RendererGLTest::mutableText() { MAGNUM_VERIFY_NO_ERROR(); /* Updated bounds */ - CORRADE_COMPARE(renderer.rectangle(), Rectangle({0.0f, -0.5f}, {5.0f, 1.0f})); + CORRADE_COMPARE(renderer.rectangle(), Range2D({0.0f, -0.5f}, {5.0f, 1.0f})); /* Aligned to line/left, no offset needed */ @@ -267,8 +267,8 @@ void RendererGLTest::multiline() { explicit Layouter(UnsignedInt glyphs): AbstractLayouter(glyphs) {} private: - std::tuple doRenderGlyph(UnsignedInt) override { - return std::make_tuple(Rectangle({}, Vector2(1.0f)), Rectangle({}, Vector2(1.0f)), Vector2::xAxis(2.0f)); + std::tuple doRenderGlyph(UnsignedInt) override { + return std::make_tuple(Range2D({}, Vector2(1.0f)), Range2D({}, Vector2(1.0f)), Vector2::xAxis(2.0f)); } }; @@ -299,14 +299,14 @@ void RendererGLTest::multiline() { Font font; font.openFile({}, 0.0f); - Rectangle rectangle; + Range2D rectangle; std::vector indices; std::vector positions, textureCoordinates; std::tie(positions, textureCoordinates, indices, rectangle) = Text::Renderer2D::render(font, *static_cast(nullptr), 0.0f, "abcd\nef\n\nghi", Alignment::MiddleCenter); /* Bounds */ - CORRADE_COMPARE(rectangle, Rectangle({-3.5f, -5.0f}, {3.5f, 5.0f})); + CORRADE_COMPARE(rectangle, Range2D({-3.5f, -5.0f}, {3.5f, 5.0f})); /* Vertices [a] [b] [c] [d] diff --git a/src/TextureTools/Atlas.cpp b/src/TextureTools/Atlas.cpp index 89f17dbc5..2db816d0b 100644 --- a/src/TextureTools/Atlas.cpp +++ b/src/TextureTools/Atlas.cpp @@ -25,19 +25,19 @@ #include "Atlas.h" #include "Math/Functions.h" -#include "Math/Geometry/Rectangle.h" +#include "Math/Range.h" namespace Magnum { namespace TextureTools { -std::vector atlas(const Vector2i& atlasSize, const std::vector& sizes, const Vector2i& padding) { - if(sizes.empty()) return std::vector{}; +std::vector atlas(const Vector2i& atlasSize, const std::vector& sizes, const Vector2i& padding) { + if(sizes.empty()) return std::vector{}; /* Size of largest texture */ Vector2i maxSize; for(const Vector2i& size: sizes) maxSize = Math::max(maxSize, size); - std::vector atlas; + std::vector atlas; /* Columns and rows */ const Vector2i paddedSize = maxSize+2*padding; @@ -53,7 +53,7 @@ std::vector atlas(const Vector2i& atlasSize, const std::vector MAGNUM_TEXTURETOOLS_EXPORT atlas(const Vector2i& atlasSize, const std::vector& sizes, const Vector2i& padding = Vector2i()); +std::vector MAGNUM_TEXTURETOOLS_EXPORT atlas(const Vector2i& atlasSize, const std::vector& sizes, const Vector2i& padding = Vector2i()); }} diff --git a/src/TextureTools/DistanceField.cpp b/src/TextureTools/DistanceField.cpp index 5805ec200..b8d8aa2ba 100644 --- a/src/TextureTools/DistanceField.cpp +++ b/src/TextureTools/DistanceField.cpp @@ -26,7 +26,7 @@ #include -#include "Math/Geometry/Rectangle.h" +#include "Math/Range.h" #include "AbstractShaderProgram.h" #include "Buffer.h" #include "Extensions.h" @@ -131,9 +131,9 @@ DistanceFieldShader::DistanceFieldShader(): radiusUniform(0), scalingUniform(1) } #ifndef MAGNUM_TARGET_GLES -void distanceField(Texture2D& input, Texture2D& output, const Rectanglei& rectangle, const Int radius, const Vector2i&) +void distanceField(Texture2D& input, Texture2D& output, const Range2Di& rectangle, const Int radius, const Vector2i&) #else -void distanceField(Texture2D& input, Texture2D& output, const Rectanglei& rectangle, const Int radius, const Vector2i& imageSize) +void distanceField(Texture2D& input, Texture2D& output, const Range2Di& rectangle, const Int radius, const Vector2i& imageSize) #endif { #ifndef MAGNUM_TARGET_GLES diff --git a/src/TextureTools/DistanceField.h b/src/TextureTools/DistanceField.h index 753ae54a0..dae2ec61c 100644 --- a/src/TextureTools/DistanceField.h +++ b/src/TextureTools/DistanceField.h @@ -85,9 +85,9 @@ http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_AlphaTestedMagnifica (jaggies, visible e.g. when rendering outlined fonts) */ #ifndef MAGNUM_TARGET_GLES -void MAGNUM_TEXTURETOOLS_EXPORT distanceField(Texture2D& input, Texture2D& output, const Rectanglei& rectangle, Int radius, const Vector2i& imageSize = Vector2i()); +void MAGNUM_TEXTURETOOLS_EXPORT distanceField(Texture2D& input, Texture2D& output, const Range2Di& rectangle, Int radius, const Vector2i& imageSize = Vector2i()); #else -void MAGNUM_TEXTURETOOLS_EXPORT distanceField(Texture2D& input, Texture2D& output, const Rectanglei& rectangle, Int radius, const Vector2i& imageSize); +void MAGNUM_TEXTURETOOLS_EXPORT distanceField(Texture2D& input, Texture2D& output, const Range2Di& rectangle, Int radius, const Vector2i& imageSize); #endif }} diff --git a/src/TextureTools/Test/AtlasTest.cpp b/src/TextureTools/Test/AtlasTest.cpp index 178a57803..11d8a4c32 100644 --- a/src/TextureTools/Test/AtlasTest.cpp +++ b/src/TextureTools/Test/AtlasTest.cpp @@ -25,7 +25,7 @@ #include #include -#include "Math/Geometry/Rectangle.h" +#include "Math/Range.h" #include "TextureTools/Atlas.h" namespace Magnum { namespace TextureTools { namespace Test { @@ -48,35 +48,35 @@ AtlasTest::AtlasTest() { } void AtlasTest::create() { - std::vector atlas = TextureTools::atlas({64, 64}, { + std::vector atlas = TextureTools::atlas({64, 64}, { {12, 18}, {32, 15}, {23, 25} }); CORRADE_COMPARE(atlas.size(), 3); - CORRADE_COMPARE(atlas, (std::vector{ - Rectanglei::fromSize({0, 0}, {12, 18}), - Rectanglei::fromSize({32, 0}, {32, 15}), - Rectanglei::fromSize({0, 25}, {23, 25})})); + CORRADE_COMPARE(atlas, (std::vector{ + Range2Di::fromSize({0, 0}, {12, 18}), + Range2Di::fromSize({32, 0}, {32, 15}), + Range2Di::fromSize({0, 25}, {23, 25})})); } void AtlasTest::createPadding() { - std::vector atlas = TextureTools::atlas({64, 64}, { + std::vector atlas = TextureTools::atlas({64, 64}, { {8, 16}, {28, 13}, {19, 23} }, {2, 1}); CORRADE_COMPARE(atlas.size(), 3); - CORRADE_COMPARE(atlas, (std::vector{ - Rectanglei::fromSize({2, 1}, {8, 16}), - Rectanglei::fromSize({34, 1}, {28, 13}), - Rectanglei::fromSize({2, 26}, {19, 23})})); + CORRADE_COMPARE(atlas, (std::vector{ + Range2Di::fromSize({2, 1}, {8, 16}), + Range2Di::fromSize({34, 1}, {28, 13}), + Range2Di::fromSize({2, 26}, {19, 23})})); } void AtlasTest::createEmpty() { - std::vector atlas = TextureTools::atlas({}, std::vector{}); + std::vector atlas = TextureTools::atlas({}, std::vector{}); CORRADE_VERIFY(atlas.empty()); } @@ -84,7 +84,7 @@ void AtlasTest::createTooSmall() { std::ostringstream o; Error::setOutput(&o); - std::vector atlas = TextureTools::atlas({64, 32}, { + std::vector atlas = TextureTools::atlas({64, 32}, { {8, 16}, {21, 13}, {19, 29} diff --git a/src/TextureTools/distancefieldconverter.cpp b/src/TextureTools/distancefieldconverter.cpp index 096e9d8ad..e61b17e45 100644 --- a/src/TextureTools/distancefieldconverter.cpp +++ b/src/TextureTools/distancefieldconverter.cpp @@ -25,7 +25,7 @@ #include #include -#include "Math/Geometry/Rectangle.h" +#include "Math/Range.h" #include "ColorFormat.h" #include "Image.h" #include "Renderer.h" From e6b15ed7975080cf2be91ccb84fa7a042d578743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 29 Nov 2013 01:13:13 +0100 Subject: [PATCH 083/105] MagnumFont: save one division per glyph. --- src/Plugins/MagnumFont/MagnumFont.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plugins/MagnumFont/MagnumFont.cpp b/src/Plugins/MagnumFont/MagnumFont.cpp index 09db70764..dbaf1c2f6 100644 --- a/src/Plugins/MagnumFont/MagnumFont.cpp +++ b/src/Plugins/MagnumFont/MagnumFont.cpp @@ -233,7 +233,7 @@ std::tuple MagnumFontLayouter::doRenderGlyph(const Un const auto quadRectangle = Range2D(Range2Di::fromSize(position, rectangle.size())).scaled(Vector2(textSize/fontSize)); /* Advance for given glyph, denormalized to requested text size */ - const Vector2 advance = glyphAdvance[glyphs[i]]*textSize/fontSize; + const Vector2 advance = glyphAdvance[glyphs[i]]*(textSize/fontSize); return std::make_tuple(quadRectangle, textureCoordinates, advance); } From 086570581357f17fd78011ac5c0c0b286aae0f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 29 Nov 2013 01:55:10 +0100 Subject: [PATCH 084/105] Math: fix Range compilation with Clang, mark the constructors as implicit. Somehow defaulted constructor is not enough and Clang complained about no user-provided default constructor. --- src/Math/Range.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Math/Range.h b/src/Math/Range.h index 5489c9ff8..e914f02ec 100644 --- a/src/Math/Range.h +++ b/src/Math/Range.h @@ -204,13 +204,13 @@ See @ref Range for more information. template class Range2D: public Range<2, T> { public: /** @copydoc Range() */ - constexpr Range2D() = default; + constexpr /*implicit*/ Range2D() {} /** @copydoc Range(const VectorType&, const VectorType&) */ - constexpr Range2D(const Vector2& min, const Vector2& max): Range<2, T>(min, max) {} + constexpr /*implicit*/ Range2D(const Vector2& min, const Vector2& max): Range<2, T>(min, max) {} /** @copydoc Range(const Range&) */ - constexpr Range2D(const Range<2, T>& other): Range<2, T>(other) {} + constexpr /*implicit*/ Range2D(const Range<2, T>& other): Range<2, T>(other) {} /** @copydoc Range(const Range&) */ template constexpr explicit Range2D(const Range2D& other): Range<2, T>(other) {} @@ -305,13 +305,13 @@ See @ref Range for more information. template class Range3D: public Range<3, T> { public: /** @copydoc Range() */ - constexpr Range3D() = default; + constexpr /*implicit*/ Range3D() {} /** @copydoc Range(const VectorType&, const VectorType&) */ - constexpr Range3D(const Vector3& min, const Vector3& max): Range<3, T>(min, max) {} + constexpr /*implicit*/ Range3D(const Vector3& min, const Vector3& max): Range<3, T>(min, max) {} /** @copydoc Range(const Range&) */ - constexpr Range3D(const Range<3, T>& other): Range<3, T>(other) {} + constexpr /*implicit*/ Range3D(const Range<3, T>& other): Range<3, T>(other) {} /** @copydoc Range(const Range&) */ template constexpr explicit Range3D(const Range3D& other): Range<3, T>(other) {} From a6dfda5c3afc194a2f89b1446549eb3c5f6ce366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 29 Nov 2013 01:56:37 +0100 Subject: [PATCH 085/105] Math: fix RangeTest compilation with GCC 4.6. --- src/Math/Test/RangeTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Math/Test/RangeTest.cpp b/src/Math/Test/RangeTest.cpp index 64cfdd0b3..341d3f8e2 100644 --- a/src/Math/Test/RangeTest.cpp +++ b/src/Math/Test/RangeTest.cpp @@ -64,10 +64,18 @@ class RangeTest: public Corrade::TestSuite::Tester { void configuration(); }; +#ifndef CORRADE_GCC46_COMPATIBILITY +typedef Math::Range1D Range1D; +#else typedef Math::Range<1, Float> Range1D; +#endif typedef Math::Range2D Range2D; typedef Math::Range3D Range3D; +#ifndef CORRADE_GCC46_COMPATIBILITY typedef Math::Range1D Range1Di; +#else +typedef Math::Range<1, Int> Range1Di; +#endif typedef Math::Range2D Range2Di; typedef Math::Range3D Range3Di; typedef Vector2 Vector2i; From 1aa5bd0961cfb9f1ef6c66b9a58399376acffc8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 29 Nov 2013 01:59:36 +0100 Subject: [PATCH 086/105] Math: error out when Rectangle.h is used in non-deprecated build. How this slipped through?! --- src/Math/Geometry/Rectangle.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Math/Geometry/Rectangle.h b/src/Math/Geometry/Rectangle.h index 4bc017c8e..56d679a46 100644 --- a/src/Math/Geometry/Rectangle.h +++ b/src/Math/Geometry/Rectangle.h @@ -65,6 +65,8 @@ namespace Corrade { namespace Utility { /** @configurationvalue{Magnum::Math::Geometry::Rectangle} */ template struct ConfigurationValue>: public ConfigurationValue> {}; }} +#else +#error #endif #endif From 463613f1cee837c5c46c5d7e5ec5df09d1634ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 29 Nov 2013 02:00:35 +0100 Subject: [PATCH 087/105] Don't include deprecated Rectangle.h header. --- src/AbstractFramebuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AbstractFramebuffer.h b/src/AbstractFramebuffer.h index 073e1afc7..a82058fe4 100644 --- a/src/AbstractFramebuffer.h +++ b/src/AbstractFramebuffer.h @@ -30,7 +30,7 @@ #include -#include "Math/Geometry/Rectangle.h" +#include "Math/Range.h" #include "Magnum.h" #include "OpenGL.h" From 1b8fff80910ad63dcfde1cf8058f21693040c7b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 29 Nov 2013 14:48:24 +0100 Subject: [PATCH 088/105] Updated toolchains submodule. --- toolchains | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains b/toolchains index 8e6dbeeb6..ca539cf41 160000 --- a/toolchains +++ b/toolchains @@ -1 +1 @@ -Subproject commit 8e6dbeeb661ad0bd2d678b9f6bfb9e9044eb45f9 +Subproject commit ca539cf413142e70a6084b090ae5cfee77fd810a From 66fb4bc1932b30e0382f11e2159637cb59449a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 29 Nov 2013 15:12:21 +0100 Subject: [PATCH 089/105] package: added Emscripten and MinGW32 Jenkins CI configuration. --- doc/building.dox | 8 ++ package/ci/jenkins-emscripten.xml | 114 +++++++++++++++++++++++++++ package/ci/jenkins-mingw32.xml | 127 ++++++++++++++++++++++++++++++ 3 files changed, 249 insertions(+) create mode 100644 package/ci/jenkins-emscripten.xml create mode 100644 package/ci/jenkins-mingw32.xml diff --git a/doc/building.dox b/doc/building.dox index ad9110668..b9ec78731 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -405,6 +405,14 @@ library with every combination of them. You can add/remove the axes in Magnum-GLTests depend on active X11 session, thus they should be run from Jenkins instance running on graphical user session. + +There is also MinGW32 and Emscripten configuration, add or update them with the +commands below. See @ref building-crosscompiling for more information about +setting up the crosscompilers and `toolchains/` submodule. For Emscripten you +need also **Node.js** installed to run the tests. + + java -jar jenkins-cli.jar -s http://your-jenkins-server Magnum-MinGW32 < jenkins-mingw32.xml + java -jar jenkins-cli.jar -s http://your-jenkins-server Magnum-Emscripten < jenkins-emscripten.xml */ } diff --git a/package/ci/jenkins-emscripten.xml b/package/ci/jenkins-emscripten.xml new file mode 100644 index 000000000..70cff54fd --- /dev/null +++ b/package/ci/jenkins-emscripten.xml @@ -0,0 +1,114 @@ + + + + + + -1 + 10 + -1 + -1 + + false + + + 2 + + + git://github.com/mosra/magnum.git + + + + + */master + + + false + + + + true + + + + + true + false + false + false + + false + Magnum + + + compatibility + + + deprecated + + + + + + + + + + + + + Errors while running CTest + false + true + true + + + + + true + + + + + UNSTABLE + 1 + YELLOW + true + + + . + diff --git a/package/ci/jenkins-mingw32.xml b/package/ci/jenkins-mingw32.xml new file mode 100644 index 000000000..0619969c1 --- /dev/null +++ b/package/ci/jenkins-mingw32.xml @@ -0,0 +1,127 @@ + + + + + + -1 + 10 + -1 + -1 + + false + + + 2 + + + git://github.com/mosra/magnum.git + + + + + */master + + + false + + + + true + + + + + true + false + false + false + + false + Magnum + + + libraries + + static + dynamic + + + + compatibility + + + deprecated + + + + + + + + + + + + + Errors while running CTest + false + true + true + + + + + true + + + + + UNSTABLE + 1 + YELLOW + true + + + . + From ce470aede7da40c5d16421f075fc7fdcba1139ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 29 Nov 2013 16:28:32 +0100 Subject: [PATCH 090/105] MagnumFont{,Converter}: these tests also need GL, set GLTest suffix. --- src/Plugins/MagnumFont/Test/CMakeLists.txt | 2 +- ...agnumFontTest.cpp => MagnumFontGLTest.cpp} | 20 +++++++++---------- .../MagnumFontConverter/Test/CMakeLists.txt | 2 +- ...Test.cpp => MagnumFontConverterGLTest.cpp} | 12 +++++------ 4 files changed, 18 insertions(+), 18 deletions(-) rename src/Plugins/MagnumFont/Test/{MagnumFontTest.cpp => MagnumFontGLTest.cpp} (89%) rename src/Plugins/MagnumFontConverter/Test/{MagnumFontConverterTest.cpp => MagnumFontConverterGLTest.cpp} (92%) diff --git a/src/Plugins/MagnumFont/Test/CMakeLists.txt b/src/Plugins/MagnumFont/Test/CMakeLists.txt index 0cc473499..4b91644ed 100644 --- a/src/Plugins/MagnumFont/Test/CMakeLists.txt +++ b/src/Plugins/MagnumFont/Test/CMakeLists.txt @@ -27,4 +27,4 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/magnumFontTestConfigure.h.cmake include_directories(${CMAKE_CURRENT_BINARY_DIR}) -corrade_add_test(MagnumFontTest MagnumFontTest.cpp LIBRARIES MagnumFontTestLib ${GL_TEST_LIBRARIES}) +corrade_add_test(MagnumFontGLTest MagnumFontGLTest.cpp LIBRARIES MagnumFontTestLib ${GL_TEST_LIBRARIES}) diff --git a/src/Plugins/MagnumFont/Test/MagnumFontTest.cpp b/src/Plugins/MagnumFont/Test/MagnumFontGLTest.cpp similarity index 89% rename from src/Plugins/MagnumFont/Test/MagnumFontTest.cpp rename to src/Plugins/MagnumFont/Test/MagnumFontGLTest.cpp index 2807c0ced..f0d3b69e3 100644 --- a/src/Plugins/MagnumFont/Test/MagnumFontTest.cpp +++ b/src/Plugins/MagnumFont/Test/MagnumFontGLTest.cpp @@ -32,22 +32,22 @@ namespace Magnum { namespace Text { namespace Test { -class MagnumFontTest: public Magnum::Test::AbstractOpenGLTester { +class MagnumFontGLTest: public Magnum::Test::AbstractOpenGLTester { public: - explicit MagnumFontTest(); + explicit MagnumFontGLTest(); void properties(); void layout(); void createGlyphCache(); }; -MagnumFontTest::MagnumFontTest() { - addTests({&MagnumFontTest::properties, - &MagnumFontTest::layout, - &MagnumFontTest::createGlyphCache}); +MagnumFontGLTest::MagnumFontGLTest() { + addTests({&MagnumFontGLTest::properties, + &MagnumFontGLTest::layout, + &MagnumFontGLTest::createGlyphCache}); } -void MagnumFontTest::properties() { +void MagnumFontGLTest::properties() { MagnumFont font; CORRADE_VERIFY(font.openFile(Utility::Directory::join(MAGNUMFONT_TEST_DIR, "font.conf"), 0.0f)); CORRADE_COMPARE(font.size(), 16.0f); @@ -55,7 +55,7 @@ void MagnumFontTest::properties() { CORRADE_COMPARE(font.glyphAdvance(font.glyphId(U'W')), Vector2(23.0f, 0.0f)); } -void MagnumFontTest::layout() { +void MagnumFontGLTest::layout() { MagnumFont font; CORRADE_VERIFY(font.openFile(Utility::Directory::join(MAGNUMFONT_TEST_DIR, "font.conf"), 0.0f)); @@ -98,11 +98,11 @@ void MagnumFontTest::layout() { CORRADE_COMPARE(cursorPosition, Vector2(0.375f, 0.0f)); } -void MagnumFontTest::createGlyphCache() { +void MagnumFontGLTest::createGlyphCache() { /** @todo */ CORRADE_SKIP("Not yet implemented"); } }}} -CORRADE_TEST_MAIN(Magnum::Text::Test::MagnumFontTest) +CORRADE_TEST_MAIN(Magnum::Text::Test::MagnumFontGLTest) diff --git a/src/Plugins/MagnumFontConverter/Test/CMakeLists.txt b/src/Plugins/MagnumFontConverter/Test/CMakeLists.txt index 91b3d9470..6ca4fda60 100644 --- a/src/Plugins/MagnumFontConverter/Test/CMakeLists.txt +++ b/src/Plugins/MagnumFontConverter/Test/CMakeLists.txt @@ -28,7 +28,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/magnumFontConverterTestConfigure.h.cm include_directories(${CMAKE_CURRENT_BINARY_DIR}/../../MagnumFont/Test/ ${CMAKE_CURRENT_BINARY_DIR}) -corrade_add_test(MagnumFontConverterTest MagnumFontConverterTest.cpp LIBRARIES +corrade_add_test(MagnumFontConverterGLTest MagnumFontConverterGLTest.cpp LIBRARIES MagnumFontConverterTestLib TgaImporterTestLib ${GL_TEST_LIBRARIES}) diff --git a/src/Plugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp b/src/Plugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp similarity index 92% rename from src/Plugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp rename to src/Plugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp index e0676f0e3..a104604ad 100644 --- a/src/Plugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp +++ b/src/Plugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp @@ -41,18 +41,18 @@ namespace Magnum { namespace Text { namespace Test { -class MagnumFontConverterTest: public Magnum::Test::AbstractOpenGLTester { +class MagnumFontConverterGLTest: public Magnum::Test::AbstractOpenGLTester { public: - explicit MagnumFontConverterTest(); + explicit MagnumFontConverterGLTest(); void exportFont(); }; -MagnumFontConverterTest::MagnumFontConverterTest() { - addTests({&MagnumFontConverterTest::exportFont}); +MagnumFontConverterGLTest::MagnumFontConverterGLTest() { + addTests({&MagnumFontConverterGLTest::exportFont}); } -void MagnumFontConverterTest::exportFont() { +void MagnumFontConverterGLTest::exportFont() { /* Remove previously created files */ Utility::Directory::rm(Utility::Directory::join(MAGNUMFONTCONVERTER_TEST_WRITE_DIR, "font.conf")); Utility::Directory::rm(Utility::Directory::join(MAGNUMFONTCONVERTER_TEST_WRITE_DIR, "font.tga")); @@ -123,4 +123,4 @@ void MagnumFontConverterTest::exportFont() { }}} -CORRADE_TEST_MAIN(Magnum::Text::Test::MagnumFontConverterTest) +CORRADE_TEST_MAIN(Magnum::Text::Test::MagnumFontConverterGLTest) From 72646fa2d56252d0f14fdf82e33fdd7b898bb11f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 29 Nov 2013 16:29:41 +0100 Subject: [PATCH 091/105] Text: fix Renderer compilation in Emscripten. --- src/Text/Renderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Renderer.cpp b/src/Text/Renderer.cpp index 96ae1ecad..adc103cfc 100644 --- a/src/Text/Renderer.cpp +++ b/src/Text/Renderer.cpp @@ -349,7 +349,7 @@ void AbstractRenderer::reserve(const uint32_t glyphCount, const BufferUsage vert /* Allocate index buffer, reset index count and reconfigure buffer binding */ _indexBuffer.setData({nullptr, indexData.size()}, indexBufferUsage); #ifdef CORRADE_TARGET_EMSCRIPTEN - _indexBufferData = Containers::Array(indicesSize); + _indexBufferData = Containers::Array(indexData.size()); #endif _mesh.setIndexCount(0) .setIndexBuffer(_indexBuffer, 0, indexType, 0, vertexCount); From 9792f2b7e00be846efd1ecee73bbb8a4a3ccf9a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 29 Nov 2013 16:31:21 +0100 Subject: [PATCH 092/105] Text: added TODO. --- src/Text/Renderer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Text/Renderer.cpp b/src/Text/Renderer.cpp index adc103cfc..534e3e26f 100644 --- a/src/Text/Renderer.cpp +++ b/src/Text/Renderer.cpp @@ -357,6 +357,7 @@ void AbstractRenderer::reserve(const uint32_t glyphCount, const BufferUsage vert /* Prefill index buffer */ unsigned char* const indices = static_cast(bufferMapImplementation(_indexBuffer, indexData.size())); CORRADE_INTERNAL_ASSERT(indices); + /** @todo Emscripten: it can be done without this copying altogether */ std::copy(indexData.begin(), indexData.end(), indices); bufferUnmapImplementation(_indexBuffer); } From f44af271df7b3a593649dc13036e593d57f9213c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 29 Nov 2013 16:32:38 +0100 Subject: [PATCH 093/105] TgaImageConverter: workaround for linking error in the test. Due to some weird bug (?) llvm-link complains about multiply defined symbol. --- src/Plugins/TgaImageConverter/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Plugins/TgaImageConverter/CMakeLists.txt b/src/Plugins/TgaImageConverter/CMakeLists.txt index 1ef44c77a..87d26761c 100644 --- a/src/Plugins/TgaImageConverter/CMakeLists.txt +++ b/src/Plugins/TgaImageConverter/CMakeLists.txt @@ -41,6 +41,10 @@ install(FILES ${TgaImageConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_ if(BUILD_TESTS) add_library(TgaImageConverterTestLib SHARED $) - target_link_libraries(TgaImageConverterTestLib Magnum) + # Otherwise llvm-link complains about multiply defined Debug::globalOutput. + # TODO: can this be done properly? + if(NOT CORRADE_TARGET_EMSCRIPTEN) + target_link_libraries(TgaImageConverterTestLib Magnum) + endif() add_subdirectory(Test) endif() From 9b6b4377e964560f3a81e6f74a12afda887855ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 29 Nov 2013 22:04:31 +0100 Subject: [PATCH 094/105] Make inter-project includes with "" and dependency includes with <>. --- src/Plugins/MagnumFont/MagnumFont.cpp | 7 ++++--- src/Plugins/TgaImageConverter/TgaImageConverter.cpp | 5 +++-- src/Plugins/TgaImporter/TgaImporter.h | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Plugins/MagnumFont/MagnumFont.cpp b/src/Plugins/MagnumFont/MagnumFont.cpp index dbaf1c2f6..46a3b1035 100644 --- a/src/Plugins/MagnumFont/MagnumFont.cpp +++ b/src/Plugins/MagnumFont/MagnumFont.cpp @@ -25,9 +25,10 @@ #include "MagnumFont.h" #include -#include "Containers/Array.h" -#include "Utility/Directory.h" -#include "Utility/Unicode.h" +#include +#include +#include + #include "Text/GlyphCache.h" #include "Trade/ImageData.h" diff --git a/src/Plugins/TgaImageConverter/TgaImageConverter.cpp b/src/Plugins/TgaImageConverter/TgaImageConverter.cpp index fdb9c8c11..84776f75c 100644 --- a/src/Plugins/TgaImageConverter/TgaImageConverter.cpp +++ b/src/Plugins/TgaImageConverter/TgaImageConverter.cpp @@ -27,8 +27,9 @@ #include #include -#include "Containers/Array.h" -#include "Utility/Endianness.h" +#include +#include + #include "ColorFormat.h" #include "Image.h" diff --git a/src/Plugins/TgaImporter/TgaImporter.h b/src/Plugins/TgaImporter/TgaImporter.h index 3a5e2c497..826fb5197 100644 --- a/src/Plugins/TgaImporter/TgaImporter.h +++ b/src/Plugins/TgaImporter/TgaImporter.h @@ -29,7 +29,8 @@ */ #include -#include + +#include "Trade/AbstractImporter.h" #ifndef DOXYGEN_GENERATING_OUTPUT #if defined(TgaImporter_EXPORTS) || defined(TgaImporterObjects_EXPORTS) From f86a60c82d383f096d2e415cc85eacf3e001dc1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 29 Nov 2013 22:05:22 +0100 Subject: [PATCH 095/105] Fix static build on Windows. --- src/Audio/magnumAudioVisibility.h | 12 +++++++++--- src/DebugTools/magnumDebugToolsVisibility.h | 12 +++++++++--- src/MeshTools/magnumMeshToolsVisibility.h | 12 +++++++++--- src/Plugins/TgaImageConverter/TgaImageConverter.h | 10 +++++++--- src/Plugins/TgaImporter/TgaImporter.h | 10 +++++++--- src/Primitives/magnumPrimitivesVisibility.h | 12 +++++++++--- src/SceneGraph/magnumSceneGraphVisibility.h | 12 +++++++++--- src/Shaders/magnumShadersVisibility.h | 12 +++++++++--- src/Shapes/magnumShapesVisibility.h | 12 +++++++++--- src/Text/magnumTextVisibility.h | 12 +++++++++--- src/TextureTools/magnumTextureToolsVisibility.h | 12 +++++++++--- src/magnumVisibility.h | 12 +++++++++--- 12 files changed, 104 insertions(+), 36 deletions(-) diff --git a/src/Audio/magnumAudioVisibility.h b/src/Audio/magnumAudioVisibility.h index e4a7c0f67..cc4600394 100644 --- a/src/Audio/magnumAudioVisibility.h +++ b/src/Audio/magnumAudioVisibility.h @@ -26,10 +26,16 @@ #include -#ifdef MagnumAudio_EXPORTS - #define MAGNUM_AUDIO_EXPORT CORRADE_VISIBILITY_EXPORT +#include "magnumConfigure.h" + +#ifndef MAGNUM_BUILD_STATIC + #ifdef MagnumAudio_EXPORTS + #define MAGNUM_AUDIO_EXPORT CORRADE_VISIBILITY_EXPORT + #else + #define MAGNUM_AUDIO_EXPORT CORRADE_VISIBILITY_IMPORT + #endif #else - #define MAGNUM_AUDIO_EXPORT CORRADE_VISIBILITY_IMPORT + #define MAGNUM_AUDIO_EXPORT CORRADE_VISIBILITY_STATIC #endif #endif diff --git a/src/DebugTools/magnumDebugToolsVisibility.h b/src/DebugTools/magnumDebugToolsVisibility.h index d08f88d14..2499c5d24 100644 --- a/src/DebugTools/magnumDebugToolsVisibility.h +++ b/src/DebugTools/magnumDebugToolsVisibility.h @@ -26,10 +26,16 @@ #include -#ifdef MagnumDebugTools_EXPORTS - #define MAGNUM_DEBUGTOOLS_EXPORT CORRADE_VISIBILITY_EXPORT +#include "magnumConfigure.h" + +#ifndef MAGNUM_BUILD_STATIC + #ifdef MagnumDebugTools_EXPORTS + #define MAGNUM_DEBUGTOOLS_EXPORT CORRADE_VISIBILITY_EXPORT + #else + #define MAGNUM_DEBUGTOOLS_EXPORT CORRADE_VISIBILITY_IMPORT + #endif #else - #define MAGNUM_DEBUGTOOLS_EXPORT CORRADE_VISIBILITY_IMPORT + #define MAGNUM_DEBUGTOOLS_EXPORT CORRADE_VISIBILITY_STATIC #endif #endif diff --git a/src/MeshTools/magnumMeshToolsVisibility.h b/src/MeshTools/magnumMeshToolsVisibility.h index f7d8a63c4..476d8f3a5 100644 --- a/src/MeshTools/magnumMeshToolsVisibility.h +++ b/src/MeshTools/magnumMeshToolsVisibility.h @@ -26,10 +26,16 @@ #include -#if defined(MagnumMeshTools_EXPORTS) || defined(MagnumMeshToolsObjects_EXPORTS) - #define MAGNUM_MESHTOOLS_EXPORT CORRADE_VISIBILITY_EXPORT +#include "magnumConfigure.h" + +#ifndef MAGNUM_BUILD_STATIC + #if defined(MagnumMeshTools_EXPORTS) || defined(MagnumMeshToolsObjects_EXPORTS) + #define MAGNUM_MESHTOOLS_EXPORT CORRADE_VISIBILITY_EXPORT + #else + #define MAGNUM_MESHTOOLS_EXPORT CORRADE_VISIBILITY_IMPORT + #endif #else - #define MAGNUM_MESHTOOLS_EXPORT CORRADE_VISIBILITY_IMPORT + #define MAGNUM_MESHTOOLS_EXPORT CORRADE_VISIBILITY_STATIC #endif #endif diff --git a/src/Plugins/TgaImageConverter/TgaImageConverter.h b/src/Plugins/TgaImageConverter/TgaImageConverter.h index 7acaa4dfd..1b5e9e02e 100644 --- a/src/Plugins/TgaImageConverter/TgaImageConverter.h +++ b/src/Plugins/TgaImageConverter/TgaImageConverter.h @@ -31,10 +31,14 @@ #include "Trade/AbstractImageConverter.h" #ifndef DOXYGEN_GENERATING_OUTPUT -#if defined(TgaImageConverter_EXPORTS) || defined(TgaImageConverterObjects_EXPORTS) - #define MAGNUM_TRADE_TGAIMAGECONVERTER_EXPORT CORRADE_VISIBILITY_EXPORT +#ifndef MAGNUM_BUILD_STATIC + #if defined(TgaImageConverter_EXPORTS) || defined(TgaImageConverterObjects_EXPORTS) + #define MAGNUM_TRADE_TGAIMAGECONVERTER_EXPORT CORRADE_VISIBILITY_EXPORT + #else + #define MAGNUM_TRADE_TGAIMAGECONVERTER_EXPORT CORRADE_VISIBILITY_IMPORT + #endif #else - #define MAGNUM_TRADE_TGAIMAGECONVERTER_EXPORT CORRADE_VISIBILITY_IMPORT + #define MAGNUM_TRADE_TGAIMAGECONVERTER_EXPORT CORRADE_VISIBILITY_STATIC #endif #define MAGNUM_TRADE_TGAIMAGECONVERTER_LOCAL CORRADE_VISIBILITY_LOCAL #endif diff --git a/src/Plugins/TgaImporter/TgaImporter.h b/src/Plugins/TgaImporter/TgaImporter.h index 826fb5197..dfdcfc5b5 100644 --- a/src/Plugins/TgaImporter/TgaImporter.h +++ b/src/Plugins/TgaImporter/TgaImporter.h @@ -33,10 +33,14 @@ #include "Trade/AbstractImporter.h" #ifndef DOXYGEN_GENERATING_OUTPUT -#if defined(TgaImporter_EXPORTS) || defined(TgaImporterObjects_EXPORTS) - #define MAGNUM_TRADE_TGAIMPORTER_EXPORT CORRADE_VISIBILITY_EXPORT +#ifndef MAGNUM_BUILD_STATIC + #if defined(TgaImporter_EXPORTS) || defined(TgaImporterObjects_EXPORTS) + #define MAGNUM_TRADE_TGAIMPORTER_EXPORT CORRADE_VISIBILITY_EXPORT + #else + #define MAGNUM_TRADE_TGAIMPORTER_EXPORT CORRADE_VISIBILITY_IMPORT + #endif #else - #define MAGNUM_TRADE_TGAIMPORTER_EXPORT CORRADE_VISIBILITY_IMPORT + #define MAGNUM_TRADE_TGAIMPORTER_EXPORT CORRADE_VISIBILITY_STATIC #endif #define MAGNUM_TRADE_TGAIMPORTER_LOCAL CORRADE_VISIBILITY_LOCAL #endif diff --git a/src/Primitives/magnumPrimitivesVisibility.h b/src/Primitives/magnumPrimitivesVisibility.h index 0acf6cf82..770730353 100644 --- a/src/Primitives/magnumPrimitivesVisibility.h +++ b/src/Primitives/magnumPrimitivesVisibility.h @@ -26,10 +26,16 @@ #include -#ifdef MagnumPrimitives_EXPORTS - #define MAGNUM_PRIMITIVES_EXPORT CORRADE_VISIBILITY_EXPORT +#include "magnumConfigure.h" + +#ifndef MAGNUM_BUILD_STATIC + #ifdef MagnumPrimitives_EXPORTS + #define MAGNUM_PRIMITIVES_EXPORT CORRADE_VISIBILITY_EXPORT + #else + #define MAGNUM_PRIMITIVES_EXPORT CORRADE_VISIBILITY_IMPORT + #endif #else - #define MAGNUM_PRIMITIVES_EXPORT CORRADE_VISIBILITY_IMPORT + #define MAGNUM_PRIMITIVES_EXPORT CORRADE_VISIBILITY_STATIC #endif #endif diff --git a/src/SceneGraph/magnumSceneGraphVisibility.h b/src/SceneGraph/magnumSceneGraphVisibility.h index 366634198..9ffc7422c 100644 --- a/src/SceneGraph/magnumSceneGraphVisibility.h +++ b/src/SceneGraph/magnumSceneGraphVisibility.h @@ -26,10 +26,16 @@ #include -#if defined(MagnumSceneGraph_EXPORTS) || defined(MagnumSceneGraphObjects_EXPORTS) - #define MAGNUM_SCENEGRAPH_EXPORT CORRADE_VISIBILITY_EXPORT +#include "magnumConfigure.h" + +#ifndef MAGNUM_BUILD_STATIC + #if defined(MagnumSceneGraph_EXPORTS) || defined(MagnumSceneGraphObjects_EXPORTS) + #define MAGNUM_SCENEGRAPH_EXPORT CORRADE_VISIBILITY_EXPORT + #else + #define MAGNUM_SCENEGRAPH_EXPORT CORRADE_VISIBILITY_IMPORT + #endif #else - #define MAGNUM_SCENEGRAPH_EXPORT CORRADE_VISIBILITY_IMPORT + #define MAGNUM_SCENEGRAPH_EXPORT CORRADE_VISIBILITY_STATIC #endif #define MAGNUM_SCENEGRAPH_LOCAL CORRADE_VISIBILITY_LOCAL diff --git a/src/Shaders/magnumShadersVisibility.h b/src/Shaders/magnumShadersVisibility.h index 93c270176..a42810511 100644 --- a/src/Shaders/magnumShadersVisibility.h +++ b/src/Shaders/magnumShadersVisibility.h @@ -26,10 +26,16 @@ #include -#ifdef MagnumShaders_EXPORTS - #define MAGNUM_SHADERS_EXPORT CORRADE_VISIBILITY_EXPORT +#include "magnumConfigure.h" + +#ifndef MAGNUM_BUILD_STATIC + #ifdef MagnumShaders_EXPORTS + #define MAGNUM_SHADERS_EXPORT CORRADE_VISIBILITY_EXPORT + #else + #define MAGNUM_SHADERS_EXPORT CORRADE_VISIBILITY_IMPORT + #endif #else - #define MAGNUM_SHADERS_EXPORT CORRADE_VISIBILITY_IMPORT + #define MAGNUM_SHADERS_EXPORT CORRADE_VISIBILITY_STATIC #endif #endif diff --git a/src/Shapes/magnumShapesVisibility.h b/src/Shapes/magnumShapesVisibility.h index c5f8fa30f..2af59f9b8 100644 --- a/src/Shapes/magnumShapesVisibility.h +++ b/src/Shapes/magnumShapesVisibility.h @@ -26,10 +26,16 @@ #include -#ifdef MagnumShapes_EXPORTS - #define MAGNUM_SHAPES_EXPORT CORRADE_VISIBILITY_EXPORT +#include "magnumConfigure.h" + +#ifndef MAGNUM_BUILD_STATIC + #ifdef MagnumShapes_EXPORTS + #define MAGNUM_SHAPES_EXPORT CORRADE_VISIBILITY_EXPORT + #else + #define MAGNUM_SHAPES_EXPORT CORRADE_VISIBILITY_IMPORT + #endif #else - #define MAGNUM_SHAPES_EXPORT CORRADE_VISIBILITY_IMPORT + #define MAGNUM_SHAPES_EXPORT CORRADE_VISIBILITY_STATIC #endif #define MAGNUM_SHAPES_LOCAL CORRADE_VISIBILITY_LOCAL diff --git a/src/Text/magnumTextVisibility.h b/src/Text/magnumTextVisibility.h index b69855471..c15adef5a 100644 --- a/src/Text/magnumTextVisibility.h +++ b/src/Text/magnumTextVisibility.h @@ -26,10 +26,16 @@ #include -#ifdef MagnumText_EXPORTS - #define MAGNUM_TEXT_EXPORT CORRADE_VISIBILITY_EXPORT +#include "magnumConfigure.h" + +#ifndef MAGNUM_BUILD_STATIC + #ifdef MagnumText_EXPORTS + #define MAGNUM_TEXT_EXPORT CORRADE_VISIBILITY_EXPORT + #else + #define MAGNUM_TEXT_EXPORT CORRADE_VISIBILITY_IMPORT + #endif #else - #define MAGNUM_TEXT_EXPORT CORRADE_VISIBILITY_IMPORT + #define MAGNUM_TEXT_EXPORT CORRADE_VISIBILITY_STATIC #endif #define MAGNUM_TEXT_LOCAL CORRADE_VISIBILITY_LOCAL diff --git a/src/TextureTools/magnumTextureToolsVisibility.h b/src/TextureTools/magnumTextureToolsVisibility.h index 30f40eb1c..c552e907d 100644 --- a/src/TextureTools/magnumTextureToolsVisibility.h +++ b/src/TextureTools/magnumTextureToolsVisibility.h @@ -26,10 +26,16 @@ #include -#ifdef MagnumTextureTools_EXPORTS - #define MAGNUM_TEXTURETOOLS_EXPORT CORRADE_VISIBILITY_EXPORT +#include "magnumConfigure.h" + +#ifndef MAGNUM_BUILD_STATIC + #ifdef MagnumTextureTools_EXPORTS + #define MAGNUM_TEXTURETOOLS_EXPORT CORRADE_VISIBILITY_EXPORT + #else + #define MAGNUM_TEXTURETOOLS_EXPORT CORRADE_VISIBILITY_IMPORT + #endif #else - #define MAGNUM_TEXTURETOOLS_EXPORT CORRADE_VISIBILITY_IMPORT + #define MAGNUM_TEXTURETOOLS_EXPORT CORRADE_VISIBILITY_STATIC #endif #endif diff --git a/src/magnumVisibility.h b/src/magnumVisibility.h index 09ac087ed..d85a39fff 100644 --- a/src/magnumVisibility.h +++ b/src/magnumVisibility.h @@ -26,10 +26,16 @@ #include -#if defined(Magnum_EXPORTS) || defined(MagnumObjects_EXPORTS) || defined(MagnumMathObjects_EXPORTS) - #define MAGNUM_EXPORT CORRADE_VISIBILITY_EXPORT +#include "magnumConfigure.h" + +#ifndef MAGNUM_BUILD_STATIC + #if defined(Magnum_EXPORTS) || defined(MagnumObjects_EXPORTS) || defined(MagnumMathObjects_EXPORTS) + #define MAGNUM_EXPORT CORRADE_VISIBILITY_EXPORT + #else + #define MAGNUM_EXPORT CORRADE_VISIBILITY_IMPORT + #endif #else - #define MAGNUM_EXPORT CORRADE_VISIBILITY_IMPORT + #define MAGNUM_EXPORT CORRADE_VISIBILITY_STATIC #endif #define MAGNUM_LOCAL CORRADE_VISIBILITY_LOCAL From ce9a9212caef87414e0798720e9fb171f7c29539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 29 Nov 2013 23:57:05 +0100 Subject: [PATCH 096/105] Fix linking of tests in static Windows build. Also fixes the "multiple definition" Emscripten issue, which was worked around in f44af271df7b3a593649dc13036e593d57f9213c. --- src/Plugins/TgaImageConverter/CMakeLists.txt | 8 ++------ src/Plugins/TgaImporter/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Plugins/TgaImageConverter/CMakeLists.txt b/src/Plugins/TgaImageConverter/CMakeLists.txt index 87d26761c..ddbb4149a 100644 --- a/src/Plugins/TgaImageConverter/CMakeLists.txt +++ b/src/Plugins/TgaImageConverter/CMakeLists.txt @@ -40,11 +40,7 @@ target_link_libraries(TgaImageConverter Magnum) install(FILES ${TgaImageConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImageConverter) if(BUILD_TESTS) - add_library(TgaImageConverterTestLib SHARED $) - # Otherwise llvm-link complains about multiply defined Debug::globalOutput. - # TODO: can this be done properly? - if(NOT CORRADE_TARGET_EMSCRIPTEN) - target_link_libraries(TgaImageConverterTestLib Magnum) - endif() + add_library(TgaImageConverterTestLib ${SHARED_OR_STATIC} $) + target_link_libraries(TgaImageConverterTestLib Magnum) add_subdirectory(Test) endif() diff --git a/src/Plugins/TgaImporter/CMakeLists.txt b/src/Plugins/TgaImporter/CMakeLists.txt index a979859f3..5f87fab56 100644 --- a/src/Plugins/TgaImporter/CMakeLists.txt +++ b/src/Plugins/TgaImporter/CMakeLists.txt @@ -41,7 +41,7 @@ target_link_libraries(TgaImporter Magnum) install(FILES ${TgaImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImporter) if(BUILD_TESTS) - add_library(TgaImporterTestLib SHARED $) + add_library(TgaImporterTestLib ${SHARED_OR_STATIC} $) target_link_libraries(TgaImporterTestLib Magnum) add_subdirectory(Test) endif() From 794c934dc1b190f9a176e4886b4b18dd7145c6b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 2 Dec 2013 01:18:15 +0100 Subject: [PATCH 097/105] Shotgun documentation updates. Fixed old references to Buffer::Usage, fixed parameter order in Image constructor, fixed some function references. Added explicit references to linkable stuff. --- src/AbstractTexture.h | 32 +++--- src/Buffer.h | 192 +++++++++++++++----------------- src/BufferTexture.h | 37 +++--- src/CubeMapTexture.h | 26 ++--- src/CubeMapTextureArray.h | 57 +++++----- src/Math/Geometry/Rectangle.h | 2 +- src/Mesh.h | 73 ++++++------ src/MeshTools/CompressIndices.h | 10 +- src/MeshTools/Interleave.h | 14 +-- src/Text/Renderer.h | 6 +- src/Texture.h | 79 ++++++------- 11 files changed, 256 insertions(+), 272 deletions(-) diff --git a/src/AbstractTexture.h b/src/AbstractTexture.h index 81121b703..406f4f674 100644 --- a/src/AbstractTexture.h +++ b/src/AbstractTexture.h @@ -25,7 +25,7 @@ */ /** @file - * @brief Class Magnum::AbstractTexture + * @brief Class @ref Magnum::AbstractTexture */ #include "Array.h" @@ -37,8 +37,9 @@ namespace Magnum { /** @brief Base for textures -See Texture, CubeMapTexture and CubeMapTextureArray documentation for more -information and usage examples. +Encapsulates one OpenGL texture object. See @ref Texture, @ref CubeMapTexture +and @ref CubeMapTextureArray documentation for more information and usage +examples. @section AbstractTexture-performance-optimization Performance optimizations and security @@ -49,15 +50,15 @@ affect active bindings in user layers. %Texture limits and implementation-defined values (such as @ref maxColorSamples()) are cached, so repeated queries don't result in repeated @fn_gl{Get} calls. -If extension @extension{EXT,direct_state_access} is available, bind() uses DSA -function to avoid unnecessary calls to @fn_gl{ActiveTexture}. Also all texture -configuration and data updating functions use DSA functions to avoid +If extension @extension{EXT,direct_state_access} is available, @ref bind() uses +DSA function to avoid unnecessary calls to @fn_gl{ActiveTexture}. Also all +texture configuration and data updating functions use DSA functions to avoid unnecessary calls to @fn_gl{ActiveTexture} and @fn_gl{BindTexture}. See respective function documentation for more information. If extension @extension{ARB,robustness} is available, image reading operations -(such as Texture::image()) are protected from buffer overflow. However, if both -@extension{EXT,direct_state_access} and @extension{ARB,robustness} are +(such as @ref Texture::image()) are protected from buffer overflow. However, if +both @extension{EXT,direct_state_access} and @extension{ARB,robustness} are available, the DSA version is used, because it is better for performance and there isn't any function combining both features. @@ -76,11 +77,12 @@ OpenGL ES 3.0 or @es_extension{EXT,texture_storage} in OpenGL ES 2.0 is not available, the feature is emulated with sequence of @ref Texture::setImage() "setImage()" calls. -You can use functions invalidateImage() and @ref Texture::invalidateSubImage() "invalidateSubImage()" -if you don't need texture data anymore to avoid unnecessary memory operations -performed by OpenGL in order to preserve the data. If running on OpenGL ES or -extension @extension{ARB,invalidate_subdata} is not available, these functions -do nothing. +You can use functions @ref invalidateImage() and +@ref Texture::invalidateSubImage() "invalidateSubImage()" if you don't need +texture data anymore to avoid unnecessary memory operations performed by OpenGL +in order to preserve the data. If running on OpenGL ES or extension +@extension{ARB,invalidate_subdata} is not available, these functions do +nothing. @todo all texture [level] parameters, global texture parameters @todo Add glPixelStore encapsulation @@ -182,8 +184,8 @@ class MAGNUM_EXPORT AbstractTexture { * @brief Set minification filter * @param filter Filter * @param mipmap Mipmap filtering. If set to anything else than - * BaseMipLevel, make sure textures for all mip levels are set or - * call generateMipmap(). + * @ref Sampler::Mipmap::Base, make sure textures for all mip + * levels are set or call @ref generateMipmap(). * @return Reference to self (for method chaining) * * Sets filter used when the object pixel size is smaller than the diff --git a/src/Buffer.h b/src/Buffer.h index 3dfb0d479..d65215739 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -42,78 +42,72 @@ namespace Magnum { /** - * @brief %Buffer usage - * - * @see @ref Buffer::setData(Containers::ArrayReference, BufferUsage) - */ +@brief %Buffer usage + +@see @ref Buffer, @ref Buffer::setData(Containers::ArrayReference, BufferUsage) +*/ enum class BufferUsage: GLenum { - /** - * Set once by the application and used infrequently for drawing. - */ + /** Set once by the application and used infrequently for drawing. */ StreamDraw = GL_STREAM_DRAW, #ifndef MAGNUM_TARGET_GLES2 /** - * Set once as output from an OpenGL command and used infequently - * for drawing. - * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::StreamDraw" + * Set once as output from an OpenGL command and used infequently for + * drawing. + * @requires_gles30 Only @ref Magnum::BufferUsage::StreamDraw "BufferUsage::StreamDraw" * is available in OpenGL ES 2.0. */ StreamRead = GL_STREAM_READ, /** - * Set once as output from an OpenGL command and used infrequently - * for drawing or copying to other buffers. - * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::StreamDraw" + * Set once as output from an OpenGL command and used infrequently for + * drawing or copying to other buffers. + * @requires_gles30 Only @ref Magnum::BufferUsage::StreamDraw "BufferUsage::StreamDraw" * is available in OpenGL ES 2.0. */ StreamCopy = GL_STREAM_COPY, #endif - /** - * Set once by the application and used frequently for drawing. - */ + /** Set once by the application and used frequently for drawing. */ StaticDraw = GL_STATIC_DRAW, #ifndef MAGNUM_TARGET_GLES2 /** - * Set once as output from an OpenGL command and queried many - * times by the application. - * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::StaticDraw" + * Set once as output from an OpenGL command and queried many times by the + * application. + * @requires_gles30 Only @ref Magnum::BufferUsage::StaticDraw "BufferUsage::StaticDraw" * is available in OpenGL ES 2.0. */ StaticRead = GL_STATIC_READ, /** - * Set once as output from an OpenGL command and used frequently - * for drawing or copying to other buffers. - * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::StaticDraw" + * Set once as output from an OpenGL command and used frequently for + * drawing or copying to other buffers. + * @requires_gles30 Only @ref Magnum::BufferUsage::StaticDraw "BufferUsage::StaticDraw" * is available in OpenGL ES 2.0. */ StaticCopy = GL_STATIC_COPY, #endif /** - * Updated frequently by the application and used frequently - * for drawing or copying to other images. + * Updated frequently by the application and used frequently for drawing or + * copying to other images. */ - DynamicDraw = GL_DYNAMIC_DRAW + DynamicDraw = GL_DYNAMIC_DRAW, #ifndef MAGNUM_TARGET_GLES2 - , - /** - * Updated frequently as output from OpenGL command and queried - * many times from the application. - * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::DynamicDraw" + * Updated frequently as output from OpenGL command and queried many times + * from the application. + * @requires_gles30 Only @ref Magnum::BufferUsage::DynamicDraw "BufferUsage::DynamicDraw" * is available in OpenGL ES 2.0. */ DynamicRead = GL_DYNAMIC_READ, /** - * Updated frequently as output from OpenGL command and used - * frequently for drawing or copying to other images. - * @requires_gles30 Only @ref Magnum::Buffer::Usage "Usage::DynamicDraw" + * Updated frequently as output from OpenGL command and used frequently for + * drawing or copying to other images. + * @requires_gles30 Only @ref Magnum::BufferUsage::DynamicDraw "BufferUsage::DynamicDraw" * is available in OpenGL ES 2.0. */ DynamicCopy = GL_DYNAMIC_COPY @@ -128,18 +122,18 @@ data updates. @section Buffer-data Data updating -Default way to set or update buffer data with setData() or setSubData() is to -use @ref Corrade::Containers::ArrayReference. See its documentation for more -information about automatic conversions etc. +Default way to set or update buffer data with @ref setData() or @ref setSubData() +is to use @ref Corrade::Containers::ArrayReference. See its documentation for +more information about automatic conversions etc. @code Containers::ArrayReference data; -buffer.setData(data, Buffer::Usage::StaticDraw); +buffer.setData(data, BufferUsage::StaticDraw); @endcode There is also overload for array-like containers from STL, such as `std::vector` or `std::array`: @code std::vector data; -buffer.setData(data, Buffer::Usage::StaticDraw); +buffer.setData(data, BufferUsage::StaticDraw); @endcode @subsection Buffer-data-mapping Memory mapping @@ -147,7 +141,7 @@ buffer.setData(data, Buffer::Usage::StaticDraw); %Buffer data can be also updated asynchronously. First you need to allocate the buffer to desired size by passing `nullptr` to @ref setData(), e.g.: @code -buffer.setData({nullptr, 200*sizeof(Vector3)}, Buffer::Usage::StaticDraw); +buffer.setData({nullptr, 200*sizeof(Vector3)}, BufferUsage::StaticDraw); @endcode Then you can map the buffer to client memory and operate with the memory directly. After you are done with the operation, call @ref unmap() to unmap the @@ -174,20 +168,21 @@ CORRADE_INTERNAL_ASSERT_OUTPUT(buffer.unmap()); The engine tracks currently bound buffers to avoid unnecessary calls to @fn_gl{BindBuffer}. If the buffer is already bound to some target, functions -copy(), setData(), setSubData(), map(), flushMappedRange() and unmap() use -that target instead of binding the buffer to some specific target. You can -also use setTargetHint() to possibly reduce unnecessary rebinding. %Buffer -limits and implementation-defined values (such as @ref maxVertexAttributeBindings()) -are cached, so repeated queries don't result in repeated @fn_gl{Get} calls. +@ref copy(), @ref setData(), @ref setSubData(), @ref map(), @ref flushMappedRange() +and @ref unmap() use that target instead of binding the buffer to some specific +target. You can also use @ref setTargetHint() to possibly reduce unnecessary +rebinding. %Buffer limits and implementation-defined values (such as +@ref maxVertexAttributeBindings()) are cached, so repeated queries don't result +in repeated @fn_gl{Get} calls. If extension @extension{EXT,direct_state_access} is available, functions -copy(), setData(), setSubData(), map(), flushMappedRange() and unmap() use DSA -functions to avoid unnecessary calls to @fn_gl{BindBuffer}. See their -respective documentation for more information. +@ref copy(), @ref setData(), @ref setSubData(), @ref map(), @ref flushMappedRange() +and @ref unmap() use DSA functions to avoid unnecessary calls to +@fn_gl{BindBuffer}. See their respective documentation for more information. -You can use functions invalidateData() and invalidateSubData() if you don't -need buffer data anymore to avoid unnecessary memory operations performed by -OpenGL in order to preserve the data. If running on OpenGL ES or extension +You can use functions @ref invalidateData() and @ref invalidateSubData() if you +don't need buffer data anymore to avoid unnecessary memory operations performed +by OpenGL in order to preserve the data. If running on OpenGL ES or extension @extension{ARB,invalidate_subdata} is not available, these functions do nothing. @@ -201,7 +196,7 @@ class MAGNUM_EXPORT Buffer { /** * @brief %Buffer target * - * @see bind(Target), unbind(Target) + * @see @ref bind(Target), @ref unbind(Target) */ enum class Target: GLenum { /** Used for storing vertex attributes. */ @@ -218,7 +213,7 @@ class MAGNUM_EXPORT Buffer { #ifndef MAGNUM_TARGET_GLES2 /** - * Source for copies. See copy(). + * Source for copies. See @ref copy(). * @requires_gl31 %Extension @extension{ARB,copy_buffer} * @requires_gles30 Buffer copying is not available in OpenGL ES * 2.0. @@ -226,7 +221,7 @@ class MAGNUM_EXPORT Buffer { CopyRead = GL_COPY_READ_BUFFER, /** - * Target for copies. See copy(). + * Target for copies. See @ref copy(). * @requires_gl31 %Extension @extension{ARB,copy_buffer} * @requires_gles30 Buffer copying is not available in OpenGL ES * 2.0. @@ -319,7 +314,7 @@ class MAGNUM_EXPORT Buffer { * * @deprecated_gl Prefer to use @ref Magnum::Buffer::map(GLintptr, GLsizeiptr, MapFlags) "map(GLintptr, GLsizeiptr, MapFlags)" * instead, as it has more complete set of features. - * @see map(MapAccess), mapSub() + * @see @ref map(MapAccess), @ref mapSub() * @requires_es_extension %Extension @es_extension{OES,mapbuffer} or * @es_extension{CHROMIUM,map_sub} */ @@ -333,9 +328,7 @@ class MAGNUM_EXPORT Buffer { ReadOnly = GL_READ_ONLY, #endif - /** - * Map buffer for writing only. - */ + /** Map buffer for writing only. */ #ifdef MAGNUM_TARGET_GLES WriteOnly = GL_WRITE_ONLY_OES #else @@ -353,7 +346,7 @@ class MAGNUM_EXPORT Buffer { /** * @brief Memory mapping flag * - * @see MapFlags, map(GLintptr, GLsizeiptr, MapFlags) + * @see @ref MapFlags, @ref map(GLintptr, GLsizeiptr, MapFlags) * @requires_gl30 %Extension @extension{ARB,map_buffer_range} * @requires_gles30 %Extension @es_extension{EXT,map_buffer_range} */ @@ -373,9 +366,9 @@ class MAGNUM_EXPORT Buffer { #endif /** - * Previous contents of the entire buffer may be discarded. May - * not be used in combination with @ref MapFlag::Read. - * @see invalidateData() + * Previous contents of the entire buffer may be discarded. May not + * be used in combination with @ref MapFlag::Read. + * @see @ref invalidateData() */ #ifndef MAGNUM_TARGET_GLES2 InvalidateBuffer = GL_MAP_INVALIDATE_BUFFER_BIT, @@ -384,9 +377,9 @@ class MAGNUM_EXPORT Buffer { #endif /** - * Previous contents of mapped range may be discarded. May not - * be used in combination with @ref MapFlag::Read. - * @see invalidateSubData() + * Previous contents of mapped range may be discarded. May not be + * used in combination with @ref MapFlag::Read. + * @see @ref invalidateSubData() */ #ifndef MAGNUM_TARGET_GLES2 InvalidateRange = GL_MAP_INVALIDATE_RANGE_BIT, @@ -396,8 +389,8 @@ class MAGNUM_EXPORT Buffer { /** * Only one or more discrete subranges of the mapping will be - * modified. See flushMappedRange() for more information. May only - * be used in conjuction with @ref MapFlag::Write. + * modified. See @ref flushMappedRange() for more information. May + * only be used in conjuction with @ref MapFlag::Write. */ #ifndef MAGNUM_TARGET_GLES2 FlushExplicit = GL_MAP_FLUSH_EXPLICIT_BIT, @@ -419,7 +412,7 @@ class MAGNUM_EXPORT Buffer { /** * @brief Memory mapping flags * - * @see map(GLintptr, GLsizeiptr, MapFlags) + * @see @ref map(GLintptr, GLsizeiptr, MapFlags) * @requires_gl30 %Extension @extension{ARB,map_buffer_range} * @requires_gles30 %Extension @es_extension{EXT,map_buffer_range} */ @@ -511,7 +504,7 @@ class MAGNUM_EXPORT Buffer { * * If @extension{EXT,direct_state_access} is not available and the * buffers aren't already bound somewhere, they are bound to - * `Target::CopyRead` and `Target::CopyWrite` before the copy is + * @ref Target::CopyRead and @ref Target::CopyWrite before the copy is * performed. * @see @fn_gl{BindBuffer} and @fn_gl{CopyBufferSubData} or * @fn_gl_extension{NamedCopyBufferSubData,EXT,direct_state_access} @@ -525,10 +518,10 @@ class MAGNUM_EXPORT Buffer { /** * @brief Constructor - * @param targetHint Target hint, see setTargetHint() for more + * @param targetHint Target hint, see @ref setTargetHint() for more * information * - * Generates new OpenGL buffer. + * Creates new OpenGL buffer. * @see @fn_gl{GenBuffers} */ explicit Buffer(Target targetHint = Target::Array); @@ -565,11 +558,11 @@ class MAGNUM_EXPORT Buffer { * * If @extension{EXT,direct_state_access} is not available, the buffer * must be internally bound to some target before any operation. You - * can specify target which will always be used when binding the - * buffer internally, possibly saving some calls to @fn_gl{BindBuffer}. + * can specify target which will always be used when binding the buffer + * internally, possibly saving some calls to @fn_gl{BindBuffer}. * - * Default target hint is `Target::Array`. - * @see setData(), setSubData() + * Default target hint is @ref Target::Array. + * @see @ref setData(), @ref setSubData() * @todo Target::ElementArray cannot be used when no VAO is bound - * http://www.opengl.org/wiki/Vertex_Specification#Index_buffers * ... damned GL state @@ -610,7 +603,8 @@ class MAGNUM_EXPORT Buffer { * Returns data of whole buffer. If @extension{EXT,direct_state_access} * is not available and the buffer is not already bound somewhere, it * is bound to hinted target before the operation. - * @see size(), subData(), setData(), @fn_gl{BindBuffer} and @fn_gl{GetBufferParameter} or + * @see @ref size(), @ref subData(), @ref setData(), @fn_gl{BindBuffer} + * and @fn_gl{GetBufferParameter} or * @fn_gl_extension{GetNamedBufferParameter,EXT,direct_state_access} * with @def_gl{BUFFER_SIZE}, @fn_gl{GetBufferSubData} or * @fn_gl_extension{GetNamedBufferSubData,EXT,direct_state_access} @@ -627,8 +621,9 @@ class MAGNUM_EXPORT Buffer { * Returns data of given buffer portion. If @extension{EXT,direct_state_access} * is not available and the buffer is not already bound somewhere, it * is bound to hinted target before the operation. - * @see size(), data(), setSubData(), @fn_gl{BindBuffer} and @fn_gl{GetBufferSubData} - * or @fn_gl_extension{GetNamedBufferSubData,EXT,direct_state_access} + * @see @ref size(), @ref data(), @ref setSubData(), @fn_gl{BindBuffer} + * and @fn_gl{GetBufferSubData} or + * @fn_gl_extension{GetNamedBufferSubData,EXT,direct_state_access} * @requires_gl %Buffer data queries are not available in OpenGL ES. * Use @ref Magnum::Buffer::map() "map()" instead. */ @@ -644,8 +639,8 @@ class MAGNUM_EXPORT Buffer { * If @extension{EXT,direct_state_access} is not available and the * buffer is not already bound somewhere, it is bound to hinted target * before the operation. - * @see setTargetHint(), @fn_gl{BindBuffer} and @fn_gl{BufferData} or - * @fn_gl_extension{NamedBufferData,EXT,direct_state_access} + * @see @ref setTargetHint(), @fn_gl{BindBuffer} and @fn_gl{BufferData} + * or @fn_gl_extension{NamedBufferData,EXT,direct_state_access} */ Buffer& setData(Containers::ArrayReference data, BufferUsage usage) { (this->*dataImplementation)(data.size(), data, usage); @@ -655,22 +650,15 @@ class MAGNUM_EXPORT Buffer { #ifdef MAGNUM_BUILD_DEPRECATED /** * @brief Set buffer data - * @deprecated Use @ref Magnum::Buffer::setData(Containers::ArrayReference, Usage) "setData(Containers::ArrayReference, Usage)" + * @deprecated Use @ref Magnum::Buffer::setData(Containers::ArrayReference, BufferUsage) "setData(Containers::ArrayReference, BufferUsage)" * instead. */ - Buffer& setData(GLsizeiptr size, const GLvoid* data, Usage usage) { + Buffer& setData(GLsizeiptr size, const GLvoid* data, BufferUsage usage) { return setData({data, std::size_t(size)}, usage); } #endif - /** - * @brief Set buffer data - * @param data Vector with data - * @param usage %Buffer usage - * @return Reference to self (for method chaining) - * - * @see setData(GLsizeiptr, const GLvoid*, Usage) - */ + /** @overload */ template Buffer& setData(const std::vector& data, BufferUsage usage) { setData({data.data(), data.size()}, usage); return *this; @@ -691,7 +679,7 @@ class MAGNUM_EXPORT Buffer { * If @extension{EXT,direct_state_access} is not available and the * buffer is not already bound somewhere, it is bound to hinted target * before the operation. - * @see setTargetHint(), @fn_gl{BindBuffer} and @fn_gl{BufferSubData} + * @see @ref setTargetHint(), @fn_gl{BindBuffer} and @fn_gl{BufferSubData} * or @fn_gl_extension{NamedBufferSubData,EXT,direct_state_access} */ Buffer& setSubData(GLintptr offset, Containers::ArrayReference data) { @@ -710,14 +698,7 @@ class MAGNUM_EXPORT Buffer { } #endif - /** - * @brief Set buffer subdata - * @param offset Offset in the buffer - * @param data Vector with data - * @return Reference to self (for method chaining) - * - * @see setSubData(GLintptr, GLsizeiptr, const GLvoid*) - */ + /** @overload */ template Buffer& setSubData(GLintptr offset, const std::vector& data) { setSubData(offset, {data.data(), data.size()}); return *this; @@ -792,7 +773,8 @@ class MAGNUM_EXPORT Buffer { * target before the operation. * @deprecated_gl Prefer to use @ref Magnum::Buffer::map(GLintptr, GLsizeiptr, MapFlags) "map(GLintptr, GLsizeiptr, MapFlags)" * instead, as it has more complete set of features. - * @see unmapSub(), setTargetHint(), @fn_gl_extension{MapBufferSubData,CHROMIUM,map_sub} + * @see @ref unmapSub(), @ref setTargetHint(), + * @fn_gl_extension{MapBufferSubData,CHROMIUM,map_sub} * @requires_gles20 Not available in ES 3.0 or desktop OpenGL. Use * @ref Magnum::Buffer::map(GLintptr, GLsizeiptr, MapFlags) "map(GLintptr, GLsizeiptr, MapFlags)" * instead. @@ -805,8 +787,8 @@ class MAGNUM_EXPORT Buffer { * @brief Map buffer to client memory * @param offset Offset into the buffer * @param length Length of the mapped memory - * @param flags Flags. At least @ref MapFlag::Read or @ref MapFlag::Write - * must be specified. + * @param flags Flags. At least @ref MapFlag::Read or + * @ref MapFlag::Write must be specified. * @return Pointer to buffer data * * If @extension{EXT,direct_state_access} is not available and the @@ -829,13 +811,13 @@ class MAGNUM_EXPORT Buffer { * @return Reference to self (for method chaining) * * Flushes specified subsection of mapped range. Use only if you called - * map() with @ref MapFlag::FlushExplicit flag. See + * @ref map() with @ref MapFlag::FlushExplicit flag. See * @ref Buffer-data-mapping "class documentation" for usage example. * * If @extension{EXT,direct_state_access} is not available and the * buffer is not already bound somewhere, it is bound to hinted target * before the operation. - * @see setTargetHint(), @fn_gl{BindBuffer} and @fn_gl{FlushMappedBufferRange} + * @see @ref setTargetHint(), @fn_gl{BindBuffer} and @fn_gl{FlushMappedBufferRange} * or @fn_gl_extension{FlushMappedNamedBufferRange,EXT,direct_state_access} * @requires_gl30 %Extension @extension{ARB,map_buffer_range} * @requires_gles30 %Extension @es_extension{EXT,map_buffer_range} @@ -851,7 +833,7 @@ class MAGNUM_EXPORT Buffer { * the buffer was mapped (e.g. after screen was resized), `true` * otherwise. * - * Unmaps buffer previously mapped with map(), invalidating the + * Unmaps buffer previously mapped with @ref map(), invalidating the * pointer returned by these functions. If @extension{EXT,direct_state_access} * is not available and the buffer is not already bound somewhere, it * is bound to hinted target before the operation. @@ -867,7 +849,7 @@ class MAGNUM_EXPORT Buffer { /** * @brief Unmap portion of buffer * - * Unmaps portion of buffer previously mapped with mapSub(), + * Unmaps portion of buffer previously mapped with @ref mapSub(), * invalidating the pointer returned by the function. * @see @fn_gl_extension{UnmapBufferSubData,CHROMIUM,map_sub} * @requires_gles20 Not available in ES 3.0 or desktop OpenGL. Use diff --git a/src/BufferTexture.h b/src/BufferTexture.h index 4bb1dacdc..8d92854de 100644 --- a/src/BufferTexture.h +++ b/src/BufferTexture.h @@ -26,7 +26,7 @@ #ifndef MAGNUM_TARGET_GLES /** @file - * @brief Class Magnum::BufferTexture, enum Magnum::BufferTextureFormat + * @brief Class @ref Magnum::BufferTexture, enum @ref Magnum::BufferTextureFormat */ #endif @@ -38,7 +38,7 @@ namespace Magnum { /** @brief Internal buffer texture format -@see BufferTexture +@see @ref BufferTexture */ enum class BufferTextureFormat: GLenum { /** Red component, normalized unsigned byte. */ @@ -153,14 +153,14 @@ enum class BufferTextureFormat: GLenum { /** @brief %Buffer texture -This texture is, unlike classic textures such as Texture or CubeMapTexture, -used as simple data source, without any unnecessary interpolation and -wrapping methods. +This texture is, unlike classic textures such as @ref Texture or +@ref CubeMapTexture, used as simple data source, without any unnecessary +interpolation and wrapping methods. @section BufferTexture-usage Usage %Texture data are stored in buffer and after binding the buffer to the texture -using setBuffer(), you can fill the buffer at any time using data setting +using @ref setBuffer(), you can fill the buffer at any time using data setting functions in Buffer itself. Note that the buffer is not managed (e.g. deleted on destruction) by the @@ -177,23 +177,24 @@ texture.setBuffer(BufferTextureFormat::RGB32F, buffer); constexpr static Vector3 data[] = { // ... }; -buffer.setData(data, Buffer::Usage::StaticDraw); +buffer.setData(data, BufferUsage::StaticDraw); @endcode -The texture is bound to layer specified by shader via bind(). In shader, the -texture is used via `samplerBuffer`, `isamplerBuffer` or `usamplerBuffer`. +The texture is bound to layer specified by shader via @ref bind(). In shader, +the texture is used via `samplerBuffer`, `isamplerBuffer` or `usamplerBuffer`. Unlike in classic textures, coordinates for buffer textures are integer -coordinates passed to `texelFetch()`. See also AbstractShaderProgram +coordinates passed to `texelFetch()`. See also @ref AbstractShaderProgram documentation for more information. @section BufferTexture-performance-optimization Performance optimizations -If extension @extension{EXT,direct_state_access} is available, setBuffer() + +If extension @extension{EXT,direct_state_access} is available, @ref setBuffer() functions use DSA to avoid unnecessary calls to @fn_gl{ActiveTexture} and -@fn_gl{BindTexture}. See @ref AbstractTexture-performance-optimization -"relevant section in AbstractTexture documentation" and respective function -documentation for more information. +@fn_gl{BindTexture}. See +@ref AbstractTexture-performance-optimization "relevant section in AbstractTexture documentation" +and respective function documentation for more information. -@see Texture, CubeMapTexture, CubeMapTextureArray +@see @ref Texture, @ref CubeMapTexture, @ref CubeMapTextureArray @requires_gl31 %Extension @extension{ARB,texture_buffer_object} @requires_gl Texture buffers are not available in OpenGL ES. */ @@ -217,8 +218,8 @@ class MAGNUM_EXPORT BufferTexture: private AbstractTexture { * @param buffer %Buffer with data * * Binds given buffer to this texture. The buffer itself can be then - * filled with data of proper format at any time using Buffer own data - * setting functions. + * filled with data of proper format at any time using @ref Buffer "Buffer"'s + * own data setting functions. * @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexBuffer} * or @fn_gl_extension{TextureBuffer,EXT,direct_state_access} */ @@ -234,7 +235,7 @@ class MAGNUM_EXPORT BufferTexture: private AbstractTexture { * @param size Data size * * Binds range of given buffer to this texture. The buffer itself can - * be then filled with data of proper format at any time using Buffer + * be then filled with data of proper format at any time using @ref Buffer "Buffer"'s * own data setting functions. * @requires_gl43 %Extension @extension{ARB,texture_buffer_range} * @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexBufferRange} diff --git a/src/CubeMapTexture.h b/src/CubeMapTexture.h index 410b6125f..1183a5081 100644 --- a/src/CubeMapTexture.h +++ b/src/CubeMapTexture.h @@ -25,7 +25,7 @@ */ /** @file - * @brief Class Magnum::CubeMapTexture + * @brief Class @ref Magnum::CubeMapTexture */ #include "AbstractTexture.h" @@ -49,12 +49,12 @@ turned upside down (+Y is top): @section CubeMapTexture-usage Basic usage -See Texture documentation for introduction. +See @ref Texture documentation for introduction. Common usage is to fully configure all texture parameters and then set the data from e.g. set of Image objects: @code -Image2D positiveX({256, 256}, ColorFormat::RGBA, ColorType::UnsignedByte, dataPositiveX); +Image2D positiveX(ColorFormat::RGBA, ColorType::UnsignedByte, {256, 256}, data); // ... CubeMapTexture texture; @@ -66,11 +66,11 @@ texture.setMagnificationFilter(Sampler::Filter::Linear) // ... @endcode -The texture is bound to layer specified by shader via bind(). In shader, the -texture is used via `samplerCube`, `samplerCubeShadow`, `isamplerCube` or +The texture is bound to layer specified by shader via @ref bind(). In shader, +the texture is used via `samplerCube`, `samplerCubeShadow`, `isamplerCube` or `usamplerCube`. Unlike in classic textures, coordinates for cube map textures is signed three-part vector from the center of the cube, which intersects one -of the six sides of the cube map. See also AbstractShaderProgram for more +of the six sides of the cube map. See also @ref AbstractShaderProgram for more information about usage in shaders. @see @ref Renderer::Feature::SeamlessCubeMapTexture, @ref CubeMapTextureArray, @@ -99,7 +99,7 @@ class CubeMapTexture: public AbstractTexture { /** * @brief Set wrapping * - * See Texture::setWrapping() for more information. + * See @ref Texture::setWrapping() for more information. */ CubeMapTexture& setWrapping(const Array3D& wrapping) { DataHelper<3>::setWrapping(this, wrapping); @@ -112,7 +112,7 @@ class CubeMapTexture: public AbstractTexture { * @param coordinate Coordinate * @param level Mip level * - * See Texture::imageSize() for more information. + * See @ref Texture::imageSize() for more information. * @requires_gl %Texture image queries are not available in OpenGL ES. */ Vector2i imageSize(Coordinate coordinate, Int level) { @@ -123,7 +123,7 @@ class CubeMapTexture: public AbstractTexture { /** * @brief Set storage * - * See Texture::setStorage() for more information. + * See @ref Texture::setStorage() for more information. */ CubeMapTexture& setStorage(Int levels, TextureFormat internalFormat, const Vector2i& size) { DataHelper<2>::setStorage(this, _target, levels, internalFormat, size); @@ -137,7 +137,7 @@ class CubeMapTexture: public AbstractTexture { * @param level Mip level * @param image %Image where to put the data * - * See Texture::image(Int, Image&) for more information. + * See @ref Texture::image(Int, Image&) for more information. * @requires_gl %Texture image queries are not available in OpenGL ES. */ void image(Coordinate coordinate, Int level, Image2D& image) { @@ -151,7 +151,7 @@ class CubeMapTexture: public AbstractTexture { * @param image %Buffer image where to put the data * @param usage %Buffer usage * - * See Texture::image(Int, BufferImage&, Buffer::Usage) for more + * See @ref Texture::image(Int, BufferImage&, BufferUsage) for more * information. * @requires_gl %Texture image queries are not available in OpenGL ES. */ @@ -168,7 +168,7 @@ class CubeMapTexture: public AbstractTexture { * @param image %Image * @return Reference to self (for method chaining) * - * See Texture::setImage() for more information. + * See @ref Texture::setImage() for more information. */ CubeMapTexture& setImage(Coordinate coordinate, Int level, TextureFormat internalFormat, const ImageReference2D& image) { DataHelper<2>::setImage(this, GLenum(coordinate), level, internalFormat, image); @@ -191,7 +191,7 @@ class CubeMapTexture: public AbstractTexture { * @param image %Image * @return Reference to self (for method chaining) * - * See Texture::setSubImage() for more information. + * See @ref Texture::setSubImage() for more information. */ CubeMapTexture& setSubImage(Coordinate coordinate, Int level, const Vector2i& offset, const ImageReference2D& image) { DataHelper<2>::setSubImage(this, GLenum(coordinate), level, offset, image); diff --git a/src/CubeMapTextureArray.h b/src/CubeMapTextureArray.h index 99d72f2ae..c28489c90 100644 --- a/src/CubeMapTextureArray.h +++ b/src/CubeMapTextureArray.h @@ -26,7 +26,7 @@ #ifndef MAGNUM_TARGET_GLES /** @file - * @brief Class Magnum::CubeMapTextureArray + * @brief Class @ref Magnum::CubeMapTextureArray */ #endif @@ -38,26 +38,23 @@ namespace Magnum { /** @brief Cube map texture array -See CubeMapTexture documentation for introduction. +See @ref CubeMapTexture documentation for introduction. @section CubeMapTextureArray-usage Usage -Common usage is to specify each layer and face separately using setSubImage(). +Common usage is to specify each layer and face separately using @ref setSubImage(). You have to allocate the memory for all layers and faces first either by -calling setStorage() or by passing properly sized empty Image to setImage(). -Example: array with 16 layers of cube map faces, each face consisting of six -64x64 images: +calling @ref setStorage() or by passing properly sized empty image to +@ref setImage(). Example: array with 16 layers of cube map faces, each face +consisting of six 64x64 images: @code -Image3D dummy({64, 64, 16*6}, ColorFormat::RGBA, ColorType::UnsignedByte, nullptr); - CubeMapTextureArray texture; texture.setMagnificationFilter(Sampler::Filter::Linear) // ... .setStorage(Math::log2(64)+1, TextureFormat::RGBA8, {64, 64, 16}); for(std::size_t i = 0; i != 16; ++i) { - void* dataPositiveX = ...; - Image2D imagePositiveX({64, 64}, ColorFormat::RGBA, ColorType::UnsignedByte, imagePositiveX); + Image2D imagePositiveX(ColorFormat::RGBA, ColorType::UnsignedByte, {64, 64}, data); // ... texture.setSubImage(i, CubeMapTextureArray::Coordinate::PositiveX, 0, {}, imagePositiveX); texture.setSubImage(i, CubeMapTextureArray::Coordinate::NegativeX, 0, {}, imageNegativeX); @@ -67,13 +64,13 @@ for(std::size_t i = 0; i != 16; ++i) { // ... @endcode -The texture is bound to layer specified by shader via bind(). In shader, the -texture is used via `samplerCubeArray`, `samplerCubeArrayShadow`, +The texture is bound to layer specified by shader via @ref bind(). In shader, +the texture is used via `samplerCubeArray`, `samplerCubeArrayShadow`, `isamplerCubeArray` or `usamplerCubeArray`. Unlike in classic textures, coordinates for cube map texture arrays is signed four-part vector. First three parts define vector from the center of the cube which intersects with one of the six sides of the cube map, fourth part is layer in the array. See also -AbstractShaderProgram for more information about usage in shaders. +@ref AbstractShaderProgram for more information about usage in shaders. @see @ref Renderer::Feature::SeamlessCubeMapTexture, @ref CubeMapTexture, @ref Texture, @ref BufferTexture @@ -103,7 +100,7 @@ class CubeMapTextureArray: public AbstractTexture { /** * @brief Set wrapping * - * See Texture::setWrapping() for more information. + * See @ref Texture::setWrapping() for more information. */ CubeMapTextureArray& setWrapping(const Array3D& wrapping) { DataHelper<3>::setWrapping(this, wrapping); @@ -115,7 +112,7 @@ class CubeMapTextureArray: public AbstractTexture { * @param coordinate Coordinate * @param level Mip level * - * See Texture::imageSize() for more information. + * See @ref Texture::imageSize() for more information. */ Vector3i imageSize(Coordinate coordinate, Int level) { return DataHelper<3>::imageSize(this, GL_TEXTURE_CUBE_MAP_POSITIVE_X + GLenum(coordinate), level); @@ -124,7 +121,7 @@ class CubeMapTextureArray: public AbstractTexture { /** * @brief Set storage * - * See Texture::setStorage() for more information. + * See @ref Texture::setStorage() for more information. */ CubeMapTextureArray& setStorage(Int levels, TextureFormat internalFormat, const Vector3i& size) { DataHelper<3>::setStorage(this, _target, levels, internalFormat, size); @@ -138,7 +135,7 @@ class CubeMapTextureArray: public AbstractTexture { * @param level Mip level * @param image %Image where to put the data * - * See Texture::image(Int, Image&) for more information. + * See @ref Texture::image(Int, Image&) for more information. * @requires_gl %Texture image queries are not available in OpenGL ES. */ void image(Coordinate coordinate, Int level, Image3D& image) { @@ -152,11 +149,11 @@ class CubeMapTextureArray: public AbstractTexture { * @param image %Buffer image where to put the data * @param usage %Buffer usage * - * See Texture::image(Int, BufferImage&, Buffer::Usage) for more + * See @ref Texture::image(Int, BufferImage&, BufferUsage) for more * information. * @requires_gl %Texture image queries are not available in OpenGL ES. */ - void image(Coordinate coordinate, Int level, BufferImage3D& image, Buffer::Usage usage) { + void image(Coordinate coordinate, Int level, BufferImage3D& image, BufferUsage usage) { AbstractTexture::image<3>(GL_TEXTURE_CUBE_MAP_POSITIVE_X + GLenum(coordinate), level, image, usage); } #endif @@ -165,15 +162,15 @@ class CubeMapTextureArray: public AbstractTexture { * @brief Set image data * @param level Mip level * @param internalFormat Internal format - * @param image Image, ImageReference, BufferImage or - * Trade::ImageData of the same dimension count + * @param image @ref Image, @ref ImageReference, @ref BufferImage + * or @ref Trade::ImageData of the same dimension count * @return Reference to self (for method chaining) * * Sets texture image data from three-dimensional image for all cube * faces for all layers. Each group of 6 2D images is one cube map * layer. The images are ordered the same way as Coordinate enum. * - * See Texture::setImage() for more information. + * See @ref Texture::setImage() for more information. */ CubeMapTextureArray& setImage(Int level, TextureFormat internalFormat, const ImageReference3D& image) { DataHelper<3>::setImage(this, GL_TEXTURE_CUBE_MAP_ARRAY, level, internalFormat, image); @@ -190,8 +187,8 @@ class CubeMapTextureArray: public AbstractTexture { * @brief Set texture image 3D subdata * @param level Mip level * @param offset Offset where to put data in the texture - * @param image Image3D, ImageReference3D, BufferImage3D or - * Trade::ImageData3D + * @param image @ref Image3D, @ref ImageReference3D, @ref BufferImage3D + * or @ref Trade::ImageData3D * @return Reference to self (for method chaining) * * Sets texture image subdata for more than one level/face at once. @@ -199,11 +196,9 @@ class CubeMapTextureArray: public AbstractTexture { * Z coordinate of @p offset specifies layer and cube map face. If * you want to start at given face in layer *n*, you have to specify * Z coordinate as @f$ 6n + i @f$, where i is face index as specified - * in Coordinate enum. - * - * See Texture::setSubImage() for more information. + * in @ref Coordinate enum. * - * @see setSubImage(Int, Coordinate, Int, const Math::Vector<2, Int>&, const Image*) + * See @ref Texture::setSubImage() for more information. */ CubeMapTextureArray& setSubImage(Int level, const Vector3i& offset, const ImageReference3D& image) { DataHelper<3>::setSubImage(this, GL_TEXTURE_CUBE_MAP_ARRAY, level, offset, image); @@ -223,10 +218,10 @@ class CubeMapTextureArray: public AbstractTexture { * @param size Size of invalidated data * * Z coordinate is equivalent to layer * 6 + number of texture face, - * i.e. @ref Coordinate "Coordinate::PositiveX" is `0` and so on, in - * the same order as in the enum. + * i.e. @ref Coordinate::PositiveX is `0` and so on, in the same order + * as in the enum. * - * See Texture::invalidateSubImage() for more information. + * See @ref Texture::invalidateSubImage() for more information. */ void invalidateSubImage(Int level, const Vector3i& offset, const Vector3i& size) { DataHelper<3>::invalidateSubImage(this, level, offset, size); diff --git a/src/Math/Geometry/Rectangle.h b/src/Math/Geometry/Rectangle.h index 56d679a46..bd2153a41 100644 --- a/src/Math/Geometry/Rectangle.h +++ b/src/Math/Geometry/Rectangle.h @@ -36,7 +36,7 @@ namespace Magnum { namespace Math { namespace Geometry { /** @copybrief Math::Range2D -@deprecated Use @ref Math::Range2D instead. +@deprecated Use @ref Magnum::Math::Range2D instead. */ template class Rectangle: public Range2D { public: diff --git a/src/Mesh.h b/src/Mesh.h index 6888d8ced..8af843eec 100644 --- a/src/Mesh.h +++ b/src/Mesh.h @@ -83,7 +83,7 @@ Mesh mesh; static constexpr Vector3 positions[30] = { // ... }; -vertexBuffer.setData(positions, Buffer::Usage::StaticDraw); +vertexBuffer.setData(positions, BufferUsage::StaticDraw); // Set primitive and vertex count, add the buffer and specify its layout mesh.setPrimitive(Mesh::Primitive::Triangles) @@ -100,7 +100,7 @@ Buffer vertexBuffer; Mesh mesh; // Fill vertex buffer with interleaved position and normal data -MeshTools::interleave(mesh, buffer, Buffer::Usage::StaticDraw, +MeshTools::interleave(mesh, buffer, BufferUsage::StaticDraw, plane.positions(0), plane.normals(0)); // Set primitive and specify layout of interleaved vertex buffer, vertex count @@ -126,13 +126,13 @@ Mesh mesh; static constexpr Vector3 positions[300] = { // ... }; -vertexBuffer.setData(positions, Buffer::Usage::StaticDraw); +vertexBuffer.setData(positions, BufferUsage::StaticDraw); // Fill index buffer with index data static constexpr GLubyte indices[75] = { // ... }; -indexBuffer.setData(indices, Buffer::Usage::StaticDraw); +indexBuffer.setData(indices, BufferUsage::StaticDraw); // Set primitive, index count, specify the buffers mesh.setPrimitive(Mesh::Primitive::Triangles) @@ -148,11 +148,11 @@ Buffer vertexBuffer, indexBuffer; Mesh mesh; // Fill vertex buffer with interleaved position and normal data -MeshTools::interleave(mesh, vertexBuffer, Buffer::Usage::StaticDraw, +MeshTools::interleave(mesh, vertexBuffer, BufferUsage::StaticDraw, cube.positions(0), cube.normals(0)); // Fill index buffer with compressed index data -MeshTools::compressIndices(mesh, indexBuffer, Buffer::Usage::StaticDraw, +MeshTools::compressIndices(mesh, indexBuffer, BufferUsage::StaticDraw, cube.indices()); // Set primitive and specify layout of interleaved vertex buffer. Index count @@ -192,7 +192,7 @@ Buffer colorBuffer; GLubyte colors[4*30] = { // ... }; -colorBuffer.setData(colors, Buffer::Usage::StaticDraw); +colorBuffer.setData(colors, BufferUsage::StaticDraw); // Specify layout of color buffer -- BGRA, each component unsigned byte and we // want to normalize them from [0, 255] to [0.0f, 1.0f] @@ -241,7 +241,7 @@ class MAGNUM_EXPORT Mesh { /** * @brief Primitive type * - * @see primitive(), setPrimitive() + * @see @ref primitive(), @ref setPrimitive() */ enum class Primitive: GLenum { /** Single points. */ @@ -315,7 +315,7 @@ class MAGNUM_EXPORT Mesh { /** * @brief Index type * - * @see setIndexBuffer(), indexSize() + * @see @ref setIndexBuffer(), @ref indexSize() */ enum class IndexType: GLenum { UnsignedByte = GL_UNSIGNED_BYTE, /**< Unsigned byte */ @@ -365,7 +365,7 @@ class MAGNUM_EXPORT Mesh { /** * @brief Size of given index type * - * @see indexSize() const + * @see @ref indexSize() const */ static std::size_t indexSize(IndexType type); @@ -374,8 +374,8 @@ class MAGNUM_EXPORT Mesh { * @param primitive Primitive type * * Creates mesh with no vertex buffers and zero vertex count. - * @see setPrimitive(), setVertexCount(), @fn_gl{GenVertexArrays} (if - * @extension{APPLE,vertex_array_object} is available) + * @see @ref setPrimitive(), @ref setVertexCount(), @fn_gl{GenVertexArrays} + * (if @extension{APPLE,vertex_array_object} is available) */ explicit Mesh(Primitive primitive = Primitive::Triangles); @@ -402,7 +402,7 @@ class MAGNUM_EXPORT Mesh { /** * @brief Index size * - * @see indexSize(IndexType) + * @see @ref indexSize(IndexType) */ std::size_t indexSize() const { return indexSize(_indexType); } @@ -429,7 +429,8 @@ class MAGNUM_EXPORT Mesh { * @return Reference to self (for method chaining) * * Default is zero. - * @see setPrimitive(), addVertexBuffer(), MeshTools::interleave() + * @see @ref setPrimitive(), @ref addVertexBuffer(), + * @ref MeshTools::interleave() */ Mesh& setVertexCount(Int vertexCount) { _vertexCount = vertexCount; @@ -444,7 +445,7 @@ class MAGNUM_EXPORT Mesh { * @return Reference to self (for method chaining) * * Default is zero. - * @see setIndexBuffer(), MeshTools::compressIndices() + * @see @ref setIndexBuffer(), @ref MeshTools::compressIndices() */ Mesh& setIndexCount(Int count) { _indexCount = count; @@ -469,34 +470,34 @@ class MAGNUM_EXPORT Mesh { * position and normal, so you have to skip weight and texture * coordinate in each vertex: * @code - Buffer buffer; - Mesh mesh; - mesh.addVertexBuffer(buffer, 76, // initial array offset - 4, // skip vertex weight (Float) - Shaders::Phong::Position(), // vertex position - 8, // skip texture coordinates (Vector2) - Shaders::Phong::Normal()); // vertex normal - @endcode + * Buffer buffer; + * Mesh mesh; + * mesh.addVertexBuffer(buffer, 76, // initial array offset + * 4, // skip vertex weight (Float) + * Shaders::Phong::Position(), // vertex position + * 8, // skip texture coordinates (Vector2) + * Shaders::Phong::Normal()); // vertex normal + * @endcode * * You can also achieve the same effect by calling @ref addVertexBuffer() * more times with explicitly specified gaps before and after the * attributes. This can be used for e.g. runtime-dependent * configuration, as it isn't dependent on the variadic template: - @code - mesh.addVertexBuffer(buffer, 76, 4, Shaders::Phong::Position(), 20) - .addVertexBuffer(buffer, 76, 24, Shaders::Phong::Normal(), 0); - @endcode + * @code + * mesh.addVertexBuffer(buffer, 76, 4, Shaders::Phong::Position(), 20) + * .addVertexBuffer(buffer, 76, 24, Shaders::Phong::Normal(), 0); + * @endcode * * If specifying more than one attribute, the function assumes that * the array is interleaved. Adding non-interleaved vertex buffer can * be done by specifying one attribute at a time with specific offset. * Above example with weight, position, texture coordinate and normal * arrays one after another (non-interleaved): - @code - Int vertexCount = 352; - mesh.addVertexBuffer(buffer, 76 + 4*vertexCount, Shaders::Phong::Position()) - .addVertexBuffer(buffer, 76 + 24*vertexCount, Shaders::Phong::Normal()); - @endcode + * @code + * Int vertexCount = 352; + * mesh.addVertexBuffer(buffer, 76 + 4*vertexCount, Shaders::Phong::Position()) + * .addVertexBuffer(buffer, 76 + 24*vertexCount, Shaders::Phong::Normal()); + * @endcode * * @attention The buffer passed as parameter is not managed by the * mesh, you must ensure it will exist for whole lifetime of the @@ -528,10 +529,10 @@ class MAGNUM_EXPORT Mesh { * The smaller range is specified with @p start and @p end the less * memory operations are needed (and possibly some optimizations), * improving draw performance. Specifying `0` for both parameters - * behaves the same as setIndexBuffer(Buffer*, GLintptr, IndexType). + * behaves the same as @ref setIndexBuffer(Buffer&, GLintptr, IndexType). * On OpenGL ES 2.0 this function behaves always as - * setIndexBuffer(Buffer*, GLintptr, IndexType), as this functionality - * is not available there. + * @ref setIndexBuffer(Buffer&, GLintptr, IndexType), as this + * functionality is not available there. * @see @ref maxElementsIndices(), @ref maxElementsVertices(), * @ref setIndexCount(), @ref MeshTools::compressIndices(), * @fn_gl{BindVertexArray}, @fn_gl{BindBuffer} (if @@ -546,7 +547,7 @@ class MAGNUM_EXPORT Mesh { * @param type Index data type * @return Reference to self (for method chaining) * - * Prefer to use setIndexBuffer(Buffer*, GLintptr, IndexType, UnsignedInt, UnsignedInt) + * Prefer to use @ref setIndexBuffer(Buffer&, GLintptr, IndexType, UnsignedInt, UnsignedInt) * for better performance. * @see setIndexCount(), MeshTools::compressIndices(), * @fn_gl{BindVertexArray}, @fn_gl{BindBuffer} (if diff --git a/src/MeshTools/CompressIndices.h b/src/MeshTools/CompressIndices.h index 781b9d295..43ef9ae2e 100644 --- a/src/MeshTools/CompressIndices.h +++ b/src/MeshTools/CompressIndices.h @@ -25,7 +25,7 @@ */ /** @file - * @brief Function Magnum::MeshTools::compressIndices() + * @brief Function @ref Magnum::MeshTools::compressIndices() */ #include @@ -52,7 +52,7 @@ Containers::Array data; std::tie(indexCount, indexType, data) = MeshTools::compressIndices(indices); @endcode -See also compressIndices(Mesh*, Buffer*, Buffer::Usage, const std::vector&), +See also @ref compressIndices(Mesh&, Buffer&, BufferUsage, const std::vector&), which writes the compressed data directly into index buffer of given mesh. */ std::tuple> MAGNUM_MESHTOOLS_EXPORT compressIndices(const std::vector& indices); @@ -64,12 +64,12 @@ std::tuple> MAGNUM_MESHTOO @param usage Index buffer usage @param indices Index array -The same as compressIndices(const std::vector&), but this +The same as @ref compressIndices(const std::vector&), but this function writes the output to given buffer, updates index count and specifies index buffer with proper index range in the mesh, so you don't have to call -Mesh::setIndexCount() and Mesh::setIndexBuffer() on your own. +@ref Mesh::setIndexCount() and @ref Mesh::setIndexBuffer() on your own. -@see MeshTools::interleave() +@see @ref MeshTools::interleave() */ void MAGNUM_MESHTOOLS_EXPORT compressIndices(Mesh& mesh, Buffer& buffer, BufferUsage usage, const std::vector& indices); diff --git a/src/MeshTools/Interleave.h b/src/MeshTools/Interleave.h index 4e4dc804b..e5dae48cc 100644 --- a/src/MeshTools/Interleave.h +++ b/src/MeshTools/Interleave.h @@ -25,7 +25,7 @@ */ /** @file - * @brief Function Magnum::MeshTools::interleave() + * @brief Function @ref Magnum::MeshTools::interleave() */ #include @@ -171,7 +171,7 @@ possible performance loss. for) and function `size()` returning count of elements. In most cases it will be `std::vector` or `std::array`. -See also interleave(Mesh*, Buffer*, Buffer::Usage, const T&...), +See also @ref interleave(Mesh&, Buffer&, BufferUsage, const T&...), which writes the interleaved array directly into buffer of given mesh. */ /* enable_if to avoid clash with overloaded function below */ @@ -186,9 +186,9 @@ template inline typename std::enable_ifsetData(attribute, usage); -mesh->setVertexCount(attribute.size()); +buffer.setData(attribute, usage); +mesh.setVertexCount(attribute.size()); @endcode -@see MeshTools::compressIndices() +@see @ref MeshTools::compressIndices() */ template inline void interleave(Mesh& mesh, Buffer& buffer, BufferUsage usage, const T&... attributes) { return Implementation::Interleave()(mesh, buffer, usage, attributes...); diff --git a/src/Text/Renderer.h b/src/Text/Renderer.h index 235377b20..27da6a9c9 100644 --- a/src/Text/Renderer.h +++ b/src/Text/Renderer.h @@ -186,7 +186,7 @@ Mesh mesh; // Render the text Range2D rectangle; std::tie(mesh, rectangle) = Text::Renderer2D::render(*font, cache, 0.15f, - "Hello World!", vertexBuffer, indexBuffer, Buffer::Usage::StaticDraw); + "Hello World!", vertexBuffer, indexBuffer, BufferUsage::StaticDraw); // Draw white text centered on the screen shader.setTransformationProjectionMatrix(projection*Matrix3::translation(-rectangle.width()/2.0f)) @@ -196,7 +196,7 @@ glyphCache->texture()->bind(Shaders::VectorShader2D::FontTextureLayer); mesh.draw(); @endcode See @ref render(AbstractFont&, const GlyphCache&, Float, const std::string&, Alignment) and -@ref render(AbstractFont&, const GlyphCache&, Float, const std::string&, Buffer&, Buffer&, Buffer::Usage, Alignment) +@ref render(AbstractFont&, const GlyphCache&, Float, const std::string&, Buffer&, Buffer&, BufferUsage, Alignment) for more information. While this method is sufficient for one-shot rendering of static texts, for @@ -209,7 +209,7 @@ Shaders::VectorShader2D shader; // Initialize renderer and reserve memory for enough glyphs Text::Renderer2D renderer(*font, cache, 0.15f); -renderer.reserve(32, Buffer::Usage::DynamicDraw, Buffer::Usage::StaticDraw); +renderer.reserve(32, BufferUsage::DynamicDraw, BufferUsage::StaticDraw); // Update the text occasionally renderer.render("Hello World Countdown: 10"); diff --git a/src/Texture.h b/src/Texture.h index ed47fede3..6ed901b4d 100644 --- a/src/Texture.h +++ b/src/Texture.h @@ -25,7 +25,7 @@ */ /** @file - * @brief Class Magnum::Texture, typedef Magnum::Texture1D, Magnum::Texture2D, Magnum::Texture3D + * @brief Class @ref Magnum::Texture, typedef @ref Magnum::Texture1D, @ref Magnum::Texture2D, @ref Magnum::Texture3D */ #include "AbstractTexture.h" @@ -37,16 +37,15 @@ namespace Magnum { @brief %Texture Template class for one- to three-dimensional textures. See also -AbstractTexture documentation for more information. +@ref AbstractTexture documentation for more information. @section Texture-usage Usage Common usage is to fully configure all texture parameters and then set the -data from e.g. Image. Example configuration of high quality texture with +data from e.g. @ref Image. Example configuration of high quality texture with trilinear anisotropic filtering, i.e. the best you can ask for: @code -void* data; -Image2D image({4096, 4096}, ColorFormat::RGBA, ColorType::UnsignedByte, data); +Image2D image(ColorFormat::RGBA, ColorType::UnsignedByte, {4096, 4096}, data); Texture2D texture; texture.setMagnificationFilter(Sampler::Filter::Linear) @@ -54,22 +53,23 @@ texture.setMagnificationFilter(Sampler::Filter::Linear) .setWrapping(Sampler::Wrapping::ClampToEdge) .setMaxAnisotropy(Sampler::maxAnisotropy()) .setStorage(Math::log2(4096)+1, TextureFormat::RGBA8, {4096, 4096}) - .setSubImage(0, {}, &image) + .setSubImage(0, {}, image) .generateMipmap(); @endcode @attention Don't forget to fully configure the texture before use. Note that - default configuration (if setMinificationFilter() is not called with - another value) is to use mipmaps, so be sure to either call setMinificationFilter(), - explicitly specify all mip levels with setStorage() and setImage() or call - generateMipmap(). If using rectangle texture, you must also call - setWrapping(), because the initial value is not supported on rectangle - textures. See also setMagnificationFilter() and setBorderColor(). - -The texture is bound to layer specified by shader via bind(). In shader, the -texture is used via `sampler2D` and friends, see @ref Target enum documentation -for more information. See also AbstractShaderProgram documentation for more -information about usage in shaders. + default configuration (if @ref setMinificationFilter() is not called with + another value) is to use mipmaps, so be sure to either call @ref setMinificationFilter(), + explicitly specify all mip levels with @ref setStorage() and @ref setImage() + or call @ref generateMipmap(). If using rectangle texture, you must also + call @ref setWrapping(), because the initial value is not supported on + rectangle textures. See also @ref setMagnificationFilter() and + @ref setBorderColor(). + +The texture is bound to layer specified by shader via @ref bind(). In shader, +the texture is used via `sampler2D` and friends, see @ref Target enum +documentation for more information. See also AbstractShaderProgram +documentation for more information about usage in shaders. @section Texture-array Texture arrays @@ -77,10 +77,10 @@ You can create texture arrays by passing @ref Target::Texture1DArray "Texture2D::Target::Texture1DArray" or @ref Target::Texture2DArray "Texture3D::Target::Texture2DArray" to constructor. -It is possible to specify each layer separately using setSubImage(), but you -have to allocate the memory for all layers first either by calling setStorage() -or by passing properly sized empty Image to setImage(). Example: 2D texture -array with 16 layers of 64x64 images: +It is possible to specify each layer separately using @ref setSubImage(), but +you have to allocate the memory for all layers first either by calling +@ref setStorage() or by passing properly sized empty image to @ref setImage(). +Example: 2D texture array with 16 layers of 64x64 images: @code Texture3D texture(Texture3D::Target::Texture2DArray); texture.setMagnificationFilter(Sampler::Filter::Linear) @@ -88,8 +88,8 @@ texture.setMagnificationFilter(Sampler::Filter::Linear) .setStorage(levels, TextureFormat::RGBA8, {64, 64,16}); for(std::size_t i = 0; i != 16; ++i) { - void* data = ...; - Image2D image({64, 64}, ColorFormat::RGBA, ColorType::UnsignedByte, image); + // ... + Image2D image(ColorFormat::RGBA, ColorType::UnsignedByte, {64, 64}, data[i]); texture.setSubImage(0, Vector3i::zAxis(i), image); } @@ -97,8 +97,8 @@ for(std::size_t i = 0; i != 16; ++i) { @endcode Similar approach can be used for any other texture types (e.g. setting -Texture3D data using 2D layers, Texture2D data using one-dimensional chunks -etc.). +@ref Texture3D data using 2D layers, @ref Texture2D data using one-dimensional +chunks etc.). @requires_gl30 %Extension @extension{EXT,texture_array} for texture arrays. @requires_gles30 %Array textures are not available in OpenGL ES 2.0. @@ -130,8 +130,8 @@ documentation for more information. textures. @requires_gl Rectangle textures are not available in OpenGL ES. -@see Texture1D, Texture2D, Texture3D, CubeMapTexture, CubeMapTextureArray, - BufferTexture +@see @ref Texture1D, @ref Texture2D, @ref Texture3D, @ref CubeMapTexture, + @ref CubeMapTextureArray, @ref BufferTexture @todo @extension{AMD,sparse_texture} */ template class Texture: public AbstractTexture { @@ -224,7 +224,7 @@ template class Texture: public AbstractTexture { * is `Target::Texture1D`, `Target::Texture2D` or * `Target::Texture3D` based on dimension count. * - * Creates one OpenGL texture. + * Creates new OpenGL texture. * @see @fn_gl{GenTextures} */ explicit Texture(Target target = DataHelper::target()): AbstractTexture(GLenum(target)) {} @@ -281,13 +281,14 @@ template class Texture: public AbstractTexture { * Specifies entire structure of a texture at once, removing the need * for additional consistency checks and memory reallocations when * updating the data later. After calling this function the texture - * is immutable and calling setStorage() or setImage() is not allowed. + * is immutable and calling @ref setStorage() or @ref setImage() is not + * allowed. * * If @extension{EXT,direct_state_access} is not available, the * texture is bound to some layer before the operation. If * OpenGL 4.2, @extension{ARB,texture_storage}, OpenGL ES 3.0 or @es_extension{EXT,texture_storage} * in OpenGL ES 2.0 is not available, the feature is emulated with - * sequence of setImage() calls. + * sequence of @ref setImage() calls. * @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and * @fn_gl{TexStorage1D}/@fn_gl{TexStorage2D}/@fn_gl{TexStorage3D} * or @fn_gl_extension{TextureStorage1D,EXT,direct_state_access}/ @@ -310,7 +311,8 @@ template class Texture: public AbstractTexture { * @param image %Image where to put the data * * %Image parameters like format and type of pixel data are taken from - * given image, image size is taken from the texture using imageSize(). + * given image, image size is taken from the texture using + * @ref imageSize(). * * If @extension{EXT,direct_state_access} is not available, the * texture is bound to some layer before the operation. If @@ -336,7 +338,7 @@ template class Texture: public AbstractTexture { * @param image %Buffer image where to put the data * @param usage %Buffer usage * - * See image(Int, Image&) for more information. + * See @ref image(Int, Image&) for more information. * @requires_gl %Texture image queries are not available in OpenGL ES. */ void image(Int level, BufferImage& image, BufferUsage usage) { @@ -352,8 +354,8 @@ template class Texture: public AbstractTexture { * @return Reference to self (for method chaining) * * For better performance when generating mipmaps using - * generateMipmap() or calling setImage() more than once use - * setStorage() and setSubImage() instead. + * @ref generateMipmap() or calling @ref setImage() more than once use + * @ref setStorage() and @ref setSubImage() instead. * * If @extension{EXT,direct_state_access} is not available, the * texture is bound to some layer before the operation. @@ -385,9 +387,10 @@ template class Texture: public AbstractTexture { * * If @extension{EXT,direct_state_access} is not available, the * texture is bound to some layer before the operation. - * @see setStorage(), setImage(), @fn_gl{ActiveTexture}, @fn_gl{BindTexture} - * and @fn_gl{TexSubImage1D}/@fn_gl{TexSubImage2D}/@fn_gl{TexSubImage3D} - * or @fn_gl_extension{TextureSubImage1D,EXT,direct_state_access}/ + * @see @ref setStorage(), @ref setImage(), @fn_gl{ActiveTexture}, + * @fn_gl{BindTexture} and @fn_gl{TexSubImage1D}/ + * @fn_gl{TexSubImage2D}/@fn_gl{TexSubImage3D} or + * @fn_gl_extension{TextureSubImage1D,EXT,direct_state_access}/ * @fn_gl_extension{TextureSubImage2D,EXT,direct_state_access}/ * @fn_gl_extension{TextureSubImage3D,EXT,direct_state_access} */ @@ -412,7 +415,7 @@ template class Texture: public AbstractTexture { * * If running on OpenGL ES or extension @extension{ARB,invalidate_subdata} * is not available, this function does nothing. - * @see invalidateImage(), @fn_gl{InvalidateTexSubImage} + * @see @ref invalidateImage(), @fn_gl{InvalidateTexSubImage} */ void invalidateSubImage(Int level, const typename DimensionTraits::VectorType& offset, const typename DimensionTraits::VectorType& size) { DataHelper::invalidateSubImage(this, level, offset, size); From 50c7ab1edce8b1f4dfe7731d45e2060f58f4c281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 2 Dec 2013 01:34:00 +0100 Subject: [PATCH 098/105] package: build tests also in MinGW Jenkins configuration. We want to test at least that they build successfully. --- package/ci/jenkins-mingw32.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/package/ci/jenkins-mingw32.xml b/package/ci/jenkins-mingw32.xml index 0619969c1..81c54c69d 100644 --- a/package/ci/jenkins-mingw32.xml +++ b/package/ci/jenkins-mingw32.xml @@ -79,6 +79,7 @@ cmake .. \ -DCMAKE_TOOLCHAIN_FILE=../toolchains/archlinux/basic-mingw32.cmake \ -DCMAKE_FIND_ROOT_PATH=${JENKINS_HOME}/filesystem/mingw32-${libraries} \ -DCMAKE_INSTALL_PREFIX=${JENKINS_HOME}/filesystem/mingw32-${libraries}-${compatibility} \ + -DBUILD_TESTS=ON \ -DBUILD_DEPRECATED=${deprecated_build_flag} \ ${static_build_flag} \ -DWITH_AUDIO=ON \ From 769838dbd5b52ba9233deb7c3ca2026de9badd35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 2 Dec 2013 01:54:30 +0100 Subject: [PATCH 099/105] Documented custom engine initialization, various doc updates. --- doc/platform.dox | 27 +++++++++++++++++ src/Context.h | 79 ++++++++++++++++++++++++------------------------ 2 files changed, 67 insertions(+), 39 deletions(-) diff --git a/doc/platform.dox b/doc/platform.dox index 17e946156..463066526 100644 --- a/doc/platform.dox +++ b/doc/platform.dox @@ -233,6 +233,33 @@ MyApplication::MyApplication(int& argc, char** argv): Platform::Application(argc } @endcode +@section platform-custom Using custom platform toolkits + +In case you want to use some not-yet-supported toolkit or you don't want to use +the wrappers in @ref Platform namespace, you can initialize %Magnum manually. +All you need is to create OpenGL context and then create instance of +@ref Context class, which will take care of proper initialization and feature +detection. The instance must be alive for whole application lifetime. Example +`main()` function with manual initialization: +@code +int main(int argc, char** argv) { + // Create OpenGL context ... + + { + // Initialize Magnum + Context context; + + // open window, enter main loop... + + // Magnum context gets destroyed + } + + // delete OpenGL context ... + + return 0; +} +@endcode + - Next page: @ref types */ }} diff --git a/src/Context.h b/src/Context.h index 7ec706a56..0dbeff1e8 100644 --- a/src/Context.h +++ b/src/Context.h @@ -25,7 +25,7 @@ */ /** @file /Context.h - * @brief Enum Magnum::Version, class Magnum::Context, Magnum::Extension, macro MAGNUM_ASSERT_VERSION_SUPPORTED(), MAGNUM_ASSERT_EXTENSION_SUPPORTED() + * @brief Class @ref Magnum::Context, @ref Magnum::Extension, enum @ref Magnum::Version, macro @ref MAGNUM_ASSERT_VERSION_SUPPORTED(), @ref MAGNUM_ASSERT_EXTENSION_SUPPORTED() */ #include @@ -48,7 +48,7 @@ namespace Implementation { /** @brief OpenGL version -@see Context, MAGNUM_ASSERT_VERSION_SUPPORTED() +@see @ref Context, @ref MAGNUM_ASSERT_VERSION_SUPPORTED() */ enum class Version: Int { None = 0xFFFF, /**< @brief Unspecified */ @@ -102,8 +102,8 @@ Encapsulates runtime information about OpenGL extension, such as name string, minimal required OpenGL version and version in which the extension was adopted to core. -See also Extensions namespace, which contain compile-time information about -OpenGL extensions. +See also @ref Extensions namespace, which contain compile-time information +about OpenGL extensions. */ class MAGNUM_EXPORT Extension { friend class Context; @@ -133,12 +133,13 @@ class MAGNUM_EXPORT Extension { }; /** -@brief OpenGL context +@brief Magnum context Provides access to version and extension information. Instance available -through Context::current() is automatically created during construction of -*Application classes in Platform namespace so you can safely assume that the -instance is available during whole lifetime of *Application object. +through @ref Context::current() is automatically created during construction of +*Application classes in @ref Platform namespace. You can safely assume that the +instance is available during whole lifetime of *Application object. See +@ref platform documentation for more information about engine setup. @todo @extension{ATI,meminfo}, @extension{NVX,gpu_memory_info}, GPU temperature? (here or where?) */ @@ -152,7 +153,7 @@ class MAGNUM_EXPORT Context { /** * @brief Context flag * - * @see Flags, flags() + * @see @ref Flags, @ref flags() */ enum class Flag: GLint { /** @@ -181,15 +182,15 @@ class MAGNUM_EXPORT Context { /** * @brief Context flags * - * @see flags() + * @see @ref flags() */ typedef Containers::EnumSet Flags; /** * @brief Constructor * - * Constructed automatically, see class documentation for more - * information. + * Does initial setup, detects available features and enables them + * throughout the engine. * @see @fn_gl{Get} with @def_gl{MAJOR_VERSION}, @def_gl{MINOR_VERSION}, * @def_gl{CONTEXT_FLAGS}, @def_gl{NUM_EXTENSIONS}, * @fn_gl{GetString} with @def_gl{EXTENSIONS} @@ -204,24 +205,24 @@ class MAGNUM_EXPORT Context { /** * @brief OpenGL version * - * @see majorVersion(), minorVersion(), versionString(), - * shadingLanguageVersionString() + * @see @ref majorVersion(), @ref minorVersion(), @ref versionString(), + * @ref shadingLanguageVersionString() */ Version version() const { return _version; } /** * @brief Major OpenGL version (e.g. `4`) * - * @see minorVersion(), version(), versionString(), - * shadingLanguageVersionString() + * @see @ref minorVersion(), @ref version(), @ref versionString(), + * @ref shadingLanguageVersionString() */ Int majorVersion() const { return _majorVersion; } /** * @brief Minor OpenGL version (e.g. `3`) * - * @see majorVersion(), version(), versionString(), - * shadingLanguageVersionString() + * @see @ref majorVersion(), @ref version(), @ref versionString(), + * @ref shadingLanguageVersionString() */ Int minorVersion() const { return _minorVersion; } @@ -230,7 +231,7 @@ class MAGNUM_EXPORT Context { * * The result is *not* cached, repeated queries will result in repeated * OpenGL calls. - * @see rendererString(), @fn_gl{GetString} with @def_gl{VENDOR} + * @see @ref rendererString(), @fn_gl{GetString} with @def_gl{VENDOR} */ std::string vendorString() const { return reinterpret_cast(glGetString(GL_VENDOR)); @@ -241,7 +242,7 @@ class MAGNUM_EXPORT Context { * * The result is *not* cached, repeated queries will result in repeated * OpenGL calls. - * @see vendorString(), @fn_gl{GetString} with @def_gl{RENDERER} + * @see @ref vendorString(), @fn_gl{GetString} with @def_gl{RENDERER} */ std::string rendererString() const { return reinterpret_cast(glGetString(GL_RENDERER)); @@ -252,8 +253,8 @@ class MAGNUM_EXPORT Context { * * The result is *not* cached, repeated queries will result in repeated * OpenGL calls. - * @see shadingLanguageVersionString(), version(), @fn_gl{GetString} - * with @def_gl{VERSION} + * @see @ref shadingLanguageVersionString(), @ref version(), + * @fn_gl{GetString} with @def_gl{VERSION} */ std::string versionString() const { return reinterpret_cast(glGetString(GL_VERSION)); @@ -264,7 +265,7 @@ class MAGNUM_EXPORT Context { * * The result is *not* cached, repeated queries will result in repeated * OpenGL calls. - * @see versionString(), version(), @fn_gl{GetString} with + * @see @ref versionString(), @ref version(), @fn_gl{GetString} with * @def_gl{SHADING_LANGUAGE_VERSION} */ std::string shadingLanguageVersionString() const { @@ -276,8 +277,9 @@ class MAGNUM_EXPORT Context { * * The result is *not* cached, repeated queries will result in repeated * OpenGL calls. - * @see versionString(), version(), @fn_gl{Get} with @def_gl{NUM_SHADING_LANGUAGE_VERSIONS}, - * @fn_gl{GetString} with @def_gl{SHADING_LANGUAGE_VERSION} + * @see @ref versionString(), @ref version(), @fn_gl{Get} with + * @def_gl{NUM_SHADING_LANGUAGE_VERSIONS}, @fn_gl{GetString} with + * @def_gl{SHADING_LANGUAGE_VERSION} */ std::vector shadingLanguageVersionStrings() const; @@ -289,8 +291,7 @@ class MAGNUM_EXPORT Context { * * The list contains only extensions from OpenGL versions newer than * the current. - * - * @see isExtensionSupported(), Extension::extensions() + * @see @ref isExtensionSupported(), @ref Extension::extensions() */ const std::vector& supportedExtensions() const { return _supportedExtensions; @@ -299,7 +300,7 @@ class MAGNUM_EXPORT Context { /** * @brief Whether given OpenGL version is supported * - * @see supportedVersion(), MAGNUM_ASSERT_VERSION_SUPPORTED() + * @see @ref supportedVersion(), @ref MAGNUM_ASSERT_VERSION_SUPPORTED() */ bool isVersionSupported(Version version) const { return _version >= version; @@ -309,7 +310,7 @@ class MAGNUM_EXPORT Context { * @brief Get supported OpenGL version * * Returns first supported OpenGL version from passed list. Convenient - * equivalent to subsequent isVersionSupported() calls, e.g.: + * equivalent to subsequent @ref isVersionSupported() calls, e.g.: * @code * Version v = isVersionSupported(Version::GL330) ? Version::GL330 : Version::GL210; * Version v = supportedVersion({Version::GL330, Version::GL210}); @@ -325,8 +326,8 @@ class MAGNUM_EXPORT Context { /** * @brief Whether given extension is supported * - * %Extensions usable with this function are listed in Extensions - * namespace in header Extensions.h. Example usage: + * %Extensions usable with this function are listed in @ref Extensions + * namespace in header @ref Extensions.h. Example usage: * @code * if(Context::current()->isExtensionSupported()) { * // draw fancy detailed model @@ -335,8 +336,8 @@ class MAGNUM_EXPORT Context { * } * @endcode * - * @see isExtensionSupported(const Extension&) const, - * MAGNUM_ASSERT_EXTENSION_SUPPORTED() + * @see @ref isExtensionSupported(const Extension&) const, + * @ref MAGNUM_ASSERT_EXTENSION_SUPPORTED() */ template bool isExtensionSupported() const { return isVersionSupported(T::coreVersion()) || (isVersionSupported(T::requiredVersion()) && extensionStatus[T::Index]); @@ -368,8 +369,8 @@ class MAGNUM_EXPORT Context { * hardware, but for general usage prefer isExtensionSupported() const, * as it does most operations in compile time. * - * @see supportedExtensions(), Extension::extensions(), - * MAGNUM_ASSERT_EXTENSION_SUPPORTED() + * @see @ref supportedExtensions(), @ref Extension::extensions(), + * @ref MAGNUM_ASSERT_EXTENSION_SUPPORTED() */ bool isExtensionSupported(const Extension& extension) const { return isVersionSupported(extension._coreVersion) || (isVersionSupported(extension._requiredVersion) && extensionStatus[extension._index]); @@ -407,8 +408,8 @@ MAGNUM_ASSERT_VERSION_SUPPORTED(Version::GL330); @endcode @see @ref Magnum::Context::isVersionSupported() "Context::isVersionSupported()", - MAGNUM_ASSERT_EXTENSION_SUPPORTED(), CORRADE_ASSERT(), - CORRADE_INTERNAL_ASSERT() + @ref MAGNUM_ASSERT_EXTENSION_SUPPORTED(), @ref CORRADE_ASSERT(), + @ref CORRADE_INTERNAL_ASSERT() */ #ifdef CORRADE_NO_ASSERT #define MAGNUM_ASSERT_VERSION_SUPPORTED(version) do {} while(0) @@ -437,8 +438,8 @@ MAGNUM_ASSERT_EXTENSION_SUPPORTED(Extensions::GL::ARB::geometry_shader4); @endcode @see @ref Magnum::Context::isExtensionSupported() "Context::isExtensionSupported()", - MAGNUM_ASSERT_VERSION_SUPPORTED(), CORRADE_ASSERT(), - CORRADE_INTERNAL_ASSERT() + @ref MAGNUM_ASSERT_VERSION_SUPPORTED(), @ref CORRADE_ASSERT(), + @ref CORRADE_INTERNAL_ASSERT() */ #ifdef CORRADE_NO_ASSERT #define MAGNUM_ASSERT_EXTENSION_SUPPORTED(extension) do {} while(0) From 228ef24e573b12f0d9d258f07e9db5aa35c362b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 2 Dec 2013 01:58:18 +0100 Subject: [PATCH 100/105] Bumped minimal version of exts related to layout() GLSL qualifier to 1.50. Related to issue #27 -- layout() qualifier causes compiler errors on GLSL 1.40 (GL 3.1) on Mac OS X even that the extensions are marked as supported. Bumping the minimal required version disables the extensions on this versions, which should avoid the issue. It is not proper fix at all, but most of the GL3 implementations are now at least GL 3.2, so it shouldn't be too much of an issue. The only exception is Mesa (GL 2.1/3.1 on most of the machines), but we need to maintain GL 2.1 compatibility for it anyway. --- src/Extensions.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Extensions.h b/src/Extensions.h index 98b20519a..beef67726 100644 --- a/src/Extensions.h +++ b/src/Extensions.h @@ -100,7 +100,7 @@ namespace GL { _extension(GL,ARB,texture_query_lod, GL210, GL400) // #73 _extension(GL,ARB,texture_compression_bptc, GL310, GL420) // #77 _extension(GL,ARB,blend_func_extended, GL210, GL330) // #78 - _extension(GL,ARB,explicit_attrib_location, /*!*/ GL310, GL330) // #79 + _extension(GL,ARB,explicit_attrib_location, /*!*/ GL320, GL330) // #79 _extension(GL,ARB,occlusion_query2, GL210, GL330) // #80 _extension(GL,ARB,sampler_objects, GL210, GL330) // #81 _extension(GL,ARB,shader_bit_encoding, /*?*/ GL210, GL330) // #82 @@ -124,7 +124,7 @@ namespace GL { _extension(GL,ARB,viewport_array, GL210, GL410) // #100 _extension(GL,ARB,robustness, GL210, None) // #105 _extension(GL,ARB,base_instance, GL210, GL420) // #107 - _extension(GL,ARB,shading_language_420pack, /*!*/ GL310, GL420) // #108 + _extension(GL,ARB,shading_language_420pack, /*!*/ GL320, GL420) // #108 _extension(GL,ARB,transform_feedback_instanced, GL210, GL420) // #109 _extension(GL,ARB,compressed_texture_pixel_storage, GL210, GL420) // #110 _extension(GL,ARB,conservative_depth, GL300, GL420) // #111 @@ -141,7 +141,7 @@ namespace GL { _extension(GL,ARB,texture_view, GL210, GL430) // #124 _extension(GL,ARB,vertex_attrib_binding, GL210, GL430) // #125 _extension(GL,ARB,ES3_compatibility, GL330, GL430) // #127 - _extension(GL,ARB,explicit_uniform_location, /*!*/ GL310, GL430) // #128 + _extension(GL,ARB,explicit_uniform_location, /*!*/ GL320, GL430) // #128 _extension(GL,ARB,fragment_layer_viewport, GL300, GL430) // #129 _extension(GL,ARB,framebuffer_no_attachments, GL210, GL430) // #130 _extension(GL,ARB,internalformat_query2, GL210, GL430) // #131 @@ -268,14 +268,15 @@ namespace GL { Notes (marked with ! above) ARB_explicit_attrib_location, ARB_explicit_uniform_location don't work - with GLSL 1.20 (compiler error related to layout qualifier on Mesa) or 1.30 - (compiler error related to layout qualifier on NVidia), bumping minimal - required version to GL 3.1 even if both have *2.1* as minimal. + with GLSL 1.20 (compiler error related to layout qualifier on Mesa), 1.30 + (compiler error related to layout qualifier on NVidia) or 1.40 (compiler + error on Mac OS X), bumping minimal required version to GL 3.2 even if both + have *2.1* as minimal. ARB_shading_language_420pack (particularly sampler bindings) doesn't work - with GLSL 1.30 (compiler error related to layout qualifier, similar to the - above), bumping minimal required version to GL 3.1 even if it has *3.0* as - minimal. + with GLSL 1.40 (compiler error related to layout qualifier, similar to the + above), bumping minimal required version to GL 3.2 even that it has *3.0* + as minimal. */ } From be48953642d34dc2b8bd43197f4920caa80589cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 2 Dec 2013 02:21:43 +0100 Subject: [PATCH 101/105] SceneGraph: deinline Object constructor. Might save some generated code. --- src/SceneGraph/Object.h | 4 +--- src/SceneGraph/Object.hpp | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/SceneGraph/Object.h b/src/SceneGraph/Object.h index 733c4a786..5a442edea 100644 --- a/src/SceneGraph/Object.h +++ b/src/SceneGraph/Object.h @@ -117,9 +117,7 @@ template class MAGNUM_SCENEGRAPH_EXPORT Object: public Abs * @brief Constructor * @param parent Parent object */ - explicit Object(Object* parent = nullptr): counter(0xFFFFu), flags(Flag::Dirty) { - setParent(parent); - } + explicit Object(Object* parent = nullptr); /** * @brief Destructor diff --git a/src/SceneGraph/Object.hpp b/src/SceneGraph/Object.hpp index a234549dc..f9acc65b5 100644 --- a/src/SceneGraph/Object.hpp +++ b/src/SceneGraph/Object.hpp @@ -43,6 +43,10 @@ template AbstractObject::~Abstra template AbstractTransformation::AbstractTransformation() {} +template Object::Object(Object* parent): counter(0xFFFFu), flags(Flag::Dirty) { + setParent(parent); +} + template Object::~Object() = default; template Scene* Object::scene() { From c5d85166e0863254ca0d09f2d5803df2a7b2ce2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 2 Dec 2013 02:22:10 +0100 Subject: [PATCH 102/105] SceneGraph: mention that Int TranslationTransformation is also included. --- src/SceneGraph/Object.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SceneGraph/Object.h b/src/SceneGraph/Object.h index 5a442edea..3d5ab250e 100644 --- a/src/SceneGraph/Object.h +++ b/src/SceneGraph/Object.h @@ -90,6 +90,8 @@ class documentation or @ref compilation-speedup-hpp for more information. - @ref RigidMatrixTransformation3D "Object" - @ref TranslationTransformation2D "Object" - @ref TranslationTransformation3D "Object" +- @ref BasicTranslationTransformation2D "Object>" +- @ref BasicTranslationTransformation3D "Object>" @see @ref Scene, @ref AbstractFeature, @ref AbstractTransformation, @ref DebugTools::ObjectRenderer From 1d0bc114a6f3dcf08eef7067c5603f66ab962d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 2 Dec 2013 02:22:49 +0100 Subject: [PATCH 103/105] SceneGraph: allow creating TranslationTransformation only from Object. --- src/SceneGraph/TranslationTransformation.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/SceneGraph/TranslationTransformation.h b/src/SceneGraph/TranslationTransformation.h index 182078cdf..70baedfa1 100644 --- a/src/SceneGraph/TranslationTransformation.h +++ b/src/SceneGraph/TranslationTransformation.h @@ -110,6 +110,10 @@ class TranslationTransformation: public AbstractTranslation>&>(*this); } + protected: + /* Allow construction only from Object */ + explicit TranslationTransformation() = default; + private: void doResetTransformation() override final { resetTransformation(); } From 3df67b370f40d2adb13d9ebc7996e6898b8fedc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 2 Dec 2013 02:23:20 +0100 Subject: [PATCH 104/105] SceneGraph: fix TranslationTransformationTest on Windows. *.hpp files are probably not working as expected here, will fix that later. Added TODO for that. --- src/SceneGraph/Object.h | 1 + src/SceneGraph/Test/TranslationTransformationTest.cpp | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/SceneGraph/Object.h b/src/SceneGraph/Object.h index 3d5ab250e..b4b59b354 100644 --- a/src/SceneGraph/Object.h +++ b/src/SceneGraph/Object.h @@ -95,6 +95,7 @@ class documentation or @ref compilation-speedup-hpp for more information. @see @ref Scene, @ref AbstractFeature, @ref AbstractTransformation, @ref DebugTools::ObjectRenderer +@todo Test (and fix) that hpp works also on Windows */ template class MAGNUM_SCENEGRAPH_EXPORT Object: public AbstractObject, public Transformation #ifndef DOXYGEN_GENERATING_OUTPUT diff --git a/src/SceneGraph/Test/TranslationTransformationTest.cpp b/src/SceneGraph/Test/TranslationTransformationTest.cpp index ffff1aa74..801fd4b1e 100644 --- a/src/SceneGraph/Test/TranslationTransformationTest.cpp +++ b/src/SceneGraph/Test/TranslationTransformationTest.cpp @@ -28,9 +28,6 @@ #include "SceneGraph/TranslationTransformation.h" #include "SceneGraph/Scene.h" -/* For Object2Di */ -#include "SceneGraph/Object.hpp" - namespace Magnum { namespace SceneGraph { namespace Test { typedef Object Object2D; @@ -134,7 +131,7 @@ void TranslationTransformationTest::translate() { } void TranslationTransformationTest::integral() { - typedef Object> Object2Di; + typedef Object> Object2Di; Object2Di o; o.translate({3, -7}); From 2c97326d8d7bb232cc599d277355089522c045af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 2 Dec 2013 14:42:25 +0100 Subject: [PATCH 105/105] std::fstream accepts filename as std::string in C++11. Finally. --- src/Plugins/TgaImporter/TgaImporter.cpp | 2 +- src/Shader.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Plugins/TgaImporter/TgaImporter.cpp b/src/Plugins/TgaImporter/TgaImporter.cpp index 201939127..b4c55ef76 100644 --- a/src/Plugins/TgaImporter/TgaImporter.cpp +++ b/src/Plugins/TgaImporter/TgaImporter.cpp @@ -59,7 +59,7 @@ void TgaImporter::doOpenData(const Containers::ArrayReferencegood()) return; Error() << "Trade::TgaImporter::openFile(): cannot open file" << filename; diff --git a/src/Shader.cpp b/src/Shader.cpp index 4993c0f4b..e3a334c1b 100644 --- a/src/Shader.cpp +++ b/src/Shader.cpp @@ -605,7 +605,7 @@ Shader& Shader::addSource(std::string source) { Shader& Shader::addFile(const std::string& filename) { /* Open file */ - std::ifstream file(filename.c_str()); + std::ifstream file(filename); CORRADE_ASSERT(file.good(), "Shader file " << '\'' + filename + '\'' << " cannot be opened.", *this); /* Get size of shader and initialize buffer */